diff --git a/.eslintignore b/.eslintignore index 0ca61147f73c..a85b04f0c719 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,16 @@ **/node_modules +**/build +**/system-test +**/test/fixtures +**/samples/generated +**/.coverage **/coverage +**/baselines +**/baselines-esm +**/.test-out* test/fixtures build/ docs/ protos/ packages/ +**/types.d.ts diff --git a/.eslintrc.json b/.eslintrc.json index 4f9e1c4f2f1d..ab61da4fa66b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,20 +1,80 @@ { "extends": [ - "./node_modules/gts", + "gts", "plugin:prettier/recommended", "plugin:import/recommended", "plugin:import/typescript", "plugin:promise/recommended" ], "root": true, - // Note: All rules configured as "error" are blocking in the PR CI pipeline. - // Only rules configured as "warn" remain non-blocking. "rules": { "import/no-unresolved": "off", "import/no-extraneous-dependencies": "error", "promise/catch-or-return": "error", "promise/always-return": "error" }, + "overrides": [ + // The overrides below were migrated from handwritten/firestore/.eslintrc.json + // during monorepo ESLint consolidation to maintain Firestore-specific rules. + { + "files": ["handwritten/firestore/dev/src/**/*.ts"], + "excludedFiles": ["handwritten/firestore/dev/src/v1/*.ts", "handwritten/firestore/dev/src/v1beta1/*.ts"], + "parser": "@typescript-eslint/parser", + "rules": { + "@typescript-eslint/explicit-function-return-type": [ + "error", + { + "allowExpressions": true, + "allowTypedFunctionExpressions": true + } + ], + "no-console": ["error", {"allow": ["error"]}], + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_" + } + ] + } + }, + { + "files": ["handwritten/firestore/dev/test/*.ts", "handwritten/firestore/dev/system-test/*.ts"], + "parser": "@typescript-eslint/parser", + "rules": { + "no-restricted-properties": [ + "error", + { + "object": "describe", + "property": "only" + }, + { + "object": "it", + "property": "only" + } + ], + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_" + } + ], + "@typescript-eslint/no-floating-promises": "warn" + } + }, + { + "files": [ + "handwritten/firestore/dev/src/v1/**/*.ts", + "handwritten/firestore/dev/src/v1beta1/**/*.ts", + "handwritten/firestore/dev/test/gapic_firestore_v1.ts", + "handwritten/firestore/dev/test/gapic_firestore_admin_v1.ts", + "handwritten/firestore/dev/test/gapic_firestore_admin_v1.ts" + ], + "rules": { + "@typescript-eslint/no-explicit-any": ["off"], + "@typescript-eslint/no-floating-promises": ["off"] + } + } + ], "ignorePatterns": [ "**/node_modules", "**/build", diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index dc152e2bec88..8d57d62c60a1 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -34,12 +34,14 @@ jobs: steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 with: - fetch-depth: 300 + fetch-depth: 2 persist-credentials: false - name: Use Node.js 24 uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 with: node-version: 24 - run: npm install - - run: npm run lint + - run: node ./bin/linter.mjs --strict name: Run monorepo linter + env: + GIT_DIFF_ARG: "HEAD^1...HEAD" diff --git a/bin/linter.mjs b/bin/linter.mjs index bd9a976ca944..ee25bb9de4b3 100755 --- a/bin/linter.mjs +++ b/bin/linter.mjs @@ -17,16 +17,20 @@ import {existsSync} from 'fs'; import path from 'path'; import {promisify} from 'util'; import {ESLint} from 'eslint'; -import ts from 'typescript'; -// --- Globals & Promisified API Wrappers --- const execFileAsync = promisify(execFile); const tsconfigCache = new Map(); // --- Main Runner (Entry Point) --- async function run() { try { - const changedTsFiles = getChangedFiles(); + const isStrict = Boolean(process.argv.includes('--strict')); + let changedTsFiles; + if (isStrict) { + changedTsFiles = getChangedFilesStrict(); + } else { + changedTsFiles = getChangedFiles(); + } if (changedTsFiles.length === 0) { console.log('No TypeScript files changed. Skipping checks.'); @@ -63,6 +67,50 @@ function runGit(args, options = {}) { }); } +function getChangedFilesStrict() { + let gitDiffArg = process.env.GIT_DIFF_ARG; + + if (!gitDiffArg) { + throw new Error( + 'Strict mode is enabled, but GIT_DIFF_ARG environment variable or --git-diff-arg flag was not provided. ' + + 'Please set the GIT_DIFF_ARG environment variable or provide --git-diff-arg .' + ); + } + + // If a single ref is provided (e.g. "HEAD^1" or "origin/main"), convert to three-dot diff ("ref...HEAD") + // to compare against the merge-base and avoid listing files modified on the base branch. + if (!gitDiffArg.includes('..')) { + gitDiffArg = `${gitDiffArg}...HEAD`; + } + + console.log(`Strict mode enabled. Comparing using GIT_DIFF_ARG: ${gitDiffArg}`); + + const args = gitDiffArg.trim().split(/\s+/); + + try { + const output = runGit([ + 'diff', + '--name-only', + '--diff-filter=ACMRT', + ...args, + '--', + '*.ts', + ]); + return output + .split('\n') + .map(f => f.trim()) + .filter(f => f.length > 0 && existsSync(f)); + } catch (err) { + if (err.status !== 1) { + throw new Error( + `Strict mode error: git diff ${gitDiffArg} failed with exit code ${err.status}.\n` + + `Ensure that the git reference '${gitDiffArg}' exists locally and that you have fetched the required commits/branches.\n` + + `Details: ${String(err.stderr || err.message || '').trim()}` + ); + } + } +} + /** * Returns a list of changed TypeScript files comparing against target branches/references. */ @@ -79,11 +127,12 @@ function getChangedFiles() { for (const ref of refsToTry) { try { + const diffRef = ref.includes('..') ? ref : `${ref}...HEAD`; const output = runGit([ 'diff', '--name-only', '--diff-filter=ACMRT', - ref, + diffRef, '--', '*.ts', ]); @@ -126,37 +175,59 @@ async function checkEslint(filesToCheck) { return true; } - try { - const eslint = new ESLint(); - const results = await eslint.lintFiles(filesToCheck); - const formatter = await eslint.loadFormatter('stylish'); - const resultText = formatter.format(results); - - if (resultText) { - console.log(resultText); + // Group files by package directory to set tsconfigRootDir properly for typescript-eslint + const filesByPkg = new Map(); + for (const file of filesToCheck) { + const pkgDir = findTsconfigDir(file) || process.cwd(); + if (!filesByPkg.has(pkgDir)) { + filesByPkg.set(pkgDir, []); } + filesByPkg.get(pkgDir).push(file); + } - let hasBlockingErrors = false; + let hasBlockingErrors = false; - for (const fileResult of results) { - for (const message of fileResult.messages) { - // message.severity === 2 indicates an error-level rule configuration. - if (message.severity === 2) { - hasBlockingErrors = true; - } + for (const [pkgDir, files] of filesByPkg.entries()) { + try { + const absPkgDir = path.resolve(pkgDir); + const eslint = new ESLint({ + cwd: absPkgDir, + resolvePluginsRelativeTo: process.cwd(), + overrideConfig: { + parserOptions: { + tsconfigRootDir: absPkgDir, + }, + }, + }); + + const relativeFiles = files.map(f => path.relative(absPkgDir, path.resolve(f))); + const results = await eslint.lintFiles(relativeFiles); + const formatter = await eslint.loadFormatter('stylish'); + const resultText = formatter.format(results); + + if (resultText) { + console.log(resultText); } - } - if (hasBlockingErrors) { - console.error('\n[ERROR] ESLint violations were detected.'); - return false; + for (const fileResult of results) { + for (const message of fileResult.messages) { + if (message.severity === 2) { + hasBlockingErrors = true; + } + } + } + } catch (err) { + console.error(`\n[ERROR] Failed running ESLint in ${pkgDir}:`, err.message); + hasBlockingErrors = true; } + } - return true; - } catch (err) { - console.error('\n[ERROR] Failed running ESLint:', err.message); + if (hasBlockingErrors) { + console.error('\n[ERROR] ESLint violations were detected.'); return false; } + + return true; } // --- TypeScript Type Checker --- @@ -166,14 +237,23 @@ async function checkEslint(filesToCheck) { * Caches directories to avoid redundant disk operations. */ function findTsconfigDir(filePath) { - const dir = path.dirname(filePath); - if (tsconfigCache.has(dir)) { - return tsconfigCache.get(dir); + let currentDir = path.resolve(path.dirname(filePath)); + const root = path.parse(currentDir).root; + + while (currentDir && currentDir !== root) { + if (tsconfigCache.has(currentDir)) { + return tsconfigCache.get(currentDir); + } + const candidate = path.join(currentDir, 'tsconfig.json'); + if (existsSync(candidate)) { + tsconfigCache.set(path.dirname(filePath), currentDir); + return currentDir; + } + currentDir = path.dirname(currentDir); } - const configPath = ts.findConfigFile(dir, ts.sys.fileExists); - const result = configPath ? path.dirname(configPath) : null; - tsconfigCache.set(dir, result); - return result; + + tsconfigCache.set(path.dirname(filePath), null); + return null; } /** diff --git a/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json b/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json index f95bb333f0d7..b2eaa06fb89c 100644 --- a/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json +++ b/core/dev-packages/pack-n-play/test/fixtures/leaky/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts/" + "extends": "gts" } diff --git a/core/generator/gapic-generator-typescript/.eslintrc.json b/core/generator/gapic-generator-typescript/.eslintrc.json index eb6fa04d6bf5..5763334a168f 100644 --- a/core/generator/gapic-generator-typescript/.eslintrc.json +++ b/core/generator/gapic-generator-typescript/.eslintrc.json @@ -10,5 +10,4 @@ "**/.coverage", "**/coverage" ] -} - \ No newline at end of file +} \ No newline at end of file diff --git a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json index 782153495464..b2eaa06fb89c 100644 --- a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json +++ b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2-nodejs/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts" + "extends": "gts" } diff --git a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json index 782153495464..b2eaa06fb89c 100644 --- a/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json +++ b/core/generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks-nodejs/tasks-v2beta2-nodejs/.eslintrc.json @@ -1,3 +1,3 @@ { - "extends": "./node_modules/gts" + "extends": "gts" } diff --git a/core/packages/gaxios/.eslintrc.json b/core/packages/gaxios/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/gaxios/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/google-auth-library-nodejs/.eslintrc.json b/core/packages/google-auth-library-nodejs/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/google-auth-library-nodejs/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/logging-utils/.eslintrc.json b/core/packages/logging-utils/.eslintrc.json deleted file mode 100644 index 3e8d97ccb390..000000000000 --- a/core/packages/logging-utils/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/core/packages/nodejs-googleapis-common/.eslintrc.json b/core/packages/nodejs-googleapis-common/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/nodejs-googleapis-common/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/nodejs-proto-files/.eslintrc.json b/core/packages/nodejs-proto-files/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/nodejs-proto-files/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/retry-request/.eslintrc.json b/core/packages/retry-request/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/retry-request/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/teeny-request/.eslintrc.json b/core/packages/teeny-request/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/core/packages/teeny-request/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/core/packages/tools/.eslintrc.json b/core/packages/tools/.eslintrc.json deleted file mode 100644 index 3e8d97ccb390..000000000000 --- a/core/packages/tools/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/handwritten/bigquery-storage/.eslintrc.json b/handwritten/bigquery-storage/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/bigquery-storage/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/bigquery/.eslintignore b/handwritten/bigquery/.eslintignore index 87a018350591..ea5b04aebe68 100644 --- a/handwritten/bigquery/.eslintignore +++ b/handwritten/bigquery/.eslintignore @@ -5,4 +5,3 @@ build/ docs/ protos/ samples/generated/ -system-test/fixtures diff --git a/handwritten/bigquery/.eslintrc.json b/handwritten/bigquery/.eslintrc.json index 3e8d97ccb390..782153495464 100644 --- a/handwritten/bigquery/.eslintrc.json +++ b/handwritten/bigquery/.eslintrc.json @@ -1,4 +1,3 @@ { - "extends": "./node_modules/gts", - "root": true + "extends": "./node_modules/gts" } diff --git a/core/packages/gax/.eslintrc.json b/handwritten/bigtable/.eslintrc.json similarity index 100% rename from core/packages/gax/.eslintrc.json rename to handwritten/bigtable/.eslintrc.json diff --git a/handwritten/cloud-profiler/.eslintrc.json b/handwritten/cloud-profiler/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/cloud-profiler/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/cloud-profiler/package.json b/handwritten/cloud-profiler/package.json index c5e3a3ceedfc..f5a1bbbc1eb6 100644 --- a/handwritten/cloud-profiler/package.json +++ b/handwritten/cloud-profiler/package.json @@ -55,7 +55,7 @@ "@types/pretty-ms": "^5.0.0", "@types/sinon": "^17.0.0", "@types/tmp": "0.2.6", - "c8": "^9.0.0", + "c8": "^10.1.3", "codecov": "^3.0.0", "gts": "^5.0.0", "js-green-licenses": "^4.0.0", @@ -63,7 +63,7 @@ "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", "long": "^5.3.2", - "mocha": "^9.2.2", + "mocha": "^11.1.0", "nock": "^13.0.0", "node-gyp": "^11.5.0", "sinon": "^18.0.0", diff --git a/handwritten/datastore/.eslintrc.json b/handwritten/datastore/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/datastore/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/error-reporting/.eslintrc.json b/handwritten/error-reporting/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/error-reporting/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/firestore/.eslintrc.json b/handwritten/firestore/.eslintrc.json deleted file mode 100644 index 13e75f0cfca0..000000000000 --- a/handwritten/firestore/.eslintrc.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "root": true, - "extends": "./node_modules/gts", - "overrides": [ - { - "files": ["dev/src/**/*.ts"], - "excludedFiles": ["dev/src/v1/*.ts", "dev/src/v1beta1/*.ts"], - "parser": "@typescript-eslint/parser", - "rules": { - "@typescript-eslint/explicit-function-return-type": [ - "error", - { - "allowExpressions": true, - "allowTypedFunctionExpressions": true - } - ], - "no-console": ["error", {"allow": ["error"]}], - "@typescript-eslint/no-unused-vars": [ - "warn", - { - // Allow args to be unused if they start with an underscore - "argsIgnorePattern": "^_" - } - ] - } - }, - { - "files": ["dev/test/*.ts", "dev/system-test/*.ts"], - "parser": "@typescript-eslint/parser", - "rules": { - "no-restricted-properties": [ - "error", - { - "object": "describe", - "property": "only" - }, - { - "object": "it", - "property": "only" - } - ], - "@typescript-eslint/no-unused-vars": [ - "warn", - { - // Allow args to be unused if they start with an underscore - "argsIgnorePattern": "^_" - } - ], - "@typescript-eslint/no-floating-promises": "warn" - } - }, - { - "files": [ - "dev/src/v1/**/*.ts", - "dev/src/v1beta1/**/*.ts", - "dev/test/gapic_firestore_v1.ts", - "dev/test/gapic_firestore_admin_v1.ts", - "dev/test/gapic_firestore_admin_v1.ts" - ], - "rules": { - "@typescript-eslint/no-explicit-any": ["off"], - "@typescript-eslint/no-floating-promises": ["off"] - } - } - ] -} diff --git a/handwritten/logging-bunyan/.eslintrc.json b/handwritten/logging-bunyan/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/logging-bunyan/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/logging-winston/.eslintrc.json b/handwritten/logging-winston/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/logging-winston/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/logging/.eslintrc.json b/handwritten/logging/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/logging/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/logging/package.json b/handwritten/logging/package.json index 2bc3118963f1..72a0fef66ea0 100644 --- a/handwritten/logging/package.json +++ b/handwritten/logging/package.json @@ -82,7 +82,7 @@ "@types/pumpify": "^1.4.1", "@types/sinon": "^10.0.0", "bignumber.js": "^9.0.0", - "c8": "^9.0.0", + "c8": "^10.1.3", "codecov": "^3.6.5", "cross-env": "^7.0.3", "gapic-tools": "^0.4.0", @@ -91,7 +91,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "mocha": "^9.2.2", + "mocha": "^11.1.0", "nock": "^13.0.0", "null-loader": "^4.0.0", "pack-n-play": "^2.0.0", diff --git a/handwritten/pubsub/.eslintrc.json b/handwritten/pubsub/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/pubsub/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/handwritten/spanner-driver/.eslintrc.json b/handwritten/spanner-driver/.eslintrc.json deleted file mode 100644 index aa462ccc3ae7..000000000000 --- a/handwritten/spanner-driver/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": "./node_modules/gts" -} diff --git a/handwritten/spanner/.eslintrc.json b/handwritten/spanner/.eslintrc.json deleted file mode 100644 index aa462ccc3ae7..000000000000 --- a/handwritten/spanner/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "root": true, - "extends": "./node_modules/gts" -} diff --git a/handwritten/spanner/protos/protos.js b/handwritten/spanner/protos/protos.js index 5064844638f6..0ee51170eecd 100644 --- a/handwritten/spanner/protos/protos.js +++ b/handwritten/spanner/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_spanner_protos || ($protobuf.roots._google_cloud_spanner_protos = {}); + var $root = $protobuf.roots["_google_cloud_spanner_protos"] || ($protobuf.roots["_google_cloud_spanner_protos"] = {}); $root.google = (function() { @@ -110,9 +110,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -130,7 +134,7 @@ * @returns {$protobuf.Writer} Writer */ Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -204,10 +208,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "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 (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) if (!$util.isInteger(message.nanos)) return "nanos: integer expected"; return null; @@ -224,6 +228,8 @@ Duration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Duration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Duration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -231,7 +237,7 @@ var message = new $root.google.protobuf.Duration(); if (object.seconds != null) if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + message.seconds = $util.Long.fromValue(object.seconds, false); else if (typeof object.seconds === "string") message.seconds = parseInt(object.seconds, 10); else if (typeof object.seconds === "number") @@ -252,24 +258,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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; + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.seconds = options.longs === String ? "0" : 0; + object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.nanos = 0; } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); + else 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")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) object.nanos = message.nanos; return object; }; @@ -357,12 +369,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorSet.encode = function encode(message, writer) { + FileDescriptorSet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -376,7 +392,7 @@ * @returns {$protobuf.Writer} Writer */ FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -448,7 +464,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.file != null && message.hasOwnProperty("file")) { + if (message.file != null && Object.hasOwnProperty.call(message, "file")) { if (!Array.isArray(message.file)) return "file: array expected"; for (var i = 0; i < message.file.length; ++i) { @@ -471,6 +487,8 @@ FileDescriptorSet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FileDescriptorSet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileDescriptorSet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -481,7 +499,7 @@ 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") + if (!$util.isObject(object.file[i])) throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i], long + 1); } @@ -498,16 +516,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorSet.toObject = function toObject(message, options) { + FileDescriptorSet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options, q + 1); } return object; }; @@ -753,9 +775,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileDescriptorProto.encode = function encode(message, writer) { + FileDescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -765,20 +791,20 @@ 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(); + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).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(); + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).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(); + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).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(); + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).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(); + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).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(); + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).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]); @@ -805,7 +831,7 @@ * @returns {$protobuf.Writer} Writer */ FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -953,41 +979,41 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) if (!$util.isString(message["package"])) return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (message.dependency != null && Object.hasOwnProperty.call(message, "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 (message.publicDependency != null && Object.hasOwnProperty.call(message, "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 (message.weakDependency != null && Object.hasOwnProperty.call(message, "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 (message.optionDependency != null && Object.hasOwnProperty.call(message, "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 (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { if (!Array.isArray(message.messageType)) return "messageType: array expected"; for (var i = 0; i < message.messageType.length; ++i) { @@ -996,7 +1022,7 @@ return "messageType." + error; } } - if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { @@ -1005,7 +1031,7 @@ return "enumType." + error; } } - if (message.service != null && message.hasOwnProperty("service")) { + if (message.service != null && Object.hasOwnProperty.call(message, "service")) { if (!Array.isArray(message.service)) return "service: array expected"; for (var i = 0; i < message.service.length; ++i) { @@ -1014,7 +1040,7 @@ return "service." + error; } } - if (message.extension != null && message.hasOwnProperty("extension")) { + if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { @@ -1023,20 +1049,20 @@ return "extension." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.FileOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) { var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo, long + 1); if (error) return "sourceCodeInfo." + error; } - if (message.syntax != null && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) if (!$util.isString(message.syntax)) return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -1068,6 +1094,8 @@ FileDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FileDescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -1110,7 +1138,7 @@ 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") + if (!$util.isObject(object.messageType[i])) throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i], long + 1); } @@ -1120,7 +1148,7 @@ 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") + if (!$util.isObject(object.enumType[i])) throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); } @@ -1130,7 +1158,7 @@ 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") + if (!$util.isObject(object.service[i])) throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i], long + 1); } @@ -1140,18 +1168,18 @@ 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") + if (!$util.isObject(object.extension[i])) throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); } } if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FileOptions.fromObject(object.options, long + 1); } if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") + if (!$util.isObject(object.sourceCodeInfo)) throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo, long + 1); } @@ -1225,9 +1253,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileDescriptorProto.toObject = function toObject(message, options) { + FileDescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.dependency = []; @@ -1247,9 +1279,9 @@ object.syntax = ""; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) object["package"] = message["package"]; if (message.dependency && message.dependency.length) { object.dependency = []; @@ -1259,27 +1291,27 @@ 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); + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options, q + 1); } 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); + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options, q + 1); } 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); + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options, q + 1); } 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); + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options, q + 1); } - 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.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options, q + 1); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options, q + 1); if (message.publicDependency && message.publicDependency.length) { object.publicDependency = []; for (var j = 0; j < message.publicDependency.length; ++j) @@ -1290,9 +1322,9 @@ for (var j = 0; j < message.weakDependency.length; ++j) object.weakDependency[j] = message.weakDependency[j]; } - if (message.syntax != null && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "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 = []; @@ -1482,34 +1514,38 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DescriptorProto.encode = function encode(message, writer) { + DescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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(); + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).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(); + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).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(); + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).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(); + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).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(); + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).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(); + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).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(); + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).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]); @@ -1528,7 +1564,7 @@ * @returns {$protobuf.Writer} Writer */ DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -1654,10 +1690,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { + if (message.field != null && Object.hasOwnProperty.call(message, "field")) { if (!Array.isArray(message.field)) return "field: array expected"; for (var i = 0; i < message.field.length; ++i) { @@ -1666,7 +1702,7 @@ return "field." + error; } } - if (message.extension != null && message.hasOwnProperty("extension")) { + if (message.extension != null && Object.hasOwnProperty.call(message, "extension")) { if (!Array.isArray(message.extension)) return "extension: array expected"; for (var i = 0; i < message.extension.length; ++i) { @@ -1675,7 +1711,7 @@ return "extension." + error; } } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (message.nestedType != null && Object.hasOwnProperty.call(message, "nestedType")) { if (!Array.isArray(message.nestedType)) return "nestedType: array expected"; for (var i = 0; i < message.nestedType.length; ++i) { @@ -1684,7 +1720,7 @@ return "nestedType." + error; } } - if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) { if (!Array.isArray(message.enumType)) return "enumType: array expected"; for (var i = 0; i < message.enumType.length; ++i) { @@ -1693,7 +1729,7 @@ return "enumType." + error; } } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (message.extensionRange != null && Object.hasOwnProperty.call(message, "extensionRange")) { if (!Array.isArray(message.extensionRange)) return "extensionRange: array expected"; for (var i = 0; i < message.extensionRange.length; ++i) { @@ -1702,7 +1738,7 @@ return "extensionRange." + error; } } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (message.oneofDecl != null && Object.hasOwnProperty.call(message, "oneofDecl")) { if (!Array.isArray(message.oneofDecl)) return "oneofDecl: array expected"; for (var i = 0; i < message.oneofDecl.length; ++i) { @@ -1711,12 +1747,12 @@ return "oneofDecl." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.MessageOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { @@ -1725,14 +1761,14 @@ return "reservedRange." + error; } } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (message.reservedName != null && Object.hasOwnProperty.call(message, "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")) + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) switch (message.visibility) { default: return "visibility: enum value expected"; @@ -1755,6 +1791,8 @@ DescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.DescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -1767,7 +1805,7 @@ 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") + if (!$util.isObject(object.field[i])) throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i], long + 1); } @@ -1777,7 +1815,7 @@ 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") + if (!$util.isObject(object.extension[i])) throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i], long + 1); } @@ -1787,7 +1825,7 @@ 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") + if (!$util.isObject(object.nestedType[i])) throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i], long + 1); } @@ -1797,7 +1835,7 @@ 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") + if (!$util.isObject(object.enumType[i])) throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i], long + 1); } @@ -1807,7 +1845,7 @@ 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") + if (!$util.isObject(object.extensionRange[i])) throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i], long + 1); } @@ -1817,13 +1855,13 @@ 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") + if (!$util.isObject(object.oneofDecl[i])) throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i], long + 1); } } if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); message.options = $root.google.protobuf.MessageOptions.fromObject(object.options, long + 1); } @@ -1832,7 +1870,7 @@ 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") + if (!$util.isObject(object.reservedRange[i])) throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i], long + 1); } @@ -1876,9 +1914,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DescriptorProto.toObject = function toObject(message, options) { + DescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.field = []; @@ -1895,51 +1937,51 @@ object.options = null; object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "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); + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options, q + 1); } 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); + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options, q + 1); } 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); + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options, q + 1); } 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); + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options, q + 1); } 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); + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options, q + 1); } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options, q + 1); 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); + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options, q + 1); } 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); + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options, q + 1); } 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")) + if (message.visibility != null && Object.hasOwnProperty.call(message, "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; }; @@ -2041,15 +2083,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRange.encode = function encode(message, writer) { + ExtensionRange.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -2063,7 +2109,7 @@ * @returns {$protobuf.Writer} Writer */ ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -2141,13 +2187,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) if (!$util.isInteger(message.start)) return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) if (!$util.isInteger(message.end)) return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -2166,6 +2212,8 @@ ExtensionRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -2176,7 +2224,7 @@ if (object.end != null) message.end = object.end | 0; if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options, long + 1); } @@ -2192,21 +2240,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRange.toObject = function toObject(message, options) { + ExtensionRange.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.start = 0; object.end = 0; object.options = null; } - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options, q + 1); return object; }; @@ -2301,9 +2353,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReservedRange.encode = function encode(message, writer) { + ReservedRange.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -2321,7 +2377,7 @@ * @returns {$protobuf.Writer} Writer */ ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -2395,10 +2451,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) if (!$util.isInteger(message.start)) return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; @@ -2415,6 +2471,8 @@ ReservedRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DescriptorProto.ReservedRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -2436,17 +2494,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReservedRange.toObject = function toObject(message, options) { + ReservedRange.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) object.end = message.end; return object; }; @@ -2565,19 +2627,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRangeOptions.encode = function encode(message, writer) { + ExtensionRangeOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); return writer; }; @@ -2591,7 +2657,7 @@ * @returns {$protobuf.Writer} Writer */ ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -2677,7 +2743,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -2686,7 +2752,7 @@ return "uninterpretedOption." + error; } } - if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (message.declaration != null && Object.hasOwnProperty.call(message, "declaration")) { if (!Array.isArray(message.declaration)) return "declaration: array expected"; for (var i = 0; i < message.declaration.length; ++i) { @@ -2695,12 +2761,12 @@ return "declaration." + error; } } - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.verification != null && message.hasOwnProperty("verification")) + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) switch (message.verification) { default: return "verification: enum value expected"; @@ -2722,6 +2788,8 @@ ExtensionRangeOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ExtensionRangeOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -2732,7 +2800,7 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } @@ -2742,13 +2810,13 @@ 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") + if (!$util.isObject(object.declaration[i])) throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i], long + 1); } } if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -2780,9 +2848,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRangeOptions.toObject = function toObject(message, options) { + ExtensionRangeOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.declaration = []; @@ -2795,16 +2867,16 @@ 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); + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options, q + 1); } - if (message.verification != null && message.hasOwnProperty("verification")) + if (message.verification != null && Object.hasOwnProperty.call(message, "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.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } return object; }; @@ -2924,9 +2996,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Declaration.encode = function encode(message, writer) { + Declaration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -2950,7 +3026,7 @@ * @returns {$protobuf.Writer} Writer */ Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -3036,19 +3112,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) if (!$util.isInteger(message.number)) return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) if (!$util.isString(message.fullName)) return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) if (typeof message.reserved !== "boolean") return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) if (typeof message.repeated !== "boolean") return "repeated: boolean expected"; return null; @@ -3065,6 +3141,8 @@ Declaration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.Declaration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3092,9 +3170,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Declaration.toObject = function toObject(message, options) { + Declaration.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.number = 0; @@ -3103,15 +3185,15 @@ object.reserved = false; object.repeated = false; } - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) object.repeated = message.repeated; return object; }; @@ -3305,9 +3387,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldDescriptorProto.encode = function encode(message, writer) { + FieldDescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -3323,7 +3409,7 @@ 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(); + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).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")) @@ -3343,7 +3429,7 @@ * @returns {$protobuf.Writer} Writer */ FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -3453,13 +3539,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) if (!$util.isInteger(message.number)) return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) switch (message.label) { default: return "label: enum value expected"; @@ -3468,7 +3554,7 @@ case 2: break; } - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) switch (message.type) { default: return "type: enum value expected"; @@ -3492,27 +3578,27 @@ case 18: break; } - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) if (!$util.isString(message.typeName)) return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) if (!$util.isString(message.extendee)) return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) if (!$util.isString(message.defaultValue)) return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) if (!$util.isInteger(message.oneofIndex)) return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) if (!$util.isString(message.jsonName)) return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.FieldOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) if (typeof message.proto3Optional !== "boolean") return "proto3Optional: boolean expected"; return null; @@ -3529,6 +3615,8 @@ FieldDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldDescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3649,7 +3737,7 @@ if (object.jsonName != null) message.jsonName = String(object.jsonName); if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); message.options = $root.google.protobuf.FieldOptions.fromObject(object.options, long + 1); } @@ -3667,9 +3755,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldDescriptorProto.toObject = function toObject(message, options) { + FieldDescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -3684,27 +3776,27 @@ object.jsonName = ""; object.proto3Optional = false; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "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")) + if (message.type != null && Object.hasOwnProperty.call(message, "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")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "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")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options, q + 1); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) object.proto3Optional = message.proto3Optional; return object; }; @@ -3862,13 +3954,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofDescriptorProto.encode = function encode(message, writer) { + OneofDescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -3882,7 +3978,7 @@ * @returns {$protobuf.Writer} Writer */ OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -3956,10 +4052,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.OneofOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -3978,6 +4074,8 @@ OneofDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.OneofDescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.OneofDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3986,7 +4084,7 @@ if (object.name != null) message.name = String(object.name); if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); message.options = $root.google.protobuf.OneofOptions.fromObject(object.options, long + 1); } @@ -4002,18 +4100,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofDescriptorProto.toObject = function toObject(message, options) { + OneofDescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.options = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options, q + 1); return object; }; @@ -4147,19 +4249,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumDescriptorProto.encode = function encode(message, writer) { + EnumDescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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(); + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).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(); + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).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]); @@ -4178,7 +4284,7 @@ * @returns {$protobuf.Writer} Writer */ EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -4274,10 +4380,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { if (!Array.isArray(message.value)) return "value: array expected"; for (var i = 0; i < message.value.length; ++i) { @@ -4286,12 +4392,12 @@ return "value." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.EnumOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (message.reservedRange != null && Object.hasOwnProperty.call(message, "reservedRange")) { if (!Array.isArray(message.reservedRange)) return "reservedRange: array expected"; for (var i = 0; i < message.reservedRange.length; ++i) { @@ -4300,14 +4406,14 @@ return "reservedRange." + error; } } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (message.reservedName != null && Object.hasOwnProperty.call(message, "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")) + if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) switch (message.visibility) { default: return "visibility: enum value expected"; @@ -4330,6 +4436,8 @@ EnumDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumDescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -4342,13 +4450,13 @@ 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") + if (!$util.isObject(object.value[i])) throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i], long + 1); } } if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumOptions.fromObject(object.options, long + 1); } @@ -4357,7 +4465,7 @@ 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") + if (!$util.isObject(object.reservedRange[i])) throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i], long + 1); } @@ -4401,9 +4509,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumDescriptorProto.toObject = function toObject(message, options) { + EnumDescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.value = []; @@ -4415,26 +4527,26 @@ object.options = null; object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "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); + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options, q + 1); } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options, q + 1); 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); + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options, q + 1); } 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")) + if (message.visibility != null && Object.hasOwnProperty.call(message, "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; }; @@ -4527,9 +4639,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumReservedRange.encode = function encode(message, writer) { + EnumReservedRange.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -4547,7 +4663,7 @@ * @returns {$protobuf.Writer} Writer */ EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -4621,10 +4737,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) if (!$util.isInteger(message.start)) return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) if (!$util.isInteger(message.end)) return "end: integer expected"; return null; @@ -4641,6 +4757,8 @@ EnumReservedRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumDescriptorProto.EnumReservedRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -4662,17 +4780,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumReservedRange.toObject = function toObject(message, options) { + EnumReservedRange.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.start = 0; object.end = 0; } - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) object.end = message.end; return object; }; @@ -4780,15 +4902,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueDescriptorProto.encode = function encode(message, writer) { + EnumValueDescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -4802,7 +4928,7 @@ * @returns {$protobuf.Writer} Writer */ EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -4880,13 +5006,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) if (!$util.isInteger(message.number)) return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.EnumValueOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -4905,6 +5031,8 @@ EnumValueDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumValueDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -4915,7 +5043,7 @@ if (object.number != null) message.number = object.number | 0; if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options, long + 1); } @@ -4931,21 +5059,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { + EnumValueDescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.number = 0; object.options = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options, q + 1); return object; }; @@ -5050,16 +5182,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceDescriptorProto.encode = function encode(message, writer) { + ServiceDescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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(); + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -5073,7 +5209,7 @@ * @returns {$protobuf.Writer} Writer */ ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -5153,10 +5289,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { + if (message.method != null && Object.hasOwnProperty.call(message, "method")) { if (!Array.isArray(message.method)) return "method: array expected"; for (var i = 0; i < message.method.length; ++i) { @@ -5165,7 +5301,7 @@ return "method." + error; } } - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.ServiceOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -5184,6 +5320,8 @@ ServiceDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ServiceDescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ServiceDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -5196,13 +5334,13 @@ 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") + if (!$util.isObject(object.method[i])) throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i], long + 1); } } if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options, long + 1); } @@ -5218,9 +5356,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceDescriptorProto.toObject = function toObject(message, options) { + ServiceDescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.method = []; @@ -5228,15 +5370,15 @@ object.name = ""; object.options = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "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); + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options, q + 1); } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options, q + 1); return object; }; @@ -5367,9 +5509,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodDescriptorProto.encode = function encode(message, writer) { + MethodDescriptorProto.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -5377,7 +5523,7 @@ 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(); + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).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")) @@ -5395,7 +5541,7 @@ * @returns {$protobuf.Writer} Writer */ MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -5485,24 +5631,24 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) if (!$util.isString(message.inputType)) return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) if (!$util.isString(message.outputType)) return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.protobuf.MethodOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) if (typeof message.clientStreaming !== "boolean") return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) if (typeof message.serverStreaming !== "boolean") return "serverStreaming: boolean expected"; return null; @@ -5519,6 +5665,8 @@ MethodDescriptorProto.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.MethodDescriptorProto) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MethodDescriptorProto: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -5531,7 +5679,7 @@ if (object.outputType != null) message.outputType = String(object.outputType); if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); message.options = $root.google.protobuf.MethodOptions.fromObject(object.options, long + 1); } @@ -5551,9 +5699,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodDescriptorProto.toObject = function toObject(message, options) { + MethodDescriptorProto.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -5563,17 +5715,17 @@ object.clientStreaming = false; object.serverStreaming = false; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "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")) + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options, q + 1); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) object.serverStreaming = message.serverStreaming; return object; }; @@ -5851,9 +6003,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileOptions.encode = function encode(message, writer) { + FileOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -5893,13 +6049,13 @@ 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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).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(); + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork(), q + 1).ldelim(); return writer; }; @@ -5913,7 +6069,7 @@ * @returns {$protobuf.Writer} Writer */ FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -6071,22 +6227,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) if (!$util.isString(message.javaPackage)) return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) if (!$util.isString(message.javaOuterClassname)) return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) if (typeof message.javaMultipleFiles !== "boolean") return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) if (typeof message.javaGenerateEqualsAndHash !== "boolean") return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) if (typeof message.javaStringCheckUtf8 !== "boolean") return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) switch (message.optimizeFor) { default: return "optimizeFor: enum value expected"; @@ -6095,51 +6251,51 @@ case 3: break; } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) if (!$util.isString(message.goPackage)) return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) if (typeof message.ccGenericServices !== "boolean") return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) if (typeof message.javaGenericServices !== "boolean") return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) if (typeof message.pyGenericServices !== "boolean") return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) if (typeof message.ccEnableArenas !== "boolean") return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) if (!$util.isString(message.objcClassPrefix)) return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) if (!$util.isString(message.csharpNamespace)) return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) if (!$util.isString(message.swiftPrefix)) return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) if (!$util.isString(message.phpClassPrefix)) return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) if (!$util.isString(message.phpNamespace)) return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) if (!$util.isString(message.phpMetadataNamespace)) return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) if (!$util.isString(message.rubyPackage)) return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -6148,7 +6304,7 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (message[".google.api.resourceDefinition"] != null && Object.hasOwnProperty.call(message, ".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) { @@ -6171,6 +6327,8 @@ FileOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FileOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FileOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6233,7 +6391,7 @@ if (object.rubyPackage != null) message.rubyPackage = String(object.rubyPackage); if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.FileOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -6242,7 +6400,7 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } @@ -6252,7 +6410,7 @@ 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") + if (!$util.isObject(object[".google.api.resourceDefinition"][i])) 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], long + 1); } @@ -6269,9 +6427,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileOptions.toObject = function toObject(message, options) { + FileOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; @@ -6299,55 +6461,55 @@ object.rubyPackage = ""; object.features = null; } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "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")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } 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); + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options, q + 1); } return object; }; @@ -6514,9 +6676,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageOptions.encode = function encode(message, writer) { + MessageOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -6528,12 +6694,12 @@ 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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).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(); + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork(), q + 1).ldelim(); return writer; }; @@ -6547,7 +6713,7 @@ * @returns {$protobuf.Writer} Writer */ MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -6647,27 +6813,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) if (typeof message.messageSetWireFormat !== "boolean") return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) if (typeof message.noStandardDescriptorAccessor !== "boolean") return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) if (typeof message.mapEntry !== "boolean") return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -6676,7 +6842,7 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) { var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"], long + 1); if (error) return ".google.api.resource." + error; @@ -6695,6 +6861,8 @@ MessageOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.MessageOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MessageOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6711,7 +6879,7 @@ if (object.deprecatedLegacyJsonFieldConflicts != null) message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.MessageOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -6720,13 +6888,13 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } } if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") + if (!$util.isObject(object[".google.api.resource"])) throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"], long + 1); } @@ -6742,9 +6910,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageOptions.toObject = function toObject(message, options) { + MessageOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -6757,25 +6929,25 @@ object.features = null; object[".google.api.resource"] = null; } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } - 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); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options, q + 1); return object; }; @@ -7000,9 +7172,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldOptions.encode = function encode(message, writer) { + FieldOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -7026,19 +7202,19 @@ 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(); + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).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(); + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).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(); + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork(), q + 1).ldelim(); return writer; }; @@ -7052,7 +7228,7 @@ * @returns {$protobuf.Writer} Writer */ FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -7200,7 +7376,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) switch (message.ctype) { default: return "ctype: enum value expected"; @@ -7209,10 +7385,10 @@ case 2: break; } - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) if (typeof message.packed !== "boolean") return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) switch (message.jstype) { default: return "jstype: enum value expected"; @@ -7221,22 +7397,22 @@ case 2: break; } - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) if (typeof message.lazy !== "boolean") return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) if (typeof message.unverifiedLazy !== "boolean") return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) if (typeof message.weak !== "boolean") return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) switch (message.retention) { default: return "retention: enum value expected"; @@ -7245,7 +7421,7 @@ case 2: break; } - if (message.targets != null && message.hasOwnProperty("targets")) { + if (message.targets != null && Object.hasOwnProperty.call(message, "targets")) { if (!Array.isArray(message.targets)) return "targets: array expected"; for (var i = 0; i < message.targets.length; ++i) @@ -7265,7 +7441,7 @@ break; } } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (message.editionDefaults != null && Object.hasOwnProperty.call(message, "editionDefaults")) { if (!Array.isArray(message.editionDefaults)) return "editionDefaults: array expected"; for (var i = 0; i < message.editionDefaults.length; ++i) { @@ -7274,17 +7450,17 @@ return "editionDefaults." + error; } } - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); if (error) return "featureSupport." + error; } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -7293,7 +7469,7 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (message[".google.api.fieldBehavior"] != null && Object.hasOwnProperty.call(message, ".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) @@ -7312,7 +7488,7 @@ break; } } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) { var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"], long + 1); if (error) return ".google.api.resourceReference." + error; @@ -7331,6 +7507,8 @@ FieldOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7466,18 +7644,18 @@ 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") + if (!$util.isObject(object.editionDefaults[i])) throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i], long + 1); } } if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } if (object.featureSupport != null) { - if (typeof object.featureSupport !== "object") + if (!$util.isObject(object.featureSupport)) throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); } @@ -7486,7 +7664,7 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } @@ -7541,7 +7719,7 @@ } } if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") + if (!$util.isObject(object[".google.api.resourceReference"])) throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"], long + 1); } @@ -7557,9 +7735,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOptions.toObject = function toObject(message, options) { + FieldOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.targets = []; @@ -7581,23 +7763,23 @@ object.featureSupport = null; object[".google.api.resourceReference"] = null; } - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "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")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "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")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) + if (message.retention != null && Object.hasOwnProperty.call(message, "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 = []; @@ -7607,24 +7789,24 @@ 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); + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options, q + 1); } - 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.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options, q + 1); return object; }; @@ -7794,9 +7976,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EditionDefault.encode = function encode(message, writer) { + EditionDefault.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -7814,7 +8000,7 @@ * @returns {$protobuf.Writer} Writer */ EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -7888,7 +8074,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -7906,7 +8092,7 @@ case 2147483647: break; } - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) if (!$util.isString(message.value)) return "value: string expected"; return null; @@ -7923,6 +8109,8 @@ EditionDefault.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions.EditionDefault: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7998,17 +8186,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EditionDefault.toObject = function toObject(message, options) { + EditionDefault.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.value = ""; object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "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; }; @@ -8122,9 +8314,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSupport.encode = function encode(message, writer) { + FeatureSupport.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -8146,7 +8342,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -8228,7 +8424,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) switch (message.editionIntroduced) { default: return "editionIntroduced: enum value expected"; @@ -8246,7 +8442,7 @@ case 2147483647: break; } - if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) switch (message.editionDeprecated) { default: return "editionDeprecated: enum value expected"; @@ -8264,10 +8460,10 @@ case 2147483647: break; } - if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) if (!$util.isString(message.deprecationWarning)) return "deprecationWarning: string expected"; - if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) switch (message.editionRemoved) { default: return "editionRemoved: enum value expected"; @@ -8299,6 +8495,8 @@ FeatureSupport.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldOptions.FeatureSupport: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -8486,9 +8684,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSupport.toObject = function toObject(message, options) { + FeatureSupport.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; @@ -8496,13 +8698,13 @@ object.deprecationWarning = ""; object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; } - if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) + if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "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")) + if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "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")) + if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) object.deprecationWarning = message.deprecationWarning; - if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) + if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "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; }; @@ -8602,14 +8804,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OneofOptions.encode = function encode(message, writer) { + OneofOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); return writer; }; @@ -8623,7 +8829,7 @@ * @returns {$protobuf.Writer} Writer */ OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -8699,12 +8905,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -8727,13 +8933,15 @@ OneofOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.OneofOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.OneofOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.protobuf.OneofOptions(); if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.OneofOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -8742,7 +8950,7 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } @@ -8759,20 +8967,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OneofOptions.toObject = function toObject(message, options) { + OneofOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } return object; }; @@ -8896,9 +9108,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumOptions.encode = function encode(message, writer) { + EnumOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -8906,10 +9122,10 @@ 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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); return writer; }; @@ -8923,7 +9139,7 @@ * @returns {$protobuf.Writer} Writer */ EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -9011,21 +9227,21 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) if (typeof message.allowAlias !== "boolean") return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -9048,6 +9264,8 @@ EnumOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -9060,7 +9278,7 @@ if (object.deprecatedLegacyJsonFieldConflicts != null) message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.EnumOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -9069,7 +9287,7 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } @@ -9086,9 +9304,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumOptions.toObject = function toObject(message, options) { + EnumOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -9098,18 +9320,18 @@ object.deprecatedLegacyJsonFieldConflicts = false; object.features = null; } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } return object; }; @@ -9233,20 +9455,24 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumValueOptions.encode = function encode(message, writer) { + EnumValueOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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(); + $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); return writer; }; @@ -9260,7 +9486,7 @@ * @returns {$protobuf.Writer} Writer */ EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -9348,23 +9574,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) if (typeof message.debugRedact !== "boolean") return "debugRedact: boolean expected"; - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { + if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) { var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); if (error) return "featureSupport." + error; } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -9387,6 +9613,8 @@ EnumValueOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.EnumValueOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.EnumValueOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -9395,14 +9623,14 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } if (object.debugRedact != null) message.debugRedact = Boolean(object.debugRedact); if (object.featureSupport != null) { - if (typeof object.featureSupport !== "object") + if (!$util.isObject(object.featureSupport)) throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); } @@ -9411,7 +9639,7 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } @@ -9428,9 +9656,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumValueOptions.toObject = function toObject(message, options) { + EnumValueOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -9440,18 +9672,18 @@ object.debugRedact = false; object.featureSupport = null; } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "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")) + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "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.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) + object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } return object; }; @@ -9584,16 +9816,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServiceOptions.encode = function encode(message, writer) { + ServiceOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).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")) @@ -9613,7 +9849,7 @@ * @returns {$protobuf.Writer} Writer */ ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -9705,15 +9941,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -9722,13 +9958,13 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".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 (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".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 (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) if (!$util.isString(message[".google.api.apiVersion"])) return ".google.api.apiVersion: string expected"; return null; @@ -9745,13 +9981,15 @@ ServiceOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ServiceOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ServiceOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.protobuf.ServiceOptions(); if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -9762,7 +10000,7 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } @@ -9785,9 +10023,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServiceOptions.toObject = function toObject(message, options) { + ServiceOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.uninterpretedOption = []; @@ -9798,20 +10040,20 @@ object[".google.api.oauthScopes"] = ""; object[".google.api.apiVersion"] = ""; } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; return object; }; @@ -9954,25 +10196,29 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodOptions.encode = function encode(message, writer) { + MethodOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).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(); + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork(), q + 1).ldelim(); if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork(), q + 1).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(); + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork(), q + 1).ldelim(); return writer; }; @@ -9986,7 +10232,7 @@ * @returns {$protobuf.Writer} Writer */ MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -10084,10 +10330,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) if (typeof message.deprecated !== "boolean") return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) switch (message.idempotencyLevel) { default: return "idempotencyLevel: enum value expected"; @@ -10096,12 +10342,12 @@ case 2: break; } - if (message.features != null && message.hasOwnProperty("features")) { + if (message.features != null && Object.hasOwnProperty.call(message, "features")) { var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); if (error) return "features." + error; } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (message.uninterpretedOption != null && Object.hasOwnProperty.call(message, "uninterpretedOption")) { if (!Array.isArray(message.uninterpretedOption)) return "uninterpretedOption: array expected"; for (var i = 0; i < message.uninterpretedOption.length; ++i) { @@ -10110,19 +10356,19 @@ return "uninterpretedOption." + error; } } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) { var error = $root.google.api.HttpRule.verify(message[".google.api.http"], long + 1); if (error) return ".google.api.http." + error; } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (message[".google.api.methodSignature"] != null && Object.hasOwnProperty.call(message, ".google.api.methodSignature")) { if (!Array.isArray(message[".google.api.methodSignature"])) return ".google.api.methodSignature: array expected"; for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) if (!$util.isString(message[".google.api.methodSignature"][i])) return ".google.api.methodSignature: string[] expected"; } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) { var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"], long + 1); if (error) return ".google.longrunning.operationInfo." + error; @@ -10141,6 +10387,8 @@ MethodOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.MethodOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.MethodOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10169,7 +10417,7 @@ break; } if (object.features != null) { - if (typeof object.features !== "object") + if (!$util.isObject(object.features)) throw TypeError(".google.protobuf.MethodOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); } @@ -10178,13 +10426,13 @@ 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") + if (!$util.isObject(object.uninterpretedOption[i])) throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i], long + 1); } } if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") + if (!$util.isObject(object[".google.api.http"])) throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"], long + 1); } @@ -10196,7 +10444,7 @@ message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); } if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") + if (!$util.isObject(object[".google.longrunning.operationInfo"])) throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"], long + 1); } @@ -10212,9 +10460,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodOptions.toObject = function toObject(message, options) { + MethodOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.uninterpretedOption = []; @@ -10227,26 +10479,26 @@ object[".google.longrunning.operationInfo"] = null; object[".google.api.http"] = null; } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "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.features != null && Object.hasOwnProperty.call(message, "features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options, q + 1); 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); + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options, q + 1); } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options, q + 1); 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); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options, q + 1); return object; }; @@ -10403,12 +10655,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UninterpretedOption.encode = function encode(message, writer) { + UninterpretedOption.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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")) @@ -10434,7 +10690,7 @@ * @returns {$protobuf.Writer} Writer */ UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -10530,7 +10786,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { if (!Array.isArray(message.name)) return "name: array expected"; for (var i = 0; i < message.name.length; ++i) { @@ -10539,22 +10795,22 @@ return "name." + error; } } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) if (!$util.isString(message.identifierValue)) return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "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 (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "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 (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "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 (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) if (!$util.isString(message.aggregateValue)) return "aggregateValue: string expected"; return null; @@ -10571,6 +10827,8 @@ UninterpretedOption.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.UninterpretedOption) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UninterpretedOption: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10581,7 +10839,7 @@ 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") + if (!$util.isObject(object.name[i])) throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i], long + 1); } @@ -10590,7 +10848,7 @@ message.identifierValue = String(object.identifierValue); if (object.positiveIntValue != null) if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue, true); else if (typeof object.positiveIntValue === "string") message.positiveIntValue = parseInt(object.positiveIntValue, 10); else if (typeof object.positiveIntValue === "number") @@ -10599,7 +10857,7 @@ 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; + message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue, false); else if (typeof object.negativeIntValue === "string") message.negativeIntValue = parseInt(object.negativeIntValue, 10); else if (typeof object.negativeIntValue === "number") @@ -10627,9 +10885,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UninterpretedOption.toObject = function toObject(message, options) { + UninterpretedOption.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.name = []; @@ -10637,14 +10899,14 @@ 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; + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.positiveIntValue = options.longs === String ? "0" : 0; + object.positiveIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("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; + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.negativeIntValue = options.longs === String ? "0" : 0; + object.negativeIntValue = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.doubleValue = 0; if (options.bytes === String) object.stringValue = ""; @@ -10658,25 +10920,29 @@ 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); + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options, q + 1); } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.positiveIntValue = typeof message.positiveIntValue === "number" ? BigInt(message.positiveIntValue) : $util.Long.fromBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0, true).toBigInt(); + else 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") + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.negativeIntValue = typeof message.negativeIntValue === "number" ? BigInt(message.negativeIntValue) : $util.Long.fromBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0, false).toBigInt(); + else 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")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "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")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) object.aggregateValue = message.aggregateValue; return object; }; @@ -10769,9 +11035,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NamePart.encode = function encode(message, writer) { + NamePart.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); return writer; @@ -10787,7 +11057,7 @@ * @returns {$protobuf.Writer} Writer */ NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -10827,9 +11097,9 @@ break; } } - if (!message.hasOwnProperty("namePart")) + if (!Object.hasOwnProperty.call(message, "namePart")) throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) + if (!Object.hasOwnProperty.call(message, "isExtension")) throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; @@ -10883,6 +11153,8 @@ NamePart.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UninterpretedOption.NamePart: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10904,17 +11176,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NamePart.toObject = function toObject(message, options) { + NamePart.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.namePart = ""; object.isExtension = false; } - if (message.namePart != null && message.hasOwnProperty("namePart")) + if (message.namePart != null && Object.hasOwnProperty.call(message, "namePart")) object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) + if (message.isExtension != null && Object.hasOwnProperty.call(message, "isExtension")) object.isExtension = message.isExtension; return object; }; @@ -11067,9 +11343,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSet.encode = function encode(message, writer) { + FeatureSet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -11099,7 +11379,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -11197,7 +11477,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) switch (message.fieldPresence) { default: return "fieldPresence: enum value expected"; @@ -11207,7 +11487,7 @@ case 3: break; } - if (message.enumType != null && message.hasOwnProperty("enumType")) + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) switch (message.enumType) { default: return "enumType: enum value expected"; @@ -11216,7 +11496,7 @@ case 2: break; } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) switch (message.repeatedFieldEncoding) { default: return "repeatedFieldEncoding: enum value expected"; @@ -11225,7 +11505,7 @@ case 2: break; } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) switch (message.utf8Validation) { default: return "utf8Validation: enum value expected"; @@ -11234,7 +11514,7 @@ case 3: break; } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) switch (message.messageEncoding) { default: return "messageEncoding: enum value expected"; @@ -11243,7 +11523,7 @@ case 2: break; } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) switch (message.jsonFormat) { default: return "jsonFormat: enum value expected"; @@ -11252,7 +11532,7 @@ case 2: break; } - if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) switch (message.enforceNamingStyle) { default: return "enforceNamingStyle: enum value expected"; @@ -11261,7 +11541,7 @@ case 2: break; } - if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) switch (message.defaultSymbolVisibility) { default: return "defaultSymbolVisibility: enum value expected"; @@ -11286,6 +11566,8 @@ FeatureSet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -11475,9 +11757,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSet.toObject = function toObject(message, options) { + FeatureSet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; @@ -11489,21 +11775,21 @@ 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")) + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "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")) + if (message.enumType != null && Object.hasOwnProperty.call(message, "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")) + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "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")) + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "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")) + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "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")) + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "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")) + if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "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")) + if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "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; }; @@ -11692,9 +11978,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VisibilityFeature.encode = function encode(message, writer) { + VisibilityFeature.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -11708,7 +11998,7 @@ * @returns {$protobuf.Writer} Writer */ VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -11788,10 +12078,6 @@ VisibilityFeature.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.protobuf.FeatureSet.VisibilityFeature(); }; @@ -11932,12 +12218,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSetDefaults.encode = function encode(message, writer) { + FeatureSetDefaults.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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")) @@ -11955,7 +12245,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -12035,7 +12325,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (message.defaults != null && Object.hasOwnProperty.call(message, "defaults")) { if (!Array.isArray(message.defaults)) return "defaults: array expected"; for (var i = 0; i < message.defaults.length; ++i) { @@ -12044,7 +12334,7 @@ return "defaults." + error; } } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) switch (message.minimumEdition) { default: return "minimumEdition: enum value expected"; @@ -12062,7 +12352,7 @@ case 2147483647: break; } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) switch (message.maximumEdition) { default: return "maximumEdition: enum value expected"; @@ -12094,6 +12384,8 @@ FeatureSetDefaults.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSetDefaults) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSetDefaults: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12104,7 +12396,7 @@ 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") + if (!$util.isObject(object.defaults[i])) throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i], long + 1); } @@ -12233,9 +12525,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSetDefaults.toObject = function toObject(message, options) { + FeatureSetDefaults.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.defaults = []; @@ -12246,11 +12542,11 @@ 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); + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options, q + 1); } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "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")) + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "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; }; @@ -12352,15 +12648,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FeatureSetEditionDefault.encode = function encode(message, writer) { + FeatureSetEditionDefault.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).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(); + $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -12374,7 +12674,7 @@ * @returns {$protobuf.Writer} Writer */ FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -12452,7 +12752,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -12470,12 +12770,12 @@ case 2147483647: break; } - if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) { var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures, long + 1); if (error) return "overridableFeatures." + error; } - if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) { var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures, long + 1); if (error) return "fixedFeatures." + error; @@ -12494,6 +12794,8 @@ FeatureSetEditionDefault.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12556,12 +12858,12 @@ break; } if (object.overridableFeatures != null) { - if (typeof object.overridableFeatures !== "object") + if (!$util.isObject(object.overridableFeatures)) throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures, long + 1); } if (object.fixedFeatures != null) { - if (typeof object.fixedFeatures !== "object") + if (!$util.isObject(object.fixedFeatures)) throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures, long + 1); } @@ -12577,21 +12879,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { + FeatureSetEditionDefault.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) + if (message.edition != null && Object.hasOwnProperty.call(message, "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); + if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) + object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options, q + 1); + if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) + object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options, q + 1); return object; }; @@ -12681,12 +12987,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceCodeInfo.encode = function encode(message, writer) { + SourceCodeInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -12700,7 +13010,7 @@ * @returns {$protobuf.Writer} Writer */ SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -12772,7 +13082,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.location != null && message.hasOwnProperty("location")) { + if (message.location != null && Object.hasOwnProperty.call(message, "location")) { if (!Array.isArray(message.location)) return "location: array expected"; for (var i = 0; i < message.location.length; ++i) { @@ -12795,6 +13105,8 @@ SourceCodeInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.SourceCodeInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.SourceCodeInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12805,7 +13117,7 @@ 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") + if (!$util.isObject(object.location[i])) throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i], long + 1); } @@ -12822,16 +13134,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceCodeInfo.toObject = function toObject(message, options) { + SourceCodeInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options, q + 1); } return object; }; @@ -12954,9 +13270,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer) { + Location.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) @@ -12989,7 +13309,7 @@ * @returns {$protobuf.Writer} Writer */ Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -13091,27 +13411,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.path != null && message.hasOwnProperty("path")) { + if (message.path != null && Object.hasOwnProperty.call(message, "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 (message.span != null && Object.hasOwnProperty.call(message, "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 (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) if (!$util.isString(message.leadingComments)) return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) if (!$util.isString(message.trailingComments)) return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (message.leadingDetachedComments != null && Object.hasOwnProperty.call(message, "leadingDetachedComments")) { if (!Array.isArray(message.leadingDetachedComments)) return "leadingDetachedComments: array expected"; for (var i = 0; i < message.leadingDetachedComments.length; ++i) @@ -13132,6 +13452,8 @@ Location.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -13174,9 +13496,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = function toObject(message, options) { + Location.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.path = []; @@ -13197,9 +13523,9 @@ for (var j = 0; j < message.span.length; ++j) object.span[j] = message.span[j]; } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) object.trailingComments = message.trailingComments; if (message.leadingDetachedComments && message.leadingDetachedComments.length) { object.leadingDetachedComments = []; @@ -13295,12 +13621,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeneratedCodeInfo.encode = function encode(message, writer) { + GeneratedCodeInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -13314,7 +13644,7 @@ * @returns {$protobuf.Writer} Writer */ GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -13386,7 +13716,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (message.annotation != null && Object.hasOwnProperty.call(message, "annotation")) { if (!Array.isArray(message.annotation)) return "annotation: array expected"; for (var i = 0; i < message.annotation.length; ++i) { @@ -13409,6 +13739,8 @@ GeneratedCodeInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.GeneratedCodeInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -13419,7 +13751,7 @@ 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") + if (!$util.isObject(object.annotation[i])) throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i], long + 1); } @@ -13436,16 +13768,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeneratedCodeInfo.toObject = function toObject(message, options) { + GeneratedCodeInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options, q + 1); } return object; }; @@ -13566,9 +13902,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Annotation.encode = function encode(message, writer) { + Annotation.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.path != null && message.path.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.path.length; ++i) @@ -13596,7 +13936,7 @@ * @returns {$protobuf.Writer} Writer */ Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -13689,23 +14029,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.path != null && message.hasOwnProperty("path")) { + if (message.path != null && Object.hasOwnProperty.call(message, "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 (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) if (!$util.isString(message.sourceFile)) return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) if (!$util.isInteger(message.begin)) return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) if (!$util.isInteger(message.end)) return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) switch (message.semantic) { default: return "semantic: enum value expected"; @@ -13728,6 +14068,8 @@ Annotation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -13778,9 +14120,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Annotation.toObject = function toObject(message, options) { + Annotation.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.path = []; @@ -13795,13 +14141,13 @@ for (var j = 0; j < message.path.length; ++j) object.path[j] = message.path[j]; } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) + if (message.semantic != null && Object.hasOwnProperty.call(message, "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; }; @@ -13932,9 +14278,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encode = function encode(message, writer) { + Any.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); if (message.value != null && Object.hasOwnProperty.call(message, "value")) @@ -13952,7 +14302,7 @@ * @returns {$protobuf.Writer} Writer */ Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14026,10 +14376,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type_url != null && message.hasOwnProperty("type_url")) + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) if (!$util.isString(message.type_url)) return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) return "value: buffer expected"; return null; @@ -14046,6 +14396,8 @@ Any.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Any) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Any: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14070,9 +14422,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Any.toObject = function toObject(message, options) { + Any.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.type_url = ""; @@ -14084,9 +14440,9 @@ object.value = $util.newBuffer(object.value); } } - if (message.type_url != null && message.hasOwnProperty("type_url")) + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; @@ -14164,9 +14520,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, writer) { + Empty.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -14180,7 +14540,7 @@ * @returns {$protobuf.Writer} Writer */ Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14260,10 +14620,6 @@ Empty.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Empty) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.protobuf.Empty(); }; @@ -14363,9 +14719,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldMask.encode = function encode(message, writer) { + FieldMask.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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]); @@ -14382,7 +14742,7 @@ * @returns {$protobuf.Writer} Writer */ FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14454,7 +14814,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.paths != null && message.hasOwnProperty("paths")) { + if (message.paths != null && Object.hasOwnProperty.call(message, "paths")) { if (!Array.isArray(message.paths)) return "paths: array expected"; for (var i = 0; i < message.paths.length; ++i) @@ -14475,6 +14835,8 @@ FieldMask.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FieldMask) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FieldMask: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14499,9 +14861,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldMask.toObject = function toObject(message, options) { + FieldMask.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.paths = []; @@ -14604,9 +14970,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + Timestamp.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -14624,7 +14994,7 @@ * @returns {$protobuf.Writer} Writer */ Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14698,10 +15068,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "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 (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) if (!$util.isInteger(message.nanos)) return "nanos: integer expected"; return null; @@ -14718,6 +15088,8 @@ Timestamp.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Timestamp) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Timestamp: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14725,7 +15097,7 @@ var message = new $root.google.protobuf.Timestamp(); if (object.seconds != null) if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + message.seconds = $util.Long.fromValue(object.seconds, false); else if (typeof object.seconds === "string") message.seconds = parseInt(object.seconds, 10); else if (typeof object.seconds === "number") @@ -14746,24 +15118,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options) { + Timestamp.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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; + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.seconds = options.longs === String ? "0" : 0; + object.seconds = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.nanos = 0; } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seconds = typeof message.seconds === "number" ? BigInt(message.seconds) : $util.Long.fromBits(message.seconds.low >>> 0, message.seconds.high >>> 0, false).toBigInt(); + else 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")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) object.nanos = message.nanos; return object; }; @@ -14851,13 +15229,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Struct.encode = function encode(message, writer) { + Struct.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); } return writer; }; @@ -14872,7 +15254,7 @@ * @returns {$protobuf.Writer} Writer */ Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14963,7 +15345,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.fields != null && message.hasOwnProperty("fields")) { + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { if (!$util.isObject(message.fields)) return "fields: object expected"; var key = Object.keys(message.fields); @@ -14987,19 +15369,21 @@ Struct.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Struct) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Struct: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.protobuf.Struct(); if (object.fields) { - if (typeof object.fields !== "object") + if (!$util.isObject(object.fields)) throw TypeError(".google.protobuf.Struct.fields: object expected"); message.fields = {}; for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { if (keys[i] === "__proto__") $util.makeProp(message.fields, keys[i]); - if (typeof object.fields[keys[i]] !== "object") + if (!$util.isObject(object.fields[keys[i]])) throw TypeError(".google.protobuf.Struct.fields: object expected"); message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]], long + 1); } @@ -15016,9 +15400,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Struct.toObject = function toObject(message, options) { + Struct.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.fields = {}; @@ -15028,7 +15416,7 @@ for (var j = 0; j < keys2.length; ++j) { if (keys2[j] === "__proto__") $util.makeProp(object.fields, keys2[j]); - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options, q + 1); } } return object; @@ -15175,9 +15563,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Value.encode = function encode(message, writer) { + Value.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) @@ -15187,9 +15579,9 @@ if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -15203,7 +15595,7 @@ * @returns {$protobuf.Writer} Writer */ Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -15294,7 +15686,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) { properties.kind = 1; switch (message.nullValue) { default: @@ -15303,28 +15695,28 @@ break; } } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; if (typeof message.numberValue !== "number") return "numberValue: number expected"; } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; if (!$util.isString(message.stringValue)) return "stringValue: string expected"; } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; if (typeof message.boolValue !== "boolean") return "boolValue: boolean expected"; } - if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; @@ -15334,7 +15726,7 @@ return "structValue." + error; } } - if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) { if (properties.kind === 1) return "kind: multiple values"; properties.kind = 1; @@ -15358,6 +15750,8 @@ Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15382,12 +15776,12 @@ if (object.boolValue != null) message.boolValue = Boolean(object.boolValue); if (object.structValue != null) { - if (typeof object.structValue !== "object") + if (!$util.isObject(object.structValue)) throw TypeError(".google.protobuf.Value.structValue: object expected"); message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue, long + 1); } if (object.listValue != null) { - if (typeof object.listValue !== "object") + if (!$util.isObject(object.listValue)) throw TypeError(".google.protobuf.Value.listValue: object expected"); message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue, long + 1); } @@ -15403,37 +15797,41 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Value.toObject = function toObject(message, options) { + Value.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) { object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; if (options.oneofs) object.kind = "nullValue"; } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) { object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; if (options.oneofs) object.kind = "numberValue"; } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { object.stringValue = message.stringValue; if (options.oneofs) object.kind = "stringValue"; } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { object.boolValue = message.boolValue; if (options.oneofs) object.kind = "boolValue"; } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options, q + 1); if (options.oneofs) object.kind = "structValue"; } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options, q + 1); if (options.oneofs) object.kind = "listValue"; } @@ -15535,12 +15933,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListValue.encode = function encode(message, writer) { + ListValue.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -15554,7 +15956,7 @@ * @returns {$protobuf.Writer} Writer */ ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -15626,7 +16028,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.values != null && message.hasOwnProperty("values")) { + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { if (!Array.isArray(message.values)) return "values: array expected"; for (var i = 0; i < message.values.length; ++i) { @@ -15649,6 +16051,8 @@ ListValue.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.ListValue) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.ListValue: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15659,7 +16063,7 @@ throw TypeError(".google.protobuf.ListValue.values: array expected"); message.values = []; for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") + if (!$util.isObject(object.values[i])) throw TypeError(".google.protobuf.ListValue.values: object expected"); message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i], long + 1); } @@ -15676,16 +16080,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListValue.toObject = function toObject(message, options) { + ListValue.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.values = []; if (message.values && message.values.length) { object.values = []; for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options, q + 1); } return object; }; @@ -15803,9 +16211,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ErrorInfo.encode = function encode(message, writer) { + ErrorInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.reason); if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) @@ -15826,7 +16238,7 @@ * @returns {$protobuf.Writer} Writer */ ErrorInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -15925,13 +16337,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.reason != null && message.hasOwnProperty("reason")) + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) if (!$util.isString(message.reason)) return "reason: string expected"; - if (message.domain != null && message.hasOwnProperty("domain")) + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) if (!$util.isString(message.domain)) return "domain: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { if (!$util.isObject(message.metadata)) return "metadata: object expected"; var key = Object.keys(message.metadata); @@ -15953,6 +16365,8 @@ ErrorInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.ErrorInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.ErrorInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15963,7 +16377,7 @@ if (object.domain != null) message.domain = String(object.domain); if (object.metadata) { - if (typeof object.metadata !== "object") + if (!$util.isObject(object.metadata)) throw TypeError(".google.rpc.ErrorInfo.metadata: object expected"); message.metadata = {}; for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) { @@ -15984,9 +16398,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ErrorInfo.toObject = function toObject(message, options) { + ErrorInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.metadata = {}; @@ -15994,9 +16412,9 @@ object.reason = ""; object.domain = ""; } - if (message.reason != null && message.hasOwnProperty("reason")) + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) object.reason = message.reason; - if (message.domain != null && message.hasOwnProperty("domain")) + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) object.domain = message.domain; var keys2; if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { @@ -16092,11 +16510,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RetryInfo.encode = function encode(message, writer) { + RetryInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.retryDelay != null && Object.hasOwnProperty.call(message, "retryDelay")) - $root.google.protobuf.Duration.encode(message.retryDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.retryDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -16110,7 +16532,7 @@ * @returns {$protobuf.Writer} Writer */ RetryInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -16180,7 +16602,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.retryDelay != null && message.hasOwnProperty("retryDelay")) { + if (message.retryDelay != null && Object.hasOwnProperty.call(message, "retryDelay")) { var error = $root.google.protobuf.Duration.verify(message.retryDelay, long + 1); if (error) return "retryDelay." + error; @@ -16199,13 +16621,15 @@ RetryInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.RetryInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.RetryInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.rpc.RetryInfo(); if (object.retryDelay != null) { - if (typeof object.retryDelay !== "object") + if (!$util.isObject(object.retryDelay)) throw TypeError(".google.rpc.RetryInfo.retryDelay: object expected"); message.retryDelay = $root.google.protobuf.Duration.fromObject(object.retryDelay, long + 1); } @@ -16221,14 +16645,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RetryInfo.toObject = function toObject(message, options) { + RetryInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.retryDelay = null; - if (message.retryDelay != null && message.hasOwnProperty("retryDelay")) - object.retryDelay = $root.google.protobuf.Duration.toObject(message.retryDelay, options); + if (message.retryDelay != null && Object.hasOwnProperty.call(message, "retryDelay")) + object.retryDelay = $root.google.protobuf.Duration.toObject(message.retryDelay, options, q + 1); return object; }; @@ -16324,9 +16752,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DebugInfo.encode = function encode(message, writer) { + DebugInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.stackEntries != null && message.stackEntries.length) for (var i = 0; i < message.stackEntries.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.stackEntries[i]); @@ -16345,7 +16777,7 @@ * @returns {$protobuf.Writer} Writer */ DebugInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -16421,14 +16853,14 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.stackEntries != null && message.hasOwnProperty("stackEntries")) { + if (message.stackEntries != null && Object.hasOwnProperty.call(message, "stackEntries")) { if (!Array.isArray(message.stackEntries)) return "stackEntries: array expected"; for (var i = 0; i < message.stackEntries.length; ++i) if (!$util.isString(message.stackEntries[i])) return "stackEntries: string[] expected"; } - if (message.detail != null && message.hasOwnProperty("detail")) + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) if (!$util.isString(message.detail)) return "detail: string expected"; return null; @@ -16445,6 +16877,8 @@ DebugInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.DebugInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.DebugInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16471,9 +16905,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DebugInfo.toObject = function toObject(message, options) { + DebugInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.stackEntries = []; @@ -16484,7 +16922,7 @@ for (var j = 0; j < message.stackEntries.length; ++j) object.stackEntries[j] = message.stackEntries[j]; } - if (message.detail != null && message.hasOwnProperty("detail")) + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) object.detail = message.detail; return object; }; @@ -16572,12 +17010,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QuotaFailure.encode = function encode(message, writer) { + QuotaFailure.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.violations != null && message.violations.length) for (var i = 0; i < message.violations.length; ++i) - $root.google.rpc.QuotaFailure.Violation.encode(message.violations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.rpc.QuotaFailure.Violation.encode(message.violations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -16591,7 +17033,7 @@ * @returns {$protobuf.Writer} Writer */ QuotaFailure.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -16663,7 +17105,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.violations != null && message.hasOwnProperty("violations")) { + if (message.violations != null && Object.hasOwnProperty.call(message, "violations")) { if (!Array.isArray(message.violations)) return "violations: array expected"; for (var i = 0; i < message.violations.length; ++i) { @@ -16686,6 +17128,8 @@ QuotaFailure.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.QuotaFailure) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.QuotaFailure: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16696,7 +17140,7 @@ throw TypeError(".google.rpc.QuotaFailure.violations: array expected"); message.violations = []; for (var i = 0; i < object.violations.length; ++i) { - if (typeof object.violations[i] !== "object") + if (!$util.isObject(object.violations[i])) throw TypeError(".google.rpc.QuotaFailure.violations: object expected"); message.violations[i] = $root.google.rpc.QuotaFailure.Violation.fromObject(object.violations[i], long + 1); } @@ -16713,16 +17157,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QuotaFailure.toObject = function toObject(message, options) { + QuotaFailure.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.violations = []; if (message.violations && message.violations.length) { object.violations = []; for (var j = 0; j < message.violations.length; ++j) - object.violations[j] = $root.google.rpc.QuotaFailure.Violation.toObject(message.violations[j], options); + object.violations[j] = $root.google.rpc.QuotaFailure.Violation.toObject(message.violations[j], options, q + 1); } return object; }; @@ -16815,9 +17263,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Violation.encode = function encode(message, writer) { + Violation.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.subject); if (message.description != null && Object.hasOwnProperty.call(message, "description")) @@ -16835,7 +17287,7 @@ * @returns {$protobuf.Writer} Writer */ Violation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -16909,10 +17361,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.subject != null && message.hasOwnProperty("subject")) + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) if (!$util.isString(message.subject)) return "subject: string expected"; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) if (!$util.isString(message.description)) return "description: string expected"; return null; @@ -16929,6 +17381,8 @@ Violation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.QuotaFailure.Violation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.QuotaFailure.Violation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16950,17 +17404,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Violation.toObject = function toObject(message, options) { + Violation.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.subject = ""; object.description = ""; } - if (message.subject != null && message.hasOwnProperty("subject")) + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) object.subject = message.subject; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; return object; }; @@ -17051,12 +17509,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PreconditionFailure.encode = function encode(message, writer) { + PreconditionFailure.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.violations != null && message.violations.length) for (var i = 0; i < message.violations.length; ++i) - $root.google.rpc.PreconditionFailure.Violation.encode(message.violations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.rpc.PreconditionFailure.Violation.encode(message.violations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -17070,7 +17532,7 @@ * @returns {$protobuf.Writer} Writer */ PreconditionFailure.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -17142,7 +17604,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.violations != null && message.hasOwnProperty("violations")) { + if (message.violations != null && Object.hasOwnProperty.call(message, "violations")) { if (!Array.isArray(message.violations)) return "violations: array expected"; for (var i = 0; i < message.violations.length; ++i) { @@ -17165,6 +17627,8 @@ PreconditionFailure.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.PreconditionFailure) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.PreconditionFailure: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17175,7 +17639,7 @@ throw TypeError(".google.rpc.PreconditionFailure.violations: array expected"); message.violations = []; for (var i = 0; i < object.violations.length; ++i) { - if (typeof object.violations[i] !== "object") + if (!$util.isObject(object.violations[i])) throw TypeError(".google.rpc.PreconditionFailure.violations: object expected"); message.violations[i] = $root.google.rpc.PreconditionFailure.Violation.fromObject(object.violations[i], long + 1); } @@ -17192,16 +17656,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PreconditionFailure.toObject = function toObject(message, options) { + PreconditionFailure.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.violations = []; if (message.violations && message.violations.length) { object.violations = []; for (var j = 0; j < message.violations.length; ++j) - object.violations[j] = $root.google.rpc.PreconditionFailure.Violation.toObject(message.violations[j], options); + object.violations[j] = $root.google.rpc.PreconditionFailure.Violation.toObject(message.violations[j], options, q + 1); } return object; }; @@ -17303,9 +17771,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Violation.encode = function encode(message, writer) { + Violation.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) @@ -17325,7 +17797,7 @@ * @returns {$protobuf.Writer} Writer */ Violation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -17403,13 +17875,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.subject != null && message.hasOwnProperty("subject")) + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) if (!$util.isString(message.subject)) return "subject: string expected"; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) if (!$util.isString(message.description)) return "description: string expected"; return null; @@ -17426,6 +17898,8 @@ Violation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.PreconditionFailure.Violation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.PreconditionFailure.Violation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17449,20 +17923,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Violation.toObject = function toObject(message, options) { + Violation.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.type = ""; object.subject = ""; object.description = ""; } - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = message.type; - if (message.subject != null && message.hasOwnProperty("subject")) + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) object.subject = message.subject; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; return object; }; @@ -17553,12 +18031,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BadRequest.encode = function encode(message, writer) { + BadRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.fieldViolations != null && message.fieldViolations.length) for (var i = 0; i < message.fieldViolations.length; ++i) - $root.google.rpc.BadRequest.FieldViolation.encode(message.fieldViolations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.rpc.BadRequest.FieldViolation.encode(message.fieldViolations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -17572,7 +18054,7 @@ * @returns {$protobuf.Writer} Writer */ BadRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -17644,7 +18126,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.fieldViolations != null && message.hasOwnProperty("fieldViolations")) { + if (message.fieldViolations != null && Object.hasOwnProperty.call(message, "fieldViolations")) { if (!Array.isArray(message.fieldViolations)) return "fieldViolations: array expected"; for (var i = 0; i < message.fieldViolations.length; ++i) { @@ -17667,6 +18149,8 @@ BadRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.BadRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.BadRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17677,7 +18161,7 @@ throw TypeError(".google.rpc.BadRequest.fieldViolations: array expected"); message.fieldViolations = []; for (var i = 0; i < object.fieldViolations.length; ++i) { - if (typeof object.fieldViolations[i] !== "object") + if (!$util.isObject(object.fieldViolations[i])) throw TypeError(".google.rpc.BadRequest.fieldViolations: object expected"); message.fieldViolations[i] = $root.google.rpc.BadRequest.FieldViolation.fromObject(object.fieldViolations[i], long + 1); } @@ -17694,16 +18178,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BadRequest.toObject = function toObject(message, options) { + BadRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.fieldViolations = []; if (message.fieldViolations && message.fieldViolations.length) { object.fieldViolations = []; for (var j = 0; j < message.fieldViolations.length; ++j) - object.fieldViolations[j] = $root.google.rpc.BadRequest.FieldViolation.toObject(message.fieldViolations[j], options); + object.fieldViolations[j] = $root.google.rpc.BadRequest.FieldViolation.toObject(message.fieldViolations[j], options, q + 1); } return object; }; @@ -17796,9 +18284,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldViolation.encode = function encode(message, writer) { + FieldViolation.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.field != null && Object.hasOwnProperty.call(message, "field")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); if (message.description != null && Object.hasOwnProperty.call(message, "description")) @@ -17816,7 +18308,7 @@ * @returns {$protobuf.Writer} Writer */ FieldViolation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -17890,10 +18382,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.field != null && message.hasOwnProperty("field")) + if (message.field != null && Object.hasOwnProperty.call(message, "field")) if (!$util.isString(message.field)) return "field: string expected"; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) if (!$util.isString(message.description)) return "description: string expected"; return null; @@ -17910,6 +18402,8 @@ FieldViolation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.BadRequest.FieldViolation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.BadRequest.FieldViolation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17931,17 +18425,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldViolation.toObject = function toObject(message, options) { + FieldViolation.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.field = ""; object.description = ""; } - if (message.field != null && message.hasOwnProperty("field")) + if (message.field != null && Object.hasOwnProperty.call(message, "field")) object.field = message.field; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; return object; }; @@ -18040,9 +18538,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RequestInfo.encode = function encode(message, writer) { + RequestInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.requestId); if (message.servingData != null && Object.hasOwnProperty.call(message, "servingData")) @@ -18060,7 +18562,7 @@ * @returns {$protobuf.Writer} Writer */ RequestInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -18134,10 +18636,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.requestId != null && message.hasOwnProperty("requestId")) + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; - if (message.servingData != null && message.hasOwnProperty("servingData")) + if (message.servingData != null && Object.hasOwnProperty.call(message, "servingData")) if (!$util.isString(message.servingData)) return "servingData: string expected"; return null; @@ -18154,6 +18656,8 @@ RequestInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.RequestInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.RequestInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18175,17 +18679,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RequestInfo.toObject = function toObject(message, options) { + RequestInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.requestId = ""; object.servingData = ""; } - if (message.requestId != null && message.hasOwnProperty("requestId")) + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) object.requestId = message.requestId; - if (message.servingData != null && message.hasOwnProperty("servingData")) + if (message.servingData != null && Object.hasOwnProperty.call(message, "servingData")) object.servingData = message.servingData; return object; }; @@ -18299,9 +18807,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceInfo.encode = function encode(message, writer) { + ResourceInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceType); if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) @@ -18323,7 +18835,7 @@ * @returns {$protobuf.Writer} Writer */ ResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -18405,16 +18917,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) if (!$util.isString(message.resourceType)) return "resourceType: string expected"; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) if (!$util.isString(message.resourceName)) return "resourceName: string expected"; - if (message.owner != null && message.hasOwnProperty("owner")) + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) if (!$util.isString(message.owner)) return "owner: string expected"; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) if (!$util.isString(message.description)) return "description: string expected"; return null; @@ -18431,6 +18943,8 @@ ResourceInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.ResourceInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.ResourceInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18456,9 +18970,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceInfo.toObject = function toObject(message, options) { + ResourceInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.resourceType = ""; @@ -18466,13 +18984,13 @@ object.owner = ""; object.description = ""; } - if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) object.resourceType = message.resourceType; - if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) object.resourceName = message.resourceName; - if (message.owner != null && message.hasOwnProperty("owner")) + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) object.owner = message.owner; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; return object; }; @@ -18560,12 +19078,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Help.encode = function encode(message, writer) { + Help.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.links != null && message.links.length) for (var i = 0; i < message.links.length; ++i) - $root.google.rpc.Help.Link.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.rpc.Help.Link.encode(message.links[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -18579,7 +19101,7 @@ * @returns {$protobuf.Writer} Writer */ Help.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -18651,7 +19173,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.links != null && message.hasOwnProperty("links")) { + if (message.links != null && Object.hasOwnProperty.call(message, "links")) { if (!Array.isArray(message.links)) return "links: array expected"; for (var i = 0; i < message.links.length; ++i) { @@ -18674,6 +19196,8 @@ Help.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.Help) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.Help: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18684,7 +19208,7 @@ throw TypeError(".google.rpc.Help.links: array expected"); message.links = []; for (var i = 0; i < object.links.length; ++i) { - if (typeof object.links[i] !== "object") + if (!$util.isObject(object.links[i])) throw TypeError(".google.rpc.Help.links: object expected"); message.links[i] = $root.google.rpc.Help.Link.fromObject(object.links[i], long + 1); } @@ -18701,16 +19225,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Help.toObject = function toObject(message, options) { + Help.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.links = []; if (message.links && message.links.length) { object.links = []; for (var j = 0; j < message.links.length; ++j) - object.links[j] = $root.google.rpc.Help.Link.toObject(message.links[j], options); + object.links[j] = $root.google.rpc.Help.Link.toObject(message.links[j], options, q + 1); } return object; }; @@ -18803,9 +19331,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Link.encode = function encode(message, writer) { + Link.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); if (message.url != null && Object.hasOwnProperty.call(message, "url")) @@ -18823,7 +19355,7 @@ * @returns {$protobuf.Writer} Writer */ Link.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -18897,10 +19429,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.url != null && message.hasOwnProperty("url")) + if (message.url != null && Object.hasOwnProperty.call(message, "url")) if (!$util.isString(message.url)) return "url: string expected"; return null; @@ -18917,6 +19449,8 @@ Link.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.Help.Link) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.Help.Link: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18938,17 +19472,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Link.toObject = function toObject(message, options) { + Link.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.description = ""; object.url = ""; } - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; - if (message.url != null && message.hasOwnProperty("url")) + if (message.url != null && Object.hasOwnProperty.call(message, "url")) object.url = message.url; return object; }; @@ -19047,9 +19585,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocalizedMessage.encode = function encode(message, writer) { + LocalizedMessage.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.locale != null && Object.hasOwnProperty.call(message, "locale")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.locale); if (message.message != null && Object.hasOwnProperty.call(message, "message")) @@ -19067,7 +19609,7 @@ * @returns {$protobuf.Writer} Writer */ LocalizedMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -19141,10 +19683,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.locale != null && message.hasOwnProperty("locale")) + if (message.locale != null && Object.hasOwnProperty.call(message, "locale")) if (!$util.isString(message.locale)) return "locale: string expected"; - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) if (!$util.isString(message.message)) return "message: string expected"; return null; @@ -19161,6 +19703,8 @@ LocalizedMessage.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.LocalizedMessage) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.LocalizedMessage: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -19182,17 +19726,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LocalizedMessage.toObject = function toObject(message, options) { + LocalizedMessage.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.locale = ""; object.message = ""; } - if (message.locale != null && message.hasOwnProperty("locale")) + if (message.locale != null && Object.hasOwnProperty.call(message, "locale")) object.locale = message.locale; - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) object.message = message.message; return object; }; @@ -19298,16 +19846,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Status.encode = function encode(message, writer) { + Status.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.details != null && message.details.length) for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -19321,7 +19873,7 @@ * @returns {$protobuf.Writer} Writer */ Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -19401,13 +19953,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) if (!$util.isInteger(message.code)) return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) if (!$util.isString(message.message)) return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { + if (message.details != null && Object.hasOwnProperty.call(message, "details")) { if (!Array.isArray(message.details)) return "details: array expected"; for (var i = 0; i < message.details.length; ++i) { @@ -19430,6 +19982,8 @@ Status.fromObject = function fromObject(object, long) { if (object instanceof $root.google.rpc.Status) return object; + if (!$util.isObject(object)) + throw TypeError(".google.rpc.Status: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -19444,7 +19998,7 @@ throw TypeError(".google.rpc.Status.details: array expected"); message.details = []; for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") + if (!$util.isObject(object.details[i])) throw TypeError(".google.rpc.Status.details: object expected"); message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i], long + 1); } @@ -19461,9 +20015,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Status.toObject = function toObject(message, options) { + Status.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.details = []; @@ -19471,14 +20029,14 @@ object.code = 0; object.message = ""; } - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) object.message = message.message; if (message.details && message.details.length) { object.details = []; for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options, q + 1); } return object; }; @@ -19771,17 +20329,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Backup.encode = function encode(message, writer) { + Backup.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); 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(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sizeBytes); if (message.state != null && Object.hasOwnProperty.call(message, "state")) @@ -19790,19 +20352,19 @@ for (var i = 0; i < message.referencingDatabases.length; ++i) writer.uint32(/* id 7, wireType 2 =*/58).string(message.referencingDatabases[i]); if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.databaseDialect); if (message.referencingBackups != null && message.referencingBackups.length) for (var i = 0; i < message.referencingBackups.length; ++i) writer.uint32(/* id 11, wireType 2 =*/90).string(message.referencingBackups[i]); if (message.maxExpireTime != null && Object.hasOwnProperty.call(message, "maxExpireTime")) - $root.google.protobuf.Timestamp.encode(message.maxExpireTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.maxExpireTime, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.encryptionInformation != null && message.encryptionInformation.length) for (var i = 0; i < message.encryptionInformation.length; ++i) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInformation[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInformation[i], writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); if (message.backupSchedules != null && message.backupSchedules.length) for (var i = 0; i < message.backupSchedules.length; ++i) writer.uint32(/* id 14, wireType 2 =*/114).string(message.backupSchedules[i]); @@ -19813,10 +20375,10 @@ if (message.incrementalBackupChainId != null && Object.hasOwnProperty.call(message, "incrementalBackupChainId")) writer.uint32(/* id 17, wireType 2 =*/138).string(message.incrementalBackupChainId); if (message.oldestVersionTime != null && Object.hasOwnProperty.call(message, "oldestVersionTime")) - $root.google.protobuf.Timestamp.encode(message.oldestVersionTime, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.oldestVersionTime, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); if (message.instancePartitions != null && message.instancePartitions.length) for (var i = 0; i < message.instancePartitions.length; ++i) - $root.google.spanner.admin.database.v1.BackupInstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + $root.google.spanner.admin.database.v1.BackupInstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); return writer; }; @@ -19830,7 +20392,7 @@ * @returns {$protobuf.Writer} Writer */ Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -19982,37 +20544,37 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) { var error = $root.google.protobuf.Timestamp.verify(message.versionTime, long + 1); if (error) return "versionTime." + error; } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) return "sizeBytes: integer|Long expected"; - if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) + if (message.freeableSizeBytes != null && Object.hasOwnProperty.call(message, "freeableSizeBytes")) if (!$util.isInteger(message.freeableSizeBytes) && !(message.freeableSizeBytes && $util.isInteger(message.freeableSizeBytes.low) && $util.isInteger(message.freeableSizeBytes.high))) return "freeableSizeBytes: integer|Long expected"; - if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) + if (message.exclusiveSizeBytes != null && Object.hasOwnProperty.call(message, "exclusiveSizeBytes")) if (!$util.isInteger(message.exclusiveSizeBytes) && !(message.exclusiveSizeBytes && $util.isInteger(message.exclusiveSizeBytes.low) && $util.isInteger(message.exclusiveSizeBytes.high))) return "exclusiveSizeBytes: integer|Long expected"; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) switch (message.state) { default: return "state: enum value expected"; @@ -20021,19 +20583,19 @@ case 2: break; } - if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { + if (message.referencingDatabases != null && Object.hasOwnProperty.call(message, "referencingDatabases")) { if (!Array.isArray(message.referencingDatabases)) return "referencingDatabases: array expected"; for (var i = 0; i < message.referencingDatabases.length; ++i) if (!$util.isString(message.referencingDatabases[i])) return "referencingDatabases: string[] expected"; } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) { var error = $root.google.spanner.admin.database.v1.EncryptionInfo.verify(message.encryptionInfo, long + 1); if (error) return "encryptionInfo." + error; } - if (message.encryptionInformation != null && message.hasOwnProperty("encryptionInformation")) { + if (message.encryptionInformation != null && Object.hasOwnProperty.call(message, "encryptionInformation")) { if (!Array.isArray(message.encryptionInformation)) return "encryptionInformation: array expected"; for (var i = 0; i < message.encryptionInformation.length; ++i) { @@ -20042,7 +20604,7 @@ return "encryptionInformation." + error; } } - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) switch (message.databaseDialect) { default: return "databaseDialect: enum value expected"; @@ -20051,34 +20613,34 @@ case 2: break; } - if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { + if (message.referencingBackups != null && Object.hasOwnProperty.call(message, "referencingBackups")) { if (!Array.isArray(message.referencingBackups)) return "referencingBackups: array expected"; for (var i = 0; i < message.referencingBackups.length; ++i) if (!$util.isString(message.referencingBackups[i])) return "referencingBackups: string[] expected"; } - if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) { + if (message.maxExpireTime != null && Object.hasOwnProperty.call(message, "maxExpireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.maxExpireTime, long + 1); if (error) return "maxExpireTime." + error; } - if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { + if (message.backupSchedules != null && Object.hasOwnProperty.call(message, "backupSchedules")) { if (!Array.isArray(message.backupSchedules)) return "backupSchedules: array expected"; for (var i = 0; i < message.backupSchedules.length; ++i) if (!$util.isString(message.backupSchedules[i])) return "backupSchedules: string[] expected"; } - if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) + if (message.incrementalBackupChainId != null && Object.hasOwnProperty.call(message, "incrementalBackupChainId")) if (!$util.isString(message.incrementalBackupChainId)) return "incrementalBackupChainId: string expected"; - if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) { + if (message.oldestVersionTime != null && Object.hasOwnProperty.call(message, "oldestVersionTime")) { var error = $root.google.protobuf.Timestamp.verify(message.oldestVersionTime, long + 1); if (error) return "oldestVersionTime." + error; } - if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { + if (message.instancePartitions != null && Object.hasOwnProperty.call(message, "instancePartitions")) { if (!Array.isArray(message.instancePartitions)) return "instancePartitions: array expected"; for (var i = 0; i < message.instancePartitions.length; ++i) { @@ -20101,6 +20663,8 @@ Backup.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.Backup) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.Backup: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -20109,25 +20673,25 @@ if (object.database != null) message.database = String(object.database); if (object.versionTime != null) { - if (typeof object.versionTime !== "object") + if (!$util.isObject(object.versionTime)) throw TypeError(".google.spanner.admin.database.v1.Backup.versionTime: object expected"); message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime, long + 1); } if (object.expireTime != null) { - if (typeof object.expireTime !== "object") + if (!$util.isObject(object.expireTime)) throw TypeError(".google.spanner.admin.database.v1.Backup.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); } if (object.name != null) message.name = String(object.name); if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.spanner.admin.database.v1.Backup.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.sizeBytes != null) if ($util.Long) - (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + message.sizeBytes = $util.Long.fromValue(object.sizeBytes, false); else if (typeof object.sizeBytes === "string") message.sizeBytes = parseInt(object.sizeBytes, 10); else if (typeof object.sizeBytes === "number") @@ -20136,7 +20700,7 @@ message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); if (object.freeableSizeBytes != null) if ($util.Long) - (message.freeableSizeBytes = $util.Long.fromValue(object.freeableSizeBytes)).unsigned = false; + message.freeableSizeBytes = $util.Long.fromValue(object.freeableSizeBytes, false); else if (typeof object.freeableSizeBytes === "string") message.freeableSizeBytes = parseInt(object.freeableSizeBytes, 10); else if (typeof object.freeableSizeBytes === "number") @@ -20145,7 +20709,7 @@ message.freeableSizeBytes = new $util.LongBits(object.freeableSizeBytes.low >>> 0, object.freeableSizeBytes.high >>> 0).toNumber(); if (object.exclusiveSizeBytes != null) if ($util.Long) - (message.exclusiveSizeBytes = $util.Long.fromValue(object.exclusiveSizeBytes)).unsigned = false; + message.exclusiveSizeBytes = $util.Long.fromValue(object.exclusiveSizeBytes, false); else if (typeof object.exclusiveSizeBytes === "string") message.exclusiveSizeBytes = parseInt(object.exclusiveSizeBytes, 10); else if (typeof object.exclusiveSizeBytes === "number") @@ -20180,7 +20744,7 @@ message.referencingDatabases[i] = String(object.referencingDatabases[i]); } if (object.encryptionInfo != null) { - if (typeof object.encryptionInfo !== "object") + if (!$util.isObject(object.encryptionInfo)) throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInfo: object expected"); message.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo, long + 1); } @@ -20189,7 +20753,7 @@ throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: array expected"); message.encryptionInformation = []; for (var i = 0; i < object.encryptionInformation.length; ++i) { - if (typeof object.encryptionInformation[i] !== "object") + if (!$util.isObject(object.encryptionInformation[i])) throw TypeError(".google.spanner.admin.database.v1.Backup.encryptionInformation: object expected"); message.encryptionInformation[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInformation[i], long + 1); } @@ -20222,7 +20786,7 @@ message.referencingBackups[i] = String(object.referencingBackups[i]); } if (object.maxExpireTime != null) { - if (typeof object.maxExpireTime !== "object") + if (!$util.isObject(object.maxExpireTime)) throw TypeError(".google.spanner.admin.database.v1.Backup.maxExpireTime: object expected"); message.maxExpireTime = $root.google.protobuf.Timestamp.fromObject(object.maxExpireTime, long + 1); } @@ -20236,7 +20800,7 @@ if (object.incrementalBackupChainId != null) message.incrementalBackupChainId = String(object.incrementalBackupChainId); if (object.oldestVersionTime != null) { - if (typeof object.oldestVersionTime !== "object") + if (!$util.isObject(object.oldestVersionTime)) throw TypeError(".google.spanner.admin.database.v1.Backup.oldestVersionTime: object expected"); message.oldestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.oldestVersionTime, long + 1); } @@ -20245,7 +20809,7 @@ throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: array expected"); message.instancePartitions = []; for (var i = 0; i < object.instancePartitions.length; ++i) { - if (typeof object.instancePartitions[i] !== "object") + if (!$util.isObject(object.instancePartitions[i])) throw TypeError(".google.spanner.admin.database.v1.Backup.instancePartitions: object expected"); message.instancePartitions[i] = $root.google.spanner.admin.database.v1.BackupInstancePartition.fromObject(object.instancePartitions[i], long + 1); } @@ -20262,9 +20826,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Backup.toObject = function toObject(message, options) { + Backup.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.referencingDatabases = []; @@ -20280,9 +20848,9 @@ object.createTime = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.sizeBytes = options.longs === String ? "0" : 0; + object.sizeBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; object.encryptionInfo = null; object.versionTime = null; @@ -20290,78 +20858,84 @@ object.maxExpireTime = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.freeableSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.freeableSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.freeableSizeBytes = options.longs === String ? "0" : 0; + object.freeableSizeBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.exclusiveSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.exclusiveSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.exclusiveSizeBytes = options.longs === String ? "0" : 0; + object.exclusiveSizeBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.incrementalBackupChainId = ""; object.oldestVersionTime = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) - if (typeof message.sizeBytes === "number") + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.sizeBytes = typeof message.sizeBytes === "number" ? BigInt(message.sizeBytes) : $util.Long.fromBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0, false).toBigInt(); + else if (typeof message.sizeBytes === "number") object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; else object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Backup.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Backup.State[message.state] : message.state; if (message.referencingDatabases && message.referencingDatabases.length) { object.referencingDatabases = []; for (var j = 0; j < message.referencingDatabases.length; ++j) object.referencingDatabases[j] = message.referencingDatabases[j]; } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) - object.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo, options); - if (message.versionTime != null && message.hasOwnProperty("versionTime")) - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) + object.encryptionInfo = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo, options, q + 1); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options, q + 1); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; if (message.referencingBackups && message.referencingBackups.length) { object.referencingBackups = []; for (var j = 0; j < message.referencingBackups.length; ++j) object.referencingBackups[j] = message.referencingBackups[j]; } - if (message.maxExpireTime != null && message.hasOwnProperty("maxExpireTime")) - object.maxExpireTime = $root.google.protobuf.Timestamp.toObject(message.maxExpireTime, options); + if (message.maxExpireTime != null && Object.hasOwnProperty.call(message, "maxExpireTime")) + object.maxExpireTime = $root.google.protobuf.Timestamp.toObject(message.maxExpireTime, options, q + 1); if (message.encryptionInformation && message.encryptionInformation.length) { object.encryptionInformation = []; for (var j = 0; j < message.encryptionInformation.length; ++j) - object.encryptionInformation[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInformation[j], options); + object.encryptionInformation[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInformation[j], options, q + 1); } if (message.backupSchedules && message.backupSchedules.length) { object.backupSchedules = []; for (var j = 0; j < message.backupSchedules.length; ++j) object.backupSchedules[j] = message.backupSchedules[j]; } - if (message.freeableSizeBytes != null && message.hasOwnProperty("freeableSizeBytes")) - if (typeof message.freeableSizeBytes === "number") + if (message.freeableSizeBytes != null && Object.hasOwnProperty.call(message, "freeableSizeBytes")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.freeableSizeBytes = typeof message.freeableSizeBytes === "number" ? BigInt(message.freeableSizeBytes) : $util.Long.fromBits(message.freeableSizeBytes.low >>> 0, message.freeableSizeBytes.high >>> 0, false).toBigInt(); + else if (typeof message.freeableSizeBytes === "number") object.freeableSizeBytes = options.longs === String ? String(message.freeableSizeBytes) : message.freeableSizeBytes; else object.freeableSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.freeableSizeBytes) : options.longs === Number ? new $util.LongBits(message.freeableSizeBytes.low >>> 0, message.freeableSizeBytes.high >>> 0).toNumber() : message.freeableSizeBytes; - if (message.exclusiveSizeBytes != null && message.hasOwnProperty("exclusiveSizeBytes")) - if (typeof message.exclusiveSizeBytes === "number") + if (message.exclusiveSizeBytes != null && Object.hasOwnProperty.call(message, "exclusiveSizeBytes")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.exclusiveSizeBytes = typeof message.exclusiveSizeBytes === "number" ? BigInt(message.exclusiveSizeBytes) : $util.Long.fromBits(message.exclusiveSizeBytes.low >>> 0, message.exclusiveSizeBytes.high >>> 0, false).toBigInt(); + else if (typeof message.exclusiveSizeBytes === "number") object.exclusiveSizeBytes = options.longs === String ? String(message.exclusiveSizeBytes) : message.exclusiveSizeBytes; else object.exclusiveSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.exclusiveSizeBytes) : options.longs === Number ? new $util.LongBits(message.exclusiveSizeBytes.low >>> 0, message.exclusiveSizeBytes.high >>> 0).toNumber() : message.exclusiveSizeBytes; - if (message.incrementalBackupChainId != null && message.hasOwnProperty("incrementalBackupChainId")) + if (message.incrementalBackupChainId != null && Object.hasOwnProperty.call(message, "incrementalBackupChainId")) object.incrementalBackupChainId = message.incrementalBackupChainId; - if (message.oldestVersionTime != null && message.hasOwnProperty("oldestVersionTime")) - object.oldestVersionTime = $root.google.protobuf.Timestamp.toObject(message.oldestVersionTime, options); + if (message.oldestVersionTime != null && Object.hasOwnProperty.call(message, "oldestVersionTime")) + object.oldestVersionTime = $root.google.protobuf.Timestamp.toObject(message.oldestVersionTime, options, q + 1); if (message.instancePartitions && message.instancePartitions.length) { object.instancePartitions = []; for (var j = 0; j < message.instancePartitions.length; ++j) - object.instancePartitions[j] = $root.google.spanner.admin.database.v1.BackupInstancePartition.toObject(message.instancePartitions[j], options); + object.instancePartitions[j] = $root.google.spanner.admin.database.v1.BackupInstancePartition.toObject(message.instancePartitions[j], options, q + 1); } return object; }; @@ -20491,17 +21065,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encode = function encode(message, writer) { + CreateBackupRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupId); if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -20515,7 +21093,7 @@ * @returns {$protobuf.Writer} Writer */ CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -20597,18 +21175,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) { var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup, long + 1); if (error) return "backup." + error; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; @@ -20627,6 +21205,8 @@ CreateBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -20637,12 +21217,12 @@ if (object.backupId != null) message.backupId = String(object.backupId); if (object.backup != null) { - if (typeof object.backup !== "object") + if (!$util.isObject(object.backup)) throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.backup: object expected"); message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup, long + 1); } if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.admin.database.v1.CreateBackupRequest.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -20658,9 +21238,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupRequest.toObject = function toObject(message, options) { + CreateBackupRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -20668,14 +21252,14 @@ object.backup = null; object.encryptionConfig = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options, q + 1); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options, q + 1); return object; }; @@ -20788,17 +21372,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupMetadata.encode = function encode(message, writer) { + CreateBackupMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -20812,7 +21400,7 @@ * @returns {$protobuf.Writer} Writer */ CreateBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -20894,18 +21482,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; @@ -20924,6 +21512,8 @@ CreateBackupMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -20934,12 +21524,12 @@ if (object.database != null) message.database = String(object.database); if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.database.v1.CreateBackupMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } @@ -20955,9 +21545,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupMetadata.toObject = function toObject(message, options) { + CreateBackupMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -20965,14 +21559,14 @@ object.progress = null; object.cancelTime = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); return object; }; @@ -21094,9 +21688,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CopyBackupRequest.encode = function encode(message, writer) { + CopyBackupRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) @@ -21104,9 +21702,9 @@ if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -21120,7 +21718,7 @@ * @returns {$protobuf.Writer} Writer */ CopyBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -21206,21 +21804,21 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) if (!$util.isString(message.sourceBackup)) return "sourceBackup: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; @@ -21239,6 +21837,8 @@ CopyBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21251,12 +21851,12 @@ if (object.sourceBackup != null) message.sourceBackup = String(object.sourceBackup); if (object.expireTime != null) { - if (typeof object.expireTime !== "object") + if (!$util.isObject(object.expireTime)) throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); } if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.admin.database.v1.CopyBackupRequest.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -21272,9 +21872,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CopyBackupRequest.toObject = function toObject(message, options) { + CopyBackupRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -21283,16 +21887,16 @@ object.expireTime = null; object.encryptionConfig = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) object.sourceBackup = message.sourceBackup; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.toObject(message.encryptionConfig, options); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.toObject(message.encryptionConfig, options, q + 1); return object; }; @@ -21405,17 +22009,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CopyBackupMetadata.encode = function encode(message, writer) { + CopyBackupMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceBackup); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -21429,7 +22037,7 @@ * @returns {$protobuf.Writer} Writer */ CopyBackupMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -21511,18 +22119,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) if (!$util.isString(message.sourceBackup)) return "sourceBackup: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; @@ -21541,6 +22149,8 @@ CopyBackupMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21551,12 +22161,12 @@ if (object.sourceBackup != null) message.sourceBackup = String(object.sourceBackup); if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.database.v1.CopyBackupMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } @@ -21572,9 +22182,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CopyBackupMetadata.toObject = function toObject(message, options) { + CopyBackupMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -21582,14 +22196,14 @@ object.progress = null; object.cancelTime = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) object.sourceBackup = message.sourceBackup; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); return object; }; @@ -21684,13 +22298,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encode = function encode(message, writer) { + UpdateBackupRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -21704,7 +22322,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -21778,12 +22396,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backup != null && message.hasOwnProperty("backup")) { + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) { var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup, long + 1); if (error) return "backup." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; @@ -21802,18 +22420,20 @@ UpdateBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.database.v1.UpdateBackupRequest(); if (object.backup != null) { - if (typeof object.backup !== "object") + if (!$util.isObject(object.backup)) throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.backup: object expected"); message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup, long + 1); } if (object.updateMask != null) { - if (typeof object.updateMask !== "object") + if (!$util.isObject(object.updateMask)) throw TypeError(".google.spanner.admin.database.v1.UpdateBackupRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -21829,18 +22449,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBackupRequest.toObject = function toObject(message, options) { + UpdateBackupRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.backup = null; object.updateMask = null; } - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); return object; }; @@ -21926,9 +22550,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encode = function encode(message, writer) { + GetBackupRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -21944,7 +22572,7 @@ * @returns {$protobuf.Writer} Writer */ GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -22014,7 +22642,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -22031,6 +22659,8 @@ GetBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.GetBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.GetBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22050,13 +22680,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBackupRequest.toObject = function toObject(message, options) { + GetBackupRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -22143,9 +22777,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encode = function encode(message, writer) { + DeleteBackupRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -22161,7 +22799,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -22231,7 +22869,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -22248,6 +22886,8 @@ DeleteBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.DeleteBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22267,13 +22907,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteBackupRequest.toObject = function toObject(message, options) { + DeleteBackupRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -22387,9 +23031,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encode = function encode(message, writer) { + ListBackupsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) @@ -22411,7 +23059,7 @@ * @returns {$protobuf.Writer} Writer */ ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -22493,16 +23141,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -22519,6 +23167,8 @@ ListBackupsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22544,9 +23194,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsRequest.toObject = function toObject(message, options) { + ListBackupsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -22554,13 +23208,13 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -22657,12 +23311,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encode = function encode(message, writer) { + ListBackupsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backups != null && message.backups.length) for (var i = 0; i < message.backups.length; ++i) - $root.google.spanner.admin.database.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -22678,7 +23336,7 @@ * @returns {$protobuf.Writer} Writer */ ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -22754,7 +23412,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backups != null && message.hasOwnProperty("backups")) { + if (message.backups != null && Object.hasOwnProperty.call(message, "backups")) { if (!Array.isArray(message.backups)) return "backups: array expected"; for (var i = 0; i < message.backups.length; ++i) { @@ -22763,7 +23421,7 @@ return "backups." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -22780,6 +23438,8 @@ ListBackupsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListBackupsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22790,7 +23450,7 @@ throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: array expected"); message.backups = []; for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") + if (!$util.isObject(object.backups[i])) throw TypeError(".google.spanner.admin.database.v1.ListBackupsResponse.backups: object expected"); message.backups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backups[i], long + 1); } @@ -22809,9 +23469,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsResponse.toObject = function toObject(message, options) { + ListBackupsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.backups = []; @@ -22820,9 +23484,9 @@ if (message.backups && message.backups.length) { object.backups = []; for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.backups[j], options); + object.backups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.backups[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -22936,9 +23600,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupOperationsRequest.encode = function encode(message, writer) { + ListBackupOperationsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) @@ -22960,7 +23628,7 @@ * @returns {$protobuf.Writer} Writer */ ListBackupOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -23042,16 +23710,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -23068,6 +23736,8 @@ ListBackupOperationsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -23093,9 +23763,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupOperationsRequest.toObject = function toObject(message, options) { + ListBackupOperationsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -23103,13 +23777,13 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -23206,12 +23880,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupOperationsResponse.encode = function encode(message, writer) { + ListBackupOperationsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -23227,7 +23905,7 @@ * @returns {$protobuf.Writer} Writer */ ListBackupOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -23303,7 +23981,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operations != null && message.hasOwnProperty("operations")) { + if (message.operations != null && Object.hasOwnProperty.call(message, "operations")) { if (!Array.isArray(message.operations)) return "operations: array expected"; for (var i = 0; i < message.operations.length; ++i) { @@ -23312,7 +23990,7 @@ return "operations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -23329,6 +24007,8 @@ ListBackupOperationsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListBackupOperationsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -23339,7 +24019,7 @@ throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: array expected"); message.operations = []; for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") + if (!$util.isObject(object.operations[i])) throw TypeError(".google.spanner.admin.database.v1.ListBackupOperationsResponse.operations: object expected"); message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); } @@ -23358,9 +24038,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupOperationsResponse.toObject = function toObject(message, options) { + ListBackupOperationsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.operations = []; @@ -23369,9 +24053,9 @@ if (message.operations && message.operations.length) { object.operations = []; for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -23485,17 +24169,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupInfo.encode = function encode(message, writer) { + BackupInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.backup); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceDatabase); if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -23509,7 +24197,7 @@ * @returns {$protobuf.Writer} Writer */ BackupInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -23591,20 +24279,20 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backup != null && message.hasOwnProperty("backup")) + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) if (!$util.isString(message.backup)) return "backup: string expected"; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) { var error = $root.google.protobuf.Timestamp.verify(message.versionTime, long + 1); if (error) return "versionTime." + error; } - if (message.createTime != null && message.hasOwnProperty("createTime")) { + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) if (!$util.isString(message.sourceDatabase)) return "sourceDatabase: string expected"; return null; @@ -23621,6 +24309,8 @@ BackupInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.BackupInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.BackupInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -23629,12 +24319,12 @@ if (object.backup != null) message.backup = String(object.backup); if (object.versionTime != null) { - if (typeof object.versionTime !== "object") + if (!$util.isObject(object.versionTime)) throw TypeError(".google.spanner.admin.database.v1.BackupInfo.versionTime: object expected"); message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime, long + 1); } if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.spanner.admin.database.v1.BackupInfo.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } @@ -23652,9 +24342,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupInfo.toObject = function toObject(message, options) { + BackupInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.backup = ""; @@ -23662,14 +24356,14 @@ object.sourceDatabase = ""; object.versionTime = null; } - if (message.backup != null && message.hasOwnProperty("backup")) + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) object.backup = message.backup; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.sourceDatabase != null && message.hasOwnProperty("sourceDatabase")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.sourceDatabase != null && Object.hasOwnProperty.call(message, "sourceDatabase")) object.sourceDatabase = message.sourceDatabase; - if (message.versionTime != null && message.hasOwnProperty("versionTime")) - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options, q + 1); return object; }; @@ -23774,9 +24468,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupEncryptionConfig.encode = function encode(message, writer) { + CreateBackupEncryptionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) @@ -23797,7 +24495,7 @@ * @returns {$protobuf.Writer} Writer */ CreateBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -23877,7 +24575,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) switch (message.encryptionType) { default: return "encryptionType: enum value expected"; @@ -23887,10 +24585,10 @@ case 3: break; } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) if (!$util.isString(message.kmsKeyName)) return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (message.kmsKeyNames != null && Object.hasOwnProperty.call(message, "kmsKeyNames")) { if (!Array.isArray(message.kmsKeyNames)) return "kmsKeyNames: array expected"; for (var i = 0; i < message.kmsKeyNames.length; ++i) @@ -23911,6 +24609,8 @@ CreateBackupEncryptionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CreateBackupEncryptionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -23961,9 +24661,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupEncryptionConfig.toObject = function toObject(message, options) { + CreateBackupEncryptionConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.kmsKeyNames = []; @@ -23971,9 +24675,9 @@ object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; object.kmsKeyName = ""; } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) object.kmsKeyName = message.kmsKeyName; if (message.kmsKeyNames && message.kmsKeyNames.length) { object.kmsKeyNames = []; @@ -24102,9 +24806,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CopyBackupEncryptionConfig.encode = function encode(message, writer) { + CopyBackupEncryptionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) @@ -24125,7 +24833,7 @@ * @returns {$protobuf.Writer} Writer */ CopyBackupEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -24205,7 +24913,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) switch (message.encryptionType) { default: return "encryptionType: enum value expected"; @@ -24215,10 +24923,10 @@ case 3: break; } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) if (!$util.isString(message.kmsKeyName)) return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (message.kmsKeyNames != null && Object.hasOwnProperty.call(message, "kmsKeyNames")) { if (!Array.isArray(message.kmsKeyNames)) return "kmsKeyNames: array expected"; for (var i = 0; i < message.kmsKeyNames.length; ++i) @@ -24239,6 +24947,8 @@ CopyBackupEncryptionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CopyBackupEncryptionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24289,9 +24999,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CopyBackupEncryptionConfig.toObject = function toObject(message, options) { + CopyBackupEncryptionConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.kmsKeyNames = []; @@ -24299,9 +25013,9 @@ object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; object.kmsKeyName = ""; } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.CopyBackupEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) object.kmsKeyName = message.kmsKeyName; if (message.kmsKeyNames && message.kmsKeyNames.length) { object.kmsKeyNames = []; @@ -24402,9 +25116,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FullBackupSpec.encode = function encode(message, writer) { + FullBackupSpec.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -24418,7 +25136,7 @@ * @returns {$protobuf.Writer} Writer */ FullBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -24498,10 +25216,6 @@ FullBackupSpec.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.FullBackupSpec) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.spanner.admin.database.v1.FullBackupSpec(); }; @@ -24591,9 +25305,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IncrementalBackupSpec.encode = function encode(message, writer) { + IncrementalBackupSpec.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -24607,7 +25325,7 @@ * @returns {$protobuf.Writer} Writer */ IncrementalBackupSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -24687,10 +25405,6 @@ IncrementalBackupSpec.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.IncrementalBackupSpec) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.spanner.admin.database.v1.IncrementalBackupSpec(); }; @@ -24789,9 +25503,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupInstancePartition.encode = function encode(message, writer) { + BackupInstancePartition.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instancePartition); return writer; @@ -24807,7 +25525,7 @@ * @returns {$protobuf.Writer} Writer */ BackupInstancePartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -24877,7 +25595,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) if (!$util.isString(message.instancePartition)) return "instancePartition: string expected"; return null; @@ -24894,6 +25612,8 @@ BackupInstancePartition.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.BackupInstancePartition) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.BackupInstancePartition: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24913,13 +25633,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupInstancePartition.toObject = function toObject(message, options) { + BackupInstancePartition.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.instancePartition = ""; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) object.instancePartition = message.instancePartition; return object; }; @@ -25024,15 +25748,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationProgress.encode = function encode(message, writer) { + OperationProgress.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -25046,7 +25774,7 @@ * @returns {$protobuf.Writer} Writer */ OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -25124,15 +25852,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) if (!$util.isInteger(message.progressPercent)) return "progressPercent: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; @@ -25151,6 +25879,8 @@ OperationProgress.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.OperationProgress) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.OperationProgress: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25159,12 +25889,12 @@ if (object.progressPercent != null) message.progressPercent = object.progressPercent | 0; if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.admin.database.v1.OperationProgress.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.endTime != null) { - if (typeof object.endTime !== "object") + if (!$util.isObject(object.endTime)) throw TypeError(".google.spanner.admin.database.v1.OperationProgress.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -25180,21 +25910,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationProgress.toObject = function toObject(message, options) { + OperationProgress.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.progressPercent = 0; object.startTime = null; object.endTime = null; } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) object.progressPercent = message.progressPercent; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); return object; }; @@ -25290,9 +26024,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionConfig.encode = function encode(message, writer) { + EncryptionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyName); if (message.kmsKeyNames != null && message.kmsKeyNames.length) @@ -25311,7 +26049,7 @@ * @returns {$protobuf.Writer} Writer */ EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -25387,10 +26125,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) if (!$util.isString(message.kmsKeyName)) return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (message.kmsKeyNames != null && Object.hasOwnProperty.call(message, "kmsKeyNames")) { if (!Array.isArray(message.kmsKeyNames)) return "kmsKeyNames: array expected"; for (var i = 0; i < message.kmsKeyNames.length; ++i) @@ -25411,6 +26149,8 @@ EncryptionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.EncryptionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.EncryptionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25437,15 +26177,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionConfig.toObject = function toObject(message, options) { + EncryptionConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.kmsKeyNames = []; if (options.defaults) object.kmsKeyName = ""; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) object.kmsKeyName = message.kmsKeyName; if (message.kmsKeyNames && message.kmsKeyNames.length) { object.kmsKeyNames = []; @@ -25555,15 +26299,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionInfo.encode = function encode(message, writer) { + EncryptionInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyVersion); if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.encryptionType); if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) - $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.rpc.Status.encode(message.encryptionStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -25577,7 +26325,7 @@ * @returns {$protobuf.Writer} Writer */ EncryptionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -25655,7 +26403,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) switch (message.encryptionType) { default: return "encryptionType: enum value expected"; @@ -25664,12 +26412,12 @@ case 2: break; } - if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) { + if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) { var error = $root.google.rpc.Status.verify(message.encryptionStatus, long + 1); if (error) return "encryptionStatus." + error; } - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) if (!$util.isString(message.kmsKeyVersion)) return "kmsKeyVersion: string expected"; return null; @@ -25686,6 +26434,8 @@ EncryptionInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.EncryptionInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.EncryptionInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25712,7 +26462,7 @@ break; } if (object.encryptionStatus != null) { - if (typeof object.encryptionStatus !== "object") + if (!$util.isObject(object.encryptionStatus)) throw TypeError(".google.spanner.admin.database.v1.EncryptionInfo.encryptionStatus: object expected"); message.encryptionStatus = $root.google.rpc.Status.fromObject(object.encryptionStatus, long + 1); } @@ -25730,21 +26480,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionInfo.toObject = function toObject(message, options) { + EncryptionInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.kmsKeyVersion = ""; object.encryptionType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; object.encryptionStatus = null; } - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) object.kmsKeyVersion = message.kmsKeyVersion; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.EncryptionInfo.Type[message.encryptionType] : message.encryptionType; - if (message.encryptionStatus != null && message.hasOwnProperty("encryptionStatus")) - object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options); + if (message.encryptionStatus != null && Object.hasOwnProperty.call(message, "encryptionStatus")) + object.encryptionStatus = $root.google.rpc.Status.toObject(message.encryptionStatus, options, q + 1); return object; }; @@ -25876,11 +26630,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupScheduleSpec.encode = function encode(message, writer) { + BackupScheduleSpec.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) - $root.google.spanner.admin.database.v1.CrontabSpec.encode(message.cronSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.CrontabSpec.encode(message.cronSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -25894,7 +26652,7 @@ * @returns {$protobuf.Writer} Writer */ BackupScheduleSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -25965,7 +26723,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { + if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) { properties.scheduleSpec = 1; { var error = $root.google.spanner.admin.database.v1.CrontabSpec.verify(message.cronSpec, long + 1); @@ -25987,13 +26745,15 @@ BackupScheduleSpec.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.BackupScheduleSpec) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.BackupScheduleSpec: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.database.v1.BackupScheduleSpec(); if (object.cronSpec != null) { - if (typeof object.cronSpec !== "object") + if (!$util.isObject(object.cronSpec)) throw TypeError(".google.spanner.admin.database.v1.BackupScheduleSpec.cronSpec: object expected"); message.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.fromObject(object.cronSpec, long + 1); } @@ -26009,12 +26769,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupScheduleSpec.toObject = function toObject(message, options) { + BackupScheduleSpec.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) { - object.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.toObject(message.cronSpec, options); + if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) { + object.cronSpec = $root.google.spanner.admin.database.v1.CrontabSpec.toObject(message.cronSpec, options, q + 1); if (options.oneofs) object.scheduleSpec = "cronSpec"; } @@ -26171,23 +26935,27 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupSchedule.encode = function encode(message, writer) { + BackupSchedule.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) - $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.retentionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) - $root.google.spanner.admin.database.v1.BackupScheduleSpec.encode(message.spec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.admin.database.v1.BackupScheduleSpec.encode(message.spec, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.fullBackupSpec != null && Object.hasOwnProperty.call(message, "fullBackupSpec")) - $root.google.spanner.admin.database.v1.FullBackupSpec.encode(message.fullBackupSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.admin.database.v1.FullBackupSpec.encode(message.fullBackupSpec, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.incrementalBackupSpec != null && Object.hasOwnProperty.call(message, "incrementalBackupSpec")) - $root.google.spanner.admin.database.v1.IncrementalBackupSpec.encode(message.incrementalBackupSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.spanner.admin.database.v1.IncrementalBackupSpec.encode(message.incrementalBackupSpec, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -26201,7 +26969,7 @@ * @returns {$protobuf.Writer} Writer */ BackupSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -26296,25 +27064,25 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.spec != null && message.hasOwnProperty("spec")) { + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) { var error = $root.google.spanner.admin.database.v1.BackupScheduleSpec.verify(message.spec, long + 1); if (error) return "spec." + error; } - if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) { + if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) { var error = $root.google.protobuf.Duration.verify(message.retentionDuration, long + 1); if (error) return "retentionDuration." + error; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; } - if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { + if (message.fullBackupSpec != null && Object.hasOwnProperty.call(message, "fullBackupSpec")) { properties.backupTypeSpec = 1; { var error = $root.google.spanner.admin.database.v1.FullBackupSpec.verify(message.fullBackupSpec, long + 1); @@ -26322,7 +27090,7 @@ return "fullBackupSpec." + error; } } - if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { + if (message.incrementalBackupSpec != null && Object.hasOwnProperty.call(message, "incrementalBackupSpec")) { if (properties.backupTypeSpec === 1) return "backupTypeSpec: multiple values"; properties.backupTypeSpec = 1; @@ -26332,7 +27100,7 @@ return "incrementalBackupSpec." + error; } } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; @@ -26351,6 +27119,8 @@ BackupSchedule.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.BackupSchedule) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.BackupSchedule: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26359,32 +27129,32 @@ if (object.name != null) message.name = String(object.name); if (object.spec != null) { - if (typeof object.spec !== "object") + if (!$util.isObject(object.spec)) throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.spec: object expected"); message.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.fromObject(object.spec, long + 1); } if (object.retentionDuration != null) { - if (typeof object.retentionDuration !== "object") + if (!$util.isObject(object.retentionDuration)) throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.retentionDuration: object expected"); message.retentionDuration = $root.google.protobuf.Duration.fromObject(object.retentionDuration, long + 1); } if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.fromObject(object.encryptionConfig, long + 1); } if (object.fullBackupSpec != null) { - if (typeof object.fullBackupSpec !== "object") + if (!$util.isObject(object.fullBackupSpec)) throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.fullBackupSpec: object expected"); message.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.fromObject(object.fullBackupSpec, long + 1); } if (object.incrementalBackupSpec != null) { - if (typeof object.incrementalBackupSpec !== "object") + if (!$util.isObject(object.incrementalBackupSpec)) throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.incrementalBackupSpec: object expected"); message.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.fromObject(object.incrementalBackupSpec, long + 1); } if (object.updateTime != null) { - if (typeof object.updateTime !== "object") + if (!$util.isObject(object.updateTime)) throw TypeError(".google.spanner.admin.database.v1.BackupSchedule.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -26400,9 +27170,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupSchedule.toObject = function toObject(message, options) { + BackupSchedule.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -26411,26 +27185,26 @@ object.spec = null; object.updateTime = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.retentionDuration != null && message.hasOwnProperty("retentionDuration")) - object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options); - if (message.spec != null && message.hasOwnProperty("spec")) - object.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.toObject(message.spec, options); - if (message.fullBackupSpec != null && message.hasOwnProperty("fullBackupSpec")) { - object.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.toObject(message.fullBackupSpec, options); + if (message.retentionDuration != null && Object.hasOwnProperty.call(message, "retentionDuration")) + object.retentionDuration = $root.google.protobuf.Duration.toObject(message.retentionDuration, options, q + 1); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.CreateBackupEncryptionConfig.toObject(message.encryptionConfig, options, q + 1); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + object.spec = $root.google.spanner.admin.database.v1.BackupScheduleSpec.toObject(message.spec, options, q + 1); + if (message.fullBackupSpec != null && Object.hasOwnProperty.call(message, "fullBackupSpec")) { + object.fullBackupSpec = $root.google.spanner.admin.database.v1.FullBackupSpec.toObject(message.fullBackupSpec, options, q + 1); if (options.oneofs) object.backupTypeSpec = "fullBackupSpec"; } - if (message.incrementalBackupSpec != null && message.hasOwnProperty("incrementalBackupSpec")) { - object.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.toObject(message.incrementalBackupSpec, options); + if (message.incrementalBackupSpec != null && Object.hasOwnProperty.call(message, "incrementalBackupSpec")) { + object.incrementalBackupSpec = $root.google.spanner.admin.database.v1.IncrementalBackupSpec.toObject(message.incrementalBackupSpec, options, q + 1); if (options.oneofs) object.backupTypeSpec = "incrementalBackupSpec"; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); return object; }; @@ -26534,15 +27308,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CrontabSpec.encode = function encode(message, writer) { + CrontabSpec.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.text != null && Object.hasOwnProperty.call(message, "text")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeZone); if (message.creationWindow != null && Object.hasOwnProperty.call(message, "creationWindow")) - $root.google.protobuf.Duration.encode(message.creationWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.creationWindow, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -26556,7 +27334,7 @@ * @returns {$protobuf.Writer} Writer */ CrontabSpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -26634,13 +27412,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.text != null && message.hasOwnProperty("text")) + if (message.text != null && Object.hasOwnProperty.call(message, "text")) if (!$util.isString(message.text)) return "text: string expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) if (!$util.isString(message.timeZone)) return "timeZone: string expected"; - if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) { + if (message.creationWindow != null && Object.hasOwnProperty.call(message, "creationWindow")) { var error = $root.google.protobuf.Duration.verify(message.creationWindow, long + 1); if (error) return "creationWindow." + error; @@ -26659,6 +27437,8 @@ CrontabSpec.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CrontabSpec) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CrontabSpec: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26669,7 +27449,7 @@ if (object.timeZone != null) message.timeZone = String(object.timeZone); if (object.creationWindow != null) { - if (typeof object.creationWindow !== "object") + if (!$util.isObject(object.creationWindow)) throw TypeError(".google.spanner.admin.database.v1.CrontabSpec.creationWindow: object expected"); message.creationWindow = $root.google.protobuf.Duration.fromObject(object.creationWindow, long + 1); } @@ -26685,21 +27465,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CrontabSpec.toObject = function toObject(message, options) { + CrontabSpec.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.text = ""; object.timeZone = ""; object.creationWindow = null; } - if (message.text != null && message.hasOwnProperty("text")) + if (message.text != null && Object.hasOwnProperty.call(message, "text")) object.text = message.text; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) object.timeZone = message.timeZone; - if (message.creationWindow != null && message.hasOwnProperty("creationWindow")) - object.creationWindow = $root.google.protobuf.Duration.toObject(message.creationWindow, options); + if (message.creationWindow != null && Object.hasOwnProperty.call(message, "creationWindow")) + object.creationWindow = $root.google.protobuf.Duration.toObject(message.creationWindow, options, q + 1); return object; }; @@ -26803,15 +27587,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupScheduleRequest.encode = function encode(message, writer) { + CreateBackupScheduleRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.backupScheduleId != null && Object.hasOwnProperty.call(message, "backupScheduleId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupScheduleId); if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -26825,7 +27613,7 @@ * @returns {$protobuf.Writer} Writer */ CreateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -26903,13 +27691,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) + if (message.backupScheduleId != null && Object.hasOwnProperty.call(message, "backupScheduleId")) if (!$util.isString(message.backupScheduleId)) return "backupScheduleId: string expected"; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) { var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule, long + 1); if (error) return "backupSchedule." + error; @@ -26928,6 +27716,8 @@ CreateBackupScheduleRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CreateBackupScheduleRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26938,7 +27728,7 @@ if (object.backupScheduleId != null) message.backupScheduleId = String(object.backupScheduleId); if (object.backupSchedule != null) { - if (typeof object.backupSchedule !== "object") + if (!$util.isObject(object.backupSchedule)) throw TypeError(".google.spanner.admin.database.v1.CreateBackupScheduleRequest.backupSchedule: object expected"); message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule, long + 1); } @@ -26954,21 +27744,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupScheduleRequest.toObject = function toObject(message, options) { + CreateBackupScheduleRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.backupScheduleId = ""; object.backupSchedule = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.backupScheduleId != null && message.hasOwnProperty("backupScheduleId")) + if (message.backupScheduleId != null && Object.hasOwnProperty.call(message, "backupScheduleId")) object.backupScheduleId = message.backupScheduleId; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) - object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) + object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options, q + 1); return object; }; @@ -27054,9 +27848,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupScheduleRequest.encode = function encode(message, writer) { + GetBackupScheduleRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -27072,7 +27870,7 @@ * @returns {$protobuf.Writer} Writer */ GetBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -27142,7 +27940,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -27159,6 +27957,8 @@ GetBackupScheduleRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.GetBackupScheduleRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.GetBackupScheduleRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -27178,13 +27978,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBackupScheduleRequest.toObject = function toObject(message, options) { + GetBackupScheduleRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -27271,9 +28075,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupScheduleRequest.encode = function encode(message, writer) { + DeleteBackupScheduleRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -27289,7 +28097,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -27359,7 +28167,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -27376,6 +28184,8 @@ DeleteBackupScheduleRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.DeleteBackupScheduleRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -27395,13 +28205,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteBackupScheduleRequest.toObject = function toObject(message, options) { + DeleteBackupScheduleRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -27506,9 +28320,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupSchedulesRequest.encode = function encode(message, writer) { + ListBackupSchedulesRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -27528,7 +28346,7 @@ * @returns {$protobuf.Writer} Writer */ ListBackupSchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -27606,13 +28424,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -27629,6 +28447,8 @@ ListBackupSchedulesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -27652,20 +28472,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupSchedulesRequest.toObject = function toObject(message, options) { + ListBackupSchedulesRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -27762,12 +28586,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupSchedulesResponse.encode = function encode(message, writer) { + ListBackupSchedulesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupSchedules != null && message.backupSchedules.length) for (var i = 0; i < message.backupSchedules.length; ++i) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -27783,7 +28611,7 @@ * @returns {$protobuf.Writer} Writer */ ListBackupSchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -27859,7 +28687,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backupSchedules != null && message.hasOwnProperty("backupSchedules")) { + if (message.backupSchedules != null && Object.hasOwnProperty.call(message, "backupSchedules")) { if (!Array.isArray(message.backupSchedules)) return "backupSchedules: array expected"; for (var i = 0; i < message.backupSchedules.length; ++i) { @@ -27868,7 +28696,7 @@ return "backupSchedules." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -27885,6 +28713,8 @@ ListBackupSchedulesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -27895,7 +28725,7 @@ throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: array expected"); message.backupSchedules = []; for (var i = 0; i < object.backupSchedules.length; ++i) { - if (typeof object.backupSchedules[i] !== "object") + if (!$util.isObject(object.backupSchedules[i])) throw TypeError(".google.spanner.admin.database.v1.ListBackupSchedulesResponse.backupSchedules: object expected"); message.backupSchedules[i] = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedules[i], long + 1); } @@ -27914,9 +28744,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupSchedulesResponse.toObject = function toObject(message, options) { + ListBackupSchedulesResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.backupSchedules = []; @@ -27925,9 +28759,9 @@ if (message.backupSchedules && message.backupSchedules.length) { object.backupSchedules = []; for (var j = 0; j < message.backupSchedules.length; ++j) - object.backupSchedules[j] = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedules[j], options); + object.backupSchedules[j] = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedules[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -28023,13 +28857,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupScheduleRequest.encode = function encode(message, writer) { + UpdateBackupScheduleRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) - $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.BackupSchedule.encode(message.backupSchedule, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -28043,7 +28881,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateBackupScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -28117,12 +28955,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) { + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) { var error = $root.google.spanner.admin.database.v1.BackupSchedule.verify(message.backupSchedule, long + 1); if (error) return "backupSchedule." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; @@ -28141,18 +28979,20 @@ UpdateBackupScheduleRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest(); if (object.backupSchedule != null) { - if (typeof object.backupSchedule !== "object") + if (!$util.isObject(object.backupSchedule)) throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.backupSchedule: object expected"); message.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.fromObject(object.backupSchedule, long + 1); } if (object.updateMask != null) { - if (typeof object.updateMask !== "object") + if (!$util.isObject(object.updateMask)) throw TypeError(".google.spanner.admin.database.v1.UpdateBackupScheduleRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -28168,18 +29008,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBackupScheduleRequest.toObject = function toObject(message, options) { + UpdateBackupScheduleRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.backupSchedule = null; object.updateMask = null; } - if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) - object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backupSchedule != null && Object.hasOwnProperty.call(message, "backupSchedule")) + object.backupSchedule = $root.google.spanner.admin.database.v1.BackupSchedule.toObject(message.backupSchedule, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); return object; }; @@ -28264,7 +29108,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.listDatabases = function listDatabases(request, callback) { - return this.rpcCall(listDatabases, $root.google.spanner.admin.database.v1.ListDatabasesRequest, $root.google.spanner.admin.database.v1.ListDatabasesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listDatabases, $root.google.spanner.admin.database.v1.ListDatabasesRequest, $root.google.spanner.admin.database.v1.ListDatabasesResponse, request, callback); }, "name", { value: "ListDatabases" }); /** @@ -28297,7 +29141,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.createDatabase = function createDatabase(request, callback) { - return this.rpcCall(createDatabase, $root.google.spanner.admin.database.v1.CreateDatabaseRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createDatabase, $root.google.spanner.admin.database.v1.CreateDatabaseRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CreateDatabase" }); /** @@ -28330,7 +29174,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.getDatabase = function getDatabase(request, callback) { - return this.rpcCall(getDatabase, $root.google.spanner.admin.database.v1.GetDatabaseRequest, $root.google.spanner.admin.database.v1.Database, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getDatabase, $root.google.spanner.admin.database.v1.GetDatabaseRequest, $root.google.spanner.admin.database.v1.Database, request, callback); }, "name", { value: "GetDatabase" }); /** @@ -28363,7 +29207,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.updateDatabase = function updateDatabase(request, callback) { - return this.rpcCall(updateDatabase, $root.google.spanner.admin.database.v1.UpdateDatabaseRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateDatabase, $root.google.spanner.admin.database.v1.UpdateDatabaseRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "UpdateDatabase" }); /** @@ -28396,7 +29240,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.updateDatabaseDdl = function updateDatabaseDdl(request, callback) { - return this.rpcCall(updateDatabaseDdl, $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateDatabaseDdl, $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "UpdateDatabaseDdl" }); /** @@ -28429,7 +29273,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.dropDatabase = function dropDatabase(request, callback) { - return this.rpcCall(dropDatabase, $root.google.spanner.admin.database.v1.DropDatabaseRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, dropDatabase, $root.google.spanner.admin.database.v1.DropDatabaseRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DropDatabase" }); /** @@ -28462,7 +29306,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.getDatabaseDdl = function getDatabaseDdl(request, callback) { - return this.rpcCall(getDatabaseDdl, $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest, $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getDatabaseDdl, $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest, $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse, request, callback); }, "name", { value: "GetDatabaseDdl" }); /** @@ -28495,7 +29339,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "SetIamPolicy" }); /** @@ -28528,7 +29372,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "GetIamPolicy" }); /** @@ -28561,7 +29405,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); }, "name", { value: "TestIamPermissions" }); /** @@ -28594,7 +29438,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.spanner.admin.database.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createBackup, $root.google.spanner.admin.database.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CreateBackup" }); /** @@ -28627,7 +29471,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.copyBackup = function copyBackup(request, callback) { - return this.rpcCall(copyBackup, $root.google.spanner.admin.database.v1.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, copyBackup, $root.google.spanner.admin.database.v1.CopyBackupRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CopyBackup" }); /** @@ -28660,7 +29504,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.spanner.admin.database.v1.GetBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getBackup, $root.google.spanner.admin.database.v1.GetBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); }, "name", { value: "GetBackup" }); /** @@ -28693,7 +29537,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.spanner.admin.database.v1.UpdateBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateBackup, $root.google.spanner.admin.database.v1.UpdateBackupRequest, $root.google.spanner.admin.database.v1.Backup, request, callback); }, "name", { value: "UpdateBackup" }); /** @@ -28726,7 +29570,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.spanner.admin.database.v1.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteBackup, $root.google.spanner.admin.database.v1.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteBackup" }); /** @@ -28759,7 +29603,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.spanner.admin.database.v1.ListBackupsRequest, $root.google.spanner.admin.database.v1.ListBackupsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listBackups, $root.google.spanner.admin.database.v1.ListBackupsRequest, $root.google.spanner.admin.database.v1.ListBackupsResponse, request, callback); }, "name", { value: "ListBackups" }); /** @@ -28792,7 +29636,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.restoreDatabase = function restoreDatabase(request, callback) { - return this.rpcCall(restoreDatabase, $root.google.spanner.admin.database.v1.RestoreDatabaseRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, restoreDatabase, $root.google.spanner.admin.database.v1.RestoreDatabaseRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "RestoreDatabase" }); /** @@ -28825,7 +29669,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.listDatabaseOperations = function listDatabaseOperations(request, callback) { - return this.rpcCall(listDatabaseOperations, $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listDatabaseOperations, $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest, $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse, request, callback); }, "name", { value: "ListDatabaseOperations" }); /** @@ -28858,7 +29702,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.listBackupOperations = function listBackupOperations(request, callback) { - return this.rpcCall(listBackupOperations, $root.google.spanner.admin.database.v1.ListBackupOperationsRequest, $root.google.spanner.admin.database.v1.ListBackupOperationsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listBackupOperations, $root.google.spanner.admin.database.v1.ListBackupOperationsRequest, $root.google.spanner.admin.database.v1.ListBackupOperationsResponse, request, callback); }, "name", { value: "ListBackupOperations" }); /** @@ -28891,7 +29735,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.listDatabaseRoles = function listDatabaseRoles(request, callback) { - return this.rpcCall(listDatabaseRoles, $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest, $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listDatabaseRoles, $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest, $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse, request, callback); }, "name", { value: "ListDatabaseRoles" }); /** @@ -28924,7 +29768,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.addSplitPoints = function addSplitPoints(request, callback) { - return this.rpcCall(addSplitPoints, $root.google.spanner.admin.database.v1.AddSplitPointsRequest, $root.google.spanner.admin.database.v1.AddSplitPointsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, addSplitPoints, $root.google.spanner.admin.database.v1.AddSplitPointsRequest, $root.google.spanner.admin.database.v1.AddSplitPointsResponse, request, callback); }, "name", { value: "AddSplitPoints" }); /** @@ -28957,7 +29801,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.createBackupSchedule = function createBackupSchedule(request, callback) { - return this.rpcCall(createBackupSchedule, $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createBackupSchedule, $root.google.spanner.admin.database.v1.CreateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); }, "name", { value: "CreateBackupSchedule" }); /** @@ -28990,7 +29834,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.getBackupSchedule = function getBackupSchedule(request, callback) { - return this.rpcCall(getBackupSchedule, $root.google.spanner.admin.database.v1.GetBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getBackupSchedule, $root.google.spanner.admin.database.v1.GetBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); }, "name", { value: "GetBackupSchedule" }); /** @@ -29023,7 +29867,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.updateBackupSchedule = function updateBackupSchedule(request, callback) { - return this.rpcCall(updateBackupSchedule, $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateBackupSchedule, $root.google.spanner.admin.database.v1.UpdateBackupScheduleRequest, $root.google.spanner.admin.database.v1.BackupSchedule, request, callback); }, "name", { value: "UpdateBackupSchedule" }); /** @@ -29056,7 +29900,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.deleteBackupSchedule = function deleteBackupSchedule(request, callback) { - return this.rpcCall(deleteBackupSchedule, $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteBackupSchedule, $root.google.spanner.admin.database.v1.DeleteBackupScheduleRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteBackupSchedule" }); /** @@ -29089,7 +29933,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.listBackupSchedules = function listBackupSchedules(request, callback) { - return this.rpcCall(listBackupSchedules, $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest, $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listBackupSchedules, $root.google.spanner.admin.database.v1.ListBackupSchedulesRequest, $root.google.spanner.admin.database.v1.ListBackupSchedulesResponse, request, callback); }, "name", { value: "ListBackupSchedules" }); /** @@ -29122,7 +29966,7 @@ * @variation 1 */ Object.defineProperty(DatabaseAdmin.prototype.internalUpdateGraphOperation = function internalUpdateGraphOperation(request, callback) { - return this.rpcCall(internalUpdateGraphOperation, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, internalUpdateGraphOperation, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest, $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse, request, callback); }, "name", { value: "InternalUpdateGraphOperation" }); /** @@ -29214,13 +30058,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreInfo.encode = function encode(message, writer) { + RestoreInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sourceType); if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) - $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -29234,7 +30082,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -29309,7 +30157,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) switch (message.sourceType) { default: return "sourceType: enum value expected"; @@ -29317,7 +30165,7 @@ case 1: break; } - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) { properties.sourceInfo = 1; { var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo, long + 1); @@ -29339,6 +30187,8 @@ RestoreInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.RestoreInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.RestoreInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -29361,7 +30211,7 @@ break; } if (object.backupInfo != null) { - if (typeof object.backupInfo !== "object") + if (!$util.isObject(object.backupInfo)) throw TypeError(".google.spanner.admin.database.v1.RestoreInfo.backupInfo: object expected"); message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo, long + 1); } @@ -29377,16 +30227,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreInfo.toObject = function toObject(message, options) { + RestoreInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.sourceType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) { + object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options, q + 1); if (options.oneofs) object.sourceInfo = "backupInfo"; } @@ -29575,26 +30429,30 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Database.encode = function encode(message, writer) { + Database.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) - $root.google.spanner.admin.database.v1.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.RestoreInfo.encode(message.restoreInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.versionRetentionPeriod != null && Object.hasOwnProperty.call(message, "versionRetentionPeriod")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.versionRetentionPeriod); if (message.earliestVersionTime != null && Object.hasOwnProperty.call(message, "earliestVersionTime")) - $root.google.protobuf.Timestamp.encode(message.earliestVersionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.earliestVersionTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.encryptionInfo != null && message.encryptionInfo.length) for (var i = 0; i < message.encryptionInfo.length; ++i) - $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionInfo.encode(message.encryptionInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.defaultLeader != null && Object.hasOwnProperty.call(message, "defaultLeader")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.defaultLeader); if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) @@ -29616,7 +30474,7 @@ * @returns {$protobuf.Writer} Writer */ Database.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -29732,10 +30590,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) switch (message.state) { default: return "state: enum value expected"; @@ -29745,22 +30603,22 @@ case 3: break; } - if (message.createTime != null && message.hasOwnProperty("createTime")) { + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) { + if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) { var error = $root.google.spanner.admin.database.v1.RestoreInfo.verify(message.restoreInfo, long + 1); if (error) return "restoreInfo." + error; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; } - if (message.encryptionInfo != null && message.hasOwnProperty("encryptionInfo")) { + if (message.encryptionInfo != null && Object.hasOwnProperty.call(message, "encryptionInfo")) { if (!Array.isArray(message.encryptionInfo)) return "encryptionInfo: array expected"; for (var i = 0; i < message.encryptionInfo.length; ++i) { @@ -29769,18 +30627,18 @@ return "encryptionInfo." + error; } } - if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) + if (message.versionRetentionPeriod != null && Object.hasOwnProperty.call(message, "versionRetentionPeriod")) if (!$util.isString(message.versionRetentionPeriod)) return "versionRetentionPeriod: string expected"; - if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) { + if (message.earliestVersionTime != null && Object.hasOwnProperty.call(message, "earliestVersionTime")) { var error = $root.google.protobuf.Timestamp.verify(message.earliestVersionTime, long + 1); if (error) return "earliestVersionTime." + error; } - if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) + if (message.defaultLeader != null && Object.hasOwnProperty.call(message, "defaultLeader")) if (!$util.isString(message.defaultLeader)) return "defaultLeader: string expected"; - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) switch (message.databaseDialect) { default: return "databaseDialect: enum value expected"; @@ -29789,10 +30647,10 @@ case 2: break; } - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) if (typeof message.enableDropProtection !== "boolean") return "enableDropProtection: boolean expected"; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) if (typeof message.reconciling !== "boolean") return "reconciling: boolean expected"; return null; @@ -29809,6 +30667,8 @@ Database.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.Database) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.Database: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -29841,17 +30701,17 @@ break; } if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.spanner.admin.database.v1.Database.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.restoreInfo != null) { - if (typeof object.restoreInfo !== "object") + if (!$util.isObject(object.restoreInfo)) throw TypeError(".google.spanner.admin.database.v1.Database.restoreInfo: object expected"); message.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.fromObject(object.restoreInfo, long + 1); } if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.admin.database.v1.Database.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -29860,7 +30720,7 @@ throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: array expected"); message.encryptionInfo = []; for (var i = 0; i < object.encryptionInfo.length; ++i) { - if (typeof object.encryptionInfo[i] !== "object") + if (!$util.isObject(object.encryptionInfo[i])) throw TypeError(".google.spanner.admin.database.v1.Database.encryptionInfo: object expected"); message.encryptionInfo[i] = $root.google.spanner.admin.database.v1.EncryptionInfo.fromObject(object.encryptionInfo[i], long + 1); } @@ -29868,7 +30728,7 @@ if (object.versionRetentionPeriod != null) message.versionRetentionPeriod = String(object.versionRetentionPeriod); if (object.earliestVersionTime != null) { - if (typeof object.earliestVersionTime !== "object") + if (!$util.isObject(object.earliestVersionTime)) throw TypeError(".google.spanner.admin.database.v1.Database.earliestVersionTime: object expected"); message.earliestVersionTime = $root.google.protobuf.Timestamp.fromObject(object.earliestVersionTime, long + 1); } @@ -29910,9 +30770,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Database.toObject = function toObject(message, options) { + Database.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.encryptionInfo = []; @@ -29929,32 +30793,32 @@ object.enableDropProtection = false; object.reconciling = false; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.spanner.admin.database.v1.Database.State[message.state] === undefined ? message.state : $root.google.spanner.admin.database.v1.Database.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.restoreInfo != null && message.hasOwnProperty("restoreInfo")) - object.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.toObject(message.restoreInfo, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.versionRetentionPeriod != null && message.hasOwnProperty("versionRetentionPeriod")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.restoreInfo != null && Object.hasOwnProperty.call(message, "restoreInfo")) + object.restoreInfo = $root.google.spanner.admin.database.v1.RestoreInfo.toObject(message.restoreInfo, options, q + 1); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options, q + 1); + if (message.versionRetentionPeriod != null && Object.hasOwnProperty.call(message, "versionRetentionPeriod")) object.versionRetentionPeriod = message.versionRetentionPeriod; - if (message.earliestVersionTime != null && message.hasOwnProperty("earliestVersionTime")) - object.earliestVersionTime = $root.google.protobuf.Timestamp.toObject(message.earliestVersionTime, options); + if (message.earliestVersionTime != null && Object.hasOwnProperty.call(message, "earliestVersionTime")) + object.earliestVersionTime = $root.google.protobuf.Timestamp.toObject(message.earliestVersionTime, options, q + 1); if (message.encryptionInfo && message.encryptionInfo.length) { object.encryptionInfo = []; for (var j = 0; j < message.encryptionInfo.length; ++j) - object.encryptionInfo[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo[j], options); + object.encryptionInfo[j] = $root.google.spanner.admin.database.v1.EncryptionInfo.toObject(message.encryptionInfo[j], options, q + 1); } - if (message.defaultLeader != null && message.hasOwnProperty("defaultLeader")) + if (message.defaultLeader != null && Object.hasOwnProperty.call(message, "defaultLeader")) object.defaultLeader = message.defaultLeader; - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) object.enableDropProtection = message.enableDropProtection; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) object.reconciling = message.reconciling; return object; }; @@ -30077,9 +30941,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatabasesRequest.encode = function encode(message, writer) { + ListDatabasesRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -30099,7 +30967,7 @@ * @returns {$protobuf.Writer} Writer */ ListDatabasesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -30177,13 +31045,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -30200,6 +31068,8 @@ ListDatabasesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabasesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -30223,20 +31093,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatabasesRequest.toObject = function toObject(message, options) { + ListDatabasesRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -30333,12 +31207,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatabasesResponse.encode = function encode(message, writer) { + ListDatabasesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databases != null && message.databases.length) for (var i = 0; i < message.databases.length; ++i) - $root.google.spanner.admin.database.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Database.encode(message.databases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -30354,7 +31232,7 @@ * @returns {$protobuf.Writer} Writer */ ListDatabasesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -30430,7 +31308,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.databases != null && message.hasOwnProperty("databases")) { + if (message.databases != null && Object.hasOwnProperty.call(message, "databases")) { if (!Array.isArray(message.databases)) return "databases: array expected"; for (var i = 0; i < message.databases.length; ++i) { @@ -30439,7 +31317,7 @@ return "databases." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -30456,6 +31334,8 @@ ListDatabasesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListDatabasesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -30466,7 +31346,7 @@ throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: array expected"); message.databases = []; for (var i = 0; i < object.databases.length; ++i) { - if (typeof object.databases[i] !== "object") + if (!$util.isObject(object.databases[i])) throw TypeError(".google.spanner.admin.database.v1.ListDatabasesResponse.databases: object expected"); message.databases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.databases[i], long + 1); } @@ -30485,9 +31365,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatabasesResponse.toObject = function toObject(message, options) { + ListDatabasesResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.databases = []; @@ -30496,9 +31380,9 @@ if (message.databases && message.databases.length) { object.databases = []; for (var j = 0; j < message.databases.length; ++j) - object.databases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.databases[j], options); + object.databases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.databases[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -30631,9 +31515,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDatabaseRequest.encode = function encode(message, writer) { + CreateDatabaseRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.createStatement != null && Object.hasOwnProperty.call(message, "createStatement")) @@ -30642,7 +31530,7 @@ for (var i = 0; i < message.extraStatements.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.extraStatements[i]); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.databaseDialect); if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) @@ -30660,7 +31548,7 @@ * @returns {$protobuf.Writer} Writer */ CreateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -30752,25 +31640,25 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.createStatement != null && message.hasOwnProperty("createStatement")) + if (message.createStatement != null && Object.hasOwnProperty.call(message, "createStatement")) if (!$util.isString(message.createStatement)) return "createStatement: string expected"; - if (message.extraStatements != null && message.hasOwnProperty("extraStatements")) { + if (message.extraStatements != null && Object.hasOwnProperty.call(message, "extraStatements")) { if (!Array.isArray(message.extraStatements)) return "extraStatements: array expected"; for (var i = 0; i < message.extraStatements.length; ++i) if (!$util.isString(message.extraStatements[i])) return "extraStatements: string[] expected"; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; } - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) switch (message.databaseDialect) { default: return "databaseDialect: enum value expected"; @@ -30779,7 +31667,7 @@ case 2: break; } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) return "protoDescriptors: buffer expected"; return null; @@ -30796,6 +31684,8 @@ CreateDatabaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -30813,7 +31703,7 @@ message.extraStatements[i] = String(object.extraStatements[i]); } if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseRequest.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -30854,9 +31744,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateDatabaseRequest.toObject = function toObject(message, options) { + CreateDatabaseRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.extraStatements = []; @@ -30873,20 +31767,20 @@ object.protoDescriptors = $util.newBuffer(object.protoDescriptors); } } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.createStatement != null && message.hasOwnProperty("createStatement")) + if (message.createStatement != null && Object.hasOwnProperty.call(message, "createStatement")) object.createStatement = message.createStatement; if (message.extraStatements && message.extraStatements.length) { object.extraStatements = []; for (var j = 0; j < message.extraStatements.length; ++j) object.extraStatements[j] = message.extraStatements[j]; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.databaseDialect != null && message.hasOwnProperty("databaseDialect")) + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options, q + 1); + if (message.databaseDialect != null && Object.hasOwnProperty.call(message, "databaseDialect")) object.databaseDialect = options.enums === String ? $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] === undefined ? message.databaseDialect : $root.google.spanner.admin.database.v1.DatabaseDialect[message.databaseDialect] : message.databaseDialect; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; return object; }; @@ -30973,9 +31867,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDatabaseMetadata.encode = function encode(message, writer) { + CreateDatabaseMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); return writer; @@ -30991,7 +31889,7 @@ * @returns {$protobuf.Writer} Writer */ CreateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -31061,7 +31959,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; return null; @@ -31078,6 +31976,8 @@ CreateDatabaseMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.CreateDatabaseMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.CreateDatabaseMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -31097,13 +31997,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateDatabaseMetadata.toObject = function toObject(message, options) { + CreateDatabaseMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; return object; }; @@ -31190,9 +32094,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDatabaseRequest.encode = function encode(message, writer) { + GetDatabaseRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -31208,7 +32116,7 @@ * @returns {$protobuf.Writer} Writer */ GetDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -31278,7 +32186,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -31295,6 +32203,8 @@ GetDatabaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.GetDatabaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -31314,13 +32224,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDatabaseRequest.toObject = function toObject(message, options) { + GetDatabaseRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -31416,13 +32330,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDatabaseRequest.encode = function encode(message, writer) { + UpdateDatabaseRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -31436,7 +32354,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -31510,12 +32428,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) { + if (message.database != null && Object.hasOwnProperty.call(message, "database")) { var error = $root.google.spanner.admin.database.v1.Database.verify(message.database, long + 1); if (error) return "database." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; @@ -31534,18 +32452,20 @@ UpdateDatabaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseRequest(); if (object.database != null) { - if (typeof object.database !== "object") + if (!$util.isObject(object.database)) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.database: object expected"); message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database, long + 1); } if (object.updateMask != null) { - if (typeof object.updateMask !== "object") + if (!$util.isObject(object.updateMask)) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -31561,18 +32481,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDatabaseRequest.toObject = function toObject(message, options) { + UpdateDatabaseRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.database = null; object.updateMask = null; } - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); return object; }; @@ -31676,15 +32600,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDatabaseMetadata.encode = function encode(message, writer) { + UpdateDatabaseMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.request != null && Object.hasOwnProperty.call(message, "request")) - $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -31698,7 +32626,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -31776,17 +32704,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.request != null && message.hasOwnProperty("request")) { + if (message.request != null && Object.hasOwnProperty.call(message, "request")) { var error = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.verify(message.request, long + 1); if (error) return "request." + error; } - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; @@ -31805,23 +32733,25 @@ UpdateDatabaseMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.database.v1.UpdateDatabaseMetadata(); if (object.request != null) { - if (typeof object.request !== "object") + if (!$util.isObject(object.request)) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.request: object expected"); message.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.fromObject(object.request, long + 1); } if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } @@ -31837,21 +32767,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDatabaseMetadata.toObject = function toObject(message, options) { + UpdateDatabaseMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.request = null; object.progress = null; object.cancelTime = null; } - if (message.request != null && message.hasOwnProperty("request")) - object.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.toObject(message.request, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + object.request = $root.google.spanner.admin.database.v1.UpdateDatabaseRequest.toObject(message.request, options, q + 1); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); return object; }; @@ -31974,9 +32908,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDatabaseDdlRequest.encode = function encode(message, writer) { + UpdateDatabaseDdlRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.statements != null && message.statements.length) @@ -32001,7 +32939,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -32089,23 +33027,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { + if (message.statements != null && Object.hasOwnProperty.call(message, "statements")) { if (!Array.isArray(message.statements)) return "statements: array expected"; for (var i = 0; i < message.statements.length; ++i) if (!$util.isString(message.statements[i])) return "statements: string[] expected"; } - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) if (!$util.isString(message.operationId)) return "operationId: string expected"; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) return "protoDescriptors: buffer expected"; - if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) + if (message.throughputMode != null && Object.hasOwnProperty.call(message, "throughputMode")) if (typeof message.throughputMode !== "boolean") return "throughputMode: boolean expected"; return null; @@ -32122,6 +33060,8 @@ UpdateDatabaseDdlRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32157,9 +33097,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDatabaseDdlRequest.toObject = function toObject(message, options) { + UpdateDatabaseDdlRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.statements = []; @@ -32175,18 +33119,18 @@ } object.throughputMode = false; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; if (message.statements && message.statements.length) { object.statements = []; for (var j = 0; j < message.statements.length; ++j) object.statements[j] = message.statements[j]; } - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) object.operationId = message.operationId; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; - if (message.throughputMode != null && message.hasOwnProperty("throughputMode")) + if (message.throughputMode != null && Object.hasOwnProperty.call(message, "throughputMode")) object.throughputMode = message.throughputMode; return object; }; @@ -32292,9 +33236,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DdlStatementActionInfo.encode = function encode(message, writer) { + DdlStatementActionInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.action); if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) @@ -32315,7 +33263,7 @@ * @returns {$protobuf.Writer} Writer */ DdlStatementActionInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -32395,13 +33343,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) if (!$util.isString(message.action)) return "action: string expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) if (!$util.isString(message.entityType)) return "entityType: string expected"; - if (message.entityNames != null && message.hasOwnProperty("entityNames")) { + if (message.entityNames != null && Object.hasOwnProperty.call(message, "entityNames")) { if (!Array.isArray(message.entityNames)) return "entityNames: array expected"; for (var i = 0; i < message.entityNames.length; ++i) @@ -32422,6 +33370,8 @@ DdlStatementActionInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.DdlStatementActionInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.DdlStatementActionInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32450,9 +33400,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DdlStatementActionInfo.toObject = function toObject(message, options) { + DdlStatementActionInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.entityNames = []; @@ -32460,9 +33414,9 @@ object.action = ""; object.entityType = ""; } - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) object.action = message.action; - if (message.entityType != null && message.hasOwnProperty("entityType")) + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) object.entityType = message.entityType; if (message.entityNames && message.entityNames.length) { object.entityNames = []; @@ -32603,9 +33557,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDatabaseDdlMetadata.encode = function encode(message, writer) { + UpdateDatabaseDdlMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.statements != null && message.statements.length) @@ -32613,15 +33571,15 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.statements[i]); if (message.commitTimestamps != null && message.commitTimestamps.length) for (var i = 0; i < message.commitTimestamps.length; ++i) - $root.google.protobuf.Timestamp.encode(message.commitTimestamps[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.commitTimestamps[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.throttled != null && Object.hasOwnProperty.call(message, "throttled")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.throttled); if (message.progress != null && message.progress.length) for (var i = 0; i < message.progress.length; ++i) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.actions != null && message.actions.length) for (var i = 0; i < message.actions.length; ++i) - $root.google.spanner.admin.database.v1.DdlStatementActionInfo.encode(message.actions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.admin.database.v1.DdlStatementActionInfo.encode(message.actions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -32635,7 +33593,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateDatabaseDdlMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -32733,17 +33691,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.statements != null && message.hasOwnProperty("statements")) { + if (message.statements != null && Object.hasOwnProperty.call(message, "statements")) { if (!Array.isArray(message.statements)) return "statements: array expected"; for (var i = 0; i < message.statements.length; ++i) if (!$util.isString(message.statements[i])) return "statements: string[] expected"; } - if (message.commitTimestamps != null && message.hasOwnProperty("commitTimestamps")) { + if (message.commitTimestamps != null && Object.hasOwnProperty.call(message, "commitTimestamps")) { if (!Array.isArray(message.commitTimestamps)) return "commitTimestamps: array expected"; for (var i = 0; i < message.commitTimestamps.length; ++i) { @@ -32752,10 +33710,10 @@ return "commitTimestamps." + error; } } - if (message.throttled != null && message.hasOwnProperty("throttled")) + if (message.throttled != null && Object.hasOwnProperty.call(message, "throttled")) if (typeof message.throttled !== "boolean") return "throttled: boolean expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { if (!Array.isArray(message.progress)) return "progress: array expected"; for (var i = 0; i < message.progress.length; ++i) { @@ -32764,7 +33722,7 @@ return "progress." + error; } } - if (message.actions != null && message.hasOwnProperty("actions")) { + if (message.actions != null && Object.hasOwnProperty.call(message, "actions")) { if (!Array.isArray(message.actions)) return "actions: array expected"; for (var i = 0; i < message.actions.length; ++i) { @@ -32787,6 +33745,8 @@ UpdateDatabaseDdlMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32806,7 +33766,7 @@ throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: array expected"); message.commitTimestamps = []; for (var i = 0; i < object.commitTimestamps.length; ++i) { - if (typeof object.commitTimestamps[i] !== "object") + if (!$util.isObject(object.commitTimestamps[i])) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.commitTimestamps: object expected"); message.commitTimestamps[i] = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamps[i], long + 1); } @@ -32818,7 +33778,7 @@ throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: array expected"); message.progress = []; for (var i = 0; i < object.progress.length; ++i) { - if (typeof object.progress[i] !== "object") + if (!$util.isObject(object.progress[i])) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.progress: object expected"); message.progress[i] = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress[i], long + 1); } @@ -32828,7 +33788,7 @@ throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: array expected"); message.actions = []; for (var i = 0; i < object.actions.length; ++i) { - if (typeof object.actions[i] !== "object") + if (!$util.isObject(object.actions[i])) throw TypeError(".google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata.actions: object expected"); message.actions[i] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.fromObject(object.actions[i], long + 1); } @@ -32845,9 +33805,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDatabaseDdlMetadata.toObject = function toObject(message, options) { + UpdateDatabaseDdlMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.statements = []; @@ -32859,7 +33823,7 @@ object.database = ""; object.throttled = false; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; if (message.statements && message.statements.length) { object.statements = []; @@ -32869,19 +33833,19 @@ if (message.commitTimestamps && message.commitTimestamps.length) { object.commitTimestamps = []; for (var j = 0; j < message.commitTimestamps.length; ++j) - object.commitTimestamps[j] = $root.google.protobuf.Timestamp.toObject(message.commitTimestamps[j], options); + object.commitTimestamps[j] = $root.google.protobuf.Timestamp.toObject(message.commitTimestamps[j], options, q + 1); } - if (message.throttled != null && message.hasOwnProperty("throttled")) + if (message.throttled != null && Object.hasOwnProperty.call(message, "throttled")) object.throttled = message.throttled; if (message.progress && message.progress.length) { object.progress = []; for (var j = 0; j < message.progress.length; ++j) - object.progress[j] = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress[j], options); + object.progress[j] = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress[j], options, q + 1); } if (message.actions && message.actions.length) { object.actions = []; for (var j = 0; j < message.actions.length; ++j) - object.actions[j] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.toObject(message.actions[j], options); + object.actions[j] = $root.google.spanner.admin.database.v1.DdlStatementActionInfo.toObject(message.actions[j], options, q + 1); } return object; }; @@ -32968,9 +33932,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DropDatabaseRequest.encode = function encode(message, writer) { + DropDatabaseRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); return writer; @@ -32986,7 +33954,7 @@ * @returns {$protobuf.Writer} Writer */ DropDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33056,7 +34024,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; return null; @@ -33073,6 +34041,8 @@ DropDatabaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.DropDatabaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.DropDatabaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33092,13 +34062,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DropDatabaseRequest.toObject = function toObject(message, options) { + DropDatabaseRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; return object; }; @@ -33185,9 +34159,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDatabaseDdlRequest.encode = function encode(message, writer) { + GetDatabaseDdlRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); return writer; @@ -33203,7 +34181,7 @@ * @returns {$protobuf.Writer} Writer */ GetDatabaseDdlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33273,7 +34251,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; return null; @@ -33290,6 +34268,8 @@ GetDatabaseDdlRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.GetDatabaseDdlRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33309,13 +34289,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDatabaseDdlRequest.toObject = function toObject(message, options) { + GetDatabaseDdlRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.database = ""; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; return object; }; @@ -33412,9 +34396,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDatabaseDdlResponse.encode = function encode(message, writer) { + GetDatabaseDdlResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.statements != null && message.statements.length) for (var i = 0; i < message.statements.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.statements[i]); @@ -33433,7 +34421,7 @@ * @returns {$protobuf.Writer} Writer */ GetDatabaseDdlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33509,14 +34497,14 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.statements != null && message.hasOwnProperty("statements")) { + if (message.statements != null && Object.hasOwnProperty.call(message, "statements")) { if (!Array.isArray(message.statements)) return "statements: array expected"; for (var i = 0; i < message.statements.length; ++i) if (!$util.isString(message.statements[i])) return "statements: string[] expected"; } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) return "protoDescriptors: buffer expected"; return null; @@ -33533,6 +34521,8 @@ GetDatabaseDdlResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.GetDatabaseDdlResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.GetDatabaseDdlResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33562,9 +34552,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDatabaseDdlResponse.toObject = function toObject(message, options) { + GetDatabaseDdlResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.statements = []; @@ -33581,7 +34575,7 @@ for (var j = 0; j < message.statements.length; ++j) object.statements[j] = message.statements[j]; } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; return object; }; @@ -33695,9 +34689,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatabaseOperationsRequest.encode = function encode(message, writer) { + ListDatabaseOperationsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) @@ -33719,7 +34717,7 @@ * @returns {$protobuf.Writer} Writer */ ListDatabaseOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33801,16 +34799,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -33827,6 +34825,8 @@ ListDatabaseOperationsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33852,9 +34852,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatabaseOperationsRequest.toObject = function toObject(message, options) { + ListDatabaseOperationsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -33862,13 +34866,13 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -33965,12 +34969,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatabaseOperationsResponse.encode = function encode(message, writer) { + ListDatabaseOperationsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -33986,7 +34994,7 @@ * @returns {$protobuf.Writer} Writer */ ListDatabaseOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -34062,7 +35070,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operations != null && message.hasOwnProperty("operations")) { + if (message.operations != null && Object.hasOwnProperty.call(message, "operations")) { if (!Array.isArray(message.operations)) return "operations: array expected"; for (var i = 0; i < message.operations.length; ++i) { @@ -34071,7 +35079,7 @@ return "operations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -34088,6 +35096,8 @@ ListDatabaseOperationsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseOperationsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34098,7 +35108,7 @@ throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: array expected"); message.operations = []; for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") + if (!$util.isObject(object.operations[i])) throw TypeError(".google.spanner.admin.database.v1.ListDatabaseOperationsResponse.operations: object expected"); message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); } @@ -34117,9 +35127,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatabaseOperationsResponse.toObject = function toObject(message, options) { + ListDatabaseOperationsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.operations = []; @@ -34128,9 +35142,9 @@ if (message.operations && message.operations.length) { object.operations = []; for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -34258,9 +35272,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreDatabaseRequest.encode = function encode(message, writer) { + RestoreDatabaseRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) @@ -34268,7 +35286,7 @@ if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.backup); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -34282,7 +35300,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreDatabaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -34365,18 +35383,18 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) { properties.source = 1; if (!$util.isString(message.backup)) return "backup: string expected"; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; @@ -34395,6 +35413,8 @@ RestoreDatabaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34407,7 +35427,7 @@ if (object.backup != null) message.backup = String(object.backup); if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseRequest.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -34423,26 +35443,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreDatabaseRequest.toObject = function toObject(message, options) { + RestoreDatabaseRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.databaseId = ""; object.encryptionConfig = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; - if (message.backup != null && message.hasOwnProperty("backup")) { + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) { object.backup = message.backup; if (options.oneofs) object.source = "backup"; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.toObject(message.encryptionConfig, options, q + 1); return object; }; @@ -34547,9 +35571,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreDatabaseEncryptionConfig.encode = function encode(message, writer) { + RestoreDatabaseEncryptionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.encryptionType); if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) @@ -34570,7 +35598,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreDatabaseEncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -34650,7 +35678,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) switch (message.encryptionType) { default: return "encryptionType: enum value expected"; @@ -34660,10 +35688,10 @@ case 3: break; } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) if (!$util.isString(message.kmsKeyName)) return "kmsKeyName: string expected"; - if (message.kmsKeyNames != null && message.hasOwnProperty("kmsKeyNames")) { + if (message.kmsKeyNames != null && Object.hasOwnProperty.call(message, "kmsKeyNames")) { if (!Array.isArray(message.kmsKeyNames)) return "kmsKeyNames: array expected"; for (var i = 0; i < message.kmsKeyNames.length; ++i) @@ -34684,6 +35712,8 @@ RestoreDatabaseEncryptionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34734,9 +35764,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreDatabaseEncryptionConfig.toObject = function toObject(message, options) { + RestoreDatabaseEncryptionConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.kmsKeyNames = []; @@ -34744,9 +35778,9 @@ object.encryptionType = options.enums === String ? "ENCRYPTION_TYPE_UNSPECIFIED" : 0; object.kmsKeyName = ""; } - if (message.encryptionType != null && message.hasOwnProperty("encryptionType")) + if (message.encryptionType != null && Object.hasOwnProperty.call(message, "encryptionType")) object.encryptionType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] === undefined ? message.encryptionType : $root.google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.EncryptionType[message.encryptionType] : message.encryptionType; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) object.kmsKeyName = message.kmsKeyName; if (message.kmsKeyNames && message.kmsKeyNames.length) { object.kmsKeyNames = []; @@ -34915,19 +35949,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreDatabaseMetadata.encode = function encode(message, writer) { + RestoreDatabaseMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sourceType); if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) - $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.database.v1.BackupInfo.encode(message.backupInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.optimizeDatabaseOperationName != null && Object.hasOwnProperty.call(message, "optimizeDatabaseOperationName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.optimizeDatabaseOperationName); return writer; @@ -34943,7 +35981,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35034,10 +36072,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) switch (message.sourceType) { default: return "sourceType: enum value expected"; @@ -35045,7 +36083,7 @@ case 1: break; } - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) { properties.sourceInfo = 1; { var error = $root.google.spanner.admin.database.v1.BackupInfo.verify(message.backupInfo, long + 1); @@ -35053,17 +36091,17 @@ return "backupInfo." + error; } } - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; } - if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) + if (message.optimizeDatabaseOperationName != null && Object.hasOwnProperty.call(message, "optimizeDatabaseOperationName")) if (!$util.isString(message.optimizeDatabaseOperationName)) return "optimizeDatabaseOperationName: string expected"; return null; @@ -35080,6 +36118,8 @@ RestoreDatabaseMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.RestoreDatabaseMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35104,17 +36144,17 @@ break; } if (object.backupInfo != null) { - if (typeof object.backupInfo !== "object") + if (!$util.isObject(object.backupInfo)) throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.backupInfo: object expected"); message.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.fromObject(object.backupInfo, long + 1); } if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.database.v1.RestoreDatabaseMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } @@ -35132,9 +36172,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreDatabaseMetadata.toObject = function toObject(message, options) { + RestoreDatabaseMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -35143,20 +36187,20 @@ object.cancelTime = null; object.optimizeDatabaseOperationName = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) object.sourceType = options.enums === String ? $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] === undefined ? message.sourceType : $root.google.spanner.admin.database.v1.RestoreSourceType[message.sourceType] : message.sourceType; - if (message.backupInfo != null && message.hasOwnProperty("backupInfo")) { - object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options); + if (message.backupInfo != null && Object.hasOwnProperty.call(message, "backupInfo")) { + object.backupInfo = $root.google.spanner.admin.database.v1.BackupInfo.toObject(message.backupInfo, options, q + 1); if (options.oneofs) object.sourceInfo = "backupInfo"; } - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.optimizeDatabaseOperationName != null && message.hasOwnProperty("optimizeDatabaseOperationName")) + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); + if (message.optimizeDatabaseOperationName != null && Object.hasOwnProperty.call(message, "optimizeDatabaseOperationName")) object.optimizeDatabaseOperationName = message.optimizeDatabaseOperationName; return object; }; @@ -35252,13 +36296,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OptimizeRestoredDatabaseMetadata.encode = function encode(message, writer) { + OptimizeRestoredDatabaseMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.database.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -35272,7 +36320,7 @@ * @returns {$protobuf.Writer} Writer */ OptimizeRestoredDatabaseMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35346,10 +36394,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.database.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; @@ -35368,6 +36416,8 @@ OptimizeRestoredDatabaseMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35376,7 +36426,7 @@ if (object.name != null) message.name = String(object.name); if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.database.v1.OperationProgress.fromObject(object.progress, long + 1); } @@ -35392,18 +36442,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OptimizeRestoredDatabaseMetadata.toObject = function toObject(message, options) { + OptimizeRestoredDatabaseMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.progress = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.database.v1.OperationProgress.toObject(message.progress, options, q + 1); return object; }; @@ -35503,9 +36557,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseRole.encode = function encode(message, writer) { + DatabaseRole.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -35521,7 +36579,7 @@ * @returns {$protobuf.Writer} Writer */ DatabaseRole.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35591,7 +36649,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -35608,6 +36666,8 @@ DatabaseRole.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.DatabaseRole) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.DatabaseRole: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35627,13 +36687,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseRole.toObject = function toObject(message, options) { + DatabaseRole.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -35738,9 +36802,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatabaseRolesRequest.encode = function encode(message, writer) { + ListDatabaseRolesRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -35760,7 +36828,7 @@ * @returns {$protobuf.Writer} Writer */ ListDatabaseRolesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35838,13 +36906,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -35861,6 +36929,8 @@ ListDatabaseRolesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35884,20 +36954,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatabaseRolesRequest.toObject = function toObject(message, options) { + ListDatabaseRolesRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -35994,12 +37068,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDatabaseRolesResponse.encode = function encode(message, writer) { + ListDatabaseRolesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databaseRoles != null && message.databaseRoles.length) for (var i = 0; i < message.databaseRoles.length; ++i) - $root.google.spanner.admin.database.v1.DatabaseRole.encode(message.databaseRoles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.DatabaseRole.encode(message.databaseRoles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -36015,7 +37093,7 @@ * @returns {$protobuf.Writer} Writer */ ListDatabaseRolesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -36091,7 +37169,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.databaseRoles != null && message.hasOwnProperty("databaseRoles")) { + if (message.databaseRoles != null && Object.hasOwnProperty.call(message, "databaseRoles")) { if (!Array.isArray(message.databaseRoles)) return "databaseRoles: array expected"; for (var i = 0; i < message.databaseRoles.length; ++i) { @@ -36100,7 +37178,7 @@ return "databaseRoles." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -36117,6 +37195,8 @@ ListDatabaseRolesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.ListDatabaseRolesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36127,7 +37207,7 @@ throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: array expected"); message.databaseRoles = []; for (var i = 0; i < object.databaseRoles.length; ++i) { - if (typeof object.databaseRoles[i] !== "object") + if (!$util.isObject(object.databaseRoles[i])) throw TypeError(".google.spanner.admin.database.v1.ListDatabaseRolesResponse.databaseRoles: object expected"); message.databaseRoles[i] = $root.google.spanner.admin.database.v1.DatabaseRole.fromObject(object.databaseRoles[i], long + 1); } @@ -36146,9 +37226,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDatabaseRolesResponse.toObject = function toObject(message, options) { + ListDatabaseRolesResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.databaseRoles = []; @@ -36157,9 +37241,9 @@ if (message.databaseRoles && message.databaseRoles.length) { object.databaseRoles = []; for (var j = 0; j < message.databaseRoles.length; ++j) - object.databaseRoles[j] = $root.google.spanner.admin.database.v1.DatabaseRole.toObject(message.databaseRoles[j], options); + object.databaseRoles[j] = $root.google.spanner.admin.database.v1.DatabaseRole.toObject(message.databaseRoles[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -36265,14 +37349,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddSplitPointsRequest.encode = function encode(message, writer) { + AddSplitPointsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.splitPoints != null && message.splitPoints.length) for (var i = 0; i < message.splitPoints.length; ++i) - $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.initiator); return writer; @@ -36288,7 +37376,7 @@ * @returns {$protobuf.Writer} Writer */ AddSplitPointsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -36368,10 +37456,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.splitPoints != null && message.hasOwnProperty("splitPoints")) { + if (message.splitPoints != null && Object.hasOwnProperty.call(message, "splitPoints")) { if (!Array.isArray(message.splitPoints)) return "splitPoints: array expected"; for (var i = 0; i < message.splitPoints.length; ++i) { @@ -36380,7 +37468,7 @@ return "splitPoints." + error; } } - if (message.initiator != null && message.hasOwnProperty("initiator")) + if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) if (!$util.isString(message.initiator)) return "initiator: string expected"; return null; @@ -36397,6 +37485,8 @@ AddSplitPointsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36409,7 +37499,7 @@ throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: array expected"); message.splitPoints = []; for (var i = 0; i < object.splitPoints.length; ++i) { - if (typeof object.splitPoints[i] !== "object") + if (!$util.isObject(object.splitPoints[i])) throw TypeError(".google.spanner.admin.database.v1.AddSplitPointsRequest.splitPoints: object expected"); message.splitPoints[i] = $root.google.spanner.admin.database.v1.SplitPoints.fromObject(object.splitPoints[i], long + 1); } @@ -36428,9 +37518,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddSplitPointsRequest.toObject = function toObject(message, options) { + AddSplitPointsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.splitPoints = []; @@ -36438,14 +37532,14 @@ object.database = ""; object.initiator = ""; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; if (message.splitPoints && message.splitPoints.length) { object.splitPoints = []; for (var j = 0; j < message.splitPoints.length; ++j) - object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options); + object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options, q + 1); } - if (message.initiator != null && message.hasOwnProperty("initiator")) + if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) object.initiator = message.initiator; return object; }; @@ -36523,9 +37617,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddSplitPointsResponse.encode = function encode(message, writer) { + AddSplitPointsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -36539,7 +37637,7 @@ * @returns {$protobuf.Writer} Writer */ AddSplitPointsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -36619,10 +37717,6 @@ AddSplitPointsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.AddSplitPointsResponse) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.spanner.admin.database.v1.AddSplitPointsResponse(); }; @@ -36749,18 +37843,22 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SplitPoints.encode = function encode(message, writer) { + SplitPoints.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); if (message.index != null && Object.hasOwnProperty.call(message, "index")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) - $root.google.spanner.admin.database.v1.SplitPoints.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.database.v1.SplitPoints.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -36774,7 +37872,7 @@ * @returns {$protobuf.Writer} Writer */ SplitPoints.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -36858,13 +37956,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) if (!$util.isString(message.index)) return "index: string expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) { if (!Array.isArray(message.keys)) return "keys: array expected"; for (var i = 0; i < message.keys.length; ++i) { @@ -36873,7 +37971,7 @@ return "keys." + error; } } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; @@ -36892,6 +37990,8 @@ SplitPoints.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.SplitPoints: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36906,13 +38006,13 @@ throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: array expected"); message.keys = []; for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") + if (!$util.isObject(object.keys[i])) throw TypeError(".google.spanner.admin.database.v1.SplitPoints.keys: object expected"); message.keys[i] = $root.google.spanner.admin.database.v1.SplitPoints.Key.fromObject(object.keys[i], long + 1); } } if (object.expireTime != null) { - if (typeof object.expireTime !== "object") + if (!$util.isObject(object.expireTime)) throw TypeError(".google.spanner.admin.database.v1.SplitPoints.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); } @@ -36928,9 +38028,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SplitPoints.toObject = function toObject(message, options) { + SplitPoints.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.keys = []; @@ -36939,17 +38043,17 @@ object.index = ""; object.expireTime = null; } - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) object.index = message.index; if (message.keys && message.keys.length) { object.keys = []; for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.spanner.admin.database.v1.SplitPoints.Key.toObject(message.keys[j], options); + object.keys[j] = $root.google.spanner.admin.database.v1.SplitPoints.Key.toObject(message.keys[j], options, q + 1); } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); return object; }; @@ -37032,11 +38136,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Key.encode = function encode(message, writer) { + Key.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.keyParts != null && Object.hasOwnProperty.call(message, "keyParts")) - $root.google.protobuf.ListValue.encode(message.keyParts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.keyParts, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -37050,7 +38158,7 @@ * @returns {$protobuf.Writer} Writer */ Key.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37120,7 +38228,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.keyParts != null && message.hasOwnProperty("keyParts")) { + if (message.keyParts != null && Object.hasOwnProperty.call(message, "keyParts")) { var error = $root.google.protobuf.ListValue.verify(message.keyParts, long + 1); if (error) return "keyParts." + error; @@ -37139,13 +38247,15 @@ Key.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.SplitPoints.Key) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.SplitPoints.Key: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.database.v1.SplitPoints.Key(); if (object.keyParts != null) { - if (typeof object.keyParts !== "object") + if (!$util.isObject(object.keyParts)) throw TypeError(".google.spanner.admin.database.v1.SplitPoints.Key.keyParts: object expected"); message.keyParts = $root.google.protobuf.ListValue.fromObject(object.keyParts, long + 1); } @@ -37161,14 +38271,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Key.toObject = function toObject(message, options) { + Key.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.keyParts = null; - if (message.keyParts != null && message.hasOwnProperty("keyParts")) - object.keyParts = $root.google.protobuf.ListValue.toObject(message.keyParts, options); + if (message.keyParts != null && Object.hasOwnProperty.call(message, "keyParts")) + object.keyParts = $root.google.protobuf.ListValue.toObject(message.keyParts, options, q + 1); return object; }; @@ -37293,9 +38407,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InternalUpdateGraphOperationRequest.encode = function encode(message, writer) { + InternalUpdateGraphOperationRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) @@ -37305,7 +38423,7 @@ if (message.vmIdentityToken != null && Object.hasOwnProperty.call(message, "vmIdentityToken")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmIdentityToken); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -37319,7 +38437,7 @@ * @returns {$protobuf.Writer} Writer */ InternalUpdateGraphOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37405,19 +38523,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) if (!$util.isString(message.operationId)) return "operationId: string expected"; - if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) + if (message.vmIdentityToken != null && Object.hasOwnProperty.call(message, "vmIdentityToken")) if (!$util.isString(message.vmIdentityToken)) return "vmIdentityToken: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) if (typeof message.progress !== "number") return "progress: number expected"; - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { var error = $root.google.rpc.Status.verify(message.status, long + 1); if (error) return "status." + error; @@ -37436,6 +38554,8 @@ InternalUpdateGraphOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37450,7 +38570,7 @@ if (object.progress != null) message.progress = Number(object.progress); if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.spanner.admin.database.v1.InternalUpdateGraphOperationRequest.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } @@ -37466,9 +38586,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InternalUpdateGraphOperationRequest.toObject = function toObject(message, options) { + InternalUpdateGraphOperationRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.database = ""; @@ -37477,16 +38601,16 @@ object.vmIdentityToken = ""; object.status = null; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) object.operationId = message.operationId; - if (message.progress != null && message.hasOwnProperty("progress")) + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress; - if (message.vmIdentityToken != null && message.hasOwnProperty("vmIdentityToken")) + if (message.vmIdentityToken != null && Object.hasOwnProperty.call(message, "vmIdentityToken")) object.vmIdentityToken = message.vmIdentityToken; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = $root.google.rpc.Status.toObject(message.status, options, q + 1); return object; }; @@ -37563,9 +38687,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InternalUpdateGraphOperationResponse.encode = function encode(message, writer) { + InternalUpdateGraphOperationResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -37579,7 +38707,7 @@ * @returns {$protobuf.Writer} Writer */ InternalUpdateGraphOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37659,10 +38787,6 @@ InternalUpdateGraphOperationResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.spanner.admin.database.v1.InternalUpdateGraphOperationResponse(); }; @@ -37803,15 +38927,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationProgress.encode = function encode(message, writer) { + OperationProgress.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.progressPercent); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -37825,7 +38953,7 @@ * @returns {$protobuf.Writer} Writer */ OperationProgress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37903,15 +39031,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) if (!$util.isInteger(message.progressPercent)) return "progressPercent: integer expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; @@ -37930,6 +39058,8 @@ OperationProgress.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.OperationProgress) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.OperationProgress: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37938,12 +39068,12 @@ if (object.progressPercent != null) message.progressPercent = object.progressPercent | 0; if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.endTime != null) { - if (typeof object.endTime !== "object") + if (!$util.isObject(object.endTime)) throw TypeError(".google.spanner.admin.instance.v1.OperationProgress.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -37959,21 +39089,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationProgress.toObject = function toObject(message, options) { + OperationProgress.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.progressPercent = 0; object.startTime = null; object.endTime = null; } - if (message.progressPercent != null && message.hasOwnProperty("progressPercent")) + if (message.progressPercent != null && Object.hasOwnProperty.call(message, "progressPercent")) object.progressPercent = message.progressPercent; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); return object; }; @@ -38075,9 +39209,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicaSelection.encode = function encode(message, writer) { + ReplicaSelection.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); return writer; @@ -38093,7 +39231,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -38163,7 +39301,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) if (!$util.isString(message.location)) return "location: string expected"; return null; @@ -38180,6 +39318,8 @@ ReplicaSelection.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaSelection) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ReplicaSelection: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -38199,13 +39339,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicaSelection.toObject = function toObject(message, options) { + ReplicaSelection.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.location = ""; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; return object; }; @@ -38291,7 +39435,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigs = function listInstanceConfigs(request, callback) { - return this.rpcCall(listInstanceConfigs, $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listInstanceConfigs, $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse, request, callback); }, "name", { value: "ListInstanceConfigs" }); /** @@ -38324,7 +39468,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.getInstanceConfig = function getInstanceConfig(request, callback) { - return this.rpcCall(getInstanceConfig, $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest, $root.google.spanner.admin.instance.v1.InstanceConfig, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getInstanceConfig, $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest, $root.google.spanner.admin.instance.v1.InstanceConfig, request, callback); }, "name", { value: "GetInstanceConfig" }); /** @@ -38357,7 +39501,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.createInstanceConfig = function createInstanceConfig(request, callback) { - return this.rpcCall(createInstanceConfig, $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createInstanceConfig, $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CreateInstanceConfig" }); /** @@ -38390,7 +39534,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.updateInstanceConfig = function updateInstanceConfig(request, callback) { - return this.rpcCall(updateInstanceConfig, $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateInstanceConfig, $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "UpdateInstanceConfig" }); /** @@ -38423,7 +39567,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.deleteInstanceConfig = function deleteInstanceConfig(request, callback) { - return this.rpcCall(deleteInstanceConfig, $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteInstanceConfig, $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteInstanceConfig" }); /** @@ -38456,7 +39600,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.listInstanceConfigOperations = function listInstanceConfigOperations(request, callback) { - return this.rpcCall(listInstanceConfigOperations, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listInstanceConfigOperations, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse, request, callback); }, "name", { value: "ListInstanceConfigOperations" }); /** @@ -38489,7 +39633,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.spanner.admin.instance.v1.ListInstancesRequest, $root.google.spanner.admin.instance.v1.ListInstancesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listInstances, $root.google.spanner.admin.instance.v1.ListInstancesRequest, $root.google.spanner.admin.instance.v1.ListInstancesResponse, request, callback); }, "name", { value: "ListInstances" }); /** @@ -38522,7 +39666,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.listInstancePartitions = function listInstancePartitions(request, callback) { - return this.rpcCall(listInstancePartitions, $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listInstancePartitions, $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse, request, callback); }, "name", { value: "ListInstancePartitions" }); /** @@ -38555,7 +39699,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.spanner.admin.instance.v1.GetInstanceRequest, $root.google.spanner.admin.instance.v1.Instance, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getInstance, $root.google.spanner.admin.instance.v1.GetInstanceRequest, $root.google.spanner.admin.instance.v1.Instance, request, callback); }, "name", { value: "GetInstance" }); /** @@ -38588,7 +39732,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.spanner.admin.instance.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createInstance, $root.google.spanner.admin.instance.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CreateInstance" }); /** @@ -38621,7 +39765,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.spanner.admin.instance.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateInstance, $root.google.spanner.admin.instance.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "UpdateInstance" }); /** @@ -38654,7 +39798,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.spanner.admin.instance.v1.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteInstance, $root.google.spanner.admin.instance.v1.DeleteInstanceRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteInstance" }); /** @@ -38687,7 +39831,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "SetIamPolicy" }); /** @@ -38720,7 +39864,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "GetIamPolicy" }); /** @@ -38753,7 +39897,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); }, "name", { value: "TestIamPermissions" }); /** @@ -38786,7 +39930,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.getInstancePartition = function getInstancePartition(request, callback) { - return this.rpcCall(getInstancePartition, $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest, $root.google.spanner.admin.instance.v1.InstancePartition, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getInstancePartition, $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest, $root.google.spanner.admin.instance.v1.InstancePartition, request, callback); }, "name", { value: "GetInstancePartition" }); /** @@ -38819,7 +39963,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.createInstancePartition = function createInstancePartition(request, callback) { - return this.rpcCall(createInstancePartition, $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createInstancePartition, $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CreateInstancePartition" }); /** @@ -38852,7 +39996,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.deleteInstancePartition = function deleteInstancePartition(request, callback) { - return this.rpcCall(deleteInstancePartition, $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteInstancePartition, $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteInstancePartition" }); /** @@ -38885,7 +40029,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.updateInstancePartition = function updateInstancePartition(request, callback) { - return this.rpcCall(updateInstancePartition, $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateInstancePartition, $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "UpdateInstancePartition" }); /** @@ -38918,7 +40062,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.listInstancePartitionOperations = function listInstancePartitionOperations(request, callback) { - return this.rpcCall(listInstancePartitionOperations, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listInstancePartitionOperations, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest, $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse, request, callback); }, "name", { value: "ListInstancePartitionOperations" }); /** @@ -38951,7 +40095,7 @@ * @variation 1 */ Object.defineProperty(InstanceAdmin.prototype.moveInstance = function moveInstance(request, callback) { - return this.rpcCall(moveInstance, $root.google.spanner.admin.instance.v1.MoveInstanceRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, moveInstance, $root.google.spanner.admin.instance.v1.MoveInstanceRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "MoveInstance" }); /** @@ -39038,9 +40182,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicaInfo.encode = function encode(message, writer) { + ReplicaInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); if (message.type != null && Object.hasOwnProperty.call(message, "type")) @@ -39060,7 +40208,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicaInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -39138,10 +40286,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) if (!$util.isString(message.location)) return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) switch (message.type) { default: return "type: enum value expected"; @@ -39151,7 +40299,7 @@ case 3: break; } - if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) + if (message.defaultLeaderLocation != null && Object.hasOwnProperty.call(message, "defaultLeaderLocation")) if (typeof message.defaultLeaderLocation !== "boolean") return "defaultLeaderLocation: boolean expected"; return null; @@ -39168,6 +40316,8 @@ ReplicaInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ReplicaInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -39213,20 +40363,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicaInfo.toObject = function toObject(message, options) { + ReplicaInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.location = ""; object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; object.defaultLeaderLocation = false; } - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] === undefined ? message.type : $root.google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType[message.type] : message.type; - if (message.defaultLeaderLocation != null && message.hasOwnProperty("defaultLeaderLocation")) + if (message.defaultLeaderLocation != null && Object.hasOwnProperty.call(message, "defaultLeaderLocation")) object.defaultLeaderLocation = message.defaultLeaderLocation; return object; }; @@ -39452,16 +40606,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstanceConfig.encode = function encode(message, writer) { + InstanceConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); if (message.replicas != null && message.replicas.length) for (var i = 0; i < message.replicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.leaderOptions != null && message.leaderOptions.length) for (var i = 0; i < message.leaderOptions.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).string(message.leaderOptions[i]); @@ -39469,7 +40627,7 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.configType); if (message.optionalReplicas != null && message.optionalReplicas.length) for (var i = 0; i < message.optionalReplicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.optionalReplicas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.optionalReplicas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.baseConfig != null && Object.hasOwnProperty.call(message, "baseConfig")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.baseConfig); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) @@ -39500,7 +40658,7 @@ * @returns {$protobuf.Writer} Writer */ InstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -39649,13 +40807,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; - if (message.configType != null && message.hasOwnProperty("configType")) + if (message.configType != null && Object.hasOwnProperty.call(message, "configType")) switch (message.configType) { default: return "configType: enum value expected"; @@ -39664,7 +40822,7 @@ case 2: break; } - if (message.replicas != null && message.hasOwnProperty("replicas")) { + if (message.replicas != null && Object.hasOwnProperty.call(message, "replicas")) { if (!Array.isArray(message.replicas)) return "replicas: array expected"; for (var i = 0; i < message.replicas.length; ++i) { @@ -39673,7 +40831,7 @@ return "replicas." + error; } } - if (message.optionalReplicas != null && message.hasOwnProperty("optionalReplicas")) { + if (message.optionalReplicas != null && Object.hasOwnProperty.call(message, "optionalReplicas")) { if (!Array.isArray(message.optionalReplicas)) return "optionalReplicas: array expected"; for (var i = 0; i < message.optionalReplicas.length; ++i) { @@ -39682,10 +40840,10 @@ return "optionalReplicas." + error; } } - if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) + if (message.baseConfig != null && Object.hasOwnProperty.call(message, "baseConfig")) if (!$util.isString(message.baseConfig)) return "baseConfig: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); @@ -39693,20 +40851,20 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) if (!$util.isString(message.etag)) return "etag: string expected"; - if (message.leaderOptions != null && message.hasOwnProperty("leaderOptions")) { + if (message.leaderOptions != null && Object.hasOwnProperty.call(message, "leaderOptions")) { if (!Array.isArray(message.leaderOptions)) return "leaderOptions: array expected"; for (var i = 0; i < message.leaderOptions.length; ++i) if (!$util.isString(message.leaderOptions[i])) return "leaderOptions: string[] expected"; } - if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) if (typeof message.reconciling !== "boolean") return "reconciling: boolean expected"; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) switch (message.state) { default: return "state: enum value expected"; @@ -39715,7 +40873,7 @@ case 2: break; } - if (message.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) + if (message.freeInstanceAvailability != null && Object.hasOwnProperty.call(message, "freeInstanceAvailability")) switch (message.freeInstanceAvailability) { default: return "freeInstanceAvailability: enum value expected"; @@ -39726,7 +40884,7 @@ case 4: break; } - if (message.quorumType != null && message.hasOwnProperty("quorumType")) + if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) switch (message.quorumType) { default: return "quorumType: enum value expected"; @@ -39736,7 +40894,7 @@ case 3: break; } - if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) + if (message.storageLimitPerProcessingUnit != null && Object.hasOwnProperty.call(message, "storageLimitPerProcessingUnit")) if (!$util.isInteger(message.storageLimitPerProcessingUnit) && !(message.storageLimitPerProcessingUnit && $util.isInteger(message.storageLimitPerProcessingUnit.low) && $util.isInteger(message.storageLimitPerProcessingUnit.high))) return "storageLimitPerProcessingUnit: integer|Long expected"; return null; @@ -39753,6 +40911,8 @@ InstanceConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.InstanceConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -39787,7 +40947,7 @@ throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: array expected"); message.replicas = []; for (var i = 0; i < object.replicas.length; ++i) { - if (typeof object.replicas[i] !== "object") + if (!$util.isObject(object.replicas[i])) throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.replicas: object expected"); message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i], long + 1); } @@ -39797,7 +40957,7 @@ throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: array expected"); message.optionalReplicas = []; for (var i = 0; i < object.optionalReplicas.length; ++i) { - if (typeof object.optionalReplicas[i] !== "object") + if (!$util.isObject(object.optionalReplicas[i])) throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.optionalReplicas: object expected"); message.optionalReplicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.optionalReplicas[i], long + 1); } @@ -39805,7 +40965,7 @@ if (object.baseConfig != null) message.baseConfig = String(object.baseConfig); if (object.labels) { - if (typeof object.labels !== "object") + if (!$util.isObject(object.labels)) throw TypeError(".google.spanner.admin.instance.v1.InstanceConfig.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { @@ -39899,7 +41059,7 @@ } if (object.storageLimitPerProcessingUnit != null) if ($util.Long) - (message.storageLimitPerProcessingUnit = $util.Long.fromValue(object.storageLimitPerProcessingUnit)).unsigned = false; + message.storageLimitPerProcessingUnit = $util.Long.fromValue(object.storageLimitPerProcessingUnit, false); else if (typeof object.storageLimitPerProcessingUnit === "string") message.storageLimitPerProcessingUnit = parseInt(object.storageLimitPerProcessingUnit, 10); else if (typeof object.storageLimitPerProcessingUnit === "number") @@ -39918,9 +41078,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstanceConfig.toObject = function toObject(message, options) { + InstanceConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.replicas = []; @@ -39941,32 +41105,32 @@ object.quorumType = options.enums === String ? "QUORUM_TYPE_UNSPECIFIED" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.storageLimitPerProcessingUnit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.storageLimitPerProcessingUnit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.storageLimitPerProcessingUnit = options.longs === String ? "0" : 0; + object.storageLimitPerProcessingUnit = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) object.displayName = message.displayName; if (message.replicas && message.replicas.length) { object.replicas = []; for (var j = 0; j < message.replicas.length; ++j) - object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); + object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options, q + 1); } if (message.leaderOptions && message.leaderOptions.length) { object.leaderOptions = []; for (var j = 0; j < message.leaderOptions.length; ++j) object.leaderOptions[j] = message.leaderOptions[j]; } - if (message.configType != null && message.hasOwnProperty("configType")) + if (message.configType != null && Object.hasOwnProperty.call(message, "configType")) object.configType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] === undefined ? message.configType : $root.google.spanner.admin.instance.v1.InstanceConfig.Type[message.configType] : message.configType; if (message.optionalReplicas && message.optionalReplicas.length) { object.optionalReplicas = []; for (var j = 0; j < message.optionalReplicas.length; ++j) - object.optionalReplicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.optionalReplicas[j], options); + object.optionalReplicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.optionalReplicas[j], options, q + 1); } - if (message.baseConfig != null && message.hasOwnProperty("baseConfig")) + if (message.baseConfig != null && Object.hasOwnProperty.call(message, "baseConfig")) object.baseConfig = message.baseConfig; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { @@ -39977,18 +41141,20 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } } - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) object.reconciling = message.reconciling; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstanceConfig.State[message.state] : message.state; - if (message.freeInstanceAvailability != null && message.hasOwnProperty("freeInstanceAvailability")) + if (message.freeInstanceAvailability != null && Object.hasOwnProperty.call(message, "freeInstanceAvailability")) object.freeInstanceAvailability = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] === undefined ? message.freeInstanceAvailability : $root.google.spanner.admin.instance.v1.InstanceConfig.FreeInstanceAvailability[message.freeInstanceAvailability] : message.freeInstanceAvailability; - if (message.quorumType != null && message.hasOwnProperty("quorumType")) + if (message.quorumType != null && Object.hasOwnProperty.call(message, "quorumType")) object.quorumType = options.enums === String ? $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] === undefined ? message.quorumType : $root.google.spanner.admin.instance.v1.InstanceConfig.QuorumType[message.quorumType] : message.quorumType; - if (message.storageLimitPerProcessingUnit != null && message.hasOwnProperty("storageLimitPerProcessingUnit")) - if (typeof message.storageLimitPerProcessingUnit === "number") + if (message.storageLimitPerProcessingUnit != null && Object.hasOwnProperty.call(message, "storageLimitPerProcessingUnit")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.storageLimitPerProcessingUnit = typeof message.storageLimitPerProcessingUnit === "number" ? BigInt(message.storageLimitPerProcessingUnit) : $util.Long.fromBits(message.storageLimitPerProcessingUnit.low >>> 0, message.storageLimitPerProcessingUnit.high >>> 0, false).toBigInt(); + else if (typeof message.storageLimitPerProcessingUnit === "number") object.storageLimitPerProcessingUnit = options.longs === String ? String(message.storageLimitPerProcessingUnit) : message.storageLimitPerProcessingUnit; else object.storageLimitPerProcessingUnit = options.longs === String ? $util.Long.prototype.toString.call(message.storageLimitPerProcessingUnit) : options.longs === Number ? new $util.LongBits(message.storageLimitPerProcessingUnit.low >>> 0, message.storageLimitPerProcessingUnit.high >>> 0).toNumber() : message.storageLimitPerProcessingUnit; @@ -40179,11 +41345,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicaComputeCapacity.encode = function encode(message, writer) { + ReplicaComputeCapacity.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) - $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nodeCount); if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) @@ -40201,7 +41371,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicaComputeCapacity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -40280,17 +41450,17 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) { var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection, long + 1); if (error) return "replicaSelection." + error; } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { properties.computeCapacity = 1; if (!$util.isInteger(message.nodeCount)) return "nodeCount: integer expected"; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { if (properties.computeCapacity === 1) return "computeCapacity: multiple values"; properties.computeCapacity = 1; @@ -40311,13 +41481,15 @@ ReplicaComputeCapacity.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ReplicaComputeCapacity: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity(); if (object.replicaSelection != null) { - if (typeof object.replicaSelection !== "object") + if (!$util.isObject(object.replicaSelection)) throw TypeError(".google.spanner.admin.instance.v1.ReplicaComputeCapacity.replicaSelection: object expected"); message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection, long + 1); } @@ -40337,20 +41509,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicaComputeCapacity.toObject = function toObject(message, options) { + ReplicaComputeCapacity.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.replicaSelection = null; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) - object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) + object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options, q + 1); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { object.nodeCount = message.nodeCount; if (options.oneofs) object.computeCapacity = "nodeCount"; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { object.processingUnits = message.processingUnits; if (options.oneofs) object.computeCapacity = "processingUnits"; @@ -40459,16 +41635,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutoscalingConfig.encode = function encode(message, writer) { + AutoscalingConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.encode(message.autoscalingTargets, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.asymmetricAutoscalingOptions != null && message.asymmetricAutoscalingOptions.length) for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.encode(message.asymmetricAutoscalingOptions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.encode(message.asymmetricAutoscalingOptions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -40482,7 +41662,7 @@ * @returns {$protobuf.Writer} Writer */ AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -40562,17 +41742,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits, long + 1); if (error) return "autoscalingLimits." + error; } - if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) { + if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.verify(message.autoscalingTargets, long + 1); if (error) return "autoscalingTargets." + error; } - if (message.asymmetricAutoscalingOptions != null && message.hasOwnProperty("asymmetricAutoscalingOptions")) { + if (message.asymmetricAutoscalingOptions != null && Object.hasOwnProperty.call(message, "asymmetricAutoscalingOptions")) { if (!Array.isArray(message.asymmetricAutoscalingOptions)) return "asymmetricAutoscalingOptions: array expected"; for (var i = 0; i < message.asymmetricAutoscalingOptions.length; ++i) { @@ -40595,18 +41775,20 @@ AutoscalingConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig(); if (object.autoscalingLimits != null) { - if (typeof object.autoscalingLimits !== "object") + if (!$util.isObject(object.autoscalingLimits)) throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingLimits: object expected"); message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits, long + 1); } if (object.autoscalingTargets != null) { - if (typeof object.autoscalingTargets !== "object") + if (!$util.isObject(object.autoscalingTargets)) throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.autoscalingTargets: object expected"); message.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.fromObject(object.autoscalingTargets, long + 1); } @@ -40615,7 +41797,7 @@ throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: array expected"); message.asymmetricAutoscalingOptions = []; for (var i = 0; i < object.asymmetricAutoscalingOptions.length; ++i) { - if (typeof object.asymmetricAutoscalingOptions[i] !== "object") + if (!$util.isObject(object.asymmetricAutoscalingOptions[i])) throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.asymmetricAutoscalingOptions: object expected"); message.asymmetricAutoscalingOptions[i] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.fromObject(object.asymmetricAutoscalingOptions[i], long + 1); } @@ -40632,9 +41814,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutoscalingConfig.toObject = function toObject(message, options) { + AutoscalingConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.asymmetricAutoscalingOptions = []; @@ -40642,14 +41828,14 @@ object.autoscalingLimits = null; object.autoscalingTargets = null; } - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) - object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); - if (message.autoscalingTargets != null && message.hasOwnProperty("autoscalingTargets")) - object.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.toObject(message.autoscalingTargets, options); + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options, q + 1); + if (message.autoscalingTargets != null && Object.hasOwnProperty.call(message, "autoscalingTargets")) + object.autoscalingTargets = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets.toObject(message.autoscalingTargets, options, q + 1); if (message.asymmetricAutoscalingOptions && message.asymmetricAutoscalingOptions.length) { object.asymmetricAutoscalingOptions = []; for (var j = 0; j < message.asymmetricAutoscalingOptions.length; ++j) - object.asymmetricAutoscalingOptions[j] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.toObject(message.asymmetricAutoscalingOptions[j], options); + object.asymmetricAutoscalingOptions[j] = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.toObject(message.asymmetricAutoscalingOptions[j], options, q + 1); } return object; }; @@ -40785,9 +41971,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutoscalingLimits.encode = function encode(message, writer) { + AutoscalingLimits.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minNodes); if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) @@ -40809,7 +41999,7 @@ * @returns {$protobuf.Writer} Writer */ AutoscalingLimits.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -40892,24 +42082,24 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) { properties.minLimit = 1; if (!$util.isInteger(message.minNodes)) return "minNodes: integer expected"; } - if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) { if (properties.minLimit === 1) return "minLimit: multiple values"; properties.minLimit = 1; if (!$util.isInteger(message.minProcessingUnits)) return "minProcessingUnits: integer expected"; } - if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) { properties.maxLimit = 1; if (!$util.isInteger(message.maxNodes)) return "maxNodes: integer expected"; } - if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + if (message.maxProcessingUnits != null && Object.hasOwnProperty.call(message, "maxProcessingUnits")) { if (properties.maxLimit === 1) return "maxLimit: multiple values"; properties.maxLimit = 1; @@ -40930,6 +42120,8 @@ AutoscalingLimits.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -40955,26 +42147,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutoscalingLimits.toObject = function toObject(message, options) { + AutoscalingLimits.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) { object.minNodes = message.minNodes; if (options.oneofs) object.minLimit = "minNodes"; } - if (message.minProcessingUnits != null && message.hasOwnProperty("minProcessingUnits")) { + if (message.minProcessingUnits != null && Object.hasOwnProperty.call(message, "minProcessingUnits")) { object.minProcessingUnits = message.minProcessingUnits; if (options.oneofs) object.minLimit = "minProcessingUnits"; } - if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) { object.maxNodes = message.maxNodes; if (options.oneofs) object.maxLimit = "maxNodes"; } - if (message.maxProcessingUnits != null && message.hasOwnProperty("maxProcessingUnits")) { + if (message.maxProcessingUnits != null && Object.hasOwnProperty.call(message, "maxProcessingUnits")) { object.maxProcessingUnits = message.maxProcessingUnits; if (options.oneofs) object.maxLimit = "maxProcessingUnits"; @@ -41082,9 +42278,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutoscalingTargets.encode = function encode(message, writer) { + AutoscalingTargets.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.highPriorityCpuUtilizationPercent); if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) @@ -41104,7 +42304,7 @@ * @returns {$protobuf.Writer} Writer */ AutoscalingTargets.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -41182,13 +42382,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) if (!$util.isInteger(message.highPriorityCpuUtilizationPercent)) return "highPriorityCpuUtilizationPercent: integer expected"; - if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) + if (message.totalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "totalCpuUtilizationPercent")) if (!$util.isInteger(message.totalCpuUtilizationPercent)) return "totalCpuUtilizationPercent: integer expected"; - if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) if (!$util.isInteger(message.storageUtilizationPercent)) return "storageUtilizationPercent: integer expected"; return null; @@ -41205,6 +42405,8 @@ AutoscalingTargets.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingTargets: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -41228,20 +42430,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutoscalingTargets.toObject = function toObject(message, options) { + AutoscalingTargets.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.highPriorityCpuUtilizationPercent = 0; object.storageUtilizationPercent = 0; object.totalCpuUtilizationPercent = 0; } - if (message.highPriorityCpuUtilizationPercent != null && message.hasOwnProperty("highPriorityCpuUtilizationPercent")) + if (message.highPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "highPriorityCpuUtilizationPercent")) object.highPriorityCpuUtilizationPercent = message.highPriorityCpuUtilizationPercent; - if (message.storageUtilizationPercent != null && message.hasOwnProperty("storageUtilizationPercent")) + if (message.storageUtilizationPercent != null && Object.hasOwnProperty.call(message, "storageUtilizationPercent")) object.storageUtilizationPercent = message.storageUtilizationPercent; - if (message.totalCpuUtilizationPercent != null && message.hasOwnProperty("totalCpuUtilizationPercent")) + if (message.totalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "totalCpuUtilizationPercent")) object.totalCpuUtilizationPercent = message.totalCpuUtilizationPercent; return object; }; @@ -41337,13 +42543,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AsymmetricAutoscalingOption.encode = function encode(message, writer) { + AsymmetricAutoscalingOption.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) - $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.ReplicaSelection.encode(message.replicaSelection, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.encode(message.overrides, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.encode(message.overrides, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -41357,7 +42567,7 @@ * @returns {$protobuf.Writer} Writer */ AsymmetricAutoscalingOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -41431,12 +42641,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) { + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) { var error = $root.google.spanner.admin.instance.v1.ReplicaSelection.verify(message.replicaSelection, long + 1); if (error) return "replicaSelection." + error; } - if (message.overrides != null && message.hasOwnProperty("overrides")) { + if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.verify(message.overrides, long + 1); if (error) return "overrides." + error; @@ -41455,18 +42665,20 @@ AsymmetricAutoscalingOption.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption(); if (object.replicaSelection != null) { - if (typeof object.replicaSelection !== "object") + if (!$util.isObject(object.replicaSelection)) throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.replicaSelection: object expected"); message.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.fromObject(object.replicaSelection, long + 1); } if (object.overrides != null) { - if (typeof object.overrides !== "object") + if (!$util.isObject(object.overrides)) throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.overrides: object expected"); message.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.fromObject(object.overrides, long + 1); } @@ -41482,18 +42694,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AsymmetricAutoscalingOption.toObject = function toObject(message, options) { + AsymmetricAutoscalingOption.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.replicaSelection = null; object.overrides = null; } - if (message.replicaSelection != null && message.hasOwnProperty("replicaSelection")) - object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options); - if (message.overrides != null && message.hasOwnProperty("overrides")) - object.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.toObject(message.overrides, options); + if (message.replicaSelection != null && Object.hasOwnProperty.call(message, "replicaSelection")) + object.replicaSelection = $root.google.spanner.admin.instance.v1.ReplicaSelection.toObject(message.replicaSelection, options, q + 1); + if (message.overrides != null && Object.hasOwnProperty.call(message, "overrides")) + object.overrides = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.toObject(message.overrides, options, q + 1); return object; }; @@ -41612,11 +42828,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutoscalingConfigOverrides.encode = function encode(message, writer) { + AutoscalingConfigOverrides.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.encode(message.autoscalingLimits, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetHighPriorityCpuUtilizationPercent")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoscalingTargetHighPriorityCpuUtilizationPercent); if (message.autoscalingTargetTotalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetTotalCpuUtilizationPercent")) @@ -41638,7 +42858,7 @@ * @returns {$protobuf.Writer} Writer */ AutoscalingConfigOverrides.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -41724,21 +42944,21 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) { + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.verify(message.autoscalingLimits, long + 1); if (error) return "autoscalingLimits." + error; } - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetHighPriorityCpuUtilizationPercent")) if (!$util.isInteger(message.autoscalingTargetHighPriorityCpuUtilizationPercent)) return "autoscalingTargetHighPriorityCpuUtilizationPercent: integer expected"; - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetTotalCpuUtilizationPercent")) if (!$util.isInteger(message.autoscalingTargetTotalCpuUtilizationPercent)) return "autoscalingTargetTotalCpuUtilizationPercent: integer expected"; - if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) + if (message.disableHighPriorityCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableHighPriorityCpuAutoscaling")) if (typeof message.disableHighPriorityCpuAutoscaling !== "boolean") return "disableHighPriorityCpuAutoscaling: boolean expected"; - if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) + if (message.disableTotalCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableTotalCpuAutoscaling")) if (typeof message.disableTotalCpuAutoscaling !== "boolean") return "disableTotalCpuAutoscaling: boolean expected"; return null; @@ -41755,13 +42975,15 @@ AutoscalingConfigOverrides.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides(); if (object.autoscalingLimits != null) { - if (typeof object.autoscalingLimits !== "object") + if (!$util.isObject(object.autoscalingLimits)) throw TypeError(".google.spanner.admin.instance.v1.AutoscalingConfig.AsymmetricAutoscalingOption.AutoscalingConfigOverrides.autoscalingLimits: object expected"); message.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.fromObject(object.autoscalingLimits, long + 1); } @@ -41785,9 +43007,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutoscalingConfigOverrides.toObject = function toObject(message, options) { + AutoscalingConfigOverrides.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.autoscalingLimits = null; @@ -41796,15 +43022,15 @@ object.disableHighPriorityCpuAutoscaling = false; object.disableTotalCpuAutoscaling = false; } - if (message.autoscalingLimits != null && message.hasOwnProperty("autoscalingLimits")) - object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options); - if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetHighPriorityCpuUtilizationPercent")) + if (message.autoscalingLimits != null && Object.hasOwnProperty.call(message, "autoscalingLimits")) + object.autoscalingLimits = $root.google.spanner.admin.instance.v1.AutoscalingConfig.AutoscalingLimits.toObject(message.autoscalingLimits, options, q + 1); + if (message.autoscalingTargetHighPriorityCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetHighPriorityCpuUtilizationPercent")) object.autoscalingTargetHighPriorityCpuUtilizationPercent = message.autoscalingTargetHighPriorityCpuUtilizationPercent; - if (message.autoscalingTargetTotalCpuUtilizationPercent != null && message.hasOwnProperty("autoscalingTargetTotalCpuUtilizationPercent")) + if (message.autoscalingTargetTotalCpuUtilizationPercent != null && Object.hasOwnProperty.call(message, "autoscalingTargetTotalCpuUtilizationPercent")) object.autoscalingTargetTotalCpuUtilizationPercent = message.autoscalingTargetTotalCpuUtilizationPercent; - if (message.disableHighPriorityCpuAutoscaling != null && message.hasOwnProperty("disableHighPriorityCpuAutoscaling")) + if (message.disableHighPriorityCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableHighPriorityCpuAutoscaling")) object.disableHighPriorityCpuAutoscaling = message.disableHighPriorityCpuAutoscaling; - if (message.disableTotalCpuAutoscaling != null && message.hasOwnProperty("disableTotalCpuAutoscaling")) + if (message.disableTotalCpuAutoscaling != null && Object.hasOwnProperty.call(message, "disableTotalCpuAutoscaling")) object.disableTotalCpuAutoscaling = message.disableTotalCpuAutoscaling; return object; }; @@ -42035,9 +43261,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encode = function encode(message, writer) { + Instance.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.config != null && Object.hasOwnProperty.call(message, "config")) @@ -42059,16 +43289,16 @@ if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.instanceType); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.freeInstanceMetadata != null && Object.hasOwnProperty.call(message, "freeInstanceMetadata")) - $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.encode(message.freeInstanceMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.encode(message.freeInstanceMetadata, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.replicaComputeCapacity != null && message.replicaComputeCapacity.length) for (var i = 0; i < message.replicaComputeCapacity.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.encode(message.replicaComputeCapacity[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.encode(message.replicaComputeCapacity[i], writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 20, wireType 0 =*/160).int32(message.edition); if (message.defaultBackupScheduleType != null && Object.hasOwnProperty.call(message, "defaultBackupScheduleType")) @@ -42086,7 +43316,7 @@ * @returns {$protobuf.Writer} Writer */ Instance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -42241,22 +43471,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.config != null && message.hasOwnProperty("config")) + if (message.config != null && Object.hasOwnProperty.call(message, "config")) if (!$util.isString(message.config)) return "config: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) if (!$util.isInteger(message.nodeCount)) return "nodeCount: integer expected"; - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) if (!$util.isInteger(message.processingUnits)) return "processingUnits: integer expected"; - if (message.replicaComputeCapacity != null && message.hasOwnProperty("replicaComputeCapacity")) { + if (message.replicaComputeCapacity != null && Object.hasOwnProperty.call(message, "replicaComputeCapacity")) { if (!Array.isArray(message.replicaComputeCapacity)) return "replicaComputeCapacity: array expected"; for (var i = 0; i < message.replicaComputeCapacity.length; ++i) { @@ -42265,12 +43495,12 @@ return "replicaComputeCapacity." + error; } } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig, long + 1); if (error) return "autoscalingConfig." + error; } - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) switch (message.state) { default: return "state: enum value expected"; @@ -42279,7 +43509,7 @@ case 2: break; } - if (message.labels != null && message.hasOwnProperty("labels")) { + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); @@ -42287,7 +43517,7 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.instanceType != null && message.hasOwnProperty("instanceType")) + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) switch (message.instanceType) { default: return "instanceType: enum value expected"; @@ -42296,29 +43526,29 @@ case 2: break; } - if (message.endpointUris != null && message.hasOwnProperty("endpointUris")) { + if (message.endpointUris != null && Object.hasOwnProperty.call(message, "endpointUris")) { if (!Array.isArray(message.endpointUris)) return "endpointUris: array expected"; for (var i = 0; i < message.endpointUris.length; ++i) if (!$util.isString(message.endpointUris[i])) return "endpointUris: string[] expected"; } - if (message.createTime != null && message.hasOwnProperty("createTime")) { + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) { + if (message.freeInstanceMetadata != null && Object.hasOwnProperty.call(message, "freeInstanceMetadata")) { var error = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.verify(message.freeInstanceMetadata, long + 1); if (error) return "freeInstanceMetadata." + error; } - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -42328,7 +43558,7 @@ case 3: break; } - if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) + if (message.defaultBackupScheduleType != null && Object.hasOwnProperty.call(message, "defaultBackupScheduleType")) switch (message.defaultBackupScheduleType) { default: return "defaultBackupScheduleType: enum value expected"; @@ -42351,6 +43581,8 @@ Instance.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.Instance) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.Instance: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -42371,13 +43603,13 @@ throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: array expected"); message.replicaComputeCapacity = []; for (var i = 0; i < object.replicaComputeCapacity.length; ++i) { - if (typeof object.replicaComputeCapacity[i] !== "object") + if (!$util.isObject(object.replicaComputeCapacity[i])) throw TypeError(".google.spanner.admin.instance.v1.Instance.replicaComputeCapacity: object expected"); message.replicaComputeCapacity[i] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.fromObject(object.replicaComputeCapacity[i], long + 1); } } if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") + if (!$util.isObject(object.autoscalingConfig)) throw TypeError(".google.spanner.admin.instance.v1.Instance.autoscalingConfig: object expected"); message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig, long + 1); } @@ -42402,7 +43634,7 @@ break; } if (object.labels) { - if (typeof object.labels !== "object") + if (!$util.isObject(object.labels)) throw TypeError(".google.spanner.admin.instance.v1.Instance.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { @@ -42439,17 +43671,17 @@ message.endpointUris[i] = String(object.endpointUris[i]); } if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.spanner.admin.instance.v1.Instance.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (typeof object.updateTime !== "object") + if (!$util.isObject(object.updateTime)) throw TypeError(".google.spanner.admin.instance.v1.Instance.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } if (object.freeInstanceMetadata != null) { - if (typeof object.freeInstanceMetadata !== "object") + if (!$util.isObject(object.freeInstanceMetadata)) throw TypeError(".google.spanner.admin.instance.v1.Instance.freeInstanceMetadata: object expected"); message.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.fromObject(object.freeInstanceMetadata, long + 1); } @@ -42509,9 +43741,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Instance.toObject = function toObject(message, options) { + Instance.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.endpointUris = []; @@ -42534,15 +43770,15 @@ object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; object.defaultBackupScheduleType = options.enums === String ? "DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED" : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) + if (message.config != null && Object.hasOwnProperty.call(message, "config")) object.config = message.config; - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) object.displayName = message.displayName; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) object.nodeCount = message.nodeCount; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.Instance.State[message.state] : message.state; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { @@ -42558,26 +43794,26 @@ for (var j = 0; j < message.endpointUris.length; ++j) object.endpointUris[j] = message.endpointUris[j]; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) object.processingUnits = message.processingUnits; - if (message.instanceType != null && message.hasOwnProperty("instanceType")) + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) object.instanceType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.spanner.admin.instance.v1.Instance.InstanceType[message.instanceType] : message.instanceType; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.freeInstanceMetadata != null && message.hasOwnProperty("freeInstanceMetadata")) - object.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.toObject(message.freeInstanceMetadata, options); - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); + if (message.freeInstanceMetadata != null && Object.hasOwnProperty.call(message, "freeInstanceMetadata")) + object.freeInstanceMetadata = $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.toObject(message.freeInstanceMetadata, options, q + 1); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options, q + 1); if (message.replicaComputeCapacity && message.replicaComputeCapacity.length) { object.replicaComputeCapacity = []; for (var j = 0; j < message.replicaComputeCapacity.length; ++j) - object.replicaComputeCapacity[j] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.toObject(message.replicaComputeCapacity[j], options); + object.replicaComputeCapacity[j] = $root.google.spanner.admin.instance.v1.ReplicaComputeCapacity.toObject(message.replicaComputeCapacity[j], options, q + 1); } - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) object.edition = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] === undefined ? message.edition : $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] : message.edition; - if (message.defaultBackupScheduleType != null && message.hasOwnProperty("defaultBackupScheduleType")) + if (message.defaultBackupScheduleType != null && Object.hasOwnProperty.call(message, "defaultBackupScheduleType")) object.defaultBackupScheduleType = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] === undefined ? message.defaultBackupScheduleType : $root.google.spanner.admin.instance.v1.Instance.DefaultBackupScheduleType[message.defaultBackupScheduleType] : message.defaultBackupScheduleType; return object; }; @@ -42748,9 +43984,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstanceConfigsRequest.encode = function encode(message, writer) { + ListInstanceConfigsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -42770,7 +44010,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstanceConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -42848,13 +44088,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -42871,6 +44111,8 @@ ListInstanceConfigsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -42894,20 +44136,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstanceConfigsRequest.toObject = function toObject(message, options) { + ListInstanceConfigsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -43004,12 +44250,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstanceConfigsResponse.encode = function encode(message, writer) { + ListInstanceConfigsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceConfigs != null && message.instanceConfigs.length) for (var i = 0; i < message.instanceConfigs.length; ++i) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -43025,7 +44275,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstanceConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -43101,7 +44351,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceConfigs != null && message.hasOwnProperty("instanceConfigs")) { + if (message.instanceConfigs != null && Object.hasOwnProperty.call(message, "instanceConfigs")) { if (!Array.isArray(message.instanceConfigs)) return "instanceConfigs: array expected"; for (var i = 0; i < message.instanceConfigs.length; ++i) { @@ -43110,7 +44360,7 @@ return "instanceConfigs." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -43127,6 +44377,8 @@ ListInstanceConfigsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43137,7 +44389,7 @@ throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: array expected"); message.instanceConfigs = []; for (var i = 0; i < object.instanceConfigs.length; ++i) { - if (typeof object.instanceConfigs[i] !== "object") + if (!$util.isObject(object.instanceConfigs[i])) throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigsResponse.instanceConfigs: object expected"); message.instanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfigs[i], long + 1); } @@ -43156,9 +44408,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstanceConfigsResponse.toObject = function toObject(message, options) { + ListInstanceConfigsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.instanceConfigs = []; @@ -43167,9 +44423,9 @@ if (message.instanceConfigs && message.instanceConfigs.length) { object.instanceConfigs = []; for (var j = 0; j < message.instanceConfigs.length; ++j) - object.instanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfigs[j], options); + object.instanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfigs[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -43256,9 +44512,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceConfigRequest.encode = function encode(message, writer) { + GetInstanceConfigRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -43274,7 +44534,7 @@ * @returns {$protobuf.Writer} Writer */ GetInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -43344,7 +44604,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -43361,6 +44621,8 @@ GetInstanceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.GetInstanceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43380,13 +44642,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceConfigRequest.toObject = function toObject(message, options) { + GetInstanceConfigRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -43500,15 +44766,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceConfigRequest.encode = function encode(message, writer) { + CreateInstanceConfigRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceConfigId); if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; @@ -43524,7 +44794,7 @@ * @returns {$protobuf.Writer} Writer */ CreateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -43606,18 +44876,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) if (!$util.isString(message.instanceConfigId)) return "instanceConfigId: string expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) { var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig, long + 1); if (error) return "instanceConfig." + error; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; return null; @@ -43634,6 +44904,8 @@ CreateInstanceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43644,7 +44916,7 @@ if (object.instanceConfigId != null) message.instanceConfigId = String(object.instanceConfigId); if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") + if (!$util.isObject(object.instanceConfig)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigRequest.instanceConfig: object expected"); message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig, long + 1); } @@ -43662,9 +44934,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceConfigRequest.toObject = function toObject(message, options) { + CreateInstanceConfigRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -43672,13 +44948,13 @@ object.instanceConfig = null; object.validateOnly = false; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) object.instanceConfigId = message.instanceConfigId; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options, q + 1); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) object.validateOnly = message.validateOnly; return object; }; @@ -43783,13 +45059,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceConfigRequest.encode = function encode(message, writer) { + UpdateInstanceConfigRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); return writer; @@ -43805,7 +45085,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -43883,17 +45163,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) { var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig, long + 1); if (error) return "instanceConfig." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; } - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; return null; @@ -43910,18 +45190,20 @@ UpdateInstanceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigRequest(); if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") + if (!$util.isObject(object.instanceConfig)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.instanceConfig: object expected"); message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig, long + 1); } if (object.updateMask != null) { - if (typeof object.updateMask !== "object") + if (!$util.isObject(object.updateMask)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -43939,20 +45221,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceConfigRequest.toObject = function toObject(message, options) { + UpdateInstanceConfigRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instanceConfig = null; object.updateMask = null; object.validateOnly = false; } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) object.validateOnly = message.validateOnly; return object; }; @@ -44057,9 +45343,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceConfigRequest.encode = function encode(message, writer) { + DeleteInstanceConfigRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) @@ -44079,7 +45369,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteInstanceConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44157,13 +45447,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) if (!$util.isString(message.etag)) return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) if (typeof message.validateOnly !== "boolean") return "validateOnly: boolean expected"; return null; @@ -44180,6 +45470,8 @@ DeleteInstanceConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.DeleteInstanceConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -44203,20 +45495,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceConfigRequest.toObject = function toObject(message, options) { + DeleteInstanceConfigRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.etag = ""; object.validateOnly = false; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) object.validateOnly = message.validateOnly; return object; }; @@ -44330,9 +45626,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstanceConfigOperationsRequest.encode = function encode(message, writer) { + ListInstanceConfigOperationsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) @@ -44354,7 +45654,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstanceConfigOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44436,16 +45736,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -44462,6 +45762,8 @@ ListInstanceConfigOperationsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -44487,9 +45789,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstanceConfigOperationsRequest.toObject = function toObject(message, options) { + ListInstanceConfigOperationsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -44497,13 +45803,13 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -44600,12 +45906,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstanceConfigOperationsResponse.encode = function encode(message, writer) { + ListInstanceConfigOperationsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -44621,7 +45931,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstanceConfigOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44697,7 +46007,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operations != null && message.hasOwnProperty("operations")) { + if (message.operations != null && Object.hasOwnProperty.call(message, "operations")) { if (!Array.isArray(message.operations)) return "operations: array expected"; for (var i = 0; i < message.operations.length; ++i) { @@ -44706,7 +46016,7 @@ return "operations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -44723,6 +46033,8 @@ ListInstanceConfigOperationsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -44733,7 +46045,7 @@ throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: array expected"); message.operations = []; for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") + if (!$util.isObject(object.operations[i])) throw TypeError(".google.spanner.admin.instance.v1.ListInstanceConfigOperationsResponse.operations: object expected"); message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); } @@ -44752,9 +46064,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstanceConfigOperationsResponse.toObject = function toObject(message, options) { + ListInstanceConfigOperationsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.operations = []; @@ -44763,9 +46079,9 @@ if (message.operations && message.operations.length) { object.operations = []; for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -44861,13 +46177,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encode = function encode(message, writer) { + GetInstanceRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -44881,7 +46201,7 @@ * @returns {$protobuf.Writer} Writer */ GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44955,10 +46275,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask, long + 1); if (error) return "fieldMask." + error; @@ -44977,6 +46297,8 @@ GetInstanceRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.GetInstanceRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.GetInstanceRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -44985,7 +46307,7 @@ if (object.name != null) message.name = String(object.name); if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") + if (!$util.isObject(object.fieldMask)) throw TypeError(".google.spanner.admin.instance.v1.GetInstanceRequest.fieldMask: object expected"); message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask, long + 1); } @@ -45001,18 +46323,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceRequest.toObject = function toObject(message, options) { + GetInstanceRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.fieldMask = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options, q + 1); return object; }; @@ -45116,15 +46442,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequest.encode = function encode(message, writer) { + CreateInstanceRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -45138,7 +46468,7 @@ * @returns {$protobuf.Writer} Writer */ CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -45216,13 +46546,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) { var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance, long + 1); if (error) return "instance." + error; @@ -45241,6 +46571,8 @@ CreateInstanceRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -45251,7 +46583,7 @@ if (object.instanceId != null) message.instanceId = String(object.instanceId); if (object.instance != null) { - if (typeof object.instance !== "object") + if (!$util.isObject(object.instance)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceRequest.instance: object expected"); message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance, long + 1); } @@ -45267,21 +46599,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequest.toObject = function toObject(message, options) { + CreateInstanceRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.instanceId = ""; object.instance = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options, q + 1); return object; }; @@ -45403,9 +46739,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.encode = function encode(message, writer) { + ListInstancesRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -45415,7 +46755,7 @@ if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); if (message.instanceDeadline != null && Object.hasOwnProperty.call(message, "instanceDeadline")) - $root.google.protobuf.Timestamp.encode(message.instanceDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.instanceDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -45429,7 +46769,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -45515,19 +46855,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) { + if (message.instanceDeadline != null && Object.hasOwnProperty.call(message, "instanceDeadline")) { var error = $root.google.protobuf.Timestamp.verify(message.instanceDeadline, long + 1); if (error) return "instanceDeadline." + error; @@ -45546,6 +46886,8 @@ ListInstancesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -45560,7 +46902,7 @@ if (object.filter != null) message.filter = String(object.filter); if (object.instanceDeadline != null) { - if (typeof object.instanceDeadline !== "object") + if (!$util.isObject(object.instanceDeadline)) throw TypeError(".google.spanner.admin.instance.v1.ListInstancesRequest.instanceDeadline: object expected"); message.instanceDeadline = $root.google.protobuf.Timestamp.fromObject(object.instanceDeadline, long + 1); } @@ -45576,9 +46918,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesRequest.toObject = function toObject(message, options) { + ListInstancesRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -45587,16 +46933,16 @@ object.filter = ""; object.instanceDeadline = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.instanceDeadline != null && message.hasOwnProperty("instanceDeadline")) - object.instanceDeadline = $root.google.protobuf.Timestamp.toObject(message.instanceDeadline, options); + if (message.instanceDeadline != null && Object.hasOwnProperty.call(message, "instanceDeadline")) + object.instanceDeadline = $root.google.protobuf.Timestamp.toObject(message.instanceDeadline, options, q + 1); return object; }; @@ -45702,12 +47048,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encode = function encode(message, writer) { + ListInstancesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instances != null && message.instances.length) for (var i = 0; i < message.instances.length; ++i) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.unreachable != null && message.unreachable.length) @@ -45726,7 +47076,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -45808,7 +47158,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instances != null && message.hasOwnProperty("instances")) { + if (message.instances != null && Object.hasOwnProperty.call(message, "instances")) { if (!Array.isArray(message.instances)) return "instances: array expected"; for (var i = 0; i < message.instances.length; ++i) { @@ -45817,10 +47167,10 @@ return "instances." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (message.unreachable != null && Object.hasOwnProperty.call(message, "unreachable")) { if (!Array.isArray(message.unreachable)) return "unreachable: array expected"; for (var i = 0; i < message.unreachable.length; ++i) @@ -45841,6 +47191,8 @@ ListInstancesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -45851,7 +47203,7 @@ throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: array expected"); message.instances = []; for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") + if (!$util.isObject(object.instances[i])) throw TypeError(".google.spanner.admin.instance.v1.ListInstancesResponse.instances: object expected"); message.instances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instances[i], long + 1); } @@ -45877,9 +47229,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + ListInstancesResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.instances = []; @@ -45890,9 +47246,9 @@ if (message.instances && message.instances.length) { object.instances = []; for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instances[j], options); + object.instances[j] = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instances[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; if (message.unreachable && message.unreachable.length) { object.unreachable = []; @@ -45993,13 +47349,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encode = function encode(message, writer) { + UpdateInstanceRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -46013,7 +47373,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -46087,12 +47447,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instance != null && message.hasOwnProperty("instance")) { + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) { var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance, long + 1); if (error) return "instance." + error; } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask, long + 1); if (error) return "fieldMask." + error; @@ -46111,18 +47471,20 @@ UpdateInstanceRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceRequest(); if (object.instance != null) { - if (typeof object.instance !== "object") + if (!$util.isObject(object.instance)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.instance: object expected"); message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance, long + 1); } if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") + if (!$util.isObject(object.fieldMask)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceRequest.fieldMask: object expected"); message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask, long + 1); } @@ -46138,18 +47500,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceRequest.toObject = function toObject(message, options) { + UpdateInstanceRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instance = null; object.fieldMask = null; } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options, q + 1); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options, q + 1); return object; }; @@ -46235,9 +47601,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encode = function encode(message, writer) { + DeleteInstanceRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -46253,7 +47623,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -46323,7 +47693,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -46340,6 +47710,8 @@ DeleteInstanceRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstanceRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.DeleteInstanceRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -46359,13 +47731,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + DeleteInstanceRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -46488,17 +47864,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceMetadata.encode = function encode(message, writer) { + CreateInstanceMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); return writer; @@ -46514,7 +47894,7 @@ * @returns {$protobuf.Writer} Writer */ CreateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -46600,27 +47980,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instance != null && message.hasOwnProperty("instance")) { + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) { var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance, long + 1); if (error) return "instance." + error; } - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; } - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) switch (message.expectedFulfillmentPeriod) { default: return "expectedFulfillmentPeriod: enum value expected"; @@ -46643,28 +48023,30 @@ CreateInstanceMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.CreateInstanceMetadata(); if (object.instance != null) { - if (typeof object.instance !== "object") + if (!$util.isObject(object.instance)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.instance: object expected"); message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance, long + 1); } if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } if (object.endTime != null) { - if (typeof object.endTime !== "object") + if (!$util.isObject(object.endTime)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -46700,9 +48082,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceMetadata.toObject = function toObject(message, options) { + CreateInstanceMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instance = null; @@ -46711,15 +48097,15 @@ object.endTime = null; object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options, q + 1); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; return object; }; @@ -46842,17 +48228,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceMetadata.encode = function encode(message, writer) { + UpdateInstanceMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.expectedFulfillmentPeriod); return writer; @@ -46868,7 +48258,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -46954,27 +48344,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instance != null && message.hasOwnProperty("instance")) { + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) { var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance, long + 1); if (error) return "instance." + error; } - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; } - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) switch (message.expectedFulfillmentPeriod) { default: return "expectedFulfillmentPeriod: enum value expected"; @@ -46997,28 +48387,30 @@ UpdateInstanceMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceMetadata(); if (object.instance != null) { - if (typeof object.instance !== "object") + if (!$util.isObject(object.instance)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.instance: object expected"); message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance, long + 1); } if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } if (object.endTime != null) { - if (typeof object.endTime !== "object") + if (!$util.isObject(object.endTime)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -47054,9 +48446,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceMetadata.toObject = function toObject(message, options) { + UpdateInstanceMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instance = null; @@ -47065,15 +48461,15 @@ object.endTime = null; object.expectedFulfillmentPeriod = options.enums === String ? "FULFILLMENT_PERIOD_UNSPECIFIED" : 0; } - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.expectedFulfillmentPeriod != null && message.hasOwnProperty("expectedFulfillmentPeriod")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options, q + 1); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.expectedFulfillmentPeriod != null && Object.hasOwnProperty.call(message, "expectedFulfillmentPeriod")) object.expectedFulfillmentPeriod = options.enums === String ? $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] === undefined ? message.expectedFulfillmentPeriod : $root.google.spanner.admin.instance.v1.FulfillmentPeriod[message.expectedFulfillmentPeriod] : message.expectedFulfillmentPeriod; return object; }; @@ -47178,13 +48574,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FreeInstanceMetadata.encode = function encode(message, writer) { + FreeInstanceMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) - $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.upgradeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.expireBehavior != null && Object.hasOwnProperty.call(message, "expireBehavior")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.expireBehavior); return writer; @@ -47200,7 +48600,7 @@ * @returns {$protobuf.Writer} Writer */ FreeInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -47278,17 +48678,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; } - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) { + if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) { var error = $root.google.protobuf.Timestamp.verify(message.upgradeTime, long + 1); if (error) return "upgradeTime." + error; } - if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) + if (message.expireBehavior != null && Object.hasOwnProperty.call(message, "expireBehavior")) switch (message.expireBehavior) { default: return "expireBehavior: enum value expected"; @@ -47311,18 +48711,20 @@ FreeInstanceMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.FreeInstanceMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.FreeInstanceMetadata(); if (object.expireTime != null) { - if (typeof object.expireTime !== "object") + if (!$util.isObject(object.expireTime)) throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); } if (object.upgradeTime != null) { - if (typeof object.upgradeTime !== "object") + if (!$util.isObject(object.upgradeTime)) throw TypeError(".google.spanner.admin.instance.v1.FreeInstanceMetadata.upgradeTime: object expected"); message.upgradeTime = $root.google.protobuf.Timestamp.fromObject(object.upgradeTime, long + 1); } @@ -47358,20 +48760,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FreeInstanceMetadata.toObject = function toObject(message, options) { + FreeInstanceMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.expireTime = null; object.upgradeTime = null; object.expireBehavior = options.enums === String ? "EXPIRE_BEHAVIOR_UNSPECIFIED" : 0; } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.upgradeTime != null && message.hasOwnProperty("upgradeTime")) - object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options); - if (message.expireBehavior != null && message.hasOwnProperty("expireBehavior")) + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); + if (message.upgradeTime != null && Object.hasOwnProperty.call(message, "upgradeTime")) + object.upgradeTime = $root.google.protobuf.Timestamp.toObject(message.upgradeTime, options, q + 1); + if (message.expireBehavior != null && Object.hasOwnProperty.call(message, "expireBehavior")) object.expireBehavior = options.enums === String ? $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] === undefined ? message.expireBehavior : $root.google.spanner.admin.instance.v1.FreeInstanceMetadata.ExpireBehavior[message.expireBehavior] : message.expireBehavior; return object; }; @@ -47492,15 +48898,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceConfigMetadata.encode = function encode(message, writer) { + CreateInstanceConfigMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -47514,7 +48924,7 @@ * @returns {$protobuf.Writer} Writer */ CreateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -47592,17 +49002,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) { var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig, long + 1); if (error) return "instanceConfig." + error; } - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; @@ -47621,23 +49031,25 @@ CreateInstanceConfigMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.CreateInstanceConfigMetadata(); if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") + if (!$util.isObject(object.instanceConfig)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.instanceConfig: object expected"); message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig, long + 1); } if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstanceConfigMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } @@ -47653,21 +49065,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceConfigMetadata.toObject = function toObject(message, options) { + CreateInstanceConfigMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instanceConfig = null; object.progress = null; object.cancelTime = null; } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options, q + 1); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); return object; }; @@ -47771,15 +49187,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceConfigMetadata.encode = function encode(message, writer) { + UpdateInstanceConfigMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -47793,7 +49213,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateInstanceConfigMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -47871,17 +49291,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) { var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig, long + 1); if (error) return "instanceConfig." + error; } - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; @@ -47900,23 +49320,25 @@ UpdateInstanceConfigMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata(); if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") + if (!$util.isObject(object.instanceConfig)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.instanceConfig: object expected"); message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig, long + 1); } if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } @@ -47932,21 +49354,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceConfigMetadata.toObject = function toObject(message, options) { + UpdateInstanceConfigMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instanceConfig = null; object.progress = null; object.cancelTime = null; } - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options, q + 1); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); return object; }; @@ -48147,9 +49573,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancePartition.encode = function encode(message, writer) { + InstancePartition.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.config != null && Object.hasOwnProperty.call(message, "config")) @@ -48163,9 +49593,9 @@ if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.referencingDatabases != null && message.referencingDatabases.length) for (var i = 0; i < message.referencingDatabases.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).string(message.referencingDatabases[i]); @@ -48175,7 +49605,7 @@ if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); return writer; }; @@ -48189,7 +49619,7 @@ * @returns {$protobuf.Writer} Writer */ InstancePartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -48308,33 +49738,33 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.config != null && message.hasOwnProperty("config")) + if (message.config != null && Object.hasOwnProperty.call(message, "config")) if (!$util.isString(message.config)) return "config: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { properties.computeCapacity = 1; if (!$util.isInteger(message.nodeCount)) return "nodeCount: integer expected"; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { if (properties.computeCapacity === 1) return "computeCapacity: multiple values"; properties.computeCapacity = 1; if (!$util.isInteger(message.processingUnits)) return "processingUnits: integer expected"; } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig, long + 1); if (error) return "autoscalingConfig." + error; } - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) switch (message.state) { default: return "state: enum value expected"; @@ -48343,31 +49773,31 @@ case 2: break; } - if (message.createTime != null && message.hasOwnProperty("createTime")) { + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) { var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); if (error) return "updateTime." + error; } - if (message.referencingDatabases != null && message.hasOwnProperty("referencingDatabases")) { + if (message.referencingDatabases != null && Object.hasOwnProperty.call(message, "referencingDatabases")) { if (!Array.isArray(message.referencingDatabases)) return "referencingDatabases: array expected"; for (var i = 0; i < message.referencingDatabases.length; ++i) if (!$util.isString(message.referencingDatabases[i])) return "referencingDatabases: string[] expected"; } - if (message.referencingBackups != null && message.hasOwnProperty("referencingBackups")) { + if (message.referencingBackups != null && Object.hasOwnProperty.call(message, "referencingBackups")) { if (!Array.isArray(message.referencingBackups)) return "referencingBackups: array expected"; for (var i = 0; i < message.referencingBackups.length; ++i) if (!$util.isString(message.referencingBackups[i])) return "referencingBackups: string[] expected"; } - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) if (!$util.isString(message.etag)) return "etag: string expected"; return null; @@ -48384,6 +49814,8 @@ InstancePartition.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.InstancePartition) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.InstancePartition: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -48400,7 +49832,7 @@ if (object.processingUnits != null) message.processingUnits = object.processingUnits | 0; if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") + if (!$util.isObject(object.autoscalingConfig)) throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.autoscalingConfig: object expected"); message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig, long + 1); } @@ -48425,12 +49857,12 @@ break; } if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.updateTime != null) { - if (typeof object.updateTime !== "object") + if (!$util.isObject(object.updateTime)) throw TypeError(".google.spanner.admin.instance.v1.InstancePartition.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime, long + 1); } @@ -48462,9 +49894,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancePartition.toObject = function toObject(message, options) { + InstancePartition.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.referencingDatabases = []; @@ -48480,28 +49916,28 @@ object.etag = ""; object.autoscalingConfig = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.config != null && message.hasOwnProperty("config")) + if (message.config != null && Object.hasOwnProperty.call(message, "config")) object.config = message.config; - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) object.displayName = message.displayName; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { object.nodeCount = message.nodeCount; if (options.oneofs) object.computeCapacity = "nodeCount"; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { object.processingUnits = message.processingUnits; if (options.oneofs) object.computeCapacity = "processingUnits"; } - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] === undefined ? message.state : $root.google.spanner.admin.instance.v1.InstancePartition.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options, q + 1); if (message.referencingDatabases && message.referencingDatabases.length) { object.referencingDatabases = []; for (var j = 0; j < message.referencingDatabases.length; ++j) @@ -48512,10 +49948,10 @@ for (var j = 0; j < message.referencingBackups.length; ++j) object.referencingBackups[j] = message.referencingBackups[j]; } - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options, q + 1); return object; }; @@ -48644,17 +50080,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstancePartitionMetadata.encode = function encode(message, writer) { + CreateInstancePartitionMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -48668,7 +50108,7 @@ * @returns {$protobuf.Writer} Writer */ CreateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -48750,22 +50190,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) { var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition, long + 1); if (error) return "instancePartition." + error; } - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; @@ -48784,28 +50224,30 @@ CreateInstancePartitionMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.CreateInstancePartitionMetadata(); if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") + if (!$util.isObject(object.instancePartition)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.instancePartition: object expected"); message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition, long + 1); } if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } if (object.endTime != null) { - if (typeof object.endTime !== "object") + if (!$util.isObject(object.endTime)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -48821,9 +50263,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstancePartitionMetadata.toObject = function toObject(message, options) { + CreateInstancePartitionMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instancePartition = null; @@ -48831,14 +50277,14 @@ object.cancelTime = null; object.endTime = null; } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options, q + 1); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); return object; }; @@ -48942,15 +50388,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstancePartitionRequest.encode = function encode(message, writer) { + CreateInstancePartitionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.instancePartitionId != null && Object.hasOwnProperty.call(message, "instancePartitionId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.instancePartitionId); if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -48964,7 +50414,7 @@ * @returns {$protobuf.Writer} Writer */ CreateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -49042,13 +50492,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) + if (message.instancePartitionId != null && Object.hasOwnProperty.call(message, "instancePartitionId")) if (!$util.isString(message.instancePartitionId)) return "instancePartitionId: string expected"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) { var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition, long + 1); if (error) return "instancePartition." + error; @@ -49067,6 +50517,8 @@ CreateInstancePartitionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.CreateInstancePartitionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -49077,7 +50529,7 @@ if (object.instancePartitionId != null) message.instancePartitionId = String(object.instancePartitionId); if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") + if (!$util.isObject(object.instancePartition)) throw TypeError(".google.spanner.admin.instance.v1.CreateInstancePartitionRequest.instancePartition: object expected"); message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition, long + 1); } @@ -49093,21 +50545,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstancePartitionRequest.toObject = function toObject(message, options) { + CreateInstancePartitionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; object.instancePartitionId = ""; object.instancePartition = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.instancePartitionId != null && message.hasOwnProperty("instancePartitionId")) + if (message.instancePartitionId != null && Object.hasOwnProperty.call(message, "instancePartitionId")) object.instancePartitionId = message.instancePartitionId; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options, q + 1); return object; }; @@ -49202,9 +50658,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstancePartitionRequest.encode = function encode(message, writer) { + DeleteInstancePartitionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) @@ -49222,7 +50682,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -49296,10 +50756,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) if (!$util.isString(message.etag)) return "etag: string expected"; return null; @@ -49316,6 +50776,8 @@ DeleteInstancePartitionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.DeleteInstancePartitionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.DeleteInstancePartitionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -49337,17 +50799,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstancePartitionRequest.toObject = function toObject(message, options) { + DeleteInstancePartitionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.etag = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; return object; }; @@ -49434,9 +50900,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstancePartitionRequest.encode = function encode(message, writer) { + GetInstancePartitionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -49452,7 +50922,7 @@ * @returns {$protobuf.Writer} Writer */ GetInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -49522,7 +50992,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -49539,6 +51009,8 @@ GetInstancePartitionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.GetInstancePartitionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.GetInstancePartitionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -49558,13 +51030,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstancePartitionRequest.toObject = function toObject(message, options) { + GetInstancePartitionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -49660,13 +51136,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstancePartitionRequest.encode = function encode(message, writer) { + UpdateInstancePartitionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) - $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.FieldMask.encode(message.fieldMask, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -49680,7 +51160,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateInstancePartitionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -49754,12 +51234,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) { var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition, long + 1); if (error) return "instancePartition." + error; } - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) { + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) { var error = $root.google.protobuf.FieldMask.verify(message.fieldMask, long + 1); if (error) return "fieldMask." + error; @@ -49778,18 +51258,20 @@ UpdateInstancePartitionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionRequest(); if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") + if (!$util.isObject(object.instancePartition)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.instancePartition: object expected"); message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition, long + 1); } if (object.fieldMask != null) { - if (typeof object.fieldMask !== "object") + if (!$util.isObject(object.fieldMask)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionRequest.fieldMask: object expected"); message.fieldMask = $root.google.protobuf.FieldMask.fromObject(object.fieldMask, long + 1); } @@ -49805,18 +51287,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstancePartitionRequest.toObject = function toObject(message, options) { + UpdateInstancePartitionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instancePartition = null; object.fieldMask = null; } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.fieldMask != null && message.hasOwnProperty("fieldMask")) - object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options, q + 1); + if (message.fieldMask != null && Object.hasOwnProperty.call(message, "fieldMask")) + object.fieldMask = $root.google.protobuf.FieldMask.toObject(message.fieldMask, options, q + 1); return object; }; @@ -49929,17 +51415,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstancePartitionMetadata.encode = function encode(message, writer) { + UpdateInstancePartitionMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartition, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -49953,7 +51443,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateInstancePartitionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -50035,22 +51525,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) { + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) { var error = $root.google.spanner.admin.instance.v1.InstancePartition.verify(message.instancePartition, long + 1); if (error) return "instancePartition." + error; } - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); if (error) return "endTime." + error; @@ -50069,28 +51559,30 @@ UpdateInstancePartitionMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata(); if (object.instancePartition != null) { - if (typeof object.instancePartition !== "object") + if (!$util.isObject(object.instancePartition)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.instancePartition: object expected"); message.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartition, long + 1); } if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } if (object.endTime != null) { - if (typeof object.endTime !== "object") + if (!$util.isObject(object.endTime)) throw TypeError(".google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -50106,9 +51598,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstancePartitionMetadata.toObject = function toObject(message, options) { + UpdateInstancePartitionMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instancePartition = null; @@ -50116,14 +51612,14 @@ object.cancelTime = null; object.endTime = null; } - if (message.instancePartition != null && message.hasOwnProperty("instancePartition")) - object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.instancePartition != null && Object.hasOwnProperty.call(message, "instancePartition")) + object.instancePartition = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartition, options, q + 1); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); return object; }; @@ -50236,9 +51732,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancePartitionsRequest.encode = function encode(message, writer) { + ListInstancePartitionsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -50246,7 +51746,7 @@ if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) - $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -50260,7 +51760,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstancePartitionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -50342,16 +51842,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) { var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline, long + 1); if (error) return "instancePartitionDeadline." + error; @@ -50370,6 +51870,8 @@ ListInstancePartitionsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -50382,7 +51884,7 @@ if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.instancePartitionDeadline != null) { - if (typeof object.instancePartitionDeadline !== "object") + if (!$util.isObject(object.instancePartitionDeadline)) throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsRequest.instancePartitionDeadline: object expected"); message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline, long + 1); } @@ -50398,9 +51900,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancePartitionsRequest.toObject = function toObject(message, options) { + ListInstancePartitionsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -50408,14 +51914,14 @@ object.pageToken = ""; object.instancePartitionDeadline = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) - object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) + object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options, q + 1); return object; }; @@ -50521,12 +52027,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancePartitionsResponse.encode = function encode(message, writer) { + ListInstancePartitionsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instancePartitions != null && message.instancePartitions.length) for (var i = 0; i < message.instancePartitions.length; ++i) - $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstancePartition.encode(message.instancePartitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.unreachable != null && message.unreachable.length) @@ -50545,7 +52055,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstancePartitionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -50627,7 +52137,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instancePartitions != null && message.hasOwnProperty("instancePartitions")) { + if (message.instancePartitions != null && Object.hasOwnProperty.call(message, "instancePartitions")) { if (!Array.isArray(message.instancePartitions)) return "instancePartitions: array expected"; for (var i = 0; i < message.instancePartitions.length; ++i) { @@ -50636,10 +52146,10 @@ return "instancePartitions." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (message.unreachable != null && Object.hasOwnProperty.call(message, "unreachable")) { if (!Array.isArray(message.unreachable)) return "unreachable: array expected"; for (var i = 0; i < message.unreachable.length; ++i) @@ -50660,6 +52170,8 @@ ListInstancePartitionsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -50670,7 +52182,7 @@ throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: array expected"); message.instancePartitions = []; for (var i = 0; i < object.instancePartitions.length; ++i) { - if (typeof object.instancePartitions[i] !== "object") + if (!$util.isObject(object.instancePartitions[i])) throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionsResponse.instancePartitions: object expected"); message.instancePartitions[i] = $root.google.spanner.admin.instance.v1.InstancePartition.fromObject(object.instancePartitions[i], long + 1); } @@ -50696,9 +52208,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancePartitionsResponse.toObject = function toObject(message, options) { + ListInstancePartitionsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.instancePartitions = []; @@ -50709,9 +52225,9 @@ if (message.instancePartitions && message.instancePartitions.length) { object.instancePartitions = []; for (var j = 0; j < message.instancePartitions.length; ++j) - object.instancePartitions[j] = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartitions[j], options); + object.instancePartitions[j] = $root.google.spanner.admin.instance.v1.InstancePartition.toObject(message.instancePartitions[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; if (message.unreachable && message.unreachable.length) { object.unreachable = []; @@ -50839,9 +52355,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancePartitionOperationsRequest.encode = function encode(message, writer) { + ListInstancePartitionOperationsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) @@ -50851,7 +52371,7 @@ if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) - $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.instancePartitionDeadline, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -50865,7 +52385,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstancePartitionOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -50951,19 +52471,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) { + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) { var error = $root.google.protobuf.Timestamp.verify(message.instancePartitionDeadline, long + 1); if (error) return "instancePartitionDeadline." + error; @@ -50982,6 +52502,8 @@ ListInstancePartitionOperationsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -50996,7 +52518,7 @@ if (object.pageToken != null) message.pageToken = String(object.pageToken); if (object.instancePartitionDeadline != null) { - if (typeof object.instancePartitionDeadline !== "object") + if (!$util.isObject(object.instancePartitionDeadline)) throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest.instancePartitionDeadline: object expected"); message.instancePartitionDeadline = $root.google.protobuf.Timestamp.fromObject(object.instancePartitionDeadline, long + 1); } @@ -51012,9 +52534,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancePartitionOperationsRequest.toObject = function toObject(message, options) { + ListInstancePartitionOperationsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.parent = ""; @@ -51023,16 +52549,16 @@ object.pageToken = ""; object.instancePartitionDeadline = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.instancePartitionDeadline != null && message.hasOwnProperty("instancePartitionDeadline")) - object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options); + if (message.instancePartitionDeadline != null && Object.hasOwnProperty.call(message, "instancePartitionDeadline")) + object.instancePartitionDeadline = $root.google.protobuf.Timestamp.toObject(message.instancePartitionDeadline, options, q + 1); return object; }; @@ -51138,12 +52664,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancePartitionOperationsResponse.encode = function encode(message, writer) { + ListInstancePartitionOperationsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.unreachableInstancePartitions != null && message.unreachableInstancePartitions.length) @@ -51162,7 +52692,7 @@ * @returns {$protobuf.Writer} Writer */ ListInstancePartitionOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -51244,7 +52774,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operations != null && message.hasOwnProperty("operations")) { + if (message.operations != null && Object.hasOwnProperty.call(message, "operations")) { if (!Array.isArray(message.operations)) return "operations: array expected"; for (var i = 0; i < message.operations.length; ++i) { @@ -51253,10 +52783,10 @@ return "operations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.unreachableInstancePartitions != null && message.hasOwnProperty("unreachableInstancePartitions")) { + if (message.unreachableInstancePartitions != null && Object.hasOwnProperty.call(message, "unreachableInstancePartitions")) { if (!Array.isArray(message.unreachableInstancePartitions)) return "unreachableInstancePartitions: array expected"; for (var i = 0; i < message.unreachableInstancePartitions.length; ++i) @@ -51277,6 +52807,8 @@ ListInstancePartitionOperationsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -51287,7 +52819,7 @@ throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: array expected"); message.operations = []; for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") + if (!$util.isObject(object.operations[i])) throw TypeError(".google.spanner.admin.instance.v1.ListInstancePartitionOperationsResponse.operations: object expected"); message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); } @@ -51313,9 +52845,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancePartitionOperationsResponse.toObject = function toObject(message, options) { + ListInstancePartitionOperationsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.operations = []; @@ -51326,9 +52862,9 @@ if (message.operations && message.operations.length) { object.operations = []; for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; if (message.unreachableInstancePartitions && message.unreachableInstancePartitions.length) { object.unreachableInstancePartitions = []; @@ -51429,9 +52965,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveInstanceRequest.encode = function encode(message, writer) { + MoveInstanceRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) @@ -51449,7 +52989,7 @@ * @returns {$protobuf.Writer} Writer */ MoveInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -51523,10 +53063,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) if (!$util.isString(message.targetConfig)) return "targetConfig: string expected"; return null; @@ -51543,6 +53083,8 @@ MoveInstanceRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -51564,17 +53106,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveInstanceRequest.toObject = function toObject(message, options) { + MoveInstanceRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.targetConfig = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) object.targetConfig = message.targetConfig; return object; }; @@ -51652,9 +53198,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveInstanceResponse.encode = function encode(message, writer) { + MoveInstanceResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -51668,7 +53218,7 @@ * @returns {$protobuf.Writer} Writer */ MoveInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -51748,10 +53298,6 @@ MoveInstanceResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceResponse) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.spanner.admin.instance.v1.MoveInstanceResponse(); }; @@ -51868,15 +53414,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveInstanceMetadata.encode = function encode(message, writer) { + MoveInstanceMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetConfig); if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.OperationProgress.encode(message.progress, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) - $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.cancelTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -51890,7 +53440,7 @@ * @returns {$protobuf.Writer} Writer */ MoveInstanceMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -51968,15 +53518,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) if (!$util.isString(message.targetConfig)) return "targetConfig: string expected"; - if (message.progress != null && message.hasOwnProperty("progress")) { + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) { var error = $root.google.spanner.admin.instance.v1.OperationProgress.verify(message.progress, long + 1); if (error) return "progress." + error; } - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) { + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) { var error = $root.google.protobuf.Timestamp.verify(message.cancelTime, long + 1); if (error) return "cancelTime." + error; @@ -51995,6 +53545,8 @@ MoveInstanceMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.admin.instance.v1.MoveInstanceMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52003,12 +53555,12 @@ if (object.targetConfig != null) message.targetConfig = String(object.targetConfig); if (object.progress != null) { - if (typeof object.progress !== "object") + if (!$util.isObject(object.progress)) throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.progress: object expected"); message.progress = $root.google.spanner.admin.instance.v1.OperationProgress.fromObject(object.progress, long + 1); } if (object.cancelTime != null) { - if (typeof object.cancelTime !== "object") + if (!$util.isObject(object.cancelTime)) throw TypeError(".google.spanner.admin.instance.v1.MoveInstanceMetadata.cancelTime: object expected"); message.cancelTime = $root.google.protobuf.Timestamp.fromObject(object.cancelTime, long + 1); } @@ -52024,21 +53576,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveInstanceMetadata.toObject = function toObject(message, options) { + MoveInstanceMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.targetConfig = ""; object.progress = null; object.cancelTime = null; } - if (message.targetConfig != null && message.hasOwnProperty("targetConfig")) + if (message.targetConfig != null && Object.hasOwnProperty.call(message, "targetConfig")) object.targetConfig = message.targetConfig; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options); - if (message.cancelTime != null && message.hasOwnProperty("cancelTime")) - object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + object.progress = $root.google.spanner.admin.instance.v1.OperationProgress.toObject(message.progress, options, q + 1); + if (message.cancelTime != null && Object.hasOwnProperty.call(message, "cancelTime")) + object.cancelTime = $root.google.protobuf.Timestamp.toObject(message.cancelTime, options, q + 1); return object; }; @@ -52150,7 +53706,7 @@ * @variation 1 */ Object.defineProperty(SpannerExecutorProxy.prototype.executeActionAsync = function executeActionAsync(request, callback) { - return this.rpcCall(executeActionAsync, $root.google.spanner.executor.v1.SpannerAsyncActionRequest, $root.google.spanner.executor.v1.SpannerAsyncActionResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, executeActionAsync, $root.google.spanner.executor.v1.SpannerAsyncActionRequest, $root.google.spanner.executor.v1.SpannerAsyncActionResponse, request, callback); }, "name", { value: "ExecuteActionAsync" }); /** @@ -52228,13 +53784,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpannerAsyncActionRequest.encode = function encode(message, writer) { + SpannerAsyncActionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionId); if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.spanner.executor.v1.SpannerAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.SpannerAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -52248,7 +53808,7 @@ * @returns {$protobuf.Writer} Writer */ SpannerAsyncActionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -52322,10 +53882,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.actionId != null && message.hasOwnProperty("actionId")) + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) if (!$util.isInteger(message.actionId)) return "actionId: integer expected"; - if (message.action != null && message.hasOwnProperty("action")) { + if (message.action != null && Object.hasOwnProperty.call(message, "action")) { var error = $root.google.spanner.executor.v1.SpannerAction.verify(message.action, long + 1); if (error) return "action." + error; @@ -52344,6 +53904,8 @@ SpannerAsyncActionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.SpannerAsyncActionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52352,7 +53914,7 @@ if (object.actionId != null) message.actionId = object.actionId | 0; if (object.action != null) { - if (typeof object.action !== "object") + if (!$util.isObject(object.action)) throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionRequest.action: object expected"); message.action = $root.google.spanner.executor.v1.SpannerAction.fromObject(object.action, long + 1); } @@ -52368,18 +53930,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpannerAsyncActionRequest.toObject = function toObject(message, options) { + SpannerAsyncActionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.actionId = 0; object.action = null; } - if (message.actionId != null && message.hasOwnProperty("actionId")) + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) object.actionId = message.actionId; - if (message.action != null && message.hasOwnProperty("action")) - object.action = $root.google.spanner.executor.v1.SpannerAction.toObject(message.action, options); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + object.action = $root.google.spanner.executor.v1.SpannerAction.toObject(message.action, options, q + 1); return object; }; @@ -52474,13 +54040,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpannerAsyncActionResponse.encode = function encode(message, writer) { + SpannerAsyncActionResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.actionId); if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) - $root.google.spanner.executor.v1.SpannerActionOutcome.encode(message.outcome, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.SpannerActionOutcome.encode(message.outcome, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -52494,7 +54064,7 @@ * @returns {$protobuf.Writer} Writer */ SpannerAsyncActionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -52568,10 +54138,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.actionId != null && message.hasOwnProperty("actionId")) + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) if (!$util.isInteger(message.actionId)) return "actionId: integer expected"; - if (message.outcome != null && message.hasOwnProperty("outcome")) { + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) { var error = $root.google.spanner.executor.v1.SpannerActionOutcome.verify(message.outcome, long + 1); if (error) return "outcome." + error; @@ -52590,6 +54160,8 @@ SpannerAsyncActionResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.SpannerAsyncActionResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52598,7 +54170,7 @@ if (object.actionId != null) message.actionId = object.actionId | 0; if (object.outcome != null) { - if (typeof object.outcome !== "object") + if (!$util.isObject(object.outcome)) throw TypeError(".google.spanner.executor.v1.SpannerAsyncActionResponse.outcome: object expected"); message.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.fromObject(object.outcome, long + 1); } @@ -52614,18 +54186,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpannerAsyncActionResponse.toObject = function toObject(message, options) { + SpannerAsyncActionResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.actionId = 0; object.outcome = null; } - if (message.actionId != null && message.hasOwnProperty("actionId")) + if (message.actionId != null && Object.hasOwnProperty.call(message, "actionId")) object.actionId = message.actionId; - if (message.outcome != null && message.hasOwnProperty("outcome")) - object.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.toObject(message.outcome, options); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + object.outcome = $root.google.spanner.executor.v1.SpannerActionOutcome.toObject(message.outcome, options, q + 1); return object; }; @@ -52896,49 +54472,53 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpannerAction.encode = function encode(message, writer) { + SpannerAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databasePath != null && Object.hasOwnProperty.call(message, "databasePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.databasePath); if (message.spannerOptions != null && Object.hasOwnProperty.call(message, "spannerOptions")) - $root.google.spanner.executor.v1.SpannerOptions.encode(message.spannerOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.SpannerOptions.encode(message.spannerOptions, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.start != null && Object.hasOwnProperty.call(message, "start")) - $root.google.spanner.executor.v1.StartTransactionAction.encode(message.start, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.spanner.executor.v1.StartTransactionAction.encode(message.start, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.finish != null && Object.hasOwnProperty.call(message, "finish")) - $root.google.spanner.executor.v1.FinishTransactionAction.encode(message.finish, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.spanner.executor.v1.FinishTransactionAction.encode(message.finish, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.read != null && Object.hasOwnProperty.call(message, "read")) - $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) - $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); if (message.dml != null && Object.hasOwnProperty.call(message, "dml")) - $root.google.spanner.executor.v1.DmlAction.encode(message.dml, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + $root.google.spanner.executor.v1.DmlAction.encode(message.dml, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); if (message.batchDml != null && Object.hasOwnProperty.call(message, "batchDml")) - $root.google.spanner.executor.v1.BatchDmlAction.encode(message.batchDml, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + $root.google.spanner.executor.v1.BatchDmlAction.encode(message.batchDml, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); if (message.write != null && Object.hasOwnProperty.call(message, "write")) - $root.google.spanner.executor.v1.WriteMutationsAction.encode(message.write, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + $root.google.spanner.executor.v1.WriteMutationsAction.encode(message.write, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); if (message.partitionedUpdate != null && Object.hasOwnProperty.call(message, "partitionedUpdate")) - $root.google.spanner.executor.v1.PartitionedUpdateAction.encode(message.partitionedUpdate, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.spanner.executor.v1.PartitionedUpdateAction.encode(message.partitionedUpdate, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) - $root.google.spanner.executor.v1.AdminAction.encode(message.admin, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + $root.google.spanner.executor.v1.AdminAction.encode(message.admin, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); if (message.startBatchTxn != null && Object.hasOwnProperty.call(message, "startBatchTxn")) - $root.google.spanner.executor.v1.StartBatchTransactionAction.encode(message.startBatchTxn, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + $root.google.spanner.executor.v1.StartBatchTransactionAction.encode(message.startBatchTxn, writer.uint32(/* id 40, wireType 2 =*/322).fork(), q + 1).ldelim(); if (message.closeBatchTxn != null && Object.hasOwnProperty.call(message, "closeBatchTxn")) - $root.google.spanner.executor.v1.CloseBatchTransactionAction.encode(message.closeBatchTxn, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + $root.google.spanner.executor.v1.CloseBatchTransactionAction.encode(message.closeBatchTxn, writer.uint32(/* id 41, wireType 2 =*/330).fork(), q + 1).ldelim(); if (message.generateDbPartitionsRead != null && Object.hasOwnProperty.call(message, "generateDbPartitionsRead")) - $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.encode(message.generateDbPartitionsRead, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.encode(message.generateDbPartitionsRead, writer.uint32(/* id 42, wireType 2 =*/338).fork(), q + 1).ldelim(); if (message.generateDbPartitionsQuery != null && Object.hasOwnProperty.call(message, "generateDbPartitionsQuery")) - $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.encode(message.generateDbPartitionsQuery, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.encode(message.generateDbPartitionsQuery, writer.uint32(/* id 43, wireType 2 =*/346).fork(), q + 1).ldelim(); if (message.executePartition != null && Object.hasOwnProperty.call(message, "executePartition")) - $root.google.spanner.executor.v1.ExecutePartitionAction.encode(message.executePartition, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + $root.google.spanner.executor.v1.ExecutePartitionAction.encode(message.executePartition, writer.uint32(/* id 44, wireType 2 =*/354).fork(), q + 1).ldelim(); if (message.executeChangeStreamQuery != null && Object.hasOwnProperty.call(message, "executeChangeStreamQuery")) - $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.encode(message.executeChangeStreamQuery, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.encode(message.executeChangeStreamQuery, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); if (message.queryCancellation != null && Object.hasOwnProperty.call(message, "queryCancellation")) - $root.google.spanner.executor.v1.QueryCancellationAction.encode(message.queryCancellation, writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryCancellationAction.encode(message.queryCancellation, writer.uint32(/* id 51, wireType 2 =*/410).fork(), q + 1).ldelim(); if (message.adaptMessage != null && Object.hasOwnProperty.call(message, "adaptMessage")) - $root.google.spanner.executor.v1.AdaptMessageAction.encode(message.adaptMessage, writer.uint32(/* id 52, wireType 2 =*/418).fork()).ldelim(); + $root.google.spanner.executor.v1.AdaptMessageAction.encode(message.adaptMessage, writer.uint32(/* id 52, wireType 2 =*/418).fork(), q + 1).ldelim(); return writer; }; @@ -52952,7 +54532,7 @@ * @returns {$protobuf.Writer} Writer */ SpannerAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -53099,15 +54679,15 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.databasePath != null && message.hasOwnProperty("databasePath")) + if (message.databasePath != null && Object.hasOwnProperty.call(message, "databasePath")) if (!$util.isString(message.databasePath)) return "databasePath: string expected"; - if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) { + if (message.spannerOptions != null && Object.hasOwnProperty.call(message, "spannerOptions")) { var error = $root.google.spanner.executor.v1.SpannerOptions.verify(message.spannerOptions, long + 1); if (error) return "spannerOptions." + error; } - if (message.start != null && message.hasOwnProperty("start")) { + if (message.start != null && Object.hasOwnProperty.call(message, "start")) { properties.action = 1; { var error = $root.google.spanner.executor.v1.StartTransactionAction.verify(message.start, long + 1); @@ -53115,7 +54695,7 @@ return "start." + error; } } - if (message.finish != null && message.hasOwnProperty("finish")) { + if (message.finish != null && Object.hasOwnProperty.call(message, "finish")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53125,7 +54705,7 @@ return "finish." + error; } } - if (message.read != null && message.hasOwnProperty("read")) { + if (message.read != null && Object.hasOwnProperty.call(message, "read")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53135,7 +54715,7 @@ return "read." + error; } } - if (message.query != null && message.hasOwnProperty("query")) { + if (message.query != null && Object.hasOwnProperty.call(message, "query")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53145,7 +54725,7 @@ return "query." + error; } } - if (message.mutation != null && message.hasOwnProperty("mutation")) { + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53155,7 +54735,7 @@ return "mutation." + error; } } - if (message.dml != null && message.hasOwnProperty("dml")) { + if (message.dml != null && Object.hasOwnProperty.call(message, "dml")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53165,7 +54745,7 @@ return "dml." + error; } } - if (message.batchDml != null && message.hasOwnProperty("batchDml")) { + if (message.batchDml != null && Object.hasOwnProperty.call(message, "batchDml")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53175,7 +54755,7 @@ return "batchDml." + error; } } - if (message.write != null && message.hasOwnProperty("write")) { + if (message.write != null && Object.hasOwnProperty.call(message, "write")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53185,7 +54765,7 @@ return "write." + error; } } - if (message.partitionedUpdate != null && message.hasOwnProperty("partitionedUpdate")) { + if (message.partitionedUpdate != null && Object.hasOwnProperty.call(message, "partitionedUpdate")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53195,7 +54775,7 @@ return "partitionedUpdate." + error; } } - if (message.admin != null && message.hasOwnProperty("admin")) { + if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53205,7 +54785,7 @@ return "admin." + error; } } - if (message.startBatchTxn != null && message.hasOwnProperty("startBatchTxn")) { + if (message.startBatchTxn != null && Object.hasOwnProperty.call(message, "startBatchTxn")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53215,7 +54795,7 @@ return "startBatchTxn." + error; } } - if (message.closeBatchTxn != null && message.hasOwnProperty("closeBatchTxn")) { + if (message.closeBatchTxn != null && Object.hasOwnProperty.call(message, "closeBatchTxn")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53225,7 +54805,7 @@ return "closeBatchTxn." + error; } } - if (message.generateDbPartitionsRead != null && message.hasOwnProperty("generateDbPartitionsRead")) { + if (message.generateDbPartitionsRead != null && Object.hasOwnProperty.call(message, "generateDbPartitionsRead")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53235,7 +54815,7 @@ return "generateDbPartitionsRead." + error; } } - if (message.generateDbPartitionsQuery != null && message.hasOwnProperty("generateDbPartitionsQuery")) { + if (message.generateDbPartitionsQuery != null && Object.hasOwnProperty.call(message, "generateDbPartitionsQuery")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53245,7 +54825,7 @@ return "generateDbPartitionsQuery." + error; } } - if (message.executePartition != null && message.hasOwnProperty("executePartition")) { + if (message.executePartition != null && Object.hasOwnProperty.call(message, "executePartition")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53255,7 +54835,7 @@ return "executePartition." + error; } } - if (message.executeChangeStreamQuery != null && message.hasOwnProperty("executeChangeStreamQuery")) { + if (message.executeChangeStreamQuery != null && Object.hasOwnProperty.call(message, "executeChangeStreamQuery")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53265,7 +54845,7 @@ return "executeChangeStreamQuery." + error; } } - if (message.queryCancellation != null && message.hasOwnProperty("queryCancellation")) { + if (message.queryCancellation != null && Object.hasOwnProperty.call(message, "queryCancellation")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53275,7 +54855,7 @@ return "queryCancellation." + error; } } - if (message.adaptMessage != null && message.hasOwnProperty("adaptMessage")) { + if (message.adaptMessage != null && Object.hasOwnProperty.call(message, "adaptMessage")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -53299,6 +54879,8 @@ SpannerAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.SpannerAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.SpannerAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53307,97 +54889,97 @@ if (object.databasePath != null) message.databasePath = String(object.databasePath); if (object.spannerOptions != null) { - if (typeof object.spannerOptions !== "object") + if (!$util.isObject(object.spannerOptions)) throw TypeError(".google.spanner.executor.v1.SpannerAction.spannerOptions: object expected"); message.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.fromObject(object.spannerOptions, long + 1); } if (object.start != null) { - if (typeof object.start !== "object") + if (!$util.isObject(object.start)) throw TypeError(".google.spanner.executor.v1.SpannerAction.start: object expected"); message.start = $root.google.spanner.executor.v1.StartTransactionAction.fromObject(object.start, long + 1); } if (object.finish != null) { - if (typeof object.finish !== "object") + if (!$util.isObject(object.finish)) throw TypeError(".google.spanner.executor.v1.SpannerAction.finish: object expected"); message.finish = $root.google.spanner.executor.v1.FinishTransactionAction.fromObject(object.finish, long + 1); } if (object.read != null) { - if (typeof object.read !== "object") + if (!$util.isObject(object.read)) throw TypeError(".google.spanner.executor.v1.SpannerAction.read: object expected"); message.read = $root.google.spanner.executor.v1.ReadAction.fromObject(object.read, long + 1); } if (object.query != null) { - if (typeof object.query !== "object") + if (!$util.isObject(object.query)) throw TypeError(".google.spanner.executor.v1.SpannerAction.query: object expected"); message.query = $root.google.spanner.executor.v1.QueryAction.fromObject(object.query, long + 1); } if (object.mutation != null) { - if (typeof object.mutation !== "object") + if (!$util.isObject(object.mutation)) throw TypeError(".google.spanner.executor.v1.SpannerAction.mutation: object expected"); message.mutation = $root.google.spanner.executor.v1.MutationAction.fromObject(object.mutation, long + 1); } if (object.dml != null) { - if (typeof object.dml !== "object") + if (!$util.isObject(object.dml)) throw TypeError(".google.spanner.executor.v1.SpannerAction.dml: object expected"); message.dml = $root.google.spanner.executor.v1.DmlAction.fromObject(object.dml, long + 1); } if (object.batchDml != null) { - if (typeof object.batchDml !== "object") + if (!$util.isObject(object.batchDml)) throw TypeError(".google.spanner.executor.v1.SpannerAction.batchDml: object expected"); message.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.fromObject(object.batchDml, long + 1); } if (object.write != null) { - if (typeof object.write !== "object") + if (!$util.isObject(object.write)) throw TypeError(".google.spanner.executor.v1.SpannerAction.write: object expected"); message.write = $root.google.spanner.executor.v1.WriteMutationsAction.fromObject(object.write, long + 1); } if (object.partitionedUpdate != null) { - if (typeof object.partitionedUpdate !== "object") + if (!$util.isObject(object.partitionedUpdate)) throw TypeError(".google.spanner.executor.v1.SpannerAction.partitionedUpdate: object expected"); message.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.fromObject(object.partitionedUpdate, long + 1); } if (object.admin != null) { - if (typeof object.admin !== "object") + if (!$util.isObject(object.admin)) throw TypeError(".google.spanner.executor.v1.SpannerAction.admin: object expected"); message.admin = $root.google.spanner.executor.v1.AdminAction.fromObject(object.admin, long + 1); } if (object.startBatchTxn != null) { - if (typeof object.startBatchTxn !== "object") + if (!$util.isObject(object.startBatchTxn)) throw TypeError(".google.spanner.executor.v1.SpannerAction.startBatchTxn: object expected"); message.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.fromObject(object.startBatchTxn, long + 1); } if (object.closeBatchTxn != null) { - if (typeof object.closeBatchTxn !== "object") + if (!$util.isObject(object.closeBatchTxn)) throw TypeError(".google.spanner.executor.v1.SpannerAction.closeBatchTxn: object expected"); message.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.fromObject(object.closeBatchTxn, long + 1); } if (object.generateDbPartitionsRead != null) { - if (typeof object.generateDbPartitionsRead !== "object") + if (!$util.isObject(object.generateDbPartitionsRead)) throw TypeError(".google.spanner.executor.v1.SpannerAction.generateDbPartitionsRead: object expected"); message.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.fromObject(object.generateDbPartitionsRead, long + 1); } if (object.generateDbPartitionsQuery != null) { - if (typeof object.generateDbPartitionsQuery !== "object") + if (!$util.isObject(object.generateDbPartitionsQuery)) throw TypeError(".google.spanner.executor.v1.SpannerAction.generateDbPartitionsQuery: object expected"); message.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.fromObject(object.generateDbPartitionsQuery, long + 1); } if (object.executePartition != null) { - if (typeof object.executePartition !== "object") + if (!$util.isObject(object.executePartition)) throw TypeError(".google.spanner.executor.v1.SpannerAction.executePartition: object expected"); message.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.fromObject(object.executePartition, long + 1); } if (object.executeChangeStreamQuery != null) { - if (typeof object.executeChangeStreamQuery !== "object") + if (!$util.isObject(object.executeChangeStreamQuery)) throw TypeError(".google.spanner.executor.v1.SpannerAction.executeChangeStreamQuery: object expected"); message.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.fromObject(object.executeChangeStreamQuery, long + 1); } if (object.queryCancellation != null) { - if (typeof object.queryCancellation !== "object") + if (!$util.isObject(object.queryCancellation)) throw TypeError(".google.spanner.executor.v1.SpannerAction.queryCancellation: object expected"); message.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.fromObject(object.queryCancellation, long + 1); } if (object.adaptMessage != null) { - if (typeof object.adaptMessage !== "object") + if (!$util.isObject(object.adaptMessage)) throw TypeError(".google.spanner.executor.v1.SpannerAction.adaptMessage: object expected"); message.adaptMessage = $root.google.spanner.executor.v1.AdaptMessageAction.fromObject(object.adaptMessage, long + 1); } @@ -53413,105 +54995,109 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpannerAction.toObject = function toObject(message, options) { + SpannerAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.databasePath = ""; object.spannerOptions = null; } - if (message.databasePath != null && message.hasOwnProperty("databasePath")) + if (message.databasePath != null && Object.hasOwnProperty.call(message, "databasePath")) object.databasePath = message.databasePath; - if (message.spannerOptions != null && message.hasOwnProperty("spannerOptions")) - object.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.toObject(message.spannerOptions, options); - if (message.start != null && message.hasOwnProperty("start")) { - object.start = $root.google.spanner.executor.v1.StartTransactionAction.toObject(message.start, options); + if (message.spannerOptions != null && Object.hasOwnProperty.call(message, "spannerOptions")) + object.spannerOptions = $root.google.spanner.executor.v1.SpannerOptions.toObject(message.spannerOptions, options, q + 1); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) { + object.start = $root.google.spanner.executor.v1.StartTransactionAction.toObject(message.start, options, q + 1); if (options.oneofs) object.action = "start"; } - if (message.finish != null && message.hasOwnProperty("finish")) { - object.finish = $root.google.spanner.executor.v1.FinishTransactionAction.toObject(message.finish, options); + if (message.finish != null && Object.hasOwnProperty.call(message, "finish")) { + object.finish = $root.google.spanner.executor.v1.FinishTransactionAction.toObject(message.finish, options, q + 1); if (options.oneofs) object.action = "finish"; } - if (message.read != null && message.hasOwnProperty("read")) { - object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options); + if (message.read != null && Object.hasOwnProperty.call(message, "read")) { + object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options, q + 1); if (options.oneofs) object.action = "read"; } - if (message.query != null && message.hasOwnProperty("query")) { - object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) { + object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options, q + 1); if (options.oneofs) object.action = "query"; } - if (message.mutation != null && message.hasOwnProperty("mutation")) { - object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options); + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) { + object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options, q + 1); if (options.oneofs) object.action = "mutation"; } - if (message.dml != null && message.hasOwnProperty("dml")) { - object.dml = $root.google.spanner.executor.v1.DmlAction.toObject(message.dml, options); + if (message.dml != null && Object.hasOwnProperty.call(message, "dml")) { + object.dml = $root.google.spanner.executor.v1.DmlAction.toObject(message.dml, options, q + 1); if (options.oneofs) object.action = "dml"; } - if (message.batchDml != null && message.hasOwnProperty("batchDml")) { - object.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.toObject(message.batchDml, options); + if (message.batchDml != null && Object.hasOwnProperty.call(message, "batchDml")) { + object.batchDml = $root.google.spanner.executor.v1.BatchDmlAction.toObject(message.batchDml, options, q + 1); if (options.oneofs) object.action = "batchDml"; } - if (message.write != null && message.hasOwnProperty("write")) { - object.write = $root.google.spanner.executor.v1.WriteMutationsAction.toObject(message.write, options); + if (message.write != null && Object.hasOwnProperty.call(message, "write")) { + object.write = $root.google.spanner.executor.v1.WriteMutationsAction.toObject(message.write, options, q + 1); if (options.oneofs) object.action = "write"; } - if (message.partitionedUpdate != null && message.hasOwnProperty("partitionedUpdate")) { - object.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.toObject(message.partitionedUpdate, options); + if (message.partitionedUpdate != null && Object.hasOwnProperty.call(message, "partitionedUpdate")) { + object.partitionedUpdate = $root.google.spanner.executor.v1.PartitionedUpdateAction.toObject(message.partitionedUpdate, options, q + 1); if (options.oneofs) object.action = "partitionedUpdate"; } - if (message.admin != null && message.hasOwnProperty("admin")) { - object.admin = $root.google.spanner.executor.v1.AdminAction.toObject(message.admin, options); + if (message.admin != null && Object.hasOwnProperty.call(message, "admin")) { + object.admin = $root.google.spanner.executor.v1.AdminAction.toObject(message.admin, options, q + 1); if (options.oneofs) object.action = "admin"; } - if (message.startBatchTxn != null && message.hasOwnProperty("startBatchTxn")) { - object.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.toObject(message.startBatchTxn, options); + if (message.startBatchTxn != null && Object.hasOwnProperty.call(message, "startBatchTxn")) { + object.startBatchTxn = $root.google.spanner.executor.v1.StartBatchTransactionAction.toObject(message.startBatchTxn, options, q + 1); if (options.oneofs) object.action = "startBatchTxn"; } - if (message.closeBatchTxn != null && message.hasOwnProperty("closeBatchTxn")) { - object.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.toObject(message.closeBatchTxn, options); + if (message.closeBatchTxn != null && Object.hasOwnProperty.call(message, "closeBatchTxn")) { + object.closeBatchTxn = $root.google.spanner.executor.v1.CloseBatchTransactionAction.toObject(message.closeBatchTxn, options, q + 1); if (options.oneofs) object.action = "closeBatchTxn"; } - if (message.generateDbPartitionsRead != null && message.hasOwnProperty("generateDbPartitionsRead")) { - object.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.toObject(message.generateDbPartitionsRead, options); + if (message.generateDbPartitionsRead != null && Object.hasOwnProperty.call(message, "generateDbPartitionsRead")) { + object.generateDbPartitionsRead = $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction.toObject(message.generateDbPartitionsRead, options, q + 1); if (options.oneofs) object.action = "generateDbPartitionsRead"; } - if (message.generateDbPartitionsQuery != null && message.hasOwnProperty("generateDbPartitionsQuery")) { - object.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.toObject(message.generateDbPartitionsQuery, options); + if (message.generateDbPartitionsQuery != null && Object.hasOwnProperty.call(message, "generateDbPartitionsQuery")) { + object.generateDbPartitionsQuery = $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.toObject(message.generateDbPartitionsQuery, options, q + 1); if (options.oneofs) object.action = "generateDbPartitionsQuery"; } - if (message.executePartition != null && message.hasOwnProperty("executePartition")) { - object.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.toObject(message.executePartition, options); + if (message.executePartition != null && Object.hasOwnProperty.call(message, "executePartition")) { + object.executePartition = $root.google.spanner.executor.v1.ExecutePartitionAction.toObject(message.executePartition, options, q + 1); if (options.oneofs) object.action = "executePartition"; } - if (message.executeChangeStreamQuery != null && message.hasOwnProperty("executeChangeStreamQuery")) { - object.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.toObject(message.executeChangeStreamQuery, options); + if (message.executeChangeStreamQuery != null && Object.hasOwnProperty.call(message, "executeChangeStreamQuery")) { + object.executeChangeStreamQuery = $root.google.spanner.executor.v1.ExecuteChangeStreamQuery.toObject(message.executeChangeStreamQuery, options, q + 1); if (options.oneofs) object.action = "executeChangeStreamQuery"; } - if (message.queryCancellation != null && message.hasOwnProperty("queryCancellation")) { - object.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.toObject(message.queryCancellation, options); + if (message.queryCancellation != null && Object.hasOwnProperty.call(message, "queryCancellation")) { + object.queryCancellation = $root.google.spanner.executor.v1.QueryCancellationAction.toObject(message.queryCancellation, options, q + 1); if (options.oneofs) object.action = "queryCancellation"; } - if (message.adaptMessage != null && message.hasOwnProperty("adaptMessage")) { - object.adaptMessage = $root.google.spanner.executor.v1.AdaptMessageAction.toObject(message.adaptMessage, options); + if (message.adaptMessage != null && Object.hasOwnProperty.call(message, "adaptMessage")) { + object.adaptMessage = $root.google.spanner.executor.v1.AdaptMessageAction.toObject(message.adaptMessage, options, q + 1); if (options.oneofs) object.action = "adaptMessage"; } @@ -53646,9 +55232,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadAction.encode = function encode(message, writer) { + ReadAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); if (message.index != null && Object.hasOwnProperty.call(message, "index")) @@ -53657,7 +55247,7 @@ for (var i = 0; i < message.column.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.column[i]); if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) - $root.google.spanner.executor.v1.KeySet.encode(message.keys, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.executor.v1.KeySet.encode(message.keys, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.limit); return writer; @@ -53673,7 +55263,7 @@ * @returns {$protobuf.Writer} Writer */ ReadAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -53762,27 +55352,27 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) { + if (message.index != null && Object.hasOwnProperty.call(message, "index")) { properties._index = 1; if (!$util.isString(message.index)) return "index: string expected"; } - if (message.column != null && message.hasOwnProperty("column")) { + if (message.column != null && Object.hasOwnProperty.call(message, "column")) { if (!Array.isArray(message.column)) return "column: array expected"; for (var i = 0; i < message.column.length; ++i) if (!$util.isString(message.column[i])) return "column: string[] expected"; } - if (message.keys != null && message.hasOwnProperty("keys")) { + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) { var error = $root.google.spanner.executor.v1.KeySet.verify(message.keys, long + 1); if (error) return "keys." + error; } - if (message.limit != null && message.hasOwnProperty("limit")) + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) if (!$util.isInteger(message.limit)) return "limit: integer expected"; return null; @@ -53799,6 +55389,8 @@ ReadAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ReadAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ReadAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53816,7 +55408,7 @@ message.column[i] = String(object.column[i]); } if (object.keys != null) { - if (typeof object.keys !== "object") + if (!$util.isObject(object.keys)) throw TypeError(".google.spanner.executor.v1.ReadAction.keys: object expected"); message.keys = $root.google.spanner.executor.v1.KeySet.fromObject(object.keys, long + 1); } @@ -53834,9 +55426,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadAction.toObject = function toObject(message, options) { + ReadAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.column = []; @@ -53845,9 +55441,9 @@ object.keys = null; object.limit = 0; } - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) { + if (message.index != null && Object.hasOwnProperty.call(message, "index")) { object.index = message.index; if (options.oneofs) object._index = "index"; @@ -53857,9 +55453,9 @@ for (var j = 0; j < message.column.length; ++j) object.column[j] = message.column[j]; } - if (message.keys != null && message.hasOwnProperty("keys")) - object.keys = $root.google.spanner.executor.v1.KeySet.toObject(message.keys, options); - if (message.limit != null && message.hasOwnProperty("limit")) + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) + object.keys = $root.google.spanner.executor.v1.KeySet.toObject(message.keys, options, q + 1); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) object.limit = message.limit; return object; }; @@ -53956,14 +55552,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryAction.encode = function encode(message, writer) { + QueryAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); if (message.params != null && message.params.length) for (var i = 0; i < message.params.length; ++i) - $root.google.spanner.executor.v1.QueryAction.Parameter.encode(message.params[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryAction.Parameter.encode(message.params[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -53977,7 +55577,7 @@ * @returns {$protobuf.Writer} Writer */ QueryAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54053,10 +55653,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) if (!$util.isString(message.sql)) return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { + if (message.params != null && Object.hasOwnProperty.call(message, "params")) { if (!Array.isArray(message.params)) return "params: array expected"; for (var i = 0; i < message.params.length; ++i) { @@ -54079,6 +55679,8 @@ QueryAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.QueryAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.QueryAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54091,7 +55693,7 @@ throw TypeError(".google.spanner.executor.v1.QueryAction.params: array expected"); message.params = []; for (var i = 0; i < object.params.length; ++i) { - if (typeof object.params[i] !== "object") + if (!$util.isObject(object.params[i])) throw TypeError(".google.spanner.executor.v1.QueryAction.params: object expected"); message.params[i] = $root.google.spanner.executor.v1.QueryAction.Parameter.fromObject(object.params[i], long + 1); } @@ -54108,20 +55710,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryAction.toObject = function toObject(message, options) { + QueryAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.params = []; if (options.defaults) object.sql = ""; - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) object.sql = message.sql; if (message.params && message.params.length) { object.params = []; for (var j = 0; j < message.params.length; ++j) - object.params[j] = $root.google.spanner.executor.v1.QueryAction.Parameter.toObject(message.params[j], options); + object.params[j] = $root.google.spanner.executor.v1.QueryAction.Parameter.toObject(message.params[j], options, q + 1); } return object; }; @@ -54223,15 +55829,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Parameter.encode = function encode(message, writer) { + Parameter.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.spanner.executor.v1.Value.encode(message.value, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.Value.encode(message.value, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -54245,7 +55855,7 @@ * @returns {$protobuf.Writer} Writer */ Parameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54323,15 +55933,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { var error = $root.google.spanner.v1.Type.verify(message.type, long + 1); if (error) return "type." + error; } - if (message.value != null && message.hasOwnProperty("value")) { + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { var error = $root.google.spanner.executor.v1.Value.verify(message.value, long + 1); if (error) return "value." + error; @@ -54350,6 +55960,8 @@ Parameter.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.QueryAction.Parameter) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.QueryAction.Parameter: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54358,12 +55970,12 @@ if (object.name != null) message.name = String(object.name); if (object.type != null) { - if (typeof object.type !== "object") + if (!$util.isObject(object.type)) throw TypeError(".google.spanner.executor.v1.QueryAction.Parameter.type: object expected"); message.type = $root.google.spanner.v1.Type.fromObject(object.type, long + 1); } if (object.value != null) { - if (typeof object.value !== "object") + if (!$util.isObject(object.value)) throw TypeError(".google.spanner.executor.v1.QueryAction.Parameter.value: object expected"); message.value = $root.google.spanner.executor.v1.Value.fromObject(object.value, long + 1); } @@ -54379,21 +55991,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Parameter.toObject = function toObject(message, options) { + Parameter.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.type = null; object.value = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.google.spanner.executor.v1.Value.toObject(message.value, options); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options, q + 1); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = $root.google.spanner.executor.v1.Value.toObject(message.value, options, q + 1); return object; }; @@ -54515,11 +56131,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DmlAction.encode = function encode(message, writer) { + DmlAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.autocommitIfSupported != null && Object.hasOwnProperty.call(message, "autocommitIfSupported")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autocommitIfSupported); if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) @@ -54537,7 +56157,7 @@ * @returns {$protobuf.Writer} Writer */ DmlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54616,17 +56236,17 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.update != null && message.hasOwnProperty("update")) { + if (message.update != null && Object.hasOwnProperty.call(message, "update")) { var error = $root.google.spanner.executor.v1.QueryAction.verify(message.update, long + 1); if (error) return "update." + error; } - if (message.autocommitIfSupported != null && message.hasOwnProperty("autocommitIfSupported")) { + if (message.autocommitIfSupported != null && Object.hasOwnProperty.call(message, "autocommitIfSupported")) { properties._autocommitIfSupported = 1; if (typeof message.autocommitIfSupported !== "boolean") return "autocommitIfSupported: boolean expected"; } - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) { + if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) { properties._lastStatement = 1; if (typeof message.lastStatement !== "boolean") return "lastStatement: boolean expected"; @@ -54645,13 +56265,15 @@ DmlAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DmlAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DmlAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.DmlAction(); if (object.update != null) { - if (typeof object.update !== "object") + if (!$util.isObject(object.update)) throw TypeError(".google.spanner.executor.v1.DmlAction.update: object expected"); message.update = $root.google.spanner.executor.v1.QueryAction.fromObject(object.update, long + 1); } @@ -54671,20 +56293,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DmlAction.toObject = function toObject(message, options) { + DmlAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.update = null; - if (message.update != null && message.hasOwnProperty("update")) - object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options); - if (message.autocommitIfSupported != null && message.hasOwnProperty("autocommitIfSupported")) { + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options, q + 1); + if (message.autocommitIfSupported != null && Object.hasOwnProperty.call(message, "autocommitIfSupported")) { object.autocommitIfSupported = message.autocommitIfSupported; if (options.oneofs) object._autocommitIfSupported = "autocommitIfSupported"; } - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) { + if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) { object.lastStatement = message.lastStatement; if (options.oneofs) object._lastStatement = "lastStatement"; @@ -54793,12 +56419,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDmlAction.encode = function encode(message, writer) { + BatchDmlAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.updates != null && message.updates.length) for (var i = 0; i < message.updates.length; ++i) - $root.google.spanner.executor.v1.QueryAction.encode(message.updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryAction.encode(message.updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.lastStatements); return writer; @@ -54814,7 +56444,7 @@ * @returns {$protobuf.Writer} Writer */ BatchDmlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54891,7 +56521,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.updates != null && message.hasOwnProperty("updates")) { + if (message.updates != null && Object.hasOwnProperty.call(message, "updates")) { if (!Array.isArray(message.updates)) return "updates: array expected"; for (var i = 0; i < message.updates.length; ++i) { @@ -54900,7 +56530,7 @@ return "updates." + error; } } - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) { + if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) { properties._lastStatements = 1; if (typeof message.lastStatements !== "boolean") return "lastStatements: boolean expected"; @@ -54919,6 +56549,8 @@ BatchDmlAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.BatchDmlAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.BatchDmlAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54929,7 +56561,7 @@ throw TypeError(".google.spanner.executor.v1.BatchDmlAction.updates: array expected"); message.updates = []; for (var i = 0; i < object.updates.length; ++i) { - if (typeof object.updates[i] !== "object") + if (!$util.isObject(object.updates[i])) throw TypeError(".google.spanner.executor.v1.BatchDmlAction.updates: object expected"); message.updates[i] = $root.google.spanner.executor.v1.QueryAction.fromObject(object.updates[i], long + 1); } @@ -54948,18 +56580,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchDmlAction.toObject = function toObject(message, options) { + BatchDmlAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.updates = []; if (message.updates && message.updates.length) { object.updates = []; for (var j = 0; j < message.updates.length; ++j) - object.updates[j] = $root.google.spanner.executor.v1.QueryAction.toObject(message.updates[j], options); + object.updates[j] = $root.google.spanner.executor.v1.QueryAction.toObject(message.updates[j], options, q + 1); } - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) { + if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) { object.lastStatements = message.lastStatements; if (options.oneofs) object._lastStatements = "lastStatements"; @@ -55168,9 +56804,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Value.encode = function encode(message, writer) { + Value.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.isNull != null && Object.hasOwnProperty.call(message, "isNull")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isNull); if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) @@ -55184,17 +56824,17 @@ if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.stringValue); if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.spanner.executor.v1.ValueList.encode(message.structValue, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.structValue, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) - $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.dateDaysValue != null && Object.hasOwnProperty.call(message, "dateDaysValue")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.dateDaysValue); if (message.isCommitTimestamp != null && Object.hasOwnProperty.call(message, "isCommitTimestamp")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.isCommitTimestamp); if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) - $root.google.spanner.executor.v1.ValueList.encode(message.arrayValue, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.arrayValue, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) - $root.google.spanner.v1.Type.encode(message.arrayType, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.arrayType, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); return writer; }; @@ -55208,7 +56848,7 @@ * @returns {$protobuf.Writer} Writer */ Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -55323,47 +56963,47 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.isNull != null && message.hasOwnProperty("isNull")) { + if (message.isNull != null && Object.hasOwnProperty.call(message, "isNull")) { properties.valueType = 1; if (typeof message.isNull !== "boolean") return "isNull: boolean expected"; } - if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) return "intValue: integer|Long expected"; } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (typeof message.boolValue !== "boolean") return "boolValue: boolean expected"; } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) return "bytesValue: buffer expected"; } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (!$util.isString(message.stringValue)) return "stringValue: string expected"; } - if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; @@ -55373,7 +57013,7 @@ return "structValue." + error; } } - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; @@ -55383,21 +57023,21 @@ return "timestampValue." + error; } } - if (message.dateDaysValue != null && message.hasOwnProperty("dateDaysValue")) { + if (message.dateDaysValue != null && Object.hasOwnProperty.call(message, "dateDaysValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (!$util.isInteger(message.dateDaysValue)) return "dateDaysValue: integer expected"; } - if (message.isCommitTimestamp != null && message.hasOwnProperty("isCommitTimestamp")) { + if (message.isCommitTimestamp != null && Object.hasOwnProperty.call(message, "isCommitTimestamp")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (typeof message.isCommitTimestamp !== "boolean") return "isCommitTimestamp: boolean expected"; } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; @@ -55407,7 +57047,7 @@ return "arrayValue." + error; } } - if (message.arrayType != null && message.hasOwnProperty("arrayType")) { + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) { properties._arrayType = 1; { var error = $root.google.spanner.v1.Type.verify(message.arrayType, long + 1); @@ -55429,6 +57069,8 @@ Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -55438,7 +57080,7 @@ message.isNull = Boolean(object.isNull); if (object.intValue != null) if ($util.Long) - (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + message.intValue = $util.Long.fromValue(object.intValue, false); else if (typeof object.intValue === "string") message.intValue = parseInt(object.intValue, 10); else if (typeof object.intValue === "number") @@ -55457,12 +57099,12 @@ if (object.stringValue != null) message.stringValue = String(object.stringValue); if (object.structValue != null) { - if (typeof object.structValue !== "object") + if (!$util.isObject(object.structValue)) throw TypeError(".google.spanner.executor.v1.Value.structValue: object expected"); message.structValue = $root.google.spanner.executor.v1.ValueList.fromObject(object.structValue, long + 1); } if (object.timestampValue != null) { - if (typeof object.timestampValue !== "object") + if (!$util.isObject(object.timestampValue)) throw TypeError(".google.spanner.executor.v1.Value.timestampValue: object expected"); message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue, long + 1); } @@ -55471,12 +57113,12 @@ if (object.isCommitTimestamp != null) message.isCommitTimestamp = Boolean(object.isCommitTimestamp); if (object.arrayValue != null) { - if (typeof object.arrayValue !== "object") + if (!$util.isObject(object.arrayValue)) throw TypeError(".google.spanner.executor.v1.Value.arrayValue: object expected"); message.arrayValue = $root.google.spanner.executor.v1.ValueList.fromObject(object.arrayValue, long + 1); } if (object.arrayType != null) { - if (typeof object.arrayType !== "object") + if (!$util.isObject(object.arrayType)) throw TypeError(".google.spanner.executor.v1.Value.arrayType: object expected"); message.arrayType = $root.google.spanner.v1.Type.fromObject(object.arrayType, long + 1); } @@ -55492,70 +57134,76 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Value.toObject = function toObject(message, options) { + Value.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.isNull != null && message.hasOwnProperty("isNull")) { + if (message.isNull != null && Object.hasOwnProperty.call(message, "isNull")) { object.isNull = message.isNull; if (options.oneofs) object.valueType = "isNull"; } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (typeof message.intValue === "number") + if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.intValue = typeof message.intValue === "number" ? BigInt(message.intValue) : $util.Long.fromBits(message.intValue.low >>> 0, message.intValue.high >>> 0, false).toBigInt(); + else if (typeof message.intValue === "number") object.intValue = options.longs === String ? String(message.intValue) : message.intValue; else object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; if (options.oneofs) object.valueType = "intValue"; } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) { object.boolValue = message.boolValue; if (options.oneofs) object.valueType = "boolValue"; } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) { object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; if (options.oneofs) object.valueType = "doubleValue"; } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) { object.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; if (options.oneofs) object.valueType = "bytesValue"; } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) { object.stringValue = message.stringValue; if (options.oneofs) object.valueType = "stringValue"; } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.spanner.executor.v1.ValueList.toObject(message.structValue, options); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) { + object.structValue = $root.google.spanner.executor.v1.ValueList.toObject(message.structValue, options, q + 1); if (options.oneofs) object.valueType = "structValue"; } - if (message.timestampValue != null && message.hasOwnProperty("timestampValue")) { - object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) { + object.timestampValue = $root.google.protobuf.Timestamp.toObject(message.timestampValue, options, q + 1); if (options.oneofs) object.valueType = "timestampValue"; } - if (message.dateDaysValue != null && message.hasOwnProperty("dateDaysValue")) { + if (message.dateDaysValue != null && Object.hasOwnProperty.call(message, "dateDaysValue")) { object.dateDaysValue = message.dateDaysValue; if (options.oneofs) object.valueType = "dateDaysValue"; } - if (message.isCommitTimestamp != null && message.hasOwnProperty("isCommitTimestamp")) { + if (message.isCommitTimestamp != null && Object.hasOwnProperty.call(message, "isCommitTimestamp")) { object.isCommitTimestamp = message.isCommitTimestamp; if (options.oneofs) object.valueType = "isCommitTimestamp"; } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - object.arrayValue = $root.google.spanner.executor.v1.ValueList.toObject(message.arrayValue, options); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) { + object.arrayValue = $root.google.spanner.executor.v1.ValueList.toObject(message.arrayValue, options, q + 1); if (options.oneofs) object.valueType = "arrayValue"; } - if (message.arrayType != null && message.hasOwnProperty("arrayType")) { - object.arrayType = $root.google.spanner.v1.Type.toObject(message.arrayType, options); + if (message.arrayType != null && Object.hasOwnProperty.call(message, "arrayType")) { + object.arrayType = $root.google.spanner.v1.Type.toObject(message.arrayType, options, q + 1); if (options.oneofs) object._arrayType = "arrayType"; } @@ -55671,13 +57319,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeyRange.encode = function encode(message, writer) { + KeyRange.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.start != null && Object.hasOwnProperty.call(message, "start")) - $root.google.spanner.executor.v1.ValueList.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.start, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.spanner.executor.v1.ValueList.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.limit, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); return writer; @@ -55693,7 +57345,7 @@ * @returns {$protobuf.Writer} Writer */ KeyRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -55772,17 +57424,17 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.start != null && message.hasOwnProperty("start")) { + if (message.start != null && Object.hasOwnProperty.call(message, "start")) { var error = $root.google.spanner.executor.v1.ValueList.verify(message.start, long + 1); if (error) return "start." + error; } - if (message.limit != null && message.hasOwnProperty("limit")) { + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) { var error = $root.google.spanner.executor.v1.ValueList.verify(message.limit, long + 1); if (error) return "limit." + error; } - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { properties._type = 1; switch (message.type) { default: @@ -55809,18 +57461,20 @@ KeyRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.KeyRange) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.KeyRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.KeyRange(); if (object.start != null) { - if (typeof object.start !== "object") + if (!$util.isObject(object.start)) throw TypeError(".google.spanner.executor.v1.KeyRange.start: object expected"); message.start = $root.google.spanner.executor.v1.ValueList.fromObject(object.start, long + 1); } if (object.limit != null) { - if (typeof object.limit !== "object") + if (!$util.isObject(object.limit)) throw TypeError(".google.spanner.executor.v1.KeyRange.limit: object expected"); message.limit = $root.google.spanner.executor.v1.ValueList.fromObject(object.limit, long + 1); } @@ -55864,19 +57518,23 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KeyRange.toObject = function toObject(message, options) { + KeyRange.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.start = null; object.limit = null; } - if (message.start != null && message.hasOwnProperty("start")) - object.start = $root.google.spanner.executor.v1.ValueList.toObject(message.start, options); - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.spanner.executor.v1.ValueList.toObject(message.limit, options); - if (message.type != null && message.hasOwnProperty("type")) { + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + object.start = $root.google.spanner.executor.v1.ValueList.toObject(message.start, options, q + 1); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + object.limit = $root.google.spanner.executor.v1.ValueList.toObject(message.limit, options, q + 1); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { object.type = options.enums === String ? $root.google.spanner.executor.v1.KeyRange.Type[message.type] === undefined ? message.type : $root.google.spanner.executor.v1.KeyRange.Type[message.type] : message.type; if (options.oneofs) object._type = "type"; @@ -56006,15 +57664,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeySet.encode = function encode(message, writer) { + KeySet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.point != null && message.point.length) for (var i = 0; i < message.point.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.point[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.point[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.range != null && message.range.length) for (var i = 0; i < message.range.length; ++i) - $root.google.spanner.executor.v1.KeyRange.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.KeyRange.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.all != null && Object.hasOwnProperty.call(message, "all")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); return writer; @@ -56030,7 +57692,7 @@ * @returns {$protobuf.Writer} Writer */ KeySet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -56112,7 +57774,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.point != null && message.hasOwnProperty("point")) { + if (message.point != null && Object.hasOwnProperty.call(message, "point")) { if (!Array.isArray(message.point)) return "point: array expected"; for (var i = 0; i < message.point.length; ++i) { @@ -56121,7 +57783,7 @@ return "point." + error; } } - if (message.range != null && message.hasOwnProperty("range")) { + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { if (!Array.isArray(message.range)) return "range: array expected"; for (var i = 0; i < message.range.length; ++i) { @@ -56130,7 +57792,7 @@ return "range." + error; } } - if (message.all != null && message.hasOwnProperty("all")) + if (message.all != null && Object.hasOwnProperty.call(message, "all")) if (typeof message.all !== "boolean") return "all: boolean expected"; return null; @@ -56147,6 +57809,8 @@ KeySet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.KeySet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.KeySet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56157,7 +57821,7 @@ throw TypeError(".google.spanner.executor.v1.KeySet.point: array expected"); message.point = []; for (var i = 0; i < object.point.length; ++i) { - if (typeof object.point[i] !== "object") + if (!$util.isObject(object.point[i])) throw TypeError(".google.spanner.executor.v1.KeySet.point: object expected"); message.point[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.point[i], long + 1); } @@ -56167,7 +57831,7 @@ throw TypeError(".google.spanner.executor.v1.KeySet.range: array expected"); message.range = []; for (var i = 0; i < object.range.length; ++i) { - if (typeof object.range[i] !== "object") + if (!$util.isObject(object.range[i])) throw TypeError(".google.spanner.executor.v1.KeySet.range: object expected"); message.range[i] = $root.google.spanner.executor.v1.KeyRange.fromObject(object.range[i], long + 1); } @@ -56186,9 +57850,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KeySet.toObject = function toObject(message, options) { + KeySet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.point = []; @@ -56199,14 +57867,14 @@ if (message.point && message.point.length) { object.point = []; for (var j = 0; j < message.point.length; ++j) - object.point[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.point[j], options); + object.point[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.point[j], options, q + 1); } if (message.range && message.range.length) { object.range = []; for (var j = 0; j < message.range.length; ++j) - object.range[j] = $root.google.spanner.executor.v1.KeyRange.toObject(message.range[j], options); + object.range[j] = $root.google.spanner.executor.v1.KeyRange.toObject(message.range[j], options, q + 1); } - if (message.all != null && message.hasOwnProperty("all")) + if (message.all != null && Object.hasOwnProperty.call(message, "all")) object.all = message.all; return object; }; @@ -56294,12 +57962,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ValueList.encode = function encode(message, writer) { + ValueList.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.value != null && message.value.length) for (var i = 0; i < message.value.length; ++i) - $root.google.spanner.executor.v1.Value.encode(message.value[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.Value.encode(message.value[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -56313,7 +57985,7 @@ * @returns {$protobuf.Writer} Writer */ ValueList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -56385,7 +58057,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.value != null && message.hasOwnProperty("value")) { + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { if (!Array.isArray(message.value)) return "value: array expected"; for (var i = 0; i < message.value.length; ++i) { @@ -56408,6 +58080,8 @@ ValueList.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ValueList) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ValueList: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56418,7 +58092,7 @@ throw TypeError(".google.spanner.executor.v1.ValueList.value: array expected"); message.value = []; for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") + if (!$util.isObject(object.value[i])) throw TypeError(".google.spanner.executor.v1.ValueList.value: object expected"); message.value[i] = $root.google.spanner.executor.v1.Value.fromObject(object.value[i], long + 1); } @@ -56435,16 +58109,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ValueList.toObject = function toObject(message, options) { + ValueList.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.value = []; if (message.value && message.value.length) { object.value = []; for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.spanner.executor.v1.Value.toObject(message.value[j], options); + object.value[j] = $root.google.spanner.executor.v1.Value.toObject(message.value[j], options, q + 1); } return object; }; @@ -56532,12 +58210,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MutationAction.encode = function encode(message, writer) { + MutationAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.mod != null && message.mod.length) for (var i = 0; i < message.mod.length; ++i) - $root.google.spanner.executor.v1.MutationAction.Mod.encode(message.mod[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.MutationAction.Mod.encode(message.mod[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -56551,7 +58233,7 @@ * @returns {$protobuf.Writer} Writer */ MutationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -56623,7 +58305,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.mod != null && message.hasOwnProperty("mod")) { + if (message.mod != null && Object.hasOwnProperty.call(message, "mod")) { if (!Array.isArray(message.mod)) return "mod: array expected"; for (var i = 0; i < message.mod.length; ++i) { @@ -56646,6 +58328,8 @@ MutationAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.MutationAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.MutationAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56656,7 +58340,7 @@ throw TypeError(".google.spanner.executor.v1.MutationAction.mod: array expected"); message.mod = []; for (var i = 0; i < object.mod.length; ++i) { - if (typeof object.mod[i] !== "object") + if (!$util.isObject(object.mod[i])) throw TypeError(".google.spanner.executor.v1.MutationAction.mod: object expected"); message.mod[i] = $root.google.spanner.executor.v1.MutationAction.Mod.fromObject(object.mod[i], long + 1); } @@ -56673,16 +58357,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MutationAction.toObject = function toObject(message, options) { + MutationAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.mod = []; if (message.mod && message.mod.length) { object.mod = []; for (var j = 0; j < message.mod.length; ++j) - object.mod[j] = $root.google.spanner.executor.v1.MutationAction.Mod.toObject(message.mod[j], options); + object.mod[j] = $root.google.spanner.executor.v1.MutationAction.Mod.toObject(message.mod[j], options, q + 1); } return object; }; @@ -56787,18 +58475,22 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InsertArgs.encode = function encode(message, writer) { + InsertArgs.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.column != null && message.column.length) for (var i = 0; i < message.column.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.column[i]); if (message.type != null && message.type.length) for (var i = 0; i < message.type.length; ++i) - $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -56812,7 +58504,7 @@ * @returns {$protobuf.Writer} Writer */ InsertArgs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -56896,14 +58588,14 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.column != null && message.hasOwnProperty("column")) { + if (message.column != null && Object.hasOwnProperty.call(message, "column")) { if (!Array.isArray(message.column)) return "column: array expected"; for (var i = 0; i < message.column.length; ++i) if (!$util.isString(message.column[i])) return "column: string[] expected"; } - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { if (!Array.isArray(message.type)) return "type: array expected"; for (var i = 0; i < message.type.length; ++i) { @@ -56912,7 +58604,7 @@ return "type." + error; } } - if (message.values != null && message.hasOwnProperty("values")) { + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { if (!Array.isArray(message.values)) return "values: array expected"; for (var i = 0; i < message.values.length; ++i) { @@ -56935,6 +58627,8 @@ InsertArgs.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.MutationAction.InsertArgs) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56952,7 +58646,7 @@ throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.type: array expected"); message.type = []; for (var i = 0; i < object.type.length; ++i) { - if (typeof object.type[i] !== "object") + if (!$util.isObject(object.type[i])) throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.type: object expected"); message.type[i] = $root.google.spanner.v1.Type.fromObject(object.type[i], long + 1); } @@ -56962,7 +58656,7 @@ throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.values: array expected"); message.values = []; for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") + if (!$util.isObject(object.values[i])) throw TypeError(".google.spanner.executor.v1.MutationAction.InsertArgs.values: object expected"); message.values[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.values[i], long + 1); } @@ -56979,9 +58673,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InsertArgs.toObject = function toObject(message, options) { + InsertArgs.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.column = []; @@ -56996,12 +58694,12 @@ if (message.type && message.type.length) { object.type = []; for (var j = 0; j < message.type.length; ++j) - object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options); + object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options, q + 1); } if (message.values && message.values.length) { object.values = []; for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options); + object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options, q + 1); } return object; }; @@ -57109,18 +58807,22 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateArgs.encode = function encode(message, writer) { + UpdateArgs.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.column != null && message.column.length) for (var i = 0; i < message.column.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.column[i]); if (message.type != null && message.type.length) for (var i = 0; i < message.type.length; ++i) - $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.type[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -57134,7 +58836,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateArgs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -57218,14 +58920,14 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.column != null && message.hasOwnProperty("column")) { + if (message.column != null && Object.hasOwnProperty.call(message, "column")) { if (!Array.isArray(message.column)) return "column: array expected"; for (var i = 0; i < message.column.length; ++i) if (!$util.isString(message.column[i])) return "column: string[] expected"; } - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { if (!Array.isArray(message.type)) return "type: array expected"; for (var i = 0; i < message.type.length; ++i) { @@ -57234,7 +58936,7 @@ return "type." + error; } } - if (message.values != null && message.hasOwnProperty("values")) { + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { if (!Array.isArray(message.values)) return "values: array expected"; for (var i = 0; i < message.values.length; ++i) { @@ -57257,6 +58959,8 @@ UpdateArgs.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.MutationAction.UpdateArgs) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -57274,7 +58978,7 @@ throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.type: array expected"); message.type = []; for (var i = 0; i < object.type.length; ++i) { - if (typeof object.type[i] !== "object") + if (!$util.isObject(object.type[i])) throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.type: object expected"); message.type[i] = $root.google.spanner.v1.Type.fromObject(object.type[i], long + 1); } @@ -57284,7 +58988,7 @@ throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.values: array expected"); message.values = []; for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") + if (!$util.isObject(object.values[i])) throw TypeError(".google.spanner.executor.v1.MutationAction.UpdateArgs.values: object expected"); message.values[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.values[i], long + 1); } @@ -57301,9 +59005,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateArgs.toObject = function toObject(message, options) { + UpdateArgs.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.column = []; @@ -57318,12 +59026,12 @@ if (message.type && message.type.length) { object.type = []; for (var j = 0; j < message.type.length; ++j) - object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options); + object.type[j] = $root.google.spanner.v1.Type.toObject(message.type[j], options, q + 1); } if (message.values && message.values.length) { object.values = []; for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options); + object.values[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.values[j], options, q + 1); } return object; }; @@ -57455,21 +59163,25 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Mod.encode = function encode(message, writer) { + Mod.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) - $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insert, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.executor.v1.MutationAction.UpdateArgs.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.MutationAction.UpdateArgs.encode(message.update, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) - $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insertOrUpdate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.insertOrUpdate, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) - $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.replace, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.executor.v1.MutationAction.InsertArgs.encode(message.replace, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.deleteKeys != null && Object.hasOwnProperty.call(message, "deleteKeys")) - $root.google.spanner.executor.v1.KeySet.encode(message.deleteKeys, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.executor.v1.KeySet.encode(message.deleteKeys, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -57483,7 +59195,7 @@ * @returns {$protobuf.Writer} Writer */ Mod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -57573,30 +59285,30 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.insert != null && message.hasOwnProperty("insert")) { + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) { var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.insert, long + 1); if (error) return "insert." + error; } - if (message.update != null && message.hasOwnProperty("update")) { + if (message.update != null && Object.hasOwnProperty.call(message, "update")) { var error = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.verify(message.update, long + 1); if (error) return "update." + error; } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { + if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) { var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.insertOrUpdate, long + 1); if (error) return "insertOrUpdate." + error; } - if (message.replace != null && message.hasOwnProperty("replace")) { + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) { var error = $root.google.spanner.executor.v1.MutationAction.InsertArgs.verify(message.replace, long + 1); if (error) return "replace." + error; } - if (message.deleteKeys != null && message.hasOwnProperty("deleteKeys")) { + if (message.deleteKeys != null && Object.hasOwnProperty.call(message, "deleteKeys")) { var error = $root.google.spanner.executor.v1.KeySet.verify(message.deleteKeys, long + 1); if (error) return "deleteKeys." + error; @@ -57615,6 +59327,8 @@ Mod.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.MutationAction.Mod) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.MutationAction.Mod: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -57623,27 +59337,27 @@ if (object.table != null) message.table = String(object.table); if (object.insert != null) { - if (typeof object.insert !== "object") + if (!$util.isObject(object.insert)) throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.insert: object expected"); message.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.insert, long + 1); } if (object.update != null) { - if (typeof object.update !== "object") + if (!$util.isObject(object.update)) throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.update: object expected"); message.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.fromObject(object.update, long + 1); } if (object.insertOrUpdate != null) { - if (typeof object.insertOrUpdate !== "object") + if (!$util.isObject(object.insertOrUpdate)) throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.insertOrUpdate: object expected"); message.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.insertOrUpdate, long + 1); } if (object.replace != null) { - if (typeof object.replace !== "object") + if (!$util.isObject(object.replace)) throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.replace: object expected"); message.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.fromObject(object.replace, long + 1); } if (object.deleteKeys != null) { - if (typeof object.deleteKeys !== "object") + if (!$util.isObject(object.deleteKeys)) throw TypeError(".google.spanner.executor.v1.MutationAction.Mod.deleteKeys: object expected"); message.deleteKeys = $root.google.spanner.executor.v1.KeySet.fromObject(object.deleteKeys, long + 1); } @@ -57659,9 +59373,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Mod.toObject = function toObject(message, options) { + Mod.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.table = ""; @@ -57671,18 +59389,18 @@ object.replace = null; object.deleteKeys = null; } - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; - if (message.insert != null && message.hasOwnProperty("insert")) - object.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insert, options); - if (message.update != null && message.hasOwnProperty("update")) - object.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.toObject(message.update, options); - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) - object.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insertOrUpdate, options); - if (message.replace != null && message.hasOwnProperty("replace")) - object.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.replace, options); - if (message.deleteKeys != null && message.hasOwnProperty("deleteKeys")) - object.deleteKeys = $root.google.spanner.executor.v1.KeySet.toObject(message.deleteKeys, options); + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) + object.insert = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insert, options, q + 1); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + object.update = $root.google.spanner.executor.v1.MutationAction.UpdateArgs.toObject(message.update, options, q + 1); + if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) + object.insertOrUpdate = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.insertOrUpdate, options, q + 1); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + object.replace = $root.google.spanner.executor.v1.MutationAction.InsertArgs.toObject(message.replace, options, q + 1); + if (message.deleteKeys != null && Object.hasOwnProperty.call(message, "deleteKeys")) + object.deleteKeys = $root.google.spanner.executor.v1.KeySet.toObject(message.deleteKeys, options, q + 1); return object; }; @@ -57771,11 +59489,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteMutationsAction.encode = function encode(message, writer) { + WriteMutationsAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) - $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.MutationAction.encode(message.mutation, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -57789,7 +59511,7 @@ * @returns {$protobuf.Writer} Writer */ WriteMutationsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -57859,7 +59581,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.mutation != null && message.hasOwnProperty("mutation")) { + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) { var error = $root.google.spanner.executor.v1.MutationAction.verify(message.mutation, long + 1); if (error) return "mutation." + error; @@ -57878,13 +59600,15 @@ WriteMutationsAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.WriteMutationsAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.WriteMutationsAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.WriteMutationsAction(); if (object.mutation != null) { - if (typeof object.mutation !== "object") + if (!$util.isObject(object.mutation)) throw TypeError(".google.spanner.executor.v1.WriteMutationsAction.mutation: object expected"); message.mutation = $root.google.spanner.executor.v1.MutationAction.fromObject(object.mutation, long + 1); } @@ -57900,14 +59624,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteMutationsAction.toObject = function toObject(message, options) { + WriteMutationsAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.mutation = null; - if (message.mutation != null && message.hasOwnProperty("mutation")) - object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options); + if (message.mutation != null && Object.hasOwnProperty.call(message, "mutation")) + object.mutation = $root.google.spanner.executor.v1.MutationAction.toObject(message.mutation, options, q + 1); return object; }; @@ -58011,13 +59739,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionedUpdateAction.encode = function encode(message, writer) { + PartitionedUpdateAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.encode(message.options, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.encode(message.options, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryAction.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -58031,7 +59763,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionedUpdateAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -58106,7 +59838,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { properties._options = 1; { var error = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.verify(message.options, long + 1); @@ -58114,7 +59846,7 @@ return "options." + error; } } - if (message.update != null && message.hasOwnProperty("update")) { + if (message.update != null && Object.hasOwnProperty.call(message, "update")) { var error = $root.google.spanner.executor.v1.QueryAction.verify(message.update, long + 1); if (error) return "update." + error; @@ -58133,18 +59865,20 @@ PartitionedUpdateAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.PartitionedUpdateAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.PartitionedUpdateAction(); if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction.options: object expected"); message.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.fromObject(object.options, long + 1); } if (object.update != null) { - if (typeof object.update !== "object") + if (!$util.isObject(object.update)) throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction.update: object expected"); message.update = $root.google.spanner.executor.v1.QueryAction.fromObject(object.update, long + 1); } @@ -58160,19 +59894,23 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionedUpdateAction.toObject = function toObject(message, options) { + PartitionedUpdateAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.update = null; - if (message.options != null && message.hasOwnProperty("options")) { - object.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { + object.options = $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions.toObject(message.options, options, q + 1); if (options.oneofs) object._options = "options"; } - if (message.update != null && message.hasOwnProperty("update")) - object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + object.update = $root.google.spanner.executor.v1.QueryAction.toObject(message.update, options, q + 1); return object; }; @@ -58279,9 +60017,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecutePartitionedUpdateOptions.encode = function encode(message, writer) { + ExecutePartitionedUpdateOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rpcPriority != null && Object.hasOwnProperty.call(message, "rpcPriority")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rpcPriority); if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) @@ -58299,7 +60041,7 @@ * @returns {$protobuf.Writer} Writer */ ExecutePartitionedUpdateOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -58374,7 +60116,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.rpcPriority != null && message.hasOwnProperty("rpcPriority")) { + if (message.rpcPriority != null && Object.hasOwnProperty.call(message, "rpcPriority")) { properties._rpcPriority = 1; switch (message.rpcPriority) { default: @@ -58386,7 +60128,7 @@ break; } } - if (message.tag != null && message.hasOwnProperty("tag")) { + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) { properties._tag = 1; if (!$util.isString(message.tag)) return "tag: string expected"; @@ -58405,6 +60147,8 @@ ExecutePartitionedUpdateOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.PartitionedUpdateAction.ExecutePartitionedUpdateOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -58448,16 +60192,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecutePartitionedUpdateOptions.toObject = function toObject(message, options) { + ExecutePartitionedUpdateOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.rpcPriority != null && message.hasOwnProperty("rpcPriority")) { + if (message.rpcPriority != null && Object.hasOwnProperty.call(message, "rpcPriority")) { object.rpcPriority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.rpcPriority] === undefined ? message.rpcPriority : $root.google.spanner.v1.RequestOptions.Priority[message.rpcPriority] : message.rpcPriority; if (options.oneofs) object._rpcPriority = "rpcPriority"; } - if (message.tag != null && message.hasOwnProperty("tag")) { + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) { object.tag = message.tag; if (options.oneofs) object._tag = "tag"; @@ -58593,18 +60341,22 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StartTransactionAction.encode = function encode(message, writer) { + StartTransactionAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.concurrency != null && Object.hasOwnProperty.call(message, "concurrency")) - $root.google.spanner.executor.v1.Concurrency.encode(message.concurrency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.Concurrency.encode(message.concurrency, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.table != null && message.table.length) for (var i = 0; i < message.table.length; ++i) - $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.transactionSeed != null && Object.hasOwnProperty.call(message, "transactionSeed")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionSeed); if (message.executionOptions != null && Object.hasOwnProperty.call(message, "executionOptions")) - $root.google.spanner.executor.v1.TransactionExecutionOptions.encode(message.executionOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.executor.v1.TransactionExecutionOptions.encode(message.executionOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -58618,7 +60370,7 @@ * @returns {$protobuf.Writer} Writer */ StartTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -58703,7 +60455,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.concurrency != null && message.hasOwnProperty("concurrency")) { + if (message.concurrency != null && Object.hasOwnProperty.call(message, "concurrency")) { properties._concurrency = 1; { var error = $root.google.spanner.executor.v1.Concurrency.verify(message.concurrency, long + 1); @@ -58711,7 +60463,7 @@ return "concurrency." + error; } } - if (message.table != null && message.hasOwnProperty("table")) { + if (message.table != null && Object.hasOwnProperty.call(message, "table")) { if (!Array.isArray(message.table)) return "table: array expected"; for (var i = 0; i < message.table.length; ++i) { @@ -58720,10 +60472,10 @@ return "table." + error; } } - if (message.transactionSeed != null && message.hasOwnProperty("transactionSeed")) + if (message.transactionSeed != null && Object.hasOwnProperty.call(message, "transactionSeed")) if (!$util.isString(message.transactionSeed)) return "transactionSeed: string expected"; - if (message.executionOptions != null && message.hasOwnProperty("executionOptions")) { + if (message.executionOptions != null && Object.hasOwnProperty.call(message, "executionOptions")) { properties._executionOptions = 1; { var error = $root.google.spanner.executor.v1.TransactionExecutionOptions.verify(message.executionOptions, long + 1); @@ -58745,13 +60497,15 @@ StartTransactionAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.StartTransactionAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.StartTransactionAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.StartTransactionAction(); if (object.concurrency != null) { - if (typeof object.concurrency !== "object") + if (!$util.isObject(object.concurrency)) throw TypeError(".google.spanner.executor.v1.StartTransactionAction.concurrency: object expected"); message.concurrency = $root.google.spanner.executor.v1.Concurrency.fromObject(object.concurrency, long + 1); } @@ -58760,7 +60514,7 @@ throw TypeError(".google.spanner.executor.v1.StartTransactionAction.table: array expected"); message.table = []; for (var i = 0; i < object.table.length; ++i) { - if (typeof object.table[i] !== "object") + if (!$util.isObject(object.table[i])) throw TypeError(".google.spanner.executor.v1.StartTransactionAction.table: object expected"); message.table[i] = $root.google.spanner.executor.v1.TableMetadata.fromObject(object.table[i], long + 1); } @@ -58768,7 +60522,7 @@ if (object.transactionSeed != null) message.transactionSeed = String(object.transactionSeed); if (object.executionOptions != null) { - if (typeof object.executionOptions !== "object") + if (!$util.isObject(object.executionOptions)) throw TypeError(".google.spanner.executor.v1.StartTransactionAction.executionOptions: object expected"); message.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.fromObject(object.executionOptions, long + 1); } @@ -58784,28 +60538,32 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StartTransactionAction.toObject = function toObject(message, options) { + StartTransactionAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.table = []; if (options.defaults) object.transactionSeed = ""; - if (message.concurrency != null && message.hasOwnProperty("concurrency")) { - object.concurrency = $root.google.spanner.executor.v1.Concurrency.toObject(message.concurrency, options); + if (message.concurrency != null && Object.hasOwnProperty.call(message, "concurrency")) { + object.concurrency = $root.google.spanner.executor.v1.Concurrency.toObject(message.concurrency, options, q + 1); if (options.oneofs) object._concurrency = "concurrency"; } if (message.table && message.table.length) { object.table = []; for (var j = 0; j < message.table.length; ++j) - object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options); + object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options, q + 1); } - if (message.transactionSeed != null && message.hasOwnProperty("transactionSeed")) + if (message.transactionSeed != null && Object.hasOwnProperty.call(message, "transactionSeed")) object.transactionSeed = message.transactionSeed; - if (message.executionOptions != null && message.hasOwnProperty("executionOptions")) { - object.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.toObject(message.executionOptions, options); + if (message.executionOptions != null && Object.hasOwnProperty.call(message, "executionOptions")) { + object.executionOptions = $root.google.spanner.executor.v1.TransactionExecutionOptions.toObject(message.executionOptions, options, q + 1); if (options.oneofs) object._executionOptions = "executionOptions"; } @@ -58980,9 +60738,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Concurrency.encode = function encode(message, writer) { + Concurrency.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.stalenessSeconds != null && Object.hasOwnProperty.call(message, "stalenessSeconds")) writer.uint32(/* id 1, wireType 1 =*/9).double(message.stalenessSeconds); if (message.minReadTimestampMicros != null && Object.hasOwnProperty.call(message, "minReadTimestampMicros")) @@ -59014,7 +60776,7 @@ * @returns {$protobuf.Writer} Writer */ Concurrency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -59117,53 +60879,53 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.stalenessSeconds != null && message.hasOwnProperty("stalenessSeconds")) { + if (message.stalenessSeconds != null && Object.hasOwnProperty.call(message, "stalenessSeconds")) { properties.concurrencyMode = 1; if (typeof message.stalenessSeconds !== "number") return "stalenessSeconds: number expected"; } - if (message.minReadTimestampMicros != null && message.hasOwnProperty("minReadTimestampMicros")) { + if (message.minReadTimestampMicros != null && Object.hasOwnProperty.call(message, "minReadTimestampMicros")) { if (properties.concurrencyMode === 1) return "concurrencyMode: multiple values"; properties.concurrencyMode = 1; if (!$util.isInteger(message.minReadTimestampMicros) && !(message.minReadTimestampMicros && $util.isInteger(message.minReadTimestampMicros.low) && $util.isInteger(message.minReadTimestampMicros.high))) return "minReadTimestampMicros: integer|Long expected"; } - if (message.maxStalenessSeconds != null && message.hasOwnProperty("maxStalenessSeconds")) { + if (message.maxStalenessSeconds != null && Object.hasOwnProperty.call(message, "maxStalenessSeconds")) { if (properties.concurrencyMode === 1) return "concurrencyMode: multiple values"; properties.concurrencyMode = 1; if (typeof message.maxStalenessSeconds !== "number") return "maxStalenessSeconds: number expected"; } - if (message.exactTimestampMicros != null && message.hasOwnProperty("exactTimestampMicros")) { + if (message.exactTimestampMicros != null && Object.hasOwnProperty.call(message, "exactTimestampMicros")) { if (properties.concurrencyMode === 1) return "concurrencyMode: multiple values"; properties.concurrencyMode = 1; if (!$util.isInteger(message.exactTimestampMicros) && !(message.exactTimestampMicros && $util.isInteger(message.exactTimestampMicros.low) && $util.isInteger(message.exactTimestampMicros.high))) return "exactTimestampMicros: integer|Long expected"; } - if (message.strong != null && message.hasOwnProperty("strong")) { + if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) { if (properties.concurrencyMode === 1) return "concurrencyMode: multiple values"; properties.concurrencyMode = 1; if (typeof message.strong !== "boolean") return "strong: boolean expected"; } - if (message.batch != null && message.hasOwnProperty("batch")) { + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) { if (properties.concurrencyMode === 1) return "concurrencyMode: multiple values"; properties.concurrencyMode = 1; if (typeof message.batch !== "boolean") return "batch: boolean expected"; } - if (message.snapshotEpochRead != null && message.hasOwnProperty("snapshotEpochRead")) + if (message.snapshotEpochRead != null && Object.hasOwnProperty.call(message, "snapshotEpochRead")) if (typeof message.snapshotEpochRead !== "boolean") return "snapshotEpochRead: boolean expected"; - if (message.snapshotEpochRootTable != null && message.hasOwnProperty("snapshotEpochRootTable")) + if (message.snapshotEpochRootTable != null && Object.hasOwnProperty.call(message, "snapshotEpochRootTable")) if (!$util.isString(message.snapshotEpochRootTable)) return "snapshotEpochRootTable: string expected"; - if (message.batchReadTimestampMicros != null && message.hasOwnProperty("batchReadTimestampMicros")) + if (message.batchReadTimestampMicros != null && Object.hasOwnProperty.call(message, "batchReadTimestampMicros")) if (!$util.isInteger(message.batchReadTimestampMicros) && !(message.batchReadTimestampMicros && $util.isInteger(message.batchReadTimestampMicros.low) && $util.isInteger(message.batchReadTimestampMicros.high))) return "batchReadTimestampMicros: integer|Long expected"; return null; @@ -59180,6 +60942,8 @@ Concurrency.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.Concurrency) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.Concurrency: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59189,7 +60953,7 @@ message.stalenessSeconds = Number(object.stalenessSeconds); if (object.minReadTimestampMicros != null) if ($util.Long) - (message.minReadTimestampMicros = $util.Long.fromValue(object.minReadTimestampMicros)).unsigned = false; + message.minReadTimestampMicros = $util.Long.fromValue(object.minReadTimestampMicros, false); else if (typeof object.minReadTimestampMicros === "string") message.minReadTimestampMicros = parseInt(object.minReadTimestampMicros, 10); else if (typeof object.minReadTimestampMicros === "number") @@ -59200,7 +60964,7 @@ message.maxStalenessSeconds = Number(object.maxStalenessSeconds); if (object.exactTimestampMicros != null) if ($util.Long) - (message.exactTimestampMicros = $util.Long.fromValue(object.exactTimestampMicros)).unsigned = false; + message.exactTimestampMicros = $util.Long.fromValue(object.exactTimestampMicros, false); else if (typeof object.exactTimestampMicros === "string") message.exactTimestampMicros = parseInt(object.exactTimestampMicros, 10); else if (typeof object.exactTimestampMicros === "number") @@ -59217,7 +60981,7 @@ message.snapshotEpochRootTable = String(object.snapshotEpochRootTable); if (object.batchReadTimestampMicros != null) if ($util.Long) - (message.batchReadTimestampMicros = $util.Long.fromValue(object.batchReadTimestampMicros)).unsigned = false; + message.batchReadTimestampMicros = $util.Long.fromValue(object.batchReadTimestampMicros, false); else if (typeof object.batchReadTimestampMicros === "string") message.batchReadTimestampMicros = parseInt(object.batchReadTimestampMicros, 10); else if (typeof object.batchReadTimestampMicros === "number") @@ -59236,61 +61000,71 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Concurrency.toObject = function toObject(message, options) { + Concurrency.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.snapshotEpochRead = false; object.snapshotEpochRootTable = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.batchReadTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.batchReadTimestampMicros = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.batchReadTimestampMicros = options.longs === String ? "0" : 0; + object.batchReadTimestampMicros = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; } - if (message.stalenessSeconds != null && message.hasOwnProperty("stalenessSeconds")) { + if (message.stalenessSeconds != null && Object.hasOwnProperty.call(message, "stalenessSeconds")) { object.stalenessSeconds = options.json && !isFinite(message.stalenessSeconds) ? String(message.stalenessSeconds) : message.stalenessSeconds; if (options.oneofs) object.concurrencyMode = "stalenessSeconds"; } - if (message.minReadTimestampMicros != null && message.hasOwnProperty("minReadTimestampMicros")) { - if (typeof message.minReadTimestampMicros === "number") + if (message.minReadTimestampMicros != null && Object.hasOwnProperty.call(message, "minReadTimestampMicros")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.minReadTimestampMicros = typeof message.minReadTimestampMicros === "number" ? BigInt(message.minReadTimestampMicros) : $util.Long.fromBits(message.minReadTimestampMicros.low >>> 0, message.minReadTimestampMicros.high >>> 0, false).toBigInt(); + else if (typeof message.minReadTimestampMicros === "number") object.minReadTimestampMicros = options.longs === String ? String(message.minReadTimestampMicros) : message.minReadTimestampMicros; else object.minReadTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.minReadTimestampMicros) : options.longs === Number ? new $util.LongBits(message.minReadTimestampMicros.low >>> 0, message.minReadTimestampMicros.high >>> 0).toNumber() : message.minReadTimestampMicros; if (options.oneofs) object.concurrencyMode = "minReadTimestampMicros"; } - if (message.maxStalenessSeconds != null && message.hasOwnProperty("maxStalenessSeconds")) { + if (message.maxStalenessSeconds != null && Object.hasOwnProperty.call(message, "maxStalenessSeconds")) { object.maxStalenessSeconds = options.json && !isFinite(message.maxStalenessSeconds) ? String(message.maxStalenessSeconds) : message.maxStalenessSeconds; if (options.oneofs) object.concurrencyMode = "maxStalenessSeconds"; } - if (message.exactTimestampMicros != null && message.hasOwnProperty("exactTimestampMicros")) { - if (typeof message.exactTimestampMicros === "number") + if (message.exactTimestampMicros != null && Object.hasOwnProperty.call(message, "exactTimestampMicros")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.exactTimestampMicros = typeof message.exactTimestampMicros === "number" ? BigInt(message.exactTimestampMicros) : $util.Long.fromBits(message.exactTimestampMicros.low >>> 0, message.exactTimestampMicros.high >>> 0, false).toBigInt(); + else if (typeof message.exactTimestampMicros === "number") object.exactTimestampMicros = options.longs === String ? String(message.exactTimestampMicros) : message.exactTimestampMicros; else object.exactTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.exactTimestampMicros) : options.longs === Number ? new $util.LongBits(message.exactTimestampMicros.low >>> 0, message.exactTimestampMicros.high >>> 0).toNumber() : message.exactTimestampMicros; if (options.oneofs) object.concurrencyMode = "exactTimestampMicros"; } - if (message.strong != null && message.hasOwnProperty("strong")) { + if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) { object.strong = message.strong; if (options.oneofs) object.concurrencyMode = "strong"; } - if (message.batch != null && message.hasOwnProperty("batch")) { + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) { object.batch = message.batch; if (options.oneofs) object.concurrencyMode = "batch"; } - if (message.snapshotEpochRead != null && message.hasOwnProperty("snapshotEpochRead")) + if (message.snapshotEpochRead != null && Object.hasOwnProperty.call(message, "snapshotEpochRead")) object.snapshotEpochRead = message.snapshotEpochRead; - if (message.snapshotEpochRootTable != null && message.hasOwnProperty("snapshotEpochRootTable")) + if (message.snapshotEpochRootTable != null && Object.hasOwnProperty.call(message, "snapshotEpochRootTable")) object.snapshotEpochRootTable = message.snapshotEpochRootTable; - if (message.batchReadTimestampMicros != null && message.hasOwnProperty("batchReadTimestampMicros")) - if (typeof message.batchReadTimestampMicros === "number") + if (message.batchReadTimestampMicros != null && Object.hasOwnProperty.call(message, "batchReadTimestampMicros")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.batchReadTimestampMicros = typeof message.batchReadTimestampMicros === "number" ? BigInt(message.batchReadTimestampMicros) : $util.Long.fromBits(message.batchReadTimestampMicros.low >>> 0, message.batchReadTimestampMicros.high >>> 0, false).toBigInt(); + else if (typeof message.batchReadTimestampMicros === "number") object.batchReadTimestampMicros = options.longs === String ? String(message.batchReadTimestampMicros) : message.batchReadTimestampMicros; else object.batchReadTimestampMicros = options.longs === String ? $util.Long.prototype.toString.call(message.batchReadTimestampMicros) : options.longs === Number ? new $util.LongBits(message.batchReadTimestampMicros.low >>> 0, message.batchReadTimestampMicros.high >>> 0).toNumber() : message.batchReadTimestampMicros; @@ -59399,17 +61173,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TableMetadata.encode = function encode(message, writer) { + TableMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.column != null && message.column.length) for (var i = 0; i < message.column.length; ++i) - $root.google.spanner.executor.v1.ColumnMetadata.encode(message.column[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.ColumnMetadata.encode(message.column[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.keyColumn != null && message.keyColumn.length) for (var i = 0; i < message.keyColumn.length; ++i) - $root.google.spanner.executor.v1.ColumnMetadata.encode(message.keyColumn[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.ColumnMetadata.encode(message.keyColumn[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -59423,7 +61201,7 @@ * @returns {$protobuf.Writer} Writer */ TableMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -59505,10 +61283,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.column != null && message.hasOwnProperty("column")) { + if (message.column != null && Object.hasOwnProperty.call(message, "column")) { if (!Array.isArray(message.column)) return "column: array expected"; for (var i = 0; i < message.column.length; ++i) { @@ -59517,7 +61295,7 @@ return "column." + error; } } - if (message.keyColumn != null && message.hasOwnProperty("keyColumn")) { + if (message.keyColumn != null && Object.hasOwnProperty.call(message, "keyColumn")) { if (!Array.isArray(message.keyColumn)) return "keyColumn: array expected"; for (var i = 0; i < message.keyColumn.length; ++i) { @@ -59540,6 +61318,8 @@ TableMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.TableMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.TableMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59552,7 +61332,7 @@ throw TypeError(".google.spanner.executor.v1.TableMetadata.column: array expected"); message.column = []; for (var i = 0; i < object.column.length; ++i) { - if (typeof object.column[i] !== "object") + if (!$util.isObject(object.column[i])) throw TypeError(".google.spanner.executor.v1.TableMetadata.column: object expected"); message.column[i] = $root.google.spanner.executor.v1.ColumnMetadata.fromObject(object.column[i], long + 1); } @@ -59562,7 +61342,7 @@ throw TypeError(".google.spanner.executor.v1.TableMetadata.keyColumn: array expected"); message.keyColumn = []; for (var i = 0; i < object.keyColumn.length; ++i) { - if (typeof object.keyColumn[i] !== "object") + if (!$util.isObject(object.keyColumn[i])) throw TypeError(".google.spanner.executor.v1.TableMetadata.keyColumn: object expected"); message.keyColumn[i] = $root.google.spanner.executor.v1.ColumnMetadata.fromObject(object.keyColumn[i], long + 1); } @@ -59579,9 +61359,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TableMetadata.toObject = function toObject(message, options) { + TableMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.column = []; @@ -59589,17 +61373,17 @@ } if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; if (message.column && message.column.length) { object.column = []; for (var j = 0; j < message.column.length; ++j) - object.column[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.column[j], options); + object.column[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.column[j], options, q + 1); } if (message.keyColumn && message.keyColumn.length) { object.keyColumn = []; for (var j = 0; j < message.keyColumn.length; ++j) - object.keyColumn[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.keyColumn[j], options); + object.keyColumn[j] = $root.google.spanner.executor.v1.ColumnMetadata.toObject(message.keyColumn[j], options, q + 1); } return object; }; @@ -59695,13 +61479,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ColumnMetadata.encode = function encode(message, writer) { + ColumnMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -59715,7 +61503,7 @@ * @returns {$protobuf.Writer} Writer */ ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -59789,10 +61577,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { var error = $root.google.spanner.v1.Type.verify(message.type, long + 1); if (error) return "type." + error; @@ -59811,6 +61599,8 @@ ColumnMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ColumnMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ColumnMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59819,7 +61609,7 @@ if (object.name != null) message.name = String(object.name); if (object.type != null) { - if (typeof object.type !== "object") + if (!$util.isObject(object.type)) throw TypeError(".google.spanner.executor.v1.ColumnMetadata.type: object expected"); message.type = $root.google.spanner.v1.Type.fromObject(object.type, long + 1); } @@ -59835,18 +61625,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ColumnMetadata.toObject = function toObject(message, options) { + ColumnMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.type = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options, q + 1); return object; }; @@ -59977,9 +61771,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransactionExecutionOptions.encode = function encode(message, writer) { + TransactionExecutionOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.optimistic != null && Object.hasOwnProperty.call(message, "optimistic")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.optimistic); if (message.excludeFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeFromChangeStreams")) @@ -60005,7 +61803,7 @@ * @returns {$protobuf.Writer} Writer */ TransactionExecutionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -60095,22 +61893,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.optimistic != null && message.hasOwnProperty("optimistic")) + if (message.optimistic != null && Object.hasOwnProperty.call(message, "optimistic")) if (typeof message.optimistic !== "boolean") return "optimistic: boolean expected"; - if (message.excludeFromChangeStreams != null && message.hasOwnProperty("excludeFromChangeStreams")) + if (message.excludeFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeFromChangeStreams")) if (typeof message.excludeFromChangeStreams !== "boolean") return "excludeFromChangeStreams: boolean expected"; - if (message.serializableOptimistic != null && message.hasOwnProperty("serializableOptimistic")) + if (message.serializableOptimistic != null && Object.hasOwnProperty.call(message, "serializableOptimistic")) if (typeof message.serializableOptimistic !== "boolean") return "serializableOptimistic: boolean expected"; - if (message.snapshotIsolationOptimistic != null && message.hasOwnProperty("snapshotIsolationOptimistic")) + if (message.snapshotIsolationOptimistic != null && Object.hasOwnProperty.call(message, "snapshotIsolationOptimistic")) if (typeof message.snapshotIsolationOptimistic !== "boolean") return "snapshotIsolationOptimistic: boolean expected"; - if (message.snapshotIsolationPessimistic != null && message.hasOwnProperty("snapshotIsolationPessimistic")) + if (message.snapshotIsolationPessimistic != null && Object.hasOwnProperty.call(message, "snapshotIsolationPessimistic")) if (typeof message.snapshotIsolationPessimistic !== "boolean") return "snapshotIsolationPessimistic: boolean expected"; - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) if (typeof message.excludeTxnFromChangeStreams !== "boolean") return "excludeTxnFromChangeStreams: boolean expected"; return null; @@ -60127,6 +61925,8 @@ TransactionExecutionOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.TransactionExecutionOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.TransactionExecutionOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60156,9 +61956,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransactionExecutionOptions.toObject = function toObject(message, options) { + TransactionExecutionOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.optimistic = false; @@ -60168,17 +61972,17 @@ object.snapshotIsolationPessimistic = false; object.excludeTxnFromChangeStreams = false; } - if (message.optimistic != null && message.hasOwnProperty("optimistic")) + if (message.optimistic != null && Object.hasOwnProperty.call(message, "optimistic")) object.optimistic = message.optimistic; - if (message.excludeFromChangeStreams != null && message.hasOwnProperty("excludeFromChangeStreams")) + if (message.excludeFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeFromChangeStreams")) object.excludeFromChangeStreams = message.excludeFromChangeStreams; - if (message.serializableOptimistic != null && message.hasOwnProperty("serializableOptimistic")) + if (message.serializableOptimistic != null && Object.hasOwnProperty.call(message, "serializableOptimistic")) object.serializableOptimistic = message.serializableOptimistic; - if (message.snapshotIsolationOptimistic != null && message.hasOwnProperty("snapshotIsolationOptimistic")) + if (message.snapshotIsolationOptimistic != null && Object.hasOwnProperty.call(message, "snapshotIsolationOptimistic")) object.snapshotIsolationOptimistic = message.snapshotIsolationOptimistic; - if (message.snapshotIsolationPessimistic != null && message.hasOwnProperty("snapshotIsolationPessimistic")) + if (message.snapshotIsolationPessimistic != null && Object.hasOwnProperty.call(message, "snapshotIsolationPessimistic")) object.snapshotIsolationPessimistic = message.snapshotIsolationPessimistic; - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; return object; }; @@ -60265,9 +62069,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FinishTransactionAction.encode = function encode(message, writer) { + FinishTransactionAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode); return writer; @@ -60283,7 +62091,7 @@ * @returns {$protobuf.Writer} Writer */ FinishTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -60353,7 +62161,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) switch (message.mode) { default: return "mode: enum value expected"; @@ -60376,6 +62184,8 @@ FinishTransactionAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.FinishTransactionAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.FinishTransactionAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60413,13 +62223,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FinishTransactionAction.toObject = function toObject(message, options) { + FinishTransactionAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - if (message.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) object.mode = options.enums === String ? $root.google.spanner.executor.v1.FinishTransactionAction.Mode[message.mode] === undefined ? message.mode : $root.google.spanner.executor.v1.FinishTransactionAction.Mode[message.mode] : message.mode; return object; }; @@ -60788,67 +62602,71 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdminAction.encode = function encode(message, writer) { + AdminAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.createUserInstanceConfig != null && Object.hasOwnProperty.call(message, "createUserInstanceConfig")) - $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.encode(message.createUserInstanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.encode(message.createUserInstanceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.updateUserInstanceConfig != null && Object.hasOwnProperty.call(message, "updateUserInstanceConfig")) - $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.encode(message.updateUserInstanceConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.encode(message.updateUserInstanceConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.deleteUserInstanceConfig != null && Object.hasOwnProperty.call(message, "deleteUserInstanceConfig")) - $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.encode(message.deleteUserInstanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.encode(message.deleteUserInstanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.getCloudInstanceConfig != null && Object.hasOwnProperty.call(message, "getCloudInstanceConfig")) - $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.encode(message.getCloudInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.encode(message.getCloudInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.listInstanceConfigs != null && Object.hasOwnProperty.call(message, "listInstanceConfigs")) - $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.encode(message.listInstanceConfigs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.encode(message.listInstanceConfigs, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.createCloudInstance != null && Object.hasOwnProperty.call(message, "createCloudInstance")) - $root.google.spanner.executor.v1.CreateCloudInstanceAction.encode(message.createCloudInstance, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.executor.v1.CreateCloudInstanceAction.encode(message.createCloudInstance, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.updateCloudInstance != null && Object.hasOwnProperty.call(message, "updateCloudInstance")) - $root.google.spanner.executor.v1.UpdateCloudInstanceAction.encode(message.updateCloudInstance, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.executor.v1.UpdateCloudInstanceAction.encode(message.updateCloudInstance, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.deleteCloudInstance != null && Object.hasOwnProperty.call(message, "deleteCloudInstance")) - $root.google.spanner.executor.v1.DeleteCloudInstanceAction.encode(message.deleteCloudInstance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.spanner.executor.v1.DeleteCloudInstanceAction.encode(message.deleteCloudInstance, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.listCloudInstances != null && Object.hasOwnProperty.call(message, "listCloudInstances")) - $root.google.spanner.executor.v1.ListCloudInstancesAction.encode(message.listCloudInstances, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.spanner.executor.v1.ListCloudInstancesAction.encode(message.listCloudInstances, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.getCloudInstance != null && Object.hasOwnProperty.call(message, "getCloudInstance")) - $root.google.spanner.executor.v1.GetCloudInstanceAction.encode(message.getCloudInstance, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.spanner.executor.v1.GetCloudInstanceAction.encode(message.getCloudInstance, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.createCloudDatabase != null && Object.hasOwnProperty.call(message, "createCloudDatabase")) - $root.google.spanner.executor.v1.CreateCloudDatabaseAction.encode(message.createCloudDatabase, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.spanner.executor.v1.CreateCloudDatabaseAction.encode(message.createCloudDatabase, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.updateCloudDatabaseDdl != null && Object.hasOwnProperty.call(message, "updateCloudDatabaseDdl")) - $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.encode(message.updateCloudDatabaseDdl, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.encode(message.updateCloudDatabaseDdl, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.dropCloudDatabase != null && Object.hasOwnProperty.call(message, "dropCloudDatabase")) - $root.google.spanner.executor.v1.DropCloudDatabaseAction.encode(message.dropCloudDatabase, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + $root.google.spanner.executor.v1.DropCloudDatabaseAction.encode(message.dropCloudDatabase, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); if (message.listCloudDatabases != null && Object.hasOwnProperty.call(message, "listCloudDatabases")) - $root.google.spanner.executor.v1.ListCloudDatabasesAction.encode(message.listCloudDatabases, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + $root.google.spanner.executor.v1.ListCloudDatabasesAction.encode(message.listCloudDatabases, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); if (message.listCloudDatabaseOperations != null && Object.hasOwnProperty.call(message, "listCloudDatabaseOperations")) - $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.encode(message.listCloudDatabaseOperations, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.encode(message.listCloudDatabaseOperations, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); if (message.restoreCloudDatabase != null && Object.hasOwnProperty.call(message, "restoreCloudDatabase")) - $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.encode(message.restoreCloudDatabase, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.encode(message.restoreCloudDatabase, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); if (message.getCloudDatabase != null && Object.hasOwnProperty.call(message, "getCloudDatabase")) - $root.google.spanner.executor.v1.GetCloudDatabaseAction.encode(message.getCloudDatabase, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.spanner.executor.v1.GetCloudDatabaseAction.encode(message.getCloudDatabase, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.createCloudBackup != null && Object.hasOwnProperty.call(message, "createCloudBackup")) - $root.google.spanner.executor.v1.CreateCloudBackupAction.encode(message.createCloudBackup, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.spanner.executor.v1.CreateCloudBackupAction.encode(message.createCloudBackup, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); if (message.copyCloudBackup != null && Object.hasOwnProperty.call(message, "copyCloudBackup")) - $root.google.spanner.executor.v1.CopyCloudBackupAction.encode(message.copyCloudBackup, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + $root.google.spanner.executor.v1.CopyCloudBackupAction.encode(message.copyCloudBackup, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); if (message.getCloudBackup != null && Object.hasOwnProperty.call(message, "getCloudBackup")) - $root.google.spanner.executor.v1.GetCloudBackupAction.encode(message.getCloudBackup, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + $root.google.spanner.executor.v1.GetCloudBackupAction.encode(message.getCloudBackup, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); if (message.updateCloudBackup != null && Object.hasOwnProperty.call(message, "updateCloudBackup")) - $root.google.spanner.executor.v1.UpdateCloudBackupAction.encode(message.updateCloudBackup, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + $root.google.spanner.executor.v1.UpdateCloudBackupAction.encode(message.updateCloudBackup, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).ldelim(); if (message.deleteCloudBackup != null && Object.hasOwnProperty.call(message, "deleteCloudBackup")) - $root.google.spanner.executor.v1.DeleteCloudBackupAction.encode(message.deleteCloudBackup, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + $root.google.spanner.executor.v1.DeleteCloudBackupAction.encode(message.deleteCloudBackup, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); if (message.listCloudBackups != null && Object.hasOwnProperty.call(message, "listCloudBackups")) - $root.google.spanner.executor.v1.ListCloudBackupsAction.encode(message.listCloudBackups, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + $root.google.spanner.executor.v1.ListCloudBackupsAction.encode(message.listCloudBackups, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim(); if (message.listCloudBackupOperations != null && Object.hasOwnProperty.call(message, "listCloudBackupOperations")) - $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.encode(message.listCloudBackupOperations, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.encode(message.listCloudBackupOperations, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); if (message.getOperation != null && Object.hasOwnProperty.call(message, "getOperation")) - $root.google.spanner.executor.v1.GetOperationAction.encode(message.getOperation, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + $root.google.spanner.executor.v1.GetOperationAction.encode(message.getOperation, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); if (message.cancelOperation != null && Object.hasOwnProperty.call(message, "cancelOperation")) - $root.google.spanner.executor.v1.CancelOperationAction.encode(message.cancelOperation, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + $root.google.spanner.executor.v1.CancelOperationAction.encode(message.cancelOperation, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); if (message.updateCloudDatabase != null && Object.hasOwnProperty.call(message, "updateCloudDatabase")) - $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.encode(message.updateCloudDatabase, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.encode(message.updateCloudDatabase, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.changeQuorumCloudDatabase != null && Object.hasOwnProperty.call(message, "changeQuorumCloudDatabase")) - $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.encode(message.changeQuorumCloudDatabase, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.encode(message.changeQuorumCloudDatabase, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); if (message.addSplitPoints != null && Object.hasOwnProperty.call(message, "addSplitPoints")) - $root.google.spanner.executor.v1.AddSplitPointsAction.encode(message.addSplitPoints, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + $root.google.spanner.executor.v1.AddSplitPointsAction.encode(message.addSplitPoints, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); return writer; }; @@ -60862,7 +62680,7 @@ * @returns {$protobuf.Writer} Writer */ AdminAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -61045,7 +62863,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.createUserInstanceConfig != null && message.hasOwnProperty("createUserInstanceConfig")) { + if (message.createUserInstanceConfig != null && Object.hasOwnProperty.call(message, "createUserInstanceConfig")) { properties.action = 1; { var error = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.verify(message.createUserInstanceConfig, long + 1); @@ -61053,7 +62871,7 @@ return "createUserInstanceConfig." + error; } } - if (message.updateUserInstanceConfig != null && message.hasOwnProperty("updateUserInstanceConfig")) { + if (message.updateUserInstanceConfig != null && Object.hasOwnProperty.call(message, "updateUserInstanceConfig")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61063,7 +62881,7 @@ return "updateUserInstanceConfig." + error; } } - if (message.deleteUserInstanceConfig != null && message.hasOwnProperty("deleteUserInstanceConfig")) { + if (message.deleteUserInstanceConfig != null && Object.hasOwnProperty.call(message, "deleteUserInstanceConfig")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61073,7 +62891,7 @@ return "deleteUserInstanceConfig." + error; } } - if (message.getCloudInstanceConfig != null && message.hasOwnProperty("getCloudInstanceConfig")) { + if (message.getCloudInstanceConfig != null && Object.hasOwnProperty.call(message, "getCloudInstanceConfig")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61083,7 +62901,7 @@ return "getCloudInstanceConfig." + error; } } - if (message.listInstanceConfigs != null && message.hasOwnProperty("listInstanceConfigs")) { + if (message.listInstanceConfigs != null && Object.hasOwnProperty.call(message, "listInstanceConfigs")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61093,7 +62911,7 @@ return "listInstanceConfigs." + error; } } - if (message.createCloudInstance != null && message.hasOwnProperty("createCloudInstance")) { + if (message.createCloudInstance != null && Object.hasOwnProperty.call(message, "createCloudInstance")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61103,7 +62921,7 @@ return "createCloudInstance." + error; } } - if (message.updateCloudInstance != null && message.hasOwnProperty("updateCloudInstance")) { + if (message.updateCloudInstance != null && Object.hasOwnProperty.call(message, "updateCloudInstance")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61113,7 +62931,7 @@ return "updateCloudInstance." + error; } } - if (message.deleteCloudInstance != null && message.hasOwnProperty("deleteCloudInstance")) { + if (message.deleteCloudInstance != null && Object.hasOwnProperty.call(message, "deleteCloudInstance")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61123,7 +62941,7 @@ return "deleteCloudInstance." + error; } } - if (message.listCloudInstances != null && message.hasOwnProperty("listCloudInstances")) { + if (message.listCloudInstances != null && Object.hasOwnProperty.call(message, "listCloudInstances")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61133,7 +62951,7 @@ return "listCloudInstances." + error; } } - if (message.getCloudInstance != null && message.hasOwnProperty("getCloudInstance")) { + if (message.getCloudInstance != null && Object.hasOwnProperty.call(message, "getCloudInstance")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61143,7 +62961,7 @@ return "getCloudInstance." + error; } } - if (message.createCloudDatabase != null && message.hasOwnProperty("createCloudDatabase")) { + if (message.createCloudDatabase != null && Object.hasOwnProperty.call(message, "createCloudDatabase")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61153,7 +62971,7 @@ return "createCloudDatabase." + error; } } - if (message.updateCloudDatabaseDdl != null && message.hasOwnProperty("updateCloudDatabaseDdl")) { + if (message.updateCloudDatabaseDdl != null && Object.hasOwnProperty.call(message, "updateCloudDatabaseDdl")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61163,7 +62981,7 @@ return "updateCloudDatabaseDdl." + error; } } - if (message.updateCloudDatabase != null && message.hasOwnProperty("updateCloudDatabase")) { + if (message.updateCloudDatabase != null && Object.hasOwnProperty.call(message, "updateCloudDatabase")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61173,7 +62991,7 @@ return "updateCloudDatabase." + error; } } - if (message.dropCloudDatabase != null && message.hasOwnProperty("dropCloudDatabase")) { + if (message.dropCloudDatabase != null && Object.hasOwnProperty.call(message, "dropCloudDatabase")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61183,7 +63001,7 @@ return "dropCloudDatabase." + error; } } - if (message.listCloudDatabases != null && message.hasOwnProperty("listCloudDatabases")) { + if (message.listCloudDatabases != null && Object.hasOwnProperty.call(message, "listCloudDatabases")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61193,7 +63011,7 @@ return "listCloudDatabases." + error; } } - if (message.listCloudDatabaseOperations != null && message.hasOwnProperty("listCloudDatabaseOperations")) { + if (message.listCloudDatabaseOperations != null && Object.hasOwnProperty.call(message, "listCloudDatabaseOperations")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61203,7 +63021,7 @@ return "listCloudDatabaseOperations." + error; } } - if (message.restoreCloudDatabase != null && message.hasOwnProperty("restoreCloudDatabase")) { + if (message.restoreCloudDatabase != null && Object.hasOwnProperty.call(message, "restoreCloudDatabase")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61213,7 +63031,7 @@ return "restoreCloudDatabase." + error; } } - if (message.getCloudDatabase != null && message.hasOwnProperty("getCloudDatabase")) { + if (message.getCloudDatabase != null && Object.hasOwnProperty.call(message, "getCloudDatabase")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61223,7 +63041,7 @@ return "getCloudDatabase." + error; } } - if (message.createCloudBackup != null && message.hasOwnProperty("createCloudBackup")) { + if (message.createCloudBackup != null && Object.hasOwnProperty.call(message, "createCloudBackup")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61233,7 +63051,7 @@ return "createCloudBackup." + error; } } - if (message.copyCloudBackup != null && message.hasOwnProperty("copyCloudBackup")) { + if (message.copyCloudBackup != null && Object.hasOwnProperty.call(message, "copyCloudBackup")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61243,7 +63061,7 @@ return "copyCloudBackup." + error; } } - if (message.getCloudBackup != null && message.hasOwnProperty("getCloudBackup")) { + if (message.getCloudBackup != null && Object.hasOwnProperty.call(message, "getCloudBackup")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61253,7 +63071,7 @@ return "getCloudBackup." + error; } } - if (message.updateCloudBackup != null && message.hasOwnProperty("updateCloudBackup")) { + if (message.updateCloudBackup != null && Object.hasOwnProperty.call(message, "updateCloudBackup")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61263,7 +63081,7 @@ return "updateCloudBackup." + error; } } - if (message.deleteCloudBackup != null && message.hasOwnProperty("deleteCloudBackup")) { + if (message.deleteCloudBackup != null && Object.hasOwnProperty.call(message, "deleteCloudBackup")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61273,7 +63091,7 @@ return "deleteCloudBackup." + error; } } - if (message.listCloudBackups != null && message.hasOwnProperty("listCloudBackups")) { + if (message.listCloudBackups != null && Object.hasOwnProperty.call(message, "listCloudBackups")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61283,7 +63101,7 @@ return "listCloudBackups." + error; } } - if (message.listCloudBackupOperations != null && message.hasOwnProperty("listCloudBackupOperations")) { + if (message.listCloudBackupOperations != null && Object.hasOwnProperty.call(message, "listCloudBackupOperations")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61293,7 +63111,7 @@ return "listCloudBackupOperations." + error; } } - if (message.getOperation != null && message.hasOwnProperty("getOperation")) { + if (message.getOperation != null && Object.hasOwnProperty.call(message, "getOperation")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61303,7 +63121,7 @@ return "getOperation." + error; } } - if (message.cancelOperation != null && message.hasOwnProperty("cancelOperation")) { + if (message.cancelOperation != null && Object.hasOwnProperty.call(message, "cancelOperation")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61313,7 +63131,7 @@ return "cancelOperation." + error; } } - if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { + if (message.changeQuorumCloudDatabase != null && Object.hasOwnProperty.call(message, "changeQuorumCloudDatabase")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61323,7 +63141,7 @@ return "changeQuorumCloudDatabase." + error; } } - if (message.addSplitPoints != null && message.hasOwnProperty("addSplitPoints")) { + if (message.addSplitPoints != null && Object.hasOwnProperty.call(message, "addSplitPoints")) { if (properties.action === 1) return "action: multiple values"; properties.action = 1; @@ -61347,153 +63165,155 @@ AdminAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.AdminAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.AdminAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.AdminAction(); if (object.createUserInstanceConfig != null) { - if (typeof object.createUserInstanceConfig !== "object") + if (!$util.isObject(object.createUserInstanceConfig)) throw TypeError(".google.spanner.executor.v1.AdminAction.createUserInstanceConfig: object expected"); message.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.fromObject(object.createUserInstanceConfig, long + 1); } if (object.updateUserInstanceConfig != null) { - if (typeof object.updateUserInstanceConfig !== "object") + if (!$util.isObject(object.updateUserInstanceConfig)) throw TypeError(".google.spanner.executor.v1.AdminAction.updateUserInstanceConfig: object expected"); message.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.fromObject(object.updateUserInstanceConfig, long + 1); } if (object.deleteUserInstanceConfig != null) { - if (typeof object.deleteUserInstanceConfig !== "object") + if (!$util.isObject(object.deleteUserInstanceConfig)) throw TypeError(".google.spanner.executor.v1.AdminAction.deleteUserInstanceConfig: object expected"); message.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.fromObject(object.deleteUserInstanceConfig, long + 1); } if (object.getCloudInstanceConfig != null) { - if (typeof object.getCloudInstanceConfig !== "object") + if (!$util.isObject(object.getCloudInstanceConfig)) throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudInstanceConfig: object expected"); message.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.fromObject(object.getCloudInstanceConfig, long + 1); } if (object.listInstanceConfigs != null) { - if (typeof object.listInstanceConfigs !== "object") + if (!$util.isObject(object.listInstanceConfigs)) throw TypeError(".google.spanner.executor.v1.AdminAction.listInstanceConfigs: object expected"); message.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.fromObject(object.listInstanceConfigs, long + 1); } if (object.createCloudInstance != null) { - if (typeof object.createCloudInstance !== "object") + if (!$util.isObject(object.createCloudInstance)) throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudInstance: object expected"); message.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.fromObject(object.createCloudInstance, long + 1); } if (object.updateCloudInstance != null) { - if (typeof object.updateCloudInstance !== "object") + if (!$util.isObject(object.updateCloudInstance)) throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudInstance: object expected"); message.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.fromObject(object.updateCloudInstance, long + 1); } if (object.deleteCloudInstance != null) { - if (typeof object.deleteCloudInstance !== "object") + if (!$util.isObject(object.deleteCloudInstance)) throw TypeError(".google.spanner.executor.v1.AdminAction.deleteCloudInstance: object expected"); message.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.fromObject(object.deleteCloudInstance, long + 1); } if (object.listCloudInstances != null) { - if (typeof object.listCloudInstances !== "object") + if (!$util.isObject(object.listCloudInstances)) throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudInstances: object expected"); message.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.fromObject(object.listCloudInstances, long + 1); } if (object.getCloudInstance != null) { - if (typeof object.getCloudInstance !== "object") + if (!$util.isObject(object.getCloudInstance)) throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudInstance: object expected"); message.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.fromObject(object.getCloudInstance, long + 1); } if (object.createCloudDatabase != null) { - if (typeof object.createCloudDatabase !== "object") + if (!$util.isObject(object.createCloudDatabase)) throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudDatabase: object expected"); message.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.fromObject(object.createCloudDatabase, long + 1); } if (object.updateCloudDatabaseDdl != null) { - if (typeof object.updateCloudDatabaseDdl !== "object") + if (!$util.isObject(object.updateCloudDatabaseDdl)) throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudDatabaseDdl: object expected"); message.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.fromObject(object.updateCloudDatabaseDdl, long + 1); } if (object.updateCloudDatabase != null) { - if (typeof object.updateCloudDatabase !== "object") + if (!$util.isObject(object.updateCloudDatabase)) throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudDatabase: object expected"); message.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.fromObject(object.updateCloudDatabase, long + 1); } if (object.dropCloudDatabase != null) { - if (typeof object.dropCloudDatabase !== "object") + if (!$util.isObject(object.dropCloudDatabase)) throw TypeError(".google.spanner.executor.v1.AdminAction.dropCloudDatabase: object expected"); message.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.fromObject(object.dropCloudDatabase, long + 1); } if (object.listCloudDatabases != null) { - if (typeof object.listCloudDatabases !== "object") + if (!$util.isObject(object.listCloudDatabases)) throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudDatabases: object expected"); message.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.fromObject(object.listCloudDatabases, long + 1); } if (object.listCloudDatabaseOperations != null) { - if (typeof object.listCloudDatabaseOperations !== "object") + if (!$util.isObject(object.listCloudDatabaseOperations)) throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudDatabaseOperations: object expected"); message.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.fromObject(object.listCloudDatabaseOperations, long + 1); } if (object.restoreCloudDatabase != null) { - if (typeof object.restoreCloudDatabase !== "object") + if (!$util.isObject(object.restoreCloudDatabase)) throw TypeError(".google.spanner.executor.v1.AdminAction.restoreCloudDatabase: object expected"); message.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.fromObject(object.restoreCloudDatabase, long + 1); } if (object.getCloudDatabase != null) { - if (typeof object.getCloudDatabase !== "object") + if (!$util.isObject(object.getCloudDatabase)) throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudDatabase: object expected"); message.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.fromObject(object.getCloudDatabase, long + 1); } if (object.createCloudBackup != null) { - if (typeof object.createCloudBackup !== "object") + if (!$util.isObject(object.createCloudBackup)) throw TypeError(".google.spanner.executor.v1.AdminAction.createCloudBackup: object expected"); message.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.fromObject(object.createCloudBackup, long + 1); } if (object.copyCloudBackup != null) { - if (typeof object.copyCloudBackup !== "object") + if (!$util.isObject(object.copyCloudBackup)) throw TypeError(".google.spanner.executor.v1.AdminAction.copyCloudBackup: object expected"); message.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.fromObject(object.copyCloudBackup, long + 1); } if (object.getCloudBackup != null) { - if (typeof object.getCloudBackup !== "object") + if (!$util.isObject(object.getCloudBackup)) throw TypeError(".google.spanner.executor.v1.AdminAction.getCloudBackup: object expected"); message.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.fromObject(object.getCloudBackup, long + 1); } if (object.updateCloudBackup != null) { - if (typeof object.updateCloudBackup !== "object") + if (!$util.isObject(object.updateCloudBackup)) throw TypeError(".google.spanner.executor.v1.AdminAction.updateCloudBackup: object expected"); message.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.fromObject(object.updateCloudBackup, long + 1); } if (object.deleteCloudBackup != null) { - if (typeof object.deleteCloudBackup !== "object") + if (!$util.isObject(object.deleteCloudBackup)) throw TypeError(".google.spanner.executor.v1.AdminAction.deleteCloudBackup: object expected"); message.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.fromObject(object.deleteCloudBackup, long + 1); } if (object.listCloudBackups != null) { - if (typeof object.listCloudBackups !== "object") + if (!$util.isObject(object.listCloudBackups)) throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudBackups: object expected"); message.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.fromObject(object.listCloudBackups, long + 1); } if (object.listCloudBackupOperations != null) { - if (typeof object.listCloudBackupOperations !== "object") + if (!$util.isObject(object.listCloudBackupOperations)) throw TypeError(".google.spanner.executor.v1.AdminAction.listCloudBackupOperations: object expected"); message.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.fromObject(object.listCloudBackupOperations, long + 1); } if (object.getOperation != null) { - if (typeof object.getOperation !== "object") + if (!$util.isObject(object.getOperation)) throw TypeError(".google.spanner.executor.v1.AdminAction.getOperation: object expected"); message.getOperation = $root.google.spanner.executor.v1.GetOperationAction.fromObject(object.getOperation, long + 1); } if (object.cancelOperation != null) { - if (typeof object.cancelOperation !== "object") + if (!$util.isObject(object.cancelOperation)) throw TypeError(".google.spanner.executor.v1.AdminAction.cancelOperation: object expected"); message.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.fromObject(object.cancelOperation, long + 1); } if (object.changeQuorumCloudDatabase != null) { - if (typeof object.changeQuorumCloudDatabase !== "object") + if (!$util.isObject(object.changeQuorumCloudDatabase)) throw TypeError(".google.spanner.executor.v1.AdminAction.changeQuorumCloudDatabase: object expected"); message.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.fromObject(object.changeQuorumCloudDatabase, long + 1); } if (object.addSplitPoints != null) { - if (typeof object.addSplitPoints !== "object") + if (!$util.isObject(object.addSplitPoints)) throw TypeError(".google.spanner.executor.v1.AdminAction.addSplitPoints: object expected"); message.addSplitPoints = $root.google.spanner.executor.v1.AddSplitPointsAction.fromObject(object.addSplitPoints, long + 1); } @@ -61509,152 +63329,156 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdminAction.toObject = function toObject(message, options) { + AdminAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.createUserInstanceConfig != null && message.hasOwnProperty("createUserInstanceConfig")) { - object.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.toObject(message.createUserInstanceConfig, options); + if (message.createUserInstanceConfig != null && Object.hasOwnProperty.call(message, "createUserInstanceConfig")) { + object.createUserInstanceConfig = $root.google.spanner.executor.v1.CreateUserInstanceConfigAction.toObject(message.createUserInstanceConfig, options, q + 1); if (options.oneofs) object.action = "createUserInstanceConfig"; } - if (message.updateUserInstanceConfig != null && message.hasOwnProperty("updateUserInstanceConfig")) { - object.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.toObject(message.updateUserInstanceConfig, options); + if (message.updateUserInstanceConfig != null && Object.hasOwnProperty.call(message, "updateUserInstanceConfig")) { + object.updateUserInstanceConfig = $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction.toObject(message.updateUserInstanceConfig, options, q + 1); if (options.oneofs) object.action = "updateUserInstanceConfig"; } - if (message.deleteUserInstanceConfig != null && message.hasOwnProperty("deleteUserInstanceConfig")) { - object.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.toObject(message.deleteUserInstanceConfig, options); + if (message.deleteUserInstanceConfig != null && Object.hasOwnProperty.call(message, "deleteUserInstanceConfig")) { + object.deleteUserInstanceConfig = $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction.toObject(message.deleteUserInstanceConfig, options, q + 1); if (options.oneofs) object.action = "deleteUserInstanceConfig"; } - if (message.getCloudInstanceConfig != null && message.hasOwnProperty("getCloudInstanceConfig")) { - object.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.toObject(message.getCloudInstanceConfig, options); + if (message.getCloudInstanceConfig != null && Object.hasOwnProperty.call(message, "getCloudInstanceConfig")) { + object.getCloudInstanceConfig = $root.google.spanner.executor.v1.GetCloudInstanceConfigAction.toObject(message.getCloudInstanceConfig, options, q + 1); if (options.oneofs) object.action = "getCloudInstanceConfig"; } - if (message.listInstanceConfigs != null && message.hasOwnProperty("listInstanceConfigs")) { - object.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.toObject(message.listInstanceConfigs, options); + if (message.listInstanceConfigs != null && Object.hasOwnProperty.call(message, "listInstanceConfigs")) { + object.listInstanceConfigs = $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction.toObject(message.listInstanceConfigs, options, q + 1); if (options.oneofs) object.action = "listInstanceConfigs"; } - if (message.createCloudInstance != null && message.hasOwnProperty("createCloudInstance")) { - object.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.toObject(message.createCloudInstance, options); + if (message.createCloudInstance != null && Object.hasOwnProperty.call(message, "createCloudInstance")) { + object.createCloudInstance = $root.google.spanner.executor.v1.CreateCloudInstanceAction.toObject(message.createCloudInstance, options, q + 1); if (options.oneofs) object.action = "createCloudInstance"; } - if (message.updateCloudInstance != null && message.hasOwnProperty("updateCloudInstance")) { - object.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.toObject(message.updateCloudInstance, options); + if (message.updateCloudInstance != null && Object.hasOwnProperty.call(message, "updateCloudInstance")) { + object.updateCloudInstance = $root.google.spanner.executor.v1.UpdateCloudInstanceAction.toObject(message.updateCloudInstance, options, q + 1); if (options.oneofs) object.action = "updateCloudInstance"; } - if (message.deleteCloudInstance != null && message.hasOwnProperty("deleteCloudInstance")) { - object.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.toObject(message.deleteCloudInstance, options); + if (message.deleteCloudInstance != null && Object.hasOwnProperty.call(message, "deleteCloudInstance")) { + object.deleteCloudInstance = $root.google.spanner.executor.v1.DeleteCloudInstanceAction.toObject(message.deleteCloudInstance, options, q + 1); if (options.oneofs) object.action = "deleteCloudInstance"; } - if (message.listCloudInstances != null && message.hasOwnProperty("listCloudInstances")) { - object.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.toObject(message.listCloudInstances, options); + if (message.listCloudInstances != null && Object.hasOwnProperty.call(message, "listCloudInstances")) { + object.listCloudInstances = $root.google.spanner.executor.v1.ListCloudInstancesAction.toObject(message.listCloudInstances, options, q + 1); if (options.oneofs) object.action = "listCloudInstances"; } - if (message.getCloudInstance != null && message.hasOwnProperty("getCloudInstance")) { - object.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.toObject(message.getCloudInstance, options); + if (message.getCloudInstance != null && Object.hasOwnProperty.call(message, "getCloudInstance")) { + object.getCloudInstance = $root.google.spanner.executor.v1.GetCloudInstanceAction.toObject(message.getCloudInstance, options, q + 1); if (options.oneofs) object.action = "getCloudInstance"; } - if (message.createCloudDatabase != null && message.hasOwnProperty("createCloudDatabase")) { - object.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.toObject(message.createCloudDatabase, options); + if (message.createCloudDatabase != null && Object.hasOwnProperty.call(message, "createCloudDatabase")) { + object.createCloudDatabase = $root.google.spanner.executor.v1.CreateCloudDatabaseAction.toObject(message.createCloudDatabase, options, q + 1); if (options.oneofs) object.action = "createCloudDatabase"; } - if (message.updateCloudDatabaseDdl != null && message.hasOwnProperty("updateCloudDatabaseDdl")) { - object.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.toObject(message.updateCloudDatabaseDdl, options); + if (message.updateCloudDatabaseDdl != null && Object.hasOwnProperty.call(message, "updateCloudDatabaseDdl")) { + object.updateCloudDatabaseDdl = $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction.toObject(message.updateCloudDatabaseDdl, options, q + 1); if (options.oneofs) object.action = "updateCloudDatabaseDdl"; } - if (message.dropCloudDatabase != null && message.hasOwnProperty("dropCloudDatabase")) { - object.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.toObject(message.dropCloudDatabase, options); + if (message.dropCloudDatabase != null && Object.hasOwnProperty.call(message, "dropCloudDatabase")) { + object.dropCloudDatabase = $root.google.spanner.executor.v1.DropCloudDatabaseAction.toObject(message.dropCloudDatabase, options, q + 1); if (options.oneofs) object.action = "dropCloudDatabase"; } - if (message.listCloudDatabases != null && message.hasOwnProperty("listCloudDatabases")) { - object.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.toObject(message.listCloudDatabases, options); + if (message.listCloudDatabases != null && Object.hasOwnProperty.call(message, "listCloudDatabases")) { + object.listCloudDatabases = $root.google.spanner.executor.v1.ListCloudDatabasesAction.toObject(message.listCloudDatabases, options, q + 1); if (options.oneofs) object.action = "listCloudDatabases"; } - if (message.listCloudDatabaseOperations != null && message.hasOwnProperty("listCloudDatabaseOperations")) { - object.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.toObject(message.listCloudDatabaseOperations, options); + if (message.listCloudDatabaseOperations != null && Object.hasOwnProperty.call(message, "listCloudDatabaseOperations")) { + object.listCloudDatabaseOperations = $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction.toObject(message.listCloudDatabaseOperations, options, q + 1); if (options.oneofs) object.action = "listCloudDatabaseOperations"; } - if (message.restoreCloudDatabase != null && message.hasOwnProperty("restoreCloudDatabase")) { - object.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.toObject(message.restoreCloudDatabase, options); + if (message.restoreCloudDatabase != null && Object.hasOwnProperty.call(message, "restoreCloudDatabase")) { + object.restoreCloudDatabase = $root.google.spanner.executor.v1.RestoreCloudDatabaseAction.toObject(message.restoreCloudDatabase, options, q + 1); if (options.oneofs) object.action = "restoreCloudDatabase"; } - if (message.getCloudDatabase != null && message.hasOwnProperty("getCloudDatabase")) { - object.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.toObject(message.getCloudDatabase, options); + if (message.getCloudDatabase != null && Object.hasOwnProperty.call(message, "getCloudDatabase")) { + object.getCloudDatabase = $root.google.spanner.executor.v1.GetCloudDatabaseAction.toObject(message.getCloudDatabase, options, q + 1); if (options.oneofs) object.action = "getCloudDatabase"; } - if (message.createCloudBackup != null && message.hasOwnProperty("createCloudBackup")) { - object.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.toObject(message.createCloudBackup, options); + if (message.createCloudBackup != null && Object.hasOwnProperty.call(message, "createCloudBackup")) { + object.createCloudBackup = $root.google.spanner.executor.v1.CreateCloudBackupAction.toObject(message.createCloudBackup, options, q + 1); if (options.oneofs) object.action = "createCloudBackup"; } - if (message.copyCloudBackup != null && message.hasOwnProperty("copyCloudBackup")) { - object.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.toObject(message.copyCloudBackup, options); + if (message.copyCloudBackup != null && Object.hasOwnProperty.call(message, "copyCloudBackup")) { + object.copyCloudBackup = $root.google.spanner.executor.v1.CopyCloudBackupAction.toObject(message.copyCloudBackup, options, q + 1); if (options.oneofs) object.action = "copyCloudBackup"; } - if (message.getCloudBackup != null && message.hasOwnProperty("getCloudBackup")) { - object.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.toObject(message.getCloudBackup, options); + if (message.getCloudBackup != null && Object.hasOwnProperty.call(message, "getCloudBackup")) { + object.getCloudBackup = $root.google.spanner.executor.v1.GetCloudBackupAction.toObject(message.getCloudBackup, options, q + 1); if (options.oneofs) object.action = "getCloudBackup"; } - if (message.updateCloudBackup != null && message.hasOwnProperty("updateCloudBackup")) { - object.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.toObject(message.updateCloudBackup, options); + if (message.updateCloudBackup != null && Object.hasOwnProperty.call(message, "updateCloudBackup")) { + object.updateCloudBackup = $root.google.spanner.executor.v1.UpdateCloudBackupAction.toObject(message.updateCloudBackup, options, q + 1); if (options.oneofs) object.action = "updateCloudBackup"; } - if (message.deleteCloudBackup != null && message.hasOwnProperty("deleteCloudBackup")) { - object.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.toObject(message.deleteCloudBackup, options); + if (message.deleteCloudBackup != null && Object.hasOwnProperty.call(message, "deleteCloudBackup")) { + object.deleteCloudBackup = $root.google.spanner.executor.v1.DeleteCloudBackupAction.toObject(message.deleteCloudBackup, options, q + 1); if (options.oneofs) object.action = "deleteCloudBackup"; } - if (message.listCloudBackups != null && message.hasOwnProperty("listCloudBackups")) { - object.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.toObject(message.listCloudBackups, options); + if (message.listCloudBackups != null && Object.hasOwnProperty.call(message, "listCloudBackups")) { + object.listCloudBackups = $root.google.spanner.executor.v1.ListCloudBackupsAction.toObject(message.listCloudBackups, options, q + 1); if (options.oneofs) object.action = "listCloudBackups"; } - if (message.listCloudBackupOperations != null && message.hasOwnProperty("listCloudBackupOperations")) { - object.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.toObject(message.listCloudBackupOperations, options); + if (message.listCloudBackupOperations != null && Object.hasOwnProperty.call(message, "listCloudBackupOperations")) { + object.listCloudBackupOperations = $root.google.spanner.executor.v1.ListCloudBackupOperationsAction.toObject(message.listCloudBackupOperations, options, q + 1); if (options.oneofs) object.action = "listCloudBackupOperations"; } - if (message.getOperation != null && message.hasOwnProperty("getOperation")) { - object.getOperation = $root.google.spanner.executor.v1.GetOperationAction.toObject(message.getOperation, options); + if (message.getOperation != null && Object.hasOwnProperty.call(message, "getOperation")) { + object.getOperation = $root.google.spanner.executor.v1.GetOperationAction.toObject(message.getOperation, options, q + 1); if (options.oneofs) object.action = "getOperation"; } - if (message.cancelOperation != null && message.hasOwnProperty("cancelOperation")) { - object.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.toObject(message.cancelOperation, options); + if (message.cancelOperation != null && Object.hasOwnProperty.call(message, "cancelOperation")) { + object.cancelOperation = $root.google.spanner.executor.v1.CancelOperationAction.toObject(message.cancelOperation, options, q + 1); if (options.oneofs) object.action = "cancelOperation"; } - if (message.updateCloudDatabase != null && message.hasOwnProperty("updateCloudDatabase")) { - object.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.toObject(message.updateCloudDatabase, options); + if (message.updateCloudDatabase != null && Object.hasOwnProperty.call(message, "updateCloudDatabase")) { + object.updateCloudDatabase = $root.google.spanner.executor.v1.UpdateCloudDatabaseAction.toObject(message.updateCloudDatabase, options, q + 1); if (options.oneofs) object.action = "updateCloudDatabase"; } - if (message.changeQuorumCloudDatabase != null && message.hasOwnProperty("changeQuorumCloudDatabase")) { - object.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.toObject(message.changeQuorumCloudDatabase, options); + if (message.changeQuorumCloudDatabase != null && Object.hasOwnProperty.call(message, "changeQuorumCloudDatabase")) { + object.changeQuorumCloudDatabase = $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction.toObject(message.changeQuorumCloudDatabase, options, q + 1); if (options.oneofs) object.action = "changeQuorumCloudDatabase"; } - if (message.addSplitPoints != null && message.hasOwnProperty("addSplitPoints")) { - object.addSplitPoints = $root.google.spanner.executor.v1.AddSplitPointsAction.toObject(message.addSplitPoints, options); + if (message.addSplitPoints != null && Object.hasOwnProperty.call(message, "addSplitPoints")) { + object.addSplitPoints = $root.google.spanner.executor.v1.AddSplitPointsAction.toObject(message.addSplitPoints, options, q + 1); if (options.oneofs) object.action = "addSplitPoints"; } @@ -61771,9 +63595,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateUserInstanceConfigAction.encode = function encode(message, writer) { + CreateUserInstanceConfigAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -61782,7 +63610,7 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.baseConfigId); if (message.replicas != null && message.replicas.length) for (var i = 0; i < message.replicas.length; ++i) - $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.ReplicaInfo.encode(message.replicas[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -61796,7 +63624,7 @@ * @returns {$protobuf.Writer} Writer */ CreateUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -61880,16 +63708,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) if (!$util.isString(message.userConfigId)) return "userConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.baseConfigId != null && message.hasOwnProperty("baseConfigId")) + if (message.baseConfigId != null && Object.hasOwnProperty.call(message, "baseConfigId")) if (!$util.isString(message.baseConfigId)) return "baseConfigId: string expected"; - if (message.replicas != null && message.hasOwnProperty("replicas")) { + if (message.replicas != null && Object.hasOwnProperty.call(message, "replicas")) { if (!Array.isArray(message.replicas)) return "replicas: array expected"; for (var i = 0; i < message.replicas.length; ++i) { @@ -61912,6 +63740,8 @@ CreateUserInstanceConfigAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CreateUserInstanceConfigAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CreateUserInstanceConfigAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -61928,7 +63758,7 @@ throw TypeError(".google.spanner.executor.v1.CreateUserInstanceConfigAction.replicas: array expected"); message.replicas = []; for (var i = 0; i < object.replicas.length; ++i) { - if (typeof object.replicas[i] !== "object") + if (!$util.isObject(object.replicas[i])) throw TypeError(".google.spanner.executor.v1.CreateUserInstanceConfigAction.replicas: object expected"); message.replicas[i] = $root.google.spanner.admin.instance.v1.ReplicaInfo.fromObject(object.replicas[i], long + 1); } @@ -61945,9 +63775,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateUserInstanceConfigAction.toObject = function toObject(message, options) { + CreateUserInstanceConfigAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.replicas = []; @@ -61956,16 +63790,16 @@ object.projectId = ""; object.baseConfigId = ""; } - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) object.userConfigId = message.userConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.baseConfigId != null && message.hasOwnProperty("baseConfigId")) + if (message.baseConfigId != null && Object.hasOwnProperty.call(message, "baseConfigId")) object.baseConfigId = message.baseConfigId; if (message.replicas && message.replicas.length) { object.replicas = []; for (var j = 0; j < message.replicas.length; ++j) - object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options); + object.replicas[j] = $root.google.spanner.admin.instance.v1.ReplicaInfo.toObject(message.replicas[j], options, q + 1); } return object; }; @@ -62089,9 +63923,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateUserInstanceConfigAction.encode = function encode(message, writer) { + UpdateUserInstanceConfigAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -62114,7 +63952,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -62218,18 +64056,18 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) if (!$util.isString(message.userConfigId)) return "userConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) { properties._displayName = 1; if (!$util.isString(message.displayName)) return "displayName: string expected"; } - if (message.labels != null && message.hasOwnProperty("labels")) { + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); @@ -62251,6 +64089,8 @@ UpdateUserInstanceConfigAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.UpdateUserInstanceConfigAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.UpdateUserInstanceConfigAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -62263,7 +64103,7 @@ if (object.displayName != null) message.displayName = String(object.displayName); if (object.labels) { - if (typeof object.labels !== "object") + if (!$util.isObject(object.labels)) throw TypeError(".google.spanner.executor.v1.UpdateUserInstanceConfigAction.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { @@ -62284,9 +64124,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateUserInstanceConfigAction.toObject = function toObject(message, options) { + UpdateUserInstanceConfigAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.labels = {}; @@ -62294,11 +64138,11 @@ object.userConfigId = ""; object.projectId = ""; } - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) object.userConfigId = message.userConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) { object.displayName = message.displayName; if (options.oneofs) object._displayName = "displayName"; @@ -62406,9 +64250,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCloudInstanceConfigAction.encode = function encode(message, writer) { + GetCloudInstanceConfigAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceConfigId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -62426,7 +64274,7 @@ * @returns {$protobuf.Writer} Writer */ GetCloudInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -62500,10 +64348,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) if (!$util.isString(message.instanceConfigId)) return "instanceConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; return null; @@ -62520,6 +64368,8 @@ GetCloudInstanceConfigAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.GetCloudInstanceConfigAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.GetCloudInstanceConfigAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -62541,17 +64391,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetCloudInstanceConfigAction.toObject = function toObject(message, options) { + GetCloudInstanceConfigAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instanceConfigId = ""; object.projectId = ""; } - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) object.instanceConfigId = message.instanceConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; return object; }; @@ -62647,9 +64501,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteUserInstanceConfigAction.encode = function encode(message, writer) { + DeleteUserInstanceConfigAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.userConfigId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -62667,7 +64525,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteUserInstanceConfigAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -62741,10 +64599,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) if (!$util.isString(message.userConfigId)) return "userConfigId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; return null; @@ -62761,6 +64619,8 @@ DeleteUserInstanceConfigAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DeleteUserInstanceConfigAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DeleteUserInstanceConfigAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -62782,17 +64642,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteUserInstanceConfigAction.toObject = function toObject(message, options) { + DeleteUserInstanceConfigAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.userConfigId = ""; object.projectId = ""; } - if (message.userConfigId != null && message.hasOwnProperty("userConfigId")) + if (message.userConfigId != null && Object.hasOwnProperty.call(message, "userConfigId")) object.userConfigId = message.userConfigId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; return object; }; @@ -62912,9 +64776,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCloudInstanceConfigsAction.encode = function encode(message, writer) { + ListCloudInstanceConfigsAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -62934,7 +64802,7 @@ * @returns {$protobuf.Writer} Writer */ ListCloudInstanceConfigsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -63013,15 +64881,15 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) { properties._pageSize = 1; if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) { properties._pageToken = 1; if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -63040,6 +64908,8 @@ ListCloudInstanceConfigsAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ListCloudInstanceConfigsAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ListCloudInstanceConfigsAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -63063,20 +64933,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCloudInstanceConfigsAction.toObject = function toObject(message, options) { + ListCloudInstanceConfigsAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.projectId = ""; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) { object.pageSize = message.pageSize; if (options.oneofs) object._pageSize = "pageSize"; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) { object.pageToken = message.pageToken; if (options.oneofs) object._pageToken = "pageToken"; @@ -63251,9 +65125,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateCloudInstanceAction.encode = function encode(message, writer) { + CreateCloudInstanceAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -63268,7 +65146,7 @@ if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.processingUnits); if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.edition); return writer; @@ -63284,7 +65162,7 @@ * @returns {$protobuf.Writer} Writer */ CreateCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -63404,26 +65282,26 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) if (!$util.isString(message.instanceConfigId)) return "instanceConfigId: string expected"; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { properties._nodeCount = 1; if (!$util.isInteger(message.nodeCount)) return "nodeCount: integer expected"; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { properties._processingUnits = 1; if (!$util.isInteger(message.processingUnits)) return "processingUnits: integer expected"; } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) { properties._autoscalingConfig = 1; { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig, long + 1); @@ -63431,7 +65309,7 @@ return "autoscalingConfig." + error; } } - if (message.labels != null && message.hasOwnProperty("labels")) { + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); @@ -63439,7 +65317,7 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -63463,6 +65341,8 @@ CreateCloudInstanceAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CreateCloudInstanceAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CreateCloudInstanceAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -63479,12 +65359,12 @@ if (object.processingUnits != null) message.processingUnits = object.processingUnits | 0; if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") + if (!$util.isObject(object.autoscalingConfig)) throw TypeError(".google.spanner.executor.v1.CreateCloudInstanceAction.autoscalingConfig: object expected"); message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig, long + 1); } if (object.labels) { - if (typeof object.labels !== "object") + if (!$util.isObject(object.labels)) throw TypeError(".google.spanner.executor.v1.CreateCloudInstanceAction.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { @@ -63529,9 +65409,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateCloudInstanceAction.toObject = function toObject(message, options) { + CreateCloudInstanceAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.labels = {}; @@ -63541,13 +65425,13 @@ object.instanceConfigId = ""; object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceConfigId != null && message.hasOwnProperty("instanceConfigId")) + if (message.instanceConfigId != null && Object.hasOwnProperty.call(message, "instanceConfigId")) object.instanceConfigId = message.instanceConfigId; - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { object.nodeCount = message.nodeCount; if (options.oneofs) object._nodeCount = "nodeCount"; @@ -63561,17 +65445,17 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { object.processingUnits = message.processingUnits; if (options.oneofs) object._processingUnits = "processingUnits"; } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) { + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options, q + 1); if (options.oneofs) object._autoscalingConfig = "autoscalingConfig"; } - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) object.edition = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] === undefined ? message.edition : $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] : message.edition; return object; }; @@ -63749,9 +65633,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCloudInstanceAction.encode = function encode(message, writer) { + UpdateCloudInstanceAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -63766,7 +65654,7 @@ for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.edition); return writer; @@ -63782,7 +65670,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -63902,28 +65790,28 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) { properties._displayName = 1; if (!$util.isString(message.displayName)) return "displayName: string expected"; } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { properties._nodeCount = 1; if (!$util.isInteger(message.nodeCount)) return "nodeCount: integer expected"; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { properties._processingUnits = 1; if (!$util.isInteger(message.processingUnits)) return "processingUnits: integer expected"; } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) { properties._autoscalingConfig = 1; { var error = $root.google.spanner.admin.instance.v1.AutoscalingConfig.verify(message.autoscalingConfig, long + 1); @@ -63931,7 +65819,7 @@ return "autoscalingConfig." + error; } } - if (message.labels != null && message.hasOwnProperty("labels")) { + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); @@ -63939,7 +65827,7 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) switch (message.edition) { default: return "edition: enum value expected"; @@ -63963,6 +65851,8 @@ UpdateCloudInstanceAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.UpdateCloudInstanceAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.UpdateCloudInstanceAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -63979,12 +65869,12 @@ if (object.processingUnits != null) message.processingUnits = object.processingUnits | 0; if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") + if (!$util.isObject(object.autoscalingConfig)) throw TypeError(".google.spanner.executor.v1.UpdateCloudInstanceAction.autoscalingConfig: object expected"); message.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.fromObject(object.autoscalingConfig, long + 1); } if (object.labels) { - if (typeof object.labels !== "object") + if (!$util.isObject(object.labels)) throw TypeError(".google.spanner.executor.v1.UpdateCloudInstanceAction.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { @@ -64029,9 +65919,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCloudInstanceAction.toObject = function toObject(message, options) { + UpdateCloudInstanceAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.labels = {}; @@ -64040,21 +65934,21 @@ object.projectId = ""; object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.displayName != null && message.hasOwnProperty("displayName")) { + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) { object.displayName = message.displayName; if (options.oneofs) object._displayName = "displayName"; } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) { + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) { object.nodeCount = message.nodeCount; if (options.oneofs) object._nodeCount = "nodeCount"; } - if (message.processingUnits != null && message.hasOwnProperty("processingUnits")) { + if (message.processingUnits != null && Object.hasOwnProperty.call(message, "processingUnits")) { object.processingUnits = message.processingUnits; if (options.oneofs) object._processingUnits = "processingUnits"; @@ -64068,12 +65962,12 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) { + object.autoscalingConfig = $root.google.spanner.admin.instance.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options, q + 1); if (options.oneofs) object._autoscalingConfig = "autoscalingConfig"; } - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) object.edition = options.enums === String ? $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] === undefined ? message.edition : $root.google.spanner.admin.instance.v1.Instance.Edition[message.edition] : message.edition; return object; }; @@ -64169,9 +66063,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteCloudInstanceAction.encode = function encode(message, writer) { + DeleteCloudInstanceAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -64189,7 +66087,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -64263,10 +66161,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; return null; @@ -64283,6 +66181,8 @@ DeleteCloudInstanceAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DeleteCloudInstanceAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DeleteCloudInstanceAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64304,17 +66204,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteCloudInstanceAction.toObject = function toObject(message, options) { + DeleteCloudInstanceAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instanceId = ""; object.projectId = ""; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; return object; }; @@ -64471,9 +66375,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateCloudDatabaseAction.encode = function encode(message, writer) { + CreateCloudDatabaseAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -64484,7 +66392,7 @@ for (var i = 0; i < message.sdlStatement.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sdlStatement[i]); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.dialect); if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) @@ -64502,7 +66410,7 @@ * @returns {$protobuf.Writer} Writer */ CreateCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -64599,33 +66507,33 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; - if (message.sdlStatement != null && message.hasOwnProperty("sdlStatement")) { + if (message.sdlStatement != null && Object.hasOwnProperty.call(message, "sdlStatement")) { if (!Array.isArray(message.sdlStatement)) return "sdlStatement: array expected"; for (var i = 0; i < message.sdlStatement.length; ++i) if (!$util.isString(message.sdlStatement[i])) return "sdlStatement: string[] expected"; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; } - if (message.dialect != null && message.hasOwnProperty("dialect")) { + if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) { properties._dialect = 1; if (!$util.isString(message.dialect)) return "dialect: string expected"; } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) { properties._protoDescriptors = 1; if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) return "protoDescriptors: buffer expected"; @@ -64644,6 +66552,8 @@ CreateCloudDatabaseAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CreateCloudDatabaseAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CreateCloudDatabaseAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64663,7 +66573,7 @@ message.sdlStatement[i] = String(object.sdlStatement[i]); } if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.executor.v1.CreateCloudDatabaseAction.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -64686,9 +66596,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateCloudDatabaseAction.toObject = function toObject(message, options) { + CreateCloudDatabaseAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.sdlStatement = []; @@ -64698,25 +66612,25 @@ object.databaseId = ""; object.encryptionConfig = null; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; if (message.sdlStatement && message.sdlStatement.length) { object.sdlStatement = []; for (var j = 0; j < message.sdlStatement.length; ++j) object.sdlStatement[j] = message.sdlStatement[j]; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.dialect != null && message.hasOwnProperty("dialect")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options, q + 1); + if (message.dialect != null && Object.hasOwnProperty.call(message, "dialect")) { object.dialect = message.dialect; if (options.oneofs) object._dialect = "dialect"; } - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) { object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; if (options.oneofs) object._protoDescriptors = "protoDescriptors"; @@ -64861,9 +66775,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCloudDatabaseDdlAction.encode = function encode(message, writer) { + UpdateCloudDatabaseDdlAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -64890,7 +66808,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateCloudDatabaseDdlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -64983,26 +66901,26 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; - if (message.sdlStatement != null && message.hasOwnProperty("sdlStatement")) { + if (message.sdlStatement != null && Object.hasOwnProperty.call(message, "sdlStatement")) { if (!Array.isArray(message.sdlStatement)) return "sdlStatement: array expected"; for (var i = 0; i < message.sdlStatement.length; ++i) if (!$util.isString(message.sdlStatement[i])) return "sdlStatement: string[] expected"; } - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) if (!$util.isString(message.operationId)) return "operationId: string expected"; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) { properties._protoDescriptors = 1; if (!(message.protoDescriptors && typeof message.protoDescriptors.length === "number" || $util.isString(message.protoDescriptors))) return "protoDescriptors: buffer expected"; @@ -65021,6 +66939,8 @@ UpdateCloudDatabaseDdlAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.UpdateCloudDatabaseDdlAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.UpdateCloudDatabaseDdlAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65058,9 +66978,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCloudDatabaseDdlAction.toObject = function toObject(message, options) { + UpdateCloudDatabaseDdlAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.sdlStatement = []; @@ -65070,20 +66994,20 @@ object.databaseId = ""; object.operationId = ""; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; if (message.sdlStatement && message.sdlStatement.length) { object.sdlStatement = []; for (var j = 0; j < message.sdlStatement.length; ++j) object.sdlStatement[j] = message.sdlStatement[j]; } - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) object.operationId = message.operationId; - if (message.protoDescriptors != null && message.hasOwnProperty("protoDescriptors")) { + if (message.protoDescriptors != null && Object.hasOwnProperty.call(message, "protoDescriptors")) { object.protoDescriptors = options.bytes === String ? $util.base64.encode(message.protoDescriptors, 0, message.protoDescriptors.length) : options.bytes === Array ? Array.prototype.slice.call(message.protoDescriptors) : message.protoDescriptors; if (options.oneofs) object._protoDescriptors = "protoDescriptors"; @@ -65200,9 +67124,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCloudDatabaseAction.encode = function encode(message, writer) { + UpdateCloudDatabaseAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -65224,7 +67152,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -65306,16 +67234,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.databaseName != null && message.hasOwnProperty("databaseName")) + if (message.databaseName != null && Object.hasOwnProperty.call(message, "databaseName")) if (!$util.isString(message.databaseName)) return "databaseName: string expected"; - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) if (typeof message.enableDropProtection !== "boolean") return "enableDropProtection: boolean expected"; return null; @@ -65332,6 +67260,8 @@ UpdateCloudDatabaseAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.UpdateCloudDatabaseAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.UpdateCloudDatabaseAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65357,9 +67287,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCloudDatabaseAction.toObject = function toObject(message, options) { + UpdateCloudDatabaseAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instanceId = ""; @@ -65367,13 +67301,13 @@ object.databaseName = ""; object.enableDropProtection = false; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.databaseName != null && message.hasOwnProperty("databaseName")) + if (message.databaseName != null && Object.hasOwnProperty.call(message, "databaseName")) object.databaseName = message.databaseName; - if (message.enableDropProtection != null && message.hasOwnProperty("enableDropProtection")) + if (message.enableDropProtection != null && Object.hasOwnProperty.call(message, "enableDropProtection")) object.enableDropProtection = message.enableDropProtection; return object; }; @@ -65478,9 +67412,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DropCloudDatabaseAction.encode = function encode(message, writer) { + DropCloudDatabaseAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceId); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) @@ -65500,7 +67438,7 @@ * @returns {$protobuf.Writer} Writer */ DropCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -65578,13 +67516,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; return null; @@ -65601,6 +67539,8 @@ DropCloudDatabaseAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DropCloudDatabaseAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DropCloudDatabaseAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65624,20 +67564,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DropCloudDatabaseAction.toObject = function toObject(message, options) { + DropCloudDatabaseAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.instanceId = ""; object.projectId = ""; object.databaseId = ""; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; return object; }; @@ -65743,9 +67687,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChangeQuorumCloudDatabaseAction.encode = function encode(message, writer) { + ChangeQuorumCloudDatabaseAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.databaseUri); if (message.servingLocations != null && message.servingLocations.length) @@ -65764,7 +67712,7 @@ * @returns {$protobuf.Writer} Writer */ ChangeQuorumCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -65841,12 +67789,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) { + if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) { properties._databaseUri = 1; if (!$util.isString(message.databaseUri)) return "databaseUri: string expected"; } - if (message.servingLocations != null && message.hasOwnProperty("servingLocations")) { + if (message.servingLocations != null && Object.hasOwnProperty.call(message, "servingLocations")) { if (!Array.isArray(message.servingLocations)) return "servingLocations: array expected"; for (var i = 0; i < message.servingLocations.length; ++i) @@ -65867,6 +67815,8 @@ ChangeQuorumCloudDatabaseAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ChangeQuorumCloudDatabaseAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65893,13 +67843,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChangeQuorumCloudDatabaseAction.toObject = function toObject(message, options) { + ChangeQuorumCloudDatabaseAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.servingLocations = []; - if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) { + if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) { object.databaseUri = message.databaseUri; if (options.oneofs) object._databaseUri = "databaseUri"; @@ -66040,9 +67994,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdaptMessageAction.encode = function encode(message, writer) { + AdaptMessageAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.databaseUri); if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) @@ -66069,7 +68027,7 @@ * @returns {$protobuf.Writer} Writer */ AdaptMessageAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -66180,16 +68138,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) + if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) if (!$util.isString(message.databaseUri)) return "databaseUri: string expected"; - if (message.protocol != null && message.hasOwnProperty("protocol")) + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) if (!$util.isString(message.protocol)) return "protocol: string expected"; - if (message.payload != null && message.hasOwnProperty("payload")) + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) return "payload: buffer expected"; - if (message.attachments != null && message.hasOwnProperty("attachments")) { + if (message.attachments != null && Object.hasOwnProperty.call(message, "attachments")) { if (!$util.isObject(message.attachments)) return "attachments: object expected"; var key = Object.keys(message.attachments); @@ -66197,10 +68155,10 @@ if (!$util.isString(message.attachments[key[i]])) return "attachments: string{k:string} expected"; } - if (message.query != null && message.hasOwnProperty("query")) + if (message.query != null && Object.hasOwnProperty.call(message, "query")) if (!$util.isString(message.query)) return "query: string expected"; - if (message.prepareThenExecute != null && message.hasOwnProperty("prepareThenExecute")) + if (message.prepareThenExecute != null && Object.hasOwnProperty.call(message, "prepareThenExecute")) if (typeof message.prepareThenExecute !== "boolean") return "prepareThenExecute: boolean expected"; return null; @@ -66217,6 +68175,8 @@ AdaptMessageAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.AdaptMessageAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.AdaptMessageAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66232,7 +68192,7 @@ else if (object.payload.length >= 0) message.payload = object.payload; if (object.attachments) { - if (typeof object.attachments !== "object") + if (!$util.isObject(object.attachments)) throw TypeError(".google.spanner.executor.v1.AdaptMessageAction.attachments: object expected"); message.attachments = {}; for (var keys = Object.keys(object.attachments), i = 0; i < keys.length; ++i) { @@ -66257,9 +68217,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdaptMessageAction.toObject = function toObject(message, options) { + AdaptMessageAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.attachments = {}; @@ -66276,11 +68240,11 @@ object.query = ""; object.prepareThenExecute = false; } - if (message.databaseUri != null && message.hasOwnProperty("databaseUri")) + if (message.databaseUri != null && Object.hasOwnProperty.call(message, "databaseUri")) object.databaseUri = message.databaseUri; - if (message.protocol != null && message.hasOwnProperty("protocol")) + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) object.protocol = message.protocol; - if (message.payload != null && message.hasOwnProperty("payload")) + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; var keys2; if (message.attachments && (keys2 = Object.keys(message.attachments)).length) { @@ -66291,9 +68255,9 @@ object.attachments[keys2[j]] = message.attachments[keys2[j]]; } } - if (message.query != null && message.hasOwnProperty("query")) + if (message.query != null && Object.hasOwnProperty.call(message, "query")) object.query = message.query; - if (message.prepareThenExecute != null && message.hasOwnProperty("prepareThenExecute")) + if (message.prepareThenExecute != null && Object.hasOwnProperty.call(message, "prepareThenExecute")) object.prepareThenExecute = message.prepareThenExecute; return object; }; @@ -66407,9 +68371,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCloudDatabasesAction.encode = function encode(message, writer) { + ListCloudDatabasesAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -66431,7 +68399,7 @@ * @returns {$protobuf.Writer} Writer */ ListCloudDatabasesAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -66513,16 +68481,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -66539,6 +68507,8 @@ ListCloudDatabasesAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ListCloudDatabasesAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ListCloudDatabasesAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66564,9 +68534,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCloudDatabasesAction.toObject = function toObject(message, options) { + ListCloudDatabasesAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -66574,13 +68548,13 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -66715,9 +68689,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCloudInstancesAction.encode = function encode(message, writer) { + ListCloudInstancesAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) @@ -66739,7 +68717,7 @@ * @returns {$protobuf.Writer} Writer */ ListCloudInstancesAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -66822,20 +68800,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) { + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) { properties._filter = 1; if (!$util.isString(message.filter)) return "filter: string expected"; } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) { properties._pageSize = 1; if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) { properties._pageToken = 1; if (!$util.isString(message.pageToken)) return "pageToken: string expected"; @@ -66854,6 +68832,8 @@ ListCloudInstancesAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ListCloudInstancesAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ListCloudInstancesAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66879,25 +68859,29 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCloudInstancesAction.toObject = function toObject(message, options) { + ListCloudInstancesAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.projectId = ""; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.filter != null && message.hasOwnProperty("filter")) { + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) { object.filter = message.filter; if (options.oneofs) object._filter = "filter"; } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) { object.pageSize = message.pageSize; if (options.oneofs) object._pageSize = "pageSize"; } - if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) { object.pageToken = message.pageToken; if (options.oneofs) object._pageToken = "pageToken"; @@ -66996,9 +68980,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCloudInstanceAction.encode = function encode(message, writer) { + GetCloudInstanceAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -67016,7 +69004,7 @@ * @returns {$protobuf.Writer} Writer */ GetCloudInstanceAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -67090,10 +69078,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; return null; @@ -67110,6 +69098,8 @@ GetCloudInstanceAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.GetCloudInstanceAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.GetCloudInstanceAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -67131,17 +69121,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetCloudInstanceAction.toObject = function toObject(message, options) { + GetCloudInstanceAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; object.instanceId = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; return object; }; @@ -67264,9 +69258,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCloudDatabaseOperationsAction.encode = function encode(message, writer) { + ListCloudDatabaseOperationsAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -67290,7 +69288,7 @@ * @returns {$protobuf.Writer} Writer */ ListCloudDatabaseOperationsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -67376,19 +69374,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -67405,6 +69403,8 @@ ListCloudDatabaseOperationsAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ListCloudDatabaseOperationsAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ListCloudDatabaseOperationsAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -67432,9 +69432,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCloudDatabaseOperationsAction.toObject = function toObject(message, options) { + ListCloudDatabaseOperationsAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -67443,15 +69447,15 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -67583,9 +69587,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreCloudDatabaseAction.encode = function encode(message, writer) { + RestoreCloudDatabaseAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.backupInstanceId != null && Object.hasOwnProperty.call(message, "backupInstanceId")) @@ -67597,7 +69605,7 @@ if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.databaseId); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -67611,7 +69619,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -67701,22 +69709,22 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.backupInstanceId != null && message.hasOwnProperty("backupInstanceId")) + if (message.backupInstanceId != null && Object.hasOwnProperty.call(message, "backupInstanceId")) if (!$util.isString(message.backupInstanceId)) return "backupInstanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; - if (message.databaseInstanceId != null && message.hasOwnProperty("databaseInstanceId")) + if (message.databaseInstanceId != null && Object.hasOwnProperty.call(message, "databaseInstanceId")) if (!$util.isString(message.databaseInstanceId)) return "databaseInstanceId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; @@ -67735,6 +69743,8 @@ RestoreCloudDatabaseAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.RestoreCloudDatabaseAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.RestoreCloudDatabaseAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -67751,7 +69761,7 @@ if (object.databaseId != null) message.databaseId = String(object.databaseId); if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.executor.v1.RestoreCloudDatabaseAction.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -67767,9 +69777,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreCloudDatabaseAction.toObject = function toObject(message, options) { + RestoreCloudDatabaseAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -67779,18 +69793,18 @@ object.databaseId = ""; object.encryptionConfig = null; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.backupInstanceId != null && message.hasOwnProperty("backupInstanceId")) + if (message.backupInstanceId != null && Object.hasOwnProperty.call(message, "backupInstanceId")) object.backupInstanceId = message.backupInstanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; - if (message.databaseInstanceId != null && message.hasOwnProperty("databaseInstanceId")) + if (message.databaseInstanceId != null && Object.hasOwnProperty.call(message, "databaseInstanceId")) object.databaseInstanceId = message.databaseInstanceId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options, q + 1); return object; }; @@ -67894,9 +69908,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCloudDatabaseAction.encode = function encode(message, writer) { + GetCloudDatabaseAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -67916,7 +69934,7 @@ * @returns {$protobuf.Writer} Writer */ GetCloudDatabaseAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -67994,13 +70012,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; return null; @@ -68017,6 +70035,8 @@ GetCloudDatabaseAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.GetCloudDatabaseAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.GetCloudDatabaseAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68040,20 +70060,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetCloudDatabaseAction.toObject = function toObject(message, options) { + GetCloudDatabaseAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; object.instanceId = ""; object.databaseId = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; return object; }; @@ -68203,9 +70227,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateCloudBackupAction.encode = function encode(message, writer) { + CreateCloudBackupAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -68215,11 +70243,11 @@ if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.databaseId); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) - $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.versionTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.admin.database.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -68233,7 +70261,7 @@ * @returns {$protobuf.Writer} Writer */ CreateCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -68328,24 +70356,24 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; } - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) { properties._versionTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.versionTime, long + 1); @@ -68353,7 +70381,7 @@ return "versionTime." + error; } } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) { var error = $root.google.spanner.admin.database.v1.EncryptionConfig.verify(message.encryptionConfig, long + 1); if (error) return "encryptionConfig." + error; @@ -68372,6 +70400,8 @@ CreateCloudBackupAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CreateCloudBackupAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68386,17 +70416,17 @@ if (object.databaseId != null) message.databaseId = String(object.databaseId); if (object.expireTime != null) { - if (typeof object.expireTime !== "object") + if (!$util.isObject(object.expireTime)) throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); } if (object.versionTime != null) { - if (typeof object.versionTime !== "object") + if (!$util.isObject(object.versionTime)) throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.versionTime: object expected"); message.versionTime = $root.google.protobuf.Timestamp.fromObject(object.versionTime, long + 1); } if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") + if (!$util.isObject(object.encryptionConfig)) throw TypeError(".google.spanner.executor.v1.CreateCloudBackupAction.encryptionConfig: object expected"); message.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.fromObject(object.encryptionConfig, long + 1); } @@ -68412,9 +70442,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateCloudBackupAction.toObject = function toObject(message, options) { + CreateCloudBackupAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -68424,23 +70458,23 @@ object.expireTime = null; object.encryptionConfig = null; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (message.versionTime != null && message.hasOwnProperty("versionTime")) { - object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); + if (message.versionTime != null && Object.hasOwnProperty.call(message, "versionTime")) { + object.versionTime = $root.google.protobuf.Timestamp.toObject(message.versionTime, options, q + 1); if (options.oneofs) object._versionTime = "versionTime"; } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + object.encryptionConfig = $root.google.spanner.admin.database.v1.EncryptionConfig.toObject(message.encryptionConfig, options, q + 1); return object; }; @@ -68562,9 +70596,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CopyCloudBackupAction.encode = function encode(message, writer) { + CopyCloudBackupAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -68574,7 +70612,7 @@ if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceBackup); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -68588,7 +70626,7 @@ * @returns {$protobuf.Writer} Writer */ CopyCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -68674,19 +70712,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) if (!$util.isString(message.sourceBackup)) return "sourceBackup: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; @@ -68705,6 +70743,8 @@ CopyCloudBackupAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CopyCloudBackupAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CopyCloudBackupAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68719,7 +70759,7 @@ if (object.sourceBackup != null) message.sourceBackup = String(object.sourceBackup); if (object.expireTime != null) { - if (typeof object.expireTime !== "object") + if (!$util.isObject(object.expireTime)) throw TypeError(".google.spanner.executor.v1.CopyCloudBackupAction.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); } @@ -68735,9 +70775,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CopyCloudBackupAction.toObject = function toObject(message, options) { + CopyCloudBackupAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -68746,16 +70790,16 @@ object.sourceBackup = ""; object.expireTime = null; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; - if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) object.sourceBackup = message.sourceBackup; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); return object; }; @@ -68859,9 +70903,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCloudBackupAction.encode = function encode(message, writer) { + GetCloudBackupAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -68881,7 +70929,7 @@ * @returns {$protobuf.Writer} Writer */ GetCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -68959,13 +71007,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; return null; @@ -68982,6 +71030,8 @@ GetCloudBackupAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.GetCloudBackupAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.GetCloudBackupAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69005,20 +71055,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetCloudBackupAction.toObject = function toObject(message, options) { + GetCloudBackupAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; object.instanceId = ""; object.backupId = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; return object; }; @@ -69132,9 +71186,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateCloudBackupAction.encode = function encode(message, writer) { + UpdateCloudBackupAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -69142,7 +71200,7 @@ if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -69156,7 +71214,7 @@ * @returns {$protobuf.Writer} Writer */ UpdateCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -69238,16 +71296,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expireTime, long + 1); if (error) return "expireTime." + error; @@ -69266,6 +71324,8 @@ UpdateCloudBackupAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.UpdateCloudBackupAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.UpdateCloudBackupAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69278,7 +71338,7 @@ if (object.backupId != null) message.backupId = String(object.backupId); if (object.expireTime != null) { - if (typeof object.expireTime !== "object") + if (!$util.isObject(object.expireTime)) throw TypeError(".google.spanner.executor.v1.UpdateCloudBackupAction.expireTime: object expected"); message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime, long + 1); } @@ -69294,9 +71354,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateCloudBackupAction.toObject = function toObject(message, options) { + UpdateCloudBackupAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -69304,14 +71368,14 @@ object.backupId = ""; object.expireTime = null; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; - if (message.expireTime != null && message.hasOwnProperty("expireTime")) - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options, q + 1); return object; }; @@ -69415,9 +71479,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteCloudBackupAction.encode = function encode(message, writer) { + DeleteCloudBackupAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -69437,7 +71505,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteCloudBackupAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -69515,13 +71583,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isString(message.backupId)) return "backupId: string expected"; return null; @@ -69538,6 +71606,8 @@ DeleteCloudBackupAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DeleteCloudBackupAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DeleteCloudBackupAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69561,20 +71631,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteCloudBackupAction.toObject = function toObject(message, options) { + DeleteCloudBackupAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; object.instanceId = ""; object.backupId = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) object.backupId = message.backupId; return object; }; @@ -69697,9 +71771,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCloudBackupsAction.encode = function encode(message, writer) { + ListCloudBackupsAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -69723,7 +71801,7 @@ * @returns {$protobuf.Writer} Writer */ ListCloudBackupsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -69809,19 +71887,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -69838,6 +71916,8 @@ ListCloudBackupsAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ListCloudBackupsAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ListCloudBackupsAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69865,9 +71945,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCloudBackupsAction.toObject = function toObject(message, options) { + ListCloudBackupsAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -69876,15 +71960,15 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -70007,9 +72091,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListCloudBackupOperationsAction.encode = function encode(message, writer) { + ListCloudBackupOperationsAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -70033,7 +72121,7 @@ * @returns {$protobuf.Writer} Writer */ ListCloudBackupOperationsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70119,19 +72207,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -70148,6 +72236,8 @@ ListCloudBackupOperationsAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ListCloudBackupOperationsAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ListCloudBackupOperationsAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70175,9 +72265,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListCloudBackupOperationsAction.toObject = function toObject(message, options) { + ListCloudBackupOperationsAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.projectId = ""; @@ -70186,15 +72280,15 @@ object.pageSize = 0; object.pageToken = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; return object; }; @@ -70281,9 +72375,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOperationAction.encode = function encode(message, writer) { + GetOperationAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); return writer; @@ -70299,7 +72397,7 @@ * @returns {$protobuf.Writer} Writer */ GetOperationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70369,7 +72467,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) if (!$util.isString(message.operation)) return "operation: string expected"; return null; @@ -70386,6 +72484,8 @@ GetOperationAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.GetOperationAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.GetOperationAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70405,13 +72505,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOperationAction.toObject = function toObject(message, options) { + GetOperationAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.operation = ""; - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) object.operation = message.operation; return object; }; @@ -70507,9 +72611,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryCancellationAction.encode = function encode(message, writer) { + QueryCancellationAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.longRunningSql != null && Object.hasOwnProperty.call(message, "longRunningSql")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.longRunningSql); if (message.cancelQuery != null && Object.hasOwnProperty.call(message, "cancelQuery")) @@ -70527,7 +72635,7 @@ * @returns {$protobuf.Writer} Writer */ QueryCancellationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70601,10 +72709,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.longRunningSql != null && message.hasOwnProperty("longRunningSql")) + if (message.longRunningSql != null && Object.hasOwnProperty.call(message, "longRunningSql")) if (!$util.isString(message.longRunningSql)) return "longRunningSql: string expected"; - if (message.cancelQuery != null && message.hasOwnProperty("cancelQuery")) + if (message.cancelQuery != null && Object.hasOwnProperty.call(message, "cancelQuery")) if (!$util.isString(message.cancelQuery)) return "cancelQuery: string expected"; return null; @@ -70621,6 +72729,8 @@ QueryCancellationAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.QueryCancellationAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.QueryCancellationAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70642,17 +72752,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryCancellationAction.toObject = function toObject(message, options) { + QueryCancellationAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.longRunningSql = ""; object.cancelQuery = ""; } - if (message.longRunningSql != null && message.hasOwnProperty("longRunningSql")) + if (message.longRunningSql != null && Object.hasOwnProperty.call(message, "longRunningSql")) object.longRunningSql = message.longRunningSql; - if (message.cancelQuery != null && message.hasOwnProperty("cancelQuery")) + if (message.cancelQuery != null && Object.hasOwnProperty.call(message, "cancelQuery")) object.cancelQuery = message.cancelQuery; return object; }; @@ -70739,9 +72853,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelOperationAction.encode = function encode(message, writer) { + CancelOperationAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); return writer; @@ -70757,7 +72875,7 @@ * @returns {$protobuf.Writer} Writer */ CancelOperationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70827,7 +72945,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) if (!$util.isString(message.operation)) return "operation: string expected"; return null; @@ -70844,6 +72962,8 @@ CancelOperationAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CancelOperationAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CancelOperationAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70863,13 +72983,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CancelOperationAction.toObject = function toObject(message, options) { + CancelOperationAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.operation = ""; - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) object.operation = message.operation; return object; }; @@ -70984,9 +73108,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddSplitPointsAction.encode = function encode(message, writer) { + AddSplitPointsAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -70995,7 +73123,7 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.databaseId); if (message.splitPoints != null && message.splitPoints.length) for (var i = 0; i < message.splitPoints.length; ++i) - $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.SplitPoints.encode(message.splitPoints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -71009,7 +73137,7 @@ * @returns {$protobuf.Writer} Writer */ AddSplitPointsAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -71093,16 +73221,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) if (!$util.isString(message.projectId)) return "projectId: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) if (!$util.isString(message.instanceId)) return "instanceId: string expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isString(message.databaseId)) return "databaseId: string expected"; - if (message.splitPoints != null && message.hasOwnProperty("splitPoints")) { + if (message.splitPoints != null && Object.hasOwnProperty.call(message, "splitPoints")) { if (!Array.isArray(message.splitPoints)) return "splitPoints: array expected"; for (var i = 0; i < message.splitPoints.length; ++i) { @@ -71125,6 +73253,8 @@ AddSplitPointsAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.AddSplitPointsAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.AddSplitPointsAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -71141,7 +73271,7 @@ throw TypeError(".google.spanner.executor.v1.AddSplitPointsAction.splitPoints: array expected"); message.splitPoints = []; for (var i = 0; i < object.splitPoints.length; ++i) { - if (typeof object.splitPoints[i] !== "object") + if (!$util.isObject(object.splitPoints[i])) throw TypeError(".google.spanner.executor.v1.AddSplitPointsAction.splitPoints: object expected"); message.splitPoints[i] = $root.google.spanner.admin.database.v1.SplitPoints.fromObject(object.splitPoints[i], long + 1); } @@ -71158,9 +73288,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddSplitPointsAction.toObject = function toObject(message, options) { + AddSplitPointsAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.splitPoints = []; @@ -71169,16 +73303,16 @@ object.instanceId = ""; object.databaseId = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) object.projectId = message.projectId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) object.databaseId = message.databaseId; if (message.splitPoints && message.splitPoints.length) { object.splitPoints = []; for (var j = 0; j < message.splitPoints.length; ++j) - object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options); + object.splitPoints[j] = $root.google.spanner.admin.database.v1.SplitPoints.toObject(message.splitPoints[j], options, q + 1); } return object; }; @@ -71297,11 +73431,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StartBatchTransactionAction.encode = function encode(message, writer) { + StartBatchTransactionAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.batchTxnTime != null && Object.hasOwnProperty.call(message, "batchTxnTime")) - $root.google.protobuf.Timestamp.encode(message.batchTxnTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.batchTxnTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.tid != null && Object.hasOwnProperty.call(message, "tid")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.tid); if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) @@ -71319,7 +73457,7 @@ * @returns {$protobuf.Writer} Writer */ StartBatchTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -71398,7 +73536,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.batchTxnTime != null && message.hasOwnProperty("batchTxnTime")) { + if (message.batchTxnTime != null && Object.hasOwnProperty.call(message, "batchTxnTime")) { properties.param = 1; { var error = $root.google.protobuf.Timestamp.verify(message.batchTxnTime, long + 1); @@ -71406,14 +73544,14 @@ return "batchTxnTime." + error; } } - if (message.tid != null && message.hasOwnProperty("tid")) { + if (message.tid != null && Object.hasOwnProperty.call(message, "tid")) { if (properties.param === 1) return "param: multiple values"; properties.param = 1; if (!(message.tid && typeof message.tid.length === "number" || $util.isString(message.tid))) return "tid: buffer expected"; } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) + if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) if (!$util.isString(message.cloudDatabaseRole)) return "cloudDatabaseRole: string expected"; return null; @@ -71430,13 +73568,15 @@ StartBatchTransactionAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.StartBatchTransactionAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.StartBatchTransactionAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.StartBatchTransactionAction(); if (object.batchTxnTime != null) { - if (typeof object.batchTxnTime !== "object") + if (!$util.isObject(object.batchTxnTime)) throw TypeError(".google.spanner.executor.v1.StartBatchTransactionAction.batchTxnTime: object expected"); message.batchTxnTime = $root.google.protobuf.Timestamp.fromObject(object.batchTxnTime, long + 1); } @@ -71459,23 +73599,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StartBatchTransactionAction.toObject = function toObject(message, options) { + StartBatchTransactionAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.cloudDatabaseRole = ""; - if (message.batchTxnTime != null && message.hasOwnProperty("batchTxnTime")) { - object.batchTxnTime = $root.google.protobuf.Timestamp.toObject(message.batchTxnTime, options); + if (message.batchTxnTime != null && Object.hasOwnProperty.call(message, "batchTxnTime")) { + object.batchTxnTime = $root.google.protobuf.Timestamp.toObject(message.batchTxnTime, options, q + 1); if (options.oneofs) object.param = "batchTxnTime"; } - if (message.tid != null && message.hasOwnProperty("tid")) { + if (message.tid != null && Object.hasOwnProperty.call(message, "tid")) { object.tid = options.bytes === String ? $util.base64.encode(message.tid, 0, message.tid.length) : options.bytes === Array ? Array.prototype.slice.call(message.tid) : message.tid; if (options.oneofs) object.param = "tid"; } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) + if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) object.cloudDatabaseRole = message.cloudDatabaseRole; return object; }; @@ -71562,9 +73706,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloseBatchTransactionAction.encode = function encode(message, writer) { + CloseBatchTransactionAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.cleanup != null && Object.hasOwnProperty.call(message, "cleanup")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.cleanup); return writer; @@ -71580,7 +73728,7 @@ * @returns {$protobuf.Writer} Writer */ CloseBatchTransactionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -71650,7 +73798,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.cleanup != null && message.hasOwnProperty("cleanup")) + if (message.cleanup != null && Object.hasOwnProperty.call(message, "cleanup")) if (typeof message.cleanup !== "boolean") return "cleanup: boolean expected"; return null; @@ -71667,6 +73815,8 @@ CloseBatchTransactionAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CloseBatchTransactionAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CloseBatchTransactionAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -71686,13 +73836,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloseBatchTransactionAction.toObject = function toObject(message, options) { + CloseBatchTransactionAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.cleanup = false; - if (message.cleanup != null && message.hasOwnProperty("cleanup")) + if (message.cleanup != null && Object.hasOwnProperty.call(message, "cleanup")) object.cleanup = message.cleanup; return object; }; @@ -71822,14 +73976,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateDbPartitionsForReadAction.encode = function encode(message, writer) { + GenerateDbPartitionsForReadAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.read != null && Object.hasOwnProperty.call(message, "read")) - $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.ReadAction.encode(message.read, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.table != null && message.table.length) for (var i = 0; i < message.table.length; ++i) - $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.TableMetadata.encode(message.table[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.desiredBytesPerPartition); if (message.maxPartitionCount != null && Object.hasOwnProperty.call(message, "maxPartitionCount")) @@ -71847,7 +74005,7 @@ * @returns {$protobuf.Writer} Writer */ GenerateDbPartitionsForReadAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -71932,12 +74090,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.read != null && message.hasOwnProperty("read")) { + if (message.read != null && Object.hasOwnProperty.call(message, "read")) { var error = $root.google.spanner.executor.v1.ReadAction.verify(message.read, long + 1); if (error) return "read." + error; } - if (message.table != null && message.hasOwnProperty("table")) { + if (message.table != null && Object.hasOwnProperty.call(message, "table")) { if (!Array.isArray(message.table)) return "table: array expected"; for (var i = 0; i < message.table.length; ++i) { @@ -71946,12 +74104,12 @@ return "table." + error; } } - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { + if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) { properties._desiredBytesPerPartition = 1; if (!$util.isInteger(message.desiredBytesPerPartition) && !(message.desiredBytesPerPartition && $util.isInteger(message.desiredBytesPerPartition.low) && $util.isInteger(message.desiredBytesPerPartition.high))) return "desiredBytesPerPartition: integer|Long expected"; } - if (message.maxPartitionCount != null && message.hasOwnProperty("maxPartitionCount")) { + if (message.maxPartitionCount != null && Object.hasOwnProperty.call(message, "maxPartitionCount")) { properties._maxPartitionCount = 1; if (!$util.isInteger(message.maxPartitionCount) && !(message.maxPartitionCount && $util.isInteger(message.maxPartitionCount.low) && $util.isInteger(message.maxPartitionCount.high))) return "maxPartitionCount: integer|Long expected"; @@ -71970,13 +74128,15 @@ GenerateDbPartitionsForReadAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForReadAction(); if (object.read != null) { - if (typeof object.read !== "object") + if (!$util.isObject(object.read)) throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.read: object expected"); message.read = $root.google.spanner.executor.v1.ReadAction.fromObject(object.read, long + 1); } @@ -71985,14 +74145,14 @@ throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.table: array expected"); message.table = []; for (var i = 0; i < object.table.length; ++i) { - if (typeof object.table[i] !== "object") + if (!$util.isObject(object.table[i])) throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForReadAction.table: object expected"); message.table[i] = $root.google.spanner.executor.v1.TableMetadata.fromObject(object.table[i], long + 1); } } if (object.desiredBytesPerPartition != null) if ($util.Long) - (message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition)).unsigned = false; + message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition, false); else if (typeof object.desiredBytesPerPartition === "string") message.desiredBytesPerPartition = parseInt(object.desiredBytesPerPartition, 10); else if (typeof object.desiredBytesPerPartition === "number") @@ -72001,7 +74161,7 @@ message.desiredBytesPerPartition = new $util.LongBits(object.desiredBytesPerPartition.low >>> 0, object.desiredBytesPerPartition.high >>> 0).toNumber(); if (object.maxPartitionCount != null) if ($util.Long) - (message.maxPartitionCount = $util.Long.fromValue(object.maxPartitionCount)).unsigned = false; + message.maxPartitionCount = $util.Long.fromValue(object.maxPartitionCount, false); else if (typeof object.maxPartitionCount === "string") message.maxPartitionCount = parseInt(object.maxPartitionCount, 10); else if (typeof object.maxPartitionCount === "number") @@ -72020,31 +74180,39 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateDbPartitionsForReadAction.toObject = function toObject(message, options) { + GenerateDbPartitionsForReadAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.table = []; if (options.defaults) object.read = null; - if (message.read != null && message.hasOwnProperty("read")) - object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options); + if (message.read != null && Object.hasOwnProperty.call(message, "read")) + object.read = $root.google.spanner.executor.v1.ReadAction.toObject(message.read, options, q + 1); if (message.table && message.table.length) { object.table = []; for (var j = 0; j < message.table.length; ++j) - object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options); + object.table[j] = $root.google.spanner.executor.v1.TableMetadata.toObject(message.table[j], options, q + 1); } - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { - if (typeof message.desiredBytesPerPartition === "number") + if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.desiredBytesPerPartition = typeof message.desiredBytesPerPartition === "number" ? BigInt(message.desiredBytesPerPartition) : $util.Long.fromBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0, false).toBigInt(); + else if (typeof message.desiredBytesPerPartition === "number") object.desiredBytesPerPartition = options.longs === String ? String(message.desiredBytesPerPartition) : message.desiredBytesPerPartition; else object.desiredBytesPerPartition = options.longs === String ? $util.Long.prototype.toString.call(message.desiredBytesPerPartition) : options.longs === Number ? new $util.LongBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0).toNumber() : message.desiredBytesPerPartition; if (options.oneofs) object._desiredBytesPerPartition = "desiredBytesPerPartition"; } - if (message.maxPartitionCount != null && message.hasOwnProperty("maxPartitionCount")) { - if (typeof message.maxPartitionCount === "number") + if (message.maxPartitionCount != null && Object.hasOwnProperty.call(message, "maxPartitionCount")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxPartitionCount = typeof message.maxPartitionCount === "number" ? BigInt(message.maxPartitionCount) : $util.Long.fromBits(message.maxPartitionCount.low >>> 0, message.maxPartitionCount.high >>> 0, false).toBigInt(); + else if (typeof message.maxPartitionCount === "number") object.maxPartitionCount = options.longs === String ? String(message.maxPartitionCount) : message.maxPartitionCount; else object.maxPartitionCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitionCount) : options.longs === Number ? new $util.LongBits(message.maxPartitionCount.low >>> 0, message.maxPartitionCount.high >>> 0).toNumber() : message.maxPartitionCount; @@ -72154,11 +74322,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateDbPartitionsForQueryAction.encode = function encode(message, writer) { + GenerateDbPartitionsForQueryAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryAction.encode(message.query, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.desiredBytesPerPartition); return writer; @@ -72174,7 +74346,7 @@ * @returns {$protobuf.Writer} Writer */ GenerateDbPartitionsForQueryAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -72249,12 +74421,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.query != null && message.hasOwnProperty("query")) { + if (message.query != null && Object.hasOwnProperty.call(message, "query")) { var error = $root.google.spanner.executor.v1.QueryAction.verify(message.query, long + 1); if (error) return "query." + error; } - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { + if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) { properties._desiredBytesPerPartition = 1; if (!$util.isInteger(message.desiredBytesPerPartition) && !(message.desiredBytesPerPartition && $util.isInteger(message.desiredBytesPerPartition.low) && $util.isInteger(message.desiredBytesPerPartition.high))) return "desiredBytesPerPartition: integer|Long expected"; @@ -72273,19 +74445,21 @@ GenerateDbPartitionsForQueryAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForQueryAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.GenerateDbPartitionsForQueryAction(); if (object.query != null) { - if (typeof object.query !== "object") + if (!$util.isObject(object.query)) throw TypeError(".google.spanner.executor.v1.GenerateDbPartitionsForQueryAction.query: object expected"); message.query = $root.google.spanner.executor.v1.QueryAction.fromObject(object.query, long + 1); } if (object.desiredBytesPerPartition != null) if ($util.Long) - (message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition)).unsigned = false; + message.desiredBytesPerPartition = $util.Long.fromValue(object.desiredBytesPerPartition, false); else if (typeof object.desiredBytesPerPartition === "string") message.desiredBytesPerPartition = parseInt(object.desiredBytesPerPartition, 10); else if (typeof object.desiredBytesPerPartition === "number") @@ -72304,16 +74478,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateDbPartitionsForQueryAction.toObject = function toObject(message, options) { + GenerateDbPartitionsForQueryAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.query = null; - if (message.query != null && message.hasOwnProperty("query")) - object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options); - if (message.desiredBytesPerPartition != null && message.hasOwnProperty("desiredBytesPerPartition")) { - if (typeof message.desiredBytesPerPartition === "number") + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + object.query = $root.google.spanner.executor.v1.QueryAction.toObject(message.query, options, q + 1); + if (message.desiredBytesPerPartition != null && Object.hasOwnProperty.call(message, "desiredBytesPerPartition")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.desiredBytesPerPartition = typeof message.desiredBytesPerPartition === "number" ? BigInt(message.desiredBytesPerPartition) : $util.Long.fromBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0, false).toBigInt(); + else if (typeof message.desiredBytesPerPartition === "number") object.desiredBytesPerPartition = options.longs === String ? String(message.desiredBytesPerPartition) : message.desiredBytesPerPartition; else object.desiredBytesPerPartition = options.longs === String ? $util.Long.prototype.toString.call(message.desiredBytesPerPartition) : options.longs === Number ? new $util.LongBits(message.desiredBytesPerPartition.low >>> 0, message.desiredBytesPerPartition.high >>> 0).toNumber() : message.desiredBytesPerPartition; @@ -72447,9 +74627,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchPartition.encode = function encode(message, writer) { + BatchPartition.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partition); if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) @@ -72471,7 +74655,7 @@ * @returns {$protobuf.Writer} Writer */ BatchPartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -72554,18 +74738,18 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.partition != null && message.hasOwnProperty("partition")) + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) if (!(message.partition && typeof message.partition.length === "number" || $util.isString(message.partition))) return "partition: buffer expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) return "partitionToken: buffer expected"; - if (message.table != null && message.hasOwnProperty("table")) { + if (message.table != null && Object.hasOwnProperty.call(message, "table")) { properties._table = 1; if (!$util.isString(message.table)) return "table: string expected"; } - if (message.index != null && message.hasOwnProperty("index")) { + if (message.index != null && Object.hasOwnProperty.call(message, "index")) { properties._index = 1; if (!$util.isString(message.index)) return "index: string expected"; @@ -72584,6 +74768,8 @@ BatchPartition.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.BatchPartition) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.BatchPartition: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -72615,9 +74801,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchPartition.toObject = function toObject(message, options) { + BatchPartition.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { if (options.bytes === String) @@ -72635,16 +74825,16 @@ object.partitionToken = $util.newBuffer(object.partitionToken); } } - if (message.partition != null && message.hasOwnProperty("partition")) + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) object.partition = options.bytes === String ? $util.base64.encode(message.partition, 0, message.partition.length) : options.bytes === Array ? Array.prototype.slice.call(message.partition) : message.partition; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.table != null && message.hasOwnProperty("table")) { + if (message.table != null && Object.hasOwnProperty.call(message, "table")) { object.table = message.table; if (options.oneofs) object._table = "table"; } - if (message.index != null && message.hasOwnProperty("index")) { + if (message.index != null && Object.hasOwnProperty.call(message, "index")) { object.index = message.index; if (options.oneofs) object._index = "index"; @@ -72734,11 +74924,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecutePartitionAction.encode = function encode(message, writer) { + ExecutePartitionAction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) - $root.google.spanner.executor.v1.BatchPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.BatchPartition.encode(message.partition, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -72752,7 +74946,7 @@ * @returns {$protobuf.Writer} Writer */ ExecutePartitionAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -72822,7 +75016,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.partition != null && message.hasOwnProperty("partition")) { + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) { var error = $root.google.spanner.executor.v1.BatchPartition.verify(message.partition, long + 1); if (error) return "partition." + error; @@ -72841,13 +75035,15 @@ ExecutePartitionAction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ExecutePartitionAction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ExecutePartitionAction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.ExecutePartitionAction(); if (object.partition != null) { - if (typeof object.partition !== "object") + if (!$util.isObject(object.partition)) throw TypeError(".google.spanner.executor.v1.ExecutePartitionAction.partition: object expected"); message.partition = $root.google.spanner.executor.v1.BatchPartition.fromObject(object.partition, long + 1); } @@ -72863,14 +75059,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecutePartitionAction.toObject = function toObject(message, options) { + ExecutePartitionAction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.partition = null; - if (message.partition != null && message.hasOwnProperty("partition")) - object.partition = $root.google.spanner.executor.v1.BatchPartition.toObject(message.partition, options); + if (message.partition != null && Object.hasOwnProperty.call(message, "partition")) + object.partition = $root.google.spanner.executor.v1.BatchPartition.toObject(message.partition, options, q + 1); return object; }; @@ -73053,15 +75253,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteChangeStreamQuery.encode = function encode(message, writer) { + ExecuteChangeStreamQuery.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.partitionToken); if (message.readOptions != null && message.readOptions.length) @@ -73086,7 +75290,7 @@ * @returns {$protobuf.Writer} Writer */ ExecuteChangeStreamQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -73187,15 +75391,15 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { properties._endTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); @@ -73203,29 +75407,29 @@ return "endTime." + error; } } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) { + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) { properties._partitionToken = 1; if (!$util.isString(message.partitionToken)) return "partitionToken: string expected"; } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) { if (!Array.isArray(message.readOptions)) return "readOptions: array expected"; for (var i = 0; i < message.readOptions.length; ++i) if (!$util.isString(message.readOptions[i])) return "readOptions: string[] expected"; } - if (message.heartbeatMilliseconds != null && message.hasOwnProperty("heartbeatMilliseconds")) { + if (message.heartbeatMilliseconds != null && Object.hasOwnProperty.call(message, "heartbeatMilliseconds")) { properties._heartbeatMilliseconds = 1; if (!$util.isInteger(message.heartbeatMilliseconds)) return "heartbeatMilliseconds: integer expected"; } - if (message.deadlineSeconds != null && message.hasOwnProperty("deadlineSeconds")) { + if (message.deadlineSeconds != null && Object.hasOwnProperty.call(message, "deadlineSeconds")) { properties._deadlineSeconds = 1; if (!$util.isInteger(message.deadlineSeconds) && !(message.deadlineSeconds && $util.isInteger(message.deadlineSeconds.low) && $util.isInteger(message.deadlineSeconds.high))) return "deadlineSeconds: integer|Long expected"; } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) { + if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) { properties._cloudDatabaseRole = 1; if (!$util.isString(message.cloudDatabaseRole)) return "cloudDatabaseRole: string expected"; @@ -73244,6 +75448,8 @@ ExecuteChangeStreamQuery.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ExecuteChangeStreamQuery) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -73252,12 +75458,12 @@ if (object.name != null) message.name = String(object.name); if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } if (object.endTime != null) { - if (typeof object.endTime !== "object") + if (!$util.isObject(object.endTime)) throw TypeError(".google.spanner.executor.v1.ExecuteChangeStreamQuery.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -73274,7 +75480,7 @@ message.heartbeatMilliseconds = object.heartbeatMilliseconds | 0; if (object.deadlineSeconds != null) if ($util.Long) - (message.deadlineSeconds = $util.Long.fromValue(object.deadlineSeconds)).unsigned = false; + message.deadlineSeconds = $util.Long.fromValue(object.deadlineSeconds, false); else if (typeof object.deadlineSeconds === "string") message.deadlineSeconds = parseInt(object.deadlineSeconds, 10); else if (typeof object.deadlineSeconds === "number") @@ -73295,9 +75501,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteChangeStreamQuery.toObject = function toObject(message, options) { + ExecuteChangeStreamQuery.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.readOptions = []; @@ -73305,16 +75515,16 @@ object.name = ""; object.startTime = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) { - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) { + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); if (options.oneofs) object._endTime = "endTime"; } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) { + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) { object.partitionToken = message.partitionToken; if (options.oneofs) object._partitionToken = "partitionToken"; @@ -73324,20 +75534,22 @@ for (var j = 0; j < message.readOptions.length; ++j) object.readOptions[j] = message.readOptions[j]; } - if (message.heartbeatMilliseconds != null && message.hasOwnProperty("heartbeatMilliseconds")) { + if (message.heartbeatMilliseconds != null && Object.hasOwnProperty.call(message, "heartbeatMilliseconds")) { object.heartbeatMilliseconds = message.heartbeatMilliseconds; if (options.oneofs) object._heartbeatMilliseconds = "heartbeatMilliseconds"; } - if (message.deadlineSeconds != null && message.hasOwnProperty("deadlineSeconds")) { - if (typeof message.deadlineSeconds === "number") + if (message.deadlineSeconds != null && Object.hasOwnProperty.call(message, "deadlineSeconds")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.deadlineSeconds = typeof message.deadlineSeconds === "number" ? BigInt(message.deadlineSeconds) : $util.Long.fromBits(message.deadlineSeconds.low >>> 0, message.deadlineSeconds.high >>> 0, false).toBigInt(); + else if (typeof message.deadlineSeconds === "number") object.deadlineSeconds = options.longs === String ? String(message.deadlineSeconds) : message.deadlineSeconds; else object.deadlineSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.deadlineSeconds) : options.longs === Number ? new $util.LongBits(message.deadlineSeconds.low >>> 0, message.deadlineSeconds.high >>> 0).toNumber() : message.deadlineSeconds; if (options.oneofs) object._deadlineSeconds = "deadlineSeconds"; } - if (message.cloudDatabaseRole != null && message.hasOwnProperty("cloudDatabaseRole")) { + if (message.cloudDatabaseRole != null && Object.hasOwnProperty.call(message, "cloudDatabaseRole")) { object.cloudDatabaseRole = message.cloudDatabaseRole; if (options.oneofs) object._cloudDatabaseRole = "cloudDatabaseRole"; @@ -73571,26 +75783,30 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpannerActionOutcome.encode = function encode(message, writer) { + SpannerActionOutcome.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) - $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.readResult != null && Object.hasOwnProperty.call(message, "readResult")) - $root.google.spanner.executor.v1.ReadResult.encode(message.readResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.ReadResult.encode(message.readResult, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) - $root.google.spanner.executor.v1.QueryResult.encode(message.queryResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.executor.v1.QueryResult.encode(message.queryResult, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.transactionRestarted != null && Object.hasOwnProperty.call(message, "transactionRestarted")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.transactionRestarted); if (message.batchTxnId != null && Object.hasOwnProperty.call(message, "batchTxnId")) writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.batchTxnId); if (message.dbPartition != null && message.dbPartition.length) for (var i = 0; i < message.dbPartition.length; ++i) - $root.google.spanner.executor.v1.BatchPartition.encode(message.dbPartition[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.executor.v1.BatchPartition.encode(message.dbPartition[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.adminResult != null && Object.hasOwnProperty.call(message, "adminResult")) - $root.google.spanner.executor.v1.AdminResult.encode(message.adminResult, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.spanner.executor.v1.AdminResult.encode(message.adminResult, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.dmlRowsModified != null && message.dmlRowsModified.length) { writer.uint32(/* id 9, wireType 2 =*/74).fork(); for (var i = 0; i < message.dmlRowsModified.length; ++i) @@ -73599,7 +75815,7 @@ } if (message.changeStreamRecords != null && message.changeStreamRecords.length) for (var i = 0; i < message.changeStreamRecords.length; ++i) - $root.google.spanner.executor.v1.ChangeStreamRecord.encode(message.changeStreamRecords[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.spanner.executor.v1.ChangeStreamRecord.encode(message.changeStreamRecords[i], writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.snapshotIsolationTxnReadTimestamp != null && Object.hasOwnProperty.call(message, "snapshotIsolationTxnReadTimestamp")) writer.uint32(/* id 11, wireType 0 =*/88).int64(message.snapshotIsolationTxnReadTimestamp); return writer; @@ -73615,7 +75831,7 @@ * @returns {$protobuf.Writer} Writer */ SpannerActionOutcome.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -73737,7 +75953,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { properties._status = 1; { var error = $root.google.rpc.Status.verify(message.status, long + 1); @@ -73745,7 +75961,7 @@ return "status." + error; } } - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) { properties._commitTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.commitTime, long + 1); @@ -73753,7 +75969,7 @@ return "commitTime." + error; } } - if (message.readResult != null && message.hasOwnProperty("readResult")) { + if (message.readResult != null && Object.hasOwnProperty.call(message, "readResult")) { properties._readResult = 1; { var error = $root.google.spanner.executor.v1.ReadResult.verify(message.readResult, long + 1); @@ -73761,7 +75977,7 @@ return "readResult." + error; } } - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) { properties._queryResult = 1; { var error = $root.google.spanner.executor.v1.QueryResult.verify(message.queryResult, long + 1); @@ -73769,17 +75985,17 @@ return "queryResult." + error; } } - if (message.transactionRestarted != null && message.hasOwnProperty("transactionRestarted")) { + if (message.transactionRestarted != null && Object.hasOwnProperty.call(message, "transactionRestarted")) { properties._transactionRestarted = 1; if (typeof message.transactionRestarted !== "boolean") return "transactionRestarted: boolean expected"; } - if (message.batchTxnId != null && message.hasOwnProperty("batchTxnId")) { + if (message.batchTxnId != null && Object.hasOwnProperty.call(message, "batchTxnId")) { properties._batchTxnId = 1; if (!(message.batchTxnId && typeof message.batchTxnId.length === "number" || $util.isString(message.batchTxnId))) return "batchTxnId: buffer expected"; } - if (message.dbPartition != null && message.hasOwnProperty("dbPartition")) { + if (message.dbPartition != null && Object.hasOwnProperty.call(message, "dbPartition")) { if (!Array.isArray(message.dbPartition)) return "dbPartition: array expected"; for (var i = 0; i < message.dbPartition.length; ++i) { @@ -73788,7 +76004,7 @@ return "dbPartition." + error; } } - if (message.adminResult != null && message.hasOwnProperty("adminResult")) { + if (message.adminResult != null && Object.hasOwnProperty.call(message, "adminResult")) { properties._adminResult = 1; { var error = $root.google.spanner.executor.v1.AdminResult.verify(message.adminResult, long + 1); @@ -73796,14 +76012,14 @@ return "adminResult." + error; } } - if (message.dmlRowsModified != null && message.hasOwnProperty("dmlRowsModified")) { + if (message.dmlRowsModified != null && Object.hasOwnProperty.call(message, "dmlRowsModified")) { if (!Array.isArray(message.dmlRowsModified)) return "dmlRowsModified: array expected"; for (var i = 0; i < message.dmlRowsModified.length; ++i) if (!$util.isInteger(message.dmlRowsModified[i]) && !(message.dmlRowsModified[i] && $util.isInteger(message.dmlRowsModified[i].low) && $util.isInteger(message.dmlRowsModified[i].high))) return "dmlRowsModified: integer|Long[] expected"; } - if (message.changeStreamRecords != null && message.hasOwnProperty("changeStreamRecords")) { + if (message.changeStreamRecords != null && Object.hasOwnProperty.call(message, "changeStreamRecords")) { if (!Array.isArray(message.changeStreamRecords)) return "changeStreamRecords: array expected"; for (var i = 0; i < message.changeStreamRecords.length; ++i) { @@ -73812,7 +76028,7 @@ return "changeStreamRecords." + error; } } - if (message.snapshotIsolationTxnReadTimestamp != null && message.hasOwnProperty("snapshotIsolationTxnReadTimestamp")) { + if (message.snapshotIsolationTxnReadTimestamp != null && Object.hasOwnProperty.call(message, "snapshotIsolationTxnReadTimestamp")) { properties._snapshotIsolationTxnReadTimestamp = 1; if (!$util.isInteger(message.snapshotIsolationTxnReadTimestamp) && !(message.snapshotIsolationTxnReadTimestamp && $util.isInteger(message.snapshotIsolationTxnReadTimestamp.low) && $util.isInteger(message.snapshotIsolationTxnReadTimestamp.high))) return "snapshotIsolationTxnReadTimestamp: integer|Long expected"; @@ -73831,28 +76047,30 @@ SpannerActionOutcome.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.SpannerActionOutcome) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.SpannerActionOutcome(); if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } if (object.commitTime != null) { - if (typeof object.commitTime !== "object") + if (!$util.isObject(object.commitTime)) throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.commitTime: object expected"); message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime, long + 1); } if (object.readResult != null) { - if (typeof object.readResult !== "object") + if (!$util.isObject(object.readResult)) throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.readResult: object expected"); message.readResult = $root.google.spanner.executor.v1.ReadResult.fromObject(object.readResult, long + 1); } if (object.queryResult != null) { - if (typeof object.queryResult !== "object") + if (!$util.isObject(object.queryResult)) throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.queryResult: object expected"); message.queryResult = $root.google.spanner.executor.v1.QueryResult.fromObject(object.queryResult, long + 1); } @@ -73868,13 +76086,13 @@ throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dbPartition: array expected"); message.dbPartition = []; for (var i = 0; i < object.dbPartition.length; ++i) { - if (typeof object.dbPartition[i] !== "object") + if (!$util.isObject(object.dbPartition[i])) throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.dbPartition: object expected"); message.dbPartition[i] = $root.google.spanner.executor.v1.BatchPartition.fromObject(object.dbPartition[i], long + 1); } } if (object.adminResult != null) { - if (typeof object.adminResult !== "object") + if (!$util.isObject(object.adminResult)) throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.adminResult: object expected"); message.adminResult = $root.google.spanner.executor.v1.AdminResult.fromObject(object.adminResult, long + 1); } @@ -73884,7 +76102,7 @@ message.dmlRowsModified = []; for (var i = 0; i < object.dmlRowsModified.length; ++i) if ($util.Long) - (message.dmlRowsModified[i] = $util.Long.fromValue(object.dmlRowsModified[i])).unsigned = false; + message.dmlRowsModified[i] = $util.Long.fromValue(object.dmlRowsModified[i], false); else if (typeof object.dmlRowsModified[i] === "string") message.dmlRowsModified[i] = parseInt(object.dmlRowsModified[i], 10); else if (typeof object.dmlRowsModified[i] === "number") @@ -73897,14 +76115,14 @@ throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.changeStreamRecords: array expected"); message.changeStreamRecords = []; for (var i = 0; i < object.changeStreamRecords.length; ++i) { - if (typeof object.changeStreamRecords[i] !== "object") + if (!$util.isObject(object.changeStreamRecords[i])) throw TypeError(".google.spanner.executor.v1.SpannerActionOutcome.changeStreamRecords: object expected"); message.changeStreamRecords[i] = $root.google.spanner.executor.v1.ChangeStreamRecord.fromObject(object.changeStreamRecords[i], long + 1); } } if (object.snapshotIsolationTxnReadTimestamp != null) if ($util.Long) - (message.snapshotIsolationTxnReadTimestamp = $util.Long.fromValue(object.snapshotIsolationTxnReadTimestamp)).unsigned = false; + message.snapshotIsolationTxnReadTimestamp = $util.Long.fromValue(object.snapshotIsolationTxnReadTimestamp, false); else if (typeof object.snapshotIsolationTxnReadTimestamp === "string") message.snapshotIsolationTxnReadTimestamp = parseInt(object.snapshotIsolationTxnReadTimestamp, 10); else if (typeof object.snapshotIsolationTxnReadTimestamp === "number") @@ -73923,41 +76141,45 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpannerActionOutcome.toObject = function toObject(message, options) { + SpannerActionOutcome.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.dbPartition = []; object.dmlRowsModified = []; object.changeStreamRecords = []; } - if (message.status != null && message.hasOwnProperty("status")) { - object.status = $root.google.rpc.Status.toObject(message.status, options); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { + object.status = $root.google.rpc.Status.toObject(message.status, options, q + 1); if (options.oneofs) object._status = "status"; } - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { - object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) { + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options, q + 1); if (options.oneofs) object._commitTime = "commitTime"; } - if (message.readResult != null && message.hasOwnProperty("readResult")) { - object.readResult = $root.google.spanner.executor.v1.ReadResult.toObject(message.readResult, options); + if (message.readResult != null && Object.hasOwnProperty.call(message, "readResult")) { + object.readResult = $root.google.spanner.executor.v1.ReadResult.toObject(message.readResult, options, q + 1); if (options.oneofs) object._readResult = "readResult"; } - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - object.queryResult = $root.google.spanner.executor.v1.QueryResult.toObject(message.queryResult, options); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) { + object.queryResult = $root.google.spanner.executor.v1.QueryResult.toObject(message.queryResult, options, q + 1); if (options.oneofs) object._queryResult = "queryResult"; } - if (message.transactionRestarted != null && message.hasOwnProperty("transactionRestarted")) { + if (message.transactionRestarted != null && Object.hasOwnProperty.call(message, "transactionRestarted")) { object.transactionRestarted = message.transactionRestarted; if (options.oneofs) object._transactionRestarted = "transactionRestarted"; } - if (message.batchTxnId != null && message.hasOwnProperty("batchTxnId")) { + if (message.batchTxnId != null && Object.hasOwnProperty.call(message, "batchTxnId")) { object.batchTxnId = options.bytes === String ? $util.base64.encode(message.batchTxnId, 0, message.batchTxnId.length) : options.bytes === Array ? Array.prototype.slice.call(message.batchTxnId) : message.batchTxnId; if (options.oneofs) object._batchTxnId = "batchTxnId"; @@ -73965,17 +76187,19 @@ if (message.dbPartition && message.dbPartition.length) { object.dbPartition = []; for (var j = 0; j < message.dbPartition.length; ++j) - object.dbPartition[j] = $root.google.spanner.executor.v1.BatchPartition.toObject(message.dbPartition[j], options); + object.dbPartition[j] = $root.google.spanner.executor.v1.BatchPartition.toObject(message.dbPartition[j], options, q + 1); } - if (message.adminResult != null && message.hasOwnProperty("adminResult")) { - object.adminResult = $root.google.spanner.executor.v1.AdminResult.toObject(message.adminResult, options); + if (message.adminResult != null && Object.hasOwnProperty.call(message, "adminResult")) { + object.adminResult = $root.google.spanner.executor.v1.AdminResult.toObject(message.adminResult, options, q + 1); if (options.oneofs) object._adminResult = "adminResult"; } if (message.dmlRowsModified && message.dmlRowsModified.length) { object.dmlRowsModified = []; for (var j = 0; j < message.dmlRowsModified.length; ++j) - if (typeof message.dmlRowsModified[j] === "number") + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.dmlRowsModified[j] = typeof message.dmlRowsModified[j] === "number" ? BigInt(message.dmlRowsModified[j]) : $util.Long.fromBits(message.dmlRowsModified[j].low >>> 0, message.dmlRowsModified[j].high >>> 0, false).toBigInt(); + else if (typeof message.dmlRowsModified[j] === "number") object.dmlRowsModified[j] = options.longs === String ? String(message.dmlRowsModified[j]) : message.dmlRowsModified[j]; else object.dmlRowsModified[j] = options.longs === String ? $util.Long.prototype.toString.call(message.dmlRowsModified[j]) : options.longs === Number ? new $util.LongBits(message.dmlRowsModified[j].low >>> 0, message.dmlRowsModified[j].high >>> 0).toNumber() : message.dmlRowsModified[j]; @@ -73983,10 +76207,12 @@ if (message.changeStreamRecords && message.changeStreamRecords.length) { object.changeStreamRecords = []; for (var j = 0; j < message.changeStreamRecords.length; ++j) - object.changeStreamRecords[j] = $root.google.spanner.executor.v1.ChangeStreamRecord.toObject(message.changeStreamRecords[j], options); + object.changeStreamRecords[j] = $root.google.spanner.executor.v1.ChangeStreamRecord.toObject(message.changeStreamRecords[j], options, q + 1); } - if (message.snapshotIsolationTxnReadTimestamp != null && message.hasOwnProperty("snapshotIsolationTxnReadTimestamp")) { - if (typeof message.snapshotIsolationTxnReadTimestamp === "number") + if (message.snapshotIsolationTxnReadTimestamp != null && Object.hasOwnProperty.call(message, "snapshotIsolationTxnReadTimestamp")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.snapshotIsolationTxnReadTimestamp = typeof message.snapshotIsolationTxnReadTimestamp === "number" ? BigInt(message.snapshotIsolationTxnReadTimestamp) : $util.Long.fromBits(message.snapshotIsolationTxnReadTimestamp.low >>> 0, message.snapshotIsolationTxnReadTimestamp.high >>> 0, false).toBigInt(); + else if (typeof message.snapshotIsolationTxnReadTimestamp === "number") object.snapshotIsolationTxnReadTimestamp = options.longs === String ? String(message.snapshotIsolationTxnReadTimestamp) : message.snapshotIsolationTxnReadTimestamp; else object.snapshotIsolationTxnReadTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotIsolationTxnReadTimestamp) : options.longs === Number ? new $util.LongBits(message.snapshotIsolationTxnReadTimestamp.low >>> 0, message.snapshotIsolationTxnReadTimestamp.high >>> 0).toNumber() : message.snapshotIsolationTxnReadTimestamp; @@ -74114,19 +76340,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdminResult.encode = function encode(message, writer) { + AdminResult.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupResponse != null && Object.hasOwnProperty.call(message, "backupResponse")) - $root.google.spanner.executor.v1.CloudBackupResponse.encode(message.backupResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.CloudBackupResponse.encode(message.backupResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.operationResponse != null && Object.hasOwnProperty.call(message, "operationResponse")) - $root.google.spanner.executor.v1.OperationResponse.encode(message.operationResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.OperationResponse.encode(message.operationResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.databaseResponse != null && Object.hasOwnProperty.call(message, "databaseResponse")) - $root.google.spanner.executor.v1.CloudDatabaseResponse.encode(message.databaseResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.CloudDatabaseResponse.encode(message.databaseResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.instanceResponse != null && Object.hasOwnProperty.call(message, "instanceResponse")) - $root.google.spanner.executor.v1.CloudInstanceResponse.encode(message.instanceResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.executor.v1.CloudInstanceResponse.encode(message.instanceResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.instanceConfigResponse != null && Object.hasOwnProperty.call(message, "instanceConfigResponse")) - $root.google.spanner.executor.v1.CloudInstanceConfigResponse.encode(message.instanceConfigResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.executor.v1.CloudInstanceConfigResponse.encode(message.instanceConfigResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -74140,7 +76370,7 @@ * @returns {$protobuf.Writer} Writer */ AdminResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -74226,27 +76456,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backupResponse != null && message.hasOwnProperty("backupResponse")) { + if (message.backupResponse != null && Object.hasOwnProperty.call(message, "backupResponse")) { var error = $root.google.spanner.executor.v1.CloudBackupResponse.verify(message.backupResponse, long + 1); if (error) return "backupResponse." + error; } - if (message.operationResponse != null && message.hasOwnProperty("operationResponse")) { + if (message.operationResponse != null && Object.hasOwnProperty.call(message, "operationResponse")) { var error = $root.google.spanner.executor.v1.OperationResponse.verify(message.operationResponse, long + 1); if (error) return "operationResponse." + error; } - if (message.databaseResponse != null && message.hasOwnProperty("databaseResponse")) { + if (message.databaseResponse != null && Object.hasOwnProperty.call(message, "databaseResponse")) { var error = $root.google.spanner.executor.v1.CloudDatabaseResponse.verify(message.databaseResponse, long + 1); if (error) return "databaseResponse." + error; } - if (message.instanceResponse != null && message.hasOwnProperty("instanceResponse")) { + if (message.instanceResponse != null && Object.hasOwnProperty.call(message, "instanceResponse")) { var error = $root.google.spanner.executor.v1.CloudInstanceResponse.verify(message.instanceResponse, long + 1); if (error) return "instanceResponse." + error; } - if (message.instanceConfigResponse != null && message.hasOwnProperty("instanceConfigResponse")) { + if (message.instanceConfigResponse != null && Object.hasOwnProperty.call(message, "instanceConfigResponse")) { var error = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.verify(message.instanceConfigResponse, long + 1); if (error) return "instanceConfigResponse." + error; @@ -74265,33 +76495,35 @@ AdminResult.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.AdminResult) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.AdminResult: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.AdminResult(); if (object.backupResponse != null) { - if (typeof object.backupResponse !== "object") + if (!$util.isObject(object.backupResponse)) throw TypeError(".google.spanner.executor.v1.AdminResult.backupResponse: object expected"); message.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.fromObject(object.backupResponse, long + 1); } if (object.operationResponse != null) { - if (typeof object.operationResponse !== "object") + if (!$util.isObject(object.operationResponse)) throw TypeError(".google.spanner.executor.v1.AdminResult.operationResponse: object expected"); message.operationResponse = $root.google.spanner.executor.v1.OperationResponse.fromObject(object.operationResponse, long + 1); } if (object.databaseResponse != null) { - if (typeof object.databaseResponse !== "object") + if (!$util.isObject(object.databaseResponse)) throw TypeError(".google.spanner.executor.v1.AdminResult.databaseResponse: object expected"); message.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.fromObject(object.databaseResponse, long + 1); } if (object.instanceResponse != null) { - if (typeof object.instanceResponse !== "object") + if (!$util.isObject(object.instanceResponse)) throw TypeError(".google.spanner.executor.v1.AdminResult.instanceResponse: object expected"); message.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.fromObject(object.instanceResponse, long + 1); } if (object.instanceConfigResponse != null) { - if (typeof object.instanceConfigResponse !== "object") + if (!$util.isObject(object.instanceConfigResponse)) throw TypeError(".google.spanner.executor.v1.AdminResult.instanceConfigResponse: object expected"); message.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.fromObject(object.instanceConfigResponse, long + 1); } @@ -74307,9 +76539,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdminResult.toObject = function toObject(message, options) { + AdminResult.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.backupResponse = null; @@ -74318,16 +76554,16 @@ object.instanceResponse = null; object.instanceConfigResponse = null; } - if (message.backupResponse != null && message.hasOwnProperty("backupResponse")) - object.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.toObject(message.backupResponse, options); - if (message.operationResponse != null && message.hasOwnProperty("operationResponse")) - object.operationResponse = $root.google.spanner.executor.v1.OperationResponse.toObject(message.operationResponse, options); - if (message.databaseResponse != null && message.hasOwnProperty("databaseResponse")) - object.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.toObject(message.databaseResponse, options); - if (message.instanceResponse != null && message.hasOwnProperty("instanceResponse")) - object.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.toObject(message.instanceResponse, options); - if (message.instanceConfigResponse != null && message.hasOwnProperty("instanceConfigResponse")) - object.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.toObject(message.instanceConfigResponse, options); + if (message.backupResponse != null && Object.hasOwnProperty.call(message, "backupResponse")) + object.backupResponse = $root.google.spanner.executor.v1.CloudBackupResponse.toObject(message.backupResponse, options, q + 1); + if (message.operationResponse != null && Object.hasOwnProperty.call(message, "operationResponse")) + object.operationResponse = $root.google.spanner.executor.v1.OperationResponse.toObject(message.operationResponse, options, q + 1); + if (message.databaseResponse != null && Object.hasOwnProperty.call(message, "databaseResponse")) + object.databaseResponse = $root.google.spanner.executor.v1.CloudDatabaseResponse.toObject(message.databaseResponse, options, q + 1); + if (message.instanceResponse != null && Object.hasOwnProperty.call(message, "instanceResponse")) + object.instanceResponse = $root.google.spanner.executor.v1.CloudInstanceResponse.toObject(message.instanceResponse, options, q + 1); + if (message.instanceConfigResponse != null && Object.hasOwnProperty.call(message, "instanceConfigResponse")) + object.instanceConfigResponse = $root.google.spanner.executor.v1.CloudInstanceConfigResponse.toObject(message.instanceConfigResponse, options, q + 1); return object; }; @@ -74442,19 +76678,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudBackupResponse.encode = function encode(message, writer) { + CloudBackupResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.listedBackups != null && message.listedBackups.length) for (var i = 0; i < message.listedBackups.length; ++i) - $root.google.spanner.admin.database.v1.Backup.encode(message.listedBackups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Backup.encode(message.listedBackups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.listedBackupOperations != null && message.listedBackupOperations.length) for (var i = 0; i < message.listedBackupOperations.length; ++i) - $root.google.longrunning.Operation.encode(message.listedBackupOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.listedBackupOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Backup.encode(message.backup, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -74468,7 +76708,7 @@ * @returns {$protobuf.Writer} Writer */ CloudBackupResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -74554,7 +76794,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.listedBackups != null && message.hasOwnProperty("listedBackups")) { + if (message.listedBackups != null && Object.hasOwnProperty.call(message, "listedBackups")) { if (!Array.isArray(message.listedBackups)) return "listedBackups: array expected"; for (var i = 0; i < message.listedBackups.length; ++i) { @@ -74563,7 +76803,7 @@ return "listedBackups." + error; } } - if (message.listedBackupOperations != null && message.hasOwnProperty("listedBackupOperations")) { + if (message.listedBackupOperations != null && Object.hasOwnProperty.call(message, "listedBackupOperations")) { if (!Array.isArray(message.listedBackupOperations)) return "listedBackupOperations: array expected"; for (var i = 0; i < message.listedBackupOperations.length; ++i) { @@ -74572,10 +76812,10 @@ return "listedBackupOperations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) { var error = $root.google.spanner.admin.database.v1.Backup.verify(message.backup, long + 1); if (error) return "backup." + error; @@ -74594,6 +76834,8 @@ CloudBackupResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CloudBackupResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CloudBackupResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74604,7 +76846,7 @@ throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackups: array expected"); message.listedBackups = []; for (var i = 0; i < object.listedBackups.length; ++i) { - if (typeof object.listedBackups[i] !== "object") + if (!$util.isObject(object.listedBackups[i])) throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackups: object expected"); message.listedBackups[i] = $root.google.spanner.admin.database.v1.Backup.fromObject(object.listedBackups[i], long + 1); } @@ -74614,7 +76856,7 @@ throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackupOperations: array expected"); message.listedBackupOperations = []; for (var i = 0; i < object.listedBackupOperations.length; ++i) { - if (typeof object.listedBackupOperations[i] !== "object") + if (!$util.isObject(object.listedBackupOperations[i])) throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.listedBackupOperations: object expected"); message.listedBackupOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedBackupOperations[i], long + 1); } @@ -74622,7 +76864,7 @@ if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.backup != null) { - if (typeof object.backup !== "object") + if (!$util.isObject(object.backup)) throw TypeError(".google.spanner.executor.v1.CloudBackupResponse.backup: object expected"); message.backup = $root.google.spanner.admin.database.v1.Backup.fromObject(object.backup, long + 1); } @@ -74638,9 +76880,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudBackupResponse.toObject = function toObject(message, options) { + CloudBackupResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.listedBackups = []; @@ -74653,17 +76899,17 @@ if (message.listedBackups && message.listedBackups.length) { object.listedBackups = []; for (var j = 0; j < message.listedBackups.length; ++j) - object.listedBackups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.listedBackups[j], options); + object.listedBackups[j] = $root.google.spanner.admin.database.v1.Backup.toObject(message.listedBackups[j], options, q + 1); } if (message.listedBackupOperations && message.listedBackupOperations.length) { object.listedBackupOperations = []; for (var j = 0; j < message.listedBackupOperations.length; ++j) - object.listedBackupOperations[j] = $root.google.longrunning.Operation.toObject(message.listedBackupOperations[j], options); + object.listedBackupOperations[j] = $root.google.longrunning.Operation.toObject(message.listedBackupOperations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + object.backup = $root.google.spanner.admin.database.v1.Backup.toObject(message.backup, options, q + 1); return object; }; @@ -74768,16 +77014,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationResponse.encode = function encode(message, writer) { + OperationResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.listedOperations != null && message.listedOperations.length) for (var i = 0; i < message.listedOperations.length; ++i) - $root.google.longrunning.Operation.encode(message.listedOperations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.listedOperations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - $root.google.longrunning.Operation.encode(message.operation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.operation, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -74791,7 +77041,7 @@ * @returns {$protobuf.Writer} Writer */ OperationResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -74871,7 +77121,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.listedOperations != null && message.hasOwnProperty("listedOperations")) { + if (message.listedOperations != null && Object.hasOwnProperty.call(message, "listedOperations")) { if (!Array.isArray(message.listedOperations)) return "listedOperations: array expected"; for (var i = 0; i < message.listedOperations.length; ++i) { @@ -74880,10 +77130,10 @@ return "listedOperations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.operation != null && message.hasOwnProperty("operation")) { + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) { var error = $root.google.longrunning.Operation.verify(message.operation, long + 1); if (error) return "operation." + error; @@ -74902,6 +77152,8 @@ OperationResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.OperationResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.OperationResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74912,7 +77164,7 @@ throw TypeError(".google.spanner.executor.v1.OperationResponse.listedOperations: array expected"); message.listedOperations = []; for (var i = 0; i < object.listedOperations.length; ++i) { - if (typeof object.listedOperations[i] !== "object") + if (!$util.isObject(object.listedOperations[i])) throw TypeError(".google.spanner.executor.v1.OperationResponse.listedOperations: object expected"); message.listedOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedOperations[i], long + 1); } @@ -74920,7 +77172,7 @@ if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.operation != null) { - if (typeof object.operation !== "object") + if (!$util.isObject(object.operation)) throw TypeError(".google.spanner.executor.v1.OperationResponse.operation: object expected"); message.operation = $root.google.longrunning.Operation.fromObject(object.operation, long + 1); } @@ -74936,9 +77188,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationResponse.toObject = function toObject(message, options) { + OperationResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.listedOperations = []; @@ -74949,12 +77205,12 @@ if (message.listedOperations && message.listedOperations.length) { object.listedOperations = []; for (var j = 0; j < message.listedOperations.length; ++j) - object.listedOperations[j] = $root.google.longrunning.Operation.toObject(message.listedOperations[j], options); + object.listedOperations[j] = $root.google.longrunning.Operation.toObject(message.listedOperations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = $root.google.longrunning.Operation.toObject(message.operation, options); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + object.operation = $root.google.longrunning.Operation.toObject(message.operation, options, q + 1); return object; }; @@ -75059,16 +77315,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudInstanceResponse.encode = function encode(message, writer) { + CloudInstanceResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.listedInstances != null && message.listedInstances.length) for (var i = 0; i < message.listedInstances.length; ++i) - $root.google.spanner.admin.instance.v1.Instance.encode(message.listedInstances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.Instance.encode(message.listedInstances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -75082,7 +77342,7 @@ * @returns {$protobuf.Writer} Writer */ CloudInstanceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -75162,7 +77422,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.listedInstances != null && message.hasOwnProperty("listedInstances")) { + if (message.listedInstances != null && Object.hasOwnProperty.call(message, "listedInstances")) { if (!Array.isArray(message.listedInstances)) return "listedInstances: array expected"; for (var i = 0; i < message.listedInstances.length; ++i) { @@ -75171,10 +77431,10 @@ return "listedInstances." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) { var error = $root.google.spanner.admin.instance.v1.Instance.verify(message.instance, long + 1); if (error) return "instance." + error; @@ -75193,6 +77453,8 @@ CloudInstanceResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CloudInstanceResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -75203,7 +77465,7 @@ throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.listedInstances: array expected"); message.listedInstances = []; for (var i = 0; i < object.listedInstances.length; ++i) { - if (typeof object.listedInstances[i] !== "object") + if (!$util.isObject(object.listedInstances[i])) throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.listedInstances: object expected"); message.listedInstances[i] = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.listedInstances[i], long + 1); } @@ -75211,7 +77473,7 @@ if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.instance != null) { - if (typeof object.instance !== "object") + if (!$util.isObject(object.instance)) throw TypeError(".google.spanner.executor.v1.CloudInstanceResponse.instance: object expected"); message.instance = $root.google.spanner.admin.instance.v1.Instance.fromObject(object.instance, long + 1); } @@ -75227,9 +77489,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudInstanceResponse.toObject = function toObject(message, options) { + CloudInstanceResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.listedInstances = []; @@ -75240,12 +77506,12 @@ if (message.listedInstances && message.listedInstances.length) { object.listedInstances = []; for (var j = 0; j < message.listedInstances.length; ++j) - object.listedInstances[j] = $root.google.spanner.admin.instance.v1.Instance.toObject(message.listedInstances[j], options); + object.listedInstances[j] = $root.google.spanner.admin.instance.v1.Instance.toObject(message.listedInstances[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + object.instance = $root.google.spanner.admin.instance.v1.Instance.toObject(message.instance, options, q + 1); return object; }; @@ -75350,16 +77616,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudInstanceConfigResponse.encode = function encode(message, writer) { + CloudInstanceConfigResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.listedInstanceConfigs != null && message.listedInstanceConfigs.length) for (var i = 0; i < message.listedInstanceConfigs.length; ++i) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.listedInstanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.listedInstanceConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) - $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.admin.instance.v1.InstanceConfig.encode(message.instanceConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -75373,7 +77643,7 @@ * @returns {$protobuf.Writer} Writer */ CloudInstanceConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -75453,7 +77723,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.listedInstanceConfigs != null && message.hasOwnProperty("listedInstanceConfigs")) { + if (message.listedInstanceConfigs != null && Object.hasOwnProperty.call(message, "listedInstanceConfigs")) { if (!Array.isArray(message.listedInstanceConfigs)) return "listedInstanceConfigs: array expected"; for (var i = 0; i < message.listedInstanceConfigs.length; ++i) { @@ -75462,10 +77732,10 @@ return "listedInstanceConfigs." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) { + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) { var error = $root.google.spanner.admin.instance.v1.InstanceConfig.verify(message.instanceConfig, long + 1); if (error) return "instanceConfig." + error; @@ -75484,6 +77754,8 @@ CloudInstanceConfigResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CloudInstanceConfigResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -75494,7 +77766,7 @@ throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.listedInstanceConfigs: array expected"); message.listedInstanceConfigs = []; for (var i = 0; i < object.listedInstanceConfigs.length; ++i) { - if (typeof object.listedInstanceConfigs[i] !== "object") + if (!$util.isObject(object.listedInstanceConfigs[i])) throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.listedInstanceConfigs: object expected"); message.listedInstanceConfigs[i] = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.listedInstanceConfigs[i], long + 1); } @@ -75502,7 +77774,7 @@ if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.instanceConfig != null) { - if (typeof object.instanceConfig !== "object") + if (!$util.isObject(object.instanceConfig)) throw TypeError(".google.spanner.executor.v1.CloudInstanceConfigResponse.instanceConfig: object expected"); message.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.fromObject(object.instanceConfig, long + 1); } @@ -75518,9 +77790,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudInstanceConfigResponse.toObject = function toObject(message, options) { + CloudInstanceConfigResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.listedInstanceConfigs = []; @@ -75531,12 +77807,12 @@ if (message.listedInstanceConfigs && message.listedInstanceConfigs.length) { object.listedInstanceConfigs = []; for (var j = 0; j < message.listedInstanceConfigs.length; ++j) - object.listedInstanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.listedInstanceConfigs[j], options); + object.listedInstanceConfigs[j] = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.listedInstanceConfigs[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; - if (message.instanceConfig != null && message.hasOwnProperty("instanceConfig")) - object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options); + if (message.instanceConfig != null && Object.hasOwnProperty.call(message, "instanceConfig")) + object.instanceConfig = $root.google.spanner.admin.instance.v1.InstanceConfig.toObject(message.instanceConfig, options, q + 1); return object; }; @@ -75651,19 +77927,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudDatabaseResponse.encode = function encode(message, writer) { + CloudDatabaseResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.listedDatabases != null && message.listedDatabases.length) for (var i = 0; i < message.listedDatabases.length; ++i) - $root.google.spanner.admin.database.v1.Database.encode(message.listedDatabases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Database.encode(message.listedDatabases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.listedDatabaseOperations != null && message.listedDatabaseOperations.length) for (var i = 0; i < message.listedDatabaseOperations.length; ++i) - $root.google.longrunning.Operation.encode(message.listedDatabaseOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.listedDatabaseOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); if (message.database != null && Object.hasOwnProperty.call(message, "database")) - $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.admin.database.v1.Database.encode(message.database, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -75677,7 +77957,7 @@ * @returns {$protobuf.Writer} Writer */ CloudDatabaseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -75763,7 +78043,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.listedDatabases != null && message.hasOwnProperty("listedDatabases")) { + if (message.listedDatabases != null && Object.hasOwnProperty.call(message, "listedDatabases")) { if (!Array.isArray(message.listedDatabases)) return "listedDatabases: array expected"; for (var i = 0; i < message.listedDatabases.length; ++i) { @@ -75772,7 +78052,7 @@ return "listedDatabases." + error; } } - if (message.listedDatabaseOperations != null && message.hasOwnProperty("listedDatabaseOperations")) { + if (message.listedDatabaseOperations != null && Object.hasOwnProperty.call(message, "listedDatabaseOperations")) { if (!Array.isArray(message.listedDatabaseOperations)) return "listedDatabaseOperations: array expected"; for (var i = 0; i < message.listedDatabaseOperations.length; ++i) { @@ -75781,10 +78061,10 @@ return "listedDatabaseOperations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; - if (message.database != null && message.hasOwnProperty("database")) { + if (message.database != null && Object.hasOwnProperty.call(message, "database")) { var error = $root.google.spanner.admin.database.v1.Database.verify(message.database, long + 1); if (error) return "database." + error; @@ -75803,6 +78083,8 @@ CloudDatabaseResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.CloudDatabaseResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -75813,7 +78095,7 @@ throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabases: array expected"); message.listedDatabases = []; for (var i = 0; i < object.listedDatabases.length; ++i) { - if (typeof object.listedDatabases[i] !== "object") + if (!$util.isObject(object.listedDatabases[i])) throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabases: object expected"); message.listedDatabases[i] = $root.google.spanner.admin.database.v1.Database.fromObject(object.listedDatabases[i], long + 1); } @@ -75823,7 +78105,7 @@ throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabaseOperations: array expected"); message.listedDatabaseOperations = []; for (var i = 0; i < object.listedDatabaseOperations.length; ++i) { - if (typeof object.listedDatabaseOperations[i] !== "object") + if (!$util.isObject(object.listedDatabaseOperations[i])) throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.listedDatabaseOperations: object expected"); message.listedDatabaseOperations[i] = $root.google.longrunning.Operation.fromObject(object.listedDatabaseOperations[i], long + 1); } @@ -75831,7 +78113,7 @@ if (object.nextPageToken != null) message.nextPageToken = String(object.nextPageToken); if (object.database != null) { - if (typeof object.database !== "object") + if (!$util.isObject(object.database)) throw TypeError(".google.spanner.executor.v1.CloudDatabaseResponse.database: object expected"); message.database = $root.google.spanner.admin.database.v1.Database.fromObject(object.database, long + 1); } @@ -75847,9 +78129,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudDatabaseResponse.toObject = function toObject(message, options) { + CloudDatabaseResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.listedDatabases = []; @@ -75862,17 +78148,17 @@ if (message.listedDatabases && message.listedDatabases.length) { object.listedDatabases = []; for (var j = 0; j < message.listedDatabases.length; ++j) - object.listedDatabases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.listedDatabases[j], options); + object.listedDatabases[j] = $root.google.spanner.admin.database.v1.Database.toObject(message.listedDatabases[j], options, q + 1); } if (message.listedDatabaseOperations && message.listedDatabaseOperations.length) { object.listedDatabaseOperations = []; for (var j = 0; j < message.listedDatabaseOperations.length; ++j) - object.listedDatabaseOperations[j] = $root.google.longrunning.Operation.toObject(message.listedDatabaseOperations[j], options); + object.listedDatabaseOperations[j] = $root.google.longrunning.Operation.toObject(message.listedDatabaseOperations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; - if (message.database != null && message.hasOwnProperty("database")) - object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + object.database = $root.google.spanner.admin.database.v1.Database.toObject(message.database, options, q + 1); return object; }; @@ -76016,9 +78302,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadResult.encode = function encode(message, writer) { + ReadResult.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); if (message.index != null && Object.hasOwnProperty.call(message, "index")) @@ -76027,9 +78317,9 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.requestIndex); if (message.row != null && message.row.length) for (var i = 0; i < message.row.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) - $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -76043,7 +78333,7 @@ * @returns {$protobuf.Writer} Writer */ ReadResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -76132,20 +78422,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) { + if (message.index != null && Object.hasOwnProperty.call(message, "index")) { properties._index = 1; if (!$util.isString(message.index)) return "index: string expected"; } - if (message.requestIndex != null && message.hasOwnProperty("requestIndex")) { + if (message.requestIndex != null && Object.hasOwnProperty.call(message, "requestIndex")) { properties._requestIndex = 1; if (!$util.isInteger(message.requestIndex)) return "requestIndex: integer expected"; } - if (message.row != null && message.hasOwnProperty("row")) { + if (message.row != null && Object.hasOwnProperty.call(message, "row")) { if (!Array.isArray(message.row)) return "row: array expected"; for (var i = 0; i < message.row.length; ++i) { @@ -76154,7 +78444,7 @@ return "row." + error; } } - if (message.rowType != null && message.hasOwnProperty("rowType")) { + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) { properties._rowType = 1; { var error = $root.google.spanner.v1.StructType.verify(message.rowType, long + 1); @@ -76176,6 +78466,8 @@ ReadResult.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ReadResult) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ReadResult: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -76192,13 +78484,13 @@ throw TypeError(".google.spanner.executor.v1.ReadResult.row: array expected"); message.row = []; for (var i = 0; i < object.row.length; ++i) { - if (typeof object.row[i] !== "object") + if (!$util.isObject(object.row[i])) throw TypeError(".google.spanner.executor.v1.ReadResult.row: object expected"); message.row[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.row[i], long + 1); } } if (object.rowType != null) { - if (typeof object.rowType !== "object") + if (!$util.isObject(object.rowType)) throw TypeError(".google.spanner.executor.v1.ReadResult.rowType: object expected"); message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType, long + 1); } @@ -76214,22 +78506,26 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadResult.toObject = function toObject(message, options) { + ReadResult.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.row = []; if (options.defaults) object.table = ""; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) { + if (message.index != null && Object.hasOwnProperty.call(message, "index")) { object.index = message.index; if (options.oneofs) object._index = "index"; } - if (message.requestIndex != null && message.hasOwnProperty("requestIndex")) { + if (message.requestIndex != null && Object.hasOwnProperty.call(message, "requestIndex")) { object.requestIndex = message.requestIndex; if (options.oneofs) object._requestIndex = "requestIndex"; @@ -76237,10 +78533,10 @@ if (message.row && message.row.length) { object.row = []; for (var j = 0; j < message.row.length; ++j) - object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options); + object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options, q + 1); } - if (message.rowType != null && message.hasOwnProperty("rowType")) { - object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) { + object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options, q + 1); if (options.oneofs) object._rowType = "rowType"; } @@ -76348,14 +78644,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryResult.encode = function encode(message, writer) { + QueryResult.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.row != null && message.row.length) for (var i = 0; i < message.row.length; ++i) - $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.ValueList.encode(message.row[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) - $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -76369,7 +78669,7 @@ * @returns {$protobuf.Writer} Writer */ QueryResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -76446,7 +78746,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.row != null && message.hasOwnProperty("row")) { + if (message.row != null && Object.hasOwnProperty.call(message, "row")) { if (!Array.isArray(message.row)) return "row: array expected"; for (var i = 0; i < message.row.length; ++i) { @@ -76455,7 +78755,7 @@ return "row." + error; } } - if (message.rowType != null && message.hasOwnProperty("rowType")) { + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) { properties._rowType = 1; { var error = $root.google.spanner.v1.StructType.verify(message.rowType, long + 1); @@ -76477,6 +78777,8 @@ QueryResult.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.QueryResult) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.QueryResult: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -76487,13 +78789,13 @@ throw TypeError(".google.spanner.executor.v1.QueryResult.row: array expected"); message.row = []; for (var i = 0; i < object.row.length; ++i) { - if (typeof object.row[i] !== "object") + if (!$util.isObject(object.row[i])) throw TypeError(".google.spanner.executor.v1.QueryResult.row: object expected"); message.row[i] = $root.google.spanner.executor.v1.ValueList.fromObject(object.row[i], long + 1); } } if (object.rowType != null) { - if (typeof object.rowType !== "object") + if (!$util.isObject(object.rowType)) throw TypeError(".google.spanner.executor.v1.QueryResult.rowType: object expected"); message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType, long + 1); } @@ -76509,19 +78811,23 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryResult.toObject = function toObject(message, options) { + QueryResult.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.row = []; if (message.row && message.row.length) { object.row = []; for (var j = 0; j < message.row.length; ++j) - object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options); + object.row[j] = $root.google.spanner.executor.v1.ValueList.toObject(message.row[j], options, q + 1); } - if (message.rowType != null && message.hasOwnProperty("rowType")) { - object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) { + object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options, q + 1); if (options.oneofs) object._rowType = "rowType"; } @@ -76642,15 +78948,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChangeStreamRecord.encode = function encode(message, writer) { + ChangeStreamRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.dataChange != null && Object.hasOwnProperty.call(message, "dataChange")) - $root.google.spanner.executor.v1.DataChangeRecord.encode(message.dataChange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.DataChangeRecord.encode(message.dataChange, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.childPartition != null && Object.hasOwnProperty.call(message, "childPartition")) - $root.google.spanner.executor.v1.ChildPartitionsRecord.encode(message.childPartition, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.executor.v1.ChildPartitionsRecord.encode(message.childPartition, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) - $root.google.spanner.executor.v1.HeartbeatRecord.encode(message.heartbeat, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.HeartbeatRecord.encode(message.heartbeat, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -76664,7 +78974,7 @@ * @returns {$protobuf.Writer} Writer */ ChangeStreamRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -76743,7 +79053,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.dataChange != null && message.hasOwnProperty("dataChange")) { + if (message.dataChange != null && Object.hasOwnProperty.call(message, "dataChange")) { properties.record = 1; { var error = $root.google.spanner.executor.v1.DataChangeRecord.verify(message.dataChange, long + 1); @@ -76751,7 +79061,7 @@ return "dataChange." + error; } } - if (message.childPartition != null && message.hasOwnProperty("childPartition")) { + if (message.childPartition != null && Object.hasOwnProperty.call(message, "childPartition")) { if (properties.record === 1) return "record: multiple values"; properties.record = 1; @@ -76761,7 +79071,7 @@ return "childPartition." + error; } } - if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { + if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) { if (properties.record === 1) return "record: multiple values"; properties.record = 1; @@ -76785,23 +79095,25 @@ ChangeStreamRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ChangeStreamRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.ChangeStreamRecord(); if (object.dataChange != null) { - if (typeof object.dataChange !== "object") + if (!$util.isObject(object.dataChange)) throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.dataChange: object expected"); message.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.fromObject(object.dataChange, long + 1); } if (object.childPartition != null) { - if (typeof object.childPartition !== "object") + if (!$util.isObject(object.childPartition)) throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.childPartition: object expected"); message.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.fromObject(object.childPartition, long + 1); } if (object.heartbeat != null) { - if (typeof object.heartbeat !== "object") + if (!$util.isObject(object.heartbeat)) throw TypeError(".google.spanner.executor.v1.ChangeStreamRecord.heartbeat: object expected"); message.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.fromObject(object.heartbeat, long + 1); } @@ -76817,22 +79129,26 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChangeStreamRecord.toObject = function toObject(message, options) { + ChangeStreamRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.dataChange != null && message.hasOwnProperty("dataChange")) { - object.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.toObject(message.dataChange, options); + if (message.dataChange != null && Object.hasOwnProperty.call(message, "dataChange")) { + object.dataChange = $root.google.spanner.executor.v1.DataChangeRecord.toObject(message.dataChange, options, q + 1); if (options.oneofs) object.record = "dataChange"; } - if (message.childPartition != null && message.hasOwnProperty("childPartition")) { - object.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.toObject(message.childPartition, options); + if (message.childPartition != null && Object.hasOwnProperty.call(message, "childPartition")) { + object.childPartition = $root.google.spanner.executor.v1.ChildPartitionsRecord.toObject(message.childPartition, options, q + 1); if (options.oneofs) object.record = "childPartition"; } - if (message.heartbeat != null && message.hasOwnProperty("heartbeat")) { - object.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.toObject(message.heartbeat, options); + if (message.heartbeat != null && Object.hasOwnProperty.call(message, "heartbeat")) { + object.heartbeat = $root.google.spanner.executor.v1.HeartbeatRecord.toObject(message.heartbeat, options, q + 1); if (options.oneofs) object.record = "heartbeat"; } @@ -77031,11 +79347,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataChangeRecord.encode = function encode(message, writer) { + DataChangeRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) - $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) @@ -77046,10 +79366,10 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.table); if (message.columnTypes != null && message.columnTypes.length) for (var i = 0; i < message.columnTypes.length; ++i) - $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.encode(message.columnTypes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.encode(message.columnTypes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.mods != null && message.mods.length) for (var i = 0; i < message.mods.length; ++i) - $root.google.spanner.executor.v1.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.executor.v1.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.modType); if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) @@ -77075,7 +79395,7 @@ * @returns {$protobuf.Writer} Writer */ DataChangeRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -77197,24 +79517,24 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) { var error = $root.google.protobuf.Timestamp.verify(message.commitTime, long + 1); if (error) return "commitTime." + error; } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) if (!$util.isString(message.recordSequence)) return "recordSequence: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) if (!$util.isString(message.transactionId)) return "transactionId: string expected"; - if (message.isLastRecord != null && message.hasOwnProperty("isLastRecord")) + if (message.isLastRecord != null && Object.hasOwnProperty.call(message, "isLastRecord")) if (typeof message.isLastRecord !== "boolean") return "isLastRecord: boolean expected"; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.columnTypes != null && message.hasOwnProperty("columnTypes")) { + if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes")) { if (!Array.isArray(message.columnTypes)) return "columnTypes: array expected"; for (var i = 0; i < message.columnTypes.length; ++i) { @@ -77223,7 +79543,7 @@ return "columnTypes." + error; } } - if (message.mods != null && message.hasOwnProperty("mods")) { + if (message.mods != null && Object.hasOwnProperty.call(message, "mods")) { if (!Array.isArray(message.mods)) return "mods: array expected"; for (var i = 0; i < message.mods.length; ++i) { @@ -77232,22 +79552,22 @@ return "mods." + error; } } - if (message.modType != null && message.hasOwnProperty("modType")) + if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) if (!$util.isString(message.modType)) return "modType: string expected"; - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) if (!$util.isString(message.valueCaptureType)) return "valueCaptureType: string expected"; - if (message.recordCount != null && message.hasOwnProperty("recordCount")) + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) if (!$util.isInteger(message.recordCount) && !(message.recordCount && $util.isInteger(message.recordCount.low) && $util.isInteger(message.recordCount.high))) return "recordCount: integer|Long expected"; - if (message.partitionCount != null && message.hasOwnProperty("partitionCount")) + if (message.partitionCount != null && Object.hasOwnProperty.call(message, "partitionCount")) if (!$util.isInteger(message.partitionCount) && !(message.partitionCount && $util.isInteger(message.partitionCount.low) && $util.isInteger(message.partitionCount.high))) return "partitionCount: integer|Long expected"; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) if (!$util.isString(message.transactionTag)) return "transactionTag: string expected"; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) if (typeof message.isSystemTransaction !== "boolean") return "isSystemTransaction: boolean expected"; return null; @@ -77264,13 +79584,15 @@ DataChangeRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DataChangeRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.DataChangeRecord(); if (object.commitTime != null) { - if (typeof object.commitTime !== "object") + if (!$util.isObject(object.commitTime)) throw TypeError(".google.spanner.executor.v1.DataChangeRecord.commitTime: object expected"); message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime, long + 1); } @@ -77287,7 +79609,7 @@ throw TypeError(".google.spanner.executor.v1.DataChangeRecord.columnTypes: array expected"); message.columnTypes = []; for (var i = 0; i < object.columnTypes.length; ++i) { - if (typeof object.columnTypes[i] !== "object") + if (!$util.isObject(object.columnTypes[i])) throw TypeError(".google.spanner.executor.v1.DataChangeRecord.columnTypes: object expected"); message.columnTypes[i] = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.fromObject(object.columnTypes[i], long + 1); } @@ -77297,7 +79619,7 @@ throw TypeError(".google.spanner.executor.v1.DataChangeRecord.mods: array expected"); message.mods = []; for (var i = 0; i < object.mods.length; ++i) { - if (typeof object.mods[i] !== "object") + if (!$util.isObject(object.mods[i])) throw TypeError(".google.spanner.executor.v1.DataChangeRecord.mods: object expected"); message.mods[i] = $root.google.spanner.executor.v1.DataChangeRecord.Mod.fromObject(object.mods[i], long + 1); } @@ -77308,7 +79630,7 @@ message.valueCaptureType = String(object.valueCaptureType); if (object.recordCount != null) if ($util.Long) - (message.recordCount = $util.Long.fromValue(object.recordCount)).unsigned = false; + message.recordCount = $util.Long.fromValue(object.recordCount, false); else if (typeof object.recordCount === "string") message.recordCount = parseInt(object.recordCount, 10); else if (typeof object.recordCount === "number") @@ -77317,7 +79639,7 @@ message.recordCount = new $util.LongBits(object.recordCount.low >>> 0, object.recordCount.high >>> 0).toNumber(); if (object.partitionCount != null) if ($util.Long) - (message.partitionCount = $util.Long.fromValue(object.partitionCount)).unsigned = false; + message.partitionCount = $util.Long.fromValue(object.partitionCount, false); else if (typeof object.partitionCount === "string") message.partitionCount = parseInt(object.partitionCount, 10); else if (typeof object.partitionCount === "number") @@ -77340,9 +79662,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataChangeRecord.toObject = function toObject(message, options) { + DataChangeRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.columnTypes = []; @@ -77358,54 +79684,58 @@ object.valueCaptureType = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.recordCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.recordCount = options.longs === String ? "0" : 0; + object.recordCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.partitionCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.partitionCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.partitionCount = options.longs === String ? "0" : 0; + object.partitionCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.transactionTag = ""; object.isSystemTransaction = false; } - if (message.commitTime != null && message.hasOwnProperty("commitTime")) - object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options, q + 1); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) object.recordSequence = message.recordSequence; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) object.transactionId = message.transactionId; - if (message.isLastRecord != null && message.hasOwnProperty("isLastRecord")) + if (message.isLastRecord != null && Object.hasOwnProperty.call(message, "isLastRecord")) object.isLastRecord = message.isLastRecord; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; if (message.columnTypes && message.columnTypes.length) { object.columnTypes = []; for (var j = 0; j < message.columnTypes.length; ++j) - object.columnTypes[j] = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.toObject(message.columnTypes[j], options); + object.columnTypes[j] = $root.google.spanner.executor.v1.DataChangeRecord.ColumnType.toObject(message.columnTypes[j], options, q + 1); } if (message.mods && message.mods.length) { object.mods = []; for (var j = 0; j < message.mods.length; ++j) - object.mods[j] = $root.google.spanner.executor.v1.DataChangeRecord.Mod.toObject(message.mods[j], options); + object.mods[j] = $root.google.spanner.executor.v1.DataChangeRecord.Mod.toObject(message.mods[j], options, q + 1); } - if (message.modType != null && message.hasOwnProperty("modType")) + if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) object.modType = message.modType; - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) object.valueCaptureType = message.valueCaptureType; - if (message.recordCount != null && message.hasOwnProperty("recordCount")) - if (typeof message.recordCount === "number") + if (message.recordCount != null && Object.hasOwnProperty.call(message, "recordCount")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.recordCount = typeof message.recordCount === "number" ? BigInt(message.recordCount) : $util.Long.fromBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0, false).toBigInt(); + else if (typeof message.recordCount === "number") object.recordCount = options.longs === String ? String(message.recordCount) : message.recordCount; else object.recordCount = options.longs === String ? $util.Long.prototype.toString.call(message.recordCount) : options.longs === Number ? new $util.LongBits(message.recordCount.low >>> 0, message.recordCount.high >>> 0).toNumber() : message.recordCount; - if (message.partitionCount != null && message.hasOwnProperty("partitionCount")) - if (typeof message.partitionCount === "number") + if (message.partitionCount != null && Object.hasOwnProperty.call(message, "partitionCount")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.partitionCount = typeof message.partitionCount === "number" ? BigInt(message.partitionCount) : $util.Long.fromBits(message.partitionCount.low >>> 0, message.partitionCount.high >>> 0, false).toBigInt(); + else if (typeof message.partitionCount === "number") object.partitionCount = options.longs === String ? String(message.partitionCount) : message.partitionCount; else object.partitionCount = options.longs === String ? $util.Long.prototype.toString.call(message.partitionCount) : options.longs === Number ? new $util.LongBits(message.partitionCount.low >>> 0, message.partitionCount.high >>> 0).toNumber() : message.partitionCount; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) object.transactionTag = message.transactionTag; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) object.isSystemTransaction = message.isSystemTransaction; return object; }; @@ -77516,9 +79846,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ColumnType.encode = function encode(message, writer) { + ColumnType.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -77540,7 +79874,7 @@ * @returns {$protobuf.Writer} Writer */ ColumnType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -77622,16 +79956,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) if (typeof message.isPrimaryKey !== "boolean") return "isPrimaryKey: boolean expected"; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) if (!$util.isInteger(message.ordinalPosition) && !(message.ordinalPosition && $util.isInteger(message.ordinalPosition.low) && $util.isInteger(message.ordinalPosition.high))) return "ordinalPosition: integer|Long expected"; return null; @@ -77648,6 +79982,8 @@ ColumnType.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord.ColumnType) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DataChangeRecord.ColumnType: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77661,7 +79997,7 @@ message.isPrimaryKey = Boolean(object.isPrimaryKey); if (object.ordinalPosition != null) if ($util.Long) - (message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition)).unsigned = false; + message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition, false); else if (typeof object.ordinalPosition === "string") message.ordinalPosition = parseInt(object.ordinalPosition, 10); else if (typeof object.ordinalPosition === "number") @@ -77680,9 +80016,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ColumnType.toObject = function toObject(message, options) { + ColumnType.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -77690,18 +80030,20 @@ object.isPrimaryKey = false; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.ordinalPosition = options.longs === String ? "0" : 0; + object.ordinalPosition = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = message.type; - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) object.isPrimaryKey = message.isPrimaryKey; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) - if (typeof message.ordinalPosition === "number") + if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.ordinalPosition = typeof message.ordinalPosition === "number" ? BigInt(message.ordinalPosition) : $util.Long.fromBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0, false).toBigInt(); + else if (typeof message.ordinalPosition === "number") object.ordinalPosition = options.longs === String ? String(message.ordinalPosition) : message.ordinalPosition; else object.ordinalPosition = options.longs === String ? $util.Long.prototype.toString.call(message.ordinalPosition) : options.longs === Number ? new $util.LongBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0).toNumber() : message.ordinalPosition; @@ -77808,9 +80150,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Mod.encode = function encode(message, writer) { + Mod.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.keys); if (message.newValues != null && Object.hasOwnProperty.call(message, "newValues")) @@ -77830,7 +80176,7 @@ * @returns {$protobuf.Writer} Writer */ Mod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -77908,13 +80254,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.keys != null && message.hasOwnProperty("keys")) + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) if (!$util.isString(message.keys)) return "keys: string expected"; - if (message.newValues != null && message.hasOwnProperty("newValues")) + if (message.newValues != null && Object.hasOwnProperty.call(message, "newValues")) if (!$util.isString(message.newValues)) return "newValues: string expected"; - if (message.oldValues != null && message.hasOwnProperty("oldValues")) + if (message.oldValues != null && Object.hasOwnProperty.call(message, "oldValues")) if (!$util.isString(message.oldValues)) return "oldValues: string expected"; return null; @@ -77931,6 +80277,8 @@ Mod.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.DataChangeRecord.Mod) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.DataChangeRecord.Mod: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77954,20 +80302,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Mod.toObject = function toObject(message, options) { + Mod.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.keys = ""; object.newValues = ""; object.oldValues = ""; } - if (message.keys != null && message.hasOwnProperty("keys")) + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) object.keys = message.keys; - if (message.newValues != null && message.hasOwnProperty("newValues")) + if (message.newValues != null && Object.hasOwnProperty.call(message, "newValues")) object.newValues = message.newValues; - if (message.oldValues != null && message.hasOwnProperty("oldValues")) + if (message.oldValues != null && Object.hasOwnProperty.call(message, "oldValues")) object.oldValues = message.oldValues; return object; }; @@ -78076,16 +80428,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChildPartitionsRecord.encode = function encode(message, writer) { + ChildPartitionsRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); if (message.childPartitions != null && message.childPartitions.length) for (var i = 0; i < message.childPartitions.length; ++i) - $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.encode(message.childPartitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.encode(message.childPartitions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -78099,7 +80455,7 @@ * @returns {$protobuf.Writer} Writer */ ChildPartitionsRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -78179,15 +80535,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) { var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); if (error) return "startTime." + error; } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) if (!$util.isString(message.recordSequence)) return "recordSequence: string expected"; - if (message.childPartitions != null && message.hasOwnProperty("childPartitions")) { + if (message.childPartitions != null && Object.hasOwnProperty.call(message, "childPartitions")) { if (!Array.isArray(message.childPartitions)) return "childPartitions: array expected"; for (var i = 0; i < message.childPartitions.length; ++i) { @@ -78210,13 +80566,15 @@ ChildPartitionsRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ChildPartitionsRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.ChildPartitionsRecord(); if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } @@ -78227,7 +80585,7 @@ throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.childPartitions: array expected"); message.childPartitions = []; for (var i = 0; i < object.childPartitions.length; ++i) { - if (typeof object.childPartitions[i] !== "object") + if (!$util.isObject(object.childPartitions[i])) throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.childPartitions: object expected"); message.childPartitions[i] = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.fromObject(object.childPartitions[i], long + 1); } @@ -78244,9 +80602,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChildPartitionsRecord.toObject = function toObject(message, options) { + ChildPartitionsRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.childPartitions = []; @@ -78254,14 +80616,14 @@ object.startTime = null; object.recordSequence = ""; } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) object.recordSequence = message.recordSequence; if (message.childPartitions && message.childPartitions.length) { object.childPartitions = []; for (var j = 0; j < message.childPartitions.length; ++j) - object.childPartitions[j] = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.toObject(message.childPartitions[j], options); + object.childPartitions[j] = $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition.toObject(message.childPartitions[j], options, q + 1); } return object; }; @@ -78355,9 +80717,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChildPartition.encode = function encode(message, writer) { + ChildPartition.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.token != null && Object.hasOwnProperty.call(message, "token")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); if (message.parentPartitionTokens != null && message.parentPartitionTokens.length) @@ -78376,7 +80742,7 @@ * @returns {$protobuf.Writer} Writer */ ChildPartition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -78452,10 +80818,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.token != null && message.hasOwnProperty("token")) + if (message.token != null && Object.hasOwnProperty.call(message, "token")) if (!$util.isString(message.token)) return "token: string expected"; - if (message.parentPartitionTokens != null && message.hasOwnProperty("parentPartitionTokens")) { + if (message.parentPartitionTokens != null && Object.hasOwnProperty.call(message, "parentPartitionTokens")) { if (!Array.isArray(message.parentPartitionTokens)) return "parentPartitionTokens: array expected"; for (var i = 0; i < message.parentPartitionTokens.length; ++i) @@ -78476,6 +80842,8 @@ ChildPartition.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.ChildPartitionsRecord.ChildPartition: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -78502,15 +80870,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChildPartition.toObject = function toObject(message, options) { + ChildPartition.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.parentPartitionTokens = []; if (options.defaults) object.token = ""; - if (message.token != null && message.hasOwnProperty("token")) + if (message.token != null && Object.hasOwnProperty.call(message, "token")) object.token = message.token; if (message.parentPartitionTokens && message.parentPartitionTokens.length) { object.parentPartitionTokens = []; @@ -78605,11 +80977,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HeartbeatRecord.encode = function encode(message, writer) { + HeartbeatRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.heartbeatTime != null && Object.hasOwnProperty.call(message, "heartbeatTime")) - $root.google.protobuf.Timestamp.encode(message.heartbeatTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.heartbeatTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -78623,7 +80999,7 @@ * @returns {$protobuf.Writer} Writer */ HeartbeatRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -78693,7 +81069,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.heartbeatTime != null && message.hasOwnProperty("heartbeatTime")) { + if (message.heartbeatTime != null && Object.hasOwnProperty.call(message, "heartbeatTime")) { var error = $root.google.protobuf.Timestamp.verify(message.heartbeatTime, long + 1); if (error) return "heartbeatTime." + error; @@ -78712,13 +81088,15 @@ HeartbeatRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.HeartbeatRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.HeartbeatRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.HeartbeatRecord(); if (object.heartbeatTime != null) { - if (typeof object.heartbeatTime !== "object") + if (!$util.isObject(object.heartbeatTime)) throw TypeError(".google.spanner.executor.v1.HeartbeatRecord.heartbeatTime: object expected"); message.heartbeatTime = $root.google.protobuf.Timestamp.fromObject(object.heartbeatTime, long + 1); } @@ -78734,14 +81112,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HeartbeatRecord.toObject = function toObject(message, options) { + HeartbeatRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.heartbeatTime = null; - if (message.heartbeatTime != null && message.hasOwnProperty("heartbeatTime")) - object.heartbeatTime = $root.google.protobuf.Timestamp.toObject(message.heartbeatTime, options); + if (message.heartbeatTime != null && Object.hasOwnProperty.call(message, "heartbeatTime")) + object.heartbeatTime = $root.google.protobuf.Timestamp.toObject(message.heartbeatTime, options, q + 1); return object; }; @@ -78827,11 +81209,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpannerOptions.encode = function encode(message, writer) { + SpannerOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sessionPoolOptions != null && Object.hasOwnProperty.call(message, "sessionPoolOptions")) - $root.google.spanner.executor.v1.SessionPoolOptions.encode(message.sessionPoolOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.executor.v1.SessionPoolOptions.encode(message.sessionPoolOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -78845,7 +81231,7 @@ * @returns {$protobuf.Writer} Writer */ SpannerOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -78915,7 +81301,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) { + if (message.sessionPoolOptions != null && Object.hasOwnProperty.call(message, "sessionPoolOptions")) { var error = $root.google.spanner.executor.v1.SessionPoolOptions.verify(message.sessionPoolOptions, long + 1); if (error) return "sessionPoolOptions." + error; @@ -78934,13 +81320,15 @@ SpannerOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.SpannerOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.SpannerOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.executor.v1.SpannerOptions(); if (object.sessionPoolOptions != null) { - if (typeof object.sessionPoolOptions !== "object") + if (!$util.isObject(object.sessionPoolOptions)) throw TypeError(".google.spanner.executor.v1.SpannerOptions.sessionPoolOptions: object expected"); message.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.fromObject(object.sessionPoolOptions, long + 1); } @@ -78956,14 +81344,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpannerOptions.toObject = function toObject(message, options) { + SpannerOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.sessionPoolOptions = null; - if (message.sessionPoolOptions != null && message.hasOwnProperty("sessionPoolOptions")) - object.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.toObject(message.sessionPoolOptions, options); + if (message.sessionPoolOptions != null && Object.hasOwnProperty.call(message, "sessionPoolOptions")) + object.sessionPoolOptions = $root.google.spanner.executor.v1.SessionPoolOptions.toObject(message.sessionPoolOptions, options, q + 1); return object; }; @@ -79049,9 +81441,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SessionPoolOptions.encode = function encode(message, writer) { + SessionPoolOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.useMultiplexed != null && Object.hasOwnProperty.call(message, "useMultiplexed")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useMultiplexed); return writer; @@ -79067,7 +81463,7 @@ * @returns {$protobuf.Writer} Writer */ SessionPoolOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -79137,7 +81533,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) + if (message.useMultiplexed != null && Object.hasOwnProperty.call(message, "useMultiplexed")) if (typeof message.useMultiplexed !== "boolean") return "useMultiplexed: boolean expected"; return null; @@ -79154,6 +81550,8 @@ SessionPoolOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.executor.v1.SessionPoolOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.executor.v1.SessionPoolOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79173,13 +81571,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SessionPoolOptions.toObject = function toObject(message, options) { + SessionPoolOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.useMultiplexed = false; - if (message.useMultiplexed != null && message.hasOwnProperty("useMultiplexed")) + if (message.useMultiplexed != null && Object.hasOwnProperty.call(message, "useMultiplexed")) object.useMultiplexed = message.useMultiplexed; return object; }; @@ -79280,7 +81682,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.createSession = function createSession(request, callback) { - return this.rpcCall(createSession, $root.google.spanner.v1.CreateSessionRequest, $root.google.spanner.v1.Session, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createSession, $root.google.spanner.v1.CreateSessionRequest, $root.google.spanner.v1.Session, request, callback); }, "name", { value: "CreateSession" }); /** @@ -79313,7 +81715,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.batchCreateSessions = function batchCreateSessions(request, callback) { - return this.rpcCall(batchCreateSessions, $root.google.spanner.v1.BatchCreateSessionsRequest, $root.google.spanner.v1.BatchCreateSessionsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, batchCreateSessions, $root.google.spanner.v1.BatchCreateSessionsRequest, $root.google.spanner.v1.BatchCreateSessionsResponse, request, callback); }, "name", { value: "BatchCreateSessions" }); /** @@ -79346,7 +81748,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.getSession = function getSession(request, callback) { - return this.rpcCall(getSession, $root.google.spanner.v1.GetSessionRequest, $root.google.spanner.v1.Session, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getSession, $root.google.spanner.v1.GetSessionRequest, $root.google.spanner.v1.Session, request, callback); }, "name", { value: "GetSession" }); /** @@ -79379,7 +81781,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.listSessions = function listSessions(request, callback) { - return this.rpcCall(listSessions, $root.google.spanner.v1.ListSessionsRequest, $root.google.spanner.v1.ListSessionsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listSessions, $root.google.spanner.v1.ListSessionsRequest, $root.google.spanner.v1.ListSessionsResponse, request, callback); }, "name", { value: "ListSessions" }); /** @@ -79412,7 +81814,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.deleteSession = function deleteSession(request, callback) { - return this.rpcCall(deleteSession, $root.google.spanner.v1.DeleteSessionRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteSession, $root.google.spanner.v1.DeleteSessionRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteSession" }); /** @@ -79445,7 +81847,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.ResultSet, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, executeSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.ResultSet, request, callback); }, "name", { value: "ExecuteSql" }); /** @@ -79478,7 +81880,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.executeStreamingSql = function executeStreamingSql(request, callback) { - return this.rpcCall(executeStreamingSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.PartialResultSet, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, executeStreamingSql, $root.google.spanner.v1.ExecuteSqlRequest, $root.google.spanner.v1.PartialResultSet, request, callback); }, "name", { value: "ExecuteStreamingSql" }); /** @@ -79511,7 +81913,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.executeBatchDml = function executeBatchDml(request, callback) { - return this.rpcCall(executeBatchDml, $root.google.spanner.v1.ExecuteBatchDmlRequest, $root.google.spanner.v1.ExecuteBatchDmlResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, executeBatchDml, $root.google.spanner.v1.ExecuteBatchDmlRequest, $root.google.spanner.v1.ExecuteBatchDmlResponse, request, callback); }, "name", { value: "ExecuteBatchDml" }); /** @@ -79544,7 +81946,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.read = function read(request, callback) { - return this.rpcCall(read, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.ResultSet, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, read, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.ResultSet, request, callback); }, "name", { value: "Read" }); /** @@ -79577,7 +81979,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.streamingRead = function streamingRead(request, callback) { - return this.rpcCall(streamingRead, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.PartialResultSet, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, streamingRead, $root.google.spanner.v1.ReadRequest, $root.google.spanner.v1.PartialResultSet, request, callback); }, "name", { value: "StreamingRead" }); /** @@ -79610,7 +82012,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.beginTransaction = function beginTransaction(request, callback) { - return this.rpcCall(beginTransaction, $root.google.spanner.v1.BeginTransactionRequest, $root.google.spanner.v1.Transaction, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, beginTransaction, $root.google.spanner.v1.BeginTransactionRequest, $root.google.spanner.v1.Transaction, request, callback); }, "name", { value: "BeginTransaction" }); /** @@ -79643,7 +82045,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.commit = function commit(request, callback) { - return this.rpcCall(commit, $root.google.spanner.v1.CommitRequest, $root.google.spanner.v1.CommitResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, commit, $root.google.spanner.v1.CommitRequest, $root.google.spanner.v1.CommitResponse, request, callback); }, "name", { value: "Commit" }); /** @@ -79676,7 +82078,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.rollback = function rollback(request, callback) { - return this.rpcCall(rollback, $root.google.spanner.v1.RollbackRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rollback, $root.google.spanner.v1.RollbackRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "Rollback" }); /** @@ -79709,7 +82111,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.partitionQuery = function partitionQuery(request, callback) { - return this.rpcCall(partitionQuery, $root.google.spanner.v1.PartitionQueryRequest, $root.google.spanner.v1.PartitionResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, partitionQuery, $root.google.spanner.v1.PartitionQueryRequest, $root.google.spanner.v1.PartitionResponse, request, callback); }, "name", { value: "PartitionQuery" }); /** @@ -79742,7 +82144,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.partitionRead = function partitionRead(request, callback) { - return this.rpcCall(partitionRead, $root.google.spanner.v1.PartitionReadRequest, $root.google.spanner.v1.PartitionResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, partitionRead, $root.google.spanner.v1.PartitionReadRequest, $root.google.spanner.v1.PartitionResponse, request, callback); }, "name", { value: "PartitionRead" }); /** @@ -79775,7 +82177,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.batchWrite = function batchWrite(request, callback) { - return this.rpcCall(batchWrite, $root.google.spanner.v1.BatchWriteRequest, $root.google.spanner.v1.BatchWriteResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, batchWrite, $root.google.spanner.v1.BatchWriteRequest, $root.google.spanner.v1.BatchWriteResponse, request, callback); }, "name", { value: "BatchWrite" }); /** @@ -79808,7 +82210,7 @@ * @variation 1 */ Object.defineProperty(Spanner.prototype.fetchCacheUpdate = function fetchCacheUpdate(request, callback) { - return this.rpcCall(fetchCacheUpdate, $root.google.spanner.v1.FetchCacheUpdateRequest, $root.google.spanner.v1.CacheUpdate, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, fetchCacheUpdate, $root.google.spanner.v1.FetchCacheUpdateRequest, $root.google.spanner.v1.CacheUpdate, request, callback); }, "name", { value: "FetchCacheUpdate" }); /** @@ -79886,13 +82288,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSessionRequest.encode = function encode(message, writer) { + CreateSessionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.session != null && Object.hasOwnProperty.call(message, "session")) - $root.google.spanner.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -79906,7 +82312,7 @@ * @returns {$protobuf.Writer} Writer */ CreateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -79980,10 +82386,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.session != null && message.hasOwnProperty("session")) { + if (message.session != null && Object.hasOwnProperty.call(message, "session")) { var error = $root.google.spanner.v1.Session.verify(message.session, long + 1); if (error) return "session." + error; @@ -80002,6 +82408,8 @@ CreateSessionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.CreateSessionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.CreateSessionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80010,7 +82418,7 @@ if (object.database != null) message.database = String(object.database); if (object.session != null) { - if (typeof object.session !== "object") + if (!$util.isObject(object.session)) throw TypeError(".google.spanner.v1.CreateSessionRequest.session: object expected"); message.session = $root.google.spanner.v1.Session.fromObject(object.session, long + 1); } @@ -80026,18 +82434,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSessionRequest.toObject = function toObject(message, options) { + CreateSessionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.database = ""; object.session = null; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.session != null && message.hasOwnProperty("session")) - object.session = $root.google.spanner.v1.Session.toObject(message.session, options); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + object.session = $root.google.spanner.v1.Session.toObject(message.session, options, q + 1); return object; }; @@ -80141,13 +82553,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateSessionsRequest.encode = function encode(message, writer) { + BatchCreateSessionsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) - $root.google.spanner.v1.Session.encode(message.sessionTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Session.encode(message.sessionTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sessionCount); return writer; @@ -80163,7 +82579,7 @@ * @returns {$protobuf.Writer} Writer */ BatchCreateSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -80241,15 +82657,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { + if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) { var error = $root.google.spanner.v1.Session.verify(message.sessionTemplate, long + 1); if (error) return "sessionTemplate." + error; } - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) if (!$util.isInteger(message.sessionCount)) return "sessionCount: integer expected"; return null; @@ -80266,6 +82682,8 @@ BatchCreateSessionsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.BatchCreateSessionsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.BatchCreateSessionsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80274,7 +82692,7 @@ if (object.database != null) message.database = String(object.database); if (object.sessionTemplate != null) { - if (typeof object.sessionTemplate !== "object") + if (!$util.isObject(object.sessionTemplate)) throw TypeError(".google.spanner.v1.BatchCreateSessionsRequest.sessionTemplate: object expected"); message.sessionTemplate = $root.google.spanner.v1.Session.fromObject(object.sessionTemplate, long + 1); } @@ -80292,20 +82710,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateSessionsRequest.toObject = function toObject(message, options) { + BatchCreateSessionsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.database = ""; object.sessionTemplate = null; object.sessionCount = 0; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) - object.sessionTemplate = $root.google.spanner.v1.Session.toObject(message.sessionTemplate, options); - if (message.sessionCount != null && message.hasOwnProperty("sessionCount")) + if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) + object.sessionTemplate = $root.google.spanner.v1.Session.toObject(message.sessionTemplate, options, q + 1); + if (message.sessionCount != null && Object.hasOwnProperty.call(message, "sessionCount")) object.sessionCount = message.sessionCount; return object; }; @@ -80393,12 +82815,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateSessionsResponse.encode = function encode(message, writer) { + BatchCreateSessionsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && message.session.length) for (var i = 0; i < message.session.length; ++i) - $root.google.spanner.v1.Session.encode(message.session[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.Session.encode(message.session[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -80412,7 +82838,7 @@ * @returns {$protobuf.Writer} Writer */ BatchCreateSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -80484,7 +82910,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) { + if (message.session != null && Object.hasOwnProperty.call(message, "session")) { if (!Array.isArray(message.session)) return "session: array expected"; for (var i = 0; i < message.session.length; ++i) { @@ -80507,6 +82933,8 @@ BatchCreateSessionsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.BatchCreateSessionsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80517,7 +82945,7 @@ throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: array expected"); message.session = []; for (var i = 0; i < object.session.length; ++i) { - if (typeof object.session[i] !== "object") + if (!$util.isObject(object.session[i])) throw TypeError(".google.spanner.v1.BatchCreateSessionsResponse.session: object expected"); message.session[i] = $root.google.spanner.v1.Session.fromObject(object.session[i], long + 1); } @@ -80534,16 +82962,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateSessionsResponse.toObject = function toObject(message, options) { + BatchCreateSessionsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.session = []; if (message.session && message.session.length) { object.session = []; for (var j = 0; j < message.session.length; ++j) - object.session[j] = $root.google.spanner.v1.Session.toObject(message.session[j], options); + object.session[j] = $root.google.spanner.v1.Session.toObject(message.session[j], options, q + 1); } return object; }; @@ -80676,18 +83108,22 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Session.encode = function encode(message, writer) { + Session.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime")) - $root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.creatorRole); if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed")) @@ -80705,7 +83141,7 @@ * @returns {$protobuf.Writer} Writer */ Session.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -80816,10 +83252,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; var key = Object.keys(message.labels); @@ -80827,20 +83263,20 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.createTime != null && message.hasOwnProperty("createTime")) { + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); if (error) return "createTime." + error; } - if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) { + if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime")) { var error = $root.google.protobuf.Timestamp.verify(message.approximateLastUseTime, long + 1); if (error) return "approximateLastUseTime." + error; } - if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) + if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole")) if (!$util.isString(message.creatorRole)) return "creatorRole: string expected"; - if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) + if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed")) if (typeof message.multiplexed !== "boolean") return "multiplexed: boolean expected"; return null; @@ -80857,6 +83293,8 @@ Session.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Session) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Session: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80865,7 +83303,7 @@ if (object.name != null) message.name = String(object.name); if (object.labels) { - if (typeof object.labels !== "object") + if (!$util.isObject(object.labels)) throw TypeError(".google.spanner.v1.Session.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) { @@ -80875,12 +83313,12 @@ } } if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.spanner.v1.Session.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.approximateLastUseTime != null) { - if (typeof object.approximateLastUseTime !== "object") + if (!$util.isObject(object.approximateLastUseTime)) throw TypeError(".google.spanner.v1.Session.approximateLastUseTime: object expected"); message.approximateLastUseTime = $root.google.protobuf.Timestamp.fromObject(object.approximateLastUseTime, long + 1); } @@ -80900,9 +83338,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Session.toObject = function toObject(message, options) { + Session.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.labels = {}; @@ -80913,7 +83355,7 @@ object.creatorRole = ""; object.multiplexed = false; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { @@ -80924,13 +83366,13 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.approximateLastUseTime != null && message.hasOwnProperty("approximateLastUseTime")) - object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options); - if (message.creatorRole != null && message.hasOwnProperty("creatorRole")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.approximateLastUseTime != null && Object.hasOwnProperty.call(message, "approximateLastUseTime")) + object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options, q + 1); + if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole")) object.creatorRole = message.creatorRole; - if (message.multiplexed != null && message.hasOwnProperty("multiplexed")) + if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed")) object.multiplexed = message.multiplexed; return object; }; @@ -81017,9 +83459,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSessionRequest.encode = function encode(message, writer) { + GetSessionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -81035,7 +83481,7 @@ * @returns {$protobuf.Writer} Writer */ GetSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81105,7 +83551,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -81122,6 +83568,8 @@ GetSessionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.GetSessionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.GetSessionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81141,13 +83589,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSessionRequest.toObject = function toObject(message, options) { + GetSessionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -81261,9 +83713,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSessionsRequest.encode = function encode(message, writer) { + ListSessionsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -81285,7 +83741,7 @@ * @returns {$protobuf.Writer} Writer */ ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81367,16 +83823,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; return null; @@ -81393,6 +83849,8 @@ ListSessionsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ListSessionsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ListSessionsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81418,9 +83876,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSessionsRequest.toObject = function toObject(message, options) { + ListSessionsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.database = ""; @@ -81428,13 +83890,13 @@ object.pageToken = ""; object.filter = ""; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; return object; }; @@ -81531,12 +83993,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSessionsResponse.encode = function encode(message, writer) { + ListSessionsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sessions != null && message.sessions.length) for (var i = 0; i < message.sessions.length; ++i) - $root.google.spanner.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -81552,7 +84018,7 @@ * @returns {$protobuf.Writer} Writer */ ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81628,7 +84094,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.sessions != null && message.hasOwnProperty("sessions")) { + if (message.sessions != null && Object.hasOwnProperty.call(message, "sessions")) { if (!Array.isArray(message.sessions)) return "sessions: array expected"; for (var i = 0; i < message.sessions.length; ++i) { @@ -81637,7 +84103,7 @@ return "sessions." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -81654,6 +84120,8 @@ ListSessionsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ListSessionsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ListSessionsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81664,7 +84132,7 @@ throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: array expected"); message.sessions = []; for (var i = 0; i < object.sessions.length; ++i) { - if (typeof object.sessions[i] !== "object") + if (!$util.isObject(object.sessions[i])) throw TypeError(".google.spanner.v1.ListSessionsResponse.sessions: object expected"); message.sessions[i] = $root.google.spanner.v1.Session.fromObject(object.sessions[i], long + 1); } @@ -81683,9 +84151,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSessionsResponse.toObject = function toObject(message, options) { + ListSessionsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.sessions = []; @@ -81694,9 +84166,9 @@ if (message.sessions && message.sessions.length) { object.sessions = []; for (var j = 0; j < message.sessions.length; ++j) - object.sessions[j] = $root.google.spanner.v1.Session.toObject(message.sessions[j], options); + object.sessions[j] = $root.google.spanner.v1.Session.toObject(message.sessions[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -81783,9 +84255,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSessionRequest.encode = function encode(message, writer) { + DeleteSessionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -81801,7 +84277,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81871,7 +84347,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -81888,6 +84364,8 @@ DeleteSessionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.DeleteSessionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.DeleteSessionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81907,13 +84385,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSessionRequest.toObject = function toObject(message, options) { + DeleteSessionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -82027,9 +84509,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RequestOptions.encode = function encode(message, writer) { + RequestOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.priority); if (message.requestTag != null && Object.hasOwnProperty.call(message, "requestTag")) @@ -82037,7 +84523,7 @@ if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.transactionTag); if (message.clientContext != null && Object.hasOwnProperty.call(message, "clientContext")) - $root.google.spanner.v1.RequestOptions.ClientContext.encode(message.clientContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.ClientContext.encode(message.clientContext, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -82051,7 +84537,7 @@ * @returns {$protobuf.Writer} Writer */ RequestOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -82133,7 +84619,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.priority != null && message.hasOwnProperty("priority")) + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) switch (message.priority) { default: return "priority: enum value expected"; @@ -82143,13 +84629,13 @@ case 3: break; } - if (message.requestTag != null && message.hasOwnProperty("requestTag")) + if (message.requestTag != null && Object.hasOwnProperty.call(message, "requestTag")) if (!$util.isString(message.requestTag)) return "requestTag: string expected"; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) if (!$util.isString(message.transactionTag)) return "transactionTag: string expected"; - if (message.clientContext != null && message.hasOwnProperty("clientContext")) { + if (message.clientContext != null && Object.hasOwnProperty.call(message, "clientContext")) { var error = $root.google.spanner.v1.RequestOptions.ClientContext.verify(message.clientContext, long + 1); if (error) return "clientContext." + error; @@ -82168,6 +84654,8 @@ RequestOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.RequestOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.RequestOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82202,7 +84690,7 @@ if (object.transactionTag != null) message.transactionTag = String(object.transactionTag); if (object.clientContext != null) { - if (typeof object.clientContext !== "object") + if (!$util.isObject(object.clientContext)) throw TypeError(".google.spanner.v1.RequestOptions.clientContext: object expected"); message.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.fromObject(object.clientContext, long + 1); } @@ -82218,9 +84706,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RequestOptions.toObject = function toObject(message, options) { + RequestOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; @@ -82228,14 +84720,14 @@ object.transactionTag = ""; object.clientContext = null; } - if (message.priority != null && message.hasOwnProperty("priority")) + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) object.priority = options.enums === String ? $root.google.spanner.v1.RequestOptions.Priority[message.priority] === undefined ? message.priority : $root.google.spanner.v1.RequestOptions.Priority[message.priority] : message.priority; - if (message.requestTag != null && message.hasOwnProperty("requestTag")) + if (message.requestTag != null && Object.hasOwnProperty.call(message, "requestTag")) object.requestTag = message.requestTag; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) object.transactionTag = message.transactionTag; - if (message.clientContext != null && message.hasOwnProperty("clientContext")) - object.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.toObject(message.clientContext, options); + if (message.clientContext != null && Object.hasOwnProperty.call(message, "clientContext")) + object.clientContext = $root.google.spanner.v1.RequestOptions.ClientContext.toObject(message.clientContext, options, q + 1); return object; }; @@ -82337,13 +84829,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientContext.encode = function encode(message, writer) { + ClientContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.secureContext != null && Object.hasOwnProperty.call(message, "secureContext")) for (var keys = Object.keys(message.secureContext), i = 0; i < keys.length; ++i) { writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.secureContext[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.protobuf.Value.encode(message.secureContext[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); } return writer; }; @@ -82358,7 +84854,7 @@ * @returns {$protobuf.Writer} Writer */ ClientContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -82449,7 +84945,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.secureContext != null && message.hasOwnProperty("secureContext")) { + if (message.secureContext != null && Object.hasOwnProperty.call(message, "secureContext")) { if (!$util.isObject(message.secureContext)) return "secureContext: object expected"; var key = Object.keys(message.secureContext); @@ -82473,19 +84969,21 @@ ClientContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.RequestOptions.ClientContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.RequestOptions.ClientContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.RequestOptions.ClientContext(); if (object.secureContext) { - if (typeof object.secureContext !== "object") + if (!$util.isObject(object.secureContext)) throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); message.secureContext = {}; for (var keys = Object.keys(object.secureContext), i = 0; i < keys.length; ++i) { if (keys[i] === "__proto__") $util.makeProp(message.secureContext, keys[i]); - if (typeof object.secureContext[keys[i]] !== "object") + if (!$util.isObject(object.secureContext[keys[i]])) throw TypeError(".google.spanner.v1.RequestOptions.ClientContext.secureContext: object expected"); message.secureContext[keys[i]] = $root.google.protobuf.Value.fromObject(object.secureContext[keys[i]], long + 1); } @@ -82502,9 +85000,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientContext.toObject = function toObject(message, options) { + ClientContext.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.secureContext = {}; @@ -82514,7 +85016,7 @@ for (var j = 0; j < keys2.length; ++j) { if (keys2[j] === "__proto__") $util.makeProp(object.secureContext, keys2[j]); - object.secureContext[keys2[j]] = $root.google.protobuf.Value.toObject(message.secureContext[keys2[j]], options); + object.secureContext[keys2[j]] = $root.google.protobuf.Value.toObject(message.secureContext[keys2[j]], options, q + 1); } } return object; @@ -82628,13 +85130,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DirectedReadOptions.encode = function encode(message, writer) { + DirectedReadOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) - $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.encode(message.includeReplicas, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.encode(message.includeReplicas, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) - $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.encode(message.excludeReplicas, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.encode(message.excludeReplicas, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -82648,7 +85154,7 @@ * @returns {$protobuf.Writer} Writer */ DirectedReadOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -82723,7 +85229,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { + if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) { properties.replicas = 1; { var error = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.verify(message.includeReplicas, long + 1); @@ -82731,7 +85237,7 @@ return "includeReplicas." + error; } } - if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { + if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) { if (properties.replicas === 1) return "replicas: multiple values"; properties.replicas = 1; @@ -82755,18 +85261,20 @@ DirectedReadOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.DirectedReadOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.DirectedReadOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.DirectedReadOptions(); if (object.includeReplicas != null) { - if (typeof object.includeReplicas !== "object") + if (!$util.isObject(object.includeReplicas)) throw TypeError(".google.spanner.v1.DirectedReadOptions.includeReplicas: object expected"); message.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.fromObject(object.includeReplicas, long + 1); } if (object.excludeReplicas != null) { - if (typeof object.excludeReplicas !== "object") + if (!$util.isObject(object.excludeReplicas)) throw TypeError(".google.spanner.v1.DirectedReadOptions.excludeReplicas: object expected"); message.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.fromObject(object.excludeReplicas, long + 1); } @@ -82782,17 +85290,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DirectedReadOptions.toObject = function toObject(message, options) { + DirectedReadOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.includeReplicas != null && message.hasOwnProperty("includeReplicas")) { - object.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.toObject(message.includeReplicas, options); + if (message.includeReplicas != null && Object.hasOwnProperty.call(message, "includeReplicas")) { + object.includeReplicas = $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas.toObject(message.includeReplicas, options, q + 1); if (options.oneofs) object.replicas = "includeReplicas"; } - if (message.excludeReplicas != null && message.hasOwnProperty("excludeReplicas")) { - object.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.toObject(message.excludeReplicas, options); + if (message.excludeReplicas != null && Object.hasOwnProperty.call(message, "excludeReplicas")) { + object.excludeReplicas = $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas.toObject(message.excludeReplicas, options, q + 1); if (options.oneofs) object.replicas = "excludeReplicas"; } @@ -82887,9 +85399,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicaSelection.encode = function encode(message, writer) { + ReplicaSelection.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); if (message.type != null && Object.hasOwnProperty.call(message, "type")) @@ -82907,7 +85423,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicaSelection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -82981,10 +85497,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) if (!$util.isString(message.location)) return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) switch (message.type) { default: return "type: enum value expected"; @@ -83007,6 +85523,8 @@ ReplicaSelection.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.ReplicaSelection: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83046,17 +85564,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicaSelection.toObject = function toObject(message, options) { + ReplicaSelection.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.location = ""; object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; } - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] === undefined ? message.type : $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.Type[message.type] : message.type; return object; }; @@ -83169,12 +85691,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IncludeReplicas.encode = function encode(message, writer) { + IncludeReplicas.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.replicaSelections != null && message.replicaSelections.length) for (var i = 0; i < message.replicaSelections.length; ++i) - $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.autoFailoverDisabled); return writer; @@ -83190,7 +85716,7 @@ * @returns {$protobuf.Writer} Writer */ IncludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -83266,7 +85792,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (message.replicaSelections != null && Object.hasOwnProperty.call(message, "replicaSelections")) { if (!Array.isArray(message.replicaSelections)) return "replicaSelections: array expected"; for (var i = 0; i < message.replicaSelections.length; ++i) { @@ -83275,7 +85801,7 @@ return "replicaSelections." + error; } } - if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) if (typeof message.autoFailoverDisabled !== "boolean") return "autoFailoverDisabled: boolean expected"; return null; @@ -83292,6 +85818,8 @@ IncludeReplicas.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.DirectedReadOptions.IncludeReplicas) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83302,7 +85830,7 @@ throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: array expected"); message.replicaSelections = []; for (var i = 0; i < object.replicaSelections.length; ++i) { - if (typeof object.replicaSelections[i] !== "object") + if (!$util.isObject(object.replicaSelections[i])) throw TypeError(".google.spanner.v1.DirectedReadOptions.IncludeReplicas.replicaSelections: object expected"); message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i], long + 1); } @@ -83321,9 +85849,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IncludeReplicas.toObject = function toObject(message, options) { + IncludeReplicas.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.replicaSelections = []; @@ -83332,9 +85864,9 @@ if (message.replicaSelections && message.replicaSelections.length) { object.replicaSelections = []; for (var j = 0; j < message.replicaSelections.length; ++j) - object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options, q + 1); } - if (message.autoFailoverDisabled != null && message.hasOwnProperty("autoFailoverDisabled")) + if (message.autoFailoverDisabled != null && Object.hasOwnProperty.call(message, "autoFailoverDisabled")) object.autoFailoverDisabled = message.autoFailoverDisabled; return object; }; @@ -83422,12 +85954,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExcludeReplicas.encode = function encode(message, writer) { + ExcludeReplicas.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.replicaSelections != null && message.replicaSelections.length) for (var i = 0; i < message.replicaSelections.length; ++i) - $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.encode(message.replicaSelections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -83441,7 +85977,7 @@ * @returns {$protobuf.Writer} Writer */ ExcludeReplicas.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -83513,7 +86049,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.replicaSelections != null && message.hasOwnProperty("replicaSelections")) { + if (message.replicaSelections != null && Object.hasOwnProperty.call(message, "replicaSelections")) { if (!Array.isArray(message.replicaSelections)) return "replicaSelections: array expected"; for (var i = 0; i < message.replicaSelections.length; ++i) { @@ -83536,6 +86072,8 @@ ExcludeReplicas.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.DirectedReadOptions.ExcludeReplicas) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83546,7 +86084,7 @@ throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: array expected"); message.replicaSelections = []; for (var i = 0; i < object.replicaSelections.length; ++i) { - if (typeof object.replicaSelections[i] !== "object") + if (!$util.isObject(object.replicaSelections[i])) throw TypeError(".google.spanner.v1.DirectedReadOptions.ExcludeReplicas.replicaSelections: object expected"); message.replicaSelections[i] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.fromObject(object.replicaSelections[i], long + 1); } @@ -83563,16 +86101,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExcludeReplicas.toObject = function toObject(message, options) { + ExcludeReplicas.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.replicaSelections = []; if (message.replicaSelections && message.replicaSelections.length) { object.replicaSelections = []; for (var j = 0; j < message.replicaSelections.length; ++j) - object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options); + object.replicaSelections[j] = $root.google.spanner.v1.DirectedReadOptions.ReplicaSelection.toObject(message.replicaSelections[j], options, q + 1); } return object; }; @@ -83789,21 +86331,25 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteSqlRequest.encode = function encode(message, writer) { + ExecuteSqlRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); } if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.resumeToken); @@ -83814,17 +86360,17 @@ if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) writer.uint32(/* id 9, wireType 0 =*/72).int64(message.seqno); if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) - $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.encode(message.queryOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) - $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled); if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.lastStatement); if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); return writer; }; @@ -83838,7 +86384,7 @@ * @returns {$protobuf.Writer} Writer */ ExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -83985,23 +86531,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) { var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction, long + 1); if (error) return "transaction." + error; } - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) if (!$util.isString(message.sql)) return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { + if (message.params != null && Object.hasOwnProperty.call(message, "params")) { var error = $root.google.protobuf.Struct.verify(message.params, long + 1); if (error) return "params." + error; } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) { if (!$util.isObject(message.paramTypes)) return "paramTypes: object expected"; var key = Object.keys(message.paramTypes); @@ -84011,10 +86557,10 @@ return "paramTypes." + error; } } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) return "resumeToken: buffer expected"; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) + if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) switch (message.queryMode) { default: return "queryMode: enum value expected"; @@ -84025,34 +86571,34 @@ case 4: break; } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) return "partitionToken: buffer expected"; - if (message.seqno != null && message.hasOwnProperty("seqno")) + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) return "seqno: integer|Long expected"; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) { + if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) { var error = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.verify(message.queryOptions, long + 1); if (error) return "queryOptions." + error; } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions, long + 1); if (error) return "requestOptions." + error; } - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) { var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions, long + 1); if (error) return "directedReadOptions." + error; } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) if (typeof message.dataBoostEnabled !== "boolean") return "dataBoostEnabled: boolean expected"; - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) + if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) if (typeof message.lastStatement !== "boolean") return "lastStatement: boolean expected"; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) { var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint, long + 1); if (error) return "routingHint." + error; @@ -84071,6 +86617,8 @@ ExecuteSqlRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ExecuteSqlRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -84079,25 +86627,25 @@ if (object.session != null) message.session = String(object.session); if (object.transaction != null) { - if (typeof object.transaction !== "object") + if (!$util.isObject(object.transaction)) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.transaction: object expected"); message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction, long + 1); } if (object.sql != null) message.sql = String(object.sql); if (object.params != null) { - if (typeof object.params !== "object") + if (!$util.isObject(object.params)) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.params: object expected"); message.params = $root.google.protobuf.Struct.fromObject(object.params, long + 1); } if (object.paramTypes) { - if (typeof object.paramTypes !== "object") + if (!$util.isObject(object.paramTypes)) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); message.paramTypes = {}; for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { if (keys[i] === "__proto__") $util.makeProp(message.paramTypes, keys[i]); - if (typeof object.paramTypes[keys[i]] !== "object") + if (!$util.isObject(object.paramTypes[keys[i]])) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.paramTypes: object expected"); message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]], long + 1); } @@ -84142,7 +86690,7 @@ message.partitionToken = object.partitionToken; if (object.seqno != null) if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + message.seqno = $util.Long.fromValue(object.seqno, false); else if (typeof object.seqno === "string") message.seqno = parseInt(object.seqno, 10); else if (typeof object.seqno === "number") @@ -84150,17 +86698,17 @@ else if (typeof object.seqno === "object") message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); if (object.queryOptions != null) { - if (typeof object.queryOptions !== "object") + if (!$util.isObject(object.queryOptions)) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.queryOptions: object expected"); message.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.fromObject(object.queryOptions, long + 1); } if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") + if (!$util.isObject(object.requestOptions)) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions, long + 1); } if (object.directedReadOptions != null) { - if (typeof object.directedReadOptions !== "object") + if (!$util.isObject(object.directedReadOptions)) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.directedReadOptions: object expected"); message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions, long + 1); } @@ -84169,7 +86717,7 @@ if (object.lastStatement != null) message.lastStatement = Boolean(object.lastStatement); if (object.routingHint != null) { - if (typeof object.routingHint !== "object") + if (!$util.isObject(object.routingHint)) throw TypeError(".google.spanner.v1.ExecuteSqlRequest.routingHint: object expected"); message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint, long + 1); } @@ -84185,9 +86733,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteSqlRequest.toObject = function toObject(message, options) { + ExecuteSqlRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.paramTypes = {}; @@ -84213,9 +86765,9 @@ } if ($util.Long) { var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.seqno = options.longs === String ? "0" : 0; + object.seqno = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.queryOptions = null; object.requestOptions = null; object.directedReadOptions = null; @@ -84223,46 +86775,48 @@ object.lastStatement = false; object.routingHint = null; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options, q + 1); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options, q + 1); var keys2; if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { object.paramTypes = {}; for (var j = 0; j < keys2.length; ++j) { if (keys2[j] === "__proto__") $util.makeProp(object.paramTypes, keys2[j]); - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options, q + 1); } } - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.queryMode != null && message.hasOwnProperty("queryMode")) + if (message.queryMode != null && Object.hasOwnProperty.call(message, "queryMode")) object.queryMode = options.enums === String ? $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] === undefined ? message.queryMode : $root.google.spanner.v1.ExecuteSqlRequest.QueryMode[message.queryMode] : message.queryMode; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seqno = typeof message.seqno === "number" ? BigInt(message.seqno) : $util.Long.fromBits(message.seqno.low >>> 0, message.seqno.high >>> 0, false).toBigInt(); + else if (typeof message.seqno === "number") object.seqno = options.longs === String ? String(message.seqno) : message.seqno; else object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.queryOptions != null && message.hasOwnProperty("queryOptions")) - object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) - object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (message.queryOptions != null && Object.hasOwnProperty.call(message, "queryOptions")) + object.queryOptions = $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions.toObject(message.queryOptions, options, q + 1); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options, q + 1); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options, q + 1); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) object.dataBoostEnabled = message.dataBoostEnabled; - if (message.lastStatement != null && message.hasOwnProperty("lastStatement")) + if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement")) object.lastStatement = message.lastStatement; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options, q + 1); return object; }; @@ -84374,9 +86928,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryOptions.encode = function encode(message, writer) { + QueryOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.optimizerVersion); if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) @@ -84394,7 +86952,7 @@ * @returns {$protobuf.Writer} Writer */ QueryOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -84468,10 +87026,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) if (!$util.isString(message.optimizerVersion)) return "optimizerVersion: string expected"; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) if (!$util.isString(message.optimizerStatisticsPackage)) return "optimizerStatisticsPackage: string expected"; return null; @@ -84488,6 +87046,8 @@ QueryOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ExecuteSqlRequest.QueryOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ExecuteSqlRequest.QueryOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -84509,17 +87069,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryOptions.toObject = function toObject(message, options) { + QueryOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.optimizerVersion = ""; object.optimizerStatisticsPackage = ""; } - if (message.optimizerVersion != null && message.hasOwnProperty("optimizerVersion")) + if (message.optimizerVersion != null && Object.hasOwnProperty.call(message, "optimizerVersion")) object.optimizerVersion = message.optimizerVersion; - if (message.optimizerStatisticsPackage != null && message.hasOwnProperty("optimizerStatisticsPackage")) + if (message.optimizerStatisticsPackage != null && Object.hasOwnProperty.call(message, "optimizerStatisticsPackage")) object.optimizerStatisticsPackage = message.optimizerStatisticsPackage; return object; }; @@ -84655,20 +87219,24 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteBatchDmlRequest.encode = function encode(message, writer) { + ExecuteBatchDmlRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.statements != null && message.statements.length) for (var i = 0; i < message.statements.length; ++i) - $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.encode(message.statements[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastStatements); return writer; @@ -84684,7 +87252,7 @@ * @returns {$protobuf.Writer} Writer */ ExecuteBatchDmlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -84776,15 +87344,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) { var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction, long + 1); if (error) return "transaction." + error; } - if (message.statements != null && message.hasOwnProperty("statements")) { + if (message.statements != null && Object.hasOwnProperty.call(message, "statements")) { if (!Array.isArray(message.statements)) return "statements: array expected"; for (var i = 0; i < message.statements.length; ++i) { @@ -84793,15 +87361,15 @@ return "statements." + error; } } - if (message.seqno != null && message.hasOwnProperty("seqno")) + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) if (!$util.isInteger(message.seqno) && !(message.seqno && $util.isInteger(message.seqno.low) && $util.isInteger(message.seqno.high))) return "seqno: integer|Long expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions, long + 1); if (error) return "requestOptions." + error; } - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) + if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) if (typeof message.lastStatements !== "boolean") return "lastStatements: boolean expected"; return null; @@ -84818,6 +87386,8 @@ ExecuteBatchDmlRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -84826,7 +87396,7 @@ if (object.session != null) message.session = String(object.session); if (object.transaction != null) { - if (typeof object.transaction !== "object") + if (!$util.isObject(object.transaction)) throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.transaction: object expected"); message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction, long + 1); } @@ -84835,14 +87405,14 @@ throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: array expected"); message.statements = []; for (var i = 0; i < object.statements.length; ++i) { - if (typeof object.statements[i] !== "object") + if (!$util.isObject(object.statements[i])) throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.statements: object expected"); message.statements[i] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.fromObject(object.statements[i], long + 1); } } if (object.seqno != null) if ($util.Long) - (message.seqno = $util.Long.fromValue(object.seqno)).unsigned = false; + message.seqno = $util.Long.fromValue(object.seqno, false); else if (typeof object.seqno === "string") message.seqno = parseInt(object.seqno, 10); else if (typeof object.seqno === "number") @@ -84850,7 +87420,7 @@ else if (typeof object.seqno === "object") message.seqno = new $util.LongBits(object.seqno.low >>> 0, object.seqno.high >>> 0).toNumber(); if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") + if (!$util.isObject(object.requestOptions)) throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions, long + 1); } @@ -84868,9 +87438,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteBatchDmlRequest.toObject = function toObject(message, options) { + ExecuteBatchDmlRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.statements = []; @@ -84879,29 +87453,31 @@ object.transaction = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.seqno = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.seqno = options.longs === String ? "0" : 0; + object.seqno = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.requestOptions = null; object.lastStatements = false; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options, q + 1); if (message.statements && message.statements.length) { object.statements = []; for (var j = 0; j < message.statements.length; ++j) - object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options); + object.statements[j] = $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement.toObject(message.statements[j], options, q + 1); } - if (message.seqno != null && message.hasOwnProperty("seqno")) - if (typeof message.seqno === "number") + if (message.seqno != null && Object.hasOwnProperty.call(message, "seqno")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.seqno = typeof message.seqno === "number" ? BigInt(message.seqno) : $util.Long.fromBits(message.seqno.low >>> 0, message.seqno.high >>> 0, false).toBigInt(); + else if (typeof message.seqno === "number") object.seqno = options.longs === String ? String(message.seqno) : message.seqno; else object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.lastStatements != null && message.hasOwnProperty("lastStatements")) + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options, q + 1); + if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements")) object.lastStatements = message.lastStatements; return object; }; @@ -85004,17 +87580,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Statement.encode = function encode(message, writer) { + Statement.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sql); if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); } return writer; }; @@ -85029,7 +87609,7 @@ * @returns {$protobuf.Writer} Writer */ Statement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -85128,15 +87708,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) if (!$util.isString(message.sql)) return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { + if (message.params != null && Object.hasOwnProperty.call(message, "params")) { var error = $root.google.protobuf.Struct.verify(message.params, long + 1); if (error) return "params." + error; } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) { if (!$util.isObject(message.paramTypes)) return "paramTypes: object expected"; var key = Object.keys(message.paramTypes); @@ -85160,6 +87740,8 @@ Statement.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlRequest.Statement) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -85168,18 +87750,18 @@ if (object.sql != null) message.sql = String(object.sql); if (object.params != null) { - if (typeof object.params !== "object") + if (!$util.isObject(object.params)) throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.params: object expected"); message.params = $root.google.protobuf.Struct.fromObject(object.params, long + 1); } if (object.paramTypes) { - if (typeof object.paramTypes !== "object") + if (!$util.isObject(object.paramTypes)) throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); message.paramTypes = {}; for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { if (keys[i] === "__proto__") $util.makeProp(message.paramTypes, keys[i]); - if (typeof object.paramTypes[keys[i]] !== "object") + if (!$util.isObject(object.paramTypes[keys[i]])) throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.Statement.paramTypes: object expected"); message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]], long + 1); } @@ -85196,9 +87778,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Statement.toObject = function toObject(message, options) { + Statement.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.paramTypes = {}; @@ -85206,17 +87792,17 @@ object.sql = ""; object.params = null; } - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options, q + 1); var keys2; if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { object.paramTypes = {}; for (var j = 0; j < keys2.length; ++j) { if (keys2[j] === "__proto__") $util.makeProp(object.paramTypes, keys2[j]); - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options, q + 1); } } return object; @@ -85326,16 +87912,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteBatchDmlResponse.encode = function encode(message, writer) { + ExecuteBatchDmlResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.resultSets != null && message.resultSets.length) for (var i = 0; i < message.resultSets.length; ++i) - $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.ResultSet.encode(message.resultSets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -85349,7 +87939,7 @@ * @returns {$protobuf.Writer} Writer */ ExecuteBatchDmlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -85429,7 +88019,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resultSets != null && message.hasOwnProperty("resultSets")) { + if (message.resultSets != null && Object.hasOwnProperty.call(message, "resultSets")) { if (!Array.isArray(message.resultSets)) return "resultSets: array expected"; for (var i = 0; i < message.resultSets.length; ++i) { @@ -85438,12 +88028,12 @@ return "resultSets." + error; } } - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { var error = $root.google.rpc.Status.verify(message.status, long + 1); if (error) return "status." + error; } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) { var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken, long + 1); if (error) return "precommitToken." + error; @@ -85462,6 +88052,8 @@ ExecuteBatchDmlResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ExecuteBatchDmlResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -85472,18 +88064,18 @@ throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: array expected"); message.resultSets = []; for (var i = 0; i < object.resultSets.length; ++i) { - if (typeof object.resultSets[i] !== "object") + if (!$util.isObject(object.resultSets[i])) throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.resultSets: object expected"); message.resultSets[i] = $root.google.spanner.v1.ResultSet.fromObject(object.resultSets[i], long + 1); } } if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") + if (!$util.isObject(object.precommitToken)) throw TypeError(".google.spanner.v1.ExecuteBatchDmlResponse.precommitToken: object expected"); message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken, long + 1); } @@ -85499,9 +88091,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteBatchDmlResponse.toObject = function toObject(message, options) { + ExecuteBatchDmlResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.resultSets = []; @@ -85512,12 +88108,12 @@ if (message.resultSets && message.resultSets.length) { object.resultSets = []; for (var j = 0; j < message.resultSets.length; ++j) - object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options); + object.resultSets[j] = $root.google.spanner.v1.ResultSet.toObject(message.resultSets[j], options, q + 1); } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = $root.google.rpc.Status.toObject(message.status, options, q + 1); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options, q + 1); return object; }; @@ -85612,9 +88208,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionOptions.encode = function encode(message, writer) { + PartitionOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.partitionSizeBytes); if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) @@ -85632,7 +88232,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -85706,10 +88306,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) + if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) if (!$util.isInteger(message.partitionSizeBytes) && !(message.partitionSizeBytes && $util.isInteger(message.partitionSizeBytes.low) && $util.isInteger(message.partitionSizeBytes.high))) return "partitionSizeBytes: integer|Long expected"; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) + if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) if (!$util.isInteger(message.maxPartitions) && !(message.maxPartitions && $util.isInteger(message.maxPartitions.low) && $util.isInteger(message.maxPartitions.high))) return "maxPartitions: integer|Long expected"; return null; @@ -85726,6 +88326,8 @@ PartitionOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PartitionOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PartitionOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -85733,7 +88335,7 @@ var message = new $root.google.spanner.v1.PartitionOptions(); if (object.partitionSizeBytes != null) if ($util.Long) - (message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes)).unsigned = false; + message.partitionSizeBytes = $util.Long.fromValue(object.partitionSizeBytes, false); else if (typeof object.partitionSizeBytes === "string") message.partitionSizeBytes = parseInt(object.partitionSizeBytes, 10); else if (typeof object.partitionSizeBytes === "number") @@ -85742,7 +88344,7 @@ message.partitionSizeBytes = new $util.LongBits(object.partitionSizeBytes.low >>> 0, object.partitionSizeBytes.high >>> 0).toNumber(); if (object.maxPartitions != null) if ($util.Long) - (message.maxPartitions = $util.Long.fromValue(object.maxPartitions)).unsigned = false; + message.maxPartitions = $util.Long.fromValue(object.maxPartitions, false); else if (typeof object.maxPartitions === "string") message.maxPartitions = parseInt(object.maxPartitions, 10); else if (typeof object.maxPartitions === "number") @@ -85761,29 +88363,37 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionOptions.toObject = function toObject(message, options) { + PartitionOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, false); - object.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.partitionSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.partitionSizeBytes = options.longs === String ? "0" : 0; + object.partitionSizeBytes = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.maxPartitions = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.maxPartitions = options.longs === String ? "0" : 0; + object.maxPartitions = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; } - if (message.partitionSizeBytes != null && message.hasOwnProperty("partitionSizeBytes")) - if (typeof message.partitionSizeBytes === "number") + if (message.partitionSizeBytes != null && Object.hasOwnProperty.call(message, "partitionSizeBytes")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.partitionSizeBytes = typeof message.partitionSizeBytes === "number" ? BigInt(message.partitionSizeBytes) : $util.Long.fromBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0, false).toBigInt(); + else if (typeof message.partitionSizeBytes === "number") object.partitionSizeBytes = options.longs === String ? String(message.partitionSizeBytes) : message.partitionSizeBytes; else object.partitionSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.partitionSizeBytes) : options.longs === Number ? new $util.LongBits(message.partitionSizeBytes.low >>> 0, message.partitionSizeBytes.high >>> 0).toNumber() : message.partitionSizeBytes; - if (message.maxPartitions != null && message.hasOwnProperty("maxPartitions")) - if (typeof message.maxPartitions === "number") + if (message.maxPartitions != null && Object.hasOwnProperty.call(message, "maxPartitions")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxPartitions = typeof message.maxPartitions === "number" ? BigInt(message.maxPartitions) : $util.Long.fromBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0, false).toBigInt(); + else if (typeof message.maxPartitions === "number") object.maxPartitions = options.longs === String ? String(message.maxPartitions) : message.maxPartitions; else object.maxPartitions = options.longs === String ? $util.Long.prototype.toString.call(message.maxPartitions) : options.longs === Number ? new $util.LongBits(message.maxPartitions.low >>> 0, message.maxPartitions.high >>> 0).toNumber() : message.maxPartitions; @@ -85918,24 +88528,28 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionQueryRequest.encode = function encode(message, writer) { + PartitionQueryRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.sql); if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Struct.encode(message.params, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) for (var keys = Object.keys(message.paramTypes), i = 0; i < keys.length; ++i) { writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.spanner.v1.Type.encode(message.paramTypes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim(); } if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -85949,7 +88563,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -86060,23 +88674,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) { var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction, long + 1); if (error) return "transaction." + error; } - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) if (!$util.isString(message.sql)) return "sql: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { + if (message.params != null && Object.hasOwnProperty.call(message, "params")) { var error = $root.google.protobuf.Struct.verify(message.params, long + 1); if (error) return "params." + error; } - if (message.paramTypes != null && message.hasOwnProperty("paramTypes")) { + if (message.paramTypes != null && Object.hasOwnProperty.call(message, "paramTypes")) { if (!$util.isObject(message.paramTypes)) return "paramTypes: object expected"; var key = Object.keys(message.paramTypes); @@ -86086,7 +88700,7 @@ return "paramTypes." + error; } } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) { var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions, long + 1); if (error) return "partitionOptions." + error; @@ -86105,6 +88719,8 @@ PartitionQueryRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PartitionQueryRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PartitionQueryRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -86113,31 +88729,31 @@ if (object.session != null) message.session = String(object.session); if (object.transaction != null) { - if (typeof object.transaction !== "object") + if (!$util.isObject(object.transaction)) throw TypeError(".google.spanner.v1.PartitionQueryRequest.transaction: object expected"); message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction, long + 1); } if (object.sql != null) message.sql = String(object.sql); if (object.params != null) { - if (typeof object.params !== "object") + if (!$util.isObject(object.params)) throw TypeError(".google.spanner.v1.PartitionQueryRequest.params: object expected"); message.params = $root.google.protobuf.Struct.fromObject(object.params, long + 1); } if (object.paramTypes) { - if (typeof object.paramTypes !== "object") + if (!$util.isObject(object.paramTypes)) throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); message.paramTypes = {}; for (var keys = Object.keys(object.paramTypes), i = 0; i < keys.length; ++i) { if (keys[i] === "__proto__") $util.makeProp(message.paramTypes, keys[i]); - if (typeof object.paramTypes[keys[i]] !== "object") + if (!$util.isObject(object.paramTypes[keys[i]])) throw TypeError(".google.spanner.v1.PartitionQueryRequest.paramTypes: object expected"); message.paramTypes[keys[i]] = $root.google.spanner.v1.Type.fromObject(object.paramTypes[keys[i]], long + 1); } } if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") + if (!$util.isObject(object.partitionOptions)) throw TypeError(".google.spanner.v1.PartitionQueryRequest.partitionOptions: object expected"); message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions, long + 1); } @@ -86153,9 +88769,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionQueryRequest.toObject = function toObject(message, options) { + PartitionQueryRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.paramTypes = {}; @@ -86166,25 +88786,25 @@ object.params = null; object.partitionOptions = null; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.sql != null && message.hasOwnProperty("sql")) + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options, q + 1); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) object.sql = message.sql; - if (message.params != null && message.hasOwnProperty("params")) - object.params = $root.google.protobuf.Struct.toObject(message.params, options); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + object.params = $root.google.protobuf.Struct.toObject(message.params, options, q + 1); var keys2; if (message.paramTypes && (keys2 = Object.keys(message.paramTypes)).length) { object.paramTypes = {}; for (var j = 0; j < keys2.length; ++j) { if (keys2[j] === "__proto__") $util.makeProp(object.paramTypes, keys2[j]); - object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options); + object.paramTypes[keys2[j]] = $root.google.spanner.v1.Type.toObject(message.paramTypes[keys2[j]], options, q + 1); } } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options, q + 1); return object; }; @@ -86325,13 +88945,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionReadRequest.encode = function encode(message, writer) { + PartitionReadRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); if (message.index != null && Object.hasOwnProperty.call(message, "index")) @@ -86340,9 +88964,9 @@ for (var i = 0; i < message.columns.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) - $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.spanner.v1.PartitionOptions.encode(message.partitionOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -86356,7 +88980,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionReadRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -86452,33 +89076,33 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) { var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction, long + 1); if (error) return "transaction." + error; } - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) if (!$util.isString(message.index)) return "index: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) { if (!Array.isArray(message.columns)) return "columns: array expected"; for (var i = 0; i < message.columns.length; ++i) if (!$util.isString(message.columns[i])) return "columns: string[] expected"; } - if (message.keySet != null && message.hasOwnProperty("keySet")) { + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) { var error = $root.google.spanner.v1.KeySet.verify(message.keySet, long + 1); if (error) return "keySet." + error; } - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) { + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) { var error = $root.google.spanner.v1.PartitionOptions.verify(message.partitionOptions, long + 1); if (error) return "partitionOptions." + error; @@ -86497,6 +89121,8 @@ PartitionReadRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PartitionReadRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PartitionReadRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -86505,7 +89131,7 @@ if (object.session != null) message.session = String(object.session); if (object.transaction != null) { - if (typeof object.transaction !== "object") + if (!$util.isObject(object.transaction)) throw TypeError(".google.spanner.v1.PartitionReadRequest.transaction: object expected"); message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction, long + 1); } @@ -86521,12 +89147,12 @@ message.columns[i] = String(object.columns[i]); } if (object.keySet != null) { - if (typeof object.keySet !== "object") + if (!$util.isObject(object.keySet)) throw TypeError(".google.spanner.v1.PartitionReadRequest.keySet: object expected"); message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet, long + 1); } if (object.partitionOptions != null) { - if (typeof object.partitionOptions !== "object") + if (!$util.isObject(object.partitionOptions)) throw TypeError(".google.spanner.v1.PartitionReadRequest.partitionOptions: object expected"); message.partitionOptions = $root.google.spanner.v1.PartitionOptions.fromObject(object.partitionOptions, long + 1); } @@ -86542,9 +89168,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionReadRequest.toObject = function toObject(message, options) { + PartitionReadRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.columns = []; @@ -86556,23 +89186,23 @@ object.keySet = null; object.partitionOptions = null; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options, q + 1); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) object.index = message.index; if (message.columns && message.columns.length) { object.columns = []; for (var j = 0; j < message.columns.length; ++j) object.columns[j] = message.columns[j]; } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.partitionOptions != null && message.hasOwnProperty("partitionOptions")) - object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options, q + 1); + if (message.partitionOptions != null && Object.hasOwnProperty.call(message, "partitionOptions")) + object.partitionOptions = $root.google.spanner.v1.PartitionOptions.toObject(message.partitionOptions, options, q + 1); return object; }; @@ -86658,9 +89288,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Partition.encode = function encode(message, writer) { + Partition.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.partitionToken); return writer; @@ -86676,7 +89310,7 @@ * @returns {$protobuf.Writer} Writer */ Partition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -86746,7 +89380,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) return "partitionToken: buffer expected"; return null; @@ -86763,6 +89397,8 @@ Partition.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Partition) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Partition: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -86785,9 +89421,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Partition.toObject = function toObject(message, options) { + Partition.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) if (options.bytes === String) @@ -86797,7 +89437,7 @@ if (options.bytes !== Array) object.partitionToken = $util.newBuffer(object.partitionToken); } - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; return object; }; @@ -86894,14 +89534,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionResponse.encode = function encode(message, writer) { + PartitionResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.partitions != null && message.partitions.length) for (var i = 0; i < message.partitions.length; ++i) - $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.Partition.encode(message.partitions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -86915,7 +89559,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -86991,7 +89635,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.partitions != null && message.hasOwnProperty("partitions")) { + if (message.partitions != null && Object.hasOwnProperty.call(message, "partitions")) { if (!Array.isArray(message.partitions)) return "partitions: array expected"; for (var i = 0; i < message.partitions.length; ++i) { @@ -87000,7 +89644,7 @@ return "partitions." + error; } } - if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) { var error = $root.google.spanner.v1.Transaction.verify(message.transaction, long + 1); if (error) return "transaction." + error; @@ -87019,6 +89663,8 @@ PartitionResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PartitionResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PartitionResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -87029,13 +89675,13 @@ throw TypeError(".google.spanner.v1.PartitionResponse.partitions: array expected"); message.partitions = []; for (var i = 0; i < object.partitions.length; ++i) { - if (typeof object.partitions[i] !== "object") + if (!$util.isObject(object.partitions[i])) throw TypeError(".google.spanner.v1.PartitionResponse.partitions: object expected"); message.partitions[i] = $root.google.spanner.v1.Partition.fromObject(object.partitions[i], long + 1); } } if (object.transaction != null) { - if (typeof object.transaction !== "object") + if (!$util.isObject(object.transaction)) throw TypeError(".google.spanner.v1.PartitionResponse.transaction: object expected"); message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction, long + 1); } @@ -87051,9 +89697,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionResponse.toObject = function toObject(message, options) { + PartitionResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.partitions = []; @@ -87062,10 +89712,10 @@ if (message.partitions && message.partitions.length) { object.partitions = []; for (var j = 0; j < message.partitions.length; ++j) - object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options); + object.partitions[j] = $root.google.spanner.v1.Partition.toObject(message.partitions[j], options, q + 1); } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options, q + 1); return object; }; @@ -87278,13 +89928,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadRequest.encode = function encode(message, writer) { + ReadRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.TransactionSelector.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.table); if (message.index != null && Object.hasOwnProperty.call(message, "index")) @@ -87293,7 +89947,7 @@ for (var i = 0; i < message.columns.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.columns[i]); if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) writer.uint32(/* id 8, wireType 0 =*/64).int64(message.limit); if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) @@ -87301,9 +89955,9 @@ if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.partitionToken); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) - $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + $root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) writer.uint32(/* id 15, wireType 0 =*/120).bool(message.dataBoostEnabled); if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) @@ -87311,7 +89965,7 @@ if (message.lockHint != null && Object.hasOwnProperty.call(message, "lockHint")) writer.uint32(/* id 17, wireType 0 =*/136).int32(message.lockHint); if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); return writer; }; @@ -87325,7 +89979,7 @@ * @returns {$protobuf.Writer} Writer */ ReadRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -87453,55 +90107,55 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) { var error = $root.google.spanner.v1.TransactionSelector.verify(message.transaction, long + 1); if (error) return "transaction." + error; } - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) if (!$util.isString(message.index)) return "index: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) { if (!Array.isArray(message.columns)) return "columns: array expected"; for (var i = 0; i < message.columns.length; ++i) if (!$util.isString(message.columns[i])) return "columns: string[] expected"; } - if (message.keySet != null && message.hasOwnProperty("keySet")) { + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) { var error = $root.google.spanner.v1.KeySet.verify(message.keySet, long + 1); if (error) return "keySet." + error; } - if (message.limit != null && message.hasOwnProperty("limit")) + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) if (!$util.isInteger(message.limit) && !(message.limit && $util.isInteger(message.limit.low) && $util.isInteger(message.limit.high))) return "limit: integer|Long expected"; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) return "resumeToken: buffer expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) if (!(message.partitionToken && typeof message.partitionToken.length === "number" || $util.isString(message.partitionToken))) return "partitionToken: buffer expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions, long + 1); if (error) return "requestOptions." + error; } - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) { + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) { var error = $root.google.spanner.v1.DirectedReadOptions.verify(message.directedReadOptions, long + 1); if (error) return "directedReadOptions." + error; } - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) if (typeof message.dataBoostEnabled !== "boolean") return "dataBoostEnabled: boolean expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) switch (message.orderBy) { default: return "orderBy: enum value expected"; @@ -87510,7 +90164,7 @@ case 2: break; } - if (message.lockHint != null && message.hasOwnProperty("lockHint")) + if (message.lockHint != null && Object.hasOwnProperty.call(message, "lockHint")) switch (message.lockHint) { default: return "lockHint: enum value expected"; @@ -87519,7 +90173,7 @@ case 2: break; } - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) { var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint, long + 1); if (error) return "routingHint." + error; @@ -87538,6 +90192,8 @@ ReadRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ReadRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ReadRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -87546,7 +90202,7 @@ if (object.session != null) message.session = String(object.session); if (object.transaction != null) { - if (typeof object.transaction !== "object") + if (!$util.isObject(object.transaction)) throw TypeError(".google.spanner.v1.ReadRequest.transaction: object expected"); message.transaction = $root.google.spanner.v1.TransactionSelector.fromObject(object.transaction, long + 1); } @@ -87562,13 +90218,13 @@ message.columns[i] = String(object.columns[i]); } if (object.keySet != null) { - if (typeof object.keySet !== "object") + if (!$util.isObject(object.keySet)) throw TypeError(".google.spanner.v1.ReadRequest.keySet: object expected"); message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet, long + 1); } if (object.limit != null) if ($util.Long) - (message.limit = $util.Long.fromValue(object.limit)).unsigned = false; + message.limit = $util.Long.fromValue(object.limit, false); else if (typeof object.limit === "string") message.limit = parseInt(object.limit, 10); else if (typeof object.limit === "number") @@ -87586,12 +90242,12 @@ else if (object.partitionToken.length >= 0) message.partitionToken = object.partitionToken; if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") + if (!$util.isObject(object.requestOptions)) throw TypeError(".google.spanner.v1.ReadRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions, long + 1); } if (object.directedReadOptions != null) { - if (typeof object.directedReadOptions !== "object") + if (!$util.isObject(object.directedReadOptions)) throw TypeError(".google.spanner.v1.ReadRequest.directedReadOptions: object expected"); message.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.fromObject(object.directedReadOptions, long + 1); } @@ -87638,7 +90294,7 @@ break; } if (object.routingHint != null) { - if (typeof object.routingHint !== "object") + if (!$util.isObject(object.routingHint)) throw TypeError(".google.spanner.v1.ReadRequest.routingHint: object expected"); message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint, long + 1); } @@ -87654,9 +90310,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadRequest.toObject = function toObject(message, options) { + ReadRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.columns = []; @@ -87668,9 +90328,9 @@ object.keySet = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.limit = options.longs === String ? "0" : 0; + object.limit = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if (options.bytes === String) object.resumeToken = ""; else { @@ -87692,42 +90352,44 @@ object.lockHint = options.enums === String ? "LOCK_HINT_UNSPECIFIED" : 0; object.routingHint = null; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options); - if (message.table != null && message.hasOwnProperty("table")) + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + object.transaction = $root.google.spanner.v1.TransactionSelector.toObject(message.transaction, options, q + 1); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) object.index = message.index; if (message.columns && message.columns.length) { object.columns = []; for (var j = 0; j < message.columns.length; ++j) object.columns[j] = message.columns[j]; } - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); - if (message.limit != null && message.hasOwnProperty("limit")) - if (typeof message.limit === "number") + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options, q + 1); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.limit = typeof message.limit === "number" ? BigInt(message.limit) : $util.Long.fromBits(message.limit.low >>> 0, message.limit.high >>> 0, false).toBigInt(); + else if (typeof message.limit === "number") object.limit = options.longs === String ? String(message.limit) : message.limit; else object.limit = options.longs === String ? $util.Long.prototype.toString.call(message.limit) : options.longs === Number ? new $util.LongBits(message.limit.low >>> 0, message.limit.high >>> 0).toNumber() : message.limit; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) object.partitionToken = options.bytes === String ? $util.base64.encode(message.partitionToken, 0, message.partitionToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.partitionToken) : message.partitionToken; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.directedReadOptions != null && message.hasOwnProperty("directedReadOptions")) - object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options); - if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled")) + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options, q + 1); + if (message.directedReadOptions != null && Object.hasOwnProperty.call(message, "directedReadOptions")) + object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options, q + 1); + if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled")) object.dataBoostEnabled = message.dataBoostEnabled; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) object.orderBy = options.enums === String ? $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] === undefined ? message.orderBy : $root.google.spanner.v1.ReadRequest.OrderBy[message.orderBy] : message.orderBy; - if (message.lockHint != null && message.hasOwnProperty("lockHint")) + if (message.lockHint != null && Object.hasOwnProperty.call(message, "lockHint")) object.lockHint = options.enums === String ? $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] === undefined ? message.lockHint : $root.google.spanner.v1.ReadRequest.LockHint[message.lockHint] : message.lockHint; - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options, q + 1); return object; }; @@ -87881,19 +90543,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BeginTransactionRequest.encode = function encode(message, writer) { + BeginTransactionRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.TransactionOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.mutationKey != null && Object.hasOwnProperty.call(message, "mutationKey")) - $root.google.spanner.v1.Mutation.encode(message.mutationKey, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.Mutation.encode(message.mutationKey, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -87907,7 +90573,7 @@ * @returns {$protobuf.Writer} Writer */ BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -87993,25 +90659,25 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.spanner.v1.TransactionOptions.verify(message.options, long + 1); if (error) return "options." + error; } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions, long + 1); if (error) return "requestOptions." + error; } - if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) { + if (message.mutationKey != null && Object.hasOwnProperty.call(message, "mutationKey")) { var error = $root.google.spanner.v1.Mutation.verify(message.mutationKey, long + 1); if (error) return "mutationKey." + error; } - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) { var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint, long + 1); if (error) return "routingHint." + error; @@ -88030,6 +90696,8 @@ BeginTransactionRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.BeginTransactionRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.BeginTransactionRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -88038,22 +90706,22 @@ if (object.session != null) message.session = String(object.session); if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.spanner.v1.BeginTransactionRequest.options: object expected"); message.options = $root.google.spanner.v1.TransactionOptions.fromObject(object.options, long + 1); } if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") + if (!$util.isObject(object.requestOptions)) throw TypeError(".google.spanner.v1.BeginTransactionRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions, long + 1); } if (object.mutationKey != null) { - if (typeof object.mutationKey !== "object") + if (!$util.isObject(object.mutationKey)) throw TypeError(".google.spanner.v1.BeginTransactionRequest.mutationKey: object expected"); message.mutationKey = $root.google.spanner.v1.Mutation.fromObject(object.mutationKey, long + 1); } if (object.routingHint != null) { - if (typeof object.routingHint !== "object") + if (!$util.isObject(object.routingHint)) throw TypeError(".google.spanner.v1.BeginTransactionRequest.routingHint: object expected"); message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint, long + 1); } @@ -88069,9 +90737,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BeginTransactionRequest.toObject = function toObject(message, options) { + BeginTransactionRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.session = ""; @@ -88080,16 +90752,16 @@ object.mutationKey = null; object.routingHint = null; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options); - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.mutationKey != null && message.hasOwnProperty("mutationKey")) - object.mutationKey = $root.google.spanner.v1.Mutation.toObject(message.mutationKey, options); - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.spanner.v1.TransactionOptions.toObject(message.options, options, q + 1); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options, q + 1); + if (message.mutationKey != null && Object.hasOwnProperty.call(message, "mutationKey")) + object.mutationKey = $root.google.spanner.v1.Mutation.toObject(message.mutationKey, options, q + 1); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options, q + 1); return object; }; @@ -88262,28 +90934,32 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommitRequest.encode = function encode(message, writer) { + CommitRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transactionId); if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) - $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.mutations != null && message.mutations.length) for (var i = 0; i < message.mutations.length; ++i) - $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.returnCommitStats); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.maxCommitDelay != null && Object.hasOwnProperty.call(message, "maxCommitDelay")) - $root.google.protobuf.Duration.encode(message.maxCommitDelay, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.maxCommitDelay, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) - $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.spanner.v1.RoutingHint.encode(message.routingHint, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); return writer; }; @@ -88297,7 +90973,7 @@ * @returns {$protobuf.Writer} Writer */ CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -88402,15 +91078,15 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) { properties.transaction = 1; if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) return "transactionId: buffer expected"; } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { + if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) { if (properties.transaction === 1) return "transaction: multiple values"; properties.transaction = 1; @@ -88420,7 +91096,7 @@ return "singleUseTransaction." + error; } } - if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (message.mutations != null && Object.hasOwnProperty.call(message, "mutations")) { if (!Array.isArray(message.mutations)) return "mutations: array expected"; for (var i = 0; i < message.mutations.length; ++i) { @@ -88429,25 +91105,25 @@ return "mutations." + error; } } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) if (typeof message.returnCommitStats !== "boolean") return "returnCommitStats: boolean expected"; - if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) { + if (message.maxCommitDelay != null && Object.hasOwnProperty.call(message, "maxCommitDelay")) { var error = $root.google.protobuf.Duration.verify(message.maxCommitDelay, long + 1); if (error) return "maxCommitDelay." + error; } - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions, long + 1); if (error) return "requestOptions." + error; } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) { var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken, long + 1); if (error) return "precommitToken." + error; } - if (message.routingHint != null && message.hasOwnProperty("routingHint")) { + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) { var error = $root.google.spanner.v1.RoutingHint.verify(message.routingHint, long + 1); if (error) return "routingHint." + error; @@ -88466,6 +91142,8 @@ CommitRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.CommitRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.CommitRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -88479,7 +91157,7 @@ else if (object.transactionId.length >= 0) message.transactionId = object.transactionId; if (object.singleUseTransaction != null) { - if (typeof object.singleUseTransaction !== "object") + if (!$util.isObject(object.singleUseTransaction)) throw TypeError(".google.spanner.v1.CommitRequest.singleUseTransaction: object expected"); message.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUseTransaction, long + 1); } @@ -88488,7 +91166,7 @@ throw TypeError(".google.spanner.v1.CommitRequest.mutations: array expected"); message.mutations = []; for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") + if (!$util.isObject(object.mutations[i])) throw TypeError(".google.spanner.v1.CommitRequest.mutations: object expected"); message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i], long + 1); } @@ -88496,22 +91174,22 @@ if (object.returnCommitStats != null) message.returnCommitStats = Boolean(object.returnCommitStats); if (object.maxCommitDelay != null) { - if (typeof object.maxCommitDelay !== "object") + if (!$util.isObject(object.maxCommitDelay)) throw TypeError(".google.spanner.v1.CommitRequest.maxCommitDelay: object expected"); message.maxCommitDelay = $root.google.protobuf.Duration.fromObject(object.maxCommitDelay, long + 1); } if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") + if (!$util.isObject(object.requestOptions)) throw TypeError(".google.spanner.v1.CommitRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions, long + 1); } if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") + if (!$util.isObject(object.precommitToken)) throw TypeError(".google.spanner.v1.CommitRequest.precommitToken: object expected"); message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken, long + 1); } if (object.routingHint != null) { - if (typeof object.routingHint !== "object") + if (!$util.isObject(object.routingHint)) throw TypeError(".google.spanner.v1.CommitRequest.routingHint: object expected"); message.routingHint = $root.google.spanner.v1.RoutingHint.fromObject(object.routingHint, long + 1); } @@ -88527,9 +91205,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommitRequest.toObject = function toObject(message, options) { + CommitRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.mutations = []; @@ -88541,33 +91223,33 @@ object.precommitToken = null; object.routingHint = null; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) { + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) { object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; if (options.oneofs) object.transaction = "transactionId"; } - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options); + if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) { + object.singleUseTransaction = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUseTransaction, options, q + 1); if (options.oneofs) object.transaction = "singleUseTransaction"; } if (message.mutations && message.mutations.length) { object.mutations = []; for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options, q + 1); } - if (message.returnCommitStats != null && message.hasOwnProperty("returnCommitStats")) + if (message.returnCommitStats != null && Object.hasOwnProperty.call(message, "returnCommitStats")) object.returnCommitStats = message.returnCommitStats; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); - if (message.maxCommitDelay != null && message.hasOwnProperty("maxCommitDelay")) - object.maxCommitDelay = $root.google.protobuf.Duration.toObject(message.maxCommitDelay, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.routingHint != null && message.hasOwnProperty("routingHint")) - object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options, q + 1); + if (message.maxCommitDelay != null && Object.hasOwnProperty.call(message, "maxCommitDelay")) + object.maxCommitDelay = $root.google.protobuf.Duration.toObject(message.maxCommitDelay, options, q + 1); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options, q + 1); + if (message.routingHint != null && Object.hasOwnProperty.call(message, "routingHint")) + object.routingHint = $root.google.spanner.v1.RoutingHint.toObject(message.routingHint, options, q + 1); return object; }; @@ -88662,9 +91344,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RollbackRequest.encode = function encode(message, writer) { + RollbackRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) @@ -88682,7 +91368,7 @@ * @returns {$protobuf.Writer} Writer */ RollbackRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -88756,10 +91442,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId))) return "transactionId: buffer expected"; return null; @@ -88776,6 +91462,8 @@ RollbackRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.RollbackRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.RollbackRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -88800,9 +91488,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RollbackRequest.toObject = function toObject(message, options) { + RollbackRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.session = ""; @@ -88814,9 +91506,9 @@ object.transactionId = $util.newBuffer(object.transactionId); } } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId; return object; }; @@ -88931,16 +91623,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchWriteRequest.encode = function encode(message, writer) { + BatchWriteRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.session != null && Object.hasOwnProperty.call(message, "session")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) - $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.mutationGroups != null && message.mutationGroups.length) for (var i = 0; i < message.mutationGroups.length; ++i) - $root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); return writer; @@ -88956,7 +91652,7 @@ * @returns {$protobuf.Writer} Writer */ BatchWriteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89040,15 +91736,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) if (!$util.isString(message.session)) return "session: string expected"; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) { + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) { var error = $root.google.spanner.v1.RequestOptions.verify(message.requestOptions, long + 1); if (error) return "requestOptions." + error; } - if (message.mutationGroups != null && message.hasOwnProperty("mutationGroups")) { + if (message.mutationGroups != null && Object.hasOwnProperty.call(message, "mutationGroups")) { if (!Array.isArray(message.mutationGroups)) return "mutationGroups: array expected"; for (var i = 0; i < message.mutationGroups.length; ++i) { @@ -89057,7 +91753,7 @@ return "mutationGroups." + error; } } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) if (typeof message.excludeTxnFromChangeStreams !== "boolean") return "excludeTxnFromChangeStreams: boolean expected"; return null; @@ -89074,6 +91770,8 @@ BatchWriteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.BatchWriteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.BatchWriteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -89082,7 +91780,7 @@ if (object.session != null) message.session = String(object.session); if (object.requestOptions != null) { - if (typeof object.requestOptions !== "object") + if (!$util.isObject(object.requestOptions)) throw TypeError(".google.spanner.v1.BatchWriteRequest.requestOptions: object expected"); message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions, long + 1); } @@ -89091,7 +91789,7 @@ throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: array expected"); message.mutationGroups = []; for (var i = 0; i < object.mutationGroups.length; ++i) { - if (typeof object.mutationGroups[i] !== "object") + if (!$util.isObject(object.mutationGroups[i])) throw TypeError(".google.spanner.v1.BatchWriteRequest.mutationGroups: object expected"); message.mutationGroups[i] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.fromObject(object.mutationGroups[i], long + 1); } @@ -89110,9 +91808,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchWriteRequest.toObject = function toObject(message, options) { + BatchWriteRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.mutationGroups = []; @@ -89121,16 +91823,16 @@ object.requestOptions = null; object.excludeTxnFromChangeStreams = false; } - if (message.session != null && message.hasOwnProperty("session")) + if (message.session != null && Object.hasOwnProperty.call(message, "session")) object.session = message.session; - if (message.requestOptions != null && message.hasOwnProperty("requestOptions")) - object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options); + if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions")) + object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options, q + 1); if (message.mutationGroups && message.mutationGroups.length) { object.mutationGroups = []; for (var j = 0; j < message.mutationGroups.length; ++j) - object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options); + object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options, q + 1); } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; return object; }; @@ -89215,12 +91917,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MutationGroup.encode = function encode(message, writer) { + MutationGroup.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.mutations != null && message.mutations.length) for (var i = 0; i < message.mutations.length; ++i) - $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -89234,7 +91940,7 @@ * @returns {$protobuf.Writer} Writer */ MutationGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89306,7 +92012,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (message.mutations != null && Object.hasOwnProperty.call(message, "mutations")) { if (!Array.isArray(message.mutations)) return "mutations: array expected"; for (var i = 0; i < message.mutations.length; ++i) { @@ -89329,6 +92035,8 @@ MutationGroup.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.BatchWriteRequest.MutationGroup) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -89339,7 +92047,7 @@ throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: array expected"); message.mutations = []; for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") + if (!$util.isObject(object.mutations[i])) throw TypeError(".google.spanner.v1.BatchWriteRequest.MutationGroup.mutations: object expected"); message.mutations[i] = $root.google.spanner.v1.Mutation.fromObject(object.mutations[i], long + 1); } @@ -89356,16 +92064,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MutationGroup.toObject = function toObject(message, options) { + MutationGroup.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.mutations = []; if (message.mutations && message.mutations.length) { object.mutations = []; for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options); + object.mutations[j] = $root.google.spanner.v1.Mutation.toObject(message.mutations[j], options, q + 1); } return object; }; @@ -89474,9 +92186,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchWriteResponse.encode = function encode(message, writer) { + BatchWriteResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.indexes != null && message.indexes.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.indexes.length; ++i) @@ -89484,9 +92200,9 @@ writer.ldelim(); } if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -89500,7 +92216,7 @@ * @returns {$protobuf.Writer} Writer */ BatchWriteResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89585,19 +92301,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.indexes != null && message.hasOwnProperty("indexes")) { + if (message.indexes != null && Object.hasOwnProperty.call(message, "indexes")) { if (!Array.isArray(message.indexes)) return "indexes: array expected"; for (var i = 0; i < message.indexes.length; ++i) if (!$util.isInteger(message.indexes[i])) return "indexes: integer[] expected"; } - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { var error = $root.google.rpc.Status.verify(message.status, long + 1); if (error) return "status." + error; } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp, long + 1); if (error) return "commitTimestamp." + error; @@ -89616,6 +92332,8 @@ BatchWriteResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.BatchWriteResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.BatchWriteResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -89629,12 +92347,12 @@ message.indexes[i] = object.indexes[i] | 0; } if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.spanner.v1.BatchWriteResponse.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") + if (!$util.isObject(object.commitTimestamp)) throw TypeError(".google.spanner.v1.BatchWriteResponse.commitTimestamp: object expected"); message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp, long + 1); } @@ -89650,9 +92368,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchWriteResponse.toObject = function toObject(message, options) { + BatchWriteResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.indexes = []; @@ -89665,10 +92387,10 @@ for (var j = 0; j < message.indexes.length; ++j) object.indexes[j] = message.indexes[j]; } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = $root.google.rpc.Status.toObject(message.status, options, q + 1); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options, q + 1); return object; }; @@ -89772,9 +92494,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FetchCacheUpdateRequest.encode = function encode(message, writer) { + FetchCacheUpdateRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.database != null && Object.hasOwnProperty.call(message, "database")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.database); if (message.maxRecipeCount != null && Object.hasOwnProperty.call(message, "maxRecipeCount")) @@ -89794,7 +92520,7 @@ * @returns {$protobuf.Writer} Writer */ FetchCacheUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89872,13 +92598,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) if (!$util.isString(message.database)) return "database: string expected"; - if (message.maxRecipeCount != null && message.hasOwnProperty("maxRecipeCount")) + if (message.maxRecipeCount != null && Object.hasOwnProperty.call(message, "maxRecipeCount")) if (!$util.isInteger(message.maxRecipeCount)) return "maxRecipeCount: integer expected"; - if (message.maxRangeCount != null && message.hasOwnProperty("maxRangeCount")) + if (message.maxRangeCount != null && Object.hasOwnProperty.call(message, "maxRangeCount")) if (!$util.isInteger(message.maxRangeCount)) return "maxRangeCount: integer expected"; return null; @@ -89895,6 +92621,8 @@ FetchCacheUpdateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.FetchCacheUpdateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.FetchCacheUpdateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -89918,20 +92646,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FetchCacheUpdateRequest.toObject = function toObject(message, options) { + FetchCacheUpdateRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.database = ""; object.maxRecipeCount = 0; object.maxRangeCount = 0; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.maxRecipeCount != null && message.hasOwnProperty("maxRecipeCount")) + if (message.maxRecipeCount != null && Object.hasOwnProperty.call(message, "maxRecipeCount")) object.maxRecipeCount = message.maxRecipeCount; - if (message.maxRangeCount != null && message.hasOwnProperty("maxRangeCount")) + if (message.maxRangeCount != null && Object.hasOwnProperty.call(message, "maxRangeCount")) object.maxRangeCount = message.maxRangeCount; return object; }; @@ -90086,19 +92818,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommitResponse.encode = function encode(message, writer) { + CommitResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.commitStats != null && Object.hasOwnProperty.call(message, "commitStats")) - $root.google.spanner.v1.CommitResponse.CommitStats.encode(message.commitStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.CommitResponse.CommitStats.encode(message.commitStats, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.snapshotTimestamp != null && Object.hasOwnProperty.call(message, "snapshotTimestamp")) - $root.google.protobuf.Timestamp.encode(message.snapshotTimestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.snapshotTimestamp, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.isolationLevel); if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) @@ -90116,7 +92852,7 @@ * @returns {$protobuf.Writer} Writer */ CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -90211,17 +92947,17 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp, long + 1); if (error) return "commitTimestamp." + error; } - if (message.commitStats != null && message.hasOwnProperty("commitStats")) { + if (message.commitStats != null && Object.hasOwnProperty.call(message, "commitStats")) { var error = $root.google.spanner.v1.CommitResponse.CommitStats.verify(message.commitStats, long + 1); if (error) return "commitStats." + error; } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) { properties.MultiplexedSessionRetry = 1; { var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken, long + 1); @@ -90229,17 +92965,17 @@ return "precommitToken." + error; } } - if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) { + if (message.snapshotTimestamp != null && Object.hasOwnProperty.call(message, "snapshotTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.snapshotTimestamp, long + 1); if (error) return "snapshotTimestamp." + error; } - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) { var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate, long + 1); if (error) return "cacheUpdate." + error; } - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) switch (message.isolationLevel) { default: return "isolationLevel: enum value expected"; @@ -90248,7 +92984,7 @@ case 2: break; } - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) switch (message.readLockMode) { default: return "readLockMode: enum value expected"; @@ -90271,33 +93007,35 @@ CommitResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.CommitResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.CommitResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.CommitResponse(); if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") + if (!$util.isObject(object.commitTimestamp)) throw TypeError(".google.spanner.v1.CommitResponse.commitTimestamp: object expected"); message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp, long + 1); } if (object.commitStats != null) { - if (typeof object.commitStats !== "object") + if (!$util.isObject(object.commitStats)) throw TypeError(".google.spanner.v1.CommitResponse.commitStats: object expected"); message.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.fromObject(object.commitStats, long + 1); } if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") + if (!$util.isObject(object.precommitToken)) throw TypeError(".google.spanner.v1.CommitResponse.precommitToken: object expected"); message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken, long + 1); } if (object.snapshotTimestamp != null) { - if (typeof object.snapshotTimestamp !== "object") + if (!$util.isObject(object.snapshotTimestamp)) throw TypeError(".google.spanner.v1.CommitResponse.snapshotTimestamp: object expected"); message.snapshotTimestamp = $root.google.protobuf.Timestamp.fromObject(object.snapshotTimestamp, long + 1); } if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") + if (!$util.isObject(object.cacheUpdate)) throw TypeError(".google.spanner.v1.CommitResponse.cacheUpdate: object expected"); message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate, long + 1); } @@ -90353,9 +93091,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommitResponse.toObject = function toObject(message, options) { + CommitResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.commitTimestamp = null; @@ -90365,22 +93107,22 @@ object.isolationLevel = options.enums === String ? "ISOLATION_LEVEL_UNSPECIFIED" : 0; object.readLockMode = options.enums === String ? "READ_LOCK_MODE_UNSPECIFIED" : 0; } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - if (message.commitStats != null && message.hasOwnProperty("commitStats")) - object.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.toObject(message.commitStats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options, q + 1); + if (message.commitStats != null && Object.hasOwnProperty.call(message, "commitStats")) + object.commitStats = $root.google.spanner.v1.CommitResponse.CommitStats.toObject(message.commitStats, options, q + 1); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) { + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options, q + 1); if (options.oneofs) object.MultiplexedSessionRetry = "precommitToken"; } - if (message.snapshotTimestamp != null && message.hasOwnProperty("snapshotTimestamp")) - object.snapshotTimestamp = $root.google.protobuf.Timestamp.toObject(message.snapshotTimestamp, options); - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + if (message.snapshotTimestamp != null && Object.hasOwnProperty.call(message, "snapshotTimestamp")) + object.snapshotTimestamp = $root.google.protobuf.Timestamp.toObject(message.snapshotTimestamp, options, q + 1); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options, q + 1); + if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) object.isolationLevel = options.enums === String ? $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] === undefined ? message.isolationLevel : $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] : message.isolationLevel; - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) object.readLockMode = options.enums === String ? $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] === undefined ? message.readLockMode : $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] : message.readLockMode; return object; }; @@ -90464,9 +93206,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommitStats.encode = function encode(message, writer) { + CommitStats.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.mutationCount != null && Object.hasOwnProperty.call(message, "mutationCount")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.mutationCount); return writer; @@ -90482,7 +93228,7 @@ * @returns {$protobuf.Writer} Writer */ CommitStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -90552,7 +93298,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) + if (message.mutationCount != null && Object.hasOwnProperty.call(message, "mutationCount")) if (!$util.isInteger(message.mutationCount) && !(message.mutationCount && $util.isInteger(message.mutationCount.low) && $util.isInteger(message.mutationCount.high))) return "mutationCount: integer|Long expected"; return null; @@ -90569,6 +93315,8 @@ CommitStats.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.CommitResponse.CommitStats) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.CommitResponse.CommitStats: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -90576,7 +93324,7 @@ var message = new $root.google.spanner.v1.CommitResponse.CommitStats(); if (object.mutationCount != null) if ($util.Long) - (message.mutationCount = $util.Long.fromValue(object.mutationCount)).unsigned = false; + message.mutationCount = $util.Long.fromValue(object.mutationCount, false); else if (typeof object.mutationCount === "string") message.mutationCount = parseInt(object.mutationCount, 10); else if (typeof object.mutationCount === "number") @@ -90595,18 +93343,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommitStats.toObject = function toObject(message, options) { + CommitStats.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) if ($util.Long) { var long = new $util.Long(0, 0, false); - object.mutationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.mutationCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.mutationCount = options.longs === String ? "0" : 0; - if (message.mutationCount != null && message.hasOwnProperty("mutationCount")) - if (typeof message.mutationCount === "number") + object.mutationCount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.mutationCount != null && Object.hasOwnProperty.call(message, "mutationCount")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.mutationCount = typeof message.mutationCount === "number" ? BigInt(message.mutationCount) : $util.Long.fromBits(message.mutationCount.low >>> 0, message.mutationCount.high >>> 0, false).toBigInt(); + else if (typeof message.mutationCount === "number") object.mutationCount = options.longs === String ? String(message.mutationCount) : message.mutationCount; else object.mutationCount = options.longs === String ? $util.Long.prototype.toString.call(message.mutationCount) : options.longs === Number ? new $util.LongBits(message.mutationCount.low >>> 0, message.mutationCount.high >>> 0).toNumber() : message.mutationCount; @@ -90734,9 +93488,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Range.encode = function encode(message, writer) { + Range.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.startKey); if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) @@ -90760,7 +93518,7 @@ * @returns {$protobuf.Writer} Writer */ Range.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -90846,19 +93604,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.startKey != null && message.hasOwnProperty("startKey")) + if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) if (!(message.startKey && typeof message.startKey.length === "number" || $util.isString(message.startKey))) return "startKey: buffer expected"; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) return "limitKey: buffer expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) return "groupUid: integer|Long expected"; - if (message.splitId != null && message.hasOwnProperty("splitId")) + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) return "splitId: integer|Long expected"; - if (message.generation != null && message.hasOwnProperty("generation")) + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) return "generation: buffer expected"; return null; @@ -90875,6 +93633,8 @@ Range.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Range) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Range: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -90892,7 +93652,7 @@ message.limitKey = object.limitKey; if (object.groupUid != null) if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + message.groupUid = $util.Long.fromValue(object.groupUid, true); else if (typeof object.groupUid === "string") message.groupUid = parseInt(object.groupUid, 10); else if (typeof object.groupUid === "number") @@ -90901,7 +93661,7 @@ message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); if (object.splitId != null) if ($util.Long) - (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; + message.splitId = $util.Long.fromValue(object.splitId, true); else if (typeof object.splitId === "string") message.splitId = parseInt(object.splitId, 10); else if (typeof object.splitId === "number") @@ -90925,9 +93685,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Range.toObject = function toObject(message, options) { + Range.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { if (options.bytes === String) @@ -90946,14 +93710,14 @@ } if ($util.Long) { var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.groupUid = options.longs === String ? "0" : 0; + object.groupUid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if ($util.Long) { var long = new $util.Long(0, 0, true); - object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.splitId = options.longs === String ? "0" : 0; + object.splitId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if (options.bytes === String) object.generation = ""; else { @@ -90962,21 +93726,25 @@ object.generation = $util.newBuffer(object.generation); } } - if (message.startKey != null && message.hasOwnProperty("startKey")) + if (message.startKey != null && Object.hasOwnProperty.call(message, "startKey")) object.startKey = options.bytes === String ? $util.base64.encode(message.startKey, 0, message.startKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.startKey) : message.startKey; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.groupUid = typeof message.groupUid === "number" ? BigInt(message.groupUid) : $util.Long.fromBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0, true).toBigInt(); + else if (typeof message.groupUid === "number") object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; else object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (typeof message.splitId === "number") + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.splitId = typeof message.splitId === "number" ? BigInt(message.splitId) : $util.Long.fromBits(message.splitId.low >>> 0, message.splitId.high >>> 0, true).toBigInt(); + else if (typeof message.splitId === "number") object.splitId = options.longs === String ? String(message.splitId) : message.splitId; else object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; - if (message.generation != null && message.hasOwnProperty("generation")) + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; return object; }; @@ -91117,9 +93885,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tablet.encode = function encode(message, writer) { + Tablet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) @@ -91147,7 +93919,7 @@ * @returns {$protobuf.Writer} Writer */ Tablet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -91241,16 +94013,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) return "tabletUid: integer|Long expected"; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) if (!$util.isString(message.serverAddress)) return "serverAddress: string expected"; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) if (!$util.isString(message.location)) return "location: string expected"; - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) switch (message.role) { default: return "role: enum value expected"; @@ -91259,13 +94031,13 @@ case 2: break; } - if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) return "incarnation: buffer expected"; - if (message.distance != null && message.hasOwnProperty("distance")) + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) if (!$util.isInteger(message.distance)) return "distance: integer expected"; - if (message.skip != null && message.hasOwnProperty("skip")) + if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) if (typeof message.skip !== "boolean") return "skip: boolean expected"; return null; @@ -91282,6 +94054,8 @@ Tablet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Tablet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Tablet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -91289,7 +94063,7 @@ var message = new $root.google.spanner.v1.Tablet(); if (object.tabletUid != null) if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + message.tabletUid = $util.Long.fromValue(object.tabletUid, true); else if (typeof object.tabletUid === "string") message.tabletUid = parseInt(object.tabletUid, 10); else if (typeof object.tabletUid === "number") @@ -91341,16 +94115,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Tablet.toObject = function toObject(message, options) { + Tablet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.tabletUid = options.longs === String ? "0" : 0; + object.tabletUid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.serverAddress = ""; object.location = ""; object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; @@ -91364,22 +94142,24 @@ object.distance = 0; object.skip = false; } - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.tabletUid = typeof message.tabletUid === "number" ? BigInt(message.tabletUid) : $util.Long.fromBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0, true).toBigInt(); + else if (typeof message.tabletUid === "number") object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; else object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.serverAddress != null && message.hasOwnProperty("serverAddress")) + if (message.serverAddress != null && Object.hasOwnProperty.call(message, "serverAddress")) object.serverAddress = message.serverAddress; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) object.role = options.enums === String ? $root.google.spanner.v1.Tablet.Role[message.role] === undefined ? message.role : $root.google.spanner.v1.Tablet.Role[message.role] : message.role; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; - if (message.distance != null && message.hasOwnProperty("distance")) + if (message.distance != null && Object.hasOwnProperty.call(message, "distance")) object.distance = message.distance; - if (message.skip != null && message.hasOwnProperty("skip")) + if (message.skip != null && Object.hasOwnProperty.call(message, "skip")) object.skip = message.skip; return object; }; @@ -91510,14 +94290,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Group.encode = function encode(message, writer) { + Group.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.groupUid); if (message.tablets != null && message.tablets.length) for (var i = 0; i < message.tablets.length; ++i) - $root.google.spanner.v1.Tablet.encode(message.tablets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Tablet.encode(message.tablets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.leaderIndex != null && Object.hasOwnProperty.call(message, "leaderIndex")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.leaderIndex); if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) @@ -91535,7 +94319,7 @@ * @returns {$protobuf.Writer} Writer */ Group.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -91619,10 +94403,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) return "groupUid: integer|Long expected"; - if (message.tablets != null && message.hasOwnProperty("tablets")) { + if (message.tablets != null && Object.hasOwnProperty.call(message, "tablets")) { if (!Array.isArray(message.tablets)) return "tablets: array expected"; for (var i = 0; i < message.tablets.length; ++i) { @@ -91631,10 +94415,10 @@ return "tablets." + error; } } - if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) + if (message.leaderIndex != null && Object.hasOwnProperty.call(message, "leaderIndex")) if (!$util.isInteger(message.leaderIndex)) return "leaderIndex: integer expected"; - if (message.generation != null && message.hasOwnProperty("generation")) + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) if (!(message.generation && typeof message.generation.length === "number" || $util.isString(message.generation))) return "generation: buffer expected"; return null; @@ -91651,6 +94435,8 @@ Group.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Group) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Group: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -91658,7 +94444,7 @@ var message = new $root.google.spanner.v1.Group(); if (object.groupUid != null) if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + message.groupUid = $util.Long.fromValue(object.groupUid, true); else if (typeof object.groupUid === "string") message.groupUid = parseInt(object.groupUid, 10); else if (typeof object.groupUid === "number") @@ -91670,7 +94456,7 @@ throw TypeError(".google.spanner.v1.Group.tablets: array expected"); message.tablets = []; for (var i = 0; i < object.tablets.length; ++i) { - if (typeof object.tablets[i] !== "object") + if (!$util.isObject(object.tablets[i])) throw TypeError(".google.spanner.v1.Group.tablets: object expected"); message.tablets[i] = $root.google.spanner.v1.Tablet.fromObject(object.tablets[i], long + 1); } @@ -91694,18 +94480,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Group.toObject = function toObject(message, options) { + Group.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.tablets = []; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.groupUid = options.longs === String ? "0" : 0; + object.groupUid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.leaderIndex = 0; if (options.bytes === String) object.generation = ""; @@ -91715,19 +94505,21 @@ object.generation = $util.newBuffer(object.generation); } } - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.groupUid = typeof message.groupUid === "number" ? BigInt(message.groupUid) : $util.Long.fromBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0, true).toBigInt(); + else if (typeof message.groupUid === "number") object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; else object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; if (message.tablets && message.tablets.length) { object.tablets = []; for (var j = 0; j < message.tablets.length; ++j) - object.tablets[j] = $root.google.spanner.v1.Tablet.toObject(message.tablets[j], options); + object.tablets[j] = $root.google.spanner.v1.Tablet.toObject(message.tablets[j], options, q + 1); } - if (message.leaderIndex != null && message.hasOwnProperty("leaderIndex")) + if (message.leaderIndex != null && Object.hasOwnProperty.call(message, "leaderIndex")) object.leaderIndex = message.leaderIndex; - if (message.generation != null && message.hasOwnProperty("generation")) + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) object.generation = options.bytes === String ? $util.base64.encode(message.generation, 0, message.generation.length) : options.bytes === Array ? Array.prototype.slice.call(message.generation) : message.generation; return object; }; @@ -91856,9 +94648,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeyRecipe.encode = function encode(message, writer) { + KeyRecipe.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.tableName); if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) @@ -91867,7 +94663,7 @@ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.operationUid); if (message.part != null && message.part.length) for (var i = 0; i < message.part.length; ++i) - $root.google.spanner.v1.KeyRecipe.Part.encode(message.part[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.KeyRecipe.Part.encode(message.part[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -91881,7 +94677,7 @@ * @returns {$protobuf.Writer} Writer */ KeyRecipe.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -91966,26 +94762,26 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.tableName != null && message.hasOwnProperty("tableName")) { + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) { properties.target = 1; if (!$util.isString(message.tableName)) return "tableName: string expected"; } - if (message.indexName != null && message.hasOwnProperty("indexName")) { + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) { if (properties.target === 1) return "target: multiple values"; properties.target = 1; if (!$util.isString(message.indexName)) return "indexName: string expected"; } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) { + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) { if (properties.target === 1) return "target: multiple values"; properties.target = 1; if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) return "operationUid: integer|Long expected"; } - if (message.part != null && message.hasOwnProperty("part")) { + if (message.part != null && Object.hasOwnProperty.call(message, "part")) { if (!Array.isArray(message.part)) return "part: array expected"; for (var i = 0; i < message.part.length; ++i) { @@ -92008,6 +94804,8 @@ KeyRecipe.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.KeyRecipe) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.KeyRecipe: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -92019,7 +94817,7 @@ message.indexName = String(object.indexName); if (object.operationUid != null) if ($util.Long) - (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; + message.operationUid = $util.Long.fromValue(object.operationUid, true); else if (typeof object.operationUid === "string") message.operationUid = parseInt(object.operationUid, 10); else if (typeof object.operationUid === "number") @@ -92031,7 +94829,7 @@ throw TypeError(".google.spanner.v1.KeyRecipe.part: array expected"); message.part = []; for (var i = 0; i < object.part.length; ++i) { - if (typeof object.part[i] !== "object") + if (!$util.isObject(object.part[i])) throw TypeError(".google.spanner.v1.KeyRecipe.part: object expected"); message.part[i] = $root.google.spanner.v1.KeyRecipe.Part.fromObject(object.part[i], long + 1); } @@ -92048,24 +94846,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KeyRecipe.toObject = function toObject(message, options) { + KeyRecipe.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.part = []; - if (message.tableName != null && message.hasOwnProperty("tableName")) { + if (message.tableName != null && Object.hasOwnProperty.call(message, "tableName")) { object.tableName = message.tableName; if (options.oneofs) object.target = "tableName"; } - if (message.indexName != null && message.hasOwnProperty("indexName")) { + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) { object.indexName = message.indexName; if (options.oneofs) object.target = "indexName"; } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) { - if (typeof message.operationUid === "number") + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.operationUid = typeof message.operationUid === "number" ? BigInt(message.operationUid) : $util.Long.fromBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0, true).toBigInt(); + else if (typeof message.operationUid === "number") object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; else object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; @@ -92075,7 +94879,7 @@ if (message.part && message.part.length) { object.part = []; for (var j = 0; j < message.part.length; ++j) - object.part[j] = $root.google.spanner.v1.KeyRecipe.Part.toObject(message.part[j], options); + object.part[j] = $root.google.spanner.v1.KeyRecipe.Part.toObject(message.part[j], options, q + 1); } return object; }; @@ -92237,9 +95041,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Part.encode = function encode(message, writer) { + Part.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.tag); if (message.order != null && Object.hasOwnProperty.call(message, "order")) @@ -92247,11 +95055,11 @@ if (message.nullOrder != null && Object.hasOwnProperty.call(message, "nullOrder")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nullOrder); if (message.type != null && Object.hasOwnProperty.call(message, "type")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.identifier); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.structIdentifiers != null && message.structIdentifiers.length) { writer.uint32(/* id 7, wireType 2 =*/58).fork(); for (var i = 0; i < message.structIdentifiers.length; ++i) @@ -92273,7 +95081,7 @@ * @returns {$protobuf.Writer} Writer */ Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -92379,10 +95187,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.tag != null && message.hasOwnProperty("tag")) + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) if (!$util.isInteger(message.tag)) return "tag: integer expected"; - if (message.order != null && message.hasOwnProperty("order")) + if (message.order != null && Object.hasOwnProperty.call(message, "order")) switch (message.order) { default: return "order: enum value expected"; @@ -92391,7 +95199,7 @@ case 2: break; } - if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) + if (message.nullOrder != null && Object.hasOwnProperty.call(message, "nullOrder")) switch (message.nullOrder) { default: return "nullOrder: enum value expected"; @@ -92401,17 +95209,17 @@ case 3: break; } - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { var error = $root.google.spanner.v1.Type.verify(message.type, long + 1); if (error) return "type." + error; } - if (message.identifier != null && message.hasOwnProperty("identifier")) { + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) { properties.valueType = 1; if (!$util.isString(message.identifier)) return "identifier: string expected"; } - if (message.value != null && message.hasOwnProperty("value")) { + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; @@ -92421,14 +95229,14 @@ return "value." + error; } } - if (message.random != null && message.hasOwnProperty("random")) { + if (message.random != null && Object.hasOwnProperty.call(message, "random")) { if (properties.valueType === 1) return "valueType: multiple values"; properties.valueType = 1; if (typeof message.random !== "boolean") return "random: boolean expected"; } - if (message.structIdentifiers != null && message.hasOwnProperty("structIdentifiers")) { + if (message.structIdentifiers != null && Object.hasOwnProperty.call(message, "structIdentifiers")) { if (!Array.isArray(message.structIdentifiers)) return "structIdentifiers: array expected"; for (var i = 0; i < message.structIdentifiers.length; ++i) @@ -92449,6 +95257,8 @@ Part.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.KeyRecipe.Part) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.KeyRecipe.Part: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -92501,14 +95311,14 @@ break; } if (object.type != null) { - if (typeof object.type !== "object") + if (!$util.isObject(object.type)) throw TypeError(".google.spanner.v1.KeyRecipe.Part.type: object expected"); message.type = $root.google.spanner.v1.Type.fromObject(object.type, long + 1); } if (object.identifier != null) message.identifier = String(object.identifier); if (object.value != null) { - if (typeof object.value !== "object") + if (!$util.isObject(object.value)) throw TypeError(".google.spanner.v1.KeyRecipe.Part.value: object expected"); message.value = $root.google.protobuf.Value.fromObject(object.value, long + 1); } @@ -92533,9 +95343,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Part.toObject = function toObject(message, options) { + Part.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.structIdentifiers = []; @@ -92545,21 +95359,21 @@ object.nullOrder = options.enums === String ? "NULL_ORDER_UNSPECIFIED" : 0; object.type = null; } - if (message.tag != null && message.hasOwnProperty("tag")) + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) object.tag = message.tag; - if (message.order != null && message.hasOwnProperty("order")) + if (message.order != null && Object.hasOwnProperty.call(message, "order")) object.order = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] === undefined ? message.order : $root.google.spanner.v1.KeyRecipe.Part.Order[message.order] : message.order; - if (message.nullOrder != null && message.hasOwnProperty("nullOrder")) + if (message.nullOrder != null && Object.hasOwnProperty.call(message, "nullOrder")) object.nullOrder = options.enums === String ? $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] === undefined ? message.nullOrder : $root.google.spanner.v1.KeyRecipe.Part.NullOrder[message.nullOrder] : message.nullOrder; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - if (message.identifier != null && message.hasOwnProperty("identifier")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options, q + 1); + if (message.identifier != null && Object.hasOwnProperty.call(message, "identifier")) { object.identifier = message.identifier; if (options.oneofs) object.valueType = "identifier"; } - if (message.value != null && message.hasOwnProperty("value")) { - object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { + object.value = $root.google.protobuf.Value.toObject(message.value, options, q + 1); if (options.oneofs) object.valueType = "value"; } @@ -92568,7 +95382,7 @@ for (var j = 0; j < message.structIdentifiers.length; ++j) object.structIdentifiers[j] = message.structIdentifiers[j]; } - if (message.random != null && message.hasOwnProperty("random")) { + if (message.random != null && Object.hasOwnProperty.call(message, "random")) { object.random = message.random; if (options.oneofs) object.valueType = "random"; @@ -92705,14 +95519,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecipeList.encode = function encode(message, writer) { + RecipeList.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.schemaGeneration); if (message.recipe != null && message.recipe.length) for (var i = 0; i < message.recipe.length; ++i) - $root.google.spanner.v1.KeyRecipe.encode(message.recipe[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.KeyRecipe.encode(message.recipe[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -92726,7 +95544,7 @@ * @returns {$protobuf.Writer} Writer */ RecipeList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -92802,10 +95620,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) return "schemaGeneration: buffer expected"; - if (message.recipe != null && message.hasOwnProperty("recipe")) { + if (message.recipe != null && Object.hasOwnProperty.call(message, "recipe")) { if (!Array.isArray(message.recipe)) return "recipe: array expected"; for (var i = 0; i < message.recipe.length; ++i) { @@ -92828,6 +95646,8 @@ RecipeList.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.RecipeList) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.RecipeList: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -92843,7 +95663,7 @@ throw TypeError(".google.spanner.v1.RecipeList.recipe: array expected"); message.recipe = []; for (var i = 0; i < object.recipe.length; ++i) { - if (typeof object.recipe[i] !== "object") + if (!$util.isObject(object.recipe[i])) throw TypeError(".google.spanner.v1.RecipeList.recipe: object expected"); message.recipe[i] = $root.google.spanner.v1.KeyRecipe.fromObject(object.recipe[i], long + 1); } @@ -92860,9 +95680,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RecipeList.toObject = function toObject(message, options) { + RecipeList.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.recipe = []; @@ -92874,12 +95698,12 @@ if (options.bytes !== Array) object.schemaGeneration = $util.newBuffer(object.schemaGeneration); } - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; if (message.recipe && message.recipe.length) { object.recipe = []; for (var j = 0; j < message.recipe.length; ++j) - object.recipe[j] = $root.google.spanner.v1.KeyRecipe.toObject(message.recipe[j], options); + object.recipe[j] = $root.google.spanner.v1.KeyRecipe.toObject(message.recipe[j], options, q + 1); } return object; }; @@ -92995,19 +95819,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CacheUpdate.encode = function encode(message, writer) { + CacheUpdate.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.databaseId); if (message.range != null && message.range.length) for (var i = 0; i < message.range.length; ++i) - $root.google.spanner.v1.Range.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Range.encode(message.range[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.group != null && message.group.length) for (var i = 0; i < message.group.length; ++i) - $root.google.spanner.v1.Group.encode(message.group[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.Group.encode(message.group[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.keyRecipes != null && Object.hasOwnProperty.call(message, "keyRecipes")) - $root.google.spanner.v1.RecipeList.encode(message.keyRecipes, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.RecipeList.encode(message.keyRecipes, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -93021,7 +95849,7 @@ * @returns {$protobuf.Writer} Writer */ CacheUpdate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -93107,10 +95935,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) return "databaseId: integer|Long expected"; - if (message.range != null && message.hasOwnProperty("range")) { + if (message.range != null && Object.hasOwnProperty.call(message, "range")) { if (!Array.isArray(message.range)) return "range: array expected"; for (var i = 0; i < message.range.length; ++i) { @@ -93119,7 +95947,7 @@ return "range." + error; } } - if (message.group != null && message.hasOwnProperty("group")) { + if (message.group != null && Object.hasOwnProperty.call(message, "group")) { if (!Array.isArray(message.group)) return "group: array expected"; for (var i = 0; i < message.group.length; ++i) { @@ -93128,7 +95956,7 @@ return "group." + error; } } - if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) { + if (message.keyRecipes != null && Object.hasOwnProperty.call(message, "keyRecipes")) { var error = $root.google.spanner.v1.RecipeList.verify(message.keyRecipes, long + 1); if (error) return "keyRecipes." + error; @@ -93147,6 +95975,8 @@ CacheUpdate.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.CacheUpdate) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.CacheUpdate: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -93154,7 +95984,7 @@ var message = new $root.google.spanner.v1.CacheUpdate(); if (object.databaseId != null) if ($util.Long) - (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; + message.databaseId = $util.Long.fromValue(object.databaseId, true); else if (typeof object.databaseId === "string") message.databaseId = parseInt(object.databaseId, 10); else if (typeof object.databaseId === "number") @@ -93166,7 +95996,7 @@ throw TypeError(".google.spanner.v1.CacheUpdate.range: array expected"); message.range = []; for (var i = 0; i < object.range.length; ++i) { - if (typeof object.range[i] !== "object") + if (!$util.isObject(object.range[i])) throw TypeError(".google.spanner.v1.CacheUpdate.range: object expected"); message.range[i] = $root.google.spanner.v1.Range.fromObject(object.range[i], long + 1); } @@ -93176,13 +96006,13 @@ throw TypeError(".google.spanner.v1.CacheUpdate.group: array expected"); message.group = []; for (var i = 0; i < object.group.length; ++i) { - if (typeof object.group[i] !== "object") + if (!$util.isObject(object.group[i])) throw TypeError(".google.spanner.v1.CacheUpdate.group: object expected"); message.group[i] = $root.google.spanner.v1.Group.fromObject(object.group[i], long + 1); } } if (object.keyRecipes != null) { - if (typeof object.keyRecipes !== "object") + if (!$util.isObject(object.keyRecipes)) throw TypeError(".google.spanner.v1.CacheUpdate.keyRecipes: object expected"); message.keyRecipes = $root.google.spanner.v1.RecipeList.fromObject(object.keyRecipes, long + 1); } @@ -93198,9 +96028,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CacheUpdate.toObject = function toObject(message, options) { + CacheUpdate.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.range = []; @@ -93209,28 +96043,30 @@ if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, true); - object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.databaseId = options.longs === String ? "0" : 0; + object.databaseId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.keyRecipes = null; } - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (typeof message.databaseId === "number") + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.databaseId = typeof message.databaseId === "number" ? BigInt(message.databaseId) : $util.Long.fromBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0, true).toBigInt(); + else if (typeof message.databaseId === "number") object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; else object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; if (message.range && message.range.length) { object.range = []; for (var j = 0; j < message.range.length; ++j) - object.range[j] = $root.google.spanner.v1.Range.toObject(message.range[j], options); + object.range[j] = $root.google.spanner.v1.Range.toObject(message.range[j], options, q + 1); } if (message.group && message.group.length) { object.group = []; for (var j = 0; j < message.group.length; ++j) - object.group[j] = $root.google.spanner.v1.Group.toObject(message.group[j], options); + object.group[j] = $root.google.spanner.v1.Group.toObject(message.group[j], options, q + 1); } - if (message.keyRecipes != null && message.hasOwnProperty("keyRecipes")) - object.keyRecipes = $root.google.spanner.v1.RecipeList.toObject(message.keyRecipes, options); + if (message.keyRecipes != null && Object.hasOwnProperty.call(message, "keyRecipes")) + object.keyRecipes = $root.google.spanner.v1.RecipeList.toObject(message.keyRecipes, options, q + 1); return object; }; @@ -93398,9 +96234,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RoutingHint.encode = function encode(message, writer) { + RoutingHint.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.operationUid); if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) @@ -93419,7 +96259,7 @@ writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.tabletUid); if (message.skippedTabletUid != null && message.skippedTabletUid.length) for (var i = 0; i < message.skippedTabletUid.length; ++i) - $root.google.spanner.v1.RoutingHint.SkippedTablet.encode(message.skippedTabletUid[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.spanner.v1.RoutingHint.SkippedTablet.encode(message.skippedTabletUid[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.clientLocation != null && Object.hasOwnProperty.call(message, "clientLocation")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.clientLocation); return writer; @@ -93435,7 +96275,7 @@ * @returns {$protobuf.Writer} Writer */ RoutingHint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -93543,31 +96383,31 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operationUid != null && message.hasOwnProperty("operationUid")) + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) if (!$util.isInteger(message.operationUid) && !(message.operationUid && $util.isInteger(message.operationUid.low) && $util.isInteger(message.operationUid.high))) return "operationUid: integer|Long expected"; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) if (!$util.isInteger(message.databaseId) && !(message.databaseId && $util.isInteger(message.databaseId.low) && $util.isInteger(message.databaseId.high))) return "databaseId: integer|Long expected"; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) if (!(message.schemaGeneration && typeof message.schemaGeneration.length === "number" || $util.isString(message.schemaGeneration))) return "schemaGeneration: buffer expected"; - if (message.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) return "key: buffer expected"; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) if (!(message.limitKey && typeof message.limitKey.length === "number" || $util.isString(message.limitKey))) return "limitKey: buffer expected"; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) if (!$util.isInteger(message.groupUid) && !(message.groupUid && $util.isInteger(message.groupUid.low) && $util.isInteger(message.groupUid.high))) return "groupUid: integer|Long expected"; - if (message.splitId != null && message.hasOwnProperty("splitId")) + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) if (!$util.isInteger(message.splitId) && !(message.splitId && $util.isInteger(message.splitId.low) && $util.isInteger(message.splitId.high))) return "splitId: integer|Long expected"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) return "tabletUid: integer|Long expected"; - if (message.skippedTabletUid != null && message.hasOwnProperty("skippedTabletUid")) { + if (message.skippedTabletUid != null && Object.hasOwnProperty.call(message, "skippedTabletUid")) { if (!Array.isArray(message.skippedTabletUid)) return "skippedTabletUid: array expected"; for (var i = 0; i < message.skippedTabletUid.length; ++i) { @@ -93576,7 +96416,7 @@ return "skippedTabletUid." + error; } } - if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) + if (message.clientLocation != null && Object.hasOwnProperty.call(message, "clientLocation")) if (!$util.isString(message.clientLocation)) return "clientLocation: string expected"; return null; @@ -93593,6 +96433,8 @@ RoutingHint.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.RoutingHint) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.RoutingHint: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -93600,7 +96442,7 @@ var message = new $root.google.spanner.v1.RoutingHint(); if (object.operationUid != null) if ($util.Long) - (message.operationUid = $util.Long.fromValue(object.operationUid)).unsigned = true; + message.operationUid = $util.Long.fromValue(object.operationUid, true); else if (typeof object.operationUid === "string") message.operationUid = parseInt(object.operationUid, 10); else if (typeof object.operationUid === "number") @@ -93609,7 +96451,7 @@ message.operationUid = new $util.LongBits(object.operationUid.low >>> 0, object.operationUid.high >>> 0).toNumber(true); if (object.databaseId != null) if ($util.Long) - (message.databaseId = $util.Long.fromValue(object.databaseId)).unsigned = true; + message.databaseId = $util.Long.fromValue(object.databaseId, true); else if (typeof object.databaseId === "string") message.databaseId = parseInt(object.databaseId, 10); else if (typeof object.databaseId === "number") @@ -93633,7 +96475,7 @@ message.limitKey = object.limitKey; if (object.groupUid != null) if ($util.Long) - (message.groupUid = $util.Long.fromValue(object.groupUid)).unsigned = true; + message.groupUid = $util.Long.fromValue(object.groupUid, true); else if (typeof object.groupUid === "string") message.groupUid = parseInt(object.groupUid, 10); else if (typeof object.groupUid === "number") @@ -93642,7 +96484,7 @@ message.groupUid = new $util.LongBits(object.groupUid.low >>> 0, object.groupUid.high >>> 0).toNumber(true); if (object.splitId != null) if ($util.Long) - (message.splitId = $util.Long.fromValue(object.splitId)).unsigned = true; + message.splitId = $util.Long.fromValue(object.splitId, true); else if (typeof object.splitId === "string") message.splitId = parseInt(object.splitId, 10); else if (typeof object.splitId === "number") @@ -93651,7 +96493,7 @@ message.splitId = new $util.LongBits(object.splitId.low >>> 0, object.splitId.high >>> 0).toNumber(true); if (object.tabletUid != null) if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + message.tabletUid = $util.Long.fromValue(object.tabletUid, true); else if (typeof object.tabletUid === "string") message.tabletUid = parseInt(object.tabletUid, 10); else if (typeof object.tabletUid === "number") @@ -93663,7 +96505,7 @@ throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: array expected"); message.skippedTabletUid = []; for (var i = 0; i < object.skippedTabletUid.length; ++i) { - if (typeof object.skippedTabletUid[i] !== "object") + if (!$util.isObject(object.skippedTabletUid[i])) throw TypeError(".google.spanner.v1.RoutingHint.skippedTabletUid: object expected"); message.skippedTabletUid[i] = $root.google.spanner.v1.RoutingHint.SkippedTablet.fromObject(object.skippedTabletUid[i], long + 1); } @@ -93682,23 +96524,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RoutingHint.toObject = function toObject(message, options) { + RoutingHint.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.skippedTabletUid = []; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, true); - object.operationUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.operationUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.operationUid = options.longs === String ? "0" : 0; + object.operationUid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if ($util.Long) { var long = new $util.Long(0, 0, true); - object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.databaseId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.databaseId = options.longs === String ? "0" : 0; + object.databaseId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if (options.bytes === String) object.schemaGeneration = ""; else { @@ -93722,58 +96568,68 @@ } if ($util.Long) { var long = new $util.Long(0, 0, true); - object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.groupUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.groupUid = options.longs === String ? "0" : 0; + object.groupUid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if ($util.Long) { var long = new $util.Long(0, 0, true); - object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.splitId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.splitId = options.longs === String ? "0" : 0; + object.splitId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if ($util.Long) { var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.tabletUid = options.longs === String ? "0" : 0; + object.tabletUid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.clientLocation = ""; } - if (message.operationUid != null && message.hasOwnProperty("operationUid")) - if (typeof message.operationUid === "number") + if (message.operationUid != null && Object.hasOwnProperty.call(message, "operationUid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.operationUid = typeof message.operationUid === "number" ? BigInt(message.operationUid) : $util.Long.fromBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0, true).toBigInt(); + else if (typeof message.operationUid === "number") object.operationUid = options.longs === String ? String(message.operationUid) : message.operationUid; else object.operationUid = options.longs === String ? $util.Long.prototype.toString.call(message.operationUid) : options.longs === Number ? new $util.LongBits(message.operationUid.low >>> 0, message.operationUid.high >>> 0).toNumber(true) : message.operationUid; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (typeof message.databaseId === "number") + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.databaseId = typeof message.databaseId === "number" ? BigInt(message.databaseId) : $util.Long.fromBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0, true).toBigInt(); + else if (typeof message.databaseId === "number") object.databaseId = options.longs === String ? String(message.databaseId) : message.databaseId; else object.databaseId = options.longs === String ? $util.Long.prototype.toString.call(message.databaseId) : options.longs === Number ? new $util.LongBits(message.databaseId.low >>> 0, message.databaseId.high >>> 0).toNumber(true) : message.databaseId; - if (message.schemaGeneration != null && message.hasOwnProperty("schemaGeneration")) + if (message.schemaGeneration != null && Object.hasOwnProperty.call(message, "schemaGeneration")) object.schemaGeneration = options.bytes === String ? $util.base64.encode(message.schemaGeneration, 0, message.schemaGeneration.length) : options.bytes === Array ? Array.prototype.slice.call(message.schemaGeneration) : message.schemaGeneration; - if (message.key != null && message.hasOwnProperty("key")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; - if (message.limitKey != null && message.hasOwnProperty("limitKey")) + if (message.limitKey != null && Object.hasOwnProperty.call(message, "limitKey")) object.limitKey = options.bytes === String ? $util.base64.encode(message.limitKey, 0, message.limitKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.limitKey) : message.limitKey; - if (message.groupUid != null && message.hasOwnProperty("groupUid")) - if (typeof message.groupUid === "number") + if (message.groupUid != null && Object.hasOwnProperty.call(message, "groupUid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.groupUid = typeof message.groupUid === "number" ? BigInt(message.groupUid) : $util.Long.fromBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0, true).toBigInt(); + else if (typeof message.groupUid === "number") object.groupUid = options.longs === String ? String(message.groupUid) : message.groupUid; else object.groupUid = options.longs === String ? $util.Long.prototype.toString.call(message.groupUid) : options.longs === Number ? new $util.LongBits(message.groupUid.low >>> 0, message.groupUid.high >>> 0).toNumber(true) : message.groupUid; - if (message.splitId != null && message.hasOwnProperty("splitId")) - if (typeof message.splitId === "number") + if (message.splitId != null && Object.hasOwnProperty.call(message, "splitId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.splitId = typeof message.splitId === "number" ? BigInt(message.splitId) : $util.Long.fromBits(message.splitId.low >>> 0, message.splitId.high >>> 0, true).toBigInt(); + else if (typeof message.splitId === "number") object.splitId = options.longs === String ? String(message.splitId) : message.splitId; else object.splitId = options.longs === String ? $util.Long.prototype.toString.call(message.splitId) : options.longs === Number ? new $util.LongBits(message.splitId.low >>> 0, message.splitId.high >>> 0).toNumber(true) : message.splitId; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.tabletUid = typeof message.tabletUid === "number" ? BigInt(message.tabletUid) : $util.Long.fromBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0, true).toBigInt(); + else if (typeof message.tabletUid === "number") object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; else object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; if (message.skippedTabletUid && message.skippedTabletUid.length) { object.skippedTabletUid = []; for (var j = 0; j < message.skippedTabletUid.length; ++j) - object.skippedTabletUid[j] = $root.google.spanner.v1.RoutingHint.SkippedTablet.toObject(message.skippedTabletUid[j], options); + object.skippedTabletUid[j] = $root.google.spanner.v1.RoutingHint.SkippedTablet.toObject(message.skippedTabletUid[j], options, q + 1); } - if (message.clientLocation != null && message.hasOwnProperty("clientLocation")) + if (message.clientLocation != null && Object.hasOwnProperty.call(message, "clientLocation")) object.clientLocation = message.clientLocation; return object; }; @@ -93866,9 +96722,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SkippedTablet.encode = function encode(message, writer) { + SkippedTablet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.tabletUid); if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) @@ -93886,7 +96746,7 @@ * @returns {$protobuf.Writer} Writer */ SkippedTablet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -93960,10 +96820,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) if (!$util.isInteger(message.tabletUid) && !(message.tabletUid && $util.isInteger(message.tabletUid.low) && $util.isInteger(message.tabletUid.high))) return "tabletUid: integer|Long expected"; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) if (!(message.incarnation && typeof message.incarnation.length === "number" || $util.isString(message.incarnation))) return "incarnation: buffer expected"; return null; @@ -93980,6 +96840,8 @@ SkippedTablet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.RoutingHint.SkippedTablet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.RoutingHint.SkippedTablet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -93987,7 +96849,7 @@ var message = new $root.google.spanner.v1.RoutingHint.SkippedTablet(); if (object.tabletUid != null) if ($util.Long) - (message.tabletUid = $util.Long.fromValue(object.tabletUid)).unsigned = true; + message.tabletUid = $util.Long.fromValue(object.tabletUid, true); else if (typeof object.tabletUid === "string") message.tabletUid = parseInt(object.tabletUid, 10); else if (typeof object.tabletUid === "number") @@ -94011,16 +96873,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SkippedTablet.toObject = function toObject(message, options) { + SkippedTablet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, true); - object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.tabletUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.tabletUid = options.longs === String ? "0" : 0; + object.tabletUid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if (options.bytes === String) object.incarnation = ""; else { @@ -94029,12 +96895,14 @@ object.incarnation = $util.newBuffer(object.incarnation); } } - if (message.tabletUid != null && message.hasOwnProperty("tabletUid")) - if (typeof message.tabletUid === "number") + if (message.tabletUid != null && Object.hasOwnProperty.call(message, "tabletUid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.tabletUid = typeof message.tabletUid === "number" ? BigInt(message.tabletUid) : $util.Long.fromBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0, true).toBigInt(); + else if (typeof message.tabletUid === "number") object.tabletUid = options.longs === String ? String(message.tabletUid) : message.tabletUid; else object.tabletUid = options.longs === String ? $util.Long.prototype.toString.call(message.tabletUid) : options.longs === Number ? new $util.LongBits(message.tabletUid.low >>> 0, message.tabletUid.high >>> 0).toNumber(true) : message.tabletUid; - if (message.incarnation != null && message.hasOwnProperty("incarnation")) + if (message.incarnation != null && Object.hasOwnProperty.call(message, "incarnation")) object.incarnation = options.bytes === String ? $util.base64.encode(message.incarnation, 0, message.incarnation.length) : options.bytes === Array ? Array.prototype.slice.call(message.incarnation) : message.incarnation; return object; }; @@ -94160,15 +97028,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Type.encode = function encode(message, writer) { + Type.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) - $root.google.spanner.v1.Type.encode(message.arrayElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.arrayElementType, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) - $root.google.spanner.v1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.StructType.encode(message.structType, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.typeAnnotation != null && Object.hasOwnProperty.call(message, "typeAnnotation")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.typeAnnotation); if (message.protoTypeFqn != null && Object.hasOwnProperty.call(message, "protoTypeFqn")) @@ -94186,7 +97058,7 @@ * @returns {$protobuf.Writer} Writer */ Type.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -94272,7 +97144,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) switch (message.code) { default: return "code: enum value expected"; @@ -94295,17 +97167,17 @@ case 17: break; } - if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) { + if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) { var error = $root.google.spanner.v1.Type.verify(message.arrayElementType, long + 1); if (error) return "arrayElementType." + error; } - if (message.structType != null && message.hasOwnProperty("structType")) { + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) { var error = $root.google.spanner.v1.StructType.verify(message.structType, long + 1); if (error) return "structType." + error; } - if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) + if (message.typeAnnotation != null && Object.hasOwnProperty.call(message, "typeAnnotation")) switch (message.typeAnnotation) { default: return "typeAnnotation: enum value expected"; @@ -94315,7 +97187,7 @@ case 4: break; } - if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) + if (message.protoTypeFqn != null && Object.hasOwnProperty.call(message, "protoTypeFqn")) if (!$util.isString(message.protoTypeFqn)) return "protoTypeFqn: string expected"; return null; @@ -94332,6 +97204,8 @@ Type.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Type) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Type: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -94414,12 +97288,12 @@ break; } if (object.arrayElementType != null) { - if (typeof object.arrayElementType !== "object") + if (!$util.isObject(object.arrayElementType)) throw TypeError(".google.spanner.v1.Type.arrayElementType: object expected"); message.arrayElementType = $root.google.spanner.v1.Type.fromObject(object.arrayElementType, long + 1); } if (object.structType != null) { - if (typeof object.structType !== "object") + if (!$util.isObject(object.structType)) throw TypeError(".google.spanner.v1.Type.structType: object expected"); message.structType = $root.google.spanner.v1.StructType.fromObject(object.structType, long + 1); } @@ -94461,9 +97335,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Type.toObject = function toObject(message, options) { + Type.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.code = options.enums === String ? "TYPE_CODE_UNSPECIFIED" : 0; @@ -94472,15 +97350,15 @@ object.typeAnnotation = options.enums === String ? "TYPE_ANNOTATION_CODE_UNSPECIFIED" : 0; object.protoTypeFqn = ""; } - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) object.code = options.enums === String ? $root.google.spanner.v1.TypeCode[message.code] === undefined ? message.code : $root.google.spanner.v1.TypeCode[message.code] : message.code; - if (message.arrayElementType != null && message.hasOwnProperty("arrayElementType")) - object.arrayElementType = $root.google.spanner.v1.Type.toObject(message.arrayElementType, options); - if (message.structType != null && message.hasOwnProperty("structType")) - object.structType = $root.google.spanner.v1.StructType.toObject(message.structType, options); - if (message.typeAnnotation != null && message.hasOwnProperty("typeAnnotation")) + if (message.arrayElementType != null && Object.hasOwnProperty.call(message, "arrayElementType")) + object.arrayElementType = $root.google.spanner.v1.Type.toObject(message.arrayElementType, options, q + 1); + if (message.structType != null && Object.hasOwnProperty.call(message, "structType")) + object.structType = $root.google.spanner.v1.StructType.toObject(message.structType, options, q + 1); + if (message.typeAnnotation != null && Object.hasOwnProperty.call(message, "typeAnnotation")) object.typeAnnotation = options.enums === String ? $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] === undefined ? message.typeAnnotation : $root.google.spanner.v1.TypeAnnotationCode[message.typeAnnotation] : message.typeAnnotation; - if (message.protoTypeFqn != null && message.hasOwnProperty("protoTypeFqn")) + if (message.protoTypeFqn != null && Object.hasOwnProperty.call(message, "protoTypeFqn")) object.protoTypeFqn = message.protoTypeFqn; return object; }; @@ -94568,12 +97446,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StructType.encode = function encode(message, writer) { + StructType.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.fields != null && message.fields.length) for (var i = 0; i < message.fields.length; ++i) - $root.google.spanner.v1.StructType.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.StructType.Field.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -94587,7 +97469,7 @@ * @returns {$protobuf.Writer} Writer */ StructType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -94659,7 +97541,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.fields != null && message.hasOwnProperty("fields")) { + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) { if (!Array.isArray(message.fields)) return "fields: array expected"; for (var i = 0; i < message.fields.length; ++i) { @@ -94682,6 +97564,8 @@ StructType.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.StructType) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.StructType: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -94692,7 +97576,7 @@ throw TypeError(".google.spanner.v1.StructType.fields: array expected"); message.fields = []; for (var i = 0; i < object.fields.length; ++i) { - if (typeof object.fields[i] !== "object") + if (!$util.isObject(object.fields[i])) throw TypeError(".google.spanner.v1.StructType.fields: object expected"); message.fields[i] = $root.google.spanner.v1.StructType.Field.fromObject(object.fields[i], long + 1); } @@ -94709,16 +97593,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StructType.toObject = function toObject(message, options) { + StructType.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.fields = []; if (message.fields && message.fields.length) { object.fields = []; for (var j = 0; j < message.fields.length; ++j) - object.fields[j] = $root.google.spanner.v1.StructType.Field.toObject(message.fields[j], options); + object.fields[j] = $root.google.spanner.v1.StructType.Field.toObject(message.fields[j], options, q + 1); } return object; }; @@ -94811,13 +97699,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Field.encode = function encode(message, writer) { + Field.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -94831,7 +97723,7 @@ * @returns {$protobuf.Writer} Writer */ Field.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -94905,10 +97797,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { var error = $root.google.spanner.v1.Type.verify(message.type, long + 1); if (error) return "type." + error; @@ -94927,6 +97819,8 @@ Field.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.StructType.Field) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.StructType.Field: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -94935,7 +97829,7 @@ if (object.name != null) message.name = String(object.name); if (object.type != null) { - if (typeof object.type !== "object") + if (!$util.isObject(object.type)) throw TypeError(".google.spanner.v1.StructType.Field.type: object expected"); message.type = $root.google.spanner.v1.Type.fromObject(object.type, long + 1); } @@ -94951,18 +97845,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Field.toObject = function toObject(message, options) { + Field.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.type = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options, q + 1); return object; }; @@ -95163,15 +98061,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransactionOptions.encode = function encode(message, writer) { + TransactionOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) - $root.google.spanner.v1.TransactionOptions.ReadWrite.encode(message.readWrite, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.TransactionOptions.ReadWrite.encode(message.readWrite, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - $root.google.spanner.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml")) - $root.google.spanner.v1.TransactionOptions.PartitionedDml.encode(message.partitionedDml, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.TransactionOptions.PartitionedDml.encode(message.partitionedDml, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams); if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) @@ -95189,7 +98091,7 @@ * @returns {$protobuf.Writer} Writer */ TransactionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -95276,7 +98178,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) { properties.mode = 1; { var error = $root.google.spanner.v1.TransactionOptions.ReadWrite.verify(message.readWrite, long + 1); @@ -95284,7 +98186,7 @@ return "readWrite." + error; } } - if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { + if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml")) { if (properties.mode === 1) return "mode: multiple values"; properties.mode = 1; @@ -95294,7 +98196,7 @@ return "partitionedDml." + error; } } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) { if (properties.mode === 1) return "mode: multiple values"; properties.mode = 1; @@ -95304,10 +98206,10 @@ return "readOnly." + error; } } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) if (typeof message.excludeTxnFromChangeStreams !== "boolean") return "excludeTxnFromChangeStreams: boolean expected"; - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) switch (message.isolationLevel) { default: return "isolationLevel: enum value expected"; @@ -95330,23 +98232,25 @@ TransactionOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.TransactionOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.TransactionOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.TransactionOptions(); if (object.readWrite != null) { - if (typeof object.readWrite !== "object") + if (!$util.isObject(object.readWrite)) throw TypeError(".google.spanner.v1.TransactionOptions.readWrite: object expected"); message.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite, long + 1); } if (object.partitionedDml != null) { - if (typeof object.partitionedDml !== "object") + if (!$util.isObject(object.partitionedDml)) throw TypeError(".google.spanner.v1.TransactionOptions.partitionedDml: object expected"); message.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.fromObject(object.partitionedDml, long + 1); } if (object.readOnly != null) { - if (typeof object.readOnly !== "object") + if (!$util.isObject(object.readOnly)) throw TypeError(".google.spanner.v1.TransactionOptions.readOnly: object expected"); message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly, long + 1); } @@ -95384,32 +98288,36 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransactionOptions.toObject = function toObject(message, options) { + TransactionOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.excludeTxnFromChangeStreams = false; object.isolationLevel = options.enums === String ? "ISOLATION_LEVEL_UNSPECIFIED" : 0; } - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { - object.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); + if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) { + object.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options, q + 1); if (options.oneofs) object.mode = "readWrite"; } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - object.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) { + object.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options, q + 1); if (options.oneofs) object.mode = "readOnly"; } - if (message.partitionedDml != null && message.hasOwnProperty("partitionedDml")) { - object.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.toObject(message.partitionedDml, options); + if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml")) { + object.partitionedDml = $root.google.spanner.v1.TransactionOptions.PartitionedDml.toObject(message.partitionedDml, options, q + 1); if (options.oneofs) object.mode = "partitionedDml"; } - if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams")) + if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams")) object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams; - if (message.isolationLevel != null && message.hasOwnProperty("isolationLevel")) + if (message.isolationLevel != null && Object.hasOwnProperty.call(message, "isolationLevel")) object.isolationLevel = options.enums === String ? $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] === undefined ? message.isolationLevel : $root.google.spanner.v1.TransactionOptions.IsolationLevel[message.isolationLevel] : message.isolationLevel; return object; }; @@ -95502,9 +98410,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadWrite.encode = function encode(message, writer) { + ReadWrite.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readLockMode); if (message.multiplexedSessionPreviousTransactionId != null && Object.hasOwnProperty.call(message, "multiplexedSessionPreviousTransactionId")) @@ -95522,7 +98434,7 @@ * @returns {$protobuf.Writer} Writer */ ReadWrite.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -95596,7 +98508,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) switch (message.readLockMode) { default: return "readLockMode: enum value expected"; @@ -95605,7 +98517,7 @@ case 2: break; } - if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) + if (message.multiplexedSessionPreviousTransactionId != null && Object.hasOwnProperty.call(message, "multiplexedSessionPreviousTransactionId")) if (!(message.multiplexedSessionPreviousTransactionId && typeof message.multiplexedSessionPreviousTransactionId.length === "number" || $util.isString(message.multiplexedSessionPreviousTransactionId))) return "multiplexedSessionPreviousTransactionId: buffer expected"; return null; @@ -95622,6 +98534,8 @@ ReadWrite.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadWrite) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.TransactionOptions.ReadWrite: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -95664,9 +98578,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadWrite.toObject = function toObject(message, options) { + ReadWrite.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.readLockMode = options.enums === String ? "READ_LOCK_MODE_UNSPECIFIED" : 0; @@ -95678,9 +98596,9 @@ object.multiplexedSessionPreviousTransactionId = $util.newBuffer(object.multiplexedSessionPreviousTransactionId); } } - if (message.readLockMode != null && message.hasOwnProperty("readLockMode")) + if (message.readLockMode != null && Object.hasOwnProperty.call(message, "readLockMode")) object.readLockMode = options.enums === String ? $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] === undefined ? message.readLockMode : $root.google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode[message.readLockMode] : message.readLockMode; - if (message.multiplexedSessionPreviousTransactionId != null && message.hasOwnProperty("multiplexedSessionPreviousTransactionId")) + if (message.multiplexedSessionPreviousTransactionId != null && Object.hasOwnProperty.call(message, "multiplexedSessionPreviousTransactionId")) object.multiplexedSessionPreviousTransactionId = options.bytes === String ? $util.base64.encode(message.multiplexedSessionPreviousTransactionId, 0, message.multiplexedSessionPreviousTransactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.multiplexedSessionPreviousTransactionId) : message.multiplexedSessionPreviousTransactionId; return object; }; @@ -95774,9 +98692,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionedDml.encode = function encode(message, writer) { + PartitionedDml.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); return writer; }; @@ -95790,7 +98712,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionedDml.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -95870,10 +98792,6 @@ PartitionedDml.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.TransactionOptions.PartitionedDml) return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); return new $root.google.spanner.v1.TransactionOptions.PartitionedDml(); }; @@ -96031,19 +98949,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadOnly.encode = function encode(message, writer) { + ReadOnly.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.strong); if (message.minReadTimestamp != null && Object.hasOwnProperty.call(message, "minReadTimestamp")) - $root.google.protobuf.Timestamp.encode(message.minReadTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.minReadTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) - $root.google.protobuf.Duration.encode(message.maxStaleness, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.maxStaleness, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) - $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.exactStaleness != null && Object.hasOwnProperty.call(message, "exactStaleness")) - $root.google.protobuf.Duration.encode(message.exactStaleness, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.exactStaleness, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.returnReadTimestamp != null && Object.hasOwnProperty.call(message, "returnReadTimestamp")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.returnReadTimestamp); return writer; @@ -96059,7 +98981,7 @@ * @returns {$protobuf.Writer} Writer */ ReadOnly.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -96150,12 +99072,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.strong != null && message.hasOwnProperty("strong")) { + if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) { properties.timestampBound = 1; if (typeof message.strong !== "boolean") return "strong: boolean expected"; } - if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { + if (message.minReadTimestamp != null && Object.hasOwnProperty.call(message, "minReadTimestamp")) { if (properties.timestampBound === 1) return "timestampBound: multiple values"; properties.timestampBound = 1; @@ -96165,7 +99087,7 @@ return "minReadTimestamp." + error; } } - if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { + if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) { if (properties.timestampBound === 1) return "timestampBound: multiple values"; properties.timestampBound = 1; @@ -96175,7 +99097,7 @@ return "maxStaleness." + error; } } - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) { if (properties.timestampBound === 1) return "timestampBound: multiple values"; properties.timestampBound = 1; @@ -96185,7 +99107,7 @@ return "readTimestamp." + error; } } - if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { + if (message.exactStaleness != null && Object.hasOwnProperty.call(message, "exactStaleness")) { if (properties.timestampBound === 1) return "timestampBound: multiple values"; properties.timestampBound = 1; @@ -96195,7 +99117,7 @@ return "exactStaleness." + error; } } - if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) + if (message.returnReadTimestamp != null && Object.hasOwnProperty.call(message, "returnReadTimestamp")) if (typeof message.returnReadTimestamp !== "boolean") return "returnReadTimestamp: boolean expected"; return null; @@ -96212,6 +99134,8 @@ ReadOnly.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.TransactionOptions.ReadOnly) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -96220,22 +99144,22 @@ if (object.strong != null) message.strong = Boolean(object.strong); if (object.minReadTimestamp != null) { - if (typeof object.minReadTimestamp !== "object") + if (!$util.isObject(object.minReadTimestamp)) throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.minReadTimestamp: object expected"); message.minReadTimestamp = $root.google.protobuf.Timestamp.fromObject(object.minReadTimestamp, long + 1); } if (object.maxStaleness != null) { - if (typeof object.maxStaleness !== "object") + if (!$util.isObject(object.maxStaleness)) throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.maxStaleness: object expected"); message.maxStaleness = $root.google.protobuf.Duration.fromObject(object.maxStaleness, long + 1); } if (object.readTimestamp != null) { - if (typeof object.readTimestamp !== "object") + if (!$util.isObject(object.readTimestamp)) throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.readTimestamp: object expected"); message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp, long + 1); } if (object.exactStaleness != null) { - if (typeof object.exactStaleness !== "object") + if (!$util.isObject(object.exactStaleness)) throw TypeError(".google.spanner.v1.TransactionOptions.ReadOnly.exactStaleness: object expected"); message.exactStaleness = $root.google.protobuf.Duration.fromObject(object.exactStaleness, long + 1); } @@ -96253,38 +99177,42 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadOnly.toObject = function toObject(message, options) { + ReadOnly.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.returnReadTimestamp = false; - if (message.strong != null && message.hasOwnProperty("strong")) { + if (message.strong != null && Object.hasOwnProperty.call(message, "strong")) { object.strong = message.strong; if (options.oneofs) object.timestampBound = "strong"; } - if (message.minReadTimestamp != null && message.hasOwnProperty("minReadTimestamp")) { - object.minReadTimestamp = $root.google.protobuf.Timestamp.toObject(message.minReadTimestamp, options); + if (message.minReadTimestamp != null && Object.hasOwnProperty.call(message, "minReadTimestamp")) { + object.minReadTimestamp = $root.google.protobuf.Timestamp.toObject(message.minReadTimestamp, options, q + 1); if (options.oneofs) object.timestampBound = "minReadTimestamp"; } - if (message.maxStaleness != null && message.hasOwnProperty("maxStaleness")) { - object.maxStaleness = $root.google.protobuf.Duration.toObject(message.maxStaleness, options); + if (message.maxStaleness != null && Object.hasOwnProperty.call(message, "maxStaleness")) { + object.maxStaleness = $root.google.protobuf.Duration.toObject(message.maxStaleness, options, q + 1); if (options.oneofs) object.timestampBound = "maxStaleness"; } - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { - object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) { + object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options, q + 1); if (options.oneofs) object.timestampBound = "readTimestamp"; } - if (message.exactStaleness != null && message.hasOwnProperty("exactStaleness")) { - object.exactStaleness = $root.google.protobuf.Duration.toObject(message.exactStaleness, options); + if (message.exactStaleness != null && Object.hasOwnProperty.call(message, "exactStaleness")) { + object.exactStaleness = $root.google.protobuf.Duration.toObject(message.exactStaleness, options, q + 1); if (options.oneofs) object.timestampBound = "exactStaleness"; } - if (message.returnReadTimestamp != null && message.hasOwnProperty("returnReadTimestamp")) + if (message.returnReadTimestamp != null && Object.hasOwnProperty.call(message, "returnReadTimestamp")) object.returnReadTimestamp = message.returnReadTimestamp; return object; }; @@ -96417,17 +99345,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Transaction.encode = function encode(message, writer) { + Transaction.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) - $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -96441,7 +99373,7 @@ * @returns {$protobuf.Writer} Writer */ Transaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -96523,20 +99455,20 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) return "id: buffer expected"; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) { + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.readTimestamp, long + 1); if (error) return "readTimestamp." + error; } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) { var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken, long + 1); if (error) return "precommitToken." + error; } - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) { var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate, long + 1); if (error) return "cacheUpdate." + error; @@ -96555,6 +99487,8 @@ Transaction.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Transaction) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Transaction: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -96566,17 +99500,17 @@ else if (object.id.length >= 0) message.id = object.id; if (object.readTimestamp != null) { - if (typeof object.readTimestamp !== "object") + if (!$util.isObject(object.readTimestamp)) throw TypeError(".google.spanner.v1.Transaction.readTimestamp: object expected"); message.readTimestamp = $root.google.protobuf.Timestamp.fromObject(object.readTimestamp, long + 1); } if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") + if (!$util.isObject(object.precommitToken)) throw TypeError(".google.spanner.v1.Transaction.precommitToken: object expected"); message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken, long + 1); } if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") + if (!$util.isObject(object.cacheUpdate)) throw TypeError(".google.spanner.v1.Transaction.cacheUpdate: object expected"); message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate, long + 1); } @@ -96592,9 +99526,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Transaction.toObject = function toObject(message, options) { + Transaction.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { if (options.bytes === String) @@ -96608,14 +99546,14 @@ object.precommitToken = null; object.cacheUpdate = null; } - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) - object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) + object.readTimestamp = $root.google.protobuf.Timestamp.toObject(message.readTimestamp, options, q + 1); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options, q + 1); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options, q + 1); return object; }; @@ -96733,15 +99671,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TransactionSelector.encode = function encode(message, writer) { + TransactionSelector.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.singleUse != null && Object.hasOwnProperty.call(message, "singleUse")) - $root.google.spanner.v1.TransactionOptions.encode(message.singleUse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.TransactionOptions.encode(message.singleUse, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.id); if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - $root.google.spanner.v1.TransactionOptions.encode(message.begin, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.TransactionOptions.encode(message.begin, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -96755,7 +99697,7 @@ * @returns {$protobuf.Writer} Writer */ TransactionSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -96834,7 +99776,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.singleUse != null && message.hasOwnProperty("singleUse")) { + if (message.singleUse != null && Object.hasOwnProperty.call(message, "singleUse")) { properties.selector = 1; { var error = $root.google.spanner.v1.TransactionOptions.verify(message.singleUse, long + 1); @@ -96842,14 +99784,14 @@ return "singleUse." + error; } } - if (message.id != null && message.hasOwnProperty("id")) { + if (message.id != null && Object.hasOwnProperty.call(message, "id")) { if (properties.selector === 1) return "selector: multiple values"; properties.selector = 1; if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) return "id: buffer expected"; } - if (message.begin != null && message.hasOwnProperty("begin")) { + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) { if (properties.selector === 1) return "selector: multiple values"; properties.selector = 1; @@ -96873,13 +99815,15 @@ TransactionSelector.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.TransactionSelector) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.TransactionSelector: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.TransactionSelector(); if (object.singleUse != null) { - if (typeof object.singleUse !== "object") + if (!$util.isObject(object.singleUse)) throw TypeError(".google.spanner.v1.TransactionSelector.singleUse: object expected"); message.singleUse = $root.google.spanner.v1.TransactionOptions.fromObject(object.singleUse, long + 1); } @@ -96889,7 +99833,7 @@ else if (object.id.length >= 0) message.id = object.id; if (object.begin != null) { - if (typeof object.begin !== "object") + if (!$util.isObject(object.begin)) throw TypeError(".google.spanner.v1.TransactionSelector.begin: object expected"); message.begin = $root.google.spanner.v1.TransactionOptions.fromObject(object.begin, long + 1); } @@ -96905,22 +99849,26 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TransactionSelector.toObject = function toObject(message, options) { + TransactionSelector.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.singleUse != null && message.hasOwnProperty("singleUse")) { - object.singleUse = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUse, options); + if (message.singleUse != null && Object.hasOwnProperty.call(message, "singleUse")) { + object.singleUse = $root.google.spanner.v1.TransactionOptions.toObject(message.singleUse, options, q + 1); if (options.oneofs) object.selector = "singleUse"; } - if (message.id != null && message.hasOwnProperty("id")) { + if (message.id != null && Object.hasOwnProperty.call(message, "id")) { object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; if (options.oneofs) object.selector = "id"; } - if (message.begin != null && message.hasOwnProperty("begin")) { - object.begin = $root.google.spanner.v1.TransactionOptions.toObject(message.begin, options); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) { + object.begin = $root.google.spanner.v1.TransactionOptions.toObject(message.begin, options, q + 1); if (options.oneofs) object.selector = "begin"; } @@ -97018,9 +99966,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MultiplexedSessionPrecommitToken.encode = function encode(message, writer) { + MultiplexedSessionPrecommitToken.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.precommitToken); if (message.seqNum != null && Object.hasOwnProperty.call(message, "seqNum")) @@ -97038,7 +99990,7 @@ * @returns {$protobuf.Writer} Writer */ MultiplexedSessionPrecommitToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -97112,10 +100064,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) if (!(message.precommitToken && typeof message.precommitToken.length === "number" || $util.isString(message.precommitToken))) return "precommitToken: buffer expected"; - if (message.seqNum != null && message.hasOwnProperty("seqNum")) + if (message.seqNum != null && Object.hasOwnProperty.call(message, "seqNum")) if (!$util.isInteger(message.seqNum)) return "seqNum: integer expected"; return null; @@ -97132,6 +100084,8 @@ MultiplexedSessionPrecommitToken.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.MultiplexedSessionPrecommitToken) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.MultiplexedSessionPrecommitToken: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -97156,9 +100110,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MultiplexedSessionPrecommitToken.toObject = function toObject(message, options) { + MultiplexedSessionPrecommitToken.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { if (options.bytes === String) @@ -97170,9 +100128,9 @@ } object.seqNum = 0; } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) object.precommitToken = options.bytes === String ? $util.base64.encode(message.precommitToken, 0, message.precommitToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.precommitToken) : message.precommitToken; - if (message.seqNum != null && message.hasOwnProperty("seqNum")) + if (message.seqNum != null && Object.hasOwnProperty.call(message, "seqNum")) object.seqNum = message.seqNum; return object; }; @@ -97311,17 +100269,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeyRange.encode = function encode(message, writer) { + KeyRange.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.startClosed != null && Object.hasOwnProperty.call(message, "startClosed")) - $root.google.protobuf.ListValue.encode(message.startClosed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.startClosed, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.startOpen != null && Object.hasOwnProperty.call(message, "startOpen")) - $root.google.protobuf.ListValue.encode(message.startOpen, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.startOpen, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.endClosed != null && Object.hasOwnProperty.call(message, "endClosed")) - $root.google.protobuf.ListValue.encode(message.endClosed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.endClosed, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.endOpen != null && Object.hasOwnProperty.call(message, "endOpen")) - $root.google.protobuf.ListValue.encode(message.endOpen, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.endOpen, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -97335,7 +100297,7 @@ * @returns {$protobuf.Writer} Writer */ KeyRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -97418,7 +100380,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.startClosed != null && message.hasOwnProperty("startClosed")) { + if (message.startClosed != null && Object.hasOwnProperty.call(message, "startClosed")) { properties.startKeyType = 1; { var error = $root.google.protobuf.ListValue.verify(message.startClosed, long + 1); @@ -97426,7 +100388,7 @@ return "startClosed." + error; } } - if (message.startOpen != null && message.hasOwnProperty("startOpen")) { + if (message.startOpen != null && Object.hasOwnProperty.call(message, "startOpen")) { if (properties.startKeyType === 1) return "startKeyType: multiple values"; properties.startKeyType = 1; @@ -97436,7 +100398,7 @@ return "startOpen." + error; } } - if (message.endClosed != null && message.hasOwnProperty("endClosed")) { + if (message.endClosed != null && Object.hasOwnProperty.call(message, "endClosed")) { properties.endKeyType = 1; { var error = $root.google.protobuf.ListValue.verify(message.endClosed, long + 1); @@ -97444,7 +100406,7 @@ return "endClosed." + error; } } - if (message.endOpen != null && message.hasOwnProperty("endOpen")) { + if (message.endOpen != null && Object.hasOwnProperty.call(message, "endOpen")) { if (properties.endKeyType === 1) return "endKeyType: multiple values"; properties.endKeyType = 1; @@ -97468,28 +100430,30 @@ KeyRange.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.KeyRange) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.KeyRange: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.KeyRange(); if (object.startClosed != null) { - if (typeof object.startClosed !== "object") + if (!$util.isObject(object.startClosed)) throw TypeError(".google.spanner.v1.KeyRange.startClosed: object expected"); message.startClosed = $root.google.protobuf.ListValue.fromObject(object.startClosed, long + 1); } if (object.startOpen != null) { - if (typeof object.startOpen !== "object") + if (!$util.isObject(object.startOpen)) throw TypeError(".google.spanner.v1.KeyRange.startOpen: object expected"); message.startOpen = $root.google.protobuf.ListValue.fromObject(object.startOpen, long + 1); } if (object.endClosed != null) { - if (typeof object.endClosed !== "object") + if (!$util.isObject(object.endClosed)) throw TypeError(".google.spanner.v1.KeyRange.endClosed: object expected"); message.endClosed = $root.google.protobuf.ListValue.fromObject(object.endClosed, long + 1); } if (object.endOpen != null) { - if (typeof object.endOpen !== "object") + if (!$util.isObject(object.endOpen)) throw TypeError(".google.spanner.v1.KeyRange.endOpen: object expected"); message.endOpen = $root.google.protobuf.ListValue.fromObject(object.endOpen, long + 1); } @@ -97505,27 +100469,31 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KeyRange.toObject = function toObject(message, options) { + KeyRange.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.startClosed != null && message.hasOwnProperty("startClosed")) { - object.startClosed = $root.google.protobuf.ListValue.toObject(message.startClosed, options); + if (message.startClosed != null && Object.hasOwnProperty.call(message, "startClosed")) { + object.startClosed = $root.google.protobuf.ListValue.toObject(message.startClosed, options, q + 1); if (options.oneofs) object.startKeyType = "startClosed"; } - if (message.startOpen != null && message.hasOwnProperty("startOpen")) { - object.startOpen = $root.google.protobuf.ListValue.toObject(message.startOpen, options); + if (message.startOpen != null && Object.hasOwnProperty.call(message, "startOpen")) { + object.startOpen = $root.google.protobuf.ListValue.toObject(message.startOpen, options, q + 1); if (options.oneofs) object.startKeyType = "startOpen"; } - if (message.endClosed != null && message.hasOwnProperty("endClosed")) { - object.endClosed = $root.google.protobuf.ListValue.toObject(message.endClosed, options); + if (message.endClosed != null && Object.hasOwnProperty.call(message, "endClosed")) { + object.endClosed = $root.google.protobuf.ListValue.toObject(message.endClosed, options, q + 1); if (options.oneofs) object.endKeyType = "endClosed"; } - if (message.endOpen != null && message.hasOwnProperty("endOpen")) { - object.endOpen = $root.google.protobuf.ListValue.toObject(message.endOpen, options); + if (message.endOpen != null && Object.hasOwnProperty.call(message, "endOpen")) { + object.endOpen = $root.google.protobuf.ListValue.toObject(message.endOpen, options, q + 1); if (options.oneofs) object.endKeyType = "endOpen"; } @@ -97634,15 +100602,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeySet.encode = function encode(message, writer) { + KeySet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) - $root.google.protobuf.ListValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.ranges != null && message.ranges.length) for (var i = 0; i < message.ranges.length; ++i) - $root.google.spanner.v1.KeyRange.encode(message.ranges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.KeyRange.encode(message.ranges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.all != null && Object.hasOwnProperty.call(message, "all")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all); return writer; @@ -97658,7 +100630,7 @@ * @returns {$protobuf.Writer} Writer */ KeySet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -97740,7 +100712,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.keys != null && message.hasOwnProperty("keys")) { + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) { if (!Array.isArray(message.keys)) return "keys: array expected"; for (var i = 0; i < message.keys.length; ++i) { @@ -97749,7 +100721,7 @@ return "keys." + error; } } - if (message.ranges != null && message.hasOwnProperty("ranges")) { + if (message.ranges != null && Object.hasOwnProperty.call(message, "ranges")) { if (!Array.isArray(message.ranges)) return "ranges: array expected"; for (var i = 0; i < message.ranges.length; ++i) { @@ -97758,7 +100730,7 @@ return "ranges." + error; } } - if (message.all != null && message.hasOwnProperty("all")) + if (message.all != null && Object.hasOwnProperty.call(message, "all")) if (typeof message.all !== "boolean") return "all: boolean expected"; return null; @@ -97775,6 +100747,8 @@ KeySet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.KeySet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.KeySet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -97785,7 +100759,7 @@ throw TypeError(".google.spanner.v1.KeySet.keys: array expected"); message.keys = []; for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") + if (!$util.isObject(object.keys[i])) throw TypeError(".google.spanner.v1.KeySet.keys: object expected"); message.keys[i] = $root.google.protobuf.ListValue.fromObject(object.keys[i], long + 1); } @@ -97795,7 +100769,7 @@ throw TypeError(".google.spanner.v1.KeySet.ranges: array expected"); message.ranges = []; for (var i = 0; i < object.ranges.length; ++i) { - if (typeof object.ranges[i] !== "object") + if (!$util.isObject(object.ranges[i])) throw TypeError(".google.spanner.v1.KeySet.ranges: object expected"); message.ranges[i] = $root.google.spanner.v1.KeyRange.fromObject(object.ranges[i], long + 1); } @@ -97814,9 +100788,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KeySet.toObject = function toObject(message, options) { + KeySet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.keys = []; @@ -97827,14 +100805,14 @@ if (message.keys && message.keys.length) { object.keys = []; for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.protobuf.ListValue.toObject(message.keys[j], options); + object.keys[j] = $root.google.protobuf.ListValue.toObject(message.keys[j], options, q + 1); } if (message.ranges && message.ranges.length) { object.ranges = []; for (var j = 0; j < message.ranges.length; ++j) - object.ranges[j] = $root.google.spanner.v1.KeyRange.toObject(message.ranges[j], options); + object.ranges[j] = $root.google.spanner.v1.KeyRange.toObject(message.ranges[j], options, q + 1); } - if (message.all != null && message.hasOwnProperty("all")) + if (message.all != null && Object.hasOwnProperty.call(message, "all")) object.all = message.all; return object; }; @@ -97989,23 +100967,27 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Mutation.encode = function encode(message, writer) { + Mutation.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) - $root.google.spanner.v1.Mutation.Write.encode(message.insert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.Mutation.Write.encode(message.insert, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.spanner.v1.Mutation.Write.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Mutation.Write.encode(message.update, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) - $root.google.spanner.v1.Mutation.Write.encode(message.insertOrUpdate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.Mutation.Write.encode(message.insertOrUpdate, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) - $root.google.spanner.v1.Mutation.Write.encode(message.replace, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.Mutation.Write.encode(message.replace, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - $root.google.spanner.v1.Mutation.Delete.encode(message["delete"], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.Mutation.Delete.encode(message["delete"], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.send != null && Object.hasOwnProperty.call(message, "send")) - $root.google.spanner.v1.Mutation.Send.encode(message.send, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.Mutation.Send.encode(message.send, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) - $root.google.spanner.v1.Mutation.Ack.encode(message.ack, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.v1.Mutation.Ack.encode(message.ack, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -98019,7 +101001,7 @@ * @returns {$protobuf.Writer} Writer */ Mutation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -98114,7 +101096,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.insert != null && message.hasOwnProperty("insert")) { + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) { properties.operation = 1; { var error = $root.google.spanner.v1.Mutation.Write.verify(message.insert, long + 1); @@ -98122,7 +101104,7 @@ return "insert." + error; } } - if (message.update != null && message.hasOwnProperty("update")) { + if (message.update != null && Object.hasOwnProperty.call(message, "update")) { if (properties.operation === 1) return "operation: multiple values"; properties.operation = 1; @@ -98132,7 +101114,7 @@ return "update." + error; } } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { + if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) { if (properties.operation === 1) return "operation: multiple values"; properties.operation = 1; @@ -98142,7 +101124,7 @@ return "insertOrUpdate." + error; } } - if (message.replace != null && message.hasOwnProperty("replace")) { + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) { if (properties.operation === 1) return "operation: multiple values"; properties.operation = 1; @@ -98152,7 +101134,7 @@ return "replace." + error; } } - if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) { if (properties.operation === 1) return "operation: multiple values"; properties.operation = 1; @@ -98162,7 +101144,7 @@ return "delete." + error; } } - if (message.send != null && message.hasOwnProperty("send")) { + if (message.send != null && Object.hasOwnProperty.call(message, "send")) { if (properties.operation === 1) return "operation: multiple values"; properties.operation = 1; @@ -98172,7 +101154,7 @@ return "send." + error; } } - if (message.ack != null && message.hasOwnProperty("ack")) { + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) { if (properties.operation === 1) return "operation: multiple values"; properties.operation = 1; @@ -98196,43 +101178,45 @@ Mutation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Mutation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Mutation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.Mutation(); if (object.insert != null) { - if (typeof object.insert !== "object") + if (!$util.isObject(object.insert)) throw TypeError(".google.spanner.v1.Mutation.insert: object expected"); message.insert = $root.google.spanner.v1.Mutation.Write.fromObject(object.insert, long + 1); } if (object.update != null) { - if (typeof object.update !== "object") + if (!$util.isObject(object.update)) throw TypeError(".google.spanner.v1.Mutation.update: object expected"); message.update = $root.google.spanner.v1.Mutation.Write.fromObject(object.update, long + 1); } if (object.insertOrUpdate != null) { - if (typeof object.insertOrUpdate !== "object") + if (!$util.isObject(object.insertOrUpdate)) throw TypeError(".google.spanner.v1.Mutation.insertOrUpdate: object expected"); message.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.fromObject(object.insertOrUpdate, long + 1); } if (object.replace != null) { - if (typeof object.replace !== "object") + if (!$util.isObject(object.replace)) throw TypeError(".google.spanner.v1.Mutation.replace: object expected"); message.replace = $root.google.spanner.v1.Mutation.Write.fromObject(object.replace, long + 1); } if (object["delete"] != null) { - if (typeof object["delete"] !== "object") + if (!$util.isObject(object["delete"])) throw TypeError(".google.spanner.v1.Mutation.delete: object expected"); message["delete"] = $root.google.spanner.v1.Mutation.Delete.fromObject(object["delete"], long + 1); } if (object.send != null) { - if (typeof object.send !== "object") + if (!$util.isObject(object.send)) throw TypeError(".google.spanner.v1.Mutation.send: object expected"); message.send = $root.google.spanner.v1.Mutation.Send.fromObject(object.send, long + 1); } if (object.ack != null) { - if (typeof object.ack !== "object") + if (!$util.isObject(object.ack)) throw TypeError(".google.spanner.v1.Mutation.ack: object expected"); message.ack = $root.google.spanner.v1.Mutation.Ack.fromObject(object.ack, long + 1); } @@ -98248,42 +101232,46 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Mutation.toObject = function toObject(message, options) { + Mutation.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.insert != null && message.hasOwnProperty("insert")) { - object.insert = $root.google.spanner.v1.Mutation.Write.toObject(message.insert, options); + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) { + object.insert = $root.google.spanner.v1.Mutation.Write.toObject(message.insert, options, q + 1); if (options.oneofs) object.operation = "insert"; } - if (message.update != null && message.hasOwnProperty("update")) { - object.update = $root.google.spanner.v1.Mutation.Write.toObject(message.update, options); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) { + object.update = $root.google.spanner.v1.Mutation.Write.toObject(message.update, options, q + 1); if (options.oneofs) object.operation = "update"; } - if (message.insertOrUpdate != null && message.hasOwnProperty("insertOrUpdate")) { - object.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.toObject(message.insertOrUpdate, options); + if (message.insertOrUpdate != null && Object.hasOwnProperty.call(message, "insertOrUpdate")) { + object.insertOrUpdate = $root.google.spanner.v1.Mutation.Write.toObject(message.insertOrUpdate, options, q + 1); if (options.oneofs) object.operation = "insertOrUpdate"; } - if (message.replace != null && message.hasOwnProperty("replace")) { - object.replace = $root.google.spanner.v1.Mutation.Write.toObject(message.replace, options); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) { + object.replace = $root.google.spanner.v1.Mutation.Write.toObject(message.replace, options, q + 1); if (options.oneofs) object.operation = "replace"; } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = $root.google.spanner.v1.Mutation.Delete.toObject(message["delete"], options); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) { + object["delete"] = $root.google.spanner.v1.Mutation.Delete.toObject(message["delete"], options, q + 1); if (options.oneofs) object.operation = "delete"; } - if (message.send != null && message.hasOwnProperty("send")) { - object.send = $root.google.spanner.v1.Mutation.Send.toObject(message.send, options); + if (message.send != null && Object.hasOwnProperty.call(message, "send")) { + object.send = $root.google.spanner.v1.Mutation.Send.toObject(message.send, options, q + 1); if (options.oneofs) object.operation = "send"; } - if (message.ack != null && message.hasOwnProperty("ack")) { - object.ack = $root.google.spanner.v1.Mutation.Ack.toObject(message.ack, options); + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) { + object.ack = $root.google.spanner.v1.Mutation.Ack.toObject(message.ack, options, q + 1); if (options.oneofs) object.operation = "ack"; } @@ -98389,9 +101377,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Write.encode = function encode(message, writer) { + Write.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); if (message.columns != null && message.columns.length) @@ -98399,7 +101391,7 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]); if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.ListValue.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -98413,7 +101405,7 @@ * @returns {$protobuf.Writer} Writer */ Write.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -98495,17 +101487,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.columns != null && message.hasOwnProperty("columns")) { + if (message.columns != null && Object.hasOwnProperty.call(message, "columns")) { if (!Array.isArray(message.columns)) return "columns: array expected"; for (var i = 0; i < message.columns.length; ++i) if (!$util.isString(message.columns[i])) return "columns: string[] expected"; } - if (message.values != null && message.hasOwnProperty("values")) { + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { if (!Array.isArray(message.values)) return "values: array expected"; for (var i = 0; i < message.values.length; ++i) { @@ -98528,6 +101520,8 @@ Write.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Mutation.Write) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Mutation.Write: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -98547,7 +101541,7 @@ throw TypeError(".google.spanner.v1.Mutation.Write.values: array expected"); message.values = []; for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") + if (!$util.isObject(object.values[i])) throw TypeError(".google.spanner.v1.Mutation.Write.values: object expected"); message.values[i] = $root.google.protobuf.ListValue.fromObject(object.values[i], long + 1); } @@ -98564,9 +101558,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Write.toObject = function toObject(message, options) { + Write.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.columns = []; @@ -98574,7 +101572,7 @@ } if (options.defaults) object.table = ""; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; if (message.columns && message.columns.length) { object.columns = []; @@ -98584,7 +101582,7 @@ if (message.values && message.values.length) { object.values = []; for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.ListValue.toObject(message.values[j], options); + object.values[j] = $root.google.protobuf.ListValue.toObject(message.values[j], options, q + 1); } return object; }; @@ -98680,13 +101678,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Delete.encode = function encode(message, writer) { + Delete.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.table != null && Object.hasOwnProperty.call(message, "table")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.table); if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) - $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.KeySet.encode(message.keySet, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -98700,7 +101702,7 @@ * @returns {$protobuf.Writer} Writer */ Delete.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -98774,10 +101776,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.keySet != null && message.hasOwnProperty("keySet")) { + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) { var error = $root.google.spanner.v1.KeySet.verify(message.keySet, long + 1); if (error) return "keySet." + error; @@ -98796,6 +101798,8 @@ Delete.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Mutation.Delete) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Mutation.Delete: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -98804,7 +101808,7 @@ if (object.table != null) message.table = String(object.table); if (object.keySet != null) { - if (typeof object.keySet !== "object") + if (!$util.isObject(object.keySet)) throw TypeError(".google.spanner.v1.Mutation.Delete.keySet: object expected"); message.keySet = $root.google.spanner.v1.KeySet.fromObject(object.keySet, long + 1); } @@ -98820,18 +101824,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Delete.toObject = function toObject(message, options) { + Delete.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.table = ""; object.keySet = null; } - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; - if (message.keySet != null && message.hasOwnProperty("keySet")) - object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options); + if (message.keySet != null && Object.hasOwnProperty.call(message, "keySet")) + object.keySet = $root.google.spanner.v1.KeySet.toObject(message.keySet, options, q + 1); return object; }; @@ -98944,17 +101952,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Send.encode = function encode(message, writer) { + Send.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.deliverTime != null && Object.hasOwnProperty.call(message, "deliverTime")) - $root.google.protobuf.Timestamp.encode(message.deliverTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.deliverTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Value.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -98968,7 +101980,7 @@ * @returns {$protobuf.Writer} Writer */ Send.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -99050,20 +102062,20 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.queue != null && message.hasOwnProperty("queue")) + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) if (!$util.isString(message.queue)) return "queue: string expected"; - if (message.key != null && message.hasOwnProperty("key")) { + if (message.key != null && Object.hasOwnProperty.call(message, "key")) { var error = $root.google.protobuf.ListValue.verify(message.key, long + 1); if (error) return "key." + error; } - if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) { + if (message.deliverTime != null && Object.hasOwnProperty.call(message, "deliverTime")) { var error = $root.google.protobuf.Timestamp.verify(message.deliverTime, long + 1); if (error) return "deliverTime." + error; } - if (message.payload != null && message.hasOwnProperty("payload")) { + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) { var error = $root.google.protobuf.Value.verify(message.payload, long + 1); if (error) return "payload." + error; @@ -99082,6 +102094,8 @@ Send.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Mutation.Send) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Mutation.Send: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -99090,17 +102104,17 @@ if (object.queue != null) message.queue = String(object.queue); if (object.key != null) { - if (typeof object.key !== "object") + if (!$util.isObject(object.key)) throw TypeError(".google.spanner.v1.Mutation.Send.key: object expected"); message.key = $root.google.protobuf.ListValue.fromObject(object.key, long + 1); } if (object.deliverTime != null) { - if (typeof object.deliverTime !== "object") + if (!$util.isObject(object.deliverTime)) throw TypeError(".google.spanner.v1.Mutation.Send.deliverTime: object expected"); message.deliverTime = $root.google.protobuf.Timestamp.fromObject(object.deliverTime, long + 1); } if (object.payload != null) { - if (typeof object.payload !== "object") + if (!$util.isObject(object.payload)) throw TypeError(".google.spanner.v1.Mutation.Send.payload: object expected"); message.payload = $root.google.protobuf.Value.fromObject(object.payload, long + 1); } @@ -99116,9 +102130,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Send.toObject = function toObject(message, options) { + Send.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.queue = ""; @@ -99126,14 +102144,14 @@ object.deliverTime = null; object.payload = null; } - if (message.queue != null && message.hasOwnProperty("queue")) + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) object.queue = message.queue; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.protobuf.ListValue.toObject(message.key, options); - if (message.deliverTime != null && message.hasOwnProperty("deliverTime")) - object.deliverTime = $root.google.protobuf.Timestamp.toObject(message.deliverTime, options); - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Value.toObject(message.payload, options); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + object.key = $root.google.protobuf.ListValue.toObject(message.key, options, q + 1); + if (message.deliverTime != null && Object.hasOwnProperty.call(message, "deliverTime")) + object.deliverTime = $root.google.protobuf.Timestamp.toObject(message.deliverTime, options, q + 1); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + object.payload = $root.google.protobuf.Value.toObject(message.payload, options, q + 1); return object; }; @@ -99237,13 +102255,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Ack.encode = function encode(message, writer) { + Ack.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.queue); if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.key, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.ignoreNotFound != null && Object.hasOwnProperty.call(message, "ignoreNotFound")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreNotFound); return writer; @@ -99259,7 +102281,7 @@ * @returns {$protobuf.Writer} Writer */ Ack.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -99337,15 +102359,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.queue != null && message.hasOwnProperty("queue")) + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) if (!$util.isString(message.queue)) return "queue: string expected"; - if (message.key != null && message.hasOwnProperty("key")) { + if (message.key != null && Object.hasOwnProperty.call(message, "key")) { var error = $root.google.protobuf.ListValue.verify(message.key, long + 1); if (error) return "key." + error; } - if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) + if (message.ignoreNotFound != null && Object.hasOwnProperty.call(message, "ignoreNotFound")) if (typeof message.ignoreNotFound !== "boolean") return "ignoreNotFound: boolean expected"; return null; @@ -99362,6 +102384,8 @@ Ack.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.Mutation.Ack) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.Mutation.Ack: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -99370,7 +102394,7 @@ if (object.queue != null) message.queue = String(object.queue); if (object.key != null) { - if (typeof object.key !== "object") + if (!$util.isObject(object.key)) throw TypeError(".google.spanner.v1.Mutation.Ack.key: object expected"); message.key = $root.google.protobuf.ListValue.fromObject(object.key, long + 1); } @@ -99388,20 +102412,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Ack.toObject = function toObject(message, options) { + Ack.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.queue = ""; object.key = null; object.ignoreNotFound = false; } - if (message.queue != null && message.hasOwnProperty("queue")) + if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) object.queue = message.queue; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.protobuf.ListValue.toObject(message.key, options); - if (message.ignoreNotFound != null && message.hasOwnProperty("ignoreNotFound")) + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + object.key = $root.google.protobuf.ListValue.toObject(message.key, options, q + 1); + if (message.ignoreNotFound != null && Object.hasOwnProperty.call(message, "ignoreNotFound")) object.ignoreNotFound = message.ignoreNotFound; return object; }; @@ -99528,20 +102556,24 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResultSet.encode = function encode(message, writer) { + ResultSet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.rows != null && message.rows.length) for (var i = 0; i < message.rows.length; ++i) - $root.google.protobuf.ListValue.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.ListValue.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -99555,7 +102587,7 @@ * @returns {$protobuf.Writer} Writer */ ResultSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -99643,12 +102675,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.rows != null && message.hasOwnProperty("rows")) { + if (message.rows != null && Object.hasOwnProperty.call(message, "rows")) { if (!Array.isArray(message.rows)) return "rows: array expected"; for (var i = 0; i < message.rows.length; ++i) { @@ -99657,17 +102689,17 @@ return "rows." + error; } } - if (message.stats != null && message.hasOwnProperty("stats")) { + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) { var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats, long + 1); if (error) return "stats." + error; } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) { var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken, long + 1); if (error) return "precommitToken." + error; } - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) { var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate, long + 1); if (error) return "cacheUpdate." + error; @@ -99686,13 +102718,15 @@ ResultSet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ResultSet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ResultSet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ResultSet(); if (object.metadata != null) { - if (typeof object.metadata !== "object") + if (!$util.isObject(object.metadata)) throw TypeError(".google.spanner.v1.ResultSet.metadata: object expected"); message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata, long + 1); } @@ -99701,23 +102735,23 @@ throw TypeError(".google.spanner.v1.ResultSet.rows: array expected"); message.rows = []; for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") + if (!$util.isObject(object.rows[i])) throw TypeError(".google.spanner.v1.ResultSet.rows: object expected"); message.rows[i] = $root.google.protobuf.ListValue.fromObject(object.rows[i], long + 1); } } if (object.stats != null) { - if (typeof object.stats !== "object") + if (!$util.isObject(object.stats)) throw TypeError(".google.spanner.v1.ResultSet.stats: object expected"); message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats, long + 1); } if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") + if (!$util.isObject(object.precommitToken)) throw TypeError(".google.spanner.v1.ResultSet.precommitToken: object expected"); message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken, long + 1); } if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") + if (!$util.isObject(object.cacheUpdate)) throw TypeError(".google.spanner.v1.ResultSet.cacheUpdate: object expected"); message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate, long + 1); } @@ -99733,9 +102767,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResultSet.toObject = function toObject(message, options) { + ResultSet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.rows = []; @@ -99745,19 +102783,19 @@ object.precommitToken = null; object.cacheUpdate = null; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options, q + 1); if (message.rows && message.rows.length) { object.rows = []; for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.protobuf.ListValue.toObject(message.rows[j], options); - } - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); + object.rows[j] = $root.google.protobuf.ListValue.toObject(message.rows[j], options, q + 1); + } + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options, q + 1); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options, q + 1); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options, q + 1); return object; }; @@ -99907,26 +102945,30 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartialResultSet.encode = function encode(message, writer) { + PartialResultSet.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.ResultSetMetadata.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.chunkedValue != null && Object.hasOwnProperty.call(message, "chunkedValue")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.chunkedValue); if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.resumeToken); if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.ResultSetStats.encode(message.stats, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) - $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.spanner.v1.MultiplexedSessionPrecommitToken.encode(message.precommitToken, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.last != null && Object.hasOwnProperty.call(message, "last")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.last); if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) - $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.spanner.v1.CacheUpdate.encode(message.cacheUpdate, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); return writer; }; @@ -99940,7 +102982,7 @@ * @returns {$protobuf.Writer} Writer */ PartialResultSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -100040,12 +103082,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { var error = $root.google.spanner.v1.ResultSetMetadata.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.values != null && message.hasOwnProperty("values")) { + if (message.values != null && Object.hasOwnProperty.call(message, "values")) { if (!Array.isArray(message.values)) return "values: array expected"; for (var i = 0; i < message.values.length; ++i) { @@ -100054,26 +103096,26 @@ return "values." + error; } } - if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) + if (message.chunkedValue != null && Object.hasOwnProperty.call(message, "chunkedValue")) if (typeof message.chunkedValue !== "boolean") return "chunkedValue: boolean expected"; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) if (!(message.resumeToken && typeof message.resumeToken.length === "number" || $util.isString(message.resumeToken))) return "resumeToken: buffer expected"; - if (message.stats != null && message.hasOwnProperty("stats")) { + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) { var error = $root.google.spanner.v1.ResultSetStats.verify(message.stats, long + 1); if (error) return "stats." + error; } - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) { + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) { var error = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.verify(message.precommitToken, long + 1); if (error) return "precommitToken." + error; } - if (message.last != null && message.hasOwnProperty("last")) + if (message.last != null && Object.hasOwnProperty.call(message, "last")) if (typeof message.last !== "boolean") return "last: boolean expected"; - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) { + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) { var error = $root.google.spanner.v1.CacheUpdate.verify(message.cacheUpdate, long + 1); if (error) return "cacheUpdate." + error; @@ -100092,13 +103134,15 @@ PartialResultSet.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PartialResultSet) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PartialResultSet: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.PartialResultSet(); if (object.metadata != null) { - if (typeof object.metadata !== "object") + if (!$util.isObject(object.metadata)) throw TypeError(".google.spanner.v1.PartialResultSet.metadata: object expected"); message.metadata = $root.google.spanner.v1.ResultSetMetadata.fromObject(object.metadata, long + 1); } @@ -100107,7 +103151,7 @@ throw TypeError(".google.spanner.v1.PartialResultSet.values: array expected"); message.values = []; for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") + if (!$util.isObject(object.values[i])) throw TypeError(".google.spanner.v1.PartialResultSet.values: object expected"); message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i], long + 1); } @@ -100120,19 +103164,19 @@ else if (object.resumeToken.length >= 0) message.resumeToken = object.resumeToken; if (object.stats != null) { - if (typeof object.stats !== "object") + if (!$util.isObject(object.stats)) throw TypeError(".google.spanner.v1.PartialResultSet.stats: object expected"); message.stats = $root.google.spanner.v1.ResultSetStats.fromObject(object.stats, long + 1); } if (object.precommitToken != null) { - if (typeof object.precommitToken !== "object") + if (!$util.isObject(object.precommitToken)) throw TypeError(".google.spanner.v1.PartialResultSet.precommitToken: object expected"); message.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.fromObject(object.precommitToken, long + 1); } if (object.last != null) message.last = Boolean(object.last); if (object.cacheUpdate != null) { - if (typeof object.cacheUpdate !== "object") + if (!$util.isObject(object.cacheUpdate)) throw TypeError(".google.spanner.v1.PartialResultSet.cacheUpdate: object expected"); message.cacheUpdate = $root.google.spanner.v1.CacheUpdate.fromObject(object.cacheUpdate, long + 1); } @@ -100148,9 +103192,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartialResultSet.toObject = function toObject(message, options) { + PartialResultSet.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.values = []; @@ -100169,25 +103217,25 @@ object.last = false; object.cacheUpdate = null; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.spanner.v1.ResultSetMetadata.toObject(message.metadata, options, q + 1); if (message.values && message.values.length) { object.values = []; for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options, q + 1); } - if (message.chunkedValue != null && message.hasOwnProperty("chunkedValue")) + if (message.chunkedValue != null && Object.hasOwnProperty.call(message, "chunkedValue")) object.chunkedValue = message.chunkedValue; - if (message.resumeToken != null && message.hasOwnProperty("resumeToken")) + if (message.resumeToken != null && Object.hasOwnProperty.call(message, "resumeToken")) object.resumeToken = options.bytes === String ? $util.base64.encode(message.resumeToken, 0, message.resumeToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.resumeToken) : message.resumeToken; - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options); - if (message.precommitToken != null && message.hasOwnProperty("precommitToken")) - object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options); - if (message.last != null && message.hasOwnProperty("last")) + if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) + object.stats = $root.google.spanner.v1.ResultSetStats.toObject(message.stats, options, q + 1); + if (message.precommitToken != null && Object.hasOwnProperty.call(message, "precommitToken")) + object.precommitToken = $root.google.spanner.v1.MultiplexedSessionPrecommitToken.toObject(message.precommitToken, options, q + 1); + if (message.last != null && Object.hasOwnProperty.call(message, "last")) object.last = message.last; - if (message.cacheUpdate != null && message.hasOwnProperty("cacheUpdate")) - object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options); + if (message.cacheUpdate != null && Object.hasOwnProperty.call(message, "cacheUpdate")) + object.cacheUpdate = $root.google.spanner.v1.CacheUpdate.toObject(message.cacheUpdate, options, q + 1); return object; }; @@ -100291,15 +103339,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResultSetMetadata.encode = function encode(message, writer) { + ResultSetMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) - $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.StructType.encode(message.rowType, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Transaction.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.undeclaredParameters != null && Object.hasOwnProperty.call(message, "undeclaredParameters")) - $root.google.spanner.v1.StructType.encode(message.undeclaredParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.StructType.encode(message.undeclaredParameters, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -100313,7 +103365,7 @@ * @returns {$protobuf.Writer} Writer */ ResultSetMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -100391,17 +103443,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rowType != null && message.hasOwnProperty("rowType")) { + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) { var error = $root.google.spanner.v1.StructType.verify(message.rowType, long + 1); if (error) return "rowType." + error; } - if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) { var error = $root.google.spanner.v1.Transaction.verify(message.transaction, long + 1); if (error) return "transaction." + error; } - if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) { + if (message.undeclaredParameters != null && Object.hasOwnProperty.call(message, "undeclaredParameters")) { var error = $root.google.spanner.v1.StructType.verify(message.undeclaredParameters, long + 1); if (error) return "undeclaredParameters." + error; @@ -100420,23 +103472,25 @@ ResultSetMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ResultSetMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ResultSetMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ResultSetMetadata(); if (object.rowType != null) { - if (typeof object.rowType !== "object") + if (!$util.isObject(object.rowType)) throw TypeError(".google.spanner.v1.ResultSetMetadata.rowType: object expected"); message.rowType = $root.google.spanner.v1.StructType.fromObject(object.rowType, long + 1); } if (object.transaction != null) { - if (typeof object.transaction !== "object") + if (!$util.isObject(object.transaction)) throw TypeError(".google.spanner.v1.ResultSetMetadata.transaction: object expected"); message.transaction = $root.google.spanner.v1.Transaction.fromObject(object.transaction, long + 1); } if (object.undeclaredParameters != null) { - if (typeof object.undeclaredParameters !== "object") + if (!$util.isObject(object.undeclaredParameters)) throw TypeError(".google.spanner.v1.ResultSetMetadata.undeclaredParameters: object expected"); message.undeclaredParameters = $root.google.spanner.v1.StructType.fromObject(object.undeclaredParameters, long + 1); } @@ -100452,21 +103506,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResultSetMetadata.toObject = function toObject(message, options) { + ResultSetMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.rowType = null; object.transaction = null; object.undeclaredParameters = null; } - if (message.rowType != null && message.hasOwnProperty("rowType")) - object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options); - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options); - if (message.undeclaredParameters != null && message.hasOwnProperty("undeclaredParameters")) - object.undeclaredParameters = $root.google.spanner.v1.StructType.toObject(message.undeclaredParameters, options); + if (message.rowType != null && Object.hasOwnProperty.call(message, "rowType")) + object.rowType = $root.google.spanner.v1.StructType.toObject(message.rowType, options, q + 1); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + object.transaction = $root.google.spanner.v1.Transaction.toObject(message.transaction, options, q + 1); + if (message.undeclaredParameters != null && Object.hasOwnProperty.call(message, "undeclaredParameters")) + object.undeclaredParameters = $root.google.spanner.v1.StructType.toObject(message.undeclaredParameters, options, q + 1); return object; }; @@ -100593,13 +103651,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResultSetStats.encode = function encode(message, writer) { + ResultSetStats.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) - $root.google.spanner.v1.QueryPlan.encode(message.queryPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.QueryPlan.encode(message.queryPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.queryStats != null && Object.hasOwnProperty.call(message, "queryStats")) - $root.google.protobuf.Struct.encode(message.queryStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Struct.encode(message.queryStats, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.rowCountExact != null && Object.hasOwnProperty.call(message, "rowCountExact")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.rowCountExact); if (message.rowCountLowerBound != null && Object.hasOwnProperty.call(message, "rowCountLowerBound")) @@ -100617,7 +103679,7 @@ * @returns {$protobuf.Writer} Writer */ ResultSetStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -100700,22 +103762,22 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) { + if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) { var error = $root.google.spanner.v1.QueryPlan.verify(message.queryPlan, long + 1); if (error) return "queryPlan." + error; } - if (message.queryStats != null && message.hasOwnProperty("queryStats")) { + if (message.queryStats != null && Object.hasOwnProperty.call(message, "queryStats")) { var error = $root.google.protobuf.Struct.verify(message.queryStats, long + 1); if (error) return "queryStats." + error; } - if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { + if (message.rowCountExact != null && Object.hasOwnProperty.call(message, "rowCountExact")) { properties.rowCount = 1; if (!$util.isInteger(message.rowCountExact) && !(message.rowCountExact && $util.isInteger(message.rowCountExact.low) && $util.isInteger(message.rowCountExact.high))) return "rowCountExact: integer|Long expected"; } - if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { + if (message.rowCountLowerBound != null && Object.hasOwnProperty.call(message, "rowCountLowerBound")) { if (properties.rowCount === 1) return "rowCount: multiple values"; properties.rowCount = 1; @@ -100736,24 +103798,26 @@ ResultSetStats.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ResultSetStats) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ResultSetStats: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ResultSetStats(); if (object.queryPlan != null) { - if (typeof object.queryPlan !== "object") + if (!$util.isObject(object.queryPlan)) throw TypeError(".google.spanner.v1.ResultSetStats.queryPlan: object expected"); message.queryPlan = $root.google.spanner.v1.QueryPlan.fromObject(object.queryPlan, long + 1); } if (object.queryStats != null) { - if (typeof object.queryStats !== "object") + if (!$util.isObject(object.queryStats)) throw TypeError(".google.spanner.v1.ResultSetStats.queryStats: object expected"); message.queryStats = $root.google.protobuf.Struct.fromObject(object.queryStats, long + 1); } if (object.rowCountExact != null) if ($util.Long) - (message.rowCountExact = $util.Long.fromValue(object.rowCountExact)).unsigned = false; + message.rowCountExact = $util.Long.fromValue(object.rowCountExact, false); else if (typeof object.rowCountExact === "string") message.rowCountExact = parseInt(object.rowCountExact, 10); else if (typeof object.rowCountExact === "number") @@ -100762,7 +103826,7 @@ message.rowCountExact = new $util.LongBits(object.rowCountExact.low >>> 0, object.rowCountExact.high >>> 0).toNumber(); if (object.rowCountLowerBound != null) if ($util.Long) - (message.rowCountLowerBound = $util.Long.fromValue(object.rowCountLowerBound)).unsigned = false; + message.rowCountLowerBound = $util.Long.fromValue(object.rowCountLowerBound, false); else if (typeof object.rowCountLowerBound === "string") message.rowCountLowerBound = parseInt(object.rowCountLowerBound, 10); else if (typeof object.rowCountLowerBound === "number") @@ -100781,28 +103845,36 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResultSetStats.toObject = function toObject(message, options) { + ResultSetStats.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.queryPlan = null; object.queryStats = null; } - if (message.queryPlan != null && message.hasOwnProperty("queryPlan")) - object.queryPlan = $root.google.spanner.v1.QueryPlan.toObject(message.queryPlan, options); - if (message.queryStats != null && message.hasOwnProperty("queryStats")) - object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options); - if (message.rowCountExact != null && message.hasOwnProperty("rowCountExact")) { - if (typeof message.rowCountExact === "number") + if (message.queryPlan != null && Object.hasOwnProperty.call(message, "queryPlan")) + object.queryPlan = $root.google.spanner.v1.QueryPlan.toObject(message.queryPlan, options, q + 1); + if (message.queryStats != null && Object.hasOwnProperty.call(message, "queryStats")) + object.queryStats = $root.google.protobuf.Struct.toObject(message.queryStats, options, q + 1); + if (message.rowCountExact != null && Object.hasOwnProperty.call(message, "rowCountExact")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.rowCountExact = typeof message.rowCountExact === "number" ? BigInt(message.rowCountExact) : $util.Long.fromBits(message.rowCountExact.low >>> 0, message.rowCountExact.high >>> 0, false).toBigInt(); + else if (typeof message.rowCountExact === "number") object.rowCountExact = options.longs === String ? String(message.rowCountExact) : message.rowCountExact; else object.rowCountExact = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountExact) : options.longs === Number ? new $util.LongBits(message.rowCountExact.low >>> 0, message.rowCountExact.high >>> 0).toNumber() : message.rowCountExact; if (options.oneofs) object.rowCount = "rowCountExact"; } - if (message.rowCountLowerBound != null && message.hasOwnProperty("rowCountLowerBound")) { - if (typeof message.rowCountLowerBound === "number") + if (message.rowCountLowerBound != null && Object.hasOwnProperty.call(message, "rowCountLowerBound")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.rowCountLowerBound = typeof message.rowCountLowerBound === "number" ? BigInt(message.rowCountLowerBound) : $util.Long.fromBits(message.rowCountLowerBound.low >>> 0, message.rowCountLowerBound.high >>> 0, false).toBigInt(); + else if (typeof message.rowCountLowerBound === "number") object.rowCountLowerBound = options.longs === String ? String(message.rowCountLowerBound) : message.rowCountLowerBound; else object.rowCountLowerBound = options.longs === String ? $util.Long.prototype.toString.call(message.rowCountLowerBound) : options.longs === Number ? new $util.LongBits(message.rowCountLowerBound.low >>> 0, message.rowCountLowerBound.high >>> 0).toNumber() : message.rowCountLowerBound; @@ -100949,9 +104021,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PlanNode.encode = function encode(message, writer) { + PlanNode.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.index != null && Object.hasOwnProperty.call(message, "index")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.index); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -100960,13 +104036,13 @@ writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); if (message.childLinks != null && message.childLinks.length) for (var i = 0; i < message.childLinks.length; ++i) - $root.google.spanner.v1.PlanNode.ChildLink.encode(message.childLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.PlanNode.ChildLink.encode(message.childLinks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.shortRepresentation != null && Object.hasOwnProperty.call(message, "shortRepresentation")) - $root.google.spanner.v1.PlanNode.ShortRepresentation.encode(message.shortRepresentation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.PlanNode.ShortRepresentation.encode(message.shortRepresentation, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) - $root.google.protobuf.Struct.encode(message.executionStats, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Struct.encode(message.executionStats, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -100980,7 +104056,7 @@ * @returns {$protobuf.Writer} Writer */ PlanNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -101076,10 +104152,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) if (!$util.isInteger(message.index)) return "index: integer expected"; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) switch (message.kind) { default: return "kind: enum value expected"; @@ -101088,10 +104164,10 @@ case 2: break; } - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; - if (message.childLinks != null && message.hasOwnProperty("childLinks")) { + if (message.childLinks != null && Object.hasOwnProperty.call(message, "childLinks")) { if (!Array.isArray(message.childLinks)) return "childLinks: array expected"; for (var i = 0; i < message.childLinks.length; ++i) { @@ -101100,17 +104176,17 @@ return "childLinks." + error; } } - if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) { + if (message.shortRepresentation != null && Object.hasOwnProperty.call(message, "shortRepresentation")) { var error = $root.google.spanner.v1.PlanNode.ShortRepresentation.verify(message.shortRepresentation, long + 1); if (error) return "shortRepresentation." + error; } - if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { var error = $root.google.protobuf.Struct.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.executionStats != null && message.hasOwnProperty("executionStats")) { + if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) { var error = $root.google.protobuf.Struct.verify(message.executionStats, long + 1); if (error) return "executionStats." + error; @@ -101129,6 +104205,8 @@ PlanNode.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PlanNode) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PlanNode: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -101163,23 +104241,23 @@ throw TypeError(".google.spanner.v1.PlanNode.childLinks: array expected"); message.childLinks = []; for (var i = 0; i < object.childLinks.length; ++i) { - if (typeof object.childLinks[i] !== "object") + if (!$util.isObject(object.childLinks[i])) throw TypeError(".google.spanner.v1.PlanNode.childLinks: object expected"); message.childLinks[i] = $root.google.spanner.v1.PlanNode.ChildLink.fromObject(object.childLinks[i], long + 1); } } if (object.shortRepresentation != null) { - if (typeof object.shortRepresentation !== "object") + if (!$util.isObject(object.shortRepresentation)) throw TypeError(".google.spanner.v1.PlanNode.shortRepresentation: object expected"); message.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.fromObject(object.shortRepresentation, long + 1); } if (object.metadata != null) { - if (typeof object.metadata !== "object") + if (!$util.isObject(object.metadata)) throw TypeError(".google.spanner.v1.PlanNode.metadata: object expected"); message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata, long + 1); } if (object.executionStats != null) { - if (typeof object.executionStats !== "object") + if (!$util.isObject(object.executionStats)) throw TypeError(".google.spanner.v1.PlanNode.executionStats: object expected"); message.executionStats = $root.google.protobuf.Struct.fromObject(object.executionStats, long + 1); } @@ -101195,9 +104273,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PlanNode.toObject = function toObject(message, options) { + PlanNode.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.childLinks = []; @@ -101209,23 +104291,23 @@ object.metadata = null; object.executionStats = null; } - if (message.index != null && message.hasOwnProperty("index")) + if (message.index != null && Object.hasOwnProperty.call(message, "index")) object.index = message.index; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = options.enums === String ? $root.google.spanner.v1.PlanNode.Kind[message.kind] === undefined ? message.kind : $root.google.spanner.v1.PlanNode.Kind[message.kind] : message.kind; - if (message.displayName != null && message.hasOwnProperty("displayName")) + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) object.displayName = message.displayName; if (message.childLinks && message.childLinks.length) { object.childLinks = []; for (var j = 0; j < message.childLinks.length; ++j) - object.childLinks[j] = $root.google.spanner.v1.PlanNode.ChildLink.toObject(message.childLinks[j], options); - } - if (message.shortRepresentation != null && message.hasOwnProperty("shortRepresentation")) - object.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.toObject(message.shortRepresentation, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); - if (message.executionStats != null && message.hasOwnProperty("executionStats")) - object.executionStats = $root.google.protobuf.Struct.toObject(message.executionStats, options); + object.childLinks[j] = $root.google.spanner.v1.PlanNode.ChildLink.toObject(message.childLinks[j], options, q + 1); + } + if (message.shortRepresentation != null && Object.hasOwnProperty.call(message, "shortRepresentation")) + object.shortRepresentation = $root.google.spanner.v1.PlanNode.ShortRepresentation.toObject(message.shortRepresentation, options, q + 1); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options, q + 1); + if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) + object.executionStats = $root.google.protobuf.Struct.toObject(message.executionStats, options, q + 1); return object; }; @@ -101342,9 +104424,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChildLink.encode = function encode(message, writer) { + ChildLink.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.childIndex != null && Object.hasOwnProperty.call(message, "childIndex")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.childIndex); if (message.type != null && Object.hasOwnProperty.call(message, "type")) @@ -101364,7 +104450,7 @@ * @returns {$protobuf.Writer} Writer */ ChildLink.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -101442,13 +104528,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.childIndex != null && message.hasOwnProperty("childIndex")) + if (message.childIndex != null && Object.hasOwnProperty.call(message, "childIndex")) if (!$util.isInteger(message.childIndex)) return "childIndex: integer expected"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.variable != null && message.hasOwnProperty("variable")) + if (message.variable != null && Object.hasOwnProperty.call(message, "variable")) if (!$util.isString(message.variable)) return "variable: string expected"; return null; @@ -101465,6 +104551,8 @@ ChildLink.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PlanNode.ChildLink) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PlanNode.ChildLink: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -101488,20 +104576,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChildLink.toObject = function toObject(message, options) { + ChildLink.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.childIndex = 0; object.type = ""; object.variable = ""; } - if (message.childIndex != null && message.hasOwnProperty("childIndex")) + if (message.childIndex != null && Object.hasOwnProperty.call(message, "childIndex")) object.childIndex = message.childIndex; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = message.type; - if (message.variable != null && message.hasOwnProperty("variable")) + if (message.variable != null && Object.hasOwnProperty.call(message, "variable")) object.variable = message.variable; return object; }; @@ -101598,9 +104690,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ShortRepresentation.encode = function encode(message, writer) { + ShortRepresentation.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); if (message.subqueries != null && Object.hasOwnProperty.call(message, "subqueries")) @@ -101619,7 +104715,7 @@ * @returns {$protobuf.Writer} Writer */ ShortRepresentation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -101714,10 +104810,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.subqueries != null && message.hasOwnProperty("subqueries")) { + if (message.subqueries != null && Object.hasOwnProperty.call(message, "subqueries")) { if (!$util.isObject(message.subqueries)) return "subqueries: object expected"; var key = Object.keys(message.subqueries); @@ -101739,6 +104835,8 @@ ShortRepresentation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.PlanNode.ShortRepresentation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.PlanNode.ShortRepresentation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -101747,7 +104845,7 @@ if (object.description != null) message.description = String(object.description); if (object.subqueries) { - if (typeof object.subqueries !== "object") + if (!$util.isObject(object.subqueries)) throw TypeError(".google.spanner.v1.PlanNode.ShortRepresentation.subqueries: object expected"); message.subqueries = {}; for (var keys = Object.keys(object.subqueries), i = 0; i < keys.length; ++i) { @@ -101768,15 +104866,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ShortRepresentation.toObject = function toObject(message, options) { + ShortRepresentation.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.subqueries = {}; if (options.defaults) object.description = ""; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; var keys2; if (message.subqueries && (keys2 = Object.keys(message.subqueries)).length) { @@ -101876,12 +104978,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryAdvisorResult.encode = function encode(message, writer) { + QueryAdvisorResult.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.indexAdvice != null && message.indexAdvice.length) for (var i = 0; i < message.indexAdvice.length; ++i) - $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.encode(message.indexAdvice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.encode(message.indexAdvice[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -101895,7 +105001,7 @@ * @returns {$protobuf.Writer} Writer */ QueryAdvisorResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -101967,7 +105073,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.indexAdvice != null && message.hasOwnProperty("indexAdvice")) { + if (message.indexAdvice != null && Object.hasOwnProperty.call(message, "indexAdvice")) { if (!Array.isArray(message.indexAdvice)) return "indexAdvice: array expected"; for (var i = 0; i < message.indexAdvice.length; ++i) { @@ -101990,6 +105096,8 @@ QueryAdvisorResult.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.QueryAdvisorResult) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.QueryAdvisorResult: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -102000,7 +105108,7 @@ throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: array expected"); message.indexAdvice = []; for (var i = 0; i < object.indexAdvice.length; ++i) { - if (typeof object.indexAdvice[i] !== "object") + if (!$util.isObject(object.indexAdvice[i])) throw TypeError(".google.spanner.v1.QueryAdvisorResult.indexAdvice: object expected"); message.indexAdvice[i] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.fromObject(object.indexAdvice[i], long + 1); } @@ -102017,16 +105125,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryAdvisorResult.toObject = function toObject(message, options) { + QueryAdvisorResult.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.indexAdvice = []; if (message.indexAdvice && message.indexAdvice.length) { object.indexAdvice = []; for (var j = 0; j < message.indexAdvice.length; ++j) - object.indexAdvice[j] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.toObject(message.indexAdvice[j], options); + object.indexAdvice[j] = $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice.toObject(message.indexAdvice[j], options, q + 1); } return object; }; @@ -102120,9 +105232,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IndexAdvice.encode = function encode(message, writer) { + IndexAdvice.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.ddl != null && message.ddl.length) for (var i = 0; i < message.ddl.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.ddl[i]); @@ -102141,7 +105257,7 @@ * @returns {$protobuf.Writer} Writer */ IndexAdvice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -102217,14 +105333,14 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.ddl != null && message.hasOwnProperty("ddl")) { + if (message.ddl != null && Object.hasOwnProperty.call(message, "ddl")) { if (!Array.isArray(message.ddl)) return "ddl: array expected"; for (var i = 0; i < message.ddl.length; ++i) if (!$util.isString(message.ddl[i])) return "ddl: string[] expected"; } - if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) + if (message.improvementFactor != null && Object.hasOwnProperty.call(message, "improvementFactor")) if (typeof message.improvementFactor !== "number") return "improvementFactor: number expected"; return null; @@ -102241,6 +105357,8 @@ IndexAdvice.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.QueryAdvisorResult.IndexAdvice) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.QueryAdvisorResult.IndexAdvice: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -102267,9 +105385,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IndexAdvice.toObject = function toObject(message, options) { + IndexAdvice.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.ddl = []; @@ -102280,7 +105402,7 @@ for (var j = 0; j < message.ddl.length; ++j) object.ddl[j] = message.ddl[j]; } - if (message.improvementFactor != null && message.hasOwnProperty("improvementFactor")) + if (message.improvementFactor != null && Object.hasOwnProperty.call(message, "improvementFactor")) object.improvementFactor = options.json && !isFinite(message.improvementFactor) ? String(message.improvementFactor) : message.improvementFactor; return object; }; @@ -102380,14 +105502,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryPlan.encode = function encode(message, writer) { + QueryPlan.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.planNodes != null && message.planNodes.length) for (var i = 0; i < message.planNodes.length; ++i) - $root.google.spanner.v1.PlanNode.encode(message.planNodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.PlanNode.encode(message.planNodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.queryAdvice != null && Object.hasOwnProperty.call(message, "queryAdvice")) - $root.google.spanner.v1.QueryAdvisorResult.encode(message.queryAdvice, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.QueryAdvisorResult.encode(message.queryAdvice, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -102401,7 +105527,7 @@ * @returns {$protobuf.Writer} Writer */ QueryPlan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -102477,7 +105603,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.planNodes != null && message.hasOwnProperty("planNodes")) { + if (message.planNodes != null && Object.hasOwnProperty.call(message, "planNodes")) { if (!Array.isArray(message.planNodes)) return "planNodes: array expected"; for (var i = 0; i < message.planNodes.length; ++i) { @@ -102486,7 +105612,7 @@ return "planNodes." + error; } } - if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) { + if (message.queryAdvice != null && Object.hasOwnProperty.call(message, "queryAdvice")) { var error = $root.google.spanner.v1.QueryAdvisorResult.verify(message.queryAdvice, long + 1); if (error) return "queryAdvice." + error; @@ -102505,6 +105631,8 @@ QueryPlan.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.QueryPlan) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.QueryPlan: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -102515,13 +105643,13 @@ throw TypeError(".google.spanner.v1.QueryPlan.planNodes: array expected"); message.planNodes = []; for (var i = 0; i < object.planNodes.length; ++i) { - if (typeof object.planNodes[i] !== "object") + if (!$util.isObject(object.planNodes[i])) throw TypeError(".google.spanner.v1.QueryPlan.planNodes: object expected"); message.planNodes[i] = $root.google.spanner.v1.PlanNode.fromObject(object.planNodes[i], long + 1); } } if (object.queryAdvice != null) { - if (typeof object.queryAdvice !== "object") + if (!$util.isObject(object.queryAdvice)) throw TypeError(".google.spanner.v1.QueryPlan.queryAdvice: object expected"); message.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.fromObject(object.queryAdvice, long + 1); } @@ -102537,9 +105665,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryPlan.toObject = function toObject(message, options) { + QueryPlan.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.planNodes = []; @@ -102548,10 +105680,10 @@ if (message.planNodes && message.planNodes.length) { object.planNodes = []; for (var j = 0; j < message.planNodes.length; ++j) - object.planNodes[j] = $root.google.spanner.v1.PlanNode.toObject(message.planNodes[j], options); + object.planNodes[j] = $root.google.spanner.v1.PlanNode.toObject(message.planNodes[j], options, q + 1); } - if (message.queryAdvice != null && message.hasOwnProperty("queryAdvice")) - object.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.toObject(message.queryAdvice, options); + if (message.queryAdvice != null && Object.hasOwnProperty.call(message, "queryAdvice")) + object.queryAdvice = $root.google.spanner.v1.QueryAdvisorResult.toObject(message.queryAdvice, options, q + 1); return object; }; @@ -102687,19 +105819,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChangeStreamRecord.encode = function encode(message, writer) { + ChangeStreamRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.dataChangeRecord != null && Object.hasOwnProperty.call(message, "dataChangeRecord")) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.encode(message.dataChangeRecord, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.encode(message.dataChangeRecord, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.heartbeatRecord != null && Object.hasOwnProperty.call(message, "heartbeatRecord")) - $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.encode(message.heartbeatRecord, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.encode(message.heartbeatRecord, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.partitionStartRecord != null && Object.hasOwnProperty.call(message, "partitionStartRecord")) - $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.encode(message.partitionStartRecord, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.encode(message.partitionStartRecord, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.partitionEndRecord != null && Object.hasOwnProperty.call(message, "partitionEndRecord")) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.encode(message.partitionEndRecord, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.encode(message.partitionEndRecord, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.partitionEventRecord != null && Object.hasOwnProperty.call(message, "partitionEventRecord")) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.encode(message.partitionEventRecord, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.encode(message.partitionEventRecord, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -102713,7 +105849,7 @@ * @returns {$protobuf.Writer} Writer */ ChangeStreamRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -102800,7 +105936,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.dataChangeRecord != null && message.hasOwnProperty("dataChangeRecord")) { + if (message.dataChangeRecord != null && Object.hasOwnProperty.call(message, "dataChangeRecord")) { properties.record = 1; { var error = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.verify(message.dataChangeRecord, long + 1); @@ -102808,7 +105944,7 @@ return "dataChangeRecord." + error; } } - if (message.heartbeatRecord != null && message.hasOwnProperty("heartbeatRecord")) { + if (message.heartbeatRecord != null && Object.hasOwnProperty.call(message, "heartbeatRecord")) { if (properties.record === 1) return "record: multiple values"; properties.record = 1; @@ -102818,7 +105954,7 @@ return "heartbeatRecord." + error; } } - if (message.partitionStartRecord != null && message.hasOwnProperty("partitionStartRecord")) { + if (message.partitionStartRecord != null && Object.hasOwnProperty.call(message, "partitionStartRecord")) { if (properties.record === 1) return "record: multiple values"; properties.record = 1; @@ -102828,7 +105964,7 @@ return "partitionStartRecord." + error; } } - if (message.partitionEndRecord != null && message.hasOwnProperty("partitionEndRecord")) { + if (message.partitionEndRecord != null && Object.hasOwnProperty.call(message, "partitionEndRecord")) { if (properties.record === 1) return "record: multiple values"; properties.record = 1; @@ -102838,7 +105974,7 @@ return "partitionEndRecord." + error; } } - if (message.partitionEventRecord != null && message.hasOwnProperty("partitionEventRecord")) { + if (message.partitionEventRecord != null && Object.hasOwnProperty.call(message, "partitionEventRecord")) { if (properties.record === 1) return "record: multiple values"; properties.record = 1; @@ -102862,33 +105998,35 @@ ChangeStreamRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ChangeStreamRecord(); if (object.dataChangeRecord != null) { - if (typeof object.dataChangeRecord !== "object") + if (!$util.isObject(object.dataChangeRecord)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.dataChangeRecord: object expected"); message.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.fromObject(object.dataChangeRecord, long + 1); } if (object.heartbeatRecord != null) { - if (typeof object.heartbeatRecord !== "object") + if (!$util.isObject(object.heartbeatRecord)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.heartbeatRecord: object expected"); message.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.fromObject(object.heartbeatRecord, long + 1); } if (object.partitionStartRecord != null) { - if (typeof object.partitionStartRecord !== "object") + if (!$util.isObject(object.partitionStartRecord)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionStartRecord: object expected"); message.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.fromObject(object.partitionStartRecord, long + 1); } if (object.partitionEndRecord != null) { - if (typeof object.partitionEndRecord !== "object") + if (!$util.isObject(object.partitionEndRecord)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionEndRecord: object expected"); message.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.fromObject(object.partitionEndRecord, long + 1); } if (object.partitionEventRecord != null) { - if (typeof object.partitionEventRecord !== "object") + if (!$util.isObject(object.partitionEventRecord)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.partitionEventRecord: object expected"); message.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.fromObject(object.partitionEventRecord, long + 1); } @@ -102904,32 +106042,36 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChangeStreamRecord.toObject = function toObject(message, options) { + ChangeStreamRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; - if (message.dataChangeRecord != null && message.hasOwnProperty("dataChangeRecord")) { - object.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.toObject(message.dataChangeRecord, options); + if (message.dataChangeRecord != null && Object.hasOwnProperty.call(message, "dataChangeRecord")) { + object.dataChangeRecord = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.toObject(message.dataChangeRecord, options, q + 1); if (options.oneofs) object.record = "dataChangeRecord"; } - if (message.heartbeatRecord != null && message.hasOwnProperty("heartbeatRecord")) { - object.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.toObject(message.heartbeatRecord, options); + if (message.heartbeatRecord != null && Object.hasOwnProperty.call(message, "heartbeatRecord")) { + object.heartbeatRecord = $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.toObject(message.heartbeatRecord, options, q + 1); if (options.oneofs) object.record = "heartbeatRecord"; } - if (message.partitionStartRecord != null && message.hasOwnProperty("partitionStartRecord")) { - object.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.toObject(message.partitionStartRecord, options); + if (message.partitionStartRecord != null && Object.hasOwnProperty.call(message, "partitionStartRecord")) { + object.partitionStartRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.toObject(message.partitionStartRecord, options, q + 1); if (options.oneofs) object.record = "partitionStartRecord"; } - if (message.partitionEndRecord != null && message.hasOwnProperty("partitionEndRecord")) { - object.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.toObject(message.partitionEndRecord, options); + if (message.partitionEndRecord != null && Object.hasOwnProperty.call(message, "partitionEndRecord")) { + object.partitionEndRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.toObject(message.partitionEndRecord, options, q + 1); if (options.oneofs) object.record = "partitionEndRecord"; } - if (message.partitionEventRecord != null && message.hasOwnProperty("partitionEventRecord")) { - object.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.toObject(message.partitionEventRecord, options); + if (message.partitionEventRecord != null && Object.hasOwnProperty.call(message, "partitionEventRecord")) { + object.partitionEventRecord = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.toObject(message.partitionEventRecord, options, q + 1); if (options.oneofs) object.record = "partitionEventRecord"; } @@ -103125,11 +106267,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataChangeRecord.encode = function encode(message, writer) { + DataChangeRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); if (message.serverTransactionId != null && Object.hasOwnProperty.call(message, "serverTransactionId")) @@ -103140,10 +106286,10 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.table); if (message.columnMetadata != null && message.columnMetadata.length) for (var i = 0; i < message.columnMetadata.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.encode(message.columnMetadata[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.encode(message.columnMetadata[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.mods != null && message.mods.length) for (var i = 0; i < message.mods.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.encode(message.mods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.modType); if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) @@ -103169,7 +106315,7 @@ * @returns {$protobuf.Writer} Writer */ DataChangeRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -103291,24 +106437,24 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp, long + 1); if (error) return "commitTimestamp." + error; } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) if (!$util.isString(message.recordSequence)) return "recordSequence: string expected"; - if (message.serverTransactionId != null && message.hasOwnProperty("serverTransactionId")) + if (message.serverTransactionId != null && Object.hasOwnProperty.call(message, "serverTransactionId")) if (!$util.isString(message.serverTransactionId)) return "serverTransactionId: string expected"; - if (message.isLastRecordInTransactionInPartition != null && message.hasOwnProperty("isLastRecordInTransactionInPartition")) + if (message.isLastRecordInTransactionInPartition != null && Object.hasOwnProperty.call(message, "isLastRecordInTransactionInPartition")) if (typeof message.isLastRecordInTransactionInPartition !== "boolean") return "isLastRecordInTransactionInPartition: boolean expected"; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) if (!$util.isString(message.table)) return "table: string expected"; - if (message.columnMetadata != null && message.hasOwnProperty("columnMetadata")) { + if (message.columnMetadata != null && Object.hasOwnProperty.call(message, "columnMetadata")) { if (!Array.isArray(message.columnMetadata)) return "columnMetadata: array expected"; for (var i = 0; i < message.columnMetadata.length; ++i) { @@ -103317,7 +106463,7 @@ return "columnMetadata." + error; } } - if (message.mods != null && message.hasOwnProperty("mods")) { + if (message.mods != null && Object.hasOwnProperty.call(message, "mods")) { if (!Array.isArray(message.mods)) return "mods: array expected"; for (var i = 0; i < message.mods.length; ++i) { @@ -103326,7 +106472,7 @@ return "mods." + error; } } - if (message.modType != null && message.hasOwnProperty("modType")) + if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) switch (message.modType) { default: return "modType: enum value expected"; @@ -103336,7 +106482,7 @@ case 30: break; } - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) switch (message.valueCaptureType) { default: return "valueCaptureType: enum value expected"; @@ -103347,16 +106493,16 @@ case 40: break; } - if (message.numberOfRecordsInTransaction != null && message.hasOwnProperty("numberOfRecordsInTransaction")) + if (message.numberOfRecordsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfRecordsInTransaction")) if (!$util.isInteger(message.numberOfRecordsInTransaction)) return "numberOfRecordsInTransaction: integer expected"; - if (message.numberOfPartitionsInTransaction != null && message.hasOwnProperty("numberOfPartitionsInTransaction")) + if (message.numberOfPartitionsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfPartitionsInTransaction")) if (!$util.isInteger(message.numberOfPartitionsInTransaction)) return "numberOfPartitionsInTransaction: integer expected"; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) if (!$util.isString(message.transactionTag)) return "transactionTag: string expected"; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) if (typeof message.isSystemTransaction !== "boolean") return "isSystemTransaction: boolean expected"; return null; @@ -103373,13 +106519,15 @@ DataChangeRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord(); if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") + if (!$util.isObject(object.commitTimestamp)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.commitTimestamp: object expected"); message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp, long + 1); } @@ -103396,7 +106544,7 @@ throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.columnMetadata: array expected"); message.columnMetadata = []; for (var i = 0; i < object.columnMetadata.length; ++i) { - if (typeof object.columnMetadata[i] !== "object") + if (!$util.isObject(object.columnMetadata[i])) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.columnMetadata: object expected"); message.columnMetadata[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.fromObject(object.columnMetadata[i], long + 1); } @@ -103406,7 +106554,7 @@ throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods: array expected"); message.mods = []; for (var i = 0; i < object.mods.length; ++i) { - if (typeof object.mods[i] !== "object") + if (!$util.isObject(object.mods[i])) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.mods: object expected"); message.mods[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.fromObject(object.mods[i], long + 1); } @@ -103483,9 +106631,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataChangeRecord.toObject = function toObject(message, options) { + DataChangeRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.columnMetadata = []; @@ -103504,37 +106656,37 @@ object.transactionTag = ""; object.isSystemTransaction = false; } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options, q + 1); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) object.recordSequence = message.recordSequence; - if (message.serverTransactionId != null && message.hasOwnProperty("serverTransactionId")) + if (message.serverTransactionId != null && Object.hasOwnProperty.call(message, "serverTransactionId")) object.serverTransactionId = message.serverTransactionId; - if (message.isLastRecordInTransactionInPartition != null && message.hasOwnProperty("isLastRecordInTransactionInPartition")) + if (message.isLastRecordInTransactionInPartition != null && Object.hasOwnProperty.call(message, "isLastRecordInTransactionInPartition")) object.isLastRecordInTransactionInPartition = message.isLastRecordInTransactionInPartition; - if (message.table != null && message.hasOwnProperty("table")) + if (message.table != null && Object.hasOwnProperty.call(message, "table")) object.table = message.table; if (message.columnMetadata && message.columnMetadata.length) { object.columnMetadata = []; for (var j = 0; j < message.columnMetadata.length; ++j) - object.columnMetadata[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.toObject(message.columnMetadata[j], options); + object.columnMetadata[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.toObject(message.columnMetadata[j], options, q + 1); } if (message.mods && message.mods.length) { object.mods = []; for (var j = 0; j < message.mods.length; ++j) - object.mods[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.toObject(message.mods[j], options); + object.mods[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.toObject(message.mods[j], options, q + 1); } - if (message.modType != null && message.hasOwnProperty("modType")) + if (message.modType != null && Object.hasOwnProperty.call(message, "modType")) object.modType = options.enums === String ? $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType[message.modType] === undefined ? message.modType : $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType[message.modType] : message.modType; - if (message.valueCaptureType != null && message.hasOwnProperty("valueCaptureType")) + if (message.valueCaptureType != null && Object.hasOwnProperty.call(message, "valueCaptureType")) object.valueCaptureType = options.enums === String ? $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType[message.valueCaptureType] === undefined ? message.valueCaptureType : $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType[message.valueCaptureType] : message.valueCaptureType; - if (message.numberOfRecordsInTransaction != null && message.hasOwnProperty("numberOfRecordsInTransaction")) + if (message.numberOfRecordsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfRecordsInTransaction")) object.numberOfRecordsInTransaction = message.numberOfRecordsInTransaction; - if (message.numberOfPartitionsInTransaction != null && message.hasOwnProperty("numberOfPartitionsInTransaction")) + if (message.numberOfPartitionsInTransaction != null && Object.hasOwnProperty.call(message, "numberOfPartitionsInTransaction")) object.numberOfPartitionsInTransaction = message.numberOfPartitionsInTransaction; - if (message.transactionTag != null && message.hasOwnProperty("transactionTag")) + if (message.transactionTag != null && Object.hasOwnProperty.call(message, "transactionTag")) object.transactionTag = message.transactionTag; - if (message.isSystemTransaction != null && message.hasOwnProperty("isSystemTransaction")) + if (message.isSystemTransaction != null && Object.hasOwnProperty.call(message, "isSystemTransaction")) object.isSystemTransaction = message.isSystemTransaction; return object; }; @@ -103645,13 +106797,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ColumnMetadata.encode = function encode(message, writer) { + ColumnMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) - $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.Type.encode(message.type, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPrimaryKey); if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) @@ -103669,7 +106825,7 @@ * @returns {$protobuf.Writer} Writer */ ColumnMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -103751,18 +106907,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) { + if (message.type != null && Object.hasOwnProperty.call(message, "type")) { var error = $root.google.spanner.v1.Type.verify(message.type, long + 1); if (error) return "type." + error; } - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) if (typeof message.isPrimaryKey !== "boolean") return "isPrimaryKey: boolean expected"; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) + if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) if (!$util.isInteger(message.ordinalPosition) && !(message.ordinalPosition && $util.isInteger(message.ordinalPosition.low) && $util.isInteger(message.ordinalPosition.high))) return "ordinalPosition: integer|Long expected"; return null; @@ -103779,6 +106935,8 @@ ColumnMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -103787,7 +106945,7 @@ if (object.name != null) message.name = String(object.name); if (object.type != null) { - if (typeof object.type !== "object") + if (!$util.isObject(object.type)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata.type: object expected"); message.type = $root.google.spanner.v1.Type.fromObject(object.type, long + 1); } @@ -103795,7 +106953,7 @@ message.isPrimaryKey = Boolean(object.isPrimaryKey); if (object.ordinalPosition != null) if ($util.Long) - (message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition)).unsigned = false; + message.ordinalPosition = $util.Long.fromValue(object.ordinalPosition, false); else if (typeof object.ordinalPosition === "string") message.ordinalPosition = parseInt(object.ordinalPosition, 10); else if (typeof object.ordinalPosition === "number") @@ -103814,9 +106972,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ColumnMetadata.toObject = function toObject(message, options) { + ColumnMetadata.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; @@ -103824,18 +106986,20 @@ object.isPrimaryKey = false; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.ordinalPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.ordinalPosition = options.longs === String ? "0" : 0; + object.ordinalPosition = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = $root.google.spanner.v1.Type.toObject(message.type, options); - if (message.isPrimaryKey != null && message.hasOwnProperty("isPrimaryKey")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + object.type = $root.google.spanner.v1.Type.toObject(message.type, options, q + 1); + if (message.isPrimaryKey != null && Object.hasOwnProperty.call(message, "isPrimaryKey")) object.isPrimaryKey = message.isPrimaryKey; - if (message.ordinalPosition != null && message.hasOwnProperty("ordinalPosition")) - if (typeof message.ordinalPosition === "number") + if (message.ordinalPosition != null && Object.hasOwnProperty.call(message, "ordinalPosition")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.ordinalPosition = typeof message.ordinalPosition === "number" ? BigInt(message.ordinalPosition) : $util.Long.fromBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0, false).toBigInt(); + else if (typeof message.ordinalPosition === "number") object.ordinalPosition = options.longs === String ? String(message.ordinalPosition) : message.ordinalPosition; else object.ordinalPosition = options.longs === String ? $util.Long.prototype.toString.call(message.ordinalPosition) : options.longs === Number ? new $util.LongBits(message.ordinalPosition.low >>> 0, message.ordinalPosition.high >>> 0).toNumber() : message.ordinalPosition; @@ -103933,13 +107097,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ModValue.encode = function encode(message, writer) { + ModValue.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.columnMetadataIndex != null && Object.hasOwnProperty.call(message, "columnMetadataIndex")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.columnMetadataIndex); if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -103953,7 +107121,7 @@ * @returns {$protobuf.Writer} Writer */ ModValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -104027,10 +107195,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.columnMetadataIndex != null && message.hasOwnProperty("columnMetadataIndex")) + if (message.columnMetadataIndex != null && Object.hasOwnProperty.call(message, "columnMetadataIndex")) if (!$util.isInteger(message.columnMetadataIndex)) return "columnMetadataIndex: integer expected"; - if (message.value != null && message.hasOwnProperty("value")) { + if (message.value != null && Object.hasOwnProperty.call(message, "value")) { var error = $root.google.protobuf.Value.verify(message.value, long + 1); if (error) return "value." + error; @@ -104049,6 +107217,8 @@ ModValue.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -104057,7 +107227,7 @@ if (object.columnMetadataIndex != null) message.columnMetadataIndex = object.columnMetadataIndex | 0; if (object.value != null) { - if (typeof object.value !== "object") + if (!$util.isObject(object.value)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.value: object expected"); message.value = $root.google.protobuf.Value.fromObject(object.value, long + 1); } @@ -104073,18 +107243,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ModValue.toObject = function toObject(message, options) { + ModValue.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.columnMetadataIndex = 0; object.value = null; } - if (message.columnMetadataIndex != null && message.hasOwnProperty("columnMetadataIndex")) + if (message.columnMetadataIndex != null && Object.hasOwnProperty.call(message, "columnMetadataIndex")) object.columnMetadataIndex = message.columnMetadataIndex; - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.google.protobuf.Value.toObject(message.value, options); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + object.value = $root.google.protobuf.Value.toObject(message.value, options, q + 1); return object; }; @@ -104191,18 +107365,22 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Mod.encode = function encode(message, writer) { + Mod.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.keys != null && message.keys.length) for (var i = 0; i < message.keys.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.oldValues != null && message.oldValues.length) for (var i = 0; i < message.oldValues.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.oldValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.oldValues[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.newValues != null && message.newValues.length) for (var i = 0; i < message.newValues.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.newValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.encode(message.newValues[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -104216,7 +107394,7 @@ * @returns {$protobuf.Writer} Writer */ Mod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -104300,7 +107478,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.keys != null && message.hasOwnProperty("keys")) { + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) { if (!Array.isArray(message.keys)) return "keys: array expected"; for (var i = 0; i < message.keys.length; ++i) { @@ -104309,7 +107487,7 @@ return "keys." + error; } } - if (message.oldValues != null && message.hasOwnProperty("oldValues")) { + if (message.oldValues != null && Object.hasOwnProperty.call(message, "oldValues")) { if (!Array.isArray(message.oldValues)) return "oldValues: array expected"; for (var i = 0; i < message.oldValues.length; ++i) { @@ -104318,7 +107496,7 @@ return "oldValues." + error; } } - if (message.newValues != null && message.hasOwnProperty("newValues")) { + if (message.newValues != null && Object.hasOwnProperty.call(message, "newValues")) { if (!Array.isArray(message.newValues)) return "newValues: array expected"; for (var i = 0; i < message.newValues.length; ++i) { @@ -104341,6 +107519,8 @@ Mod.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -104351,7 +107531,7 @@ throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.keys: array expected"); message.keys = []; for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") + if (!$util.isObject(object.keys[i])) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.keys: object expected"); message.keys[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.keys[i], long + 1); } @@ -104361,7 +107541,7 @@ throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.oldValues: array expected"); message.oldValues = []; for (var i = 0; i < object.oldValues.length; ++i) { - if (typeof object.oldValues[i] !== "object") + if (!$util.isObject(object.oldValues[i])) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.oldValues: object expected"); message.oldValues[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.oldValues[i], long + 1); } @@ -104371,7 +107551,7 @@ throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.newValues: array expected"); message.newValues = []; for (var i = 0; i < object.newValues.length; ++i) { - if (typeof object.newValues[i] !== "object") + if (!$util.isObject(object.newValues[i])) throw TypeError(".google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod.newValues: object expected"); message.newValues[i] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.fromObject(object.newValues[i], long + 1); } @@ -104388,9 +107568,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Mod.toObject = function toObject(message, options) { + Mod.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.keys = []; @@ -104400,17 +107584,17 @@ if (message.keys && message.keys.length) { object.keys = []; for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.keys[j], options); + object.keys[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.keys[j], options, q + 1); } if (message.oldValues && message.oldValues.length) { object.oldValues = []; for (var j = 0; j < message.oldValues.length; ++j) - object.oldValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.oldValues[j], options); + object.oldValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.oldValues[j], options, q + 1); } if (message.newValues && message.newValues.length) { object.newValues = []; for (var j = 0; j < message.newValues.length; ++j) - object.newValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.newValues[j], options); + object.newValues[j] = $root.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue.toObject(message.newValues[j], options, q + 1); } return object; }; @@ -104538,11 +107722,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HeartbeatRecord.encode = function encode(message, writer) { + HeartbeatRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.timestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -104556,7 +107744,7 @@ * @returns {$protobuf.Writer} Writer */ HeartbeatRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -104626,7 +107814,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.timestamp, long + 1); if (error) return "timestamp." + error; @@ -104645,13 +107833,15 @@ HeartbeatRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.HeartbeatRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ChangeStreamRecord.HeartbeatRecord(); if (object.timestamp != null) { - if (typeof object.timestamp !== "object") + if (!$util.isObject(object.timestamp)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.HeartbeatRecord.timestamp: object expected"); message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp, long + 1); } @@ -104667,14 +107857,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HeartbeatRecord.toObject = function toObject(message, options) { + HeartbeatRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.timestamp = null; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options, q + 1); return object; }; @@ -104779,11 +107973,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionStartRecord.encode = function encode(message, writer) { + PartitionStartRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.startTimestamp != null && Object.hasOwnProperty.call(message, "startTimestamp")) - $root.google.protobuf.Timestamp.encode(message.startTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); if (message.partitionTokens != null && message.partitionTokens.length) @@ -104802,7 +108000,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionStartRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -104882,15 +108080,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) { + if (message.startTimestamp != null && Object.hasOwnProperty.call(message, "startTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.startTimestamp, long + 1); if (error) return "startTimestamp." + error; } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) if (!$util.isString(message.recordSequence)) return "recordSequence: string expected"; - if (message.partitionTokens != null && message.hasOwnProperty("partitionTokens")) { + if (message.partitionTokens != null && Object.hasOwnProperty.call(message, "partitionTokens")) { if (!Array.isArray(message.partitionTokens)) return "partitionTokens: array expected"; for (var i = 0; i < message.partitionTokens.length; ++i) @@ -104911,13 +108109,15 @@ PartitionStartRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionStartRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionStartRecord(); if (object.startTimestamp != null) { - if (typeof object.startTimestamp !== "object") + if (!$util.isObject(object.startTimestamp)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionStartRecord.startTimestamp: object expected"); message.startTimestamp = $root.google.protobuf.Timestamp.fromObject(object.startTimestamp, long + 1); } @@ -104942,9 +108142,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionStartRecord.toObject = function toObject(message, options) { + PartitionStartRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.partitionTokens = []; @@ -104952,9 +108156,9 @@ object.startTimestamp = null; object.recordSequence = ""; } - if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) - object.startTimestamp = $root.google.protobuf.Timestamp.toObject(message.startTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.startTimestamp != null && Object.hasOwnProperty.call(message, "startTimestamp")) + object.startTimestamp = $root.google.protobuf.Timestamp.toObject(message.startTimestamp, options, q + 1); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) object.recordSequence = message.recordSequence; if (message.partitionTokens && message.partitionTokens.length) { object.partitionTokens = []; @@ -105064,11 +108268,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionEndRecord.encode = function encode(message, writer) { + PartitionEndRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.endTimestamp != null && Object.hasOwnProperty.call(message, "endTimestamp")) - $root.google.protobuf.Timestamp.encode(message.endTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) @@ -105086,7 +108294,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionEndRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -105164,15 +108372,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) { + if (message.endTimestamp != null && Object.hasOwnProperty.call(message, "endTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.endTimestamp, long + 1); if (error) return "endTimestamp." + error; } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) if (!$util.isString(message.recordSequence)) return "recordSequence: string expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) if (!$util.isString(message.partitionToken)) return "partitionToken: string expected"; return null; @@ -105189,13 +108397,15 @@ PartitionEndRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEndRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEndRecord(); if (object.endTimestamp != null) { - if (typeof object.endTimestamp !== "object") + if (!$util.isObject(object.endTimestamp)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEndRecord.endTimestamp: object expected"); message.endTimestamp = $root.google.protobuf.Timestamp.fromObject(object.endTimestamp, long + 1); } @@ -105215,20 +108425,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionEndRecord.toObject = function toObject(message, options) { + PartitionEndRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.endTimestamp = null; object.recordSequence = ""; object.partitionToken = ""; } - if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) - object.endTimestamp = $root.google.protobuf.Timestamp.toObject(message.endTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.endTimestamp != null && Object.hasOwnProperty.call(message, "endTimestamp")) + object.endTimestamp = $root.google.protobuf.Timestamp.toObject(message.endTimestamp, options, q + 1); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) object.recordSequence = message.recordSequence; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) object.partitionToken = message.partitionToken; return object; }; @@ -105353,21 +108567,25 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionEventRecord.encode = function encode(message, writer) { + PartitionEventRecord.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) - $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.commitTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.recordSequence); if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.partitionToken); if (message.moveInEvents != null && message.moveInEvents.length) for (var i = 0; i < message.moveInEvents.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.encode(message.moveInEvents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.encode(message.moveInEvents[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.moveOutEvents != null && message.moveOutEvents.length) for (var i = 0; i < message.moveOutEvents.length; ++i) - $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.encode(message.moveOutEvents[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.encode(message.moveOutEvents[i], writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -105381,7 +108599,7 @@ * @returns {$protobuf.Writer} Writer */ PartitionEventRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -105471,18 +108689,18 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) { + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) { var error = $root.google.protobuf.Timestamp.verify(message.commitTimestamp, long + 1); if (error) return "commitTimestamp." + error; } - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) if (!$util.isString(message.recordSequence)) return "recordSequence: string expected"; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) if (!$util.isString(message.partitionToken)) return "partitionToken: string expected"; - if (message.moveInEvents != null && message.hasOwnProperty("moveInEvents")) { + if (message.moveInEvents != null && Object.hasOwnProperty.call(message, "moveInEvents")) { if (!Array.isArray(message.moveInEvents)) return "moveInEvents: array expected"; for (var i = 0; i < message.moveInEvents.length; ++i) { @@ -105491,7 +108709,7 @@ return "moveInEvents." + error; } } - if (message.moveOutEvents != null && message.hasOwnProperty("moveOutEvents")) { + if (message.moveOutEvents != null && Object.hasOwnProperty.call(message, "moveOutEvents")) { if (!Array.isArray(message.moveOutEvents)) return "moveOutEvents: array expected"; for (var i = 0; i < message.moveOutEvents.length; ++i) { @@ -105514,13 +108732,15 @@ PartitionEventRecord.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord(); if (object.commitTimestamp != null) { - if (typeof object.commitTimestamp !== "object") + if (!$util.isObject(object.commitTimestamp)) throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.commitTimestamp: object expected"); message.commitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.commitTimestamp, long + 1); } @@ -105533,7 +108753,7 @@ throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveInEvents: array expected"); message.moveInEvents = []; for (var i = 0; i < object.moveInEvents.length; ++i) { - if (typeof object.moveInEvents[i] !== "object") + if (!$util.isObject(object.moveInEvents[i])) throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveInEvents: object expected"); message.moveInEvents[i] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.fromObject(object.moveInEvents[i], long + 1); } @@ -105543,7 +108763,7 @@ throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveOutEvents: array expected"); message.moveOutEvents = []; for (var i = 0; i < object.moveOutEvents.length; ++i) { - if (typeof object.moveOutEvents[i] !== "object") + if (!$util.isObject(object.moveOutEvents[i])) throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.moveOutEvents: object expected"); message.moveOutEvents[i] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.fromObject(object.moveOutEvents[i], long + 1); } @@ -105560,9 +108780,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionEventRecord.toObject = function toObject(message, options) { + PartitionEventRecord.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.moveInEvents = []; @@ -105573,21 +108797,21 @@ object.recordSequence = ""; object.partitionToken = ""; } - if (message.commitTimestamp != null && message.hasOwnProperty("commitTimestamp")) - object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options); - if (message.recordSequence != null && message.hasOwnProperty("recordSequence")) + if (message.commitTimestamp != null && Object.hasOwnProperty.call(message, "commitTimestamp")) + object.commitTimestamp = $root.google.protobuf.Timestamp.toObject(message.commitTimestamp, options, q + 1); + if (message.recordSequence != null && Object.hasOwnProperty.call(message, "recordSequence")) object.recordSequence = message.recordSequence; - if (message.partitionToken != null && message.hasOwnProperty("partitionToken")) + if (message.partitionToken != null && Object.hasOwnProperty.call(message, "partitionToken")) object.partitionToken = message.partitionToken; if (message.moveInEvents && message.moveInEvents.length) { object.moveInEvents = []; for (var j = 0; j < message.moveInEvents.length; ++j) - object.moveInEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.toObject(message.moveInEvents[j], options); + object.moveInEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent.toObject(message.moveInEvents[j], options, q + 1); } if (message.moveOutEvents && message.moveOutEvents.length) { object.moveOutEvents = []; for (var j = 0; j < message.moveOutEvents.length; ++j) - object.moveOutEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.toObject(message.moveOutEvents[j], options); + object.moveOutEvents[j] = $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent.toObject(message.moveOutEvents[j], options, q + 1); } return object; }; @@ -105671,9 +108895,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveInEvent.encode = function encode(message, writer) { + MoveInEvent.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sourcePartitionToken != null && Object.hasOwnProperty.call(message, "sourcePartitionToken")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourcePartitionToken); return writer; @@ -105689,7 +108917,7 @@ * @returns {$protobuf.Writer} Writer */ MoveInEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -105759,7 +108987,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.sourcePartitionToken != null && message.hasOwnProperty("sourcePartitionToken")) + if (message.sourcePartitionToken != null && Object.hasOwnProperty.call(message, "sourcePartitionToken")) if (!$util.isString(message.sourcePartitionToken)) return "sourcePartitionToken: string expected"; return null; @@ -105776,6 +109004,8 @@ MoveInEvent.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -105795,13 +109025,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveInEvent.toObject = function toObject(message, options) { + MoveInEvent.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.sourcePartitionToken = ""; - if (message.sourcePartitionToken != null && message.hasOwnProperty("sourcePartitionToken")) + if (message.sourcePartitionToken != null && Object.hasOwnProperty.call(message, "sourcePartitionToken")) object.sourcePartitionToken = message.sourcePartitionToken; return object; }; @@ -105888,9 +109122,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MoveOutEvent.encode = function encode(message, writer) { + MoveOutEvent.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.destinationPartitionToken != null && Object.hasOwnProperty.call(message, "destinationPartitionToken")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationPartitionToken); return writer; @@ -105906,7 +109144,7 @@ * @returns {$protobuf.Writer} Writer */ MoveOutEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -105976,7 +109214,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.destinationPartitionToken != null && message.hasOwnProperty("destinationPartitionToken")) + if (message.destinationPartitionToken != null && Object.hasOwnProperty.call(message, "destinationPartitionToken")) if (!$util.isString(message.destinationPartitionToken)) return "destinationPartitionToken: string expected"; return null; @@ -105993,6 +109231,8 @@ MoveOutEvent.fromObject = function fromObject(object, long) { if (object instanceof $root.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent) return object; + if (!$util.isObject(object)) + throw TypeError(".google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -106012,13 +109252,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MoveOutEvent.toObject = function toObject(message, options) { + MoveOutEvent.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.destinationPartitionToken = ""; - if (message.destinationPartitionToken != null && message.hasOwnProperty("destinationPartitionToken")) + if (message.destinationPartitionToken != null && Object.hasOwnProperty.call(message, "destinationPartitionToken")) object.destinationPartitionToken = message.destinationPartitionToken; return object; }; @@ -106210,9 +109454,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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) @@ -106245,7 +109493,7 @@ * @returns {$protobuf.Writer} Writer */ ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -106348,20 +109596,20 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (message.pattern != null && Object.hasOwnProperty.call(message, "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 (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) if (!$util.isString(message.nameField)) return "nameField: string expected"; - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) switch (message.history) { default: return "history: enum value expected"; @@ -106370,13 +109618,13 @@ case 2: break; } - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) if (!$util.isString(message.plural)) return "plural: string expected"; - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) if (!$util.isString(message.singular)) return "singular: string expected"; - if (message.style != null && message.hasOwnProperty("style")) { + if (message.style != null && Object.hasOwnProperty.call(message, "style")) { if (!Array.isArray(message.style)) return "style: array expected"; for (var i = 0; i < message.style.length; ++i) @@ -106402,6 +109650,8 @@ ResourceDescriptor.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.ResourceDescriptor) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ResourceDescriptor: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -106475,9 +109725,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.pattern = []; @@ -106490,20 +109744,20 @@ object.plural = ""; object.singular = ""; } - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "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")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "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")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) object.singular = message.singular; if (message.style && message.style.length) { object.style = []; @@ -106634,9 +109888,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -106654,7 +109912,7 @@ * @returns {$protobuf.Writer} Writer */ ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -106728,10 +109986,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) if (!$util.isString(message.type)) return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) if (!$util.isString(message.childType)) return "childType: string expected"; return null; @@ -106748,6 +110006,8 @@ ResourceReference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.ResourceReference) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ResourceReference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -106769,17 +110029,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.type = ""; object.childType = ""; } - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) object.childType = message.childType; return object; }; @@ -106876,12 +110140,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + Http.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; @@ -106897,7 +110165,7 @@ * @returns {$protobuf.Writer} Writer */ Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -106973,7 +110241,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rules != null && message.hasOwnProperty("rules")) { + if (message.rules != null && Object.hasOwnProperty.call(message, "rules")) { if (!Array.isArray(message.rules)) return "rules: array expected"; for (var i = 0; i < message.rules.length; ++i) { @@ -106982,7 +110250,7 @@ return "rules." + error; } } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) if (typeof message.fullyDecodeReservedExpansion !== "boolean") return "fullyDecodeReservedExpansion: boolean expected"; return null; @@ -106999,6 +110267,8 @@ Http.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.Http) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Http: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -107009,7 +110279,7 @@ 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") + if (!$util.isObject(object.rules[i])) throw TypeError(".google.api.Http.rules: object expected"); message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i], long + 1); } @@ -107028,9 +110298,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.rules = []; @@ -107039,9 +110313,9 @@ 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); + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options, q + 1); } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; @@ -107224,9 +110498,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -107242,10 +110520,10 @@ 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(); + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).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(); + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; @@ -107261,7 +110539,7 @@ * @returns {$protobuf.Writer} Writer */ HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -107370,43 +110648,43 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) if (!$util.isString(message.selector)) return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { + if (message.get != null && Object.hasOwnProperty.call(message, "get")) { properties.pattern = 1; if (!$util.isString(message.get)) return "get: string expected"; } - if (message.put != null && message.hasOwnProperty("put")) { + if (message.put != null && Object.hasOwnProperty.call(message, "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 (message.post != null && Object.hasOwnProperty.call(message, "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 (message["delete"] != null && Object.hasOwnProperty.call(message, "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 (message.patch != null && Object.hasOwnProperty.call(message, "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 (message.custom != null && Object.hasOwnProperty.call(message, "custom")) { if (properties.pattern === 1) return "pattern: multiple values"; properties.pattern = 1; @@ -107416,13 +110694,13 @@ return "custom." + error; } } - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) if (!$util.isString(message.body)) return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) if (!$util.isString(message.responseBody)) return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (message.additionalBindings != null && Object.hasOwnProperty.call(message, "additionalBindings")) { if (!Array.isArray(message.additionalBindings)) return "additionalBindings: array expected"; for (var i = 0; i < message.additionalBindings.length; ++i) { @@ -107445,6 +110723,8 @@ HttpRule.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.HttpRule) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.HttpRule: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -107463,7 +110743,7 @@ if (object.patch != null) message.patch = String(object.patch); if (object.custom != null) { - if (typeof object.custom !== "object") + if (!$util.isObject(object.custom)) throw TypeError(".google.api.HttpRule.custom: object expected"); message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom, long + 1); } @@ -107476,7 +110756,7 @@ 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") + if (!$util.isObject(object.additionalBindings[i])) throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i], long + 1); } @@ -107493,9 +110773,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.additionalBindings = []; @@ -107504,46 +110788,46 @@ object.body = ""; object.responseBody = ""; } - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { + if (message.get != null && Object.hasOwnProperty.call(message, "get")) { object.get = message.get; if (options.oneofs) object.pattern = "get"; } - if (message.put != null && message.hasOwnProperty("put")) { + if (message.put != null && Object.hasOwnProperty.call(message, "put")) { object.put = message.put; if (options.oneofs) object.pattern = "put"; } - if (message.post != null && message.hasOwnProperty("post")) { + if (message.post != null && Object.hasOwnProperty.call(message, "post")) { object.post = message.post; if (options.oneofs) object.pattern = "post"; } - if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) { object["delete"] = message["delete"]; if (options.oneofs) object.pattern = "delete"; } - if (message.patch != null && message.hasOwnProperty("patch")) { + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) { object.patch = message.patch; if (options.oneofs) object.pattern = "patch"; } - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options, q + 1); 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); + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options, q + 1); } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) object.responseBody = message.responseBody; return object; }; @@ -107639,9 +110923,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -107659,7 +110947,7 @@ * @returns {$protobuf.Writer} Writer */ CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -107733,10 +111021,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) if (!$util.isString(message.kind)) return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) if (!$util.isString(message.path)) return "path: string expected"; return null; @@ -107753,6 +111041,8 @@ CustomHttpPattern.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.CustomHttpPattern) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CustomHttpPattern: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -107774,17 +111064,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.kind = ""; object.path = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) object.path = message.path; return object; }; @@ -107890,9 +111184,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommonLanguageSettings.encode = function encode(message, writer) { + CommonLanguageSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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) { @@ -107902,7 +111200,7 @@ 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(); + $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -107916,7 +111214,7 @@ * @returns {$protobuf.Writer} Writer */ CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -108001,10 +111299,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) if (!$util.isString(message.referenceDocsUri)) return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (message.destinations != null && Object.hasOwnProperty.call(message, "destinations")) { if (!Array.isArray(message.destinations)) return "destinations: array expected"; for (var i = 0; i < message.destinations.length; ++i) @@ -108017,7 +111315,7 @@ break; } } - if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) { var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration, long + 1); if (error) return "selectiveGapicGeneration." + error; @@ -108036,6 +111334,8 @@ CommonLanguageSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.CommonLanguageSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CommonLanguageSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -108069,7 +111369,7 @@ } } if (object.selectiveGapicGeneration != null) { - if (typeof object.selectiveGapicGeneration !== "object") + if (!$util.isObject(object.selectiveGapicGeneration)) throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration, long + 1); } @@ -108085,9 +111385,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommonLanguageSettings.toObject = function toObject(message, options) { + CommonLanguageSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.destinations = []; @@ -108095,15 +111399,15 @@ object.referenceDocsUri = ""; object.selectiveGapicGeneration = null; } - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "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); + if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) + object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options, q + 1); return object; }; @@ -108279,9 +111583,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientLibrarySettings.encode = function encode(message, writer) { + ClientLibrarySettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -108289,21 +111597,21 @@ 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(); + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork(), q + 1).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(); + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).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(); + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).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(); + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).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(); + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).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(); + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).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(); + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).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(); + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); return writer; }; @@ -108317,7 +111625,7 @@ * @returns {$protobuf.Writer} Writer */ ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -108427,10 +111735,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) if (!$util.isString(message.version)) return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) switch (message.launchStage) { default: return "launchStage: enum value expected"; @@ -108444,45 +111752,45 @@ case 5: break; } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) if (typeof message.restNumericEnums !== "boolean") return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) { var error = $root.google.api.JavaSettings.verify(message.javaSettings, long + 1); if (error) return "javaSettings." + error; } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) { var error = $root.google.api.CppSettings.verify(message.cppSettings, long + 1); if (error) return "cppSettings." + error; } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) { var error = $root.google.api.PhpSettings.verify(message.phpSettings, long + 1); if (error) return "phpSettings." + error; } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) { var error = $root.google.api.PythonSettings.verify(message.pythonSettings, long + 1); if (error) return "pythonSettings." + error; } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) { var error = $root.google.api.NodeSettings.verify(message.nodeSettings, long + 1); if (error) return "nodeSettings." + error; } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) { var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings, long + 1); if (error) return "dotnetSettings." + error; } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) { var error = $root.google.api.RubySettings.verify(message.rubySettings, long + 1); if (error) return "rubySettings." + error; } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) { var error = $root.google.api.GoSettings.verify(message.goSettings, long + 1); if (error) return "goSettings." + error; @@ -108501,6 +111809,8 @@ ClientLibrarySettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.ClientLibrarySettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.ClientLibrarySettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -108551,42 +111861,42 @@ if (object.restNumericEnums != null) message.restNumericEnums = Boolean(object.restNumericEnums); if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") + if (!$util.isObject(object.javaSettings)) throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings, long + 1); } if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") + if (!$util.isObject(object.cppSettings)) throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings, long + 1); } if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") + if (!$util.isObject(object.phpSettings)) throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings, long + 1); } if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") + if (!$util.isObject(object.pythonSettings)) throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings, long + 1); } if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") + if (!$util.isObject(object.nodeSettings)) throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings, long + 1); } if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") + if (!$util.isObject(object.dotnetSettings)) throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings, long + 1); } if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") + if (!$util.isObject(object.rubySettings)) throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings, long + 1); } if (object.goSettings != null) { - if (typeof object.goSettings !== "object") + if (!$util.isObject(object.goSettings)) throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings, long + 1); } @@ -108602,9 +111912,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientLibrarySettings.toObject = function toObject(message, options) { + ClientLibrarySettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.version = ""; @@ -108619,28 +111933,28 @@ object.rubySettings = null; object.goSettings = null; } - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) + if (message.launchStage != null && Object.hasOwnProperty.call(message, "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")) + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "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); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options, q + 1); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options, q + 1); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options, q + 1); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options, q + 1); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options, q + 1); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options, q + 1); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options, q + 1); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options, q + 1); return object; }; @@ -108819,12 +112133,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Publishing.encode = function encode(message, writer) { + Publishing.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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")) @@ -108842,7 +112160,7 @@ 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(); + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork(), q + 1).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")) @@ -108860,7 +112178,7 @@ * @returns {$protobuf.Writer} Writer */ Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -108976,7 +112294,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (message.methodSettings != null && Object.hasOwnProperty.call(message, "methodSettings")) { if (!Array.isArray(message.methodSettings)) return "methodSettings: array expected"; for (var i = 0; i < message.methodSettings.length; ++i) { @@ -108985,29 +112303,29 @@ return "methodSettings." + error; } } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) if (!$util.isString(message.newIssueUri)) return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) if (!$util.isString(message.documentationUri)) return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) if (!$util.isString(message.apiShortName)) return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) if (!$util.isString(message.githubLabel)) return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (message.codeownerGithubTeams != null && Object.hasOwnProperty.call(message, "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 (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) if (!$util.isString(message.docTagPrefix)) return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) switch (message.organization) { default: return "organization: enum value expected"; @@ -109021,7 +112339,7 @@ case 7: break; } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (message.librarySettings != null && Object.hasOwnProperty.call(message, "librarySettings")) { if (!Array.isArray(message.librarySettings)) return "librarySettings: array expected"; for (var i = 0; i < message.librarySettings.length; ++i) { @@ -109030,10 +112348,10 @@ return "librarySettings." + error; } } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) if (!$util.isString(message.protoReferenceDocumentationUri)) return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) if (!$util.isString(message.restReferenceDocumentationUri)) return "restReferenceDocumentationUri: string expected"; return null; @@ -109050,6 +112368,8 @@ Publishing.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.Publishing) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.Publishing: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -109060,7 +112380,7 @@ 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") + if (!$util.isObject(object.methodSettings[i])) throw TypeError(".google.api.Publishing.methodSettings: object expected"); message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i], long + 1); } @@ -109127,7 +112447,7 @@ 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") + if (!$util.isObject(object.librarySettings[i])) throw TypeError(".google.api.Publishing.librarySettings: object expected"); message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i], long + 1); } @@ -109148,9 +112468,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Publishing.toObject = function toObject(message, options) { + Publishing.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.methodSettings = []; @@ -109170,33 +112494,33 @@ 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); + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options, q + 1); } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "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")) + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) + if (message.organization != null && Object.hasOwnProperty.call(message, "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); + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options, q + 1); } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; return object; }; @@ -109302,16 +112626,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - JavaSettings.encode = function encode(message, writer) { + JavaSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -109325,7 +112653,7 @@ * @returns {$protobuf.Writer} Writer */ JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -109424,10 +112752,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) if (!$util.isString(message.libraryPackage)) return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) { if (!$util.isObject(message.serviceClassNames)) return "serviceClassNames: object expected"; var key = Object.keys(message.serviceClassNames); @@ -109435,7 +112763,7 @@ if (!$util.isString(message.serviceClassNames[key[i]])) return "serviceClassNames: string{k:string} expected"; } - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -109454,6 +112782,8 @@ JavaSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.JavaSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.JavaSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -109462,7 +112792,7 @@ if (object.libraryPackage != null) message.libraryPackage = String(object.libraryPackage); if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") + if (!$util.isObject(object.serviceClassNames)) throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); message.serviceClassNames = {}; for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) { @@ -109472,7 +112802,7 @@ } } if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.JavaSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -109488,9 +112818,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - JavaSettings.toObject = function toObject(message, options) { + JavaSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.objects || options.defaults) object.serviceClassNames = {}; @@ -109498,7 +112832,7 @@ object.libraryPackage = ""; object.common = null; } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) object.libraryPackage = message.libraryPackage; var keys2; if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { @@ -109509,8 +112843,8 @@ 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); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); return object; }; @@ -109596,11 +112930,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CppSettings.encode = function encode(message, writer) { + CppSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -109614,7 +112952,7 @@ * @returns {$protobuf.Writer} Writer */ CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -109684,7 +113022,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -109703,13 +113041,15 @@ CppSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.CppSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.CppSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.CppSettings(); if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.CppSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -109725,14 +113065,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CppSettings.toObject = function toObject(message, options) { + CppSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); return object; }; @@ -109818,11 +113162,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PhpSettings.encode = function encode(message, writer) { + PhpSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -109836,7 +113184,7 @@ * @returns {$protobuf.Writer} Writer */ PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -109906,7 +113254,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -109925,13 +113273,15 @@ PhpSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.PhpSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PhpSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.PhpSettings(); if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.PhpSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -109947,14 +113297,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PhpSettings.toObject = function toObject(message, options) { + PhpSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); return object; }; @@ -110049,13 +113403,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PythonSettings.encode = function encode(message, writer) { + PythonSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); + $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -110069,7 +113427,7 @@ * @returns {$protobuf.Writer} Writer */ PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110143,12 +113501,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; } - if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) { var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures, long + 1); if (error) return "experimentalFeatures." + error; @@ -110167,18 +113525,20 @@ PythonSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.PythonSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PythonSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.PythonSettings(); if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.PythonSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } if (object.experimentalFeatures != null) { - if (typeof object.experimentalFeatures !== "object") + if (!$util.isObject(object.experimentalFeatures)) throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures, long + 1); } @@ -110194,18 +113554,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PythonSettings.toObject = function toObject(message, options) { + PythonSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); + if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) + object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options, q + 1); return object; }; @@ -110306,9 +113670,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExperimentalFeatures.encode = function encode(message, writer) { + ExperimentalFeatures.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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")) @@ -110328,7 +113696,7 @@ * @returns {$protobuf.Writer} Writer */ ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110406,13 +113774,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) if (typeof message.restAsyncIoEnabled !== "boolean") return "restAsyncIoEnabled: boolean expected"; - if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) if (typeof message.protobufPythonicTypesEnabled !== "boolean") return "protobufPythonicTypesEnabled: boolean expected"; - if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) if (typeof message.unversionedPackageDisabled !== "boolean") return "unversionedPackageDisabled: boolean expected"; return null; @@ -110429,6 +113797,8 @@ ExperimentalFeatures.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.PythonSettings.ExperimentalFeatures: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -110452,20 +113822,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExperimentalFeatures.toObject = function toObject(message, options) { + ExperimentalFeatures.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.restAsyncIoEnabled = false; object.protobufPythonicTypesEnabled = false; object.unversionedPackageDisabled = false; } - if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) + if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) object.restAsyncIoEnabled = message.restAsyncIoEnabled; - if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) + if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; - if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) + if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) object.unversionedPackageDisabled = message.unversionedPackageDisabled; return object; }; @@ -110555,11 +113929,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NodeSettings.encode = function encode(message, writer) { + NodeSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -110573,7 +113951,7 @@ * @returns {$protobuf.Writer} Writer */ NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110643,7 +114021,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -110662,13 +114040,15 @@ NodeSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.NodeSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.NodeSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.NodeSettings(); if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.NodeSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -110684,14 +114064,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NodeSettings.toObject = function toObject(message, options) { + NodeSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); return object; }; @@ -110827,11 +114211,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DotnetSettings.encode = function encode(message, writer) { + DotnetSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); @@ -110860,7 +114248,7 @@ * @returns {$protobuf.Writer} Writer */ DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110998,12 +114386,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { if (!$util.isObject(message.renamedServices)) return "renamedServices: object expected"; var key = Object.keys(message.renamedServices); @@ -111011,7 +114399,7 @@ if (!$util.isString(message.renamedServices[key[i]])) return "renamedServices: string{k:string} expected"; } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) { if (!$util.isObject(message.renamedResources)) return "renamedResources: object expected"; var key = Object.keys(message.renamedResources); @@ -111019,21 +114407,21 @@ if (!$util.isString(message.renamedResources[key[i]])) return "renamedResources: string{k:string} expected"; } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (message.ignoredResources != null && Object.hasOwnProperty.call(message, "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 (message.forcedNamespaceAliases != null && Object.hasOwnProperty.call(message, "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 (message.handwrittenSignatures != null && Object.hasOwnProperty.call(message, "handwrittenSignatures")) { if (!Array.isArray(message.handwrittenSignatures)) return "handwrittenSignatures: array expected"; for (var i = 0; i < message.handwrittenSignatures.length; ++i) @@ -111054,18 +114442,20 @@ DotnetSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.DotnetSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.DotnetSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.DotnetSettings(); if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.DotnetSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } if (object.renamedServices) { - if (typeof object.renamedServices !== "object") + if (!$util.isObject(object.renamedServices)) throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); message.renamedServices = {}; for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { @@ -111075,7 +114465,7 @@ } } if (object.renamedResources) { - if (typeof object.renamedResources !== "object") + if (!$util.isObject(object.renamedResources)) throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); message.renamedResources = {}; for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) { @@ -111117,9 +114507,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DotnetSettings.toObject = function toObject(message, options) { + DotnetSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.ignoredResources = []; @@ -111132,8 +114526,8 @@ } if (options.defaults) object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); var keys2; if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { object.renamedServices = {}; @@ -111251,11 +114645,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RubySettings.encode = function encode(message, writer) { + RubySettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -111269,7 +114667,7 @@ * @returns {$protobuf.Writer} Writer */ RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -111339,7 +114737,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; @@ -111358,13 +114756,15 @@ RubySettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.RubySettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.RubySettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.RubySettings(); if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.RubySettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } @@ -111380,14 +114780,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RubySettings.toObject = function toObject(message, options) { + RubySettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); return object; }; @@ -111483,11 +114887,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GoSettings.encode = function encode(message, writer) { + GoSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); @@ -111504,7 +114912,7 @@ * @returns {$protobuf.Writer} Writer */ GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -111599,12 +115007,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { + if (message.common != null && Object.hasOwnProperty.call(message, "common")) { var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); if (error) return "common." + error; } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) { if (!$util.isObject(message.renamedServices)) return "renamedServices: object expected"; var key = Object.keys(message.renamedServices); @@ -111626,18 +115034,20 @@ GoSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.GoSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.GoSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.GoSettings(); if (object.common != null) { - if (typeof object.common !== "object") + if (!$util.isObject(object.common)) throw TypeError(".google.api.GoSettings.common: object expected"); message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); } if (object.renamedServices) { - if (typeof object.renamedServices !== "object") + if (!$util.isObject(object.renamedServices)) throw TypeError(".google.api.GoSettings.renamedServices: object expected"); message.renamedServices = {}; for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { @@ -111658,16 +115068,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GoSettings.toObject = function toObject(message, options) { + GoSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options, q + 1); var keys2; if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { object.renamedServices = {}; @@ -111781,13 +115195,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MethodSettings.encode = function encode(message, writer) { + MethodSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).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]); @@ -111804,7 +115222,7 @@ * @returns {$protobuf.Writer} Writer */ MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -111884,15 +115302,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) if (!$util.isString(message.selector)) return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) { var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning, long + 1); if (error) return "longRunning." + error; } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (message.autoPopulatedFields != null && Object.hasOwnProperty.call(message, "autoPopulatedFields")) { if (!Array.isArray(message.autoPopulatedFields)) return "autoPopulatedFields: array expected"; for (var i = 0; i < message.autoPopulatedFields.length; ++i) @@ -111913,6 +115331,8 @@ MethodSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.MethodSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MethodSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -111921,7 +115341,7 @@ if (object.selector != null) message.selector = String(object.selector); if (object.longRunning != null) { - if (typeof object.longRunning !== "object") + if (!$util.isObject(object.longRunning)) throw TypeError(".google.api.MethodSettings.longRunning: object expected"); message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning, long + 1); } @@ -111944,9 +115364,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MethodSettings.toObject = function toObject(message, options) { + MethodSettings.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.autoPopulatedFields = []; @@ -111954,10 +115378,10 @@ object.selector = ""; object.longRunning = null; } - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "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.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options, q + 1); if (message.autoPopulatedFields && message.autoPopulatedFields.length) { object.autoPopulatedFields = []; for (var j = 0; j < message.autoPopulatedFields.length; ++j) @@ -112072,17 +115496,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LongRunning.encode = function encode(message, writer) { + LongRunning.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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(); + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).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(); + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).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(); + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -112096,7 +115524,7 @@ * @returns {$protobuf.Writer} Writer */ LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -112178,20 +115606,20 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) { var error = $root.google.protobuf.Duration.verify(message.initialPollDelay, long + 1); if (error) return "initialPollDelay." + error; } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) if (typeof message.pollDelayMultiplier !== "number") return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) { var error = $root.google.protobuf.Duration.verify(message.maxPollDelay, long + 1); if (error) return "maxPollDelay." + error; } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) { var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout, long + 1); if (error) return "totalPollTimeout." + error; @@ -112210,25 +115638,27 @@ LongRunning.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.MethodSettings.LongRunning) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.MethodSettings.LongRunning: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.api.MethodSettings.LongRunning(); if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") + if (!$util.isObject(object.initialPollDelay)) throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay, long + 1); } if (object.pollDelayMultiplier != null) message.pollDelayMultiplier = Number(object.pollDelayMultiplier); if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") + if (!$util.isObject(object.maxPollDelay)) throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay, long + 1); } if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") + if (!$util.isObject(object.totalPollTimeout)) throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout, long + 1); } @@ -112244,9 +115674,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LongRunning.toObject = function toObject(message, options) { + LongRunning.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.initialPollDelay = null; @@ -112254,14 +115688,14 @@ 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")) + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options, q + 1); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "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); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options, q + 1); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options, q + 1); return object; }; @@ -112402,9 +115836,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SelectiveGapicGeneration.encode = function encode(message, writer) { + SelectiveGapicGeneration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); 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]); @@ -112423,7 +115861,7 @@ * @returns {$protobuf.Writer} Writer */ SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -112499,14 +115937,14 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.methods != null && message.hasOwnProperty("methods")) { + if (message.methods != null && Object.hasOwnProperty.call(message, "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 (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) if (typeof message.generateOmittedAsInternal !== "boolean") return "generateOmittedAsInternal: boolean expected"; return null; @@ -112523,6 +115961,8 @@ SelectiveGapicGeneration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.SelectiveGapicGeneration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.SelectiveGapicGeneration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -112549,9 +115989,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SelectiveGapicGeneration.toObject = function toObject(message, options) { + SelectiveGapicGeneration.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.methods = []; @@ -112562,7 +116006,7 @@ for (var j = 0; j < message.methods.length; ++j) object.methods[j] = message.methods[j]; } - if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) + if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) object.generateOmittedAsInternal = message.generateOmittedAsInternal; return object; }; @@ -112686,7 +116130,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); }, "name", { value: "ListOperations" }); /** @@ -112719,7 +116163,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "GetOperation" }); /** @@ -112752,7 +116196,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteOperation" }); /** @@ -112785,7 +116229,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "CancelOperation" }); /** @@ -112818,7 +116262,7 @@ * @variation 1 */ Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "WaitOperation" }); /** @@ -112937,19 +116381,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Operation.encode = function encode(message, writer) { + Operation.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -112963,7 +116411,7 @@ * @returns {$protobuf.Writer} Writer */ Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -113050,18 +116498,18 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { var error = $root.google.protobuf.Any.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.done != null && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) if (typeof message.done !== "boolean") return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { properties.result = 1; { var error = $root.google.rpc.Status.verify(message.error, long + 1); @@ -113069,7 +116517,7 @@ return "error." + error; } } - if (message.response != null && message.hasOwnProperty("response")) { + if (message.response != null && Object.hasOwnProperty.call(message, "response")) { if (properties.result === 1) return "result: multiple values"; properties.result = 1; @@ -113093,6 +116541,8 @@ Operation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.Operation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.Operation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -113101,19 +116551,19 @@ if (object.name != null) message.name = String(object.name); if (object.metadata != null) { - if (typeof object.metadata !== "object") + if (!$util.isObject(object.metadata)) throw TypeError(".google.longrunning.Operation.metadata: object expected"); message.metadata = $root.google.protobuf.Any.fromObject(object.metadata, long + 1); } if (object.done != null) message.done = Boolean(object.done); if (object.error != null) { - if (typeof object.error !== "object") + if (!$util.isObject(object.error)) throw TypeError(".google.longrunning.Operation.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); } if (object.response != null) { - if (typeof object.response !== "object") + if (!$util.isObject(object.response)) throw TypeError(".google.longrunning.Operation.response: object expected"); message.response = $root.google.protobuf.Any.fromObject(object.response, long + 1); } @@ -113129,28 +116579,32 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Operation.toObject = function toObject(message, options) { + Operation.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.metadata = null; object.done = false; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options, q + 1); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options, q + 1); if (options.oneofs) object.result = "error"; } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options, q + 1); if (options.oneofs) object.result = "response"; } @@ -113239,9 +116693,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetOperationRequest.encode = function encode(message, writer) { + GetOperationRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -113257,7 +116715,7 @@ * @returns {$protobuf.Writer} Writer */ GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -113327,7 +116785,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -113344,6 +116802,8 @@ GetOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.GetOperationRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.GetOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -113363,13 +116823,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetOperationRequest.toObject = function toObject(message, options) { + GetOperationRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -113483,9 +116947,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListOperationsRequest.encode = function encode(message, writer) { + ListOperationsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -113507,7 +116975,7 @@ * @returns {$protobuf.Writer} Writer */ ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -113589,16 +117057,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) if (!$util.isString(message.filter)) return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; return null; @@ -113615,6 +117083,8 @@ ListOperationsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.ListOperationsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.ListOperationsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -113640,9 +117110,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListOperationsRequest.toObject = function toObject(message, options) { + ListOperationsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.filter = ""; @@ -113650,13 +117124,13 @@ object.pageToken = ""; object.name = ""; } - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -113753,12 +117227,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListOperationsResponse.encode = function encode(message, writer) { + ListOperationsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operations != null && message.operations.length) for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; @@ -113774,7 +117252,7 @@ * @returns {$protobuf.Writer} Writer */ ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -113850,7 +117328,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.operations != null && message.hasOwnProperty("operations")) { + if (message.operations != null && Object.hasOwnProperty.call(message, "operations")) { if (!Array.isArray(message.operations)) return "operations: array expected"; for (var i = 0; i < message.operations.length; ++i) { @@ -113859,7 +117337,7 @@ return "operations." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) if (!$util.isString(message.nextPageToken)) return "nextPageToken: string expected"; return null; @@ -113876,6 +117354,8 @@ ListOperationsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.ListOperationsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.ListOperationsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -113886,7 +117366,7 @@ throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); message.operations = []; for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") + if (!$util.isObject(object.operations[i])) throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); } @@ -113905,9 +117385,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListOperationsResponse.toObject = function toObject(message, options) { + ListOperationsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.operations = []; @@ -113916,9 +117400,9 @@ if (message.operations && message.operations.length) { object.operations = []; for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options, q + 1); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) object.nextPageToken = message.nextPageToken; return object; }; @@ -114005,9 +117489,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelOperationRequest.encode = function encode(message, writer) { + CancelOperationRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -114023,7 +117511,7 @@ * @returns {$protobuf.Writer} Writer */ CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -114093,7 +117581,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -114110,6 +117598,8 @@ CancelOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.CancelOperationRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.CancelOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -114129,13 +117619,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CancelOperationRequest.toObject = function toObject(message, options) { + CancelOperationRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -114222,9 +117716,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteOperationRequest.encode = function encode(message, writer) { + DeleteOperationRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; @@ -114240,7 +117738,7 @@ * @returns {$protobuf.Writer} Writer */ DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -114310,7 +117808,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; return null; @@ -114327,6 +117825,8 @@ DeleteOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.DeleteOperationRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.DeleteOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -114346,13 +117846,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteOperationRequest.toObject = function toObject(message, options) { + DeleteOperationRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -114448,13 +117952,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WaitOperationRequest.encode = function encode(message, writer) { + WaitOperationRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -114468,7 +117976,7 @@ * @returns {$protobuf.Writer} Writer */ WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -114542,10 +118050,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) { var error = $root.google.protobuf.Duration.verify(message.timeout, long + 1); if (error) return "timeout." + error; @@ -114564,6 +118072,8 @@ WaitOperationRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.WaitOperationRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.WaitOperationRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -114572,7 +118082,7 @@ if (object.name != null) message.name = String(object.name); if (object.timeout != null) { - if (typeof object.timeout !== "object") + if (!$util.isObject(object.timeout)) throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout, long + 1); } @@ -114588,18 +118098,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WaitOperationRequest.toObject = function toObject(message, options) { + WaitOperationRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.name = ""; object.timeout = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options, q + 1); return object; }; @@ -114694,9 +118208,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationInfo.encode = function encode(message, writer) { + OperationInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) @@ -114714,7 +118232,7 @@ * @returns {$protobuf.Writer} Writer */ OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -114788,10 +118306,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) if (!$util.isString(message.responseType)) return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) if (!$util.isString(message.metadataType)) return "metadataType: string expected"; return null; @@ -114808,6 +118326,8 @@ OperationInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.longrunning.OperationInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.longrunning.OperationInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -114829,17 +118349,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationInfo.toObject = function toObject(message, options) { + OperationInfo.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.responseType = ""; object.metadataType = ""; } - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) object.metadataType = message.metadataType; return object; }; @@ -114946,7 +118470,7 @@ * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "SetIamPolicy" }); /** @@ -114979,7 +118503,7 @@ * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); }, "name", { value: "GetIamPolicy" }); /** @@ -115012,7 +118536,7 @@ * @variation 1 */ Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); }, "name", { value: "TestIamPermissions" }); /** @@ -115099,15 +118623,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetIamPolicyRequest.encode = function encode(message, writer) { + SetIamPolicyRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -115121,7 +118649,7 @@ * @returns {$protobuf.Writer} Writer */ SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -115199,15 +118727,15 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) if (!$util.isString(message.resource)) return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) { var error = $root.google.iam.v1.Policy.verify(message.policy, long + 1); if (error) return "policy." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask, long + 1); if (error) return "updateMask." + error; @@ -115226,6 +118754,8 @@ SetIamPolicyRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.SetIamPolicyRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -115234,12 +118764,12 @@ if (object.resource != null) message.resource = String(object.resource); if (object.policy != null) { - if (typeof object.policy !== "object") + if (!$util.isObject(object.policy)) throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); message.policy = $root.google.iam.v1.Policy.fromObject(object.policy, long + 1); } if (object.updateMask != null) { - if (typeof object.updateMask !== "object") + if (!$util.isObject(object.updateMask)) throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -115255,21 +118785,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetIamPolicyRequest.toObject = function toObject(message, options) { + SetIamPolicyRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.resource = ""; object.policy = null; object.updateMask = null; } - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options, q + 1); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options, q + 1); return object; }; @@ -115364,13 +118898,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIamPolicyRequest.encode = function encode(message, writer) { + GetIamPolicyRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -115384,7 +118922,7 @@ * @returns {$protobuf.Writer} Writer */ GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -115458,10 +118996,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) if (!$util.isString(message.resource)) return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { + if (message.options != null && Object.hasOwnProperty.call(message, "options")) { var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options, long + 1); if (error) return "options." + error; @@ -115480,6 +119018,8 @@ GetIamPolicyRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.GetIamPolicyRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -115488,7 +119028,7 @@ if (object.resource != null) message.resource = String(object.resource); if (object.options != null) { - if (typeof object.options !== "object") + if (!$util.isObject(object.options)) throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options, long + 1); } @@ -115504,18 +119044,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIamPolicyRequest.toObject = function toObject(message, options) { + GetIamPolicyRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.resource = ""; object.options = null; } - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options, q + 1); return object; }; @@ -115611,9 +119155,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsRequest.encode = function encode(message, writer) { + TestIamPermissionsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); if (message.permissions != null && message.permissions.length) @@ -115632,7 +119180,7 @@ * @returns {$protobuf.Writer} Writer */ TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -115708,10 +119256,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) if (!$util.isString(message.resource)) return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (message.permissions != null && Object.hasOwnProperty.call(message, "permissions")) { if (!Array.isArray(message.permissions)) return "permissions: array expected"; for (var i = 0; i < message.permissions.length; ++i) @@ -115732,6 +119280,8 @@ TestIamPermissionsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.TestIamPermissionsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -115758,15 +119308,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { + TestIamPermissionsRequest.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.permissions = []; if (options.defaults) object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) object.resource = message.resource; if (message.permissions && message.permissions.length) { object.permissions = []; @@ -115859,9 +119413,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TestIamPermissionsResponse.encode = function encode(message, writer) { + TestIamPermissionsResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.permissions != null && message.permissions.length) for (var i = 0; i < message.permissions.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); @@ -115878,7 +119436,7 @@ * @returns {$protobuf.Writer} Writer */ TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -115950,7 +119508,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (message.permissions != null && Object.hasOwnProperty.call(message, "permissions")) { if (!Array.isArray(message.permissions)) return "permissions: array expected"; for (var i = 0; i < message.permissions.length; ++i) @@ -115971,6 +119529,8 @@ TestIamPermissionsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.TestIamPermissionsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -115995,9 +119555,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { + TestIamPermissionsResponse.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.permissions = []; @@ -116091,9 +119655,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetPolicyOptions.encode = function encode(message, writer) { + GetPolicyOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); return writer; @@ -116109,7 +119677,7 @@ * @returns {$protobuf.Writer} Writer */ GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -116179,7 +119747,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) if (!$util.isInteger(message.requestedPolicyVersion)) return "requestedPolicyVersion: integer expected"; return null; @@ -116196,6 +119764,8 @@ GetPolicyOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.GetPolicyOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.GetPolicyOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -116215,13 +119785,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetPolicyOptions.toObject = function toObject(message, options) { + GetPolicyOptions.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) + if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) object.requestedPolicyVersion = message.requestedPolicyVersion; return object; }; @@ -116337,19 +119911,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Policy.encode = function encode(message, writer) { + Policy.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); if (message.bindings != null && message.bindings.length) for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.auditConfigs != null && message.auditConfigs.length) for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -116363,7 +119941,7 @@ * @returns {$protobuf.Writer} Writer */ Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -116449,10 +120027,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) if (!$util.isInteger(message.version)) return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (message.bindings != null && Object.hasOwnProperty.call(message, "bindings")) { if (!Array.isArray(message.bindings)) return "bindings: array expected"; for (var i = 0; i < message.bindings.length; ++i) { @@ -116461,7 +120039,7 @@ return "bindings." + error; } } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (message.auditConfigs != null && Object.hasOwnProperty.call(message, "auditConfigs")) { if (!Array.isArray(message.auditConfigs)) return "auditConfigs: array expected"; for (var i = 0; i < message.auditConfigs.length; ++i) { @@ -116470,7 +120048,7 @@ return "auditConfigs." + error; } } - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) return "etag: buffer expected"; return null; @@ -116487,6 +120065,8 @@ Policy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.Policy) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.Policy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -116499,7 +120079,7 @@ throw TypeError(".google.iam.v1.Policy.bindings: array expected"); message.bindings = []; for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") + if (!$util.isObject(object.bindings[i])) throw TypeError(".google.iam.v1.Policy.bindings: object expected"); message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i], long + 1); } @@ -116509,7 +120089,7 @@ throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); message.auditConfigs = []; for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") + if (!$util.isObject(object.auditConfigs[i])) throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i], long + 1); } @@ -116531,9 +120111,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Policy.toObject = function toObject(message, options) { + Policy.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.bindings = []; @@ -116549,19 +120133,19 @@ object.etag = $util.newBuffer(object.etag); } } - if (message.version != null && message.hasOwnProperty("version")) + if (message.version != null && Object.hasOwnProperty.call(message, "version")) object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; if (message.bindings && message.bindings.length) { object.bindings = []; for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options, q + 1); } if (message.auditConfigs && message.auditConfigs.length) { object.auditConfigs = []; for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options, q + 1); } return object; }; @@ -116667,16 +120251,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Binding.encode = function encode(message, writer) { + Binding.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); if (message.members != null && message.members.length) for (var i = 0; i < message.members.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -116690,7 +120278,7 @@ * @returns {$protobuf.Writer} Writer */ Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -116770,17 +120358,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) if (!$util.isString(message.role)) return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { + if (message.members != null && Object.hasOwnProperty.call(message, "members")) { if (!Array.isArray(message.members)) return "members: array expected"; for (var i = 0; i < message.members.length; ++i) if (!$util.isString(message.members[i])) return "members: string[] expected"; } - if (message.condition != null && message.hasOwnProperty("condition")) { + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) { var error = $root.google.type.Expr.verify(message.condition, long + 1); if (error) return "condition." + error; @@ -116799,6 +120387,8 @@ Binding.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.Binding) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.Binding: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -116814,7 +120404,7 @@ message.members[i] = String(object.members[i]); } if (object.condition != null) { - if (typeof object.condition !== "object") + if (!$util.isObject(object.condition)) throw TypeError(".google.iam.v1.Binding.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition, long + 1); } @@ -116830,9 +120420,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Binding.toObject = function toObject(message, options) { + Binding.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.members = []; @@ -116840,15 +120434,15 @@ object.role = ""; object.condition = null; } - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) object.role = message.role; if (message.members && message.members.length) { object.members = []; for (var j = 0; j < message.members.length; ++j) object.members[j] = message.members[j]; } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options, q + 1); return object; }; @@ -116944,14 +120538,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditConfig.encode = function encode(message, writer) { + AuditConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.service != null && Object.hasOwnProperty.call(message, "service")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); if (message.auditLogConfigs != null && message.auditLogConfigs.length) for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -116965,7 +120563,7 @@ * @returns {$protobuf.Writer} Writer */ AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -117041,10 +120639,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.service != null && message.hasOwnProperty("service")) + if (message.service != null && Object.hasOwnProperty.call(message, "service")) if (!$util.isString(message.service)) return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (message.auditLogConfigs != null && Object.hasOwnProperty.call(message, "auditLogConfigs")) { if (!Array.isArray(message.auditLogConfigs)) return "auditLogConfigs: array expected"; for (var i = 0; i < message.auditLogConfigs.length; ++i) { @@ -117067,6 +120665,8 @@ AuditConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.AuditConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.AuditConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -117079,7 +120679,7 @@ throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); message.auditLogConfigs = []; for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") + if (!$util.isObject(object.auditLogConfigs[i])) throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i], long + 1); } @@ -117096,20 +120696,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AuditConfig.toObject = function toObject(message, options) { + AuditConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.auditLogConfigs = []; if (options.defaults) object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) + if (message.service != null && Object.hasOwnProperty.call(message, "service")) object.service = message.service; if (message.auditLogConfigs && message.auditLogConfigs.length) { object.auditLogConfigs = []; for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options, q + 1); } return object; }; @@ -117206,9 +120810,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditLogConfig.encode = function encode(message, writer) { + AuditLogConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); if (message.exemptedMembers != null && message.exemptedMembers.length) @@ -117227,7 +120835,7 @@ * @returns {$protobuf.Writer} Writer */ AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -117303,7 +120911,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) switch (message.logType) { default: return "logType: enum value expected"; @@ -117313,7 +120921,7 @@ case 3: break; } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (message.exemptedMembers != null && Object.hasOwnProperty.call(message, "exemptedMembers")) { if (!Array.isArray(message.exemptedMembers)) return "exemptedMembers: array expected"; for (var i = 0; i < message.exemptedMembers.length; ++i) @@ -117334,6 +120942,8 @@ AuditLogConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.AuditLogConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.AuditLogConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -117382,15 +120992,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AuditLogConfig.toObject = function toObject(message, options) { + AuditLogConfig.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) object.exemptedMembers = []; if (options.defaults) object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; if (message.exemptedMembers && message.exemptedMembers.length) { object.exemptedMembers = []; @@ -117511,15 +121125,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PolicyDelta.encode = function encode(message, writer) { + PolicyDelta.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.bindingDeltas != null && message.bindingDeltas.length) for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -117533,7 +121151,7 @@ * @returns {$protobuf.Writer} Writer */ PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -117611,7 +121229,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (message.bindingDeltas != null && Object.hasOwnProperty.call(message, "bindingDeltas")) { if (!Array.isArray(message.bindingDeltas)) return "bindingDeltas: array expected"; for (var i = 0; i < message.bindingDeltas.length; ++i) { @@ -117620,7 +121238,7 @@ return "bindingDeltas." + error; } } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (message.auditConfigDeltas != null && Object.hasOwnProperty.call(message, "auditConfigDeltas")) { if (!Array.isArray(message.auditConfigDeltas)) return "auditConfigDeltas: array expected"; for (var i = 0; i < message.auditConfigDeltas.length; ++i) { @@ -117643,6 +121261,8 @@ PolicyDelta.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.PolicyDelta) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.PolicyDelta: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -117653,7 +121273,7 @@ throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); message.bindingDeltas = []; for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") + if (!$util.isObject(object.bindingDeltas[i])) throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i], long + 1); } @@ -117663,7 +121283,7 @@ throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); message.auditConfigDeltas = []; for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") + if (!$util.isObject(object.auditConfigDeltas[i])) throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i], long + 1); } @@ -117680,9 +121300,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PolicyDelta.toObject = function toObject(message, options) { + PolicyDelta.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.arrays || options.defaults) { object.bindingDeltas = []; @@ -117691,12 +121315,12 @@ if (message.bindingDeltas && message.bindingDeltas.length) { object.bindingDeltas = []; for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options, q + 1); } if (message.auditConfigDeltas && message.auditConfigDeltas.length) { object.auditConfigDeltas = []; for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options, q + 1); } return object; }; @@ -117810,9 +121434,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BindingDelta.encode = function encode(message, writer) { + BindingDelta.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); if (message.role != null && Object.hasOwnProperty.call(message, "role")) @@ -117820,7 +121448,7 @@ if (message.member != null && Object.hasOwnProperty.call(message, "member")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -117834,7 +121462,7 @@ * @returns {$protobuf.Writer} Writer */ BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -117916,7 +121544,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) switch (message.action) { default: return "action: enum value expected"; @@ -117925,13 +121553,13 @@ case 2: break; } - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) if (!$util.isString(message.role)) return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) + if (message.member != null && Object.hasOwnProperty.call(message, "member")) if (!$util.isString(message.member)) return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) { var error = $root.google.type.Expr.verify(message.condition, long + 1); if (error) return "condition." + error; @@ -117950,6 +121578,8 @@ BindingDelta.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.BindingDelta) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.BindingDelta: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -117980,7 +121610,7 @@ if (object.member != null) message.member = String(object.member); if (object.condition != null) { - if (typeof object.condition !== "object") + if (!$util.isObject(object.condition)) throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition, long + 1); } @@ -117996,9 +121626,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BindingDelta.toObject = function toObject(message, options) { + BindingDelta.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; @@ -118006,14 +121640,14 @@ object.member = ""; object.condition = null; } - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) + if (message.role != null && Object.hasOwnProperty.call(message, "role")) object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) + if (message.member != null && Object.hasOwnProperty.call(message, "member")) object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options, q + 1); return object; }; @@ -118142,9 +121776,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AuditConfigDelta.encode = function encode(message, writer) { + AuditConfigDelta.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.action != null && Object.hasOwnProperty.call(message, "action")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); if (message.service != null && Object.hasOwnProperty.call(message, "service")) @@ -118166,7 +121804,7 @@ * @returns {$protobuf.Writer} Writer */ AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -118248,7 +121886,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) switch (message.action) { default: return "action: enum value expected"; @@ -118257,13 +121895,13 @@ case 2: break; } - if (message.service != null && message.hasOwnProperty("service")) + if (message.service != null && Object.hasOwnProperty.call(message, "service")) if (!$util.isString(message.service)) return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) if (!$util.isString(message.exemptedMember)) return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) if (!$util.isString(message.logType)) return "logType: string expected"; return null; @@ -118280,6 +121918,8 @@ AuditConfigDelta.fromObject = function fromObject(object, long) { if (object instanceof $root.google.iam.v1.AuditConfigDelta) return object; + if (!$util.isObject(object)) + throw TypeError(".google.iam.v1.AuditConfigDelta: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -118323,9 +121963,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AuditConfigDelta.toObject = function toObject(message, options) { + AuditConfigDelta.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; @@ -118333,13 +121977,13 @@ object.exemptedMember = ""; object.logType = ""; } - if (message.action != null && message.hasOwnProperty("action")) + if (message.action != null && Object.hasOwnProperty.call(message, "action")) object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) + if (message.service != null && Object.hasOwnProperty.call(message, "service")) object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) object.logType = message.logType; return object; }; @@ -118484,9 +122128,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Expr.encode = function encode(message, writer) { + Expr.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); if (message.title != null && Object.hasOwnProperty.call(message, "title")) @@ -118508,7 +122156,7 @@ * @returns {$protobuf.Writer} Writer */ Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -118590,16 +122238,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.expression != null && message.hasOwnProperty("expression")) + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) if (!$util.isString(message.expression)) return "expression: string expected"; - if (message.title != null && message.hasOwnProperty("title")) + if (message.title != null && Object.hasOwnProperty.call(message, "title")) if (!$util.isString(message.title)) return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) if (!$util.isString(message.location)) return "location: string expected"; return null; @@ -118616,6 +122264,8 @@ Expr.fromObject = function fromObject(object, long) { if (object instanceof $root.google.type.Expr) return object; + if (!$util.isObject(object)) + throw TypeError(".google.type.Expr: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -118641,9 +122291,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Expr.toObject = function toObject(message, options) { + Expr.toObject = function toObject(message, options, q) { if (!options) options = {}; + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); var object = {}; if (options.defaults) { object.expression = ""; @@ -118651,13 +122305,13 @@ object.description = ""; object.location = ""; } - if (message.expression != null && message.hasOwnProperty("expression")) + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) + if (message.title != null && Object.hasOwnProperty.call(message, "title")) object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; return object; }; diff --git a/handwritten/storage/.eslintrc.json b/handwritten/storage/.eslintrc.json deleted file mode 100644 index 782153495464..000000000000 --- a/handwritten/storage/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/packages/.eslintrc.json b/packages/.eslintrc.json deleted file mode 100644 index 153f062d7fbe..000000000000 --- a/packages/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../node_modules/gts", - "root": true -}