diff --git a/librarian.yaml b/librarian.yaml index 6ec57dbdf0b9..ac43aa9c3bb1 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1531,7 +1531,6 @@ libraries: - path: google/cloud/sql/v1 - path: google/cloud/sql/v1beta4 copyright_year: "2026" - skip_generate: true nodejs: default_version: v1 - name: google-cloud-storagebatchoperations diff --git a/packages/google-cloud-sql/.OwlBot.yaml b/packages/google-cloud-sql/.OwlBot.yaml deleted file mode 100644 index 74ec2faa42f7..000000000000 --- a/packages/google-cloud-sql/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/cloud/sql/google-cloud-sql-nodejs - dest: /owl-bot-staging/google-cloud-sql - -api-name: sql diff --git a/packages/google-cloud-sql/.repo-metadata.json b/packages/google-cloud-sql/.repo-metadata.json index 07e82186825b..7ccc643c38cb 100644 --- a/packages/google-cloud-sql/.repo-metadata.json +++ b/packages/google-cloud-sql/.repo-metadata.json @@ -1,17 +1,14 @@ { - "name": "sql", - "name_pretty": "Cloud SQL Admin API", - "product_documentation": "", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/sql/latest", - "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", - "release_level": "stable", - "language": "nodejs", - "repo": "googleapis/google-cloud-node", - "distribution_name": "@google-cloud/sql", - "api_id": "sqladmin.googleapis.com", - "default_version": "v1", - "requires_billing": true, - "library_type": "GAPIC_AUTO", - "api_shortname": "sql" -} - + "api_description": "API for Cloud SQL database instance management", + "api_id": "sqladmin.googleapis.com", + "api_shortname": "sqladmin", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/sql/latest", + "default_version": "v1", + "distribution_name": "@google-cloud/sql", + "language": "nodejs", + "library_type": "GAPIC_AUTO", + "name": "sqladmin", + "name_pretty": "Cloud SQL Admin", + "release_level": "preview", + "repo": "googleapis/google-cloud-node" +} \ No newline at end of file diff --git a/packages/google-cloud-sql/librarian.js b/packages/google-cloud-sql/librarian.js index e4edce8eba1b..d2ba020cb488 100644 --- a/packages/google-cloud-sql/librarian.js +++ b/packages/google-cloud-sql/librarian.js @@ -136,9 +136,119 @@ const replacements = [ searchPattern: /export {\s*SqlRegionsServiceClient\s*} from '\.\/sql_regions_service_client';/gs, replacement: '' }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /const SqlAvailableDatabaseVersionsServiceClient = v1\.SqlAvailableDatabaseVersionsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /type SqlAvailableDatabaseVersionsServiceClient = v1\.SqlAvailableDatabaseVersionsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /const SqlEventsServiceClient = v1\.SqlEventsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /type SqlEventsServiceClient = v1\.SqlEventsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /const SqlIamPoliciesServiceClient = v1\.SqlIamPoliciesServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /type SqlIamPoliciesServiceClient = v1\.SqlIamPoliciesServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /const SqlInstanceNamesServiceClient = v1\.SqlInstanceNamesServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /type SqlInstanceNamesServiceClient = v1\.SqlInstanceNamesServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /const SqlRegionsServiceClient = v1\.SqlRegionsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /type SqlRegionsServiceClient = v1\.SqlRegionsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /const SqlBackupsServiceClient = v1\.SqlBackupsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /type SqlBackupsServiceClient = v1\.SqlBackupsServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /const SqlFeatureEligibilityServiceClient = v1\.SqlFeatureEligibilityServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /type SqlFeatureEligibilityServiceClient = v1\.SqlFeatureEligibilityServiceClient;/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /SqlAvailableDatabaseVersionsServiceClient, /gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /SqlEventsServiceClient, /gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /SqlIamPoliciesServiceClient, /gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /SqlInstanceNamesServiceClient, /gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /SqlRegionsServiceClient, /gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /SqlBackupsServiceClient, /gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/src/index.ts', + searchPattern: /SqlFeatureEligibilityServiceClient, /gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.js', + searchPattern: /const sqlAvailableDatabaseVersionsServiceClient = new sql.SqlAvailableDatabaseVersionsServiceClient\(\);/gs, + replacement: '' + }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.js', - searchPattern: /const sqlAvailableDatabaseVersionsServiceClient =\n new sql.SqlAvailableDatabaseVersionsServiceClient\(\);/gs, + searchPattern: /const sqlBackupsServiceClient = new sql.SqlBackupsServiceClient\(\);/gs, replacement: '' }, { @@ -146,6 +256,11 @@ const replacements = [ searchPattern: /const sqlEventsServiceClient = new sql.SqlEventsServiceClient\(\);/gs, replacement: '' }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.js', + searchPattern: /const sqlFeatureEligibilityServiceClient = new sql.SqlFeatureEligibilityServiceClient\(\);/gs, + replacement: '' + }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.js', searchPattern: /const sqlIamPoliciesServiceClient = new sql.SqlIamPoliciesServiceClient\(\);/gs, @@ -163,47 +278,67 @@ const replacements = [ }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /SqlAvailableDatabaseVersionsServiceClient,/gs, + searchPattern: /SqlAvailableDatabaseVersionsServiceClient,/s, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /SqlEventsServiceClient,/gs, + searchPattern: /SqlBackupsServiceClient,/s, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /SqlIamPoliciesServiceClient,/gs, + searchPattern: /SqlFeatureEligibilityServiceClient,/s, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /SqlInstanceNamesServiceClient,/gs, + searchPattern: /SqlEventsServiceClient,/s, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /SqlRegionsServiceClient,/gs, + searchPattern: /SqlIamPoliciesServiceClient,/s, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /function doStuffWithSqlAvailableDatabaseVersionsServiceClient\(\n client: SqlAvailableDatabaseVersionsServiceClient\n\) {\n client.close\(\);\n}/gs, + searchPattern: /SqlInstanceNamesServiceClient,/s, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /function doStuffWithSqlEventsServiceClient\(client: SqlEventsServiceClient\) {\n client.close\(\);\n}/gs, + searchPattern: /SqlRegionsServiceClient,/s, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /function doStuffWithSqlIamPoliciesServiceClient\(\n client: SqlIamPoliciesServiceClient\n\) {\n client.close\(\);\n}/gs, + searchPattern: /function doStuffWithSqlAvailableDatabaseVersionsServiceClient\s*\(\s*client:\s*SqlAvailableDatabaseVersionsServiceClient,?\s*\)\s*\{\s*client\.close\(\);\s*\}/gs, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /function doStuffWithSqlInstanceNamesServiceClient\(\n client: SqlInstanceNamesServiceClient\n\) {\n client.close\(\);\n}/gs, + searchPattern: /function doStuffWithSqlBackupsServiceClient\s*\(\s*client:\s*SqlBackupsServiceClient,?\s*\)\s*\{\s*client\.close\(\);\s*\}/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', + searchPattern: /function doStuffWithSqlEventsServiceClient\s*\(\s*client:\s*SqlEventsServiceClient,?\s*\)\s*\{\s*client\.close\(\);\s*\}/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', + searchPattern: /function doStuffWithSqlFeatureEligibilityServiceClient\s*\(\s*client:\s*SqlFeatureEligibilityServiceClient,?\s*\)\s*\{\s*client\.close\(\);\s*\}/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', + searchPattern: /function doStuffWithSqlIamPoliciesServiceClient\s*\(\s*client:\s*SqlIamPoliciesServiceClient,?\s*\)\s*\{\s*client\.close\(\);\s*\}/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', + searchPattern: /function doStuffWithSqlInstanceNamesServiceClient\s*\(\s*client:\s*SqlInstanceNamesServiceClient,?\s*\)\s*\{\s*client\.close\(\);\s*\}/gs, replacement: '' }, { @@ -213,27 +348,37 @@ const replacements = [ }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /\n const sqlAvailableDatabaseVersionsServiceClient =\n new SqlAvailableDatabaseVersionsServiceClient\(\);\n doStuffWithSqlAvailableDatabaseVersionsServiceClient\(\n sqlAvailableDatabaseVersionsServiceClient\n \);/gs, + searchPattern: /\/\/ check that the client instance can be created\s*const sqlAvailableDatabaseVersionsServiceClient =\s*new SqlAvailableDatabaseVersionsServiceClient\(\);\s*doStuffWithSqlAvailableDatabaseVersionsServiceClient\(\s*sqlAvailableDatabaseVersionsServiceClient,?\s*\);/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', + searchPattern: /\/\/ check that the client instance can be created\s*const sqlBackupsServiceClient =\s*new SqlBackupsServiceClient\(\);\s*doStuffWithSqlBackupsServiceClient\(\s*sqlBackupsServiceClient,?\s*\);/gs, + replacement: '' + }, + { + files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', + searchPattern: /\/\/ check that the client instance can be created\s*const sqlFeatureEligibilityServiceClient =\s*new SqlFeatureEligibilityServiceClient\(\);\s*doStuffWithSqlFeatureEligibilityServiceClient\(\s*sqlFeatureEligibilityServiceClient,?\s*\);/gs, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /const sqlEventsServiceClient = new SqlEventsServiceClient\(\);\n doStuffWithSqlEventsServiceClient\(sqlEventsServiceClient\);/gs, + searchPattern: /\/\/ check that the client instance can be created\s*const sqlEventsServiceClient = new SqlEventsServiceClient\(\);\n doStuffWithSqlEventsServiceClient\(sqlEventsServiceClient\);/gs, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /const sqlIamPoliciesServiceClient = new SqlIamPoliciesServiceClient\(\);\n doStuffWithSqlIamPoliciesServiceClient\(sqlIamPoliciesServiceClient\);/gs, + searchPattern: /\/\/ check that the client instance can be created\s*const sqlIamPoliciesServiceClient = new SqlIamPoliciesServiceClient\(\);\n doStuffWithSqlIamPoliciesServiceClient\(sqlIamPoliciesServiceClient\);/gs, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /const sqlInstanceNamesServiceClient = new SqlInstanceNamesServiceClient\(\);\n doStuffWithSqlInstanceNamesServiceClient\(sqlInstanceNamesServiceClient\);/gs, + searchPattern: /\/\/ check that the client instance can be created\s*const sqlInstanceNamesServiceClient = new SqlInstanceNamesServiceClient\(\);\n doStuffWithSqlInstanceNamesServiceClient\(sqlInstanceNamesServiceClient\);/gs, replacement: '' }, { files: 'packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts', - searchPattern: /const sqlRegionsServiceClient = new SqlRegionsServiceClient\(\);\n doStuffWithSqlRegionsServiceClient\(sqlRegionsServiceClient\);/gs, + searchPattern: /\/\/ check that the client instance can be created\s*const sqlRegionsServiceClient = new SqlRegionsServiceClient\(\);\n doStuffWithSqlRegionsServiceClient\(sqlRegionsServiceClient\);/gs, replacement: '' } ]; diff --git a/packages/google-cloud-sql/protos/protos.js b/packages/google-cloud-sql/protos/protos.js index 2d23112c566c..06ae630a0bdc 100644 --- a/packages/google-cloud-sql/protos/protos.js +++ b/packages/google-cloud-sql/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_sql_protos || ($protobuf.roots._google_cloud_sql_protos = {}); + var $root = $protobuf.roots["_google_cloud_sql_protos"] || ($protobuf.roots["_google_cloud_sql_protos"] = {}); $root.google = (function() { @@ -153,7 +153,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1.SqlBackupRunsDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1.SqlBackupRunsDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -186,7 +186,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1.SqlBackupRunsGetRequest, $root.google.cloud.sql.v1.BackupRun, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1.SqlBackupRunsGetRequest, $root.google.cloud.sql.v1.BackupRun, request, callback); }, "name", { value: "Get" }); /** @@ -219,7 +219,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1.SqlBackupRunsInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1.SqlBackupRunsInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -252,7 +252,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlBackupRunsListRequest, $root.google.cloud.sql.v1.BackupRunsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlBackupRunsListRequest, $root.google.cloud.sql.v1.BackupRunsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -339,9 +339,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsDeleteRequest.encode = function encode(message, writer) { + SqlBackupRunsDeleteRequest.encode = function encode(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 0 =*/8).int64(message.id); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -361,7 +365,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -439,13 +443,13 @@ 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 (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) return "id: integer|Long expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -462,6 +466,8 @@ SqlBackupRunsDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlBackupRunsDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlBackupRunsDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -469,7 +475,7 @@ var message = new $root.google.cloud.sql.v1.SqlBackupRunsDeleteRequest(); if (object.id != null) if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; + message.id = $util.Long.fromValue(object.id, false); else if (typeof object.id === "string") message.id = parseInt(object.id, 10); else if (typeof object.id === "number") @@ -492,27 +498,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsDeleteRequest.toObject = function toObject(message, options) { + SqlBackupRunsDeleteRequest.toObject = function toObject(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.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.id = options.longs === String ? "0" : 0; + object.id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.instance = ""; object.project = ""; } - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.id = typeof message.id === "number" ? BigInt(message.id) : $util.Long.fromBits(message.id.low >>> 0, message.id.high >>> 0, false).toBigInt(); + else if (typeof message.id === "number") object.id = options.longs === String ? String(message.id) : message.id; else object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -617,9 +629,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsGetRequest.encode = function encode(message, writer) { + SqlBackupRunsGetRequest.encode = function encode(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 0 =*/8).int64(message.id); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -639,7 +655,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -717,13 +733,13 @@ 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 (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) return "id: integer|Long expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -740,6 +756,8 @@ SqlBackupRunsGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlBackupRunsGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlBackupRunsGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -747,7 +765,7 @@ var message = new $root.google.cloud.sql.v1.SqlBackupRunsGetRequest(); if (object.id != null) if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; + message.id = $util.Long.fromValue(object.id, false); else if (typeof object.id === "string") message.id = parseInt(object.id, 10); else if (typeof object.id === "number") @@ -770,27 +788,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsGetRequest.toObject = function toObject(message, options) { + SqlBackupRunsGetRequest.toObject = function toObject(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.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.id = options.longs === String ? "0" : 0; + object.id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.instance = ""; object.project = ""; } - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.id = typeof message.id === "number" ? BigInt(message.id) : $util.Long.fromBits(message.id.low >>> 0, message.id.high >>> 0, false).toBigInt(); + else if (typeof message.id === "number") object.id = options.longs === String ? String(message.id) : message.id; else object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -895,15 +919,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsInsertRequest.encode = function encode(message, writer) { + SqlBackupRunsInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.BackupRun.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.BackupRun.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -917,7 +945,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -995,13 +1023,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.BackupRun.verify(message.body, long + 1); if (error) return "body." + error; @@ -1020,6 +1048,8 @@ SqlBackupRunsInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlBackupRunsInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlBackupRunsInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -1030,7 +1060,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlBackupRunsInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.BackupRun.fromObject(object.body, long + 1); } @@ -1046,21 +1076,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsInsertRequest.toObject = function toObject(message, options) { + SqlBackupRunsInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.BackupRun.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.BackupRun.toObject(message.body, options, q + 1); return object; }; @@ -1173,9 +1207,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsListRequest.encode = function encode(message, writer) { + SqlBackupRunsListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) @@ -1197,7 +1235,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -1279,16 +1317,16 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) if (!$util.isInteger(message.maxResults)) return "maxResults: 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -1305,6 +1343,8 @@ SqlBackupRunsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlBackupRunsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlBackupRunsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -1330,9 +1370,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsListRequest.toObject = function toObject(message, options) { + SqlBackupRunsListRequest.toObject = function toObject(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 = ""; @@ -1340,13 +1384,13 @@ object.pageToken = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) object.maxResults = message.maxResults; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -1604,29 +1648,33 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupRun.encode = function encode(message, writer) { + BackupRun.encode = function encode(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.status != null && Object.hasOwnProperty.call(message, "status")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); if (message.enqueuedTime != null && Object.hasOwnProperty.call(message, "enqueuedTime")) - $root.google.protobuf.Timestamp.encode(message.enqueuedTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.enqueuedTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.id); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.sql.v1.OperationError.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.sql.v1.OperationError.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); if (message.windowStartTime != null && Object.hasOwnProperty.call(message, "windowStartTime")) - $root.google.protobuf.Timestamp.encode(message.windowStartTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.windowStartTime, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.instance); if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) @@ -1636,9 +1684,9 @@ if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.databaseVersion); if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) - $root.google.cloud.sql.v1.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + $root.google.cloud.sql.v1.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) - $root.google.cloud.sql.v1.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) writer.uint32(/* id 19, wireType 0 =*/152).int32(message.backupKind); if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) @@ -1658,7 +1706,7 @@ * @returns {$protobuf.Writer} Writer */ BackupRun.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -1801,10 +1849,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) switch (message.status) { default: return "status: enum value expected"; @@ -1820,30 +1868,30 @@ case 9: break; } - if (message.enqueuedTime != null && message.hasOwnProperty("enqueuedTime")) { + if (message.enqueuedTime != null && Object.hasOwnProperty.call(message, "enqueuedTime")) { var error = $root.google.protobuf.Timestamp.verify(message.enqueuedTime, long + 1); if (error) return "enqueuedTime." + error; } - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) return "id: integer|Long 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; } - if (message.error != null && message.hasOwnProperty("error")) { + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { var error = $root.google.cloud.sql.v1.OperationError.verify(message.error, long + 1); if (error) return "error." + error; } - 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"; @@ -1852,24 +1900,24 @@ case 2: break; } - 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.windowStartTime != null && message.hasOwnProperty("windowStartTime")) { + if (message.windowStartTime != null && Object.hasOwnProperty.call(message, "windowStartTime")) { var error = $root.google.protobuf.Timestamp.verify(message.windowStartTime, long + 1); if (error) return "windowStartTime." + error; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: 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.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -1930,17 +1978,17 @@ case 551: break; } - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) { + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) { var error = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.verify(message.diskEncryptionConfiguration, long + 1); if (error) return "diskEncryptionConfiguration." + error; } - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) { + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) { var error = $root.google.cloud.sql.v1.DiskEncryptionStatus.verify(message.diskEncryptionStatus, long + 1); if (error) return "diskEncryptionStatus." + error; } - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) switch (message.backupKind) { default: return "backupKind: enum value expected"; @@ -1949,10 +1997,10 @@ case 2: break; } - 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.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { properties._maxChargeableBytes = 1; if (!$util.isInteger(message.maxChargeableBytes) && !(message.maxChargeableBytes && $util.isInteger(message.maxChargeableBytes.low) && $util.isInteger(message.maxChargeableBytes.high))) return "maxChargeableBytes: integer|Long expected"; @@ -1971,6 +2019,8 @@ BackupRun.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.BackupRun) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.BackupRun: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -2027,13 +2077,13 @@ break; } if (object.enqueuedTime != null) { - if (typeof object.enqueuedTime !== "object") + if (!$util.isObject(object.enqueuedTime)) throw TypeError(".google.cloud.sql.v1.BackupRun.enqueuedTime: object expected"); message.enqueuedTime = $root.google.protobuf.Timestamp.fromObject(object.enqueuedTime, long + 1); } if (object.id != null) if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; + message.id = $util.Long.fromValue(object.id, false); else if (typeof object.id === "string") message.id = parseInt(object.id, 10); else if (typeof object.id === "number") @@ -2041,17 +2091,17 @@ else if (typeof object.id === "object") message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.cloud.sql.v1.BackupRun.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.cloud.sql.v1.BackupRun.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } if (object.error != null) { - if (typeof object.error !== "object") + if (!$util.isObject(object.error)) throw TypeError(".google.cloud.sql.v1.BackupRun.error: object expected"); message.error = $root.google.cloud.sql.v1.OperationError.fromObject(object.error, long + 1); } @@ -2078,7 +2128,7 @@ if (object.description != null) message.description = String(object.description); if (object.windowStartTime != null) { - if (typeof object.windowStartTime !== "object") + if (!$util.isObject(object.windowStartTime)) throw TypeError(".google.cloud.sql.v1.BackupRun.windowStartTime: object expected"); message.windowStartTime = $root.google.protobuf.Timestamp.fromObject(object.windowStartTime, long + 1); } @@ -2317,12 +2367,12 @@ break; } if (object.diskEncryptionConfiguration != null) { - if (typeof object.diskEncryptionConfiguration !== "object") + if (!$util.isObject(object.diskEncryptionConfiguration)) throw TypeError(".google.cloud.sql.v1.BackupRun.diskEncryptionConfiguration: object expected"); message.diskEncryptionConfiguration = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.fromObject(object.diskEncryptionConfiguration, long + 1); } if (object.diskEncryptionStatus != null) { - if (typeof object.diskEncryptionStatus !== "object") + if (!$util.isObject(object.diskEncryptionStatus)) throw TypeError(".google.cloud.sql.v1.BackupRun.diskEncryptionStatus: object expected"); message.diskEncryptionStatus = $root.google.cloud.sql.v1.DiskEncryptionStatus.fromObject(object.diskEncryptionStatus, long + 1); } @@ -2350,7 +2400,7 @@ message.timeZone = String(object.timeZone); if (object.maxChargeableBytes != null) if ($util.Long) - (message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes)).unsigned = false; + message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes, false); else if (typeof object.maxChargeableBytes === "string") message.maxChargeableBytes = parseInt(object.maxChargeableBytes, 10); else if (typeof object.maxChargeableBytes === "number") @@ -2369,9 +2419,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupRun.toObject = function toObject(message, options) { + BackupRun.toObject = function toObject(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 = ""; @@ -2379,9 +2433,9 @@ object.enqueuedTime = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.id = options.longs === String ? "0" : 0; + object.id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.startTime = null; object.endTime = null; object.error = null; @@ -2397,47 +2451,51 @@ object.backupKind = options.enums === String ? "SQL_BACKUP_KIND_UNSPECIFIED" : 0; object.timeZone = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) object.status = options.enums === String ? $root.google.cloud.sql.v1.SqlBackupRunStatus[message.status] === undefined ? message.status : $root.google.cloud.sql.v1.SqlBackupRunStatus[message.status] : message.status; - if (message.enqueuedTime != null && message.hasOwnProperty("enqueuedTime")) - object.enqueuedTime = $root.google.protobuf.Timestamp.toObject(message.enqueuedTime, options); - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") + if (message.enqueuedTime != null && Object.hasOwnProperty.call(message, "enqueuedTime")) + object.enqueuedTime = $root.google.protobuf.Timestamp.toObject(message.enqueuedTime, options, q + 1); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.id = typeof message.id === "number" ? BigInt(message.id) : $util.Long.fromBits(message.id.low >>> 0, message.id.high >>> 0, false).toBigInt(); + else if (typeof message.id === "number") object.id = options.longs === String ? String(message.id) : message.id; else object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - 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.error != null && message.hasOwnProperty("error")) - object.error = $root.google.cloud.sql.v1.OperationError.toObject(message.error, options); - if (message.type != null && message.hasOwnProperty("type")) + 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 (message.error != null && Object.hasOwnProperty.call(message, "error")) + object.error = $root.google.cloud.sql.v1.OperationError.toObject(message.error, options, q + 1); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1.SqlBackupRunType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1.SqlBackupRunType[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; - if (message.windowStartTime != null && message.hasOwnProperty("windowStartTime")) - object.windowStartTime = $root.google.protobuf.Timestamp.toObject(message.windowStartTime, options); - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.windowStartTime != null && Object.hasOwnProperty.call(message, "windowStartTime")) + object.windowStartTime = $root.google.protobuf.Timestamp.toObject(message.windowStartTime, options, q + 1); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) - object.diskEncryptionConfiguration = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options); - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) - object.diskEncryptionStatus = $root.google.cloud.sql.v1.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options); - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) + object.diskEncryptionConfiguration = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options, q + 1); + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) + object.diskEncryptionStatus = $root.google.cloud.sql.v1.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options, q + 1); + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) object.backupKind = options.enums === String ? $root.google.cloud.sql.v1.SqlBackupKind[message.backupKind] === undefined ? message.backupKind : $root.google.cloud.sql.v1.SqlBackupKind[message.backupKind] : message.backupKind; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) object.timeZone = message.timeZone; - if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { - if (typeof message.maxChargeableBytes === "number") + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxChargeableBytes = typeof message.maxChargeableBytes === "number" ? BigInt(message.maxChargeableBytes) : $util.Long.fromBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0, false).toBigInt(); + else if (typeof message.maxChargeableBytes === "number") object.maxChargeableBytes = options.longs === String ? String(message.maxChargeableBytes) : message.maxChargeableBytes; else object.maxChargeableBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxChargeableBytes) : options.longs === Number ? new $util.LongBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0).toNumber() : message.maxChargeableBytes; @@ -2548,14 +2606,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupRunsListResponse.encode = function encode(message, writer) { + BackupRunsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.BackupRun.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.BackupRun.encode(message.items[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); return writer; @@ -2571,7 +2633,7 @@ * @returns {$protobuf.Writer} Writer */ BackupRunsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -2651,10 +2713,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -2663,7 +2725,7 @@ return "items." + 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; @@ -2680,6 +2742,8 @@ BackupRunsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.BackupRunsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.BackupRunsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -2692,7 +2756,7 @@ throw TypeError(".google.cloud.sql.v1.BackupRunsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.BackupRunsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.BackupRun.fromObject(object.items[i], long + 1); } @@ -2711,9 +2775,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupRunsListResponse.toObject = function toObject(message, options) { + BackupRunsListResponse.toObject = function toObject(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.items = []; @@ -2721,14 +2789,14 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.BackupRun.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.BackupRun.toObject(message.items[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; }; @@ -2904,13 +2972,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AclEntry.encode = function encode(message, writer) { + AclEntry.encode = function encode(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 1, wireType 2 =*/10).string(message.value); if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) - $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -2928,7 +3000,7 @@ * @returns {$protobuf.Writer} Writer */ AclEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -3010,18 +3082,18 @@ 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 (!$util.isString(message.value)) return "value: string expected"; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) { + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expirationTime, long + 1); if (error) return "expirationTime." + 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.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) if (!$util.isString(message.kind)) return "kind: string expected"; return null; @@ -3038,6 +3110,8 @@ AclEntry.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.AclEntry) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.AclEntry: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3046,7 +3120,7 @@ if (object.value != null) message.value = String(object.value); if (object.expirationTime != null) { - if (typeof object.expirationTime !== "object") + if (!$util.isObject(object.expirationTime)) throw TypeError(".google.cloud.sql.v1.AclEntry.expirationTime: object expected"); message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime, long + 1); } @@ -3066,9 +3140,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AclEntry.toObject = function toObject(message, options) { + AclEntry.toObject = function toObject(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 = ""; @@ -3076,13 +3154,13 @@ object.name = ""; object.kind = ""; } - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) - object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options); - if (message.name != null && message.hasOwnProperty("name")) + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options, q + 1); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -3187,9 +3265,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ApiWarning.encode = function encode(message, writer) { + ApiWarning.encode = function encode(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")) @@ -3209,7 +3291,7 @@ * @returns {$protobuf.Writer} Writer */ ApiWarning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -3287,7 +3369,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"; @@ -3298,10 +3380,10 @@ case 4: break; } - 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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; return null; @@ -3318,6 +3400,8 @@ ApiWarning.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ApiWarning) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ApiWarning: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3367,20 +3451,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ApiWarning.toObject = function toObject(message, options) { + ApiWarning.toObject = function toObject(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 ? "SQL_API_WARNING_CODE_UNSPECIFIED" : 0; object.message = ""; object.region = ""; } - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) object.code = options.enums === String ? $root.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode[message.code] === undefined ? message.code : $root.google.cloud.sql.v1.ApiWarning.SqlApiWarningCode[message.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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; return object; }; @@ -3496,13 +3584,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupRetentionSettings.encode = function encode(message, writer) { + BackupRetentionSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.retentionUnit != null && Object.hasOwnProperty.call(message, "retentionUnit")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionUnit); if (message.retainedBackups != null && Object.hasOwnProperty.call(message, "retainedBackups")) - $root.google.protobuf.Int32Value.encode(message.retainedBackups, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.retainedBackups, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -3516,7 +3608,7 @@ * @returns {$protobuf.Writer} Writer */ BackupRetentionSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -3590,7 +3682,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.retentionUnit != null && message.hasOwnProperty("retentionUnit")) + if (message.retentionUnit != null && Object.hasOwnProperty.call(message, "retentionUnit")) switch (message.retentionUnit) { default: return "retentionUnit: enum value expected"; @@ -3598,7 +3690,7 @@ case 1: break; } - if (message.retainedBackups != null && message.hasOwnProperty("retainedBackups")) { + if (message.retainedBackups != null && Object.hasOwnProperty.call(message, "retainedBackups")) { var error = $root.google.protobuf.Int32Value.verify(message.retainedBackups, long + 1); if (error) return "retainedBackups." + error; @@ -3617,6 +3709,8 @@ BackupRetentionSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.BackupRetentionSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.BackupRetentionSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -3639,7 +3733,7 @@ break; } if (object.retainedBackups != null) { - if (typeof object.retainedBackups !== "object") + if (!$util.isObject(object.retainedBackups)) throw TypeError(".google.cloud.sql.v1.BackupRetentionSettings.retainedBackups: object expected"); message.retainedBackups = $root.google.protobuf.Int32Value.fromObject(object.retainedBackups, long + 1); } @@ -3655,18 +3749,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupRetentionSettings.toObject = function toObject(message, options) { + BackupRetentionSettings.toObject = function toObject(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.retentionUnit = options.enums === String ? "RETENTION_UNIT_UNSPECIFIED" : 0; object.retainedBackups = null; } - if (message.retentionUnit != null && message.hasOwnProperty("retentionUnit")) + if (message.retentionUnit != null && Object.hasOwnProperty.call(message, "retentionUnit")) object.retentionUnit = options.enums === String ? $root.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit[message.retentionUnit] === undefined ? message.retentionUnit : $root.google.cloud.sql.v1.BackupRetentionSettings.RetentionUnit[message.retentionUnit] : message.retentionUnit; - if (message.retainedBackups != null && message.hasOwnProperty("retainedBackups")) - object.retainedBackups = $root.google.protobuf.Int32Value.toObject(message.retainedBackups, options); + if (message.retainedBackups != null && Object.hasOwnProperty.call(message, "retainedBackups")) + object.retainedBackups = $root.google.protobuf.Int32Value.toObject(message.retainedBackups, options, q + 1); return object; }; @@ -3871,27 +3969,31 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupConfiguration.encode = function encode(message, writer) { + BackupConfiguration.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.startTime); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.kind); if (message.binaryLogEnabled != null && Object.hasOwnProperty.call(message, "binaryLogEnabled")) - $root.google.protobuf.BoolValue.encode(message.binaryLogEnabled, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.binaryLogEnabled, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.replicationLogArchivingEnabled != null && Object.hasOwnProperty.call(message, "replicationLogArchivingEnabled")) - $root.google.protobuf.BoolValue.encode(message.replicationLogArchivingEnabled, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.replicationLogArchivingEnabled, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); if (message.pointInTimeRecoveryEnabled != null && Object.hasOwnProperty.call(message, "pointInTimeRecoveryEnabled")) - $root.google.protobuf.BoolValue.encode(message.pointInTimeRecoveryEnabled, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.pointInTimeRecoveryEnabled, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.backupRetentionSettings != null && Object.hasOwnProperty.call(message, "backupRetentionSettings")) - $root.google.cloud.sql.v1.BackupRetentionSettings.encode(message.backupRetentionSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1.BackupRetentionSettings.encode(message.backupRetentionSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.transactionLogRetentionDays != null && Object.hasOwnProperty.call(message, "transactionLogRetentionDays")) - $root.google.protobuf.Int32Value.encode(message.transactionLogRetentionDays, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.transactionLogRetentionDays, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.transactionalLogStorageState != null && Object.hasOwnProperty.call(message, "transactionalLogStorageState")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.transactionalLogStorageState); if (message.backupTier != null && Object.hasOwnProperty.call(message, "backupTier")) @@ -3909,7 +4011,7 @@ * @returns {$protobuf.Writer} Writer */ BackupConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -4020,46 +4122,46 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) if (!$util.isString(message.startTime)) return "startTime: string expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { var error = $root.google.protobuf.BoolValue.verify(message.enabled, long + 1); if (error) return "enabled." + error; } - 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.binaryLogEnabled != null && message.hasOwnProperty("binaryLogEnabled")) { + if (message.binaryLogEnabled != null && Object.hasOwnProperty.call(message, "binaryLogEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.binaryLogEnabled, long + 1); if (error) return "binaryLogEnabled." + error; } - if (message.replicationLogArchivingEnabled != null && message.hasOwnProperty("replicationLogArchivingEnabled")) { + if (message.replicationLogArchivingEnabled != null && Object.hasOwnProperty.call(message, "replicationLogArchivingEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.replicationLogArchivingEnabled, long + 1); if (error) return "replicationLogArchivingEnabled." + error; } - 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.pointInTimeRecoveryEnabled != null && message.hasOwnProperty("pointInTimeRecoveryEnabled")) { + if (message.pointInTimeRecoveryEnabled != null && Object.hasOwnProperty.call(message, "pointInTimeRecoveryEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.pointInTimeRecoveryEnabled, long + 1); if (error) return "pointInTimeRecoveryEnabled." + error; } - if (message.backupRetentionSettings != null && message.hasOwnProperty("backupRetentionSettings")) { + if (message.backupRetentionSettings != null && Object.hasOwnProperty.call(message, "backupRetentionSettings")) { var error = $root.google.cloud.sql.v1.BackupRetentionSettings.verify(message.backupRetentionSettings, long + 1); if (error) return "backupRetentionSettings." + error; } - if (message.transactionLogRetentionDays != null && message.hasOwnProperty("transactionLogRetentionDays")) { + if (message.transactionLogRetentionDays != null && Object.hasOwnProperty.call(message, "transactionLogRetentionDays")) { var error = $root.google.protobuf.Int32Value.verify(message.transactionLogRetentionDays, long + 1); if (error) return "transactionLogRetentionDays." + error; } - if (message.transactionalLogStorageState != null && message.hasOwnProperty("transactionalLogStorageState")) { + if (message.transactionalLogStorageState != null && Object.hasOwnProperty.call(message, "transactionalLogStorageState")) { properties._transactionalLogStorageState = 1; switch (message.transactionalLogStorageState) { default: @@ -4072,7 +4174,7 @@ break; } } - if (message.backupTier != null && message.hasOwnProperty("backupTier")) { + if (message.backupTier != null && Object.hasOwnProperty.call(message, "backupTier")) { properties._backupTier = 1; switch (message.backupTier) { default: @@ -4098,6 +4200,8 @@ BackupConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.BackupConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.BackupConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -4106,36 +4210,36 @@ if (object.startTime != null) message.startTime = String(object.startTime); if (object.enabled != null) { - if (typeof object.enabled !== "object") + if (!$util.isObject(object.enabled)) throw TypeError(".google.cloud.sql.v1.BackupConfiguration.enabled: object expected"); message.enabled = $root.google.protobuf.BoolValue.fromObject(object.enabled, long + 1); } if (object.kind != null) message.kind = String(object.kind); if (object.binaryLogEnabled != null) { - if (typeof object.binaryLogEnabled !== "object") + if (!$util.isObject(object.binaryLogEnabled)) throw TypeError(".google.cloud.sql.v1.BackupConfiguration.binaryLogEnabled: object expected"); message.binaryLogEnabled = $root.google.protobuf.BoolValue.fromObject(object.binaryLogEnabled, long + 1); } if (object.replicationLogArchivingEnabled != null) { - if (typeof object.replicationLogArchivingEnabled !== "object") + if (!$util.isObject(object.replicationLogArchivingEnabled)) throw TypeError(".google.cloud.sql.v1.BackupConfiguration.replicationLogArchivingEnabled: object expected"); message.replicationLogArchivingEnabled = $root.google.protobuf.BoolValue.fromObject(object.replicationLogArchivingEnabled, long + 1); } if (object.location != null) message.location = String(object.location); if (object.pointInTimeRecoveryEnabled != null) { - if (typeof object.pointInTimeRecoveryEnabled !== "object") + if (!$util.isObject(object.pointInTimeRecoveryEnabled)) throw TypeError(".google.cloud.sql.v1.BackupConfiguration.pointInTimeRecoveryEnabled: object expected"); message.pointInTimeRecoveryEnabled = $root.google.protobuf.BoolValue.fromObject(object.pointInTimeRecoveryEnabled, long + 1); } if (object.backupRetentionSettings != null) { - if (typeof object.backupRetentionSettings !== "object") + if (!$util.isObject(object.backupRetentionSettings)) throw TypeError(".google.cloud.sql.v1.BackupConfiguration.backupRetentionSettings: object expected"); message.backupRetentionSettings = $root.google.cloud.sql.v1.BackupRetentionSettings.fromObject(object.backupRetentionSettings, long + 1); } if (object.transactionLogRetentionDays != null) { - if (typeof object.transactionLogRetentionDays !== "object") + if (!$util.isObject(object.transactionLogRetentionDays)) throw TypeError(".google.cloud.sql.v1.BackupConfiguration.transactionLogRetentionDays: object expected"); message.transactionLogRetentionDays = $root.google.protobuf.Int32Value.fromObject(object.transactionLogRetentionDays, long + 1); } @@ -4203,9 +4307,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupConfiguration.toObject = function toObject(message, options) { + BackupConfiguration.toObject = function toObject(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.startTime = ""; @@ -4218,30 +4326,30 @@ object.backupRetentionSettings = null; object.transactionLogRetentionDays = null; } - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) object.startTime = message.startTime; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options, q + 1); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.binaryLogEnabled != null && message.hasOwnProperty("binaryLogEnabled")) - object.binaryLogEnabled = $root.google.protobuf.BoolValue.toObject(message.binaryLogEnabled, options); - if (message.replicationLogArchivingEnabled != null && message.hasOwnProperty("replicationLogArchivingEnabled")) - object.replicationLogArchivingEnabled = $root.google.protobuf.BoolValue.toObject(message.replicationLogArchivingEnabled, options); - if (message.location != null && message.hasOwnProperty("location")) + if (message.binaryLogEnabled != null && Object.hasOwnProperty.call(message, "binaryLogEnabled")) + object.binaryLogEnabled = $root.google.protobuf.BoolValue.toObject(message.binaryLogEnabled, options, q + 1); + if (message.replicationLogArchivingEnabled != null && Object.hasOwnProperty.call(message, "replicationLogArchivingEnabled")) + object.replicationLogArchivingEnabled = $root.google.protobuf.BoolValue.toObject(message.replicationLogArchivingEnabled, options, q + 1); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.pointInTimeRecoveryEnabled != null && message.hasOwnProperty("pointInTimeRecoveryEnabled")) - object.pointInTimeRecoveryEnabled = $root.google.protobuf.BoolValue.toObject(message.pointInTimeRecoveryEnabled, options); - if (message.backupRetentionSettings != null && message.hasOwnProperty("backupRetentionSettings")) - object.backupRetentionSettings = $root.google.cloud.sql.v1.BackupRetentionSettings.toObject(message.backupRetentionSettings, options); - if (message.transactionLogRetentionDays != null && message.hasOwnProperty("transactionLogRetentionDays")) - object.transactionLogRetentionDays = $root.google.protobuf.Int32Value.toObject(message.transactionLogRetentionDays, options); - if (message.transactionalLogStorageState != null && message.hasOwnProperty("transactionalLogStorageState")) { + if (message.pointInTimeRecoveryEnabled != null && Object.hasOwnProperty.call(message, "pointInTimeRecoveryEnabled")) + object.pointInTimeRecoveryEnabled = $root.google.protobuf.BoolValue.toObject(message.pointInTimeRecoveryEnabled, options, q + 1); + if (message.backupRetentionSettings != null && Object.hasOwnProperty.call(message, "backupRetentionSettings")) + object.backupRetentionSettings = $root.google.cloud.sql.v1.BackupRetentionSettings.toObject(message.backupRetentionSettings, options, q + 1); + if (message.transactionLogRetentionDays != null && Object.hasOwnProperty.call(message, "transactionLogRetentionDays")) + object.transactionLogRetentionDays = $root.google.protobuf.Int32Value.toObject(message.transactionLogRetentionDays, options, q + 1); + if (message.transactionalLogStorageState != null && Object.hasOwnProperty.call(message, "transactionalLogStorageState")) { object.transactionalLogStorageState = options.enums === String ? $root.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState[message.transactionalLogStorageState] === undefined ? message.transactionalLogStorageState : $root.google.cloud.sql.v1.BackupConfiguration.TransactionalLogStorageState[message.transactionalLogStorageState] : message.transactionalLogStorageState; if (options.oneofs) object._transactionalLogStorageState = "transactionalLogStorageState"; } - if (message.backupTier != null && message.hasOwnProperty("backupTier")) { + if (message.backupTier != null && Object.hasOwnProperty.call(message, "backupTier")) { object.backupTier = options.enums === String ? $root.google.cloud.sql.v1.BackupConfiguration.BackupTier[message.backupTier] === undefined ? message.backupTier : $root.google.cloud.sql.v1.BackupConfiguration.BackupTier[message.backupTier] : message.backupTier; if (options.oneofs) object._backupTier = "backupTier"; @@ -4369,9 +4477,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerformDiskShrinkContext.encode = function encode(message, writer) { + PerformDiskShrinkContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.targetSizeGb != null && Object.hasOwnProperty.call(message, "targetSizeGb")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.targetSizeGb); return writer; @@ -4387,7 +4499,7 @@ * @returns {$protobuf.Writer} Writer */ PerformDiskShrinkContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -4457,7 +4569,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.targetSizeGb != null && message.hasOwnProperty("targetSizeGb")) + if (message.targetSizeGb != null && Object.hasOwnProperty.call(message, "targetSizeGb")) if (!$util.isInteger(message.targetSizeGb) && !(message.targetSizeGb && $util.isInteger(message.targetSizeGb.low) && $util.isInteger(message.targetSizeGb.high))) return "targetSizeGb: integer|Long expected"; return null; @@ -4474,6 +4586,8 @@ PerformDiskShrinkContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PerformDiskShrinkContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PerformDiskShrinkContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -4481,7 +4595,7 @@ var message = new $root.google.cloud.sql.v1.PerformDiskShrinkContext(); if (object.targetSizeGb != null) if ($util.Long) - (message.targetSizeGb = $util.Long.fromValue(object.targetSizeGb)).unsigned = false; + message.targetSizeGb = $util.Long.fromValue(object.targetSizeGb, false); else if (typeof object.targetSizeGb === "string") message.targetSizeGb = parseInt(object.targetSizeGb, 10); else if (typeof object.targetSizeGb === "number") @@ -4500,18 +4614,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PerformDiskShrinkContext.toObject = function toObject(message, options) { + PerformDiskShrinkContext.toObject = function toObject(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.targetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.targetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.targetSizeGb = options.longs === String ? "0" : 0; - if (message.targetSizeGb != null && message.hasOwnProperty("targetSizeGb")) - if (typeof message.targetSizeGb === "number") + object.targetSizeGb = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.targetSizeGb != null && Object.hasOwnProperty.call(message, "targetSizeGb")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.targetSizeGb = typeof message.targetSizeGb === "number" ? BigInt(message.targetSizeGb) : $util.Long.fromBits(message.targetSizeGb.low >>> 0, message.targetSizeGb.high >>> 0, false).toBigInt(); + else if (typeof message.targetSizeGb === "number") object.targetSizeGb = options.longs === String ? String(message.targetSizeGb) : message.targetSizeGb; else object.targetSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.targetSizeGb) : options.longs === Number ? new $util.LongBits(message.targetSizeGb.low >>> 0, message.targetSizeGb.high >>> 0).toNumber() : message.targetSizeGb; @@ -4634,9 +4754,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PreCheckResponse.encode = function encode(message, writer) { + PreCheckResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) @@ -4657,7 +4781,7 @@ * @returns {$protobuf.Writer} Writer */ PreCheckResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -4738,12 +4862,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { properties._message = 1; if (!$util.isString(message.message)) return "message: string expected"; } - if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { properties._messageType = 1; switch (message.messageType) { default: @@ -4755,7 +4879,7 @@ break; } } - if (message.actionsRequired != null && message.hasOwnProperty("actionsRequired")) { + if (message.actionsRequired != null && Object.hasOwnProperty.call(message, "actionsRequired")) { if (!Array.isArray(message.actionsRequired)) return "actionsRequired: array expected"; for (var i = 0; i < message.actionsRequired.length; ++i) @@ -4776,6 +4900,8 @@ PreCheckResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PreCheckResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PreCheckResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -4826,18 +4952,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PreCheckResponse.toObject = function toObject(message, options) { + PreCheckResponse.toObject = function toObject(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.actionsRequired = []; - if (message.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { object.message = message.message; if (options.oneofs) object._message = "message"; } - if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { object.messageType = options.enums === String ? $root.google.cloud.sql.v1.PreCheckResponse.MessageType[message.messageType] === undefined ? message.messageType : $root.google.cloud.sql.v1.PreCheckResponse.MessageType[message.messageType] : message.messageType; if (options.oneofs) object._messageType = "messageType"; @@ -4969,14 +5099,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PreCheckMajorVersionUpgradeContext.encode = function encode(message, writer) { + PreCheckMajorVersionUpgradeContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.targetDatabaseVersion != null && Object.hasOwnProperty.call(message, "targetDatabaseVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.targetDatabaseVersion); if (message.preCheckResponse != null && message.preCheckResponse.length) for (var i = 0; i < message.preCheckResponse.length; ++i) - $root.google.cloud.sql.v1.PreCheckResponse.encode(message.preCheckResponse[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.PreCheckResponse.encode(message.preCheckResponse[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.kind); return writer; @@ -4992,7 +5126,7 @@ * @returns {$protobuf.Writer} Writer */ PreCheckMajorVersionUpgradeContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -5072,7 +5206,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.targetDatabaseVersion != null && message.hasOwnProperty("targetDatabaseVersion")) + if (message.targetDatabaseVersion != null && Object.hasOwnProperty.call(message, "targetDatabaseVersion")) switch (message.targetDatabaseVersion) { default: return "targetDatabaseVersion: enum value expected"; @@ -5133,7 +5267,7 @@ case 551: break; } - if (message.preCheckResponse != null && message.hasOwnProperty("preCheckResponse")) { + if (message.preCheckResponse != null && Object.hasOwnProperty.call(message, "preCheckResponse")) { if (!Array.isArray(message.preCheckResponse)) return "preCheckResponse: array expected"; for (var i = 0; i < message.preCheckResponse.length; ++i) { @@ -5142,7 +5276,7 @@ return "preCheckResponse." + error; } } - 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"; return null; @@ -5159,6 +5293,8 @@ PreCheckMajorVersionUpgradeContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -5397,7 +5533,7 @@ throw TypeError(".google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.preCheckResponse: array expected"); message.preCheckResponse = []; for (var i = 0; i < object.preCheckResponse.length; ++i) { - if (typeof object.preCheckResponse[i] !== "object") + if (!$util.isObject(object.preCheckResponse[i])) throw TypeError(".google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.preCheckResponse: object expected"); message.preCheckResponse[i] = $root.google.cloud.sql.v1.PreCheckResponse.fromObject(object.preCheckResponse[i], long + 1); } @@ -5416,9 +5552,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PreCheckMajorVersionUpgradeContext.toObject = function toObject(message, options) { + PreCheckMajorVersionUpgradeContext.toObject = function toObject(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.preCheckResponse = []; @@ -5426,14 +5566,14 @@ object.targetDatabaseVersion = options.enums === String ? "SQL_DATABASE_VERSION_UNSPECIFIED" : 0; object.kind = ""; } - if (message.targetDatabaseVersion != null && message.hasOwnProperty("targetDatabaseVersion")) + if (message.targetDatabaseVersion != null && Object.hasOwnProperty.call(message, "targetDatabaseVersion")) object.targetDatabaseVersion = options.enums === String ? $root.google.cloud.sql.v1.SqlDatabaseVersion[message.targetDatabaseVersion] === undefined ? message.targetDatabaseVersion : $root.google.cloud.sql.v1.SqlDatabaseVersion[message.targetDatabaseVersion] : message.targetDatabaseVersion; if (message.preCheckResponse && message.preCheckResponse.length) { object.preCheckResponse = []; for (var j = 0; j < message.preCheckResponse.length; ++j) - object.preCheckResponse[j] = $root.google.cloud.sql.v1.PreCheckResponse.toObject(message.preCheckResponse[j], options); + object.preCheckResponse[j] = $root.google.cloud.sql.v1.PreCheckResponse.toObject(message.preCheckResponse[j], options, q + 1); } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -5538,9 +5678,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupContext.encode = function encode(message, writer) { + BackupContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.backupId); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -5560,7 +5704,7 @@ * @returns {$protobuf.Writer} Writer */ BackupContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -5638,13 +5782,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isInteger(message.backupId) && !(message.backupId && $util.isInteger(message.backupId.low) && $util.isInteger(message.backupId.high))) return "backupId: integer|Long expected"; - 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.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; @@ -5661,6 +5805,8 @@ BackupContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.BackupContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.BackupContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -5668,7 +5814,7 @@ var message = new $root.google.cloud.sql.v1.BackupContext(); if (object.backupId != null) if ($util.Long) - (message.backupId = $util.Long.fromValue(object.backupId)).unsigned = false; + message.backupId = $util.Long.fromValue(object.backupId, false); else if (typeof object.backupId === "string") message.backupId = parseInt(object.backupId, 10); else if (typeof object.backupId === "number") @@ -5691,27 +5837,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupContext.toObject = function toObject(message, options) { + BackupContext.toObject = function toObject(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.backupId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.backupId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.backupId = options.longs === String ? "0" : 0; + object.backupId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; object.name = ""; } - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (typeof message.backupId === "number") + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.backupId = typeof message.backupId === "number" ? BigInt(message.backupId) : $util.Long.fromBits(message.backupId.low >>> 0, message.backupId.high >>> 0, false).toBigInt(); + else if (typeof message.backupId === "number") object.backupId = options.longs === String ? String(message.backupId) : message.backupId; else object.backupId = options.longs === String ? $util.Long.prototype.toString.call(message.backupId) : options.longs === Number ? new $util.LongBits(message.backupId.low >>> 0, message.backupId.high >>> 0).toNumber() : message.backupId; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -5884,9 +6036,13 @@ * @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.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) @@ -5904,7 +6060,7 @@ if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.project); if (message.sqlserverDatabaseDetails != null && Object.hasOwnProperty.call(message, "sqlserverDatabaseDetails")) - $root.google.cloud.sql.v1.SqlServerDatabaseDetails.encode(message.sqlserverDatabaseDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlServerDatabaseDetails.encode(message.sqlserverDatabaseDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -5918,7 +6074,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(); }; /** @@ -6021,31 +6177,31 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.charset != null && message.hasOwnProperty("charset")) + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) if (!$util.isString(message.charset)) return "charset: string expected"; - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) if (!$util.isString(message.collation)) return "collation: 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.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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sqlserverDatabaseDetails != null && message.hasOwnProperty("sqlserverDatabaseDetails")) { + if (message.sqlserverDatabaseDetails != null && Object.hasOwnProperty.call(message, "sqlserverDatabaseDetails")) { properties.databaseDetails = 1; { var error = $root.google.cloud.sql.v1.SqlServerDatabaseDetails.verify(message.sqlserverDatabaseDetails, long + 1); @@ -6067,6 +6223,8 @@ Database.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Database) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Database: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6089,7 +6247,7 @@ if (object.project != null) message.project = String(object.project); if (object.sqlserverDatabaseDetails != null) { - if (typeof object.sqlserverDatabaseDetails !== "object") + if (!$util.isObject(object.sqlserverDatabaseDetails)) throw TypeError(".google.cloud.sql.v1.Database.sqlserverDatabaseDetails: object expected"); message.sqlserverDatabaseDetails = $root.google.cloud.sql.v1.SqlServerDatabaseDetails.fromObject(object.sqlserverDatabaseDetails, long + 1); } @@ -6105,9 +6263,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.defaults) { object.kind = ""; @@ -6119,24 +6281,24 @@ object.selfLink = ""; object.project = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.charset != null && message.hasOwnProperty("charset")) + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) object.charset = message.charset; - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) object.collation = message.collation; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sqlserverDatabaseDetails != null && message.hasOwnProperty("sqlserverDatabaseDetails")) { - object.sqlserverDatabaseDetails = $root.google.cloud.sql.v1.SqlServerDatabaseDetails.toObject(message.sqlserverDatabaseDetails, options); + if (message.sqlserverDatabaseDetails != null && Object.hasOwnProperty.call(message, "sqlserverDatabaseDetails")) { + object.sqlserverDatabaseDetails = $root.google.cloud.sql.v1.SqlServerDatabaseDetails.toObject(message.sqlserverDatabaseDetails, options, q + 1); if (options.oneofs) object.databaseDetails = "sqlserverDatabaseDetails"; } @@ -6234,9 +6396,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerDatabaseDetails.encode = function encode(message, writer) { + SqlServerDatabaseDetails.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.compatibilityLevel != null && Object.hasOwnProperty.call(message, "compatibilityLevel")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.compatibilityLevel); if (message.recoveryModel != null && Object.hasOwnProperty.call(message, "recoveryModel")) @@ -6254,7 +6420,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerDatabaseDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -6328,10 +6494,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.compatibilityLevel != null && message.hasOwnProperty("compatibilityLevel")) + if (message.compatibilityLevel != null && Object.hasOwnProperty.call(message, "compatibilityLevel")) if (!$util.isInteger(message.compatibilityLevel)) return "compatibilityLevel: integer expected"; - if (message.recoveryModel != null && message.hasOwnProperty("recoveryModel")) + if (message.recoveryModel != null && Object.hasOwnProperty.call(message, "recoveryModel")) if (!$util.isString(message.recoveryModel)) return "recoveryModel: string expected"; return null; @@ -6348,6 +6514,8 @@ SqlServerDatabaseDetails.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlServerDatabaseDetails) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlServerDatabaseDetails: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6369,17 +6537,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerDatabaseDetails.toObject = function toObject(message, options) { + SqlServerDatabaseDetails.toObject = function toObject(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.compatibilityLevel = 0; object.recoveryModel = ""; } - if (message.compatibilityLevel != null && message.hasOwnProperty("compatibilityLevel")) + if (message.compatibilityLevel != null && Object.hasOwnProperty.call(message, "compatibilityLevel")) object.compatibilityLevel = message.compatibilityLevel; - if (message.recoveryModel != null && message.hasOwnProperty("recoveryModel")) + if (message.recoveryModel != null && Object.hasOwnProperty.call(message, "recoveryModel")) object.recoveryModel = message.recoveryModel; return object; }; @@ -6475,9 +6647,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseFlags.encode = function encode(message, writer) { + DatabaseFlags.encode = function encode(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 && Object.hasOwnProperty.call(message, "value")) @@ -6495,7 +6671,7 @@ * @returns {$protobuf.Writer} Writer */ DatabaseFlags.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -6569,10 +6745,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 (!$util.isString(message.value)) return "value: string expected"; return null; @@ -6589,6 +6765,8 @@ DatabaseFlags.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DatabaseFlags) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DatabaseFlags: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6610,17 +6788,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseFlags.toObject = function toObject(message, options) { + DatabaseFlags.toObject = function toObject(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.value = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -6708,12 +6890,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MySqlSyncConfig.encode = function encode(message, writer) { + MySqlSyncConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.initialSyncFlags != null && message.initialSyncFlags.length) for (var i = 0; i < message.initialSyncFlags.length; ++i) - $root.google.cloud.sql.v1.SyncFlags.encode(message.initialSyncFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.SyncFlags.encode(message.initialSyncFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -6727,7 +6913,7 @@ * @returns {$protobuf.Writer} Writer */ MySqlSyncConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -6799,7 +6985,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.initialSyncFlags != null && message.hasOwnProperty("initialSyncFlags")) { + if (message.initialSyncFlags != null && Object.hasOwnProperty.call(message, "initialSyncFlags")) { if (!Array.isArray(message.initialSyncFlags)) return "initialSyncFlags: array expected"; for (var i = 0; i < message.initialSyncFlags.length; ++i) { @@ -6822,6 +7008,8 @@ MySqlSyncConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.MySqlSyncConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.MySqlSyncConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -6832,7 +7020,7 @@ throw TypeError(".google.cloud.sql.v1.MySqlSyncConfig.initialSyncFlags: array expected"); message.initialSyncFlags = []; for (var i = 0; i < object.initialSyncFlags.length; ++i) { - if (typeof object.initialSyncFlags[i] !== "object") + if (!$util.isObject(object.initialSyncFlags[i])) throw TypeError(".google.cloud.sql.v1.MySqlSyncConfig.initialSyncFlags: object expected"); message.initialSyncFlags[i] = $root.google.cloud.sql.v1.SyncFlags.fromObject(object.initialSyncFlags[i], long + 1); } @@ -6849,16 +7037,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MySqlSyncConfig.toObject = function toObject(message, options) { + MySqlSyncConfig.toObject = function toObject(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.initialSyncFlags = []; if (message.initialSyncFlags && message.initialSyncFlags.length) { object.initialSyncFlags = []; for (var j = 0; j < message.initialSyncFlags.length; ++j) - object.initialSyncFlags[j] = $root.google.cloud.sql.v1.SyncFlags.toObject(message.initialSyncFlags[j], options); + object.initialSyncFlags[j] = $root.google.cloud.sql.v1.SyncFlags.toObject(message.initialSyncFlags[j], options, q + 1); } return object; }; @@ -6954,9 +7146,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncFlags.encode = function encode(message, writer) { + SyncFlags.encode = function encode(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 && Object.hasOwnProperty.call(message, "value")) @@ -6974,7 +7170,7 @@ * @returns {$protobuf.Writer} Writer */ SyncFlags.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -7048,10 +7244,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 (!$util.isString(message.value)) return "value: string expected"; return null; @@ -7068,6 +7264,8 @@ SyncFlags.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SyncFlags) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SyncFlags: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7089,17 +7287,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncFlags.toObject = function toObject(message, options) { + SyncFlags.toObject = function toObject(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.value = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -7204,9 +7406,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstanceReference.encode = function encode(message, writer) { + InstanceReference.encode = function encode(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.region != null && Object.hasOwnProperty.call(message, "region")) @@ -7226,7 +7432,7 @@ * @returns {$protobuf.Writer} Writer */ InstanceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -7304,13 +7510,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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -7327,6 +7533,8 @@ InstanceReference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstanceReference) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstanceReference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7350,20 +7558,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstanceReference.toObject = function toObject(message, options) { + InstanceReference.toObject = function toObject(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.region = ""; object.project = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -7459,13 +7671,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteMasterConfiguration.encode = function encode(message, writer) { + DemoteMasterConfiguration.encode = function encode(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.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) - $root.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -7479,7 +7695,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteMasterConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -7553,10 +7769,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.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) { + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) { var error = $root.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.verify(message.mysqlReplicaConfiguration, long + 1); if (error) return "mysqlReplicaConfiguration." + error; @@ -7575,6 +7791,8 @@ DemoteMasterConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DemoteMasterConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DemoteMasterConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7583,7 +7801,7 @@ if (object.kind != null) message.kind = String(object.kind); if (object.mysqlReplicaConfiguration != null) { - if (typeof object.mysqlReplicaConfiguration !== "object") + if (!$util.isObject(object.mysqlReplicaConfiguration)) throw TypeError(".google.cloud.sql.v1.DemoteMasterConfiguration.mysqlReplicaConfiguration: object expected"); message.mysqlReplicaConfiguration = $root.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.fromObject(object.mysqlReplicaConfiguration, long + 1); } @@ -7599,18 +7817,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteMasterConfiguration.toObject = function toObject(message, options) { + DemoteMasterConfiguration.toObject = function toObject(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.mysqlReplicaConfiguration = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) - object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options); + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) + object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options, q + 1); return object; }; @@ -7741,9 +7963,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteMasterMySqlReplicaConfiguration.encode = function encode(message, writer) { + DemoteMasterMySqlReplicaConfiguration.encode = function encode(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.username != null && Object.hasOwnProperty.call(message, "username")) @@ -7769,7 +7995,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteMasterMySqlReplicaConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -7859,22 +8085,22 @@ 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.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) if (!$util.isString(message.username)) return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) if (!$util.isString(message.clientKey)) return "clientKey: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) if (!$util.isString(message.clientCertificate)) return "clientCertificate: string expected"; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) if (!$util.isString(message.caCertificate)) return "caCertificate: string expected"; return null; @@ -7891,6 +8117,8 @@ DemoteMasterMySqlReplicaConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DemoteMasterMySqlReplicaConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -7920,9 +8148,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteMasterMySqlReplicaConfiguration.toObject = function toObject(message, options) { + DemoteMasterMySqlReplicaConfiguration.toObject = function toObject(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 = ""; @@ -7932,17 +8164,17 @@ object.clientCertificate = ""; object.caCertificate = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) object.clientKey = message.clientKey; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) object.clientCertificate = message.clientCertificate; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) object.caCertificate = message.caCertificate; return object; }; @@ -8122,9 +8354,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportContext.encode = function encode(message, writer) { + ExportContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); if (message.databases != null && message.databases.length) @@ -8133,17 +8369,17 @@ if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.kind); if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) - $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) - $root.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.fileType); if (message.offload != null && Object.hasOwnProperty.call(message, "offload")) - $root.google.protobuf.BoolValue.encode(message.offload, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.offload, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.bakExportOptions != null && Object.hasOwnProperty.call(message, "bakExportOptions")) - $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.encode(message.bakExportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.encode(message.bakExportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.tdeExportOptions != null && Object.hasOwnProperty.call(message, "tdeExportOptions")) - $root.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.encode(message.tdeExportOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.encode(message.tdeExportOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); return writer; }; @@ -8157,7 +8393,7 @@ * @returns {$protobuf.Writer} Writer */ ExportContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -8261,30 +8497,30 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) if (!$util.isString(message.uri)) return "uri: string expected"; - 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) if (!$util.isString(message.databases[i])) return "databases: string[] expected"; } - 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.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) { var error = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.verify(message.sqlExportOptions, long + 1); if (error) return "sqlExportOptions." + error; } - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) { var error = $root.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.verify(message.csvExportOptions, long + 1); if (error) return "csvExportOptions." + error; } - if (message.fileType != null && message.hasOwnProperty("fileType")) + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) switch (message.fileType) { default: return "fileType: enum value expected"; @@ -8295,17 +8531,17 @@ case 8: break; } - if (message.offload != null && message.hasOwnProperty("offload")) { + if (message.offload != null && Object.hasOwnProperty.call(message, "offload")) { var error = $root.google.protobuf.BoolValue.verify(message.offload, long + 1); if (error) return "offload." + error; } - if (message.bakExportOptions != null && message.hasOwnProperty("bakExportOptions")) { + if (message.bakExportOptions != null && Object.hasOwnProperty.call(message, "bakExportOptions")) { var error = $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.verify(message.bakExportOptions, long + 1); if (error) return "bakExportOptions." + error; } - if (message.tdeExportOptions != null && message.hasOwnProperty("tdeExportOptions")) { + if (message.tdeExportOptions != null && Object.hasOwnProperty.call(message, "tdeExportOptions")) { var error = $root.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.verify(message.tdeExportOptions, long + 1); if (error) return "tdeExportOptions." + error; @@ -8324,6 +8560,8 @@ ExportContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExportContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExportContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -8341,12 +8579,12 @@ if (object.kind != null) message.kind = String(object.kind); if (object.sqlExportOptions != null) { - if (typeof object.sqlExportOptions !== "object") + if (!$util.isObject(object.sqlExportOptions)) throw TypeError(".google.cloud.sql.v1.ExportContext.sqlExportOptions: object expected"); message.sqlExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.fromObject(object.sqlExportOptions, long + 1); } if (object.csvExportOptions != null) { - if (typeof object.csvExportOptions !== "object") + if (!$util.isObject(object.csvExportOptions)) throw TypeError(".google.cloud.sql.v1.ExportContext.csvExportOptions: object expected"); message.csvExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.fromObject(object.csvExportOptions, long + 1); } @@ -8379,17 +8617,17 @@ break; } if (object.offload != null) { - if (typeof object.offload !== "object") + if (!$util.isObject(object.offload)) throw TypeError(".google.cloud.sql.v1.ExportContext.offload: object expected"); message.offload = $root.google.protobuf.BoolValue.fromObject(object.offload, long + 1); } if (object.bakExportOptions != null) { - if (typeof object.bakExportOptions !== "object") + if (!$util.isObject(object.bakExportOptions)) throw TypeError(".google.cloud.sql.v1.ExportContext.bakExportOptions: object expected"); message.bakExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.fromObject(object.bakExportOptions, long + 1); } if (object.tdeExportOptions != null) { - if (typeof object.tdeExportOptions !== "object") + if (!$util.isObject(object.tdeExportOptions)) throw TypeError(".google.cloud.sql.v1.ExportContext.tdeExportOptions: object expected"); message.tdeExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.fromObject(object.tdeExportOptions, long + 1); } @@ -8405,9 +8643,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportContext.toObject = function toObject(message, options) { + ExportContext.toObject = function toObject(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 = []; @@ -8421,27 +8663,27 @@ object.bakExportOptions = null; object.tdeExportOptions = null; } - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) object.uri = message.uri; if (message.databases && message.databases.length) { object.databases = []; for (var j = 0; j < message.databases.length; ++j) object.databases[j] = message.databases[j]; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) - object.sqlExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.toObject(message.sqlExportOptions, options); - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) - object.csvExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.toObject(message.csvExportOptions, options); - if (message.fileType != null && message.hasOwnProperty("fileType")) + if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) + object.sqlExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.toObject(message.sqlExportOptions, options, q + 1); + if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) + object.csvExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions.toObject(message.csvExportOptions, options, q + 1); + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) object.fileType = options.enums === String ? $root.google.cloud.sql.v1.SqlFileType[message.fileType] === undefined ? message.fileType : $root.google.cloud.sql.v1.SqlFileType[message.fileType] : message.fileType; - if (message.offload != null && message.hasOwnProperty("offload")) - object.offload = $root.google.protobuf.BoolValue.toObject(message.offload, options); - if (message.bakExportOptions != null && message.hasOwnProperty("bakExportOptions")) - object.bakExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.toObject(message.bakExportOptions, options); - if (message.tdeExportOptions != null && message.hasOwnProperty("tdeExportOptions")) - object.tdeExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.toObject(message.tdeExportOptions, options); + if (message.offload != null && Object.hasOwnProperty.call(message, "offload")) + object.offload = $root.google.protobuf.BoolValue.toObject(message.offload, options, q + 1); + if (message.bakExportOptions != null && Object.hasOwnProperty.call(message, "bakExportOptions")) + object.bakExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions.toObject(message.bakExportOptions, options, q + 1); + if (message.tdeExportOptions != null && Object.hasOwnProperty.call(message, "tdeExportOptions")) + object.tdeExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions.toObject(message.tdeExportOptions, options, q + 1); return object; }; @@ -8560,9 +8802,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlCsvExportOptions.encode = function encode(message, writer) { + SqlCsvExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) @@ -8586,7 +8832,7 @@ * @returns {$protobuf.Writer} Writer */ SqlCsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -8672,19 +8918,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) if (!$util.isString(message.selectQuery)) return "selectQuery: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) if (!$util.isString(message.escapeCharacter)) return "escapeCharacter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) if (!$util.isString(message.quoteCharacter)) return "quoteCharacter: string expected"; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) if (!$util.isString(message.fieldsTerminatedBy)) return "fieldsTerminatedBy: string expected"; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) if (!$util.isString(message.linesTerminatedBy)) return "linesTerminatedBy: string expected"; return null; @@ -8701,6 +8947,8 @@ SqlCsvExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExportContext.SqlCsvExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExportContext.SqlCsvExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -8728,9 +8976,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlCsvExportOptions.toObject = function toObject(message, options) { + SqlCsvExportOptions.toObject = function toObject(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.selectQuery = ""; @@ -8739,15 +8991,15 @@ object.fieldsTerminatedBy = ""; object.linesTerminatedBy = ""; } - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) object.selectQuery = message.selectQuery; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) object.escapeCharacter = message.escapeCharacter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) object.quoteCharacter = message.quoteCharacter; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) object.fieldsTerminatedBy = message.fieldsTerminatedBy; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) object.linesTerminatedBy = message.linesTerminatedBy; return object; }; @@ -8880,22 +9132,26 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlExportOptions.encode = function encode(message, writer) { + SqlExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tables != null && message.tables.length) for (var i = 0; i < message.tables.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) - $root.google.protobuf.BoolValue.encode(message.schemaOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.schemaOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.mysqlExportOptions != null && Object.hasOwnProperty.call(message, "mysqlExportOptions")) - $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.encode(message.mysqlExportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.encode(message.mysqlExportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) - $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) - $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.postgresExportOptions != null && Object.hasOwnProperty.call(message, "postgresExportOptions")) - $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.encode(message.postgresExportOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.encode(message.postgresExportOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -8909,7 +9165,7 @@ * @returns {$protobuf.Writer} Writer */ SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -9001,34 +9257,34 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.tables != null && message.hasOwnProperty("tables")) { + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) { if (!Array.isArray(message.tables)) return "tables: array expected"; for (var i = 0; i < message.tables.length; ++i) if (!$util.isString(message.tables[i])) return "tables: string[] expected"; } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) { var error = $root.google.protobuf.BoolValue.verify(message.schemaOnly, long + 1); if (error) return "schemaOnly." + error; } - if (message.mysqlExportOptions != null && message.hasOwnProperty("mysqlExportOptions")) { + if (message.mysqlExportOptions != null && Object.hasOwnProperty.call(message, "mysqlExportOptions")) { var error = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.verify(message.mysqlExportOptions, long + 1); if (error) return "mysqlExportOptions." + error; } - if (message.threads != null && message.hasOwnProperty("threads")) { + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) { var error = $root.google.protobuf.Int32Value.verify(message.threads, long + 1); if (error) return "threads." + error; } - if (message.parallel != null && message.hasOwnProperty("parallel")) { + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) { var error = $root.google.protobuf.BoolValue.verify(message.parallel, long + 1); if (error) return "parallel." + error; } - if (message.postgresExportOptions != null && message.hasOwnProperty("postgresExportOptions")) { + if (message.postgresExportOptions != null && Object.hasOwnProperty.call(message, "postgresExportOptions")) { var error = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.verify(message.postgresExportOptions, long + 1); if (error) return "postgresExportOptions." + error; @@ -9047,6 +9303,8 @@ SqlExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExportContext.SqlExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -9060,27 +9318,27 @@ message.tables[i] = String(object.tables[i]); } if (object.schemaOnly != null) { - if (typeof object.schemaOnly !== "object") + if (!$util.isObject(object.schemaOnly)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.schemaOnly: object expected"); message.schemaOnly = $root.google.protobuf.BoolValue.fromObject(object.schemaOnly, long + 1); } if (object.mysqlExportOptions != null) { - if (typeof object.mysqlExportOptions !== "object") + if (!$util.isObject(object.mysqlExportOptions)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.mysqlExportOptions: object expected"); message.mysqlExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.fromObject(object.mysqlExportOptions, long + 1); } if (object.threads != null) { - if (typeof object.threads !== "object") + if (!$util.isObject(object.threads)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.threads: object expected"); message.threads = $root.google.protobuf.Int32Value.fromObject(object.threads, long + 1); } if (object.parallel != null) { - if (typeof object.parallel !== "object") + if (!$util.isObject(object.parallel)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.parallel: object expected"); message.parallel = $root.google.protobuf.BoolValue.fromObject(object.parallel, long + 1); } if (object.postgresExportOptions != null) { - if (typeof object.postgresExportOptions !== "object") + if (!$util.isObject(object.postgresExportOptions)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.postgresExportOptions: object expected"); message.postgresExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.fromObject(object.postgresExportOptions, long + 1); } @@ -9096,9 +9354,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlExportOptions.toObject = function toObject(message, options) { + SqlExportOptions.toObject = function toObject(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.tables = []; @@ -9114,16 +9376,16 @@ for (var j = 0; j < message.tables.length; ++j) object.tables[j] = message.tables[j]; } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) - object.schemaOnly = $root.google.protobuf.BoolValue.toObject(message.schemaOnly, options); - if (message.mysqlExportOptions != null && message.hasOwnProperty("mysqlExportOptions")) - object.mysqlExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.toObject(message.mysqlExportOptions, options); - if (message.threads != null && message.hasOwnProperty("threads")) - object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options); - if (message.parallel != null && message.hasOwnProperty("parallel")) - object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options); - if (message.postgresExportOptions != null && message.hasOwnProperty("postgresExportOptions")) - object.postgresExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.toObject(message.postgresExportOptions, options); + if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) + object.schemaOnly = $root.google.protobuf.BoolValue.toObject(message.schemaOnly, options, q + 1); + if (message.mysqlExportOptions != null && Object.hasOwnProperty.call(message, "mysqlExportOptions")) + object.mysqlExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.toObject(message.mysqlExportOptions, options, q + 1); + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) + object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options, q + 1); + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) + object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options, q + 1); + if (message.postgresExportOptions != null && Object.hasOwnProperty.call(message, "postgresExportOptions")) + object.postgresExportOptions = $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.toObject(message.postgresExportOptions, options, q + 1); return object; }; @@ -9206,11 +9468,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MysqlExportOptions.encode = function encode(message, writer) { + MysqlExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.masterData != null && Object.hasOwnProperty.call(message, "masterData")) - $root.google.protobuf.Int32Value.encode(message.masterData, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.masterData, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -9224,7 +9490,7 @@ * @returns {$protobuf.Writer} Writer */ MysqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -9294,7 +9560,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.masterData != null && message.hasOwnProperty("masterData")) { + if (message.masterData != null && Object.hasOwnProperty.call(message, "masterData")) { var error = $root.google.protobuf.Int32Value.verify(message.masterData, long + 1); if (error) return "masterData." + error; @@ -9313,13 +9579,15 @@ MysqlExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions(); if (object.masterData != null) { - if (typeof object.masterData !== "object") + if (!$util.isObject(object.masterData)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.MysqlExportOptions.masterData: object expected"); message.masterData = $root.google.protobuf.Int32Value.fromObject(object.masterData, long + 1); } @@ -9335,14 +9603,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MysqlExportOptions.toObject = function toObject(message, options) { + MysqlExportOptions.toObject = function toObject(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.masterData = null; - if (message.masterData != null && message.hasOwnProperty("masterData")) - object.masterData = $root.google.protobuf.Int32Value.toObject(message.masterData, options); + if (message.masterData != null && Object.hasOwnProperty.call(message, "masterData")) + object.masterData = $root.google.protobuf.Int32Value.toObject(message.masterData, options, q + 1); return object; }; @@ -9437,13 +9709,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PostgresExportOptions.encode = function encode(message, writer) { + PostgresExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) - $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) - $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -9457,7 +9733,7 @@ * @returns {$protobuf.Writer} Writer */ PostgresExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -9531,12 +9807,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.clean != null && message.hasOwnProperty("clean")) { + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) { var error = $root.google.protobuf.BoolValue.verify(message.clean, long + 1); if (error) return "clean." + error; } - if (message.ifExists != null && message.hasOwnProperty("ifExists")) { + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) { var error = $root.google.protobuf.BoolValue.verify(message.ifExists, long + 1); if (error) return "ifExists." + error; @@ -9555,18 +9831,20 @@ PostgresExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions(); if (object.clean != null) { - if (typeof object.clean !== "object") + if (!$util.isObject(object.clean)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.clean: object expected"); message.clean = $root.google.protobuf.BoolValue.fromObject(object.clean, long + 1); } if (object.ifExists != null) { - if (typeof object.ifExists !== "object") + if (!$util.isObject(object.ifExists)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlExportOptions.PostgresExportOptions.ifExists: object expected"); message.ifExists = $root.google.protobuf.BoolValue.fromObject(object.ifExists, long + 1); } @@ -9582,18 +9860,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PostgresExportOptions.toObject = function toObject(message, options) { + PostgresExportOptions.toObject = function toObject(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.clean = null; object.ifExists = null; } - if (message.clean != null && message.hasOwnProperty("clean")) - object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options); - if (message.ifExists != null && message.hasOwnProperty("ifExists")) - object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options); + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) + object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options, q + 1); + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) + object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options, q + 1); return object; }; @@ -9736,23 +10018,27 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBakExportOptions.encode = function encode(message, writer) { + SqlBakExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) - $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.stripeCount != null && Object.hasOwnProperty.call(message, "stripeCount")) - $root.google.protobuf.Int32Value.encode(message.stripeCount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.stripeCount, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.bakType); if (message.copyOnly != null && Object.hasOwnProperty.call(message, "copyOnly")) - $root.google.protobuf.BoolValue.encode(message.copyOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.copyOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.differentialBase != null && Object.hasOwnProperty.call(message, "differentialBase")) - $root.google.protobuf.BoolValue.encode(message.differentialBase, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.differentialBase, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.exportLogStartTime != null && Object.hasOwnProperty.call(message, "exportLogStartTime")) - $root.google.protobuf.Timestamp.encode(message.exportLogStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.exportLogStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.exportLogEndTime != null && Object.hasOwnProperty.call(message, "exportLogEndTime")) - $root.google.protobuf.Timestamp.encode(message.exportLogEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.exportLogEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -9766,7 +10052,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBakExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -9860,17 +10146,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.striped != null && message.hasOwnProperty("striped")) { + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) { var error = $root.google.protobuf.BoolValue.verify(message.striped, long + 1); if (error) return "striped." + error; } - if (message.stripeCount != null && message.hasOwnProperty("stripeCount")) { + if (message.stripeCount != null && Object.hasOwnProperty.call(message, "stripeCount")) { var error = $root.google.protobuf.Int32Value.verify(message.stripeCount, long + 1); if (error) return "stripeCount." + error; } - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) switch (message.bakType) { default: return "bakType: enum value expected"; @@ -9880,22 +10166,22 @@ case 3: break; } - if (message.copyOnly != null && message.hasOwnProperty("copyOnly")) { + if (message.copyOnly != null && Object.hasOwnProperty.call(message, "copyOnly")) { var error = $root.google.protobuf.BoolValue.verify(message.copyOnly, long + 1); if (error) return "copyOnly." + error; } - if (message.differentialBase != null && message.hasOwnProperty("differentialBase")) { + if (message.differentialBase != null && Object.hasOwnProperty.call(message, "differentialBase")) { var error = $root.google.protobuf.BoolValue.verify(message.differentialBase, long + 1); if (error) return "differentialBase." + error; } - if (message.exportLogStartTime != null && message.hasOwnProperty("exportLogStartTime")) { + if (message.exportLogStartTime != null && Object.hasOwnProperty.call(message, "exportLogStartTime")) { var error = $root.google.protobuf.Timestamp.verify(message.exportLogStartTime, long + 1); if (error) return "exportLogStartTime." + error; } - if (message.exportLogEndTime != null && message.hasOwnProperty("exportLogEndTime")) { + if (message.exportLogEndTime != null && Object.hasOwnProperty.call(message, "exportLogEndTime")) { var error = $root.google.protobuf.Timestamp.verify(message.exportLogEndTime, long + 1); if (error) return "exportLogEndTime." + error; @@ -9914,18 +10200,20 @@ SqlBakExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExportContext.SqlBakExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.ExportContext.SqlBakExportOptions(); if (object.striped != null) { - if (typeof object.striped !== "object") + if (!$util.isObject(object.striped)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlBakExportOptions.striped: object expected"); message.striped = $root.google.protobuf.BoolValue.fromObject(object.striped, long + 1); } if (object.stripeCount != null) { - if (typeof object.stripeCount !== "object") + if (!$util.isObject(object.stripeCount)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlBakExportOptions.stripeCount: object expected"); message.stripeCount = $root.google.protobuf.Int32Value.fromObject(object.stripeCount, long + 1); } @@ -9954,22 +10242,22 @@ break; } if (object.copyOnly != null) { - if (typeof object.copyOnly !== "object") + if (!$util.isObject(object.copyOnly)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlBakExportOptions.copyOnly: object expected"); message.copyOnly = $root.google.protobuf.BoolValue.fromObject(object.copyOnly, long + 1); } if (object.differentialBase != null) { - if (typeof object.differentialBase !== "object") + if (!$util.isObject(object.differentialBase)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlBakExportOptions.differentialBase: object expected"); message.differentialBase = $root.google.protobuf.BoolValue.fromObject(object.differentialBase, long + 1); } if (object.exportLogStartTime != null) { - if (typeof object.exportLogStartTime !== "object") + if (!$util.isObject(object.exportLogStartTime)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlBakExportOptions.exportLogStartTime: object expected"); message.exportLogStartTime = $root.google.protobuf.Timestamp.fromObject(object.exportLogStartTime, long + 1); } if (object.exportLogEndTime != null) { - if (typeof object.exportLogEndTime !== "object") + if (!$util.isObject(object.exportLogEndTime)) throw TypeError(".google.cloud.sql.v1.ExportContext.SqlBakExportOptions.exportLogEndTime: object expected"); message.exportLogEndTime = $root.google.protobuf.Timestamp.fromObject(object.exportLogEndTime, long + 1); } @@ -9985,9 +10273,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBakExportOptions.toObject = function toObject(message, options) { + SqlBakExportOptions.toObject = function toObject(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.striped = null; @@ -9998,20 +10290,20 @@ object.exportLogStartTime = null; object.exportLogEndTime = null; } - if (message.striped != null && message.hasOwnProperty("striped")) - object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options); - if (message.stripeCount != null && message.hasOwnProperty("stripeCount")) - object.stripeCount = $root.google.protobuf.Int32Value.toObject(message.stripeCount, options); - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) + object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options, q + 1); + if (message.stripeCount != null && Object.hasOwnProperty.call(message, "stripeCount")) + object.stripeCount = $root.google.protobuf.Int32Value.toObject(message.stripeCount, options, q + 1); + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) object.bakType = options.enums === String ? $root.google.cloud.sql.v1.BakType[message.bakType] === undefined ? message.bakType : $root.google.cloud.sql.v1.BakType[message.bakType] : message.bakType; - if (message.copyOnly != null && message.hasOwnProperty("copyOnly")) - object.copyOnly = $root.google.protobuf.BoolValue.toObject(message.copyOnly, options); - if (message.differentialBase != null && message.hasOwnProperty("differentialBase")) - object.differentialBase = $root.google.protobuf.BoolValue.toObject(message.differentialBase, options); - if (message.exportLogStartTime != null && message.hasOwnProperty("exportLogStartTime")) - object.exportLogStartTime = $root.google.protobuf.Timestamp.toObject(message.exportLogStartTime, options); - if (message.exportLogEndTime != null && message.hasOwnProperty("exportLogEndTime")) - object.exportLogEndTime = $root.google.protobuf.Timestamp.toObject(message.exportLogEndTime, options); + if (message.copyOnly != null && Object.hasOwnProperty.call(message, "copyOnly")) + object.copyOnly = $root.google.protobuf.BoolValue.toObject(message.copyOnly, options, q + 1); + if (message.differentialBase != null && Object.hasOwnProperty.call(message, "differentialBase")) + object.differentialBase = $root.google.protobuf.BoolValue.toObject(message.differentialBase, options, q + 1); + if (message.exportLogStartTime != null && Object.hasOwnProperty.call(message, "exportLogStartTime")) + object.exportLogStartTime = $root.google.protobuf.Timestamp.toObject(message.exportLogStartTime, options, q + 1); + if (message.exportLogEndTime != null && Object.hasOwnProperty.call(message, "exportLogEndTime")) + object.exportLogEndTime = $root.google.protobuf.Timestamp.toObject(message.exportLogEndTime, options, q + 1); return object; }; @@ -10124,9 +10416,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlTdeExportOptions.encode = function encode(message, writer) { + SqlTdeExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificatePath); if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) @@ -10148,7 +10444,7 @@ * @returns {$protobuf.Writer} Writer */ SqlTdeExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -10230,16 +10526,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) if (!$util.isString(message.certificatePath)) return "certificatePath: string expected"; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) if (!$util.isString(message.privateKeyPath)) return "privateKeyPath: string expected"; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) if (!$util.isString(message.privateKeyPassword)) return "privateKeyPassword: string expected"; - 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; @@ -10256,6 +10552,8 @@ SqlTdeExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExportContext.SqlTdeExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExportContext.SqlTdeExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10281,9 +10579,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlTdeExportOptions.toObject = function toObject(message, options) { + SqlTdeExportOptions.toObject = function toObject(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.certificatePath = ""; @@ -10291,13 +10593,13 @@ object.privateKeyPassword = ""; object.name = ""; } - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) object.certificatePath = message.certificatePath; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) object.privateKeyPath = message.privateKeyPath; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) object.privateKeyPassword = message.privateKeyPassword; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -10459,9 +10761,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportContext.encode = function encode(message, writer) { + ImportContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); if (message.database != null && Object.hasOwnProperty.call(message, "database")) @@ -10471,15 +10777,15 @@ if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.fileType); if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) - $root.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.importUser != null && Object.hasOwnProperty.call(message, "importUser")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.importUser); if (message.bakImportOptions != null && Object.hasOwnProperty.call(message, "bakImportOptions")) - $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.encode(message.bakImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.encode(message.bakImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) - $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.tdeImportOptions != null && Object.hasOwnProperty.call(message, "tdeImportOptions")) - $root.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.encode(message.tdeImportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.encode(message.tdeImportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -10493,7 +10799,7 @@ * @returns {$protobuf.Writer} Writer */ ImportContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -10595,16 +10901,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) if (!$util.isString(message.uri)) return "uri: 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.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.fileType != null && message.hasOwnProperty("fileType")) + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) switch (message.fileType) { default: return "fileType: enum value expected"; @@ -10615,25 +10921,25 @@ case 8: break; } - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) { var error = $root.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.verify(message.csvImportOptions, long + 1); if (error) return "csvImportOptions." + error; } - if (message.importUser != null && message.hasOwnProperty("importUser")) + if (message.importUser != null && Object.hasOwnProperty.call(message, "importUser")) if (!$util.isString(message.importUser)) return "importUser: string expected"; - if (message.bakImportOptions != null && message.hasOwnProperty("bakImportOptions")) { + if (message.bakImportOptions != null && Object.hasOwnProperty.call(message, "bakImportOptions")) { var error = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.verify(message.bakImportOptions, long + 1); if (error) return "bakImportOptions." + error; } - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) { var error = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.verify(message.sqlImportOptions, long + 1); if (error) return "sqlImportOptions." + error; } - if (message.tdeImportOptions != null && message.hasOwnProperty("tdeImportOptions")) { + if (message.tdeImportOptions != null && Object.hasOwnProperty.call(message, "tdeImportOptions")) { var error = $root.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.verify(message.tdeImportOptions, long + 1); if (error) return "tdeImportOptions." + error; @@ -10652,6 +10958,8 @@ ImportContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ImportContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ImportContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -10692,24 +11000,24 @@ break; } if (object.csvImportOptions != null) { - if (typeof object.csvImportOptions !== "object") + if (!$util.isObject(object.csvImportOptions)) throw TypeError(".google.cloud.sql.v1.ImportContext.csvImportOptions: object expected"); message.csvImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.fromObject(object.csvImportOptions, long + 1); } if (object.importUser != null) message.importUser = String(object.importUser); if (object.bakImportOptions != null) { - if (typeof object.bakImportOptions !== "object") + if (!$util.isObject(object.bakImportOptions)) throw TypeError(".google.cloud.sql.v1.ImportContext.bakImportOptions: object expected"); message.bakImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.fromObject(object.bakImportOptions, long + 1); } if (object.sqlImportOptions != null) { - if (typeof object.sqlImportOptions !== "object") + if (!$util.isObject(object.sqlImportOptions)) throw TypeError(".google.cloud.sql.v1.ImportContext.sqlImportOptions: object expected"); message.sqlImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.fromObject(object.sqlImportOptions, long + 1); } if (object.tdeImportOptions != null) { - if (typeof object.tdeImportOptions !== "object") + if (!$util.isObject(object.tdeImportOptions)) throw TypeError(".google.cloud.sql.v1.ImportContext.tdeImportOptions: object expected"); message.tdeImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.fromObject(object.tdeImportOptions, long + 1); } @@ -10725,9 +11033,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportContext.toObject = function toObject(message, options) { + ImportContext.toObject = function toObject(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.uri = ""; @@ -10740,24 +11052,24 @@ object.sqlImportOptions = null; object.tdeImportOptions = null; } - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) object.uri = message.uri; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.fileType != null && message.hasOwnProperty("fileType")) + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) object.fileType = options.enums === String ? $root.google.cloud.sql.v1.SqlFileType[message.fileType] === undefined ? message.fileType : $root.google.cloud.sql.v1.SqlFileType[message.fileType] : message.fileType; - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) - object.csvImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.toObject(message.csvImportOptions, options); - if (message.importUser != null && message.hasOwnProperty("importUser")) + if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) + object.csvImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions.toObject(message.csvImportOptions, options, q + 1); + if (message.importUser != null && Object.hasOwnProperty.call(message, "importUser")) object.importUser = message.importUser; - if (message.bakImportOptions != null && message.hasOwnProperty("bakImportOptions")) - object.bakImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.toObject(message.bakImportOptions, options); - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) - object.sqlImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.toObject(message.sqlImportOptions, options); - if (message.tdeImportOptions != null && message.hasOwnProperty("tdeImportOptions")) - object.tdeImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.toObject(message.tdeImportOptions, options); + if (message.bakImportOptions != null && Object.hasOwnProperty.call(message, "bakImportOptions")) + object.bakImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.toObject(message.bakImportOptions, options, q + 1); + if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) + object.sqlImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.toObject(message.sqlImportOptions, options, q + 1); + if (message.tdeImportOptions != null && Object.hasOwnProperty.call(message, "tdeImportOptions")) + object.tdeImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions.toObject(message.tdeImportOptions, options, q + 1); return object; }; @@ -10858,15 +11170,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlImportOptions.encode = function encode(message, writer) { + SqlImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) - $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) - $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.postgresImportOptions != null && Object.hasOwnProperty.call(message, "postgresImportOptions")) - $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.encode(message.postgresImportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.encode(message.postgresImportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -10880,7 +11196,7 @@ * @returns {$protobuf.Writer} Writer */ SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -10958,17 +11274,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.threads != null && message.hasOwnProperty("threads")) { + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) { var error = $root.google.protobuf.Int32Value.verify(message.threads, long + 1); if (error) return "threads." + error; } - if (message.parallel != null && message.hasOwnProperty("parallel")) { + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) { var error = $root.google.protobuf.BoolValue.verify(message.parallel, long + 1); if (error) return "parallel." + error; } - if (message.postgresImportOptions != null && message.hasOwnProperty("postgresImportOptions")) { + if (message.postgresImportOptions != null && Object.hasOwnProperty.call(message, "postgresImportOptions")) { var error = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.verify(message.postgresImportOptions, long + 1); if (error) return "postgresImportOptions." + error; @@ -10987,23 +11303,25 @@ SqlImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ImportContext.SqlImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ImportContext.SqlImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.ImportContext.SqlImportOptions(); if (object.threads != null) { - if (typeof object.threads !== "object") + if (!$util.isObject(object.threads)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlImportOptions.threads: object expected"); message.threads = $root.google.protobuf.Int32Value.fromObject(object.threads, long + 1); } if (object.parallel != null) { - if (typeof object.parallel !== "object") + if (!$util.isObject(object.parallel)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlImportOptions.parallel: object expected"); message.parallel = $root.google.protobuf.BoolValue.fromObject(object.parallel, long + 1); } if (object.postgresImportOptions != null) { - if (typeof object.postgresImportOptions !== "object") + if (!$util.isObject(object.postgresImportOptions)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlImportOptions.postgresImportOptions: object expected"); message.postgresImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.fromObject(object.postgresImportOptions, long + 1); } @@ -11019,21 +11337,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlImportOptions.toObject = function toObject(message, options) { + SqlImportOptions.toObject = function toObject(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.threads = null; object.parallel = null; object.postgresImportOptions = null; } - if (message.threads != null && message.hasOwnProperty("threads")) - object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options); - if (message.parallel != null && message.hasOwnProperty("parallel")) - object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options); - if (message.postgresImportOptions != null && message.hasOwnProperty("postgresImportOptions")) - object.postgresImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.toObject(message.postgresImportOptions, options); + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) + object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options, q + 1); + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) + object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options, q + 1); + if (message.postgresImportOptions != null && Object.hasOwnProperty.call(message, "postgresImportOptions")) + object.postgresImportOptions = $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.toObject(message.postgresImportOptions, options, q + 1); return object; }; @@ -11125,13 +11447,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PostgresImportOptions.encode = function encode(message, writer) { + PostgresImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) - $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) - $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -11145,7 +11471,7 @@ * @returns {$protobuf.Writer} Writer */ PostgresImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -11219,12 +11545,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.clean != null && message.hasOwnProperty("clean")) { + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) { var error = $root.google.protobuf.BoolValue.verify(message.clean, long + 1); if (error) return "clean." + error; } - if (message.ifExists != null && message.hasOwnProperty("ifExists")) { + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) { var error = $root.google.protobuf.BoolValue.verify(message.ifExists, long + 1); if (error) return "ifExists." + error; @@ -11243,18 +11569,20 @@ PostgresImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions(); if (object.clean != null) { - if (typeof object.clean !== "object") + if (!$util.isObject(object.clean)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.clean: object expected"); message.clean = $root.google.protobuf.BoolValue.fromObject(object.clean, long + 1); } if (object.ifExists != null) { - if (typeof object.ifExists !== "object") + if (!$util.isObject(object.ifExists)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlImportOptions.PostgresImportOptions.ifExists: object expected"); message.ifExists = $root.google.protobuf.BoolValue.fromObject(object.ifExists, long + 1); } @@ -11270,18 +11598,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PostgresImportOptions.toObject = function toObject(message, options) { + PostgresImportOptions.toObject = function toObject(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.clean = null; object.ifExists = null; } - if (message.clean != null && message.hasOwnProperty("clean")) - object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options); - if (message.ifExists != null && message.hasOwnProperty("ifExists")) - object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options); + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) + object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options, q + 1); + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) + object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options, q + 1); return object; }; @@ -11416,9 +11748,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlCsvImportOptions.encode = function encode(message, writer) { + SqlCsvImportOptions.encode = function encode(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) @@ -11445,7 +11781,7 @@ * @returns {$protobuf.Writer} Writer */ SqlCsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -11537,26 +11873,26 @@ 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.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) if (!$util.isString(message.escapeCharacter)) return "escapeCharacter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) if (!$util.isString(message.quoteCharacter)) return "quoteCharacter: string expected"; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) if (!$util.isString(message.fieldsTerminatedBy)) return "fieldsTerminatedBy: string expected"; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) if (!$util.isString(message.linesTerminatedBy)) return "linesTerminatedBy: string expected"; return null; @@ -11573,6 +11909,8 @@ SqlCsvImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ImportContext.SqlCsvImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ImportContext.SqlCsvImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -11607,9 +11945,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlCsvImportOptions.toObject = function toObject(message, options) { + SqlCsvImportOptions.toObject = function toObject(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 = []; @@ -11620,20 +11962,20 @@ object.fieldsTerminatedBy = ""; object.linesTerminatedBy = ""; } - 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 = []; for (var j = 0; j < message.columns.length; ++j) object.columns[j] = message.columns[j]; } - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) object.escapeCharacter = message.escapeCharacter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) object.quoteCharacter = message.quoteCharacter; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) object.fieldsTerminatedBy = message.fieldsTerminatedBy; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) object.linesTerminatedBy = message.linesTerminatedBy; return object; }; @@ -11774,21 +12116,25 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBakImportOptions.encode = function encode(message, writer) { + SqlBakImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.encryptionOptions != null && Object.hasOwnProperty.call(message, "encryptionOptions")) - $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.encode(message.encryptionOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.encode(message.encryptionOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) - $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.noRecovery != null && Object.hasOwnProperty.call(message, "noRecovery")) - $root.google.protobuf.BoolValue.encode(message.noRecovery, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.noRecovery, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.recoveryOnly != null && Object.hasOwnProperty.call(message, "recoveryOnly")) - $root.google.protobuf.BoolValue.encode(message.recoveryOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.recoveryOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.bakType); if (message.stopAt != null && Object.hasOwnProperty.call(message, "stopAt")) - $root.google.protobuf.Timestamp.encode(message.stopAt, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.stopAt, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.stopAtMark != null && Object.hasOwnProperty.call(message, "stopAtMark")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.stopAtMark); return writer; @@ -11804,7 +12150,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBakImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -11898,27 +12244,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionOptions != null && message.hasOwnProperty("encryptionOptions")) { + if (message.encryptionOptions != null && Object.hasOwnProperty.call(message, "encryptionOptions")) { var error = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.verify(message.encryptionOptions, long + 1); if (error) return "encryptionOptions." + error; } - if (message.striped != null && message.hasOwnProperty("striped")) { + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) { var error = $root.google.protobuf.BoolValue.verify(message.striped, long + 1); if (error) return "striped." + error; } - if (message.noRecovery != null && message.hasOwnProperty("noRecovery")) { + if (message.noRecovery != null && Object.hasOwnProperty.call(message, "noRecovery")) { var error = $root.google.protobuf.BoolValue.verify(message.noRecovery, long + 1); if (error) return "noRecovery." + error; } - if (message.recoveryOnly != null && message.hasOwnProperty("recoveryOnly")) { + if (message.recoveryOnly != null && Object.hasOwnProperty.call(message, "recoveryOnly")) { var error = $root.google.protobuf.BoolValue.verify(message.recoveryOnly, long + 1); if (error) return "recoveryOnly." + error; } - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) switch (message.bakType) { default: return "bakType: enum value expected"; @@ -11928,12 +12274,12 @@ case 3: break; } - if (message.stopAt != null && message.hasOwnProperty("stopAt")) { + if (message.stopAt != null && Object.hasOwnProperty.call(message, "stopAt")) { var error = $root.google.protobuf.Timestamp.verify(message.stopAt, long + 1); if (error) return "stopAt." + error; } - if (message.stopAtMark != null && message.hasOwnProperty("stopAtMark")) + if (message.stopAtMark != null && Object.hasOwnProperty.call(message, "stopAtMark")) if (!$util.isString(message.stopAtMark)) return "stopAtMark: string expected"; return null; @@ -11950,28 +12296,30 @@ SqlBakImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions(); if (object.encryptionOptions != null) { - if (typeof object.encryptionOptions !== "object") + if (!$util.isObject(object.encryptionOptions)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions.encryptionOptions: object expected"); message.encryptionOptions = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.fromObject(object.encryptionOptions, long + 1); } if (object.striped != null) { - if (typeof object.striped !== "object") + if (!$util.isObject(object.striped)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions.striped: object expected"); message.striped = $root.google.protobuf.BoolValue.fromObject(object.striped, long + 1); } if (object.noRecovery != null) { - if (typeof object.noRecovery !== "object") + if (!$util.isObject(object.noRecovery)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions.noRecovery: object expected"); message.noRecovery = $root.google.protobuf.BoolValue.fromObject(object.noRecovery, long + 1); } if (object.recoveryOnly != null) { - if (typeof object.recoveryOnly !== "object") + if (!$util.isObject(object.recoveryOnly)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions.recoveryOnly: object expected"); message.recoveryOnly = $root.google.protobuf.BoolValue.fromObject(object.recoveryOnly, long + 1); } @@ -12000,7 +12348,7 @@ break; } if (object.stopAt != null) { - if (typeof object.stopAt !== "object") + if (!$util.isObject(object.stopAt)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions.stopAt: object expected"); message.stopAt = $root.google.protobuf.Timestamp.fromObject(object.stopAt, long + 1); } @@ -12018,9 +12366,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBakImportOptions.toObject = function toObject(message, options) { + SqlBakImportOptions.toObject = function toObject(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.encryptionOptions = null; @@ -12031,19 +12383,19 @@ object.stopAt = null; object.stopAtMark = ""; } - if (message.encryptionOptions != null && message.hasOwnProperty("encryptionOptions")) - object.encryptionOptions = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.toObject(message.encryptionOptions, options); - if (message.striped != null && message.hasOwnProperty("striped")) - object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options); - if (message.noRecovery != null && message.hasOwnProperty("noRecovery")) - object.noRecovery = $root.google.protobuf.BoolValue.toObject(message.noRecovery, options); - if (message.recoveryOnly != null && message.hasOwnProperty("recoveryOnly")) - object.recoveryOnly = $root.google.protobuf.BoolValue.toObject(message.recoveryOnly, options); - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.encryptionOptions != null && Object.hasOwnProperty.call(message, "encryptionOptions")) + object.encryptionOptions = $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.toObject(message.encryptionOptions, options, q + 1); + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) + object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options, q + 1); + if (message.noRecovery != null && Object.hasOwnProperty.call(message, "noRecovery")) + object.noRecovery = $root.google.protobuf.BoolValue.toObject(message.noRecovery, options, q + 1); + if (message.recoveryOnly != null && Object.hasOwnProperty.call(message, "recoveryOnly")) + object.recoveryOnly = $root.google.protobuf.BoolValue.toObject(message.recoveryOnly, options, q + 1); + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) object.bakType = options.enums === String ? $root.google.cloud.sql.v1.BakType[message.bakType] === undefined ? message.bakType : $root.google.cloud.sql.v1.BakType[message.bakType] : message.bakType; - if (message.stopAt != null && message.hasOwnProperty("stopAt")) - object.stopAt = $root.google.protobuf.Timestamp.toObject(message.stopAt, options); - if (message.stopAtMark != null && message.hasOwnProperty("stopAtMark")) + if (message.stopAt != null && Object.hasOwnProperty.call(message, "stopAt")) + object.stopAt = $root.google.protobuf.Timestamp.toObject(message.stopAt, options, q + 1); + if (message.stopAtMark != null && Object.hasOwnProperty.call(message, "stopAtMark")) object.stopAtMark = message.stopAtMark; return object; }; @@ -12154,9 +12506,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionOptions.encode = function encode(message, writer) { + EncryptionOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certPath != null && Object.hasOwnProperty.call(message, "certPath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.certPath); if (message.pvkPath != null && Object.hasOwnProperty.call(message, "pvkPath")) @@ -12164,7 +12520,7 @@ if (message.pvkPassword != null && Object.hasOwnProperty.call(message, "pvkPassword")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pvkPassword); if (message.keepEncrypted != null && Object.hasOwnProperty.call(message, "keepEncrypted")) - $root.google.protobuf.BoolValue.encode(message.keepEncrypted, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.keepEncrypted, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -12178,7 +12534,7 @@ * @returns {$protobuf.Writer} Writer */ EncryptionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -12260,16 +12616,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certPath != null && message.hasOwnProperty("certPath")) + if (message.certPath != null && Object.hasOwnProperty.call(message, "certPath")) if (!$util.isString(message.certPath)) return "certPath: string expected"; - if (message.pvkPath != null && message.hasOwnProperty("pvkPath")) + if (message.pvkPath != null && Object.hasOwnProperty.call(message, "pvkPath")) if (!$util.isString(message.pvkPath)) return "pvkPath: string expected"; - if (message.pvkPassword != null && message.hasOwnProperty("pvkPassword")) + if (message.pvkPassword != null && Object.hasOwnProperty.call(message, "pvkPassword")) if (!$util.isString(message.pvkPassword)) return "pvkPassword: string expected"; - if (message.keepEncrypted != null && message.hasOwnProperty("keepEncrypted")) { + if (message.keepEncrypted != null && Object.hasOwnProperty.call(message, "keepEncrypted")) { var error = $root.google.protobuf.BoolValue.verify(message.keepEncrypted, long + 1); if (error) return "keepEncrypted." + error; @@ -12288,6 +12644,8 @@ EncryptionOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12300,7 +12658,7 @@ if (object.pvkPassword != null) message.pvkPassword = String(object.pvkPassword); if (object.keepEncrypted != null) { - if (typeof object.keepEncrypted !== "object") + if (!$util.isObject(object.keepEncrypted)) throw TypeError(".google.cloud.sql.v1.ImportContext.SqlBakImportOptions.EncryptionOptions.keepEncrypted: object expected"); message.keepEncrypted = $root.google.protobuf.BoolValue.fromObject(object.keepEncrypted, long + 1); } @@ -12316,9 +12674,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionOptions.toObject = function toObject(message, options) { + EncryptionOptions.toObject = function toObject(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.certPath = ""; @@ -12326,14 +12688,14 @@ object.pvkPassword = ""; object.keepEncrypted = null; } - if (message.certPath != null && message.hasOwnProperty("certPath")) + if (message.certPath != null && Object.hasOwnProperty.call(message, "certPath")) object.certPath = message.certPath; - if (message.pvkPath != null && message.hasOwnProperty("pvkPath")) + if (message.pvkPath != null && Object.hasOwnProperty.call(message, "pvkPath")) object.pvkPath = message.pvkPath; - if (message.pvkPassword != null && message.hasOwnProperty("pvkPassword")) + if (message.pvkPassword != null && Object.hasOwnProperty.call(message, "pvkPassword")) object.pvkPassword = message.pvkPassword; - if (message.keepEncrypted != null && message.hasOwnProperty("keepEncrypted")) - object.keepEncrypted = $root.google.protobuf.BoolValue.toObject(message.keepEncrypted, options); + if (message.keepEncrypted != null && Object.hasOwnProperty.call(message, "keepEncrypted")) + object.keepEncrypted = $root.google.protobuf.BoolValue.toObject(message.keepEncrypted, options, q + 1); return object; }; @@ -12449,9 +12811,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlTdeImportOptions.encode = function encode(message, writer) { + SqlTdeImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificatePath); if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) @@ -12473,7 +12839,7 @@ * @returns {$protobuf.Writer} Writer */ SqlTdeImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -12555,16 +12921,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) if (!$util.isString(message.certificatePath)) return "certificatePath: string expected"; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) if (!$util.isString(message.privateKeyPath)) return "privateKeyPath: string expected"; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) if (!$util.isString(message.privateKeyPassword)) return "privateKeyPassword: string expected"; - 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; @@ -12581,6 +12947,8 @@ SqlTdeImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ImportContext.SqlTdeImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ImportContext.SqlTdeImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -12606,9 +12974,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlTdeImportOptions.toObject = function toObject(message, options) { + SqlTdeImportOptions.toObject = function toObject(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.certificatePath = ""; @@ -12616,13 +12988,13 @@ object.privateKeyPassword = ""; object.name = ""; } - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) object.certificatePath = message.certificatePath; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) object.privateKeyPath = message.privateKeyPath; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) object.privateKeyPassword = message.privateKeyPassword; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -12858,26 +13230,30 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IpConfiguration.encode = function encode(message, writer) { + IpConfiguration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.ipv4Enabled != null && Object.hasOwnProperty.call(message, "ipv4Enabled")) - $root.google.protobuf.BoolValue.encode(message.ipv4Enabled, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.ipv4Enabled, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateNetwork); if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) - $root.google.protobuf.BoolValue.encode(message.requireSsl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.requireSsl, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.authorizedNetworks != null && message.authorizedNetworks.length) for (var i = 0; i < message.authorizedNetworks.length; ++i) - $root.google.cloud.sql.v1.AclEntry.encode(message.authorizedNetworks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.AclEntry.encode(message.authorizedNetworks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.allocatedIpRange); if (message.enablePrivatePathForGoogleCloudServices != null && Object.hasOwnProperty.call(message, "enablePrivatePathForGoogleCloudServices")) - $root.google.protobuf.BoolValue.encode(message.enablePrivatePathForGoogleCloudServices, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enablePrivatePathForGoogleCloudServices, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.sslMode); if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) - $root.google.cloud.sql.v1.PscConfig.encode(message.pscConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1.PscConfig.encode(message.pscConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.serverCaMode); if (message.customSubjectAlternativeNames != null && message.customSubjectAlternativeNames.length) @@ -12900,7 +13276,7 @@ * @returns {$protobuf.Writer} Writer */ IpConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -13019,20 +13395,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.ipv4Enabled != null && message.hasOwnProperty("ipv4Enabled")) { + if (message.ipv4Enabled != null && Object.hasOwnProperty.call(message, "ipv4Enabled")) { var error = $root.google.protobuf.BoolValue.verify(message.ipv4Enabled, long + 1); if (error) return "ipv4Enabled." + error; } - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) if (!$util.isString(message.privateNetwork)) return "privateNetwork: string expected"; - if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) { + if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) { var error = $root.google.protobuf.BoolValue.verify(message.requireSsl, long + 1); if (error) return "requireSsl." + error; } - if (message.authorizedNetworks != null && message.hasOwnProperty("authorizedNetworks")) { + if (message.authorizedNetworks != null && Object.hasOwnProperty.call(message, "authorizedNetworks")) { if (!Array.isArray(message.authorizedNetworks)) return "authorizedNetworks: array expected"; for (var i = 0; i < message.authorizedNetworks.length; ++i) { @@ -13041,15 +13417,15 @@ return "authorizedNetworks." + error; } } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) if (!$util.isString(message.allocatedIpRange)) return "allocatedIpRange: string expected"; - if (message.enablePrivatePathForGoogleCloudServices != null && message.hasOwnProperty("enablePrivatePathForGoogleCloudServices")) { + if (message.enablePrivatePathForGoogleCloudServices != null && Object.hasOwnProperty.call(message, "enablePrivatePathForGoogleCloudServices")) { var error = $root.google.protobuf.BoolValue.verify(message.enablePrivatePathForGoogleCloudServices, long + 1); if (error) return "enablePrivatePathForGoogleCloudServices." + error; } - if (message.sslMode != null && message.hasOwnProperty("sslMode")) + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) switch (message.sslMode) { default: return "sslMode: enum value expected"; @@ -13059,7 +13435,7 @@ case 3: break; } - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { + if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) { properties._pscConfig = 1; { var error = $root.google.cloud.sql.v1.PscConfig.verify(message.pscConfig, long + 1); @@ -13067,7 +13443,7 @@ return "pscConfig." + error; } } - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) { + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) { properties._serverCaMode = 1; switch (message.serverCaMode) { default: @@ -13079,19 +13455,19 @@ break; } } - if (message.customSubjectAlternativeNames != null && message.hasOwnProperty("customSubjectAlternativeNames")) { + if (message.customSubjectAlternativeNames != null && Object.hasOwnProperty.call(message, "customSubjectAlternativeNames")) { if (!Array.isArray(message.customSubjectAlternativeNames)) return "customSubjectAlternativeNames: array expected"; for (var i = 0; i < message.customSubjectAlternativeNames.length; ++i) if (!$util.isString(message.customSubjectAlternativeNames[i])) return "customSubjectAlternativeNames: string[] expected"; } - if (message.serverCaPool != null && message.hasOwnProperty("serverCaPool")) { + if (message.serverCaPool != null && Object.hasOwnProperty.call(message, "serverCaPool")) { properties._serverCaPool = 1; if (!$util.isString(message.serverCaPool)) return "serverCaPool: string expected"; } - if (message.serverCertificateRotationMode != null && message.hasOwnProperty("serverCertificateRotationMode")) { + if (message.serverCertificateRotationMode != null && Object.hasOwnProperty.call(message, "serverCertificateRotationMode")) { properties._serverCertificateRotationMode = 1; switch (message.serverCertificateRotationMode) { default: @@ -13116,20 +13492,22 @@ IpConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.IpConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.IpConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.IpConfiguration(); if (object.ipv4Enabled != null) { - if (typeof object.ipv4Enabled !== "object") + if (!$util.isObject(object.ipv4Enabled)) throw TypeError(".google.cloud.sql.v1.IpConfiguration.ipv4Enabled: object expected"); message.ipv4Enabled = $root.google.protobuf.BoolValue.fromObject(object.ipv4Enabled, long + 1); } if (object.privateNetwork != null) message.privateNetwork = String(object.privateNetwork); if (object.requireSsl != null) { - if (typeof object.requireSsl !== "object") + if (!$util.isObject(object.requireSsl)) throw TypeError(".google.cloud.sql.v1.IpConfiguration.requireSsl: object expected"); message.requireSsl = $root.google.protobuf.BoolValue.fromObject(object.requireSsl, long + 1); } @@ -13138,7 +13516,7 @@ throw TypeError(".google.cloud.sql.v1.IpConfiguration.authorizedNetworks: array expected"); message.authorizedNetworks = []; for (var i = 0; i < object.authorizedNetworks.length; ++i) { - if (typeof object.authorizedNetworks[i] !== "object") + if (!$util.isObject(object.authorizedNetworks[i])) throw TypeError(".google.cloud.sql.v1.IpConfiguration.authorizedNetworks: object expected"); message.authorizedNetworks[i] = $root.google.cloud.sql.v1.AclEntry.fromObject(object.authorizedNetworks[i], long + 1); } @@ -13146,7 +13524,7 @@ if (object.allocatedIpRange != null) message.allocatedIpRange = String(object.allocatedIpRange); if (object.enablePrivatePathForGoogleCloudServices != null) { - if (typeof object.enablePrivatePathForGoogleCloudServices !== "object") + if (!$util.isObject(object.enablePrivatePathForGoogleCloudServices)) throw TypeError(".google.cloud.sql.v1.IpConfiguration.enablePrivatePathForGoogleCloudServices: object expected"); message.enablePrivatePathForGoogleCloudServices = $root.google.protobuf.BoolValue.fromObject(object.enablePrivatePathForGoogleCloudServices, long + 1); } @@ -13175,7 +13553,7 @@ break; } if (object.pscConfig != null) { - if (typeof object.pscConfig !== "object") + if (!$util.isObject(object.pscConfig)) throw TypeError(".google.cloud.sql.v1.IpConfiguration.pscConfig: object expected"); message.pscConfig = $root.google.cloud.sql.v1.PscConfig.fromObject(object.pscConfig, long + 1); } @@ -13244,9 +13622,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IpConfiguration.toObject = function toObject(message, options) { + IpConfiguration.toObject = function toObject(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.authorizedNetworks = []; @@ -13260,29 +13642,29 @@ object.enablePrivatePathForGoogleCloudServices = null; object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; } - if (message.ipv4Enabled != null && message.hasOwnProperty("ipv4Enabled")) - object.ipv4Enabled = $root.google.protobuf.BoolValue.toObject(message.ipv4Enabled, options); - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + if (message.ipv4Enabled != null && Object.hasOwnProperty.call(message, "ipv4Enabled")) + object.ipv4Enabled = $root.google.protobuf.BoolValue.toObject(message.ipv4Enabled, options, q + 1); + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) object.privateNetwork = message.privateNetwork; - if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) - object.requireSsl = $root.google.protobuf.BoolValue.toObject(message.requireSsl, options); + if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) + object.requireSsl = $root.google.protobuf.BoolValue.toObject(message.requireSsl, options, q + 1); if (message.authorizedNetworks && message.authorizedNetworks.length) { object.authorizedNetworks = []; for (var j = 0; j < message.authorizedNetworks.length; ++j) - object.authorizedNetworks[j] = $root.google.cloud.sql.v1.AclEntry.toObject(message.authorizedNetworks[j], options); + object.authorizedNetworks[j] = $root.google.cloud.sql.v1.AclEntry.toObject(message.authorizedNetworks[j], options, q + 1); } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) object.allocatedIpRange = message.allocatedIpRange; - if (message.enablePrivatePathForGoogleCloudServices != null && message.hasOwnProperty("enablePrivatePathForGoogleCloudServices")) - object.enablePrivatePathForGoogleCloudServices = $root.google.protobuf.BoolValue.toObject(message.enablePrivatePathForGoogleCloudServices, options); - if (message.sslMode != null && message.hasOwnProperty("sslMode")) + if (message.enablePrivatePathForGoogleCloudServices != null && Object.hasOwnProperty.call(message, "enablePrivatePathForGoogleCloudServices")) + object.enablePrivatePathForGoogleCloudServices = $root.google.protobuf.BoolValue.toObject(message.enablePrivatePathForGoogleCloudServices, options, q + 1); + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) object.sslMode = options.enums === String ? $root.google.cloud.sql.v1.IpConfiguration.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.sql.v1.IpConfiguration.SslMode[message.sslMode] : message.sslMode; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { - object.pscConfig = $root.google.cloud.sql.v1.PscConfig.toObject(message.pscConfig, options); + if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) { + object.pscConfig = $root.google.cloud.sql.v1.PscConfig.toObject(message.pscConfig, options, q + 1); if (options.oneofs) object._pscConfig = "pscConfig"; } - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) { + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) { object.serverCaMode = options.enums === String ? $root.google.cloud.sql.v1.IpConfiguration.CaMode[message.serverCaMode] === undefined ? message.serverCaMode : $root.google.cloud.sql.v1.IpConfiguration.CaMode[message.serverCaMode] : message.serverCaMode; if (options.oneofs) object._serverCaMode = "serverCaMode"; @@ -13292,12 +13674,12 @@ for (var j = 0; j < message.customSubjectAlternativeNames.length; ++j) object.customSubjectAlternativeNames[j] = message.customSubjectAlternativeNames[j]; } - if (message.serverCaPool != null && message.hasOwnProperty("serverCaPool")) { + if (message.serverCaPool != null && Object.hasOwnProperty.call(message, "serverCaPool")) { object.serverCaPool = message.serverCaPool; if (options.oneofs) object._serverCaPool = "serverCaPool"; } - if (message.serverCertificateRotationMode != null && message.hasOwnProperty("serverCertificateRotationMode")) { + if (message.serverCertificateRotationMode != null && Object.hasOwnProperty.call(message, "serverCertificateRotationMode")) { object.serverCertificateRotationMode = options.enums === String ? $root.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode[message.serverCertificateRotationMode] === undefined ? message.serverCertificateRotationMode : $root.google.cloud.sql.v1.IpConfiguration.ServerCertificateRotationMode[message.serverCertificateRotationMode] : message.serverCertificateRotationMode; if (options.oneofs) object._serverCertificateRotationMode = "serverCertificateRotationMode"; @@ -13507,9 +13889,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PscConfig.encode = function encode(message, writer) { + PscConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) @@ -13517,7 +13903,7 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); if (message.pscAutoConnections != null && message.pscAutoConnections.length) for (var i = 0; i < message.pscAutoConnections.length; ++i) - $root.google.cloud.sql.v1.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.networkAttachmentUri != null && Object.hasOwnProperty.call(message, "networkAttachmentUri")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.networkAttachmentUri); if (message.pscAutoDnsEnabled != null && Object.hasOwnProperty.call(message, "pscAutoDnsEnabled")) @@ -13537,7 +13923,7 @@ * @returns {$protobuf.Writer} Writer */ PscConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -13632,19 +14018,19 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) { + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) { properties._pscEnabled = 1; if (typeof message.pscEnabled !== "boolean") return "pscEnabled: boolean expected"; } - if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { + if (message.allowedConsumerProjects != null && Object.hasOwnProperty.call(message, "allowedConsumerProjects")) { if (!Array.isArray(message.allowedConsumerProjects)) return "allowedConsumerProjects: array expected"; for (var i = 0; i < message.allowedConsumerProjects.length; ++i) if (!$util.isString(message.allowedConsumerProjects[i])) return "allowedConsumerProjects: string[] expected"; } - if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { + if (message.pscAutoConnections != null && Object.hasOwnProperty.call(message, "pscAutoConnections")) { if (!Array.isArray(message.pscAutoConnections)) return "pscAutoConnections: array expected"; for (var i = 0; i < message.pscAutoConnections.length; ++i) { @@ -13653,15 +14039,15 @@ return "pscAutoConnections." + error; } } - if (message.networkAttachmentUri != null && message.hasOwnProperty("networkAttachmentUri")) + if (message.networkAttachmentUri != null && Object.hasOwnProperty.call(message, "networkAttachmentUri")) if (!$util.isString(message.networkAttachmentUri)) return "networkAttachmentUri: string expected"; - if (message.pscAutoDnsEnabled != null && message.hasOwnProperty("pscAutoDnsEnabled")) { + if (message.pscAutoDnsEnabled != null && Object.hasOwnProperty.call(message, "pscAutoDnsEnabled")) { properties._pscAutoDnsEnabled = 1; if (typeof message.pscAutoDnsEnabled !== "boolean") return "pscAutoDnsEnabled: boolean expected"; } - if (message.pscWriteEndpointDnsEnabled != null && message.hasOwnProperty("pscWriteEndpointDnsEnabled")) { + if (message.pscWriteEndpointDnsEnabled != null && Object.hasOwnProperty.call(message, "pscWriteEndpointDnsEnabled")) { properties._pscWriteEndpointDnsEnabled = 1; if (typeof message.pscWriteEndpointDnsEnabled !== "boolean") return "pscWriteEndpointDnsEnabled: boolean expected"; @@ -13680,6 +14066,8 @@ PscConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PscConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PscConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -13699,7 +14087,7 @@ throw TypeError(".google.cloud.sql.v1.PscConfig.pscAutoConnections: array expected"); message.pscAutoConnections = []; for (var i = 0; i < object.pscAutoConnections.length; ++i) { - if (typeof object.pscAutoConnections[i] !== "object") + if (!$util.isObject(object.pscAutoConnections[i])) throw TypeError(".google.cloud.sql.v1.PscConfig.pscAutoConnections: object expected"); message.pscAutoConnections[i] = $root.google.cloud.sql.v1.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i], long + 1); } @@ -13722,9 +14110,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PscConfig.toObject = function toObject(message, options) { + PscConfig.toObject = function toObject(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.allowedConsumerProjects = []; @@ -13732,7 +14124,7 @@ } if (options.defaults) object.networkAttachmentUri = ""; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) { + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) { object.pscEnabled = message.pscEnabled; if (options.oneofs) object._pscEnabled = "pscEnabled"; @@ -13745,16 +14137,16 @@ if (message.pscAutoConnections && message.pscAutoConnections.length) { object.pscAutoConnections = []; for (var j = 0; j < message.pscAutoConnections.length; ++j) - object.pscAutoConnections[j] = $root.google.cloud.sql.v1.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); + object.pscAutoConnections[j] = $root.google.cloud.sql.v1.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options, q + 1); } - if (message.networkAttachmentUri != null && message.hasOwnProperty("networkAttachmentUri")) + if (message.networkAttachmentUri != null && Object.hasOwnProperty.call(message, "networkAttachmentUri")) object.networkAttachmentUri = message.networkAttachmentUri; - if (message.pscAutoDnsEnabled != null && message.hasOwnProperty("pscAutoDnsEnabled")) { + if (message.pscAutoDnsEnabled != null && Object.hasOwnProperty.call(message, "pscAutoDnsEnabled")) { object.pscAutoDnsEnabled = message.pscAutoDnsEnabled; if (options.oneofs) object._pscAutoDnsEnabled = "pscAutoDnsEnabled"; } - if (message.pscWriteEndpointDnsEnabled != null && message.hasOwnProperty("pscWriteEndpointDnsEnabled")) { + if (message.pscWriteEndpointDnsEnabled != null && Object.hasOwnProperty.call(message, "pscWriteEndpointDnsEnabled")) { object.pscWriteEndpointDnsEnabled = message.pscWriteEndpointDnsEnabled; if (options.oneofs) object._pscWriteEndpointDnsEnabled = "pscWriteEndpointDnsEnabled"; @@ -13901,9 +14293,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PscAutoConnectionConfig.encode = function encode(message, writer) { + PscAutoConnectionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) @@ -13927,7 +14323,7 @@ * @returns {$protobuf.Writer} Writer */ PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14014,23 +14410,23 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) if (!$util.isString(message.consumerProject)) return "consumerProject: string expected"; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) if (!$util.isString(message.consumerNetwork)) return "consumerNetwork: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) { properties._ipAddress = 1; if (!$util.isString(message.ipAddress)) return "ipAddress: string expected"; } - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { properties._status = 1; if (!$util.isString(message.status)) return "status: string expected"; } - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) { + if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) { properties._consumerNetworkStatus = 1; if (!$util.isString(message.consumerNetworkStatus)) return "consumerNetworkStatus: string expected"; @@ -14049,6 +14445,8 @@ PscAutoConnectionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PscAutoConnectionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PscAutoConnectionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14076,29 +14474,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PscAutoConnectionConfig.toObject = function toObject(message, options) { + PscAutoConnectionConfig.toObject = function toObject(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.consumerProject = ""; object.consumerNetwork = ""; } - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) object.consumerProject = message.consumerProject; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) object.consumerNetwork = message.consumerNetwork; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) { object.ipAddress = message.ipAddress; if (options.oneofs) object._ipAddress = "ipAddress"; } - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { object.status = message.status; if (options.oneofs) object._status = "status"; } - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) { + if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) { object.consumerNetworkStatus = message.consumerNetworkStatus; if (options.oneofs) object._consumerNetworkStatus = "consumerNetworkStatus"; @@ -14215,9 +14617,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocationPreference.encode = function encode(message, writer) { + LocationPreference.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.followGaeApplication != null && Object.hasOwnProperty.call(message, "followGaeApplication")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.followGaeApplication); if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) @@ -14239,7 +14645,7 @@ * @returns {$protobuf.Writer} Writer */ LocationPreference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14321,16 +14727,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.followGaeApplication != null && message.hasOwnProperty("followGaeApplication")) + if (message.followGaeApplication != null && Object.hasOwnProperty.call(message, "followGaeApplication")) if (!$util.isString(message.followGaeApplication)) return "followGaeApplication: string expected"; - if (message.zone != null && message.hasOwnProperty("zone")) + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) if (!$util.isString(message.zone)) return "zone: string expected"; - if (message.secondaryZone != null && message.hasOwnProperty("secondaryZone")) + if (message.secondaryZone != null && Object.hasOwnProperty.call(message, "secondaryZone")) if (!$util.isString(message.secondaryZone)) return "secondaryZone: string expected"; - 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"; return null; @@ -14347,6 +14753,8 @@ LocationPreference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.LocationPreference) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.LocationPreference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14372,9 +14780,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LocationPreference.toObject = function toObject(message, options) { + LocationPreference.toObject = function toObject(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.followGaeApplication = ""; @@ -14382,13 +14794,13 @@ object.kind = ""; object.secondaryZone = ""; } - if (message.followGaeApplication != null && message.hasOwnProperty("followGaeApplication")) + if (message.followGaeApplication != null && Object.hasOwnProperty.call(message, "followGaeApplication")) object.followGaeApplication = message.followGaeApplication; - if (message.zone != null && message.hasOwnProperty("zone")) + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) object.zone = message.zone; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.secondaryZone != null && message.hasOwnProperty("secondaryZone")) + if (message.secondaryZone != null && Object.hasOwnProperty.call(message, "secondaryZone")) object.secondaryZone = message.secondaryZone; return object; }; @@ -14502,13 +14914,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MaintenanceWindow.encode = function encode(message, writer) { + MaintenanceWindow.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) - $root.google.protobuf.Int32Value.encode(message.hour, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.hour, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.day != null && Object.hasOwnProperty.call(message, "day")) - $root.google.protobuf.Int32Value.encode(message.day, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.day, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.updateTrack != null && Object.hasOwnProperty.call(message, "updateTrack")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.updateTrack); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -14526,7 +14942,7 @@ * @returns {$protobuf.Writer} Writer */ MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14608,17 +15024,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.hour != null && message.hasOwnProperty("hour")) { + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) { var error = $root.google.protobuf.Int32Value.verify(message.hour, long + 1); if (error) return "hour." + error; } - if (message.day != null && message.hasOwnProperty("day")) { + if (message.day != null && Object.hasOwnProperty.call(message, "day")) { var error = $root.google.protobuf.Int32Value.verify(message.day, long + 1); if (error) return "day." + error; } - if (message.updateTrack != null && message.hasOwnProperty("updateTrack")) + if (message.updateTrack != null && Object.hasOwnProperty.call(message, "updateTrack")) switch (message.updateTrack) { default: return "updateTrack: enum value expected"; @@ -14628,7 +15044,7 @@ case 3: break; } - 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"; return null; @@ -14645,18 +15061,20 @@ MaintenanceWindow.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.MaintenanceWindow) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.MaintenanceWindow: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.MaintenanceWindow(); if (object.hour != null) { - if (typeof object.hour !== "object") + if (!$util.isObject(object.hour)) throw TypeError(".google.cloud.sql.v1.MaintenanceWindow.hour: object expected"); message.hour = $root.google.protobuf.Int32Value.fromObject(object.hour, long + 1); } if (object.day != null) { - if (typeof object.day !== "object") + if (!$util.isObject(object.day)) throw TypeError(".google.cloud.sql.v1.MaintenanceWindow.day: object expected"); message.day = $root.google.protobuf.Int32Value.fromObject(object.day, long + 1); } @@ -14698,9 +15116,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MaintenanceWindow.toObject = function toObject(message, options) { + MaintenanceWindow.toObject = function toObject(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.hour = null; @@ -14708,13 +15130,13 @@ object.updateTrack = options.enums === String ? "SQL_UPDATE_TRACK_UNSPECIFIED" : 0; object.kind = ""; } - if (message.hour != null && message.hasOwnProperty("hour")) - object.hour = $root.google.protobuf.Int32Value.toObject(message.hour, options); - if (message.day != null && message.hasOwnProperty("day")) - object.day = $root.google.protobuf.Int32Value.toObject(message.day, options); - if (message.updateTrack != null && message.hasOwnProperty("updateTrack")) + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) + object.hour = $root.google.protobuf.Int32Value.toObject(message.hour, options, q + 1); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + object.day = $root.google.protobuf.Int32Value.toObject(message.day, options, q + 1); + if (message.updateTrack != null && Object.hasOwnProperty.call(message, "updateTrack")) object.updateTrack = options.enums === String ? $root.google.cloud.sql.v1.SqlUpdateTrack[message.updateTrack] === undefined ? message.updateTrack : $root.google.cloud.sql.v1.SqlUpdateTrack[message.updateTrack] : message.updateTrack; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -14819,9 +15241,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DenyMaintenancePeriod.encode = function encode(message, writer) { + DenyMaintenancePeriod.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.startDate); if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) @@ -14841,7 +15267,7 @@ * @returns {$protobuf.Writer} Writer */ DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -14919,13 +15345,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.startDate != null && message.hasOwnProperty("startDate")) + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) if (!$util.isString(message.startDate)) return "startDate: string expected"; - if (message.endDate != null && message.hasOwnProperty("endDate")) + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) if (!$util.isString(message.endDate)) return "endDate: string expected"; - if (message.time != null && message.hasOwnProperty("time")) + if (message.time != null && Object.hasOwnProperty.call(message, "time")) if (!$util.isString(message.time)) return "time: string expected"; return null; @@ -14942,6 +15368,8 @@ DenyMaintenancePeriod.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DenyMaintenancePeriod) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DenyMaintenancePeriod: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -14965,20 +15393,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DenyMaintenancePeriod.toObject = function toObject(message, options) { + DenyMaintenancePeriod.toObject = function toObject(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.startDate = ""; object.endDate = ""; object.time = ""; } - if (message.startDate != null && message.hasOwnProperty("startDate")) + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) object.startDate = message.startDate; - if (message.endDate != null && message.hasOwnProperty("endDate")) + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) object.endDate = message.endDate; - if (message.time != null && message.hasOwnProperty("time")) + if (message.time != null && Object.hasOwnProperty.call(message, "time")) object.time = message.time; return object; }; @@ -15110,9 +15542,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InsightsConfig.encode = function encode(message, writer) { + InsightsConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.queryInsightsEnabled != null && Object.hasOwnProperty.call(message, "queryInsightsEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.queryInsightsEnabled); if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) @@ -15120,11 +15556,11 @@ if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordApplicationTags); if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - $root.google.protobuf.Int32Value.encode(message.queryStringLength, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.queryStringLength, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - $root.google.protobuf.Int32Value.encode(message.queryPlansPerMinute, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.queryPlansPerMinute, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.enhancedQueryInsightsEnabled != null && Object.hasOwnProperty.call(message, "enhancedQueryInsightsEnabled")) - $root.google.protobuf.BoolValue.encode(message.enhancedQueryInsightsEnabled, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enhancedQueryInsightsEnabled, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -15138,7 +15574,7 @@ * @returns {$protobuf.Writer} Writer */ InsightsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -15228,26 +15664,26 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.queryInsightsEnabled != null && message.hasOwnProperty("queryInsightsEnabled")) + if (message.queryInsightsEnabled != null && Object.hasOwnProperty.call(message, "queryInsightsEnabled")) if (typeof message.queryInsightsEnabled !== "boolean") return "queryInsightsEnabled: boolean expected"; - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) if (typeof message.recordClientAddress !== "boolean") return "recordClientAddress: boolean expected"; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) if (typeof message.recordApplicationTags !== "boolean") return "recordApplicationTags: boolean expected"; - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) { + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) { var error = $root.google.protobuf.Int32Value.verify(message.queryStringLength, long + 1); if (error) return "queryStringLength." + error; } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) { var error = $root.google.protobuf.Int32Value.verify(message.queryPlansPerMinute, long + 1); if (error) return "queryPlansPerMinute." + error; } - if (message.enhancedQueryInsightsEnabled != null && message.hasOwnProperty("enhancedQueryInsightsEnabled")) { + if (message.enhancedQueryInsightsEnabled != null && Object.hasOwnProperty.call(message, "enhancedQueryInsightsEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.enhancedQueryInsightsEnabled, long + 1); if (error) return "enhancedQueryInsightsEnabled." + error; @@ -15266,6 +15702,8 @@ InsightsConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InsightsConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InsightsConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15278,17 +15716,17 @@ if (object.recordApplicationTags != null) message.recordApplicationTags = Boolean(object.recordApplicationTags); if (object.queryStringLength != null) { - if (typeof object.queryStringLength !== "object") + if (!$util.isObject(object.queryStringLength)) throw TypeError(".google.cloud.sql.v1.InsightsConfig.queryStringLength: object expected"); message.queryStringLength = $root.google.protobuf.Int32Value.fromObject(object.queryStringLength, long + 1); } if (object.queryPlansPerMinute != null) { - if (typeof object.queryPlansPerMinute !== "object") + if (!$util.isObject(object.queryPlansPerMinute)) throw TypeError(".google.cloud.sql.v1.InsightsConfig.queryPlansPerMinute: object expected"); message.queryPlansPerMinute = $root.google.protobuf.Int32Value.fromObject(object.queryPlansPerMinute, long + 1); } if (object.enhancedQueryInsightsEnabled != null) { - if (typeof object.enhancedQueryInsightsEnabled !== "object") + if (!$util.isObject(object.enhancedQueryInsightsEnabled)) throw TypeError(".google.cloud.sql.v1.InsightsConfig.enhancedQueryInsightsEnabled: object expected"); message.enhancedQueryInsightsEnabled = $root.google.protobuf.BoolValue.fromObject(object.enhancedQueryInsightsEnabled, long + 1); } @@ -15304,9 +15742,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InsightsConfig.toObject = function toObject(message, options) { + InsightsConfig.toObject = function toObject(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.queryInsightsEnabled = false; @@ -15316,18 +15758,18 @@ object.queryPlansPerMinute = null; object.enhancedQueryInsightsEnabled = null; } - if (message.queryInsightsEnabled != null && message.hasOwnProperty("queryInsightsEnabled")) + if (message.queryInsightsEnabled != null && Object.hasOwnProperty.call(message, "queryInsightsEnabled")) object.queryInsightsEnabled = message.queryInsightsEnabled; - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) object.recordClientAddress = message.recordClientAddress; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) object.recordApplicationTags = message.recordApplicationTags; - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = $root.google.protobuf.Int32Value.toObject(message.queryStringLength, options); - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) - object.queryPlansPerMinute = $root.google.protobuf.Int32Value.toObject(message.queryPlansPerMinute, options); - if (message.enhancedQueryInsightsEnabled != null && message.hasOwnProperty("enhancedQueryInsightsEnabled")) - object.enhancedQueryInsightsEnabled = $root.google.protobuf.BoolValue.toObject(message.enhancedQueryInsightsEnabled, options); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + object.queryStringLength = $root.google.protobuf.Int32Value.toObject(message.queryStringLength, options, q + 1); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + object.queryPlansPerMinute = $root.google.protobuf.Int32Value.toObject(message.queryPlansPerMinute, options, q + 1); + if (message.enhancedQueryInsightsEnabled != null && Object.hasOwnProperty.call(message, "enhancedQueryInsightsEnabled")) + object.enhancedQueryInsightsEnabled = $root.google.protobuf.BoolValue.toObject(message.enhancedQueryInsightsEnabled, options, q + 1); return object; }; @@ -15503,9 +15945,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MySqlReplicaConfiguration.encode = function encode(message, writer) { + MySqlReplicaConfiguration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dumpFilePath); if (message.username != null && Object.hasOwnProperty.call(message, "username")) @@ -15513,9 +15959,9 @@ if (message.password != null && Object.hasOwnProperty.call(message, "password")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.password); if (message.connectRetryInterval != null && Object.hasOwnProperty.call(message, "connectRetryInterval")) - $root.google.protobuf.Int32Value.encode(message.connectRetryInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.connectRetryInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.masterHeartbeatPeriod != null && Object.hasOwnProperty.call(message, "masterHeartbeatPeriod")) - $root.google.protobuf.Int64Value.encode(message.masterHeartbeatPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.masterHeartbeatPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.caCertificate); if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) @@ -15525,7 +15971,7 @@ if (message.sslCipher != null && Object.hasOwnProperty.call(message, "sslCipher")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.sslCipher); if (message.verifyServerCertificate != null && Object.hasOwnProperty.call(message, "verifyServerCertificate")) - $root.google.protobuf.BoolValue.encode(message.verifyServerCertificate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.verifyServerCertificate, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.kind); return writer; @@ -15541,7 +15987,7 @@ * @returns {$protobuf.Writer} Writer */ MySqlReplicaConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -15651,43 +16097,43 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) if (!$util.isString(message.dumpFilePath)) return "dumpFilePath: string expected"; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) if (!$util.isString(message.username)) return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: string expected"; - if (message.connectRetryInterval != null && message.hasOwnProperty("connectRetryInterval")) { + if (message.connectRetryInterval != null && Object.hasOwnProperty.call(message, "connectRetryInterval")) { var error = $root.google.protobuf.Int32Value.verify(message.connectRetryInterval, long + 1); if (error) return "connectRetryInterval." + error; } - if (message.masterHeartbeatPeriod != null && message.hasOwnProperty("masterHeartbeatPeriod")) { + if (message.masterHeartbeatPeriod != null && Object.hasOwnProperty.call(message, "masterHeartbeatPeriod")) { var error = $root.google.protobuf.Int64Value.verify(message.masterHeartbeatPeriod, long + 1); if (error) return "masterHeartbeatPeriod." + error; } - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) if (!$util.isString(message.caCertificate)) return "caCertificate: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) if (!$util.isString(message.clientCertificate)) return "clientCertificate: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) if (!$util.isString(message.clientKey)) return "clientKey: string expected"; - if (message.sslCipher != null && message.hasOwnProperty("sslCipher")) + if (message.sslCipher != null && Object.hasOwnProperty.call(message, "sslCipher")) if (!$util.isString(message.sslCipher)) return "sslCipher: string expected"; - if (message.verifyServerCertificate != null && message.hasOwnProperty("verifyServerCertificate")) { + if (message.verifyServerCertificate != null && Object.hasOwnProperty.call(message, "verifyServerCertificate")) { var error = $root.google.protobuf.BoolValue.verify(message.verifyServerCertificate, long + 1); if (error) return "verifyServerCertificate." + error; } - 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"; return null; @@ -15704,6 +16150,8 @@ MySqlReplicaConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.MySqlReplicaConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.MySqlReplicaConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -15716,12 +16164,12 @@ if (object.password != null) message.password = String(object.password); if (object.connectRetryInterval != null) { - if (typeof object.connectRetryInterval !== "object") + if (!$util.isObject(object.connectRetryInterval)) throw TypeError(".google.cloud.sql.v1.MySqlReplicaConfiguration.connectRetryInterval: object expected"); message.connectRetryInterval = $root.google.protobuf.Int32Value.fromObject(object.connectRetryInterval, long + 1); } if (object.masterHeartbeatPeriod != null) { - if (typeof object.masterHeartbeatPeriod !== "object") + if (!$util.isObject(object.masterHeartbeatPeriod)) throw TypeError(".google.cloud.sql.v1.MySqlReplicaConfiguration.masterHeartbeatPeriod: object expected"); message.masterHeartbeatPeriod = $root.google.protobuf.Int64Value.fromObject(object.masterHeartbeatPeriod, long + 1); } @@ -15734,7 +16182,7 @@ if (object.sslCipher != null) message.sslCipher = String(object.sslCipher); if (object.verifyServerCertificate != null) { - if (typeof object.verifyServerCertificate !== "object") + if (!$util.isObject(object.verifyServerCertificate)) throw TypeError(".google.cloud.sql.v1.MySqlReplicaConfiguration.verifyServerCertificate: object expected"); message.verifyServerCertificate = $root.google.protobuf.BoolValue.fromObject(object.verifyServerCertificate, long + 1); } @@ -15752,9 +16200,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MySqlReplicaConfiguration.toObject = function toObject(message, options) { + MySqlReplicaConfiguration.toObject = function toObject(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.dumpFilePath = ""; @@ -15769,27 +16221,27 @@ object.verifyServerCertificate = null; object.kind = ""; } - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) object.dumpFilePath = message.dumpFilePath; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.connectRetryInterval != null && message.hasOwnProperty("connectRetryInterval")) - object.connectRetryInterval = $root.google.protobuf.Int32Value.toObject(message.connectRetryInterval, options); - if (message.masterHeartbeatPeriod != null && message.hasOwnProperty("masterHeartbeatPeriod")) - object.masterHeartbeatPeriod = $root.google.protobuf.Int64Value.toObject(message.masterHeartbeatPeriod, options); - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.connectRetryInterval != null && Object.hasOwnProperty.call(message, "connectRetryInterval")) + object.connectRetryInterval = $root.google.protobuf.Int32Value.toObject(message.connectRetryInterval, options, q + 1); + if (message.masterHeartbeatPeriod != null && Object.hasOwnProperty.call(message, "masterHeartbeatPeriod")) + object.masterHeartbeatPeriod = $root.google.protobuf.Int64Value.toObject(message.masterHeartbeatPeriod, options, q + 1); + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) object.caCertificate = message.caCertificate; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) object.clientCertificate = message.clientCertificate; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) object.clientKey = message.clientKey; - if (message.sslCipher != null && message.hasOwnProperty("sslCipher")) + if (message.sslCipher != null && Object.hasOwnProperty.call(message, "sslCipher")) object.sslCipher = message.sslCipher; - if (message.verifyServerCertificate != null && message.hasOwnProperty("verifyServerCertificate")) - object.verifyServerCertificate = $root.google.protobuf.BoolValue.toObject(message.verifyServerCertificate, options); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.verifyServerCertificate != null && Object.hasOwnProperty.call(message, "verifyServerCertificate")) + object.verifyServerCertificate = $root.google.protobuf.BoolValue.toObject(message.verifyServerCertificate, options, q + 1); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -15885,9 +16337,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiskEncryptionConfiguration.encode = function encode(message, writer) { + DiskEncryptionConfiguration.encode = function encode(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 1, wireType 2 =*/10).string(message.kmsKeyName); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -15905,7 +16361,7 @@ * @returns {$protobuf.Writer} Writer */ DiskEncryptionConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -15979,10 +16435,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.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) if (!$util.isString(message.kind)) return "kind: string expected"; return null; @@ -15999,6 +16455,8 @@ DiskEncryptionConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DiskEncryptionConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DiskEncryptionConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16020,17 +16478,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DiskEncryptionConfiguration.toObject = function toObject(message, options) { + DiskEncryptionConfiguration.toObject = function toObject(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.kmsKeyName = ""; object.kind = ""; } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) object.kmsKeyName = message.kmsKeyName; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -16126,9 +16588,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiskEncryptionStatus.encode = function encode(message, writer) { + DiskEncryptionStatus.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyVersionName); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -16146,7 +16612,7 @@ * @returns {$protobuf.Writer} Writer */ DiskEncryptionStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -16220,10 +16686,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) if (!$util.isString(message.kmsKeyVersionName)) return "kmsKeyVersionName: string expected"; - 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"; return null; @@ -16240,6 +16706,8 @@ DiskEncryptionStatus.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DiskEncryptionStatus) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DiskEncryptionStatus: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16261,17 +16729,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DiskEncryptionStatus.toObject = function toObject(message, options) { + DiskEncryptionStatus.toObject = function toObject(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.kmsKeyVersionName = ""; object.kind = ""; } - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) object.kmsKeyVersionName = message.kmsKeyVersionName; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -16376,15 +16848,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IpMapping.encode = function encode(message, writer) { + IpMapping.encode = function encode(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 0 =*/8).int32(message.type); if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); if (message.timeToRetire != null && Object.hasOwnProperty.call(message, "timeToRetire")) - $root.google.protobuf.Timestamp.encode(message.timeToRetire, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.timeToRetire, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -16398,7 +16874,7 @@ * @returns {$protobuf.Writer} Writer */ IpMapping.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -16476,7 +16952,7 @@ 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")) switch (message.type) { default: return "type: enum value expected"; @@ -16487,10 +16963,10 @@ case 4: break; } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) if (!$util.isString(message.ipAddress)) return "ipAddress: string expected"; - if (message.timeToRetire != null && message.hasOwnProperty("timeToRetire")) { + if (message.timeToRetire != null && Object.hasOwnProperty.call(message, "timeToRetire")) { var error = $root.google.protobuf.Timestamp.verify(message.timeToRetire, long + 1); if (error) return "timeToRetire." + error; @@ -16509,6 +16985,8 @@ IpMapping.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.IpMapping) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.IpMapping: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16545,7 +17023,7 @@ if (object.ipAddress != null) message.ipAddress = String(object.ipAddress); if (object.timeToRetire != null) { - if (typeof object.timeToRetire !== "object") + if (!$util.isObject(object.timeToRetire)) throw TypeError(".google.cloud.sql.v1.IpMapping.timeToRetire: object expected"); message.timeToRetire = $root.google.protobuf.Timestamp.fromObject(object.timeToRetire, long + 1); } @@ -16561,21 +17039,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IpMapping.toObject = function toObject(message, options) { + IpMapping.toObject = function toObject(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 = options.enums === String ? "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" : 0; object.ipAddress = ""; object.timeToRetire = null; } - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1.SqlIpAddressType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1.SqlIpAddressType[message.type] : message.type; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) object.ipAddress = message.ipAddress; - if (message.timeToRetire != null && message.hasOwnProperty("timeToRetire")) - object.timeToRetire = $root.google.protobuf.Timestamp.toObject(message.timeToRetire, options); + if (message.timeToRetire != null && Object.hasOwnProperty.call(message, "timeToRetire")) + object.timeToRetire = $root.google.protobuf.Timestamp.toObject(message.timeToRetire, options, q + 1); return object; }; @@ -16695,9 +17177,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSubOperationType.encode = function encode(message, writer) { + SqlSubOperationType.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.maintenanceType != null && Object.hasOwnProperty.call(message, "maintenanceType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maintenanceType); return writer; @@ -16713,7 +17199,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSubOperationType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -16784,7 +17270,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.maintenanceType != null && message.hasOwnProperty("maintenanceType")) { + if (message.maintenanceType != null && Object.hasOwnProperty.call(message, "maintenanceType")) { properties.subOperationDetails = 1; switch (message.maintenanceType) { default: @@ -16811,6 +17297,8 @@ SqlSubOperationType.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlSubOperationType) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlSubOperationType: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -16856,11 +17344,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSubOperationType.toObject = function toObject(message, options) { + SqlSubOperationType.toObject = function 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.maintenanceType != null && message.hasOwnProperty("maintenanceType")) { + if (message.maintenanceType != null && Object.hasOwnProperty.call(message, "maintenanceType")) { object.maintenanceType = options.enums === String ? $root.google.cloud.sql.v1.SqlMaintenanceType[message.maintenanceType] === undefined ? message.maintenanceType : $root.google.cloud.sql.v1.SqlMaintenanceType[message.maintenanceType] : message.maintenanceType; if (options.oneofs) object.subOperationDetails = "maintenanceType"; @@ -17121,9 +17613,13 @@ * @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.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.targetLink != null && Object.hasOwnProperty.call(message, "targetLink")) @@ -17133,19 +17629,19 @@ if (message.user != null && Object.hasOwnProperty.call(message, "user")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.user); if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) - $root.google.protobuf.Timestamp.encode(message.insertTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.insertTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.sql.v1.OperationErrors.encode(message.error, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1.OperationErrors.encode(message.error, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.operationType); if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) - $root.google.cloud.sql.v1.ImportContext.encode(message.importContext, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.encode(message.importContext, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) - $root.google.cloud.sql.v1.ExportContext.encode(message.exportContext, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.encode(message.exportContext, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) @@ -17155,15 +17651,15 @@ if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) writer.uint32(/* id 15, wireType 2 =*/122).string(message.targetProject); if (message.backupContext != null && Object.hasOwnProperty.call(message, "backupContext")) - $root.google.cloud.sql.v1.BackupContext.encode(message.backupContext, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1.BackupContext.encode(message.backupContext, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.apiWarning != null && Object.hasOwnProperty.call(message, "apiWarning")) - $root.google.cloud.sql.v1.ApiWarning.encode(message.apiWarning, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + $root.google.cloud.sql.v1.ApiWarning.encode(message.apiWarning, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) - $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); if (message.subOperationType != null && Object.hasOwnProperty.call(message, "subOperationType")) - $root.google.cloud.sql.v1.SqlSubOperationType.encode(message.subOperationType, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlSubOperationType.encode(message.subOperationType, writer.uint32(/* id 48, wireType 2 =*/386).fork(), q + 1).ldelim(); if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) - $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); return writer; }; @@ -17177,7 +17673,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(); }; /** @@ -17323,13 +17819,13 @@ 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.targetLink != null && message.hasOwnProperty("targetLink")) + if (message.targetLink != null && Object.hasOwnProperty.call(message, "targetLink")) if (!$util.isString(message.targetLink)) return "targetLink: string expected"; - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) switch (message.status) { default: return "status: enum value expected"; @@ -17339,35 +17835,35 @@ case 3: break; } - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) if (!$util.isString(message.user)) return "user: string expected"; - if (message.insertTime != null && message.hasOwnProperty("insertTime")) { + if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) { var error = $root.google.protobuf.Timestamp.verify(message.insertTime, long + 1); if (error) return "insertTime." + 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.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.error != null && message.hasOwnProperty("error")) { + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { var error = $root.google.cloud.sql.v1.OperationErrors.verify(message.error, long + 1); if (error) return "error." + error; } - if (message.apiWarning != null && message.hasOwnProperty("apiWarning")) { + if (message.apiWarning != null && Object.hasOwnProperty.call(message, "apiWarning")) { var error = $root.google.cloud.sql.v1.ApiWarning.verify(message.apiWarning, long + 1); if (error) return "apiWarning." + error; } - if (message.operationType != null && message.hasOwnProperty("operationType")) + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) switch (message.operationType) { default: return "operationType: enum value expected"; @@ -17426,44 +17922,44 @@ case 54: break; } - if (message.importContext != null && message.hasOwnProperty("importContext")) { + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) { var error = $root.google.cloud.sql.v1.ImportContext.verify(message.importContext, long + 1); if (error) return "importContext." + error; } - if (message.exportContext != null && message.hasOwnProperty("exportContext")) { + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) { var error = $root.google.cloud.sql.v1.ExportContext.verify(message.exportContext, long + 1); if (error) return "exportContext." + error; } - if (message.backupContext != null && message.hasOwnProperty("backupContext")) { + if (message.backupContext != null && Object.hasOwnProperty.call(message, "backupContext")) { var error = $root.google.cloud.sql.v1.BackupContext.verify(message.backupContext, long + 1); if (error) return "backupContext." + error; } - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) { + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) { var error = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.verify(message.preCheckMajorVersionUpgradeContext, long + 1); if (error) return "preCheckMajorVersionUpgradeContext." + 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.targetId != null && message.hasOwnProperty("targetId")) + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) if (!$util.isString(message.targetId)) return "targetId: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; - if (message.targetProject != null && message.hasOwnProperty("targetProject")) + if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) if (!$util.isString(message.targetProject)) return "targetProject: string expected"; - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) { + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) { var error = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.verify(message.acquireSsrsLeaseContext, long + 1); if (error) return "acquireSsrsLeaseContext." + error; } - if (message.subOperationType != null && message.hasOwnProperty("subOperationType")) { + if (message.subOperationType != null && Object.hasOwnProperty.call(message, "subOperationType")) { var error = $root.google.cloud.sql.v1.SqlSubOperationType.verify(message.subOperationType, long + 1); if (error) return "subOperationType." + error; @@ -17482,6 +17978,8 @@ Operation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Operation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Operation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -17518,27 +18016,27 @@ if (object.user != null) message.user = String(object.user); if (object.insertTime != null) { - if (typeof object.insertTime !== "object") + if (!$util.isObject(object.insertTime)) throw TypeError(".google.cloud.sql.v1.Operation.insertTime: object expected"); message.insertTime = $root.google.protobuf.Timestamp.fromObject(object.insertTime, long + 1); } if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.cloud.sql.v1.Operation.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.cloud.sql.v1.Operation.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } if (object.error != null) { - if (typeof object.error !== "object") + if (!$util.isObject(object.error)) throw TypeError(".google.cloud.sql.v1.Operation.error: object expected"); message.error = $root.google.cloud.sql.v1.OperationErrors.fromObject(object.error, long + 1); } if (object.apiWarning != null) { - if (typeof object.apiWarning !== "object") + if (!$util.isObject(object.apiWarning)) throw TypeError(".google.cloud.sql.v1.Operation.apiWarning: object expected"); message.apiWarning = $root.google.cloud.sql.v1.ApiWarning.fromObject(object.apiWarning, long + 1); } @@ -17763,22 +18261,22 @@ break; } if (object.importContext != null) { - if (typeof object.importContext !== "object") + if (!$util.isObject(object.importContext)) throw TypeError(".google.cloud.sql.v1.Operation.importContext: object expected"); message.importContext = $root.google.cloud.sql.v1.ImportContext.fromObject(object.importContext, long + 1); } if (object.exportContext != null) { - if (typeof object.exportContext !== "object") + if (!$util.isObject(object.exportContext)) throw TypeError(".google.cloud.sql.v1.Operation.exportContext: object expected"); message.exportContext = $root.google.cloud.sql.v1.ExportContext.fromObject(object.exportContext, long + 1); } if (object.backupContext != null) { - if (typeof object.backupContext !== "object") + if (!$util.isObject(object.backupContext)) throw TypeError(".google.cloud.sql.v1.Operation.backupContext: object expected"); message.backupContext = $root.google.cloud.sql.v1.BackupContext.fromObject(object.backupContext, long + 1); } if (object.preCheckMajorVersionUpgradeContext != null) { - if (typeof object.preCheckMajorVersionUpgradeContext !== "object") + if (!$util.isObject(object.preCheckMajorVersionUpgradeContext)) throw TypeError(".google.cloud.sql.v1.Operation.preCheckMajorVersionUpgradeContext: object expected"); message.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.fromObject(object.preCheckMajorVersionUpgradeContext, long + 1); } @@ -17791,12 +18289,12 @@ if (object.targetProject != null) message.targetProject = String(object.targetProject); if (object.acquireSsrsLeaseContext != null) { - if (typeof object.acquireSsrsLeaseContext !== "object") + if (!$util.isObject(object.acquireSsrsLeaseContext)) throw TypeError(".google.cloud.sql.v1.Operation.acquireSsrsLeaseContext: object expected"); message.acquireSsrsLeaseContext = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.fromObject(object.acquireSsrsLeaseContext, long + 1); } if (object.subOperationType != null) { - if (typeof object.subOperationType !== "object") + if (!$util.isObject(object.subOperationType)) throw TypeError(".google.cloud.sql.v1.Operation.subOperationType: object expected"); message.subOperationType = $root.google.cloud.sql.v1.SqlSubOperationType.fromObject(object.subOperationType, long + 1); } @@ -17812,9 +18310,13 @@ * @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.kind = ""; @@ -17838,46 +18340,46 @@ object.subOperationType = null; object.preCheckMajorVersionUpgradeContext = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.targetLink != null && message.hasOwnProperty("targetLink")) + if (message.targetLink != null && Object.hasOwnProperty.call(message, "targetLink")) object.targetLink = message.targetLink; - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) object.status = options.enums === String ? $root.google.cloud.sql.v1.Operation.SqlOperationStatus[message.status] === undefined ? message.status : $root.google.cloud.sql.v1.Operation.SqlOperationStatus[message.status] : message.status; - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) object.user = message.user; - if (message.insertTime != null && message.hasOwnProperty("insertTime")) - object.insertTime = $root.google.protobuf.Timestamp.toObject(message.insertTime, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.cloud.sql.v1.OperationErrors.toObject(message.error, options); - if (message.operationType != null && message.hasOwnProperty("operationType")) + if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) + object.insertTime = $root.google.protobuf.Timestamp.toObject(message.insertTime, 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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + object.error = $root.google.cloud.sql.v1.OperationErrors.toObject(message.error, options, q + 1); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) object.operationType = options.enums === String ? $root.google.cloud.sql.v1.Operation.SqlOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.sql.v1.Operation.SqlOperationType[message.operationType] : message.operationType; - if (message.importContext != null && message.hasOwnProperty("importContext")) - object.importContext = $root.google.cloud.sql.v1.ImportContext.toObject(message.importContext, options); - if (message.exportContext != null && message.hasOwnProperty("exportContext")) - object.exportContext = $root.google.cloud.sql.v1.ExportContext.toObject(message.exportContext, options); - if (message.name != null && message.hasOwnProperty("name")) + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) + object.importContext = $root.google.cloud.sql.v1.ImportContext.toObject(message.importContext, options, q + 1); + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) + object.exportContext = $root.google.cloud.sql.v1.ExportContext.toObject(message.exportContext, options, q + 1); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.targetId != null && message.hasOwnProperty("targetId")) + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) object.targetId = message.targetId; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.targetProject != null && message.hasOwnProperty("targetProject")) + if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) object.targetProject = message.targetProject; - if (message.backupContext != null && message.hasOwnProperty("backupContext")) - object.backupContext = $root.google.cloud.sql.v1.BackupContext.toObject(message.backupContext, options); - if (message.apiWarning != null && message.hasOwnProperty("apiWarning")) - object.apiWarning = $root.google.cloud.sql.v1.ApiWarning.toObject(message.apiWarning, options); - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) - object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options); - if (message.subOperationType != null && message.hasOwnProperty("subOperationType")) - object.subOperationType = $root.google.cloud.sql.v1.SqlSubOperationType.toObject(message.subOperationType, options); - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) - object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options); + if (message.backupContext != null && Object.hasOwnProperty.call(message, "backupContext")) + object.backupContext = $root.google.cloud.sql.v1.BackupContext.toObject(message.backupContext, options, q + 1); + if (message.apiWarning != null && Object.hasOwnProperty.call(message, "apiWarning")) + object.apiWarning = $root.google.cloud.sql.v1.ApiWarning.toObject(message.apiWarning, options, q + 1); + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) + object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options, q + 1); + if (message.subOperationType != null && Object.hasOwnProperty.call(message, "subOperationType")) + object.subOperationType = $root.google.cloud.sql.v1.SqlSubOperationType.toObject(message.subOperationType, options, q + 1); + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) + object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options, q + 1); return object; }; @@ -18115,9 +18617,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationError.encode = function encode(message, writer) { + OperationError.encode = function encode(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.code != null && Object.hasOwnProperty.call(message, "code")) @@ -18137,7 +18643,7 @@ * @returns {$protobuf.Writer} Writer */ OperationError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -18215,13 +18721,13 @@ 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.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) if (!$util.isString(message.code)) return "code: 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; @@ -18238,6 +18744,8 @@ OperationError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.OperationError) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.OperationError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18261,20 +18769,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationError.toObject = function toObject(message, options) { + OperationError.toObject = function toObject(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.code = ""; object.message = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - 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; return object; }; @@ -18371,14 +18883,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationErrors.encode = function encode(message, writer) { + OperationErrors.encode = function encode(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.errors != null && message.errors.length) for (var i = 0; i < message.errors.length; ++i) - $root.google.cloud.sql.v1.OperationError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.OperationError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -18392,7 +18908,7 @@ * @returns {$protobuf.Writer} Writer */ OperationErrors.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -18468,10 +18984,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.errors != null && message.hasOwnProperty("errors")) { + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { if (!Array.isArray(message.errors)) return "errors: array expected"; for (var i = 0; i < message.errors.length; ++i) { @@ -18494,6 +19010,8 @@ OperationErrors.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.OperationErrors) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.OperationErrors: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -18506,7 +19024,7 @@ throw TypeError(".google.cloud.sql.v1.OperationErrors.errors: array expected"); message.errors = []; for (var i = 0; i < object.errors.length; ++i) { - if (typeof object.errors[i] !== "object") + if (!$util.isObject(object.errors[i])) throw TypeError(".google.cloud.sql.v1.OperationErrors.errors: object expected"); message.errors[i] = $root.google.cloud.sql.v1.OperationError.fromObject(object.errors[i], long + 1); } @@ -18523,20 +19041,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationErrors.toObject = function toObject(message, options) { + OperationErrors.toObject = function toObject(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.errors = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.errors && message.errors.length) { object.errors = []; for (var j = 0; j < message.errors.length; ++j) - object.errors[j] = $root.google.cloud.sql.v1.OperationError.toObject(message.errors[j], options); + object.errors[j] = $root.google.cloud.sql.v1.OperationError.toObject(message.errors[j], options, q + 1); } return object; }; @@ -18677,23 +19199,27 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PasswordValidationPolicy.encode = function encode(message, writer) { + PasswordValidationPolicy.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.minLength != null && Object.hasOwnProperty.call(message, "minLength")) - $root.google.protobuf.Int32Value.encode(message.minLength, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.minLength, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.complexity != null && Object.hasOwnProperty.call(message, "complexity")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.complexity); if (message.reuseInterval != null && Object.hasOwnProperty.call(message, "reuseInterval")) - $root.google.protobuf.Int32Value.encode(message.reuseInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.reuseInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.disallowUsernameSubstring != null && Object.hasOwnProperty.call(message, "disallowUsernameSubstring")) - $root.google.protobuf.BoolValue.encode(message.disallowUsernameSubstring, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.disallowUsernameSubstring, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.passwordChangeInterval != null && Object.hasOwnProperty.call(message, "passwordChangeInterval")) - $root.google.protobuf.Duration.encode(message.passwordChangeInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.passwordChangeInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.enablePasswordPolicy != null && Object.hasOwnProperty.call(message, "enablePasswordPolicy")) - $root.google.protobuf.BoolValue.encode(message.enablePasswordPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enablePasswordPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.disallowCompromisedCredentials != null && Object.hasOwnProperty.call(message, "disallowCompromisedCredentials")) - $root.google.protobuf.BoolValue.encode(message.disallowCompromisedCredentials, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.disallowCompromisedCredentials, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -18707,7 +19233,7 @@ * @returns {$protobuf.Writer} Writer */ PasswordValidationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -18801,12 +19327,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.minLength != null && message.hasOwnProperty("minLength")) { + if (message.minLength != null && Object.hasOwnProperty.call(message, "minLength")) { var error = $root.google.protobuf.Int32Value.verify(message.minLength, long + 1); if (error) return "minLength." + error; } - if (message.complexity != null && message.hasOwnProperty("complexity")) + if (message.complexity != null && Object.hasOwnProperty.call(message, "complexity")) switch (message.complexity) { default: return "complexity: enum value expected"; @@ -18814,27 +19340,27 @@ case 1: break; } - if (message.reuseInterval != null && message.hasOwnProperty("reuseInterval")) { + if (message.reuseInterval != null && Object.hasOwnProperty.call(message, "reuseInterval")) { var error = $root.google.protobuf.Int32Value.verify(message.reuseInterval, long + 1); if (error) return "reuseInterval." + error; } - if (message.disallowUsernameSubstring != null && message.hasOwnProperty("disallowUsernameSubstring")) { + if (message.disallowUsernameSubstring != null && Object.hasOwnProperty.call(message, "disallowUsernameSubstring")) { var error = $root.google.protobuf.BoolValue.verify(message.disallowUsernameSubstring, long + 1); if (error) return "disallowUsernameSubstring." + error; } - if (message.passwordChangeInterval != null && message.hasOwnProperty("passwordChangeInterval")) { + if (message.passwordChangeInterval != null && Object.hasOwnProperty.call(message, "passwordChangeInterval")) { var error = $root.google.protobuf.Duration.verify(message.passwordChangeInterval, long + 1); if (error) return "passwordChangeInterval." + error; } - if (message.enablePasswordPolicy != null && message.hasOwnProperty("enablePasswordPolicy")) { + if (message.enablePasswordPolicy != null && Object.hasOwnProperty.call(message, "enablePasswordPolicy")) { var error = $root.google.protobuf.BoolValue.verify(message.enablePasswordPolicy, long + 1); if (error) return "enablePasswordPolicy." + error; } - if (message.disallowCompromisedCredentials != null && message.hasOwnProperty("disallowCompromisedCredentials")) { + if (message.disallowCompromisedCredentials != null && Object.hasOwnProperty.call(message, "disallowCompromisedCredentials")) { var error = $root.google.protobuf.BoolValue.verify(message.disallowCompromisedCredentials, long + 1); if (error) return "disallowCompromisedCredentials." + error; @@ -18853,13 +19379,15 @@ PasswordValidationPolicy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PasswordValidationPolicy) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PasswordValidationPolicy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.PasswordValidationPolicy(); if (object.minLength != null) { - if (typeof object.minLength !== "object") + if (!$util.isObject(object.minLength)) throw TypeError(".google.cloud.sql.v1.PasswordValidationPolicy.minLength: object expected"); message.minLength = $root.google.protobuf.Int32Value.fromObject(object.minLength, long + 1); } @@ -18880,27 +19408,27 @@ break; } if (object.reuseInterval != null) { - if (typeof object.reuseInterval !== "object") + if (!$util.isObject(object.reuseInterval)) throw TypeError(".google.cloud.sql.v1.PasswordValidationPolicy.reuseInterval: object expected"); message.reuseInterval = $root.google.protobuf.Int32Value.fromObject(object.reuseInterval, long + 1); } if (object.disallowUsernameSubstring != null) { - if (typeof object.disallowUsernameSubstring !== "object") + if (!$util.isObject(object.disallowUsernameSubstring)) throw TypeError(".google.cloud.sql.v1.PasswordValidationPolicy.disallowUsernameSubstring: object expected"); message.disallowUsernameSubstring = $root.google.protobuf.BoolValue.fromObject(object.disallowUsernameSubstring, long + 1); } if (object.passwordChangeInterval != null) { - if (typeof object.passwordChangeInterval !== "object") + if (!$util.isObject(object.passwordChangeInterval)) throw TypeError(".google.cloud.sql.v1.PasswordValidationPolicy.passwordChangeInterval: object expected"); message.passwordChangeInterval = $root.google.protobuf.Duration.fromObject(object.passwordChangeInterval, long + 1); } if (object.enablePasswordPolicy != null) { - if (typeof object.enablePasswordPolicy !== "object") + if (!$util.isObject(object.enablePasswordPolicy)) throw TypeError(".google.cloud.sql.v1.PasswordValidationPolicy.enablePasswordPolicy: object expected"); message.enablePasswordPolicy = $root.google.protobuf.BoolValue.fromObject(object.enablePasswordPolicy, long + 1); } if (object.disallowCompromisedCredentials != null) { - if (typeof object.disallowCompromisedCredentials !== "object") + if (!$util.isObject(object.disallowCompromisedCredentials)) throw TypeError(".google.cloud.sql.v1.PasswordValidationPolicy.disallowCompromisedCredentials: object expected"); message.disallowCompromisedCredentials = $root.google.protobuf.BoolValue.fromObject(object.disallowCompromisedCredentials, long + 1); } @@ -18916,9 +19444,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PasswordValidationPolicy.toObject = function toObject(message, options) { + PasswordValidationPolicy.toObject = function toObject(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.minLength = null; @@ -18929,20 +19461,20 @@ object.enablePasswordPolicy = null; object.disallowCompromisedCredentials = null; } - if (message.minLength != null && message.hasOwnProperty("minLength")) - object.minLength = $root.google.protobuf.Int32Value.toObject(message.minLength, options); - if (message.complexity != null && message.hasOwnProperty("complexity")) + if (message.minLength != null && Object.hasOwnProperty.call(message, "minLength")) + object.minLength = $root.google.protobuf.Int32Value.toObject(message.minLength, options, q + 1); + if (message.complexity != null && Object.hasOwnProperty.call(message, "complexity")) object.complexity = options.enums === String ? $root.google.cloud.sql.v1.PasswordValidationPolicy.Complexity[message.complexity] === undefined ? message.complexity : $root.google.cloud.sql.v1.PasswordValidationPolicy.Complexity[message.complexity] : message.complexity; - if (message.reuseInterval != null && message.hasOwnProperty("reuseInterval")) - object.reuseInterval = $root.google.protobuf.Int32Value.toObject(message.reuseInterval, options); - if (message.disallowUsernameSubstring != null && message.hasOwnProperty("disallowUsernameSubstring")) - object.disallowUsernameSubstring = $root.google.protobuf.BoolValue.toObject(message.disallowUsernameSubstring, options); - if (message.passwordChangeInterval != null && message.hasOwnProperty("passwordChangeInterval")) - object.passwordChangeInterval = $root.google.protobuf.Duration.toObject(message.passwordChangeInterval, options); - if (message.enablePasswordPolicy != null && message.hasOwnProperty("enablePasswordPolicy")) - object.enablePasswordPolicy = $root.google.protobuf.BoolValue.toObject(message.enablePasswordPolicy, options); - if (message.disallowCompromisedCredentials != null && message.hasOwnProperty("disallowCompromisedCredentials")) - object.disallowCompromisedCredentials = $root.google.protobuf.BoolValue.toObject(message.disallowCompromisedCredentials, options); + if (message.reuseInterval != null && Object.hasOwnProperty.call(message, "reuseInterval")) + object.reuseInterval = $root.google.protobuf.Int32Value.toObject(message.reuseInterval, options, q + 1); + if (message.disallowUsernameSubstring != null && Object.hasOwnProperty.call(message, "disallowUsernameSubstring")) + object.disallowUsernameSubstring = $root.google.protobuf.BoolValue.toObject(message.disallowUsernameSubstring, options, q + 1); + if (message.passwordChangeInterval != null && Object.hasOwnProperty.call(message, "passwordChangeInterval")) + object.passwordChangeInterval = $root.google.protobuf.Duration.toObject(message.passwordChangeInterval, options, q + 1); + if (message.enablePasswordPolicy != null && Object.hasOwnProperty.call(message, "enablePasswordPolicy")) + object.enablePasswordPolicy = $root.google.protobuf.BoolValue.toObject(message.enablePasswordPolicy, options, q + 1); + if (message.disallowCompromisedCredentials != null && Object.hasOwnProperty.call(message, "disallowCompromisedCredentials")) + object.disallowCompromisedCredentials = $root.google.protobuf.BoolValue.toObject(message.disallowCompromisedCredentials, options, q + 1); return object; }; @@ -19042,9 +19574,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataCacheConfig.encode = function encode(message, writer) { + DataCacheConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.dataCacheEnabled != null && Object.hasOwnProperty.call(message, "dataCacheEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.dataCacheEnabled); return writer; @@ -19060,7 +19596,7 @@ * @returns {$protobuf.Writer} Writer */ DataCacheConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -19130,7 +19666,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.dataCacheEnabled != null && message.hasOwnProperty("dataCacheEnabled")) + if (message.dataCacheEnabled != null && Object.hasOwnProperty.call(message, "dataCacheEnabled")) if (typeof message.dataCacheEnabled !== "boolean") return "dataCacheEnabled: boolean expected"; return null; @@ -19147,6 +19683,8 @@ DataCacheConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DataCacheConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DataCacheConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -19166,13 +19704,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataCacheConfig.toObject = function toObject(message, options) { + DataCacheConfig.toObject = function toObject(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.dataCacheEnabled = false; - if (message.dataCacheEnabled != null && message.hasOwnProperty("dataCacheEnabled")) + if (message.dataCacheEnabled != null && Object.hasOwnProperty.call(message, "dataCacheEnabled")) object.dataCacheEnabled = message.dataCacheEnabled; return object; }; @@ -19283,9 +19825,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FinalBackupConfig.encode = function encode(message, writer) { + FinalBackupConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) @@ -19303,7 +19849,7 @@ * @returns {$protobuf.Writer} Writer */ FinalBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -19378,12 +19924,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { properties._enabled = 1; if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; } - if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) { + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) { properties._retentionDays = 1; if (!$util.isInteger(message.retentionDays)) return "retentionDays: integer expected"; @@ -19402,6 +19948,8 @@ FinalBackupConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.FinalBackupConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.FinalBackupConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -19423,16 +19971,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FinalBackupConfig.toObject = function toObject(message, options) { + FinalBackupConfig.toObject = function 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.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { object.enabled = message.enabled; if (options.oneofs) object._enabled = "enabled"; } - if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) { + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) { object.retentionDays = message.retentionDays; if (options.oneofs) object._retentionDays = "retentionDays"; @@ -19976,11 +20528,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Settings.encode = function encode(message, writer) { + Settings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) - $root.google.protobuf.Int64Value.encode(message.settingsVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.settingsVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.authorizedGaeApplications != null && message.authorizedGaeApplications.length) for (var i = 0; i < message.authorizedGaeApplications.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.authorizedGaeApplications[i]); @@ -19998,83 +20554,83 @@ if (message.replicationType != null && Object.hasOwnProperty.call(message, "replicationType")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.replicationType); if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) - $root.google.protobuf.Int64Value.encode(message.storageAutoResizeLimit, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.storageAutoResizeLimit, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.activationPolicy); if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) - $root.google.cloud.sql.v1.IpConfiguration.encode(message.ipConfiguration, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1.IpConfiguration.encode(message.ipConfiguration, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.storageAutoResize != null && Object.hasOwnProperty.call(message, "storageAutoResize")) - $root.google.protobuf.BoolValue.encode(message.storageAutoResize, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.storageAutoResize, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.locationPreference != null && Object.hasOwnProperty.call(message, "locationPreference")) - $root.google.cloud.sql.v1.LocationPreference.encode(message.locationPreference, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + $root.google.cloud.sql.v1.LocationPreference.encode(message.locationPreference, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); if (message.databaseFlags != null && message.databaseFlags.length) for (var i = 0; i < message.databaseFlags.length; ++i) - $root.google.cloud.sql.v1.DatabaseFlags.encode(message.databaseFlags[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseFlags.encode(message.databaseFlags[i], writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.dataDiskType); if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) - $root.google.cloud.sql.v1.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + $root.google.cloud.sql.v1.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); if (message.backupConfiguration != null && Object.hasOwnProperty.call(message, "backupConfiguration")) - $root.google.cloud.sql.v1.BackupConfiguration.encode(message.backupConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1.BackupConfiguration.encode(message.backupConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.databaseReplicationEnabled != null && Object.hasOwnProperty.call(message, "databaseReplicationEnabled")) - $root.google.protobuf.BoolValue.encode(message.databaseReplicationEnabled, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.databaseReplicationEnabled, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); if (message.crashSafeReplicationEnabled != null && Object.hasOwnProperty.call(message, "crashSafeReplicationEnabled")) - $root.google.protobuf.BoolValue.encode(message.crashSafeReplicationEnabled, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.crashSafeReplicationEnabled, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) - $root.google.protobuf.Int64Value.encode(message.dataDiskSizeGb, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.dataDiskSizeGb, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); if (message.activeDirectoryConfig != null && Object.hasOwnProperty.call(message, "activeDirectoryConfig")) - $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.encode(message.activeDirectoryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.encode(message.activeDirectoryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) writer.uint32(/* id 23, wireType 2 =*/186).string(message.collation); if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) - $root.google.cloud.sql.v1.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + $root.google.cloud.sql.v1.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); if (message.insightsConfig != null && Object.hasOwnProperty.call(message, "insightsConfig")) - $root.google.cloud.sql.v1.InsightsConfig.encode(message.insightsConfig, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + $root.google.cloud.sql.v1.InsightsConfig.encode(message.insightsConfig, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); if (message.passwordValidationPolicy != null && Object.hasOwnProperty.call(message, "passwordValidationPolicy")) - $root.google.cloud.sql.v1.PasswordValidationPolicy.encode(message.passwordValidationPolicy, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.cloud.sql.v1.PasswordValidationPolicy.encode(message.passwordValidationPolicy, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.sqlServerAuditConfig != null && Object.hasOwnProperty.call(message, "sqlServerAuditConfig")) - $root.google.cloud.sql.v1.SqlServerAuditConfig.encode(message.sqlServerAuditConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlServerAuditConfig.encode(message.sqlServerAuditConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); if (message.connectorEnforcement != null && Object.hasOwnProperty.call(message, "connectorEnforcement")) writer.uint32(/* id 32, wireType 0 =*/256).int32(message.connectorEnforcement); if (message.deletionProtectionEnabled != null && Object.hasOwnProperty.call(message, "deletionProtectionEnabled")) - $root.google.protobuf.BoolValue.encode(message.deletionProtectionEnabled, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.deletionProtectionEnabled, writer.uint32(/* id 33, wireType 2 =*/266).fork(), q + 1).ldelim(); if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) writer.uint32(/* id 34, wireType 2 =*/274).string(message.timeZone); if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) - $root.google.cloud.sql.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + $root.google.cloud.sql.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); if (message.dataCacheConfig != null && Object.hasOwnProperty.call(message, "dataCacheConfig")) - $root.google.cloud.sql.v1.DataCacheConfig.encode(message.dataCacheConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + $root.google.cloud.sql.v1.DataCacheConfig.encode(message.dataCacheConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork(), q + 1).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 38, wireType 0 =*/304).int32(message.edition); if (message.replicationLagMaxSeconds != null && Object.hasOwnProperty.call(message, "replicationLagMaxSeconds")) - $root.google.protobuf.Int32Value.encode(message.replicationLagMaxSeconds, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.replicationLagMaxSeconds, writer.uint32(/* id 39, wireType 2 =*/314).fork(), q + 1).ldelim(); if (message.enableGoogleMlIntegration != null && Object.hasOwnProperty.call(message, "enableGoogleMlIntegration")) - $root.google.protobuf.BoolValue.encode(message.enableGoogleMlIntegration, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enableGoogleMlIntegration, writer.uint32(/* id 40, wireType 2 =*/322).fork(), q + 1).ldelim(); if (message.enableDataplexIntegration != null && Object.hasOwnProperty.call(message, "enableDataplexIntegration")) - $root.google.protobuf.BoolValue.encode(message.enableDataplexIntegration, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enableDataplexIntegration, writer.uint32(/* id 41, wireType 2 =*/330).fork(), q + 1).ldelim(); if (message.retainBackupsOnDelete != null && Object.hasOwnProperty.call(message, "retainBackupsOnDelete")) - $root.google.protobuf.BoolValue.encode(message.retainBackupsOnDelete, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.retainBackupsOnDelete, writer.uint32(/* id 42, wireType 2 =*/338).fork(), q + 1).ldelim(); if (message.dataDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedIops")) writer.uint32(/* id 43, wireType 0 =*/344).int64(message.dataDiskProvisionedIops); if (message.dataDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedThroughput")) writer.uint32(/* id 44, wireType 0 =*/352).int64(message.dataDiskProvisionedThroughput); if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) - $root.google.cloud.sql.v1.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + $root.google.cloud.sql.v1.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 45, wireType 2 =*/362).fork(), q + 1).ldelim(); if (message.finalBackupConfig != null && Object.hasOwnProperty.call(message, "finalBackupConfig")) - $root.google.cloud.sql.v1.FinalBackupConfig.encode(message.finalBackupConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + $root.google.cloud.sql.v1.FinalBackupConfig.encode(message.finalBackupConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork(), q + 1).ldelim(); if (message.readPoolAutoScaleConfig != null && Object.hasOwnProperty.call(message, "readPoolAutoScaleConfig")) - $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.encode(message.readPoolAutoScaleConfig, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.encode(message.readPoolAutoScaleConfig, writer.uint32(/* id 48, wireType 2 =*/386).fork(), q + 1).ldelim(); if (message.acceleratedReplicaMode != null && Object.hasOwnProperty.call(message, "acceleratedReplicaMode")) - $root.google.protobuf.BoolValue.encode(message.acceleratedReplicaMode, writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.acceleratedReplicaMode, writer.uint32(/* id 49, wireType 2 =*/394).fork(), q + 1).ldelim(); if (message.autoUpgradeEnabled != null && Object.hasOwnProperty.call(message, "autoUpgradeEnabled")) writer.uint32(/* id 50, wireType 0 =*/400).bool(message.autoUpgradeEnabled); if (message.entraidConfig != null && Object.hasOwnProperty.call(message, "entraidConfig")) - $root.google.cloud.sql.v1.SqlServerEntraIdConfig.encode(message.entraidConfig, writer.uint32(/* id 52, wireType 2 =*/418).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlServerEntraIdConfig.encode(message.entraidConfig, writer.uint32(/* id 52, wireType 2 =*/418).fork(), q + 1).ldelim(); if (message.dataApiAccess != null && Object.hasOwnProperty.call(message, "dataApiAccess")) writer.uint32(/* id 53, wireType 0 =*/424).int32(message.dataApiAccess); if (message.performanceCaptureConfig != null && Object.hasOwnProperty.call(message, "performanceCaptureConfig")) - $root.google.cloud.sql.v1.PerformanceCaptureConfig.encode(message.performanceCaptureConfig, writer.uint32(/* id 54, wireType 2 =*/434).fork()).ldelim(); + $root.google.cloud.sql.v1.PerformanceCaptureConfig.encode(message.performanceCaptureConfig, writer.uint32(/* id 54, wireType 2 =*/434).fork(), q + 1).ldelim(); return writer; }; @@ -20088,7 +20644,7 @@ * @returns {$protobuf.Writer} Writer */ Settings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -20366,25 +20922,25 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) { + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) { var error = $root.google.protobuf.Int64Value.verify(message.settingsVersion, long + 1); if (error) return "settingsVersion." + error; } - if (message.authorizedGaeApplications != null && message.hasOwnProperty("authorizedGaeApplications")) { + if (message.authorizedGaeApplications != null && Object.hasOwnProperty.call(message, "authorizedGaeApplications")) { if (!Array.isArray(message.authorizedGaeApplications)) return "authorizedGaeApplications: array expected"; for (var i = 0; i < message.authorizedGaeApplications.length; ++i) if (!$util.isString(message.authorizedGaeApplications[i])) return "authorizedGaeApplications: string[] expected"; } - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) if (!$util.isString(message.tier)) return "tier: string expected"; - 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.userLabels != null && message.hasOwnProperty("userLabels")) { + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) { if (!$util.isObject(message.userLabels)) return "userLabels: object expected"; var key = Object.keys(message.userLabels); @@ -20392,7 +20948,7 @@ if (!$util.isString(message.userLabels[key[i]])) return "userLabels: string{k:string} expected"; } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) switch (message.availabilityType) { default: return "availabilityType: enum value expected"; @@ -20401,7 +20957,7 @@ case 2: break; } - if (message.pricingPlan != null && message.hasOwnProperty("pricingPlan")) + if (message.pricingPlan != null && Object.hasOwnProperty.call(message, "pricingPlan")) switch (message.pricingPlan) { default: return "pricingPlan: enum value expected"; @@ -20410,7 +20966,7 @@ case 2: break; } - if (message.replicationType != null && message.hasOwnProperty("replicationType")) + if (message.replicationType != null && Object.hasOwnProperty.call(message, "replicationType")) switch (message.replicationType) { default: return "replicationType: enum value expected"; @@ -20419,12 +20975,12 @@ case 2: break; } - if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) { + if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) { var error = $root.google.protobuf.Int64Value.verify(message.storageAutoResizeLimit, long + 1); if (error) return "storageAutoResizeLimit." + error; } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) switch (message.activationPolicy) { default: return "activationPolicy: enum value expected"; @@ -20434,22 +20990,22 @@ case 3: break; } - if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) { + if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) { var error = $root.google.cloud.sql.v1.IpConfiguration.verify(message.ipConfiguration, long + 1); if (error) return "ipConfiguration." + error; } - if (message.storageAutoResize != null && message.hasOwnProperty("storageAutoResize")) { + if (message.storageAutoResize != null && Object.hasOwnProperty.call(message, "storageAutoResize")) { var error = $root.google.protobuf.BoolValue.verify(message.storageAutoResize, long + 1); if (error) return "storageAutoResize." + error; } - if (message.locationPreference != null && message.hasOwnProperty("locationPreference")) { + if (message.locationPreference != null && Object.hasOwnProperty.call(message, "locationPreference")) { var error = $root.google.cloud.sql.v1.LocationPreference.verify(message.locationPreference, long + 1); if (error) return "locationPreference." + error; } - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) { if (!Array.isArray(message.databaseFlags)) return "databaseFlags: array expected"; for (var i = 0; i < message.databaseFlags.length; ++i) { @@ -20458,7 +21014,7 @@ return "databaseFlags." + error; } } - if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) switch (message.dataDiskType) { default: return "dataDiskType: enum value expected"; @@ -20469,40 +21025,40 @@ case 4: break; } - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) { var error = $root.google.cloud.sql.v1.MaintenanceWindow.verify(message.maintenanceWindow, long + 1); if (error) return "maintenanceWindow." + error; } - if (message.backupConfiguration != null && message.hasOwnProperty("backupConfiguration")) { + if (message.backupConfiguration != null && Object.hasOwnProperty.call(message, "backupConfiguration")) { var error = $root.google.cloud.sql.v1.BackupConfiguration.verify(message.backupConfiguration, long + 1); if (error) return "backupConfiguration." + error; } - if (message.databaseReplicationEnabled != null && message.hasOwnProperty("databaseReplicationEnabled")) { + if (message.databaseReplicationEnabled != null && Object.hasOwnProperty.call(message, "databaseReplicationEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.databaseReplicationEnabled, long + 1); if (error) return "databaseReplicationEnabled." + error; } - if (message.crashSafeReplicationEnabled != null && message.hasOwnProperty("crashSafeReplicationEnabled")) { + if (message.crashSafeReplicationEnabled != null && Object.hasOwnProperty.call(message, "crashSafeReplicationEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.crashSafeReplicationEnabled, long + 1); if (error) return "crashSafeReplicationEnabled." + error; } - if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) { + if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) { var error = $root.google.protobuf.Int64Value.verify(message.dataDiskSizeGb, long + 1); if (error) return "dataDiskSizeGb." + error; } - if (message.activeDirectoryConfig != null && message.hasOwnProperty("activeDirectoryConfig")) { + if (message.activeDirectoryConfig != null && Object.hasOwnProperty.call(message, "activeDirectoryConfig")) { var error = $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.verify(message.activeDirectoryConfig, long + 1); if (error) return "activeDirectoryConfig." + error; } - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) if (!$util.isString(message.collation)) return "collation: string expected"; - if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { + if (message.denyMaintenancePeriods != null && Object.hasOwnProperty.call(message, "denyMaintenancePeriods")) { if (!Array.isArray(message.denyMaintenancePeriods)) return "denyMaintenancePeriods: array expected"; for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { @@ -20511,22 +21067,22 @@ return "denyMaintenancePeriods." + error; } } - if (message.insightsConfig != null && message.hasOwnProperty("insightsConfig")) { + if (message.insightsConfig != null && Object.hasOwnProperty.call(message, "insightsConfig")) { var error = $root.google.cloud.sql.v1.InsightsConfig.verify(message.insightsConfig, long + 1); if (error) return "insightsConfig." + error; } - if (message.passwordValidationPolicy != null && message.hasOwnProperty("passwordValidationPolicy")) { + if (message.passwordValidationPolicy != null && Object.hasOwnProperty.call(message, "passwordValidationPolicy")) { var error = $root.google.cloud.sql.v1.PasswordValidationPolicy.verify(message.passwordValidationPolicy, long + 1); if (error) return "passwordValidationPolicy." + error; } - if (message.sqlServerAuditConfig != null && message.hasOwnProperty("sqlServerAuditConfig")) { + if (message.sqlServerAuditConfig != null && Object.hasOwnProperty.call(message, "sqlServerAuditConfig")) { var error = $root.google.cloud.sql.v1.SqlServerAuditConfig.verify(message.sqlServerAuditConfig, long + 1); if (error) return "sqlServerAuditConfig." + 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"; @@ -20535,7 +21091,7 @@ case 3: break; } - if (message.connectorEnforcement != null && message.hasOwnProperty("connectorEnforcement")) + if (message.connectorEnforcement != null && Object.hasOwnProperty.call(message, "connectorEnforcement")) switch (message.connectorEnforcement) { default: return "connectorEnforcement: enum value expected"; @@ -20544,55 +21100,55 @@ case 2: break; } - if (message.deletionProtectionEnabled != null && message.hasOwnProperty("deletionProtectionEnabled")) { + if (message.deletionProtectionEnabled != null && Object.hasOwnProperty.call(message, "deletionProtectionEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.deletionProtectionEnabled, long + 1); if (error) return "deletionProtectionEnabled." + error; } - 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.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) { var error = $root.google.cloud.sql.v1.AdvancedMachineFeatures.verify(message.advancedMachineFeatures, long + 1); if (error) return "advancedMachineFeatures." + error; } - if (message.dataCacheConfig != null && message.hasOwnProperty("dataCacheConfig")) { + if (message.dataCacheConfig != null && Object.hasOwnProperty.call(message, "dataCacheConfig")) { var error = $root.google.cloud.sql.v1.DataCacheConfig.verify(message.dataCacheConfig, long + 1); if (error) return "dataCacheConfig." + error; } - if (message.replicationLagMaxSeconds != null && message.hasOwnProperty("replicationLagMaxSeconds")) { + if (message.replicationLagMaxSeconds != null && Object.hasOwnProperty.call(message, "replicationLagMaxSeconds")) { var error = $root.google.protobuf.Int32Value.verify(message.replicationLagMaxSeconds, long + 1); if (error) return "replicationLagMaxSeconds." + error; } - if (message.enableGoogleMlIntegration != null && message.hasOwnProperty("enableGoogleMlIntegration")) { + if (message.enableGoogleMlIntegration != null && Object.hasOwnProperty.call(message, "enableGoogleMlIntegration")) { var error = $root.google.protobuf.BoolValue.verify(message.enableGoogleMlIntegration, long + 1); if (error) return "enableGoogleMlIntegration." + error; } - if (message.enableDataplexIntegration != null && message.hasOwnProperty("enableDataplexIntegration")) { + if (message.enableDataplexIntegration != null && Object.hasOwnProperty.call(message, "enableDataplexIntegration")) { var error = $root.google.protobuf.BoolValue.verify(message.enableDataplexIntegration, long + 1); if (error) return "enableDataplexIntegration." + error; } - if (message.retainBackupsOnDelete != null && message.hasOwnProperty("retainBackupsOnDelete")) { + if (message.retainBackupsOnDelete != null && Object.hasOwnProperty.call(message, "retainBackupsOnDelete")) { var error = $root.google.protobuf.BoolValue.verify(message.retainBackupsOnDelete, long + 1); if (error) return "retainBackupsOnDelete." + error; } - if (message.dataDiskProvisionedIops != null && message.hasOwnProperty("dataDiskProvisionedIops")) { + if (message.dataDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedIops")) { properties._dataDiskProvisionedIops = 1; if (!$util.isInteger(message.dataDiskProvisionedIops) && !(message.dataDiskProvisionedIops && $util.isInteger(message.dataDiskProvisionedIops.low) && $util.isInteger(message.dataDiskProvisionedIops.high))) return "dataDiskProvisionedIops: integer|Long expected"; } - if (message.dataDiskProvisionedThroughput != null && message.hasOwnProperty("dataDiskProvisionedThroughput")) { + if (message.dataDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedThroughput")) { properties._dataDiskProvisionedThroughput = 1; if (!$util.isInteger(message.dataDiskProvisionedThroughput) && !(message.dataDiskProvisionedThroughput && $util.isInteger(message.dataDiskProvisionedThroughput.low) && $util.isInteger(message.dataDiskProvisionedThroughput.high))) return "dataDiskProvisionedThroughput: integer|Long expected"; } - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { + if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) { properties._connectionPoolConfig = 1; { var error = $root.google.cloud.sql.v1.ConnectionPoolConfig.verify(message.connectionPoolConfig, long + 1); @@ -20600,7 +21156,7 @@ return "connectionPoolConfig." + error; } } - if (message.finalBackupConfig != null && message.hasOwnProperty("finalBackupConfig")) { + if (message.finalBackupConfig != null && Object.hasOwnProperty.call(message, "finalBackupConfig")) { properties._finalBackupConfig = 1; { var error = $root.google.cloud.sql.v1.FinalBackupConfig.verify(message.finalBackupConfig, long + 1); @@ -20608,7 +21164,7 @@ return "finalBackupConfig." + error; } } - if (message.readPoolAutoScaleConfig != null && message.hasOwnProperty("readPoolAutoScaleConfig")) { + if (message.readPoolAutoScaleConfig != null && Object.hasOwnProperty.call(message, "readPoolAutoScaleConfig")) { properties._readPoolAutoScaleConfig = 1; { var error = $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.verify(message.readPoolAutoScaleConfig, long + 1); @@ -20616,22 +21172,22 @@ return "readPoolAutoScaleConfig." + error; } } - if (message.acceleratedReplicaMode != null && message.hasOwnProperty("acceleratedReplicaMode")) { + if (message.acceleratedReplicaMode != null && Object.hasOwnProperty.call(message, "acceleratedReplicaMode")) { var error = $root.google.protobuf.BoolValue.verify(message.acceleratedReplicaMode, long + 1); if (error) return "acceleratedReplicaMode." + error; } - if (message.autoUpgradeEnabled != null && message.hasOwnProperty("autoUpgradeEnabled")) { + if (message.autoUpgradeEnabled != null && Object.hasOwnProperty.call(message, "autoUpgradeEnabled")) { properties._autoUpgradeEnabled = 1; if (typeof message.autoUpgradeEnabled !== "boolean") return "autoUpgradeEnabled: boolean expected"; } - if (message.entraidConfig != null && message.hasOwnProperty("entraidConfig")) { + if (message.entraidConfig != null && Object.hasOwnProperty.call(message, "entraidConfig")) { var error = $root.google.cloud.sql.v1.SqlServerEntraIdConfig.verify(message.entraidConfig, long + 1); if (error) return "entraidConfig." + error; } - if (message.dataApiAccess != null && message.hasOwnProperty("dataApiAccess")) { + if (message.dataApiAccess != null && Object.hasOwnProperty.call(message, "dataApiAccess")) { properties._dataApiAccess = 1; switch (message.dataApiAccess) { default: @@ -20642,7 +21198,7 @@ break; } } - if (message.performanceCaptureConfig != null && message.hasOwnProperty("performanceCaptureConfig")) { + if (message.performanceCaptureConfig != null && Object.hasOwnProperty.call(message, "performanceCaptureConfig")) { var error = $root.google.cloud.sql.v1.PerformanceCaptureConfig.verify(message.performanceCaptureConfig, long + 1); if (error) return "performanceCaptureConfig." + error; @@ -20661,13 +21217,15 @@ Settings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Settings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Settings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.Settings(); if (object.settingsVersion != null) { - if (typeof object.settingsVersion !== "object") + if (!$util.isObject(object.settingsVersion)) throw TypeError(".google.cloud.sql.v1.Settings.settingsVersion: object expected"); message.settingsVersion = $root.google.protobuf.Int64Value.fromObject(object.settingsVersion, long + 1); } @@ -20683,7 +21241,7 @@ if (object.kind != null) message.kind = String(object.kind); if (object.userLabels) { - if (typeof object.userLabels !== "object") + if (!$util.isObject(object.userLabels)) throw TypeError(".google.cloud.sql.v1.Settings.userLabels: object expected"); message.userLabels = {}; for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) { @@ -20753,7 +21311,7 @@ break; } if (object.storageAutoResizeLimit != null) { - if (typeof object.storageAutoResizeLimit !== "object") + if (!$util.isObject(object.storageAutoResizeLimit)) throw TypeError(".google.cloud.sql.v1.Settings.storageAutoResizeLimit: object expected"); message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.fromObject(object.storageAutoResizeLimit, long + 1); } @@ -20782,17 +21340,17 @@ break; } if (object.ipConfiguration != null) { - if (typeof object.ipConfiguration !== "object") + if (!$util.isObject(object.ipConfiguration)) throw TypeError(".google.cloud.sql.v1.Settings.ipConfiguration: object expected"); message.ipConfiguration = $root.google.cloud.sql.v1.IpConfiguration.fromObject(object.ipConfiguration, long + 1); } if (object.storageAutoResize != null) { - if (typeof object.storageAutoResize !== "object") + if (!$util.isObject(object.storageAutoResize)) throw TypeError(".google.cloud.sql.v1.Settings.storageAutoResize: object expected"); message.storageAutoResize = $root.google.protobuf.BoolValue.fromObject(object.storageAutoResize, long + 1); } if (object.locationPreference != null) { - if (typeof object.locationPreference !== "object") + if (!$util.isObject(object.locationPreference)) throw TypeError(".google.cloud.sql.v1.Settings.locationPreference: object expected"); message.locationPreference = $root.google.cloud.sql.v1.LocationPreference.fromObject(object.locationPreference, long + 1); } @@ -20801,7 +21359,7 @@ throw TypeError(".google.cloud.sql.v1.Settings.databaseFlags: array expected"); message.databaseFlags = []; for (var i = 0; i < object.databaseFlags.length; ++i) { - if (typeof object.databaseFlags[i] !== "object") + if (!$util.isObject(object.databaseFlags[i])) throw TypeError(".google.cloud.sql.v1.Settings.databaseFlags: object expected"); message.databaseFlags[i] = $root.google.cloud.sql.v1.DatabaseFlags.fromObject(object.databaseFlags[i], long + 1); } @@ -20835,32 +21393,32 @@ break; } if (object.maintenanceWindow != null) { - if (typeof object.maintenanceWindow !== "object") + if (!$util.isObject(object.maintenanceWindow)) throw TypeError(".google.cloud.sql.v1.Settings.maintenanceWindow: object expected"); message.maintenanceWindow = $root.google.cloud.sql.v1.MaintenanceWindow.fromObject(object.maintenanceWindow, long + 1); } if (object.backupConfiguration != null) { - if (typeof object.backupConfiguration !== "object") + if (!$util.isObject(object.backupConfiguration)) throw TypeError(".google.cloud.sql.v1.Settings.backupConfiguration: object expected"); message.backupConfiguration = $root.google.cloud.sql.v1.BackupConfiguration.fromObject(object.backupConfiguration, long + 1); } if (object.databaseReplicationEnabled != null) { - if (typeof object.databaseReplicationEnabled !== "object") + if (!$util.isObject(object.databaseReplicationEnabled)) throw TypeError(".google.cloud.sql.v1.Settings.databaseReplicationEnabled: object expected"); message.databaseReplicationEnabled = $root.google.protobuf.BoolValue.fromObject(object.databaseReplicationEnabled, long + 1); } if (object.crashSafeReplicationEnabled != null) { - if (typeof object.crashSafeReplicationEnabled !== "object") + if (!$util.isObject(object.crashSafeReplicationEnabled)) throw TypeError(".google.cloud.sql.v1.Settings.crashSafeReplicationEnabled: object expected"); message.crashSafeReplicationEnabled = $root.google.protobuf.BoolValue.fromObject(object.crashSafeReplicationEnabled, long + 1); } if (object.dataDiskSizeGb != null) { - if (typeof object.dataDiskSizeGb !== "object") + if (!$util.isObject(object.dataDiskSizeGb)) throw TypeError(".google.cloud.sql.v1.Settings.dataDiskSizeGb: object expected"); message.dataDiskSizeGb = $root.google.protobuf.Int64Value.fromObject(object.dataDiskSizeGb, long + 1); } if (object.activeDirectoryConfig != null) { - if (typeof object.activeDirectoryConfig !== "object") + if (!$util.isObject(object.activeDirectoryConfig)) throw TypeError(".google.cloud.sql.v1.Settings.activeDirectoryConfig: object expected"); message.activeDirectoryConfig = $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.fromObject(object.activeDirectoryConfig, long + 1); } @@ -20871,23 +21429,23 @@ throw TypeError(".google.cloud.sql.v1.Settings.denyMaintenancePeriods: array expected"); message.denyMaintenancePeriods = []; for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { - if (typeof object.denyMaintenancePeriods[i] !== "object") + if (!$util.isObject(object.denyMaintenancePeriods[i])) throw TypeError(".google.cloud.sql.v1.Settings.denyMaintenancePeriods: object expected"); message.denyMaintenancePeriods[i] = $root.google.cloud.sql.v1.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i], long + 1); } } if (object.insightsConfig != null) { - if (typeof object.insightsConfig !== "object") + if (!$util.isObject(object.insightsConfig)) throw TypeError(".google.cloud.sql.v1.Settings.insightsConfig: object expected"); message.insightsConfig = $root.google.cloud.sql.v1.InsightsConfig.fromObject(object.insightsConfig, long + 1); } if (object.passwordValidationPolicy != null) { - if (typeof object.passwordValidationPolicy !== "object") + if (!$util.isObject(object.passwordValidationPolicy)) throw TypeError(".google.cloud.sql.v1.Settings.passwordValidationPolicy: object expected"); message.passwordValidationPolicy = $root.google.cloud.sql.v1.PasswordValidationPolicy.fromObject(object.passwordValidationPolicy, long + 1); } if (object.sqlServerAuditConfig != null) { - if (typeof object.sqlServerAuditConfig !== "object") + if (!$util.isObject(object.sqlServerAuditConfig)) throw TypeError(".google.cloud.sql.v1.Settings.sqlServerAuditConfig: object expected"); message.sqlServerAuditConfig = $root.google.cloud.sql.v1.SqlServerAuditConfig.fromObject(object.sqlServerAuditConfig, long + 1); } @@ -20932,45 +21490,45 @@ break; } if (object.deletionProtectionEnabled != null) { - if (typeof object.deletionProtectionEnabled !== "object") + if (!$util.isObject(object.deletionProtectionEnabled)) throw TypeError(".google.cloud.sql.v1.Settings.deletionProtectionEnabled: object expected"); message.deletionProtectionEnabled = $root.google.protobuf.BoolValue.fromObject(object.deletionProtectionEnabled, long + 1); } if (object.timeZone != null) message.timeZone = String(object.timeZone); if (object.advancedMachineFeatures != null) { - if (typeof object.advancedMachineFeatures !== "object") + if (!$util.isObject(object.advancedMachineFeatures)) throw TypeError(".google.cloud.sql.v1.Settings.advancedMachineFeatures: object expected"); message.advancedMachineFeatures = $root.google.cloud.sql.v1.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures, long + 1); } if (object.dataCacheConfig != null) { - if (typeof object.dataCacheConfig !== "object") + if (!$util.isObject(object.dataCacheConfig)) throw TypeError(".google.cloud.sql.v1.Settings.dataCacheConfig: object expected"); message.dataCacheConfig = $root.google.cloud.sql.v1.DataCacheConfig.fromObject(object.dataCacheConfig, long + 1); } if (object.replicationLagMaxSeconds != null) { - if (typeof object.replicationLagMaxSeconds !== "object") + if (!$util.isObject(object.replicationLagMaxSeconds)) throw TypeError(".google.cloud.sql.v1.Settings.replicationLagMaxSeconds: object expected"); message.replicationLagMaxSeconds = $root.google.protobuf.Int32Value.fromObject(object.replicationLagMaxSeconds, long + 1); } if (object.enableGoogleMlIntegration != null) { - if (typeof object.enableGoogleMlIntegration !== "object") + if (!$util.isObject(object.enableGoogleMlIntegration)) throw TypeError(".google.cloud.sql.v1.Settings.enableGoogleMlIntegration: object expected"); message.enableGoogleMlIntegration = $root.google.protobuf.BoolValue.fromObject(object.enableGoogleMlIntegration, long + 1); } if (object.enableDataplexIntegration != null) { - if (typeof object.enableDataplexIntegration !== "object") + if (!$util.isObject(object.enableDataplexIntegration)) throw TypeError(".google.cloud.sql.v1.Settings.enableDataplexIntegration: object expected"); message.enableDataplexIntegration = $root.google.protobuf.BoolValue.fromObject(object.enableDataplexIntegration, long + 1); } if (object.retainBackupsOnDelete != null) { - if (typeof object.retainBackupsOnDelete !== "object") + if (!$util.isObject(object.retainBackupsOnDelete)) throw TypeError(".google.cloud.sql.v1.Settings.retainBackupsOnDelete: object expected"); message.retainBackupsOnDelete = $root.google.protobuf.BoolValue.fromObject(object.retainBackupsOnDelete, long + 1); } if (object.dataDiskProvisionedIops != null) if ($util.Long) - (message.dataDiskProvisionedIops = $util.Long.fromValue(object.dataDiskProvisionedIops)).unsigned = false; + message.dataDiskProvisionedIops = $util.Long.fromValue(object.dataDiskProvisionedIops, false); else if (typeof object.dataDiskProvisionedIops === "string") message.dataDiskProvisionedIops = parseInt(object.dataDiskProvisionedIops, 10); else if (typeof object.dataDiskProvisionedIops === "number") @@ -20979,7 +21537,7 @@ message.dataDiskProvisionedIops = new $util.LongBits(object.dataDiskProvisionedIops.low >>> 0, object.dataDiskProvisionedIops.high >>> 0).toNumber(); if (object.dataDiskProvisionedThroughput != null) if ($util.Long) - (message.dataDiskProvisionedThroughput = $util.Long.fromValue(object.dataDiskProvisionedThroughput)).unsigned = false; + message.dataDiskProvisionedThroughput = $util.Long.fromValue(object.dataDiskProvisionedThroughput, false); else if (typeof object.dataDiskProvisionedThroughput === "string") message.dataDiskProvisionedThroughput = parseInt(object.dataDiskProvisionedThroughput, 10); else if (typeof object.dataDiskProvisionedThroughput === "number") @@ -20987,29 +21545,29 @@ else if (typeof object.dataDiskProvisionedThroughput === "object") message.dataDiskProvisionedThroughput = new $util.LongBits(object.dataDiskProvisionedThroughput.low >>> 0, object.dataDiskProvisionedThroughput.high >>> 0).toNumber(); if (object.connectionPoolConfig != null) { - if (typeof object.connectionPoolConfig !== "object") + if (!$util.isObject(object.connectionPoolConfig)) throw TypeError(".google.cloud.sql.v1.Settings.connectionPoolConfig: object expected"); message.connectionPoolConfig = $root.google.cloud.sql.v1.ConnectionPoolConfig.fromObject(object.connectionPoolConfig, long + 1); } if (object.finalBackupConfig != null) { - if (typeof object.finalBackupConfig !== "object") + if (!$util.isObject(object.finalBackupConfig)) throw TypeError(".google.cloud.sql.v1.Settings.finalBackupConfig: object expected"); message.finalBackupConfig = $root.google.cloud.sql.v1.FinalBackupConfig.fromObject(object.finalBackupConfig, long + 1); } if (object.readPoolAutoScaleConfig != null) { - if (typeof object.readPoolAutoScaleConfig !== "object") + if (!$util.isObject(object.readPoolAutoScaleConfig)) throw TypeError(".google.cloud.sql.v1.Settings.readPoolAutoScaleConfig: object expected"); message.readPoolAutoScaleConfig = $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.fromObject(object.readPoolAutoScaleConfig, long + 1); } if (object.acceleratedReplicaMode != null) { - if (typeof object.acceleratedReplicaMode !== "object") + if (!$util.isObject(object.acceleratedReplicaMode)) throw TypeError(".google.cloud.sql.v1.Settings.acceleratedReplicaMode: object expected"); message.acceleratedReplicaMode = $root.google.protobuf.BoolValue.fromObject(object.acceleratedReplicaMode, long + 1); } if (object.autoUpgradeEnabled != null) message.autoUpgradeEnabled = Boolean(object.autoUpgradeEnabled); if (object.entraidConfig != null) { - if (typeof object.entraidConfig !== "object") + if (!$util.isObject(object.entraidConfig)) throw TypeError(".google.cloud.sql.v1.Settings.entraidConfig: object expected"); message.entraidConfig = $root.google.cloud.sql.v1.SqlServerEntraIdConfig.fromObject(object.entraidConfig, long + 1); } @@ -21034,7 +21592,7 @@ break; } if (object.performanceCaptureConfig != null) { - if (typeof object.performanceCaptureConfig !== "object") + if (!$util.isObject(object.performanceCaptureConfig)) throw TypeError(".google.cloud.sql.v1.Settings.performanceCaptureConfig: object expected"); message.performanceCaptureConfig = $root.google.cloud.sql.v1.PerformanceCaptureConfig.fromObject(object.performanceCaptureConfig, long + 1); } @@ -21050,9 +21608,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Settings.toObject = function toObject(message, options) { + Settings.toObject = function toObject(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.authorizedGaeApplications = []; @@ -21098,16 +21660,16 @@ object.entraidConfig = null; object.performanceCaptureConfig = null; } - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) - object.settingsVersion = $root.google.protobuf.Int64Value.toObject(message.settingsVersion, options); + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) + object.settingsVersion = $root.google.protobuf.Int64Value.toObject(message.settingsVersion, options, q + 1); if (message.authorizedGaeApplications && message.authorizedGaeApplications.length) { object.authorizedGaeApplications = []; for (var j = 0; j < message.authorizedGaeApplications.length; ++j) object.authorizedGaeApplications[j] = message.authorizedGaeApplications[j]; } - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) object.tier = message.tier; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; var keys2; if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { @@ -21118,121 +21680,125 @@ object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; } } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) object.availabilityType = options.enums === String ? $root.google.cloud.sql.v1.SqlAvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.sql.v1.SqlAvailabilityType[message.availabilityType] : message.availabilityType; - if (message.pricingPlan != null && message.hasOwnProperty("pricingPlan")) + if (message.pricingPlan != null && Object.hasOwnProperty.call(message, "pricingPlan")) object.pricingPlan = options.enums === String ? $root.google.cloud.sql.v1.SqlPricingPlan[message.pricingPlan] === undefined ? message.pricingPlan : $root.google.cloud.sql.v1.SqlPricingPlan[message.pricingPlan] : message.pricingPlan; - if (message.replicationType != null && message.hasOwnProperty("replicationType")) + if (message.replicationType != null && Object.hasOwnProperty.call(message, "replicationType")) object.replicationType = options.enums === String ? $root.google.cloud.sql.v1.SqlReplicationType[message.replicationType] === undefined ? message.replicationType : $root.google.cloud.sql.v1.SqlReplicationType[message.replicationType] : message.replicationType; - if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) - object.storageAutoResizeLimit = $root.google.protobuf.Int64Value.toObject(message.storageAutoResizeLimit, options); - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) + object.storageAutoResizeLimit = $root.google.protobuf.Int64Value.toObject(message.storageAutoResizeLimit, options, q + 1); + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) object.activationPolicy = options.enums === String ? $root.google.cloud.sql.v1.Settings.SqlActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.sql.v1.Settings.SqlActivationPolicy[message.activationPolicy] : message.activationPolicy; - if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) - object.ipConfiguration = $root.google.cloud.sql.v1.IpConfiguration.toObject(message.ipConfiguration, options); - if (message.storageAutoResize != null && message.hasOwnProperty("storageAutoResize")) - object.storageAutoResize = $root.google.protobuf.BoolValue.toObject(message.storageAutoResize, options); - if (message.locationPreference != null && message.hasOwnProperty("locationPreference")) - object.locationPreference = $root.google.cloud.sql.v1.LocationPreference.toObject(message.locationPreference, options); + if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) + object.ipConfiguration = $root.google.cloud.sql.v1.IpConfiguration.toObject(message.ipConfiguration, options, q + 1); + if (message.storageAutoResize != null && Object.hasOwnProperty.call(message, "storageAutoResize")) + object.storageAutoResize = $root.google.protobuf.BoolValue.toObject(message.storageAutoResize, options, q + 1); + if (message.locationPreference != null && Object.hasOwnProperty.call(message, "locationPreference")) + object.locationPreference = $root.google.cloud.sql.v1.LocationPreference.toObject(message.locationPreference, options, q + 1); if (message.databaseFlags && message.databaseFlags.length) { object.databaseFlags = []; for (var j = 0; j < message.databaseFlags.length; ++j) - object.databaseFlags[j] = $root.google.cloud.sql.v1.DatabaseFlags.toObject(message.databaseFlags[j], options); + object.databaseFlags[j] = $root.google.cloud.sql.v1.DatabaseFlags.toObject(message.databaseFlags[j], options, q + 1); } - if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) object.dataDiskType = options.enums === String ? $root.google.cloud.sql.v1.SqlDataDiskType[message.dataDiskType] === undefined ? message.dataDiskType : $root.google.cloud.sql.v1.SqlDataDiskType[message.dataDiskType] : message.dataDiskType; - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) - object.maintenanceWindow = $root.google.cloud.sql.v1.MaintenanceWindow.toObject(message.maintenanceWindow, options); - if (message.backupConfiguration != null && message.hasOwnProperty("backupConfiguration")) - object.backupConfiguration = $root.google.cloud.sql.v1.BackupConfiguration.toObject(message.backupConfiguration, options); - if (message.databaseReplicationEnabled != null && message.hasOwnProperty("databaseReplicationEnabled")) - object.databaseReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.databaseReplicationEnabled, options); - if (message.crashSafeReplicationEnabled != null && message.hasOwnProperty("crashSafeReplicationEnabled")) - object.crashSafeReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.crashSafeReplicationEnabled, options); - if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) - object.dataDiskSizeGb = $root.google.protobuf.Int64Value.toObject(message.dataDiskSizeGb, options); - if (message.activeDirectoryConfig != null && message.hasOwnProperty("activeDirectoryConfig")) - object.activeDirectoryConfig = $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.toObject(message.activeDirectoryConfig, options); - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) + object.maintenanceWindow = $root.google.cloud.sql.v1.MaintenanceWindow.toObject(message.maintenanceWindow, options, q + 1); + if (message.backupConfiguration != null && Object.hasOwnProperty.call(message, "backupConfiguration")) + object.backupConfiguration = $root.google.cloud.sql.v1.BackupConfiguration.toObject(message.backupConfiguration, options, q + 1); + if (message.databaseReplicationEnabled != null && Object.hasOwnProperty.call(message, "databaseReplicationEnabled")) + object.databaseReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.databaseReplicationEnabled, options, q + 1); + if (message.crashSafeReplicationEnabled != null && Object.hasOwnProperty.call(message, "crashSafeReplicationEnabled")) + object.crashSafeReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.crashSafeReplicationEnabled, options, q + 1); + if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) + object.dataDiskSizeGb = $root.google.protobuf.Int64Value.toObject(message.dataDiskSizeGb, options, q + 1); + if (message.activeDirectoryConfig != null && Object.hasOwnProperty.call(message, "activeDirectoryConfig")) + object.activeDirectoryConfig = $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.toObject(message.activeDirectoryConfig, options, q + 1); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) object.collation = message.collation; if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { object.denyMaintenancePeriods = []; for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) - object.denyMaintenancePeriods[j] = $root.google.cloud.sql.v1.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); - } - if (message.insightsConfig != null && message.hasOwnProperty("insightsConfig")) - object.insightsConfig = $root.google.cloud.sql.v1.InsightsConfig.toObject(message.insightsConfig, options); - if (message.passwordValidationPolicy != null && message.hasOwnProperty("passwordValidationPolicy")) - object.passwordValidationPolicy = $root.google.cloud.sql.v1.PasswordValidationPolicy.toObject(message.passwordValidationPolicy, options); - if (message.sqlServerAuditConfig != null && message.hasOwnProperty("sqlServerAuditConfig")) - object.sqlServerAuditConfig = $root.google.cloud.sql.v1.SqlServerAuditConfig.toObject(message.sqlServerAuditConfig, options); - if (message.connectorEnforcement != null && message.hasOwnProperty("connectorEnforcement")) + object.denyMaintenancePeriods[j] = $root.google.cloud.sql.v1.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options, q + 1); + } + if (message.insightsConfig != null && Object.hasOwnProperty.call(message, "insightsConfig")) + object.insightsConfig = $root.google.cloud.sql.v1.InsightsConfig.toObject(message.insightsConfig, options, q + 1); + if (message.passwordValidationPolicy != null && Object.hasOwnProperty.call(message, "passwordValidationPolicy")) + object.passwordValidationPolicy = $root.google.cloud.sql.v1.PasswordValidationPolicy.toObject(message.passwordValidationPolicy, options, q + 1); + if (message.sqlServerAuditConfig != null && Object.hasOwnProperty.call(message, "sqlServerAuditConfig")) + object.sqlServerAuditConfig = $root.google.cloud.sql.v1.SqlServerAuditConfig.toObject(message.sqlServerAuditConfig, options, q + 1); + if (message.connectorEnforcement != null && Object.hasOwnProperty.call(message, "connectorEnforcement")) object.connectorEnforcement = options.enums === String ? $root.google.cloud.sql.v1.Settings.ConnectorEnforcement[message.connectorEnforcement] === undefined ? message.connectorEnforcement : $root.google.cloud.sql.v1.Settings.ConnectorEnforcement[message.connectorEnforcement] : message.connectorEnforcement; - if (message.deletionProtectionEnabled != null && message.hasOwnProperty("deletionProtectionEnabled")) - object.deletionProtectionEnabled = $root.google.protobuf.BoolValue.toObject(message.deletionProtectionEnabled, options); - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.deletionProtectionEnabled != null && Object.hasOwnProperty.call(message, "deletionProtectionEnabled")) + object.deletionProtectionEnabled = $root.google.protobuf.BoolValue.toObject(message.deletionProtectionEnabled, options, q + 1); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) object.timeZone = message.timeZone; - if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) - object.advancedMachineFeatures = $root.google.cloud.sql.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); - if (message.dataCacheConfig != null && message.hasOwnProperty("dataCacheConfig")) - object.dataCacheConfig = $root.google.cloud.sql.v1.DataCacheConfig.toObject(message.dataCacheConfig, options); - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) + object.advancedMachineFeatures = $root.google.cloud.sql.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options, q + 1); + if (message.dataCacheConfig != null && Object.hasOwnProperty.call(message, "dataCacheConfig")) + object.dataCacheConfig = $root.google.cloud.sql.v1.DataCacheConfig.toObject(message.dataCacheConfig, options, q + 1); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) object.edition = options.enums === String ? $root.google.cloud.sql.v1.Settings.Edition[message.edition] === undefined ? message.edition : $root.google.cloud.sql.v1.Settings.Edition[message.edition] : message.edition; - if (message.replicationLagMaxSeconds != null && message.hasOwnProperty("replicationLagMaxSeconds")) - object.replicationLagMaxSeconds = $root.google.protobuf.Int32Value.toObject(message.replicationLagMaxSeconds, options); - if (message.enableGoogleMlIntegration != null && message.hasOwnProperty("enableGoogleMlIntegration")) - object.enableGoogleMlIntegration = $root.google.protobuf.BoolValue.toObject(message.enableGoogleMlIntegration, options); - if (message.enableDataplexIntegration != null && message.hasOwnProperty("enableDataplexIntegration")) - object.enableDataplexIntegration = $root.google.protobuf.BoolValue.toObject(message.enableDataplexIntegration, options); - if (message.retainBackupsOnDelete != null && message.hasOwnProperty("retainBackupsOnDelete")) - object.retainBackupsOnDelete = $root.google.protobuf.BoolValue.toObject(message.retainBackupsOnDelete, options); - if (message.dataDiskProvisionedIops != null && message.hasOwnProperty("dataDiskProvisionedIops")) { - if (typeof message.dataDiskProvisionedIops === "number") + if (message.replicationLagMaxSeconds != null && Object.hasOwnProperty.call(message, "replicationLagMaxSeconds")) + object.replicationLagMaxSeconds = $root.google.protobuf.Int32Value.toObject(message.replicationLagMaxSeconds, options, q + 1); + if (message.enableGoogleMlIntegration != null && Object.hasOwnProperty.call(message, "enableGoogleMlIntegration")) + object.enableGoogleMlIntegration = $root.google.protobuf.BoolValue.toObject(message.enableGoogleMlIntegration, options, q + 1); + if (message.enableDataplexIntegration != null && Object.hasOwnProperty.call(message, "enableDataplexIntegration")) + object.enableDataplexIntegration = $root.google.protobuf.BoolValue.toObject(message.enableDataplexIntegration, options, q + 1); + if (message.retainBackupsOnDelete != null && Object.hasOwnProperty.call(message, "retainBackupsOnDelete")) + object.retainBackupsOnDelete = $root.google.protobuf.BoolValue.toObject(message.retainBackupsOnDelete, options, q + 1); + if (message.dataDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedIops")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.dataDiskProvisionedIops = typeof message.dataDiskProvisionedIops === "number" ? BigInt(message.dataDiskProvisionedIops) : $util.Long.fromBits(message.dataDiskProvisionedIops.low >>> 0, message.dataDiskProvisionedIops.high >>> 0, false).toBigInt(); + else if (typeof message.dataDiskProvisionedIops === "number") object.dataDiskProvisionedIops = options.longs === String ? String(message.dataDiskProvisionedIops) : message.dataDiskProvisionedIops; else object.dataDiskProvisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.dataDiskProvisionedIops) : options.longs === Number ? new $util.LongBits(message.dataDiskProvisionedIops.low >>> 0, message.dataDiskProvisionedIops.high >>> 0).toNumber() : message.dataDiskProvisionedIops; if (options.oneofs) object._dataDiskProvisionedIops = "dataDiskProvisionedIops"; } - if (message.dataDiskProvisionedThroughput != null && message.hasOwnProperty("dataDiskProvisionedThroughput")) { - if (typeof message.dataDiskProvisionedThroughput === "number") + if (message.dataDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedThroughput")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.dataDiskProvisionedThroughput = typeof message.dataDiskProvisionedThroughput === "number" ? BigInt(message.dataDiskProvisionedThroughput) : $util.Long.fromBits(message.dataDiskProvisionedThroughput.low >>> 0, message.dataDiskProvisionedThroughput.high >>> 0, false).toBigInt(); + else if (typeof message.dataDiskProvisionedThroughput === "number") object.dataDiskProvisionedThroughput = options.longs === String ? String(message.dataDiskProvisionedThroughput) : message.dataDiskProvisionedThroughput; else object.dataDiskProvisionedThroughput = options.longs === String ? $util.Long.prototype.toString.call(message.dataDiskProvisionedThroughput) : options.longs === Number ? new $util.LongBits(message.dataDiskProvisionedThroughput.low >>> 0, message.dataDiskProvisionedThroughput.high >>> 0).toNumber() : message.dataDiskProvisionedThroughput; if (options.oneofs) object._dataDiskProvisionedThroughput = "dataDiskProvisionedThroughput"; } - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { - object.connectionPoolConfig = $root.google.cloud.sql.v1.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); + if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) { + object.connectionPoolConfig = $root.google.cloud.sql.v1.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options, q + 1); if (options.oneofs) object._connectionPoolConfig = "connectionPoolConfig"; } - if (message.finalBackupConfig != null && message.hasOwnProperty("finalBackupConfig")) { - object.finalBackupConfig = $root.google.cloud.sql.v1.FinalBackupConfig.toObject(message.finalBackupConfig, options); + if (message.finalBackupConfig != null && Object.hasOwnProperty.call(message, "finalBackupConfig")) { + object.finalBackupConfig = $root.google.cloud.sql.v1.FinalBackupConfig.toObject(message.finalBackupConfig, options, q + 1); if (options.oneofs) object._finalBackupConfig = "finalBackupConfig"; } - if (message.readPoolAutoScaleConfig != null && message.hasOwnProperty("readPoolAutoScaleConfig")) { - object.readPoolAutoScaleConfig = $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.toObject(message.readPoolAutoScaleConfig, options); + if (message.readPoolAutoScaleConfig != null && Object.hasOwnProperty.call(message, "readPoolAutoScaleConfig")) { + object.readPoolAutoScaleConfig = $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.toObject(message.readPoolAutoScaleConfig, options, q + 1); if (options.oneofs) object._readPoolAutoScaleConfig = "readPoolAutoScaleConfig"; } - if (message.acceleratedReplicaMode != null && message.hasOwnProperty("acceleratedReplicaMode")) - object.acceleratedReplicaMode = $root.google.protobuf.BoolValue.toObject(message.acceleratedReplicaMode, options); - if (message.autoUpgradeEnabled != null && message.hasOwnProperty("autoUpgradeEnabled")) { + if (message.acceleratedReplicaMode != null && Object.hasOwnProperty.call(message, "acceleratedReplicaMode")) + object.acceleratedReplicaMode = $root.google.protobuf.BoolValue.toObject(message.acceleratedReplicaMode, options, q + 1); + if (message.autoUpgradeEnabled != null && Object.hasOwnProperty.call(message, "autoUpgradeEnabled")) { object.autoUpgradeEnabled = message.autoUpgradeEnabled; if (options.oneofs) object._autoUpgradeEnabled = "autoUpgradeEnabled"; } - if (message.entraidConfig != null && message.hasOwnProperty("entraidConfig")) - object.entraidConfig = $root.google.cloud.sql.v1.SqlServerEntraIdConfig.toObject(message.entraidConfig, options); - if (message.dataApiAccess != null && message.hasOwnProperty("dataApiAccess")) { + if (message.entraidConfig != null && Object.hasOwnProperty.call(message, "entraidConfig")) + object.entraidConfig = $root.google.cloud.sql.v1.SqlServerEntraIdConfig.toObject(message.entraidConfig, options, q + 1); + if (message.dataApiAccess != null && Object.hasOwnProperty.call(message, "dataApiAccess")) { object.dataApiAccess = options.enums === String ? $root.google.cloud.sql.v1.Settings.DataApiAccess[message.dataApiAccess] === undefined ? message.dataApiAccess : $root.google.cloud.sql.v1.Settings.DataApiAccess[message.dataApiAccess] : message.dataApiAccess; if (options.oneofs) object._dataApiAccess = "dataApiAccess"; } - if (message.performanceCaptureConfig != null && message.hasOwnProperty("performanceCaptureConfig")) - object.performanceCaptureConfig = $root.google.cloud.sql.v1.PerformanceCaptureConfig.toObject(message.performanceCaptureConfig, options); + if (message.performanceCaptureConfig != null && Object.hasOwnProperty.call(message, "performanceCaptureConfig")) + object.performanceCaptureConfig = $root.google.cloud.sql.v1.PerformanceCaptureConfig.toObject(message.performanceCaptureConfig, options, q + 1); return object; }; @@ -21468,9 +22034,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerformanceCaptureConfig.encode = function encode(message, writer) { + PerformanceCaptureConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); if (message.probingIntervalSeconds != null && Object.hasOwnProperty.call(message, "probingIntervalSeconds")) @@ -21496,7 +22066,7 @@ * @returns {$protobuf.Writer} Writer */ PerformanceCaptureConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -21587,32 +22157,32 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { properties._enabled = 1; if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; } - if (message.probingIntervalSeconds != null && message.hasOwnProperty("probingIntervalSeconds")) { + if (message.probingIntervalSeconds != null && Object.hasOwnProperty.call(message, "probingIntervalSeconds")) { properties._probingIntervalSeconds = 1; if (!$util.isInteger(message.probingIntervalSeconds)) return "probingIntervalSeconds: integer expected"; } - if (message.probeThreshold != null && message.hasOwnProperty("probeThreshold")) { + if (message.probeThreshold != null && Object.hasOwnProperty.call(message, "probeThreshold")) { properties._probeThreshold = 1; if (!$util.isInteger(message.probeThreshold)) return "probeThreshold: integer expected"; } - if (message.runningThreadsThreshold != null && message.hasOwnProperty("runningThreadsThreshold")) { + if (message.runningThreadsThreshold != null && Object.hasOwnProperty.call(message, "runningThreadsThreshold")) { properties._runningThreadsThreshold = 1; if (!$util.isInteger(message.runningThreadsThreshold)) return "runningThreadsThreshold: integer expected"; } - if (message.secondsBehindSourceThreshold != null && message.hasOwnProperty("secondsBehindSourceThreshold")) { + if (message.secondsBehindSourceThreshold != null && Object.hasOwnProperty.call(message, "secondsBehindSourceThreshold")) { properties._secondsBehindSourceThreshold = 1; if (!$util.isInteger(message.secondsBehindSourceThreshold)) return "secondsBehindSourceThreshold: integer expected"; } - if (message.transactionDurationThreshold != null && message.hasOwnProperty("transactionDurationThreshold")) { + if (message.transactionDurationThreshold != null && Object.hasOwnProperty.call(message, "transactionDurationThreshold")) { properties._transactionDurationThreshold = 1; if (!$util.isInteger(message.transactionDurationThreshold)) return "transactionDurationThreshold: integer expected"; @@ -21631,6 +22201,8 @@ PerformanceCaptureConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PerformanceCaptureConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PerformanceCaptureConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21660,36 +22232,40 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PerformanceCaptureConfig.toObject = function toObject(message, options) { + PerformanceCaptureConfig.toObject = function 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.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { object.enabled = message.enabled; if (options.oneofs) object._enabled = "enabled"; } - if (message.probingIntervalSeconds != null && message.hasOwnProperty("probingIntervalSeconds")) { + if (message.probingIntervalSeconds != null && Object.hasOwnProperty.call(message, "probingIntervalSeconds")) { object.probingIntervalSeconds = message.probingIntervalSeconds; if (options.oneofs) object._probingIntervalSeconds = "probingIntervalSeconds"; } - if (message.probeThreshold != null && message.hasOwnProperty("probeThreshold")) { + if (message.probeThreshold != null && Object.hasOwnProperty.call(message, "probeThreshold")) { object.probeThreshold = message.probeThreshold; if (options.oneofs) object._probeThreshold = "probeThreshold"; } - if (message.runningThreadsThreshold != null && message.hasOwnProperty("runningThreadsThreshold")) { + if (message.runningThreadsThreshold != null && Object.hasOwnProperty.call(message, "runningThreadsThreshold")) { object.runningThreadsThreshold = message.runningThreadsThreshold; if (options.oneofs) object._runningThreadsThreshold = "runningThreadsThreshold"; } - if (message.secondsBehindSourceThreshold != null && message.hasOwnProperty("secondsBehindSourceThreshold")) { + if (message.secondsBehindSourceThreshold != null && Object.hasOwnProperty.call(message, "secondsBehindSourceThreshold")) { object.secondsBehindSourceThreshold = message.secondsBehindSourceThreshold; if (options.oneofs) object._secondsBehindSourceThreshold = "secondsBehindSourceThreshold"; } - if (message.transactionDurationThreshold != null && message.hasOwnProperty("transactionDurationThreshold")) { + if (message.transactionDurationThreshold != null && Object.hasOwnProperty.call(message, "transactionDurationThreshold")) { object.transactionDurationThreshold = message.transactionDurationThreshold; if (options.oneofs) object._transactionDurationThreshold = "transactionDurationThreshold"; @@ -21788,9 +22364,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectionPoolFlags.encode = function encode(message, writer) { + ConnectionPoolFlags.encode = function encode(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 && Object.hasOwnProperty.call(message, "value")) @@ -21808,7 +22388,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectionPoolFlags.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -21882,10 +22462,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 (!$util.isString(message.value)) return "value: string expected"; return null; @@ -21902,6 +22482,8 @@ ConnectionPoolFlags.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ConnectionPoolFlags) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ConnectionPoolFlags: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -21923,17 +22505,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectionPoolFlags.toObject = function toObject(message, options) { + ConnectionPoolFlags.toObject = function toObject(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.value = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -22054,14 +22640,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectionPoolConfig.encode = function encode(message, writer) { + ConnectionPoolConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.connectionPoolingEnabled != null && Object.hasOwnProperty.call(message, "connectionPoolingEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.connectionPoolingEnabled); if (message.flags != null && message.flags.length) for (var i = 0; i < message.flags.length; ++i) - $root.google.cloud.sql.v1.ConnectionPoolFlags.encode(message.flags[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1.ConnectionPoolFlags.encode(message.flags[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.poolerCount); return writer; @@ -22077,7 +22667,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -22158,12 +22748,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.connectionPoolingEnabled != null && message.hasOwnProperty("connectionPoolingEnabled")) { + if (message.connectionPoolingEnabled != null && Object.hasOwnProperty.call(message, "connectionPoolingEnabled")) { properties._connectionPoolingEnabled = 1; if (typeof message.connectionPoolingEnabled !== "boolean") return "connectionPoolingEnabled: boolean expected"; } - if (message.flags != null && message.hasOwnProperty("flags")) { + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) { if (!Array.isArray(message.flags)) return "flags: array expected"; for (var i = 0; i < message.flags.length; ++i) { @@ -22172,7 +22762,7 @@ return "flags." + error; } } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) { + if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) { properties._poolerCount = 1; if (!$util.isInteger(message.poolerCount)) return "poolerCount: integer expected"; @@ -22191,6 +22781,8 @@ ConnectionPoolConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ConnectionPoolConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ConnectionPoolConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22203,7 +22795,7 @@ throw TypeError(".google.cloud.sql.v1.ConnectionPoolConfig.flags: array expected"); message.flags = []; for (var i = 0; i < object.flags.length; ++i) { - if (typeof object.flags[i] !== "object") + if (!$util.isObject(object.flags[i])) throw TypeError(".google.cloud.sql.v1.ConnectionPoolConfig.flags: object expected"); message.flags[i] = $root.google.cloud.sql.v1.ConnectionPoolFlags.fromObject(object.flags[i], long + 1); } @@ -22222,13 +22814,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectionPoolConfig.toObject = function toObject(message, options) { + ConnectionPoolConfig.toObject = function toObject(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.flags = []; - if (message.connectionPoolingEnabled != null && message.hasOwnProperty("connectionPoolingEnabled")) { + if (message.connectionPoolingEnabled != null && Object.hasOwnProperty.call(message, "connectionPoolingEnabled")) { object.connectionPoolingEnabled = message.connectionPoolingEnabled; if (options.oneofs) object._connectionPoolingEnabled = "connectionPoolingEnabled"; @@ -22236,9 +22832,9 @@ if (message.flags && message.flags.length) { object.flags = []; for (var j = 0; j < message.flags.length; ++j) - object.flags[j] = $root.google.cloud.sql.v1.ConnectionPoolFlags.toObject(message.flags[j], options); + object.flags[j] = $root.google.cloud.sql.v1.ConnectionPoolFlags.toObject(message.flags[j], options, q + 1); } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) { + if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) { object.poolerCount = message.poolerCount; if (options.oneofs) object._poolerCount = "poolerCount"; @@ -22422,9 +23018,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadPoolAutoScaleConfig.encode = function encode(message, writer) { + ReadPoolAutoScaleConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) @@ -22433,7 +23033,7 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodeCount); if (message.targetMetrics != null && message.targetMetrics.length) for (var i = 0; i < message.targetMetrics.length; ++i) - $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.encode(message.targetMetrics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.encode(message.targetMetrics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.disableScaleIn != null && Object.hasOwnProperty.call(message, "disableScaleIn")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableScaleIn); if (message.scaleInCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleInCooldownSeconds")) @@ -22453,7 +23053,7 @@ * @returns {$protobuf.Writer} Writer */ ReadPoolAutoScaleConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -22550,22 +23150,22 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { properties._enabled = 1; if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; } - if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) { + if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) { properties._minNodeCount = 1; if (!$util.isInteger(message.minNodeCount)) return "minNodeCount: integer expected"; } - if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) { + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) { properties._maxNodeCount = 1; if (!$util.isInteger(message.maxNodeCount)) return "maxNodeCount: integer expected"; } - if (message.targetMetrics != null && message.hasOwnProperty("targetMetrics")) { + if (message.targetMetrics != null && Object.hasOwnProperty.call(message, "targetMetrics")) { if (!Array.isArray(message.targetMetrics)) return "targetMetrics: array expected"; for (var i = 0; i < message.targetMetrics.length; ++i) { @@ -22574,17 +23174,17 @@ return "targetMetrics." + error; } } - if (message.disableScaleIn != null && message.hasOwnProperty("disableScaleIn")) { + if (message.disableScaleIn != null && Object.hasOwnProperty.call(message, "disableScaleIn")) { properties._disableScaleIn = 1; if (typeof message.disableScaleIn !== "boolean") return "disableScaleIn: boolean expected"; } - if (message.scaleInCooldownSeconds != null && message.hasOwnProperty("scaleInCooldownSeconds")) { + if (message.scaleInCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleInCooldownSeconds")) { properties._scaleInCooldownSeconds = 1; if (!$util.isInteger(message.scaleInCooldownSeconds)) return "scaleInCooldownSeconds: integer expected"; } - if (message.scaleOutCooldownSeconds != null && message.hasOwnProperty("scaleOutCooldownSeconds")) { + if (message.scaleOutCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleOutCooldownSeconds")) { properties._scaleOutCooldownSeconds = 1; if (!$util.isInteger(message.scaleOutCooldownSeconds)) return "scaleOutCooldownSeconds: integer expected"; @@ -22603,6 +23203,8 @@ ReadPoolAutoScaleConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ReadPoolAutoScaleConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22619,7 +23221,7 @@ throw TypeError(".google.cloud.sql.v1.ReadPoolAutoScaleConfig.targetMetrics: array expected"); message.targetMetrics = []; for (var i = 0; i < object.targetMetrics.length; ++i) { - if (typeof object.targetMetrics[i] !== "object") + if (!$util.isObject(object.targetMetrics[i])) throw TypeError(".google.cloud.sql.v1.ReadPoolAutoScaleConfig.targetMetrics: object expected"); message.targetMetrics[i] = $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.fromObject(object.targetMetrics[i], long + 1); } @@ -22642,23 +23244,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadPoolAutoScaleConfig.toObject = function toObject(message, options) { + ReadPoolAutoScaleConfig.toObject = function toObject(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.targetMetrics = []; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { object.enabled = message.enabled; if (options.oneofs) object._enabled = "enabled"; } - if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) { + if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) { object.minNodeCount = message.minNodeCount; if (options.oneofs) object._minNodeCount = "minNodeCount"; } - if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) { + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) { object.maxNodeCount = message.maxNodeCount; if (options.oneofs) object._maxNodeCount = "maxNodeCount"; @@ -22666,19 +23272,19 @@ if (message.targetMetrics && message.targetMetrics.length) { object.targetMetrics = []; for (var j = 0; j < message.targetMetrics.length; ++j) - object.targetMetrics[j] = $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.toObject(message.targetMetrics[j], options); + object.targetMetrics[j] = $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric.toObject(message.targetMetrics[j], options, q + 1); } - if (message.disableScaleIn != null && message.hasOwnProperty("disableScaleIn")) { + if (message.disableScaleIn != null && Object.hasOwnProperty.call(message, "disableScaleIn")) { object.disableScaleIn = message.disableScaleIn; if (options.oneofs) object._disableScaleIn = "disableScaleIn"; } - if (message.scaleInCooldownSeconds != null && message.hasOwnProperty("scaleInCooldownSeconds")) { + if (message.scaleInCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleInCooldownSeconds")) { object.scaleInCooldownSeconds = message.scaleInCooldownSeconds; if (options.oneofs) object._scaleInCooldownSeconds = "scaleInCooldownSeconds"; } - if (message.scaleOutCooldownSeconds != null && message.hasOwnProperty("scaleOutCooldownSeconds")) { + if (message.scaleOutCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleOutCooldownSeconds")) { object.scaleOutCooldownSeconds = message.scaleOutCooldownSeconds; if (options.oneofs) object._scaleOutCooldownSeconds = "scaleOutCooldownSeconds"; @@ -22789,9 +23395,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TargetMetric.encode = function encode(message, writer) { + TargetMetric.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.metric); if (message.targetValue != null && Object.hasOwnProperty.call(message, "targetValue")) @@ -22809,7 +23419,7 @@ * @returns {$protobuf.Writer} Writer */ TargetMetric.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -22884,12 +23494,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.metric != null && message.hasOwnProperty("metric")) { + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) { properties._metric = 1; if (!$util.isString(message.metric)) return "metric: string expected"; } - if (message.targetValue != null && message.hasOwnProperty("targetValue")) { + if (message.targetValue != null && Object.hasOwnProperty.call(message, "targetValue")) { properties._targetValue = 1; if (typeof message.targetValue !== "number") return "targetValue: number expected"; @@ -22908,6 +23518,8 @@ TargetMetric.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ReadPoolAutoScaleConfig.TargetMetric: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -22929,16 +23541,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TargetMetric.toObject = function toObject(message, options) { + TargetMetric.toObject = function 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.metric != null && message.hasOwnProperty("metric")) { + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) { object.metric = message.metric; if (options.oneofs) object._metric = "metric"; } - if (message.targetValue != null && message.hasOwnProperty("targetValue")) { + if (message.targetValue != null && Object.hasOwnProperty.call(message, "targetValue")) { object.targetValue = options.json && !isFinite(message.targetValue) ? String(message.targetValue) : message.targetValue; if (options.oneofs) object._targetValue = "targetValue"; @@ -23031,9 +23647,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdvancedMachineFeatures.encode = function encode(message, writer) { + AdvancedMachineFeatures.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.threadsPerCore); return writer; @@ -23049,7 +23669,7 @@ * @returns {$protobuf.Writer} Writer */ AdvancedMachineFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -23119,7 +23739,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) if (!$util.isInteger(message.threadsPerCore)) return "threadsPerCore: integer expected"; return null; @@ -23136,6 +23756,8 @@ AdvancedMachineFeatures.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.AdvancedMachineFeatures) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.AdvancedMachineFeatures: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -23155,13 +23777,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdvancedMachineFeatures.toObject = function toObject(message, options) { + AdvancedMachineFeatures.toObject = function toObject(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.threadsPerCore = 0; - if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) object.threadsPerCore = message.threadsPerCore; return object; }; @@ -23320,9 +23946,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCert.encode = function encode(message, writer) { + SslCert.encode = function encode(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.certSerialNumber != null && Object.hasOwnProperty.call(message, "certSerialNumber")) @@ -23330,11 +23960,11 @@ if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.cert); 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.commonName != null && Object.hasOwnProperty.call(message, "commonName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.commonName); if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) - $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.sha1Fingerprint); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -23354,7 +23984,7 @@ * @returns {$protobuf.Writer} Writer */ SslCert.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -23456,35 +24086,35 @@ 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.certSerialNumber != null && message.hasOwnProperty("certSerialNumber")) + if (message.certSerialNumber != null && Object.hasOwnProperty.call(message, "certSerialNumber")) if (!$util.isString(message.certSerialNumber)) return "certSerialNumber: string expected"; - if (message.cert != null && message.hasOwnProperty("cert")) + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) if (!$util.isString(message.cert)) return "cert: 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.commonName != null && message.hasOwnProperty("commonName")) + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) if (!$util.isString(message.commonName)) return "commonName: string expected"; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) { + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expirationTime, long + 1); if (error) return "expirationTime." + error; } - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) if (!$util.isString(message.sha1Fingerprint)) return "sha1Fingerprint: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; return null; @@ -23501,6 +24131,8 @@ SslCert.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SslCert) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SslCert: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -23513,14 +24145,14 @@ if (object.cert != null) message.cert = String(object.cert); if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.cloud.sql.v1.SslCert.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.commonName != null) message.commonName = String(object.commonName); if (object.expirationTime != null) { - if (typeof object.expirationTime !== "object") + if (!$util.isObject(object.expirationTime)) throw TypeError(".google.cloud.sql.v1.SslCert.expirationTime: object expected"); message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime, long + 1); } @@ -23542,9 +24174,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCert.toObject = function toObject(message, options) { + SslCert.toObject = function toObject(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 = ""; @@ -23557,23 +24193,23 @@ object.instance = ""; object.selfLink = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.certSerialNumber != null && message.hasOwnProperty("certSerialNumber")) + if (message.certSerialNumber != null && Object.hasOwnProperty.call(message, "certSerialNumber")) object.certSerialNumber = message.certSerialNumber; - if (message.cert != null && message.hasOwnProperty("cert")) + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) object.cert = message.cert; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.commonName != null && message.hasOwnProperty("commonName")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) object.commonName = message.commonName; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) - object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options); - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options, q + 1); + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) object.sha1Fingerprint = message.sha1Fingerprint; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; return object; }; @@ -23669,11 +24305,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertDetail.encode = function encode(message, writer) { + SslCertDetail.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certInfo != null && Object.hasOwnProperty.call(message, "certInfo")) - $root.google.cloud.sql.v1.SslCert.encode(message.certInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.certInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.certPrivateKey != null && Object.hasOwnProperty.call(message, "certPrivateKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.certPrivateKey); return writer; @@ -23689,7 +24329,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertDetail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -23763,12 +24403,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certInfo != null && message.hasOwnProperty("certInfo")) { + if (message.certInfo != null && Object.hasOwnProperty.call(message, "certInfo")) { var error = $root.google.cloud.sql.v1.SslCert.verify(message.certInfo, long + 1); if (error) return "certInfo." + error; } - if (message.certPrivateKey != null && message.hasOwnProperty("certPrivateKey")) + if (message.certPrivateKey != null && Object.hasOwnProperty.call(message, "certPrivateKey")) if (!$util.isString(message.certPrivateKey)) return "certPrivateKey: string expected"; return null; @@ -23785,13 +24425,15 @@ SslCertDetail.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SslCertDetail) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SslCertDetail: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.SslCertDetail(); if (object.certInfo != null) { - if (typeof object.certInfo !== "object") + if (!$util.isObject(object.certInfo)) throw TypeError(".google.cloud.sql.v1.SslCertDetail.certInfo: object expected"); message.certInfo = $root.google.cloud.sql.v1.SslCert.fromObject(object.certInfo, long + 1); } @@ -23809,17 +24451,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertDetail.toObject = function toObject(message, options) { + SslCertDetail.toObject = function toObject(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.certInfo = null; object.certPrivateKey = ""; } - if (message.certInfo != null && message.hasOwnProperty("certInfo")) - object.certInfo = $root.google.cloud.sql.v1.SslCert.toObject(message.certInfo, options); - if (message.certPrivateKey != null && message.hasOwnProperty("certPrivateKey")) + if (message.certInfo != null && Object.hasOwnProperty.call(message, "certInfo")) + object.certInfo = $root.google.cloud.sql.v1.SslCert.toObject(message.certInfo, options, q + 1); + if (message.certPrivateKey != null && Object.hasOwnProperty.call(message, "certPrivateKey")) object.certPrivateKey = message.certPrivateKey; return object; }; @@ -23952,9 +24598,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlActiveDirectoryConfig.encode = function encode(message, writer) { + SqlActiveDirectoryConfig.encode = function encode(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.domain != null && Object.hasOwnProperty.call(message, "domain")) @@ -23981,7 +24631,7 @@ * @returns {$protobuf.Writer} Writer */ SqlActiveDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -24073,13 +24723,13 @@ 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.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.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) switch (message.mode) { default: return "mode: enum value expected"; @@ -24089,17 +24739,17 @@ case 3: break; } - if (message.dnsServers != null && message.hasOwnProperty("dnsServers")) { + if (message.dnsServers != null && Object.hasOwnProperty.call(message, "dnsServers")) { if (!Array.isArray(message.dnsServers)) return "dnsServers: array expected"; for (var i = 0; i < message.dnsServers.length; ++i) if (!$util.isString(message.dnsServers[i])) return "dnsServers: string[] expected"; } - if (message.adminCredentialSecretName != null && message.hasOwnProperty("adminCredentialSecretName")) + if (message.adminCredentialSecretName != null && Object.hasOwnProperty.call(message, "adminCredentialSecretName")) if (!$util.isString(message.adminCredentialSecretName)) return "adminCredentialSecretName: string expected"; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) if (!$util.isString(message.organizationalUnit)) return "organizationalUnit: string expected"; return null; @@ -24116,6 +24766,8 @@ SqlActiveDirectoryConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlActiveDirectoryConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlActiveDirectoryConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24172,9 +24824,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlActiveDirectoryConfig.toObject = function toObject(message, options) { + SqlActiveDirectoryConfig.toObject = function toObject(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.dnsServers = []; @@ -24185,20 +24841,20 @@ object.adminCredentialSecretName = ""; object.organizationalUnit = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.domain != null && message.hasOwnProperty("domain")) + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) object.domain = message.domain; - if (message.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) object.mode = options.enums === String ? $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode[message.mode] === undefined ? message.mode : $root.google.cloud.sql.v1.SqlActiveDirectoryConfig.ActiveDirectoryMode[message.mode] : message.mode; if (message.dnsServers && message.dnsServers.length) { object.dnsServers = []; for (var j = 0; j < message.dnsServers.length; ++j) object.dnsServers[j] = message.dnsServers[j]; } - if (message.adminCredentialSecretName != null && message.hasOwnProperty("adminCredentialSecretName")) + if (message.adminCredentialSecretName != null && Object.hasOwnProperty.call(message, "adminCredentialSecretName")) object.adminCredentialSecretName = message.adminCredentialSecretName; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) object.organizationalUnit = message.organizationalUnit; return object; }; @@ -24330,17 +24986,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerAuditConfig.encode = function encode(message, writer) { + SqlServerAuditConfig.encode = function encode(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.bucket != null && Object.hasOwnProperty.call(message, "bucket")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.bucket); if (message.retentionInterval != null && Object.hasOwnProperty.call(message, "retentionInterval")) - $root.google.protobuf.Duration.encode(message.retentionInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.retentionInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.uploadInterval != null && Object.hasOwnProperty.call(message, "uploadInterval")) - $root.google.protobuf.Duration.encode(message.uploadInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.uploadInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -24354,7 +25014,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerAuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -24436,18 +25096,18 @@ 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.bucket != null && message.hasOwnProperty("bucket")) + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.retentionInterval != null && message.hasOwnProperty("retentionInterval")) { + if (message.retentionInterval != null && Object.hasOwnProperty.call(message, "retentionInterval")) { var error = $root.google.protobuf.Duration.verify(message.retentionInterval, long + 1); if (error) return "retentionInterval." + error; } - if (message.uploadInterval != null && message.hasOwnProperty("uploadInterval")) { + if (message.uploadInterval != null && Object.hasOwnProperty.call(message, "uploadInterval")) { var error = $root.google.protobuf.Duration.verify(message.uploadInterval, long + 1); if (error) return "uploadInterval." + error; @@ -24466,6 +25126,8 @@ SqlServerAuditConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlServerAuditConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlServerAuditConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24476,12 +25138,12 @@ if (object.bucket != null) message.bucket = String(object.bucket); if (object.retentionInterval != null) { - if (typeof object.retentionInterval !== "object") + if (!$util.isObject(object.retentionInterval)) throw TypeError(".google.cloud.sql.v1.SqlServerAuditConfig.retentionInterval: object expected"); message.retentionInterval = $root.google.protobuf.Duration.fromObject(object.retentionInterval, long + 1); } if (object.uploadInterval != null) { - if (typeof object.uploadInterval !== "object") + if (!$util.isObject(object.uploadInterval)) throw TypeError(".google.cloud.sql.v1.SqlServerAuditConfig.uploadInterval: object expected"); message.uploadInterval = $root.google.protobuf.Duration.fromObject(object.uploadInterval, long + 1); } @@ -24497,9 +25159,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerAuditConfig.toObject = function toObject(message, options) { + SqlServerAuditConfig.toObject = function toObject(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 = ""; @@ -24507,14 +25173,14 @@ object.retentionInterval = null; object.uploadInterval = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.bucket != null && message.hasOwnProperty("bucket")) + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) object.bucket = message.bucket; - if (message.retentionInterval != null && message.hasOwnProperty("retentionInterval")) - object.retentionInterval = $root.google.protobuf.Duration.toObject(message.retentionInterval, options); - if (message.uploadInterval != null && message.hasOwnProperty("uploadInterval")) - object.uploadInterval = $root.google.protobuf.Duration.toObject(message.uploadInterval, options); + if (message.retentionInterval != null && Object.hasOwnProperty.call(message, "retentionInterval")) + object.retentionInterval = $root.google.protobuf.Duration.toObject(message.retentionInterval, options, q + 1); + if (message.uploadInterval != null && Object.hasOwnProperty.call(message, "uploadInterval")) + object.uploadInterval = $root.google.protobuf.Duration.toObject(message.uploadInterval, options, q + 1); return object; }; @@ -24618,9 +25284,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerEntraIdConfig.encode = function encode(message, writer) { + SqlServerEntraIdConfig.encode = function encode(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.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) @@ -24640,7 +25310,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerEntraIdConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -24718,13 +25388,13 @@ 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.tenantId != null && message.hasOwnProperty("tenantId")) + if (message.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) if (!$util.isString(message.tenantId)) return "tenantId: string expected"; - if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) if (!$util.isString(message.applicationId)) return "applicationId: string expected"; return null; @@ -24741,6 +25411,8 @@ SqlServerEntraIdConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlServerEntraIdConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlServerEntraIdConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -24764,20 +25436,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerEntraIdConfig.toObject = function toObject(message, options) { + SqlServerEntraIdConfig.toObject = function toObject(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.tenantId = ""; object.applicationId = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.tenantId != null && message.hasOwnProperty("tenantId")) + if (message.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) object.tenantId = message.tenantId; - if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) object.applicationId = message.applicationId; return object; }; @@ -25162,9 +25838,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AcquireSsrsLeaseContext.encode = function encode(message, writer) { + AcquireSsrsLeaseContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.setupLogin != null && Object.hasOwnProperty.call(message, "setupLogin")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.setupLogin); if (message.serviceLogin != null && Object.hasOwnProperty.call(message, "serviceLogin")) @@ -25172,7 +25852,7 @@ if (message.reportDatabase != null && Object.hasOwnProperty.call(message, "reportDatabase")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.reportDatabase); if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -25186,7 +25866,7 @@ * @returns {$protobuf.Writer} Writer */ AcquireSsrsLeaseContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -25269,22 +25949,22 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.setupLogin != null && message.hasOwnProperty("setupLogin")) { + if (message.setupLogin != null && Object.hasOwnProperty.call(message, "setupLogin")) { properties._setupLogin = 1; if (!$util.isString(message.setupLogin)) return "setupLogin: string expected"; } - if (message.serviceLogin != null && message.hasOwnProperty("serviceLogin")) { + if (message.serviceLogin != null && Object.hasOwnProperty.call(message, "serviceLogin")) { properties._serviceLogin = 1; if (!$util.isString(message.serviceLogin)) return "serviceLogin: string expected"; } - if (message.reportDatabase != null && message.hasOwnProperty("reportDatabase")) { + if (message.reportDatabase != null && Object.hasOwnProperty.call(message, "reportDatabase")) { properties._reportDatabase = 1; if (!$util.isString(message.reportDatabase)) return "reportDatabase: string expected"; } - if (message.duration != null && message.hasOwnProperty("duration")) { + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) { properties._duration = 1; { var error = $root.google.protobuf.Duration.verify(message.duration, long + 1); @@ -25306,6 +25986,8 @@ AcquireSsrsLeaseContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.AcquireSsrsLeaseContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.AcquireSsrsLeaseContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25318,7 +26000,7 @@ if (object.reportDatabase != null) message.reportDatabase = String(object.reportDatabase); if (object.duration != null) { - if (typeof object.duration !== "object") + if (!$util.isObject(object.duration)) throw TypeError(".google.cloud.sql.v1.AcquireSsrsLeaseContext.duration: object expected"); message.duration = $root.google.protobuf.Duration.fromObject(object.duration, long + 1); } @@ -25334,27 +26016,31 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AcquireSsrsLeaseContext.toObject = function toObject(message, options) { + AcquireSsrsLeaseContext.toObject = function 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.setupLogin != null && message.hasOwnProperty("setupLogin")) { + if (message.setupLogin != null && Object.hasOwnProperty.call(message, "setupLogin")) { object.setupLogin = message.setupLogin; if (options.oneofs) object._setupLogin = "setupLogin"; } - if (message.serviceLogin != null && message.hasOwnProperty("serviceLogin")) { + if (message.serviceLogin != null && Object.hasOwnProperty.call(message, "serviceLogin")) { object.serviceLogin = message.serviceLogin; if (options.oneofs) object._serviceLogin = "serviceLogin"; } - if (message.reportDatabase != null && message.hasOwnProperty("reportDatabase")) { + if (message.reportDatabase != null && Object.hasOwnProperty.call(message, "reportDatabase")) { object.reportDatabase = message.reportDatabase; if (options.oneofs) object._reportDatabase = "reportDatabase"; } - if (message.duration != null && message.hasOwnProperty("duration")) { - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) { + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options, q + 1); if (options.oneofs) object._duration = "duration"; } @@ -25470,9 +26156,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DnsNameMapping.encode = function encode(message, writer) { + DnsNameMapping.encode = function encode(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.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) @@ -25494,7 +26184,7 @@ * @returns {$protobuf.Writer} Writer */ DnsNameMapping.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -25576,10 +26266,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.connectionType != null && message.hasOwnProperty("connectionType")) + if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) switch (message.connectionType) { default: return "connectionType: enum value expected"; @@ -25589,7 +26279,7 @@ case 3: break; } - if (message.dnsScope != null && message.hasOwnProperty("dnsScope")) + if (message.dnsScope != null && Object.hasOwnProperty.call(message, "dnsScope")) switch (message.dnsScope) { default: return "dnsScope: enum value expected"; @@ -25598,7 +26288,7 @@ case 2: break; } - if (message.recordManager != null && message.hasOwnProperty("recordManager")) + if (message.recordManager != null && Object.hasOwnProperty.call(message, "recordManager")) switch (message.recordManager) { default: return "recordManager: enum value expected"; @@ -25621,6 +26311,8 @@ DnsNameMapping.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DnsNameMapping) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DnsNameMapping: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -25704,9 +26396,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DnsNameMapping.toObject = function toObject(message, options) { + DnsNameMapping.toObject = function toObject(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 = ""; @@ -25714,13 +26410,13 @@ object.dnsScope = options.enums === String ? "DNS_SCOPE_UNSPECIFIED" : 0; object.recordManager = options.enums === String ? "RECORD_MANAGER_UNSPECIFIED" : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.connectionType != null && message.hasOwnProperty("connectionType")) + if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) object.connectionType = options.enums === String ? $root.google.cloud.sql.v1.DnsNameMapping.ConnectionType[message.connectionType] === undefined ? message.connectionType : $root.google.cloud.sql.v1.DnsNameMapping.ConnectionType[message.connectionType] : message.connectionType; - if (message.dnsScope != null && message.hasOwnProperty("dnsScope")) + if (message.dnsScope != null && Object.hasOwnProperty.call(message, "dnsScope")) object.dnsScope = options.enums === String ? $root.google.cloud.sql.v1.DnsNameMapping.DnsScope[message.dnsScope] === undefined ? message.dnsScope : $root.google.cloud.sql.v1.DnsNameMapping.DnsScope[message.dnsScope] : message.dnsScope; - if (message.recordManager != null && message.hasOwnProperty("recordManager")) + if (message.recordManager != null && Object.hasOwnProperty.call(message, "recordManager")) object.recordManager = options.enums === String ? $root.google.cloud.sql.v1.DnsNameMapping.RecordManager[message.recordManager] === undefined ? message.recordManager : $root.google.cloud.sql.v1.DnsNameMapping.RecordManager[message.recordManager] : message.recordManager; return object; }; @@ -25856,7 +26552,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.sql.v1.CreateBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createBackup, $root.google.cloud.sql.v1.CreateBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "CreateBackup" }); /** @@ -25889,7 +26585,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.sql.v1.GetBackupRequest, $root.google.cloud.sql.v1.Backup, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getBackup, $root.google.cloud.sql.v1.GetBackupRequest, $root.google.cloud.sql.v1.Backup, request, callback); }, "name", { value: "GetBackup" }); /** @@ -25922,7 +26618,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.sql.v1.ListBackupsRequest, $root.google.cloud.sql.v1.ListBackupsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listBackups, $root.google.cloud.sql.v1.ListBackupsRequest, $root.google.cloud.sql.v1.ListBackupsResponse, request, callback); }, "name", { value: "ListBackups" }); /** @@ -25955,7 +26651,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.sql.v1.UpdateBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateBackup, $root.google.cloud.sql.v1.UpdateBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "UpdateBackup" }); /** @@ -25988,7 +26684,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.sql.v1.DeleteBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteBackup, $root.google.cloud.sql.v1.DeleteBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "DeleteBackup" }); /** @@ -26066,13 +26762,17 @@ * @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.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.sql.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -26086,7 +26786,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(); }; /** @@ -26160,10 +26860,10 @@ 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.backup != null && message.hasOwnProperty("backup")) { + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) { var error = $root.google.cloud.sql.v1.Backup.verify(message.backup, long + 1); if (error) return "backup." + error; @@ -26182,6 +26882,8 @@ CreateBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.CreateBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.CreateBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26190,7 +26892,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.backup != null) { - if (typeof object.backup !== "object") + if (!$util.isObject(object.backup)) throw TypeError(".google.cloud.sql.v1.CreateBackupRequest.backup: object expected"); message.backup = $root.google.cloud.sql.v1.Backup.fromObject(object.backup, long + 1); } @@ -26206,18 +26908,22 @@ * @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 = ""; object.backup = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.sql.v1.Backup.toObject(message.backup, options); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + object.backup = $root.google.cloud.sql.v1.Backup.toObject(message.backup, options, q + 1); return object; }; @@ -26303,9 +27009,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; @@ -26321,7 +27031,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(); }; /** @@ -26391,7 +27101,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; @@ -26408,6 +27118,8 @@ GetBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.GetBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.GetBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26427,13 +27139,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; }; @@ -26547,9 +27263,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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -26571,7 +27291,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(); }; /** @@ -26653,16 +27373,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.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; @@ -26679,6 +27399,8 @@ ListBackupsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ListBackupsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ListBackupsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26704,9 +27426,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 = ""; @@ -26714,13 +27440,13 @@ object.pageToken = ""; object.filter = ""; } - 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; return object; }; @@ -26827,17 +27553,21 @@ * @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.cloud.sql.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.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); if (message.warnings != null && message.warnings.length) for (var i = 0; i < message.warnings.length; ++i) - $root.google.cloud.sql.v1.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -26851,7 +27581,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(); }; /** @@ -26933,7 +27663,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) { @@ -26942,10 +27672,10 @@ 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"; - if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (message.warnings != null && Object.hasOwnProperty.call(message, "warnings")) { if (!Array.isArray(message.warnings)) return "warnings: array expected"; for (var i = 0; i < message.warnings.length; ++i) { @@ -26968,6 +27698,8 @@ ListBackupsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ListBackupsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ListBackupsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -26978,7 +27710,7 @@ throw TypeError(".google.cloud.sql.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.cloud.sql.v1.ListBackupsResponse.backups: object expected"); message.backups[i] = $root.google.cloud.sql.v1.Backup.fromObject(object.backups[i], long + 1); } @@ -26990,7 +27722,7 @@ throw TypeError(".google.cloud.sql.v1.ListBackupsResponse.warnings: array expected"); message.warnings = []; for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") + if (!$util.isObject(object.warnings[i])) throw TypeError(".google.cloud.sql.v1.ListBackupsResponse.warnings: object expected"); message.warnings[i] = $root.google.cloud.sql.v1.ApiWarning.fromObject(object.warnings[i], long + 1); } @@ -27007,9 +27739,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 = []; @@ -27020,14 +27756,14 @@ if (message.backups && message.backups.length) { object.backups = []; for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.sql.v1.Backup.toObject(message.backups[j], options); + object.backups[j] = $root.google.cloud.sql.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; if (message.warnings && message.warnings.length) { object.warnings = []; for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.sql.v1.ApiWarning.toObject(message.warnings[j], options); + object.warnings[j] = $root.google.cloud.sql.v1.ApiWarning.toObject(message.warnings[j], options, q + 1); } return object; }; @@ -27123,13 +27859,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.cloud.sql.v1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.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; }; @@ -27143,7 +27883,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(); }; /** @@ -27217,12 +27957,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.cloud.sql.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; @@ -27241,18 +27981,20 @@ UpdateBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.UpdateBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.UpdateBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.UpdateBackupRequest(); if (object.backup != null) { - if (typeof object.backup !== "object") + if (!$util.isObject(object.backup)) throw TypeError(".google.cloud.sql.v1.UpdateBackupRequest.backup: object expected"); message.backup = $root.google.cloud.sql.v1.Backup.fromObject(object.backup, long + 1); } if (object.updateMask != null) { - if (typeof object.updateMask !== "object") + if (!$util.isObject(object.updateMask)) throw TypeError(".google.cloud.sql.v1.UpdateBackupRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -27268,18 +28010,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.cloud.sql.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.cloud.sql.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; }; @@ -27365,9 +28111,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; @@ -27383,7 +28133,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(); }; /** @@ -27453,7 +28203,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; @@ -27470,6 +28220,8 @@ DeleteBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DeleteBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DeleteBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -27489,13 +28241,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; }; @@ -27800,9 +28556,13 @@ * @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.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -27818,11 +28578,11 @@ if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.location); if (message.backupInterval != null && Object.hasOwnProperty.call(message, "backupInterval")) - $root.google.type.Interval.encode(message.backupInterval, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.type.Interval.encode(message.backupInterval, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.sql.v1.OperationError.encode(message.error, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.cloud.sql.v1.OperationError.encode(message.error, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.kmsKey); if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) @@ -27834,21 +28594,21 @@ if (message.ttlDays != null && Object.hasOwnProperty.call(message, "ttlDays")) writer.uint32(/* id 16, wireType 0 =*/128).int64(message.ttlDays); if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 20, wireType 0 =*/160).int32(message.databaseVersion); if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) writer.uint32(/* id 23, wireType 0 =*/184).int64(message.maxChargeableBytes); if (message.instanceDeletionTime != null && Object.hasOwnProperty.call(message, "instanceDeletionTime")) - $root.google.protobuf.Timestamp.encode(message.instanceDeletionTime, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.instanceDeletionTime, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); if (message.instanceSettings != null && Object.hasOwnProperty.call(message, "instanceSettings")) - $root.google.cloud.sql.v1.DatabaseInstance.encode(message.instanceSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.encode(message.instanceSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); if (message.backupRun != null && Object.hasOwnProperty.call(message, "backupRun")) writer.uint32(/* id 26, wireType 2 =*/210).string(message.backupRun); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); return writer; }; @@ -27862,7 +28622,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(); }; /** @@ -28021,16 +28781,16 @@ 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.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: 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"; @@ -28040,21 +28800,21 @@ case 3: break; } - 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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: 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.backupInterval != null && message.hasOwnProperty("backupInterval")) { + if (message.backupInterval != null && Object.hasOwnProperty.call(message, "backupInterval")) { var error = $root.google.type.Interval.verify(message.backupInterval, long + 1); if (error) return "backupInterval." + 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"; @@ -28067,18 +28827,18 @@ case 6: break; } - if (message.error != null && message.hasOwnProperty("error")) { + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { var error = $root.google.cloud.sql.v1.OperationError.verify(message.error, long + 1); if (error) return "error." + error; } - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) if (!$util.isString(message.kmsKey)) return "kmsKey: string expected"; - 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"; - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) switch (message.backupKind) { default: return "backupKind: enum value expected"; @@ -28087,15 +28847,15 @@ case 2: break; } - 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.ttlDays != null && message.hasOwnProperty("ttlDays")) { + if (message.ttlDays != null && Object.hasOwnProperty.call(message, "ttlDays")) { properties.expiration = 1; if (!$util.isInteger(message.ttlDays) && !(message.ttlDays && $util.isInteger(message.ttlDays.low) && $util.isInteger(message.ttlDays.high))) return "ttlDays: integer|Long expected"; } - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) { if (properties.expiration === 1) return "expiration: multiple values"; properties.expiration = 1; @@ -28105,7 +28865,7 @@ return "expiryTime." + error; } } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -28166,30 +28926,30 @@ case 551: break; } - if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { properties._maxChargeableBytes = 1; if (!$util.isInteger(message.maxChargeableBytes) && !(message.maxChargeableBytes && $util.isInteger(message.maxChargeableBytes.low) && $util.isInteger(message.maxChargeableBytes.high))) return "maxChargeableBytes: integer|Long expected"; } - if (message.instanceDeletionTime != null && message.hasOwnProperty("instanceDeletionTime")) { + if (message.instanceDeletionTime != null && Object.hasOwnProperty.call(message, "instanceDeletionTime")) { var error = $root.google.protobuf.Timestamp.verify(message.instanceDeletionTime, long + 1); if (error) return "instanceDeletionTime." + error; } - if (message.instanceSettings != null && message.hasOwnProperty("instanceSettings")) { + if (message.instanceSettings != null && Object.hasOwnProperty.call(message, "instanceSettings")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.verify(message.instanceSettings, long + 1); if (error) return "instanceSettings." + error; } - if (message.backupRun != null && message.hasOwnProperty("backupRun")) + if (message.backupRun != null && Object.hasOwnProperty.call(message, "backupRun")) if (!$util.isString(message.backupRun)) return "backupRun: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs, long + 1); if (error) return "satisfiesPzs." + error; } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzi, long + 1); if (error) return "satisfiesPzi." + error; @@ -28208,6 +28968,8 @@ Backup.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Backup) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Backup: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -28250,7 +29012,7 @@ if (object.location != null) message.location = String(object.location); if (object.backupInterval != null) { - if (typeof object.backupInterval !== "object") + if (!$util.isObject(object.backupInterval)) throw TypeError(".google.cloud.sql.v1.Backup.backupInterval: object expected"); message.backupInterval = $root.google.type.Interval.fromObject(object.backupInterval, long + 1); } @@ -28291,7 +29053,7 @@ break; } if (object.error != null) { - if (typeof object.error !== "object") + if (!$util.isObject(object.error)) throw TypeError(".google.cloud.sql.v1.Backup.error: object expected"); message.error = $root.google.cloud.sql.v1.OperationError.fromObject(object.error, long + 1); } @@ -28323,7 +29085,7 @@ message.timeZone = String(object.timeZone); if (object.ttlDays != null) if ($util.Long) - (message.ttlDays = $util.Long.fromValue(object.ttlDays)).unsigned = false; + message.ttlDays = $util.Long.fromValue(object.ttlDays, false); else if (typeof object.ttlDays === "string") message.ttlDays = parseInt(object.ttlDays, 10); else if (typeof object.ttlDays === "number") @@ -28331,7 +29093,7 @@ else if (typeof object.ttlDays === "object") message.ttlDays = new $util.LongBits(object.ttlDays.low >>> 0, object.ttlDays.high >>> 0).toNumber(); if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") + if (!$util.isObject(object.expiryTime)) throw TypeError(".google.cloud.sql.v1.Backup.expiryTime: object expected"); message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime, long + 1); } @@ -28565,7 +29327,7 @@ } if (object.maxChargeableBytes != null) if ($util.Long) - (message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes)).unsigned = false; + message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes, false); else if (typeof object.maxChargeableBytes === "string") message.maxChargeableBytes = parseInt(object.maxChargeableBytes, 10); else if (typeof object.maxChargeableBytes === "number") @@ -28573,24 +29335,24 @@ else if (typeof object.maxChargeableBytes === "object") message.maxChargeableBytes = new $util.LongBits(object.maxChargeableBytes.low >>> 0, object.maxChargeableBytes.high >>> 0).toNumber(); if (object.instanceDeletionTime != null) { - if (typeof object.instanceDeletionTime !== "object") + if (!$util.isObject(object.instanceDeletionTime)) throw TypeError(".google.cloud.sql.v1.Backup.instanceDeletionTime: object expected"); message.instanceDeletionTime = $root.google.protobuf.Timestamp.fromObject(object.instanceDeletionTime, long + 1); } if (object.instanceSettings != null) { - if (typeof object.instanceSettings !== "object") + if (!$util.isObject(object.instanceSettings)) throw TypeError(".google.cloud.sql.v1.Backup.instanceSettings: object expected"); message.instanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.fromObject(object.instanceSettings, long + 1); } if (object.backupRun != null) message.backupRun = String(object.backupRun); if (object.satisfiesPzs != null) { - if (typeof object.satisfiesPzs !== "object") + if (!$util.isObject(object.satisfiesPzs)) throw TypeError(".google.cloud.sql.v1.Backup.satisfiesPzs: object expected"); message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs, long + 1); } if (object.satisfiesPzi != null) { - if (typeof object.satisfiesPzi !== "object") + if (!$util.isObject(object.satisfiesPzi)) throw TypeError(".google.cloud.sql.v1.Backup.satisfiesPzi: object expected"); message.satisfiesPzi = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzi, long + 1); } @@ -28606,9 +29368,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.defaults) { object.name = ""; @@ -28632,67 +29398,71 @@ object.satisfiesPzs = null; object.satisfiesPzi = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1.Backup.SqlBackupType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1.Backup.SqlBackupType[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.backupInterval != null && message.hasOwnProperty("backupInterval")) - object.backupInterval = $root.google.type.Interval.toObject(message.backupInterval, options); - if (message.state != null && message.hasOwnProperty("state")) + if (message.backupInterval != null && Object.hasOwnProperty.call(message, "backupInterval")) + object.backupInterval = $root.google.type.Interval.toObject(message.backupInterval, options, q + 1); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.cloud.sql.v1.Backup.SqlBackupState[message.state] === undefined ? message.state : $root.google.cloud.sql.v1.Backup.SqlBackupState[message.state] : message.state; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.cloud.sql.v1.OperationError.toObject(message.error, options); - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + object.error = $root.google.cloud.sql.v1.OperationError.toObject(message.error, options, q + 1); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) object.kmsKey = message.kmsKey; - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) object.kmsKeyVersion = message.kmsKeyVersion; - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) object.backupKind = options.enums === String ? $root.google.cloud.sql.v1.SqlBackupKind[message.backupKind] === undefined ? message.backupKind : $root.google.cloud.sql.v1.SqlBackupKind[message.backupKind] : message.backupKind; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) object.timeZone = message.timeZone; - if (message.ttlDays != null && message.hasOwnProperty("ttlDays")) { - if (typeof message.ttlDays === "number") + if (message.ttlDays != null && Object.hasOwnProperty.call(message, "ttlDays")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.ttlDays = typeof message.ttlDays === "number" ? BigInt(message.ttlDays) : $util.Long.fromBits(message.ttlDays.low >>> 0, message.ttlDays.high >>> 0, false).toBigInt(); + else if (typeof message.ttlDays === "number") object.ttlDays = options.longs === String ? String(message.ttlDays) : message.ttlDays; else object.ttlDays = options.longs === String ? $util.Long.prototype.toString.call(message.ttlDays) : options.longs === Number ? new $util.LongBits(message.ttlDays.low >>> 0, message.ttlDays.high >>> 0).toNumber() : message.ttlDays; if (options.oneofs) object.expiration = "ttlDays"; } - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) { + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options, q + 1); if (options.oneofs) object.expiration = "expiryTime"; } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { - if (typeof message.maxChargeableBytes === "number") + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxChargeableBytes = typeof message.maxChargeableBytes === "number" ? BigInt(message.maxChargeableBytes) : $util.Long.fromBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0, false).toBigInt(); + else if (typeof message.maxChargeableBytes === "number") object.maxChargeableBytes = options.longs === String ? String(message.maxChargeableBytes) : message.maxChargeableBytes; else object.maxChargeableBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxChargeableBytes) : options.longs === Number ? new $util.LongBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0).toNumber() : message.maxChargeableBytes; if (options.oneofs) object._maxChargeableBytes = "maxChargeableBytes"; } - if (message.instanceDeletionTime != null && message.hasOwnProperty("instanceDeletionTime")) - object.instanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.instanceDeletionTime, options); - if (message.instanceSettings != null && message.hasOwnProperty("instanceSettings")) - object.instanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.instanceSettings, options); - if (message.backupRun != null && message.hasOwnProperty("backupRun")) + if (message.instanceDeletionTime != null && Object.hasOwnProperty.call(message, "instanceDeletionTime")) + object.instanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.instanceDeletionTime, options, q + 1); + if (message.instanceSettings != null && Object.hasOwnProperty.call(message, "instanceSettings")) + object.instanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.instanceSettings, options, q + 1); + if (message.backupRun != null && Object.hasOwnProperty.call(message, "backupRun")) object.backupRun = message.backupRun; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options, q + 1); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options, q + 1); return object; }; @@ -28819,7 +29589,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.addServerCa = function addServerCa(request, callback) { - return this.rpcCall(addServerCa, $root.google.cloud.sql.v1.SqlInstancesAddServerCaRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, addServerCa, $root.google.cloud.sql.v1.SqlInstancesAddServerCaRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "AddServerCa" }); /** @@ -28852,7 +29622,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.addServerCertificate = function addServerCertificate(request, callback) { - return this.rpcCall(addServerCertificate, $root.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, addServerCertificate, $root.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "AddServerCertificate" }); /** @@ -28885,7 +29655,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.addEntraIdCertificate = function addEntraIdCertificate(request, callback) { - return this.rpcCall(addEntraIdCertificate, $root.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, addEntraIdCertificate, $root.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "AddEntraIdCertificate" }); /** @@ -28918,7 +29688,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.clone = function clone(request, callback) { - return this.rpcCall(clone, $root.google.cloud.sql.v1.SqlInstancesCloneRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, clone, $root.google.cloud.sql.v1.SqlInstancesCloneRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Clone" }); /** @@ -28951,7 +29721,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1.SqlInstancesDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1.SqlInstancesDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -28984,7 +29754,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.demoteMaster = function demoteMaster(request, callback) { - return this.rpcCall(demoteMaster, $root.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, demoteMaster, $root.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "DemoteMaster" }); /** @@ -29017,7 +29787,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.demote = function demote(request, callback) { - return this.rpcCall(demote, $root.google.cloud.sql.v1.SqlInstancesDemoteRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, demote, $root.google.cloud.sql.v1.SqlInstancesDemoteRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Demote" }); /** @@ -29050,7 +29820,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.google.cloud.sql.v1.SqlInstancesExportRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, export_, $root.google.cloud.sql.v1.SqlInstancesExportRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Export" }); /** @@ -29083,7 +29853,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.failover = function failover(request, callback) { - return this.rpcCall(failover, $root.google.cloud.sql.v1.SqlInstancesFailoverRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, failover, $root.google.cloud.sql.v1.SqlInstancesFailoverRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Failover" }); /** @@ -29116,7 +29886,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.reencrypt = function reencrypt(request, callback) { - return this.rpcCall(reencrypt, $root.google.cloud.sql.v1.SqlInstancesReencryptRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, reencrypt, $root.google.cloud.sql.v1.SqlInstancesReencryptRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Reencrypt" }); /** @@ -29149,7 +29919,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1.SqlInstancesGetRequest, $root.google.cloud.sql.v1.DatabaseInstance, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1.SqlInstancesGetRequest, $root.google.cloud.sql.v1.DatabaseInstance, request, callback); }, "name", { value: "Get" }); /** @@ -29182,7 +29952,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype["import"] = function import_(request, callback) { - return this.rpcCall(import_, $root.google.cloud.sql.v1.SqlInstancesImportRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, import_, $root.google.cloud.sql.v1.SqlInstancesImportRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Import" }); /** @@ -29215,7 +29985,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1.SqlInstancesInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1.SqlInstancesInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -29248,7 +30018,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlInstancesListRequest, $root.google.cloud.sql.v1.InstancesListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlInstancesListRequest, $root.google.cloud.sql.v1.InstancesListResponse, request, callback); }, "name", { value: "List" }); /** @@ -29281,7 +30051,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.listServerCas = function listServerCas(request, callback) { - return this.rpcCall(listServerCas, $root.google.cloud.sql.v1.SqlInstancesListServerCasRequest, $root.google.cloud.sql.v1.InstancesListServerCasResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listServerCas, $root.google.cloud.sql.v1.SqlInstancesListServerCasRequest, $root.google.cloud.sql.v1.InstancesListServerCasResponse, request, callback); }, "name", { value: "ListServerCas" }); /** @@ -29314,7 +30084,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.listServerCertificates = function listServerCertificates(request, callback) { - return this.rpcCall(listServerCertificates, $root.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest, $root.google.cloud.sql.v1.InstancesListServerCertificatesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listServerCertificates, $root.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest, $root.google.cloud.sql.v1.InstancesListServerCertificatesResponse, request, callback); }, "name", { value: "ListServerCertificates" }); /** @@ -29347,7 +30117,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.listEntraIdCertificates = function listEntraIdCertificates(request, callback) { - return this.rpcCall(listEntraIdCertificates, $root.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest, $root.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listEntraIdCertificates, $root.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest, $root.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse, request, callback); }, "name", { value: "ListEntraIdCertificates" }); /** @@ -29380,7 +30150,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.patch = function patch(request, callback) { - return this.rpcCall(patch, $root.google.cloud.sql.v1.SqlInstancesPatchRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, patch, $root.google.cloud.sql.v1.SqlInstancesPatchRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Patch" }); /** @@ -29413,7 +30183,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.promoteReplica = function promoteReplica(request, callback) { - return this.rpcCall(promoteReplica, $root.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, promoteReplica, $root.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "PromoteReplica" }); /** @@ -29446,7 +30216,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.switchover = function switchover(request, callback) { - return this.rpcCall(switchover, $root.google.cloud.sql.v1.SqlInstancesSwitchoverRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, switchover, $root.google.cloud.sql.v1.SqlInstancesSwitchoverRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Switchover" }); /** @@ -29479,7 +30249,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.resetSslConfig = function resetSslConfig(request, callback) { - return this.rpcCall(resetSslConfig, $root.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, resetSslConfig, $root.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "ResetSslConfig" }); /** @@ -29512,7 +30282,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.restart = function restart(request, callback) { - return this.rpcCall(restart, $root.google.cloud.sql.v1.SqlInstancesRestartRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, restart, $root.google.cloud.sql.v1.SqlInstancesRestartRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Restart" }); /** @@ -29545,7 +30315,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.restoreBackup = function restoreBackup(request, callback) { - return this.rpcCall(restoreBackup, $root.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, restoreBackup, $root.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "RestoreBackup" }); /** @@ -29578,7 +30348,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rotateServerCa = function rotateServerCa(request, callback) { - return this.rpcCall(rotateServerCa, $root.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rotateServerCa, $root.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "RotateServerCa" }); /** @@ -29611,7 +30381,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rotateServerCertificate = function rotateServerCertificate(request, callback) { - return this.rpcCall(rotateServerCertificate, $root.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rotateServerCertificate, $root.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "RotateServerCertificate" }); /** @@ -29644,7 +30414,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rotateEntraIdCertificate = function rotateEntraIdCertificate(request, callback) { - return this.rpcCall(rotateEntraIdCertificate, $root.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rotateEntraIdCertificate, $root.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "RotateEntraIdCertificate" }); /** @@ -29677,7 +30447,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.startReplica = function startReplica(request, callback) { - return this.rpcCall(startReplica, $root.google.cloud.sql.v1.SqlInstancesStartReplicaRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, startReplica, $root.google.cloud.sql.v1.SqlInstancesStartReplicaRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "StartReplica" }); /** @@ -29710,7 +30480,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.stopReplica = function stopReplica(request, callback) { - return this.rpcCall(stopReplica, $root.google.cloud.sql.v1.SqlInstancesStopReplicaRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, stopReplica, $root.google.cloud.sql.v1.SqlInstancesStopReplicaRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "StopReplica" }); /** @@ -29743,7 +30513,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.truncateLog = function truncateLog(request, callback) { - return this.rpcCall(truncateLog, $root.google.cloud.sql.v1.SqlInstancesTruncateLogRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, truncateLog, $root.google.cloud.sql.v1.SqlInstancesTruncateLogRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "TruncateLog" }); /** @@ -29776,7 +30546,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.update = function update(request, callback) { - return this.rpcCall(update, $root.google.cloud.sql.v1.SqlInstancesUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, update, $root.google.cloud.sql.v1.SqlInstancesUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Update" }); /** @@ -29809,7 +30579,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.createEphemeral = function createEphemeral(request, callback) { - return this.rpcCall(createEphemeral, $root.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest, $root.google.cloud.sql.v1.SslCert, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createEphemeral, $root.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest, $root.google.cloud.sql.v1.SslCert, request, callback); }, "name", { value: "CreateEphemeral" }); /** @@ -29842,7 +30612,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rescheduleMaintenance = function rescheduleMaintenance(request, callback) { - return this.rpcCall(rescheduleMaintenance, $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rescheduleMaintenance, $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "RescheduleMaintenance" }); /** @@ -29875,7 +30645,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.verifyExternalSyncSettings = function verifyExternalSyncSettings(request, callback) { - return this.rpcCall(verifyExternalSyncSettings, $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest, $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, verifyExternalSyncSettings, $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest, $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse, request, callback); }, "name", { value: "VerifyExternalSyncSettings" }); /** @@ -29908,7 +30678,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.startExternalSync = function startExternalSync(request, callback) { - return this.rpcCall(startExternalSync, $root.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, startExternalSync, $root.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "StartExternalSync" }); /** @@ -29941,7 +30711,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.performDiskShrink = function performDiskShrink(request, callback) { - return this.rpcCall(performDiskShrink, $root.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, performDiskShrink, $root.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "PerformDiskShrink" }); /** @@ -29974,7 +30744,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.getDiskShrinkConfig = function getDiskShrinkConfig(request, callback) { - return this.rpcCall(getDiskShrinkConfig, $root.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest, $root.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getDiskShrinkConfig, $root.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest, $root.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse, request, callback); }, "name", { value: "GetDiskShrinkConfig" }); /** @@ -30007,7 +30777,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.resetReplicaSize = function resetReplicaSize(request, callback) { - return this.rpcCall(resetReplicaSize, $root.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, resetReplicaSize, $root.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "ResetReplicaSize" }); /** @@ -30040,7 +30810,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.getLatestRecoveryTime = function getLatestRecoveryTime(request, callback) { - return this.rpcCall(getLatestRecoveryTime, $root.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest, $root.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getLatestRecoveryTime, $root.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest, $root.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse, request, callback); }, "name", { value: "GetLatestRecoveryTime" }); /** @@ -30073,7 +30843,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest, $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, executeSql, $root.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest, $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse, request, callback); }, "name", { value: "ExecuteSql" }); /** @@ -30106,7 +30876,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.acquireSsrsLease = function acquireSsrsLease(request, callback) { - return this.rpcCall(acquireSsrsLease, $root.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest, $root.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, acquireSsrsLease, $root.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest, $root.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse, request, callback); }, "name", { value: "AcquireSsrsLease" }); /** @@ -30139,7 +30909,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.releaseSsrsLease = function releaseSsrsLease(request, callback) { - return this.rpcCall(releaseSsrsLease, $root.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest, $root.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, releaseSsrsLease, $root.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest, $root.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse, request, callback); }, "name", { value: "ReleaseSsrsLease" }); /** @@ -30172,7 +30942,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.preCheckMajorVersionUpgrade = function preCheckMajorVersionUpgrade(request, callback) { - return this.rpcCall(preCheckMajorVersionUpgrade, $root.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, preCheckMajorVersionUpgrade, $root.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "PreCheckMajorVersionUpgrade" }); /** @@ -30205,7 +30975,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.pointInTimeRestore = function pointInTimeRestore(request, callback) { - return this.rpcCall(pointInTimeRestore, $root.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, pointInTimeRestore, $root.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "PointInTimeRestore" }); /** @@ -30283,9 +31053,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAddServerCaRequest.encode = function encode(message, writer) { + SqlInstancesAddServerCaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -30303,7 +31077,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAddServerCaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -30377,10 +31151,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -30397,6 +31171,8 @@ SqlInstancesAddServerCaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesAddServerCaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesAddServerCaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -30418,17 +31194,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAddServerCaRequest.toObject = function toObject(message, options) { + SqlInstancesAddServerCaRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -30524,9 +31304,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAddServerCertificateRequest.encode = function encode(message, writer) { + SqlInstancesAddServerCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -30544,7 +31328,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAddServerCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -30618,10 +31402,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -30638,6 +31422,8 @@ SqlInstancesAddServerCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesAddServerCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -30659,17 +31445,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAddServerCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesAddServerCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -30765,9 +31555,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAddEntraIdCertificateRequest.encode = function encode(message, writer) { + SqlInstancesAddEntraIdCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -30785,7 +31579,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAddEntraIdCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -30859,10 +31653,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -30879,6 +31673,8 @@ SqlInstancesAddEntraIdCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesAddEntraIdCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -30900,17 +31696,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAddEntraIdCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesAddEntraIdCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -31015,15 +31815,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesCloneRequest.encode = function encode(message, writer) { + SqlInstancesCloneRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesCloneRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesCloneRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -31037,7 +31841,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesCloneRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -31115,13 +31919,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesCloneRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -31140,6 +31944,8 @@ SqlInstancesCloneRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesCloneRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesCloneRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -31150,7 +31956,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesCloneRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesCloneRequest.fromObject(object.body, long + 1); } @@ -31166,21 +31972,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesCloneRequest.toObject = function toObject(message, options) { + SqlInstancesCloneRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesCloneRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesCloneRequest.toObject(message.body, options, q + 1); return object; }; @@ -31331,9 +32141,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesDeleteRequest.encode = function encode(message, writer) { + SqlInstancesDeleteRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -31343,7 +32157,7 @@ if (message.finalBackupDescription != null && Object.hasOwnProperty.call(message, "finalBackupDescription")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.finalBackupDescription); if (message.finalBackupExpiryTime != null && Object.hasOwnProperty.call(message, "finalBackupExpiryTime")) - $root.google.protobuf.Timestamp.encode(message.finalBackupExpiryTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.finalBackupExpiryTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.enableFinalBackup != null && Object.hasOwnProperty.call(message, "enableFinalBackup")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFinalBackup); return writer; @@ -31359,7 +32173,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -31450,23 +32264,23 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.enableFinalBackup != null && message.hasOwnProperty("enableFinalBackup")) { + if (message.enableFinalBackup != null && Object.hasOwnProperty.call(message, "enableFinalBackup")) { properties._enableFinalBackup = 1; if (typeof message.enableFinalBackup !== "boolean") return "enableFinalBackup: boolean expected"; } - if (message.finalBackupTtlDays != null && message.hasOwnProperty("finalBackupTtlDays")) { + if (message.finalBackupTtlDays != null && Object.hasOwnProperty.call(message, "finalBackupTtlDays")) { properties.expiration = 1; if (!$util.isInteger(message.finalBackupTtlDays) && !(message.finalBackupTtlDays && $util.isInteger(message.finalBackupTtlDays.low) && $util.isInteger(message.finalBackupTtlDays.high))) return "finalBackupTtlDays: integer|Long expected"; } - if (message.finalBackupExpiryTime != null && message.hasOwnProperty("finalBackupExpiryTime")) { + if (message.finalBackupExpiryTime != null && Object.hasOwnProperty.call(message, "finalBackupExpiryTime")) { if (properties.expiration === 1) return "expiration: multiple values"; properties.expiration = 1; @@ -31476,7 +32290,7 @@ return "finalBackupExpiryTime." + error; } } - if (message.finalBackupDescription != null && message.hasOwnProperty("finalBackupDescription")) + if (message.finalBackupDescription != null && Object.hasOwnProperty.call(message, "finalBackupDescription")) if (!$util.isString(message.finalBackupDescription)) return "finalBackupDescription: string expected"; return null; @@ -31493,6 +32307,8 @@ SqlInstancesDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -31506,7 +32322,7 @@ message.enableFinalBackup = Boolean(object.enableFinalBackup); if (object.finalBackupTtlDays != null) if ($util.Long) - (message.finalBackupTtlDays = $util.Long.fromValue(object.finalBackupTtlDays)).unsigned = false; + message.finalBackupTtlDays = $util.Long.fromValue(object.finalBackupTtlDays, false); else if (typeof object.finalBackupTtlDays === "string") message.finalBackupTtlDays = parseInt(object.finalBackupTtlDays, 10); else if (typeof object.finalBackupTtlDays === "number") @@ -31514,7 +32330,7 @@ else if (typeof object.finalBackupTtlDays === "object") message.finalBackupTtlDays = new $util.LongBits(object.finalBackupTtlDays.low >>> 0, object.finalBackupTtlDays.high >>> 0).toNumber(); if (object.finalBackupExpiryTime != null) { - if (typeof object.finalBackupExpiryTime !== "object") + if (!$util.isObject(object.finalBackupExpiryTime)) throw TypeError(".google.cloud.sql.v1.SqlInstancesDeleteRequest.finalBackupExpiryTime: object expected"); message.finalBackupExpiryTime = $root.google.protobuf.Timestamp.fromObject(object.finalBackupExpiryTime, long + 1); } @@ -31532,35 +32348,41 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesDeleteRequest.toObject = function toObject(message, options) { + SqlInstancesDeleteRequest.toObject = function toObject(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 = ""; object.project = ""; object.finalBackupDescription = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.finalBackupTtlDays != null && message.hasOwnProperty("finalBackupTtlDays")) { - if (typeof message.finalBackupTtlDays === "number") + if (message.finalBackupTtlDays != null && Object.hasOwnProperty.call(message, "finalBackupTtlDays")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.finalBackupTtlDays = typeof message.finalBackupTtlDays === "number" ? BigInt(message.finalBackupTtlDays) : $util.Long.fromBits(message.finalBackupTtlDays.low >>> 0, message.finalBackupTtlDays.high >>> 0, false).toBigInt(); + else if (typeof message.finalBackupTtlDays === "number") object.finalBackupTtlDays = options.longs === String ? String(message.finalBackupTtlDays) : message.finalBackupTtlDays; else object.finalBackupTtlDays = options.longs === String ? $util.Long.prototype.toString.call(message.finalBackupTtlDays) : options.longs === Number ? new $util.LongBits(message.finalBackupTtlDays.low >>> 0, message.finalBackupTtlDays.high >>> 0).toNumber() : message.finalBackupTtlDays; if (options.oneofs) object.expiration = "finalBackupTtlDays"; } - if (message.finalBackupDescription != null && message.hasOwnProperty("finalBackupDescription")) + if (message.finalBackupDescription != null && Object.hasOwnProperty.call(message, "finalBackupDescription")) object.finalBackupDescription = message.finalBackupDescription; - if (message.finalBackupExpiryTime != null && message.hasOwnProperty("finalBackupExpiryTime")) { - object.finalBackupExpiryTime = $root.google.protobuf.Timestamp.toObject(message.finalBackupExpiryTime, options); + if (message.finalBackupExpiryTime != null && Object.hasOwnProperty.call(message, "finalBackupExpiryTime")) { + object.finalBackupExpiryTime = $root.google.protobuf.Timestamp.toObject(message.finalBackupExpiryTime, options, q + 1); if (options.oneofs) object.expiration = "finalBackupExpiryTime"; } - if (message.enableFinalBackup != null && message.hasOwnProperty("enableFinalBackup")) { + if (message.enableFinalBackup != null && Object.hasOwnProperty.call(message, "enableFinalBackup")) { object.enableFinalBackup = message.enableFinalBackup; if (options.oneofs) object._enableFinalBackup = "enableFinalBackup"; @@ -31668,15 +32490,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesDemoteMasterRequest.encode = function encode(message, writer) { + SqlInstancesDemoteMasterRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesDemoteMasterRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesDemoteMasterRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -31690,7 +32516,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesDemoteMasterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -31768,13 +32594,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesDemoteMasterRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -31793,6 +32619,8 @@ SqlInstancesDemoteMasterRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesDemoteMasterRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesDemoteMasterRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -31803,7 +32631,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesDemoteMasterRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesDemoteMasterRequest.fromObject(object.body, long + 1); } @@ -31819,21 +32647,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesDemoteMasterRequest.toObject = function toObject(message, options) { + SqlInstancesDemoteMasterRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesDemoteMasterRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesDemoteMasterRequest.toObject(message.body, options, q + 1); return object; }; @@ -31937,15 +32769,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesDemoteRequest.encode = function encode(message, writer) { + SqlInstancesDemoteRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesDemoteRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesDemoteRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -31959,7 +32795,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesDemoteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -32037,13 +32873,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesDemoteRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -32062,6 +32898,8 @@ SqlInstancesDemoteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesDemoteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesDemoteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32072,7 +32910,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesDemoteRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesDemoteRequest.fromObject(object.body, long + 1); } @@ -32088,21 +32926,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesDemoteRequest.toObject = function toObject(message, options) { + SqlInstancesDemoteRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesDemoteRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesDemoteRequest.toObject(message.body, options, q + 1); return object; }; @@ -32206,15 +33048,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesExportRequest.encode = function encode(message, writer) { + SqlInstancesExportRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesExportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesExportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -32228,7 +33074,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -32306,13 +33152,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesExportRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -32331,6 +33177,8 @@ SqlInstancesExportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesExportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesExportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32341,7 +33189,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesExportRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesExportRequest.fromObject(object.body, long + 1); } @@ -32357,21 +33205,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesExportRequest.toObject = function toObject(message, options) { + SqlInstancesExportRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesExportRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesExportRequest.toObject(message.body, options, q + 1); return object; }; @@ -32475,15 +33327,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesFailoverRequest.encode = function encode(message, writer) { + SqlInstancesFailoverRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesFailoverRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesFailoverRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -32497,7 +33353,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesFailoverRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -32575,13 +33431,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesFailoverRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -32600,6 +33456,8 @@ SqlInstancesFailoverRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesFailoverRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesFailoverRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32610,7 +33468,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesFailoverRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesFailoverRequest.fromObject(object.body, long + 1); } @@ -32626,21 +33484,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesFailoverRequest.toObject = function toObject(message, options) { + SqlInstancesFailoverRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesFailoverRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesFailoverRequest.toObject(message.body, options, q + 1); return object; }; @@ -32735,9 +33597,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetRequest.encode = function encode(message, writer) { + SqlInstancesGetRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -32755,7 +33621,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -32829,10 +33695,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -32849,6 +33715,8 @@ SqlInstancesGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -32870,17 +33738,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetRequest.toObject = function toObject(message, options) { + SqlInstancesGetRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -32985,15 +33857,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesImportRequest.encode = function encode(message, writer) { + SqlInstancesImportRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesImportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesImportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -33007,7 +33883,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesImportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33085,13 +33961,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesImportRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -33110,6 +33986,8 @@ SqlInstancesImportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesImportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesImportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33120,7 +33998,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesImportRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesImportRequest.fromObject(object.body, long + 1); } @@ -33136,21 +34014,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesImportRequest.toObject = function toObject(message, options) { + SqlInstancesImportRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesImportRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesImportRequest.toObject(message.body, options, q + 1); return object; }; @@ -33245,13 +34127,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesInsertRequest.encode = function encode(message, writer) { + SqlInstancesInsertRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -33265,7 +34151,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33339,10 +34225,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.verify(message.body, long + 1); if (error) return "body." + error; @@ -33361,6 +34247,8 @@ SqlInstancesInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33369,7 +34257,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.DatabaseInstance.fromObject(object.body, long + 1); } @@ -33385,18 +34273,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesInsertRequest.toObject = function toObject(message, options) { + SqlInstancesInsertRequest.toObject = function toObject(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.project = ""; object.body = null; } - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.body, options, q + 1); return object; }; @@ -33509,9 +34401,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListRequest.encode = function encode(message, writer) { + SqlInstancesListRequest.encode = function encode(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.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) @@ -33533,7 +34429,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33615,16 +34511,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) if (!$util.isInteger(message.maxResults)) return "maxResults: 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -33641,6 +34537,8 @@ SqlInstancesListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33666,9 +34564,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListRequest.toObject = function toObject(message, options) { + SqlInstancesListRequest.toObject = function toObject(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 = ""; @@ -33676,13 +34578,13 @@ object.pageToken = ""; object.project = ""; } - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) object.maxResults = message.maxResults; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -33778,9 +34680,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListServerCasRequest.encode = function encode(message, writer) { + SqlInstancesListServerCasRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -33798,7 +34704,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListServerCasRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -33872,10 +34778,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -33892,6 +34798,8 @@ SqlInstancesListServerCasRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesListServerCasRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesListServerCasRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -33913,17 +34821,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListServerCasRequest.toObject = function toObject(message, options) { + SqlInstancesListServerCasRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -34019,9 +34931,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListServerCertificatesRequest.encode = function encode(message, writer) { + SqlInstancesListServerCertificatesRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -34039,7 +34955,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListServerCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -34113,10 +35029,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -34133,6 +35049,8 @@ SqlInstancesListServerCertificatesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesListServerCertificatesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34154,17 +35072,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListServerCertificatesRequest.toObject = function toObject(message, options) { + SqlInstancesListServerCertificatesRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -34260,9 +35182,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListEntraIdCertificatesRequest.encode = function encode(message, writer) { + SqlInstancesListEntraIdCertificatesRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -34280,7 +35206,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListEntraIdCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -34354,10 +35280,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -34374,6 +35300,8 @@ SqlInstancesListEntraIdCertificatesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesListEntraIdCertificatesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34395,17 +35323,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListEntraIdCertificatesRequest.toObject = function toObject(message, options) { + SqlInstancesListEntraIdCertificatesRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -34510,15 +35442,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPatchRequest.encode = function encode(message, writer) { + SqlInstancesPatchRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -34532,7 +35468,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPatchRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -34610,13 +35546,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.verify(message.body, long + 1); if (error) return "body." + error; @@ -34635,6 +35571,8 @@ SqlInstancesPatchRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesPatchRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesPatchRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34645,7 +35583,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesPatchRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.DatabaseInstance.fromObject(object.body, long + 1); } @@ -34661,21 +35599,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPatchRequest.toObject = function toObject(message, options) { + SqlInstancesPatchRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.body, options, q + 1); return object; }; @@ -34779,9 +35721,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPromoteReplicaRequest.encode = function encode(message, writer) { + SqlInstancesPromoteReplicaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -34801,7 +35747,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPromoteReplicaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -34879,13 +35825,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.failover != null && message.hasOwnProperty("failover")) + if (message.failover != null && Object.hasOwnProperty.call(message, "failover")) if (typeof message.failover !== "boolean") return "failover: boolean expected"; return null; @@ -34902,6 +35848,8 @@ SqlInstancesPromoteReplicaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesPromoteReplicaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -34925,20 +35873,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPromoteReplicaRequest.toObject = function toObject(message, options) { + SqlInstancesPromoteReplicaRequest.toObject = function toObject(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 = ""; object.project = ""; object.failover = false; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.failover != null && message.hasOwnProperty("failover")) + if (message.failover != null && Object.hasOwnProperty.call(message, "failover")) object.failover = message.failover; return object; }; @@ -35043,15 +35995,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesSwitchoverRequest.encode = function encode(message, writer) { + SqlInstancesSwitchoverRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.dbTimeout != null && Object.hasOwnProperty.call(message, "dbTimeout")) - $root.google.protobuf.Duration.encode(message.dbTimeout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.dbTimeout, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -35065,7 +36021,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesSwitchoverRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35143,13 +36099,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.dbTimeout != null && message.hasOwnProperty("dbTimeout")) { + if (message.dbTimeout != null && Object.hasOwnProperty.call(message, "dbTimeout")) { var error = $root.google.protobuf.Duration.verify(message.dbTimeout, long + 1); if (error) return "dbTimeout." + error; @@ -35168,6 +36124,8 @@ SqlInstancesSwitchoverRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesSwitchoverRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesSwitchoverRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35178,7 +36136,7 @@ if (object.project != null) message.project = String(object.project); if (object.dbTimeout != null) { - if (typeof object.dbTimeout !== "object") + if (!$util.isObject(object.dbTimeout)) throw TypeError(".google.cloud.sql.v1.SqlInstancesSwitchoverRequest.dbTimeout: object expected"); message.dbTimeout = $root.google.protobuf.Duration.fromObject(object.dbTimeout, long + 1); } @@ -35194,21 +36152,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesSwitchoverRequest.toObject = function toObject(message, options) { + SqlInstancesSwitchoverRequest.toObject = function toObject(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 = ""; object.project = ""; object.dbTimeout = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.dbTimeout != null && message.hasOwnProperty("dbTimeout")) - object.dbTimeout = $root.google.protobuf.Duration.toObject(message.dbTimeout, options); + if (message.dbTimeout != null && Object.hasOwnProperty.call(message, "dbTimeout")) + object.dbTimeout = $root.google.protobuf.Duration.toObject(message.dbTimeout, options, q + 1); return object; }; @@ -35312,9 +36274,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesResetSslConfigRequest.encode = function encode(message, writer) { + SqlInstancesResetSslConfigRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -35334,7 +36300,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesResetSslConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35412,13 +36378,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - 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"; @@ -35441,6 +36407,8 @@ SqlInstancesResetSslConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesResetSslConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35482,20 +36450,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesResetSslConfigRequest.toObject = function toObject(message, options) { + SqlInstancesResetSslConfigRequest.toObject = function toObject(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 = ""; object.project = ""; object.mode = options.enums === String ? "RESET_SSL_MODE_UNSPECIFIED" : 0; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) object.mode = options.enums === String ? $root.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode[message.mode] === undefined ? message.mode : $root.google.cloud.sql.v1.SqlInstancesResetSslConfigRequest.ResetSslMode[message.mode] : message.mode; return object; }; @@ -35607,9 +36579,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRestartRequest.encode = function encode(message, writer) { + SqlInstancesRestartRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -35627,7 +36603,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRestartRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35701,10 +36677,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -35721,6 +36697,8 @@ SqlInstancesRestartRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRestartRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRestartRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35742,17 +36720,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRestartRequest.toObject = function toObject(message, options) { + SqlInstancesRestartRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -35857,15 +36839,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRestoreBackupRequest.encode = function encode(message, writer) { + SqlInstancesRestoreBackupRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesRestoreBackupRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesRestoreBackupRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -35879,7 +36865,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -35957,13 +36943,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesRestoreBackupRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -35982,6 +36968,8 @@ SqlInstancesRestoreBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRestoreBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRestoreBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -35992,7 +36980,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesRestoreBackupRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesRestoreBackupRequest.fromObject(object.body, long + 1); } @@ -36008,21 +36996,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRestoreBackupRequest.toObject = function toObject(message, options) { + SqlInstancesRestoreBackupRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesRestoreBackupRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesRestoreBackupRequest.toObject(message.body, options, q + 1); return object; }; @@ -36126,15 +37118,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRotateServerCaRequest.encode = function encode(message, writer) { + SqlInstancesRotateServerCaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesRotateServerCaRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesRotateServerCaRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -36148,7 +37144,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRotateServerCaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -36226,13 +37222,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesRotateServerCaRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -36251,6 +37247,8 @@ SqlInstancesRotateServerCaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRotateServerCaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRotateServerCaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36261,7 +37259,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesRotateServerCaRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesRotateServerCaRequest.fromObject(object.body, long + 1); } @@ -36277,21 +37275,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRotateServerCaRequest.toObject = function toObject(message, options) { + SqlInstancesRotateServerCaRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesRotateServerCaRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesRotateServerCaRequest.toObject(message.body, options, q + 1); return object; }; @@ -36395,15 +37397,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRotateServerCertificateRequest.encode = function encode(message, writer) { + SqlInstancesRotateServerCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -36417,7 +37423,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRotateServerCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -36495,13 +37501,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -36520,6 +37526,8 @@ SqlInstancesRotateServerCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36530,7 +37538,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesRotateServerCertificateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.fromObject(object.body, long + 1); } @@ -36546,21 +37554,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRotateServerCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesRotateServerCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest.toObject(message.body, options, q + 1); return object; }; @@ -36664,15 +37676,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRotateEntraIdCertificateRequest.encode = function encode(message, writer) { + SqlInstancesRotateEntraIdCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -36686,7 +37702,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRotateEntraIdCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -36764,13 +37780,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -36789,6 +37805,8 @@ SqlInstancesRotateEntraIdCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -36799,7 +37817,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesRotateEntraIdCertificateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.fromObject(object.body, long + 1); } @@ -36815,21 +37833,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRotateEntraIdCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesRotateEntraIdCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.toObject(message.body, options, q + 1); return object; }; @@ -36924,9 +37946,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesStartReplicaRequest.encode = function encode(message, writer) { + SqlInstancesStartReplicaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -36944,7 +37970,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesStartReplicaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37018,10 +38044,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -37038,6 +38064,8 @@ SqlInstancesStartReplicaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesStartReplicaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesStartReplicaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37059,17 +38087,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesStartReplicaRequest.toObject = function toObject(message, options) { + SqlInstancesStartReplicaRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -37165,9 +38197,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesStopReplicaRequest.encode = function encode(message, writer) { + SqlInstancesStopReplicaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -37185,7 +38221,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesStopReplicaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37259,10 +38295,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -37279,6 +38315,8 @@ SqlInstancesStopReplicaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesStopReplicaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesStopReplicaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37300,17 +38338,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesStopReplicaRequest.toObject = function toObject(message, options) { + SqlInstancesStopReplicaRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -37415,15 +38457,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesTruncateLogRequest.encode = function encode(message, writer) { + SqlInstancesTruncateLogRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesTruncateLogRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesTruncateLogRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -37437,7 +38483,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesTruncateLogRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37515,13 +38561,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesTruncateLogRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -37540,6 +38586,8 @@ SqlInstancesTruncateLogRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesTruncateLogRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesTruncateLogRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37550,7 +38598,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesTruncateLogRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesTruncateLogRequest.fromObject(object.body, long + 1); } @@ -37566,21 +38614,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesTruncateLogRequest.toObject = function toObject(message, options) { + SqlInstancesTruncateLogRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesTruncateLogRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesTruncateLogRequest.toObject(message.body, options, q + 1); return object; }; @@ -37684,15 +38736,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPerformDiskShrinkRequest.encode = function encode(message, writer) { + SqlInstancesPerformDiskShrinkRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.PerformDiskShrinkContext.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.PerformDiskShrinkContext.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -37706,7 +38762,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPerformDiskShrinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -37784,13 +38840,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.PerformDiskShrinkContext.verify(message.body, long + 1); if (error) return "body." + error; @@ -37809,6 +38865,8 @@ SqlInstancesPerformDiskShrinkRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -37819,7 +38877,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesPerformDiskShrinkRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.PerformDiskShrinkContext.fromObject(object.body, long + 1); } @@ -37835,21 +38893,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPerformDiskShrinkRequest.toObject = function toObject(message, options) { + SqlInstancesPerformDiskShrinkRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.PerformDiskShrinkContext.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.PerformDiskShrinkContext.toObject(message.body, options, q + 1); return object; }; @@ -37953,15 +39015,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesUpdateRequest.encode = function encode(message, writer) { + SqlInstancesUpdateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -37975,7 +39041,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -38053,13 +39119,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.verify(message.body, long + 1); if (error) return "body." + error; @@ -38078,6 +39144,8 @@ SqlInstancesUpdateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesUpdateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesUpdateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -38088,7 +39156,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesUpdateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.DatabaseInstance.fromObject(object.body, long + 1); } @@ -38104,21 +39172,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesUpdateRequest.toObject = function toObject(message, options) { + SqlInstancesUpdateRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.body, options, q + 1); return object; }; @@ -38222,15 +39294,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRescheduleMaintenanceRequest.encode = function encode(message, writer) { + SqlInstancesRescheduleMaintenanceRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -38244,7 +39320,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRescheduleMaintenanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -38322,13 +39398,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.verify(message.body, long + 1); if (error) return "body." + error; @@ -38347,6 +39423,8 @@ SqlInstancesRescheduleMaintenanceRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -38357,7 +39435,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.fromObject(object.body, long + 1); } @@ -38373,21 +39451,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRescheduleMaintenanceRequest.toObject = function toObject(message, options) { + SqlInstancesRescheduleMaintenanceRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.toObject(message.body, options, q + 1); return object; }; @@ -38491,15 +39573,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesReencryptRequest.encode = function encode(message, writer) { + SqlInstancesReencryptRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesReencryptRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesReencryptRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -38513,7 +39599,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesReencryptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -38591,13 +39677,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesReencryptRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -38616,6 +39702,8 @@ SqlInstancesReencryptRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesReencryptRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesReencryptRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -38626,7 +39714,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesReencryptRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesReencryptRequest.fromObject(object.body, long + 1); } @@ -38642,21 +39730,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesReencryptRequest.toObject = function toObject(message, options) { + SqlInstancesReencryptRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesReencryptRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesReencryptRequest.toObject(message.body, options, q + 1); return object; }; @@ -38751,11 +39843,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesReencryptRequest.encode = function encode(message, writer) { + InstancesReencryptRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupReencryptionConfig != null && Object.hasOwnProperty.call(message, "backupReencryptionConfig")) - $root.google.cloud.sql.v1.BackupReencryptionConfig.encode(message.backupReencryptionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.BackupReencryptionConfig.encode(message.backupReencryptionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -38769,7 +39865,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesReencryptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -38840,7 +39936,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.backupReencryptionConfig != null && message.hasOwnProperty("backupReencryptionConfig")) { + if (message.backupReencryptionConfig != null && Object.hasOwnProperty.call(message, "backupReencryptionConfig")) { properties._backupReencryptionConfig = 1; { var error = $root.google.cloud.sql.v1.BackupReencryptionConfig.verify(message.backupReencryptionConfig, long + 1); @@ -38862,13 +39958,15 @@ InstancesReencryptRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesReencryptRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesReencryptRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesReencryptRequest(); if (object.backupReencryptionConfig != null) { - if (typeof object.backupReencryptionConfig !== "object") + if (!$util.isObject(object.backupReencryptionConfig)) throw TypeError(".google.cloud.sql.v1.InstancesReencryptRequest.backupReencryptionConfig: object expected"); message.backupReencryptionConfig = $root.google.cloud.sql.v1.BackupReencryptionConfig.fromObject(object.backupReencryptionConfig, long + 1); } @@ -38884,12 +39982,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesReencryptRequest.toObject = function toObject(message, options) { + InstancesReencryptRequest.toObject = function 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.backupReencryptionConfig != null && message.hasOwnProperty("backupReencryptionConfig")) { - object.backupReencryptionConfig = $root.google.cloud.sql.v1.BackupReencryptionConfig.toObject(message.backupReencryptionConfig, options); + if (message.backupReencryptionConfig != null && Object.hasOwnProperty.call(message, "backupReencryptionConfig")) { + object.backupReencryptionConfig = $root.google.cloud.sql.v1.BackupReencryptionConfig.toObject(message.backupReencryptionConfig, options, q + 1); if (options.oneofs) object._backupReencryptionConfig = "backupReencryptionConfig"; } @@ -39002,9 +40104,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupReencryptionConfig.encode = function encode(message, writer) { + BackupReencryptionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupLimit != null && Object.hasOwnProperty.call(message, "backupLimit")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.backupLimit); if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) @@ -39022,7 +40128,7 @@ * @returns {$protobuf.Writer} Writer */ BackupReencryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -39097,12 +40203,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.backupLimit != null && message.hasOwnProperty("backupLimit")) { + if (message.backupLimit != null && Object.hasOwnProperty.call(message, "backupLimit")) { properties._backupLimit = 1; if (!$util.isInteger(message.backupLimit)) return "backupLimit: integer expected"; } - if (message.backupType != null && message.hasOwnProperty("backupType")) { + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) { properties._backupType = 1; switch (message.backupType) { default: @@ -39127,6 +40233,8 @@ BackupReencryptionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.BackupReencryptionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.BackupReencryptionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -39166,16 +40274,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupReencryptionConfig.toObject = function toObject(message, options) { + BackupReencryptionConfig.toObject = function 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.backupLimit != null && message.hasOwnProperty("backupLimit")) { + if (message.backupLimit != null && Object.hasOwnProperty.call(message, "backupLimit")) { object.backupLimit = message.backupLimit; if (options.oneofs) object._backupLimit = "backupLimit"; } - if (message.backupType != null && message.hasOwnProperty("backupType")) { + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) { object.backupType = options.enums === String ? $root.google.cloud.sql.v1.BackupReencryptionConfig.BackupType[message.backupType] === undefined ? message.backupType : $root.google.cloud.sql.v1.BackupReencryptionConfig.BackupType[message.backupType] : message.backupType; if (options.oneofs) object._backupType = "backupType"; @@ -39299,9 +40411,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalSyncSelectedObject.encode = function encode(message, writer) { + ExternalSyncSelectedObject.encode = function encode(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; @@ -39317,7 +40433,7 @@ * @returns {$protobuf.Writer} Writer */ ExternalSyncSelectedObject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -39387,7 +40503,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; @@ -39404,6 +40520,8 @@ ExternalSyncSelectedObject.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExternalSyncSelectedObject) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExternalSyncSelectedObject: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -39423,13 +40541,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExternalSyncSelectedObject.toObject = function toObject(message, options) { + ExternalSyncSelectedObject.toObject = function toObject(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; }; @@ -39525,9 +40647,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetDiskShrinkConfigRequest.encode = function encode(message, writer) { + SqlInstancesGetDiskShrinkConfigRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -39545,7 +40671,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetDiskShrinkConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -39619,10 +40745,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -39639,6 +40765,8 @@ SqlInstancesGetDiskShrinkConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -39660,17 +40788,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetDiskShrinkConfigRequest.toObject = function toObject(message, options) { + SqlInstancesGetDiskShrinkConfigRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -39844,9 +40976,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesVerifyExternalSyncSettingsRequest.encode = function encode(message, writer) { + SqlInstancesVerifyExternalSyncSettingsRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -39858,14 +40994,14 @@ if (message.verifyReplicationOnly != null && Object.hasOwnProperty.call(message, "verifyReplicationOnly")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.verifyReplicationOnly); if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) - $root.google.cloud.sql.v1.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.migrationType); if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.syncParallelLevel); if (message.selectedObjects != null && message.selectedObjects.length) for (var i = 0; i < message.selectedObjects.length; ++i) - $root.google.cloud.sql.v1.ExternalSyncSelectedObject.encode(message.selectedObjects[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1.ExternalSyncSelectedObject.encode(message.selectedObjects[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -39879,7 +41015,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesVerifyExternalSyncSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -39984,16 +41120,16 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.verifyConnectionOnly != null && message.hasOwnProperty("verifyConnectionOnly")) + if (message.verifyConnectionOnly != null && Object.hasOwnProperty.call(message, "verifyConnectionOnly")) if (typeof message.verifyConnectionOnly !== "boolean") return "verifyConnectionOnly: boolean expected"; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) switch (message.syncMode) { default: return "syncMode: enum value expected"; @@ -40002,10 +41138,10 @@ case 2: break; } - if (message.verifyReplicationOnly != null && message.hasOwnProperty("verifyReplicationOnly")) + if (message.verifyReplicationOnly != null && Object.hasOwnProperty.call(message, "verifyReplicationOnly")) if (typeof message.verifyReplicationOnly !== "boolean") return "verifyReplicationOnly: boolean expected"; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { properties.syncConfig = 1; { var error = $root.google.cloud.sql.v1.MySqlSyncConfig.verify(message.mysqlSyncConfig, long + 1); @@ -40013,7 +41149,7 @@ return "mysqlSyncConfig." + error; } } - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) switch (message.migrationType) { default: return "migrationType: enum value expected"; @@ -40022,7 +41158,7 @@ case 2: break; } - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) switch (message.syncParallelLevel) { default: return "syncParallelLevel: enum value expected"; @@ -40032,7 +41168,7 @@ case 3: break; } - if (message.selectedObjects != null && message.hasOwnProperty("selectedObjects")) { + if (message.selectedObjects != null && Object.hasOwnProperty.call(message, "selectedObjects")) { if (!Array.isArray(message.selectedObjects)) return "selectedObjects: array expected"; for (var i = 0; i < message.selectedObjects.length; ++i) { @@ -40055,6 +41191,8 @@ SqlInstancesVerifyExternalSyncSettingsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -40089,7 +41227,7 @@ if (object.verifyReplicationOnly != null) message.verifyReplicationOnly = Boolean(object.verifyReplicationOnly); if (object.mysqlSyncConfig != null) { - if (typeof object.mysqlSyncConfig !== "object") + if (!$util.isObject(object.mysqlSyncConfig)) throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.mysqlSyncConfig: object expected"); message.mysqlSyncConfig = $root.google.cloud.sql.v1.MySqlSyncConfig.fromObject(object.mysqlSyncConfig, long + 1); } @@ -40142,7 +41280,7 @@ throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.selectedObjects: array expected"); message.selectedObjects = []; for (var i = 0; i < object.selectedObjects.length; ++i) { - if (typeof object.selectedObjects[i] !== "object") + if (!$util.isObject(object.selectedObjects[i])) throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.selectedObjects: object expected"); message.selectedObjects[i] = $root.google.cloud.sql.v1.ExternalSyncSelectedObject.fromObject(object.selectedObjects[i], long + 1); } @@ -40159,9 +41297,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesVerifyExternalSyncSettingsRequest.toObject = function toObject(message, options) { + SqlInstancesVerifyExternalSyncSettingsRequest.toObject = function toObject(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.selectedObjects = []; @@ -40174,29 +41316,29 @@ object.migrationType = options.enums === String ? "MIGRATION_TYPE_UNSPECIFIED" : 0; object.syncParallelLevel = options.enums === String ? "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" : 0; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.verifyConnectionOnly != null && message.hasOwnProperty("verifyConnectionOnly")) + if (message.verifyConnectionOnly != null && Object.hasOwnProperty.call(message, "verifyConnectionOnly")) object.verifyConnectionOnly = message.verifyConnectionOnly; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) object.syncMode = options.enums === String ? $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] === undefined ? message.syncMode : $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] : message.syncMode; - if (message.verifyReplicationOnly != null && message.hasOwnProperty("verifyReplicationOnly")) + if (message.verifyReplicationOnly != null && Object.hasOwnProperty.call(message, "verifyReplicationOnly")) object.verifyReplicationOnly = message.verifyReplicationOnly; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { - object.mysqlSyncConfig = $root.google.cloud.sql.v1.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options); + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { + object.mysqlSyncConfig = $root.google.cloud.sql.v1.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options, q + 1); if (options.oneofs) object.syncConfig = "mysqlSyncConfig"; } - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) object.migrationType = options.enums === String ? $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] === undefined ? message.migrationType : $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] : message.migrationType; - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) object.syncParallelLevel = options.enums === String ? $root.google.cloud.sql.v1.ExternalSyncParallelLevel[message.syncParallelLevel] === undefined ? message.syncParallelLevel : $root.google.cloud.sql.v1.ExternalSyncParallelLevel[message.syncParallelLevel] : message.syncParallelLevel; if (message.selectedObjects && message.selectedObjects.length) { object.selectedObjects = []; for (var j = 0; j < message.selectedObjects.length; ++j) - object.selectedObjects[j] = $root.google.cloud.sql.v1.ExternalSyncSelectedObject.toObject(message.selectedObjects[j], options); + object.selectedObjects[j] = $root.google.cloud.sql.v1.ExternalSyncSelectedObject.toObject(message.selectedObjects[j], options, q + 1); } return object; }; @@ -40392,9 +41534,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesStartExternalSyncRequest.encode = function encode(message, writer) { + SqlInstancesStartExternalSyncRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -40404,7 +41550,7 @@ if (message.skipVerification != null && Object.hasOwnProperty.call(message, "skipVerification")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipVerification); if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) - $root.google.cloud.sql.v1.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.syncParallelLevel); if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) @@ -40424,7 +41570,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesStartExternalSyncRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -40523,13 +41669,13 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) switch (message.syncMode) { default: return "syncMode: enum value expected"; @@ -40538,10 +41684,10 @@ case 2: break; } - if (message.skipVerification != null && message.hasOwnProperty("skipVerification")) + if (message.skipVerification != null && Object.hasOwnProperty.call(message, "skipVerification")) if (typeof message.skipVerification !== "boolean") return "skipVerification: boolean expected"; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { properties.syncConfig = 1; { var error = $root.google.cloud.sql.v1.MySqlSyncConfig.verify(message.mysqlSyncConfig, long + 1); @@ -40549,7 +41695,7 @@ return "mysqlSyncConfig." + error; } } - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) switch (message.syncParallelLevel) { default: return "syncParallelLevel: enum value expected"; @@ -40559,7 +41705,7 @@ case 3: break; } - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) switch (message.migrationType) { default: return "migrationType: enum value expected"; @@ -40568,7 +41714,7 @@ case 2: break; } - if (message.replicaOverwriteEnabled != null && message.hasOwnProperty("replicaOverwriteEnabled")) + if (message.replicaOverwriteEnabled != null && Object.hasOwnProperty.call(message, "replicaOverwriteEnabled")) if (typeof message.replicaOverwriteEnabled !== "boolean") return "replicaOverwriteEnabled: boolean expected"; return null; @@ -40585,6 +41731,8 @@ SqlInstancesStartExternalSyncRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -40617,7 +41765,7 @@ if (object.skipVerification != null) message.skipVerification = Boolean(object.skipVerification); if (object.mysqlSyncConfig != null) { - if (typeof object.mysqlSyncConfig !== "object") + if (!$util.isObject(object.mysqlSyncConfig)) throw TypeError(".google.cloud.sql.v1.SqlInstancesStartExternalSyncRequest.mysqlSyncConfig: object expected"); message.mysqlSyncConfig = $root.google.cloud.sql.v1.MySqlSyncConfig.fromObject(object.mysqlSyncConfig, long + 1); } @@ -40679,9 +41827,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesStartExternalSyncRequest.toObject = function toObject(message, options) { + SqlInstancesStartExternalSyncRequest.toObject = function toObject(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 = ""; @@ -40692,24 +41844,24 @@ object.migrationType = options.enums === String ? "MIGRATION_TYPE_UNSPECIFIED" : 0; object.replicaOverwriteEnabled = false; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) object.syncMode = options.enums === String ? $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] === undefined ? message.syncMode : $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] : message.syncMode; - if (message.skipVerification != null && message.hasOwnProperty("skipVerification")) + if (message.skipVerification != null && Object.hasOwnProperty.call(message, "skipVerification")) object.skipVerification = message.skipVerification; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { - object.mysqlSyncConfig = $root.google.cloud.sql.v1.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options); + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { + object.mysqlSyncConfig = $root.google.cloud.sql.v1.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options, q + 1); if (options.oneofs) object.syncConfig = "mysqlSyncConfig"; } - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) object.syncParallelLevel = options.enums === String ? $root.google.cloud.sql.v1.ExternalSyncParallelLevel[message.syncParallelLevel] === undefined ? message.syncParallelLevel : $root.google.cloud.sql.v1.ExternalSyncParallelLevel[message.syncParallelLevel] : message.syncParallelLevel; - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) object.migrationType = options.enums === String ? $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] === undefined ? message.migrationType : $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] : message.migrationType; - if (message.replicaOverwriteEnabled != null && message.hasOwnProperty("replicaOverwriteEnabled")) + if (message.replicaOverwriteEnabled != null && Object.hasOwnProperty.call(message, "replicaOverwriteEnabled")) object.replicaOverwriteEnabled = message.replicaOverwriteEnabled; return object; }; @@ -40805,9 +41957,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesResetReplicaSizeRequest.encode = function encode(message, writer) { + SqlInstancesResetReplicaSizeRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -40825,7 +41981,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesResetReplicaSizeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -40899,10 +42055,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -40919,6 +42075,8 @@ SqlInstancesResetReplicaSizeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesResetReplicaSizeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -40940,17 +42098,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesResetReplicaSizeRequest.toObject = function toObject(message, options) { + SqlInstancesResetReplicaSizeRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -41055,15 +42217,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesCreateEphemeralCertRequest.encode = function encode(message, writer) { + SqlInstancesCreateEphemeralCertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -41077,7 +42243,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesCreateEphemeralCertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -41155,13 +42321,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -41180,6 +42346,8 @@ SqlInstancesCreateEphemeralCertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -41190,7 +42358,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesCreateEphemeralCertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.fromObject(object.body, long + 1); } @@ -41206,21 +42374,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesCreateEphemeralCertRequest.toObject = function toObject(message, options) { + SqlInstancesCreateEphemeralCertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.SslCertsCreateEphemeralRequest.toObject(message.body, options, q + 1); return object; }; @@ -41306,11 +42478,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesCloneRequest.encode = function encode(message, writer) { + InstancesCloneRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.cloneContext != null && Object.hasOwnProperty.call(message, "cloneContext")) - $root.google.cloud.sql.v1.CloneContext.encode(message.cloneContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.CloneContext.encode(message.cloneContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -41324,7 +42500,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesCloneRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -41394,7 +42570,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.cloneContext != null && message.hasOwnProperty("cloneContext")) { + if (message.cloneContext != null && Object.hasOwnProperty.call(message, "cloneContext")) { var error = $root.google.cloud.sql.v1.CloneContext.verify(message.cloneContext, long + 1); if (error) return "cloneContext." + error; @@ -41413,13 +42589,15 @@ InstancesCloneRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesCloneRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesCloneRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesCloneRequest(); if (object.cloneContext != null) { - if (typeof object.cloneContext !== "object") + if (!$util.isObject(object.cloneContext)) throw TypeError(".google.cloud.sql.v1.InstancesCloneRequest.cloneContext: object expected"); message.cloneContext = $root.google.cloud.sql.v1.CloneContext.fromObject(object.cloneContext, long + 1); } @@ -41435,14 +42613,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesCloneRequest.toObject = function toObject(message, options) { + InstancesCloneRequest.toObject = function toObject(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.cloneContext = null; - if (message.cloneContext != null && message.hasOwnProperty("cloneContext")) - object.cloneContext = $root.google.cloud.sql.v1.CloneContext.toObject(message.cloneContext, options); + if (message.cloneContext != null && Object.hasOwnProperty.call(message, "cloneContext")) + object.cloneContext = $root.google.cloud.sql.v1.CloneContext.toObject(message.cloneContext, options, q + 1); return object; }; @@ -41528,11 +42710,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesDemoteMasterRequest.encode = function encode(message, writer) { + InstancesDemoteMasterRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.demoteMasterContext != null && Object.hasOwnProperty.call(message, "demoteMasterContext")) - $root.google.cloud.sql.v1.DemoteMasterContext.encode(message.demoteMasterContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.DemoteMasterContext.encode(message.demoteMasterContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -41546,7 +42732,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesDemoteMasterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -41616,7 +42802,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.demoteMasterContext != null && message.hasOwnProperty("demoteMasterContext")) { + if (message.demoteMasterContext != null && Object.hasOwnProperty.call(message, "demoteMasterContext")) { var error = $root.google.cloud.sql.v1.DemoteMasterContext.verify(message.demoteMasterContext, long + 1); if (error) return "demoteMasterContext." + error; @@ -41635,13 +42821,15 @@ InstancesDemoteMasterRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesDemoteMasterRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesDemoteMasterRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesDemoteMasterRequest(); if (object.demoteMasterContext != null) { - if (typeof object.demoteMasterContext !== "object") + if (!$util.isObject(object.demoteMasterContext)) throw TypeError(".google.cloud.sql.v1.InstancesDemoteMasterRequest.demoteMasterContext: object expected"); message.demoteMasterContext = $root.google.cloud.sql.v1.DemoteMasterContext.fromObject(object.demoteMasterContext, long + 1); } @@ -41657,14 +42845,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesDemoteMasterRequest.toObject = function toObject(message, options) { + InstancesDemoteMasterRequest.toObject = function toObject(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.demoteMasterContext = null; - if (message.demoteMasterContext != null && message.hasOwnProperty("demoteMasterContext")) - object.demoteMasterContext = $root.google.cloud.sql.v1.DemoteMasterContext.toObject(message.demoteMasterContext, options); + if (message.demoteMasterContext != null && Object.hasOwnProperty.call(message, "demoteMasterContext")) + object.demoteMasterContext = $root.google.cloud.sql.v1.DemoteMasterContext.toObject(message.demoteMasterContext, options, q + 1); return object; }; @@ -41750,11 +42942,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesDemoteRequest.encode = function encode(message, writer) { + InstancesDemoteRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.demoteContext != null && Object.hasOwnProperty.call(message, "demoteContext")) - $root.google.cloud.sql.v1.DemoteContext.encode(message.demoteContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.DemoteContext.encode(message.demoteContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -41768,7 +42964,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesDemoteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -41838,7 +43034,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.demoteContext != null && message.hasOwnProperty("demoteContext")) { + if (message.demoteContext != null && Object.hasOwnProperty.call(message, "demoteContext")) { var error = $root.google.cloud.sql.v1.DemoteContext.verify(message.demoteContext, long + 1); if (error) return "demoteContext." + error; @@ -41857,13 +43053,15 @@ InstancesDemoteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesDemoteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesDemoteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesDemoteRequest(); if (object.demoteContext != null) { - if (typeof object.demoteContext !== "object") + if (!$util.isObject(object.demoteContext)) throw TypeError(".google.cloud.sql.v1.InstancesDemoteRequest.demoteContext: object expected"); message.demoteContext = $root.google.cloud.sql.v1.DemoteContext.fromObject(object.demoteContext, long + 1); } @@ -41879,14 +43077,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesDemoteRequest.toObject = function toObject(message, options) { + InstancesDemoteRequest.toObject = function toObject(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.demoteContext = null; - if (message.demoteContext != null && message.hasOwnProperty("demoteContext")) - object.demoteContext = $root.google.cloud.sql.v1.DemoteContext.toObject(message.demoteContext, options); + if (message.demoteContext != null && Object.hasOwnProperty.call(message, "demoteContext")) + object.demoteContext = $root.google.cloud.sql.v1.DemoteContext.toObject(message.demoteContext, options, q + 1); return object; }; @@ -41972,11 +43174,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesExportRequest.encode = function encode(message, writer) { + InstancesExportRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) - $root.google.cloud.sql.v1.ExportContext.encode(message.exportContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.ExportContext.encode(message.exportContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -41990,7 +43196,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -42060,7 +43266,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.exportContext != null && message.hasOwnProperty("exportContext")) { + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) { var error = $root.google.cloud.sql.v1.ExportContext.verify(message.exportContext, long + 1); if (error) return "exportContext." + error; @@ -42079,13 +43285,15 @@ InstancesExportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesExportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesExportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesExportRequest(); if (object.exportContext != null) { - if (typeof object.exportContext !== "object") + if (!$util.isObject(object.exportContext)) throw TypeError(".google.cloud.sql.v1.InstancesExportRequest.exportContext: object expected"); message.exportContext = $root.google.cloud.sql.v1.ExportContext.fromObject(object.exportContext, long + 1); } @@ -42101,14 +43309,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesExportRequest.toObject = function toObject(message, options) { + InstancesExportRequest.toObject = function toObject(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.exportContext = null; - if (message.exportContext != null && message.hasOwnProperty("exportContext")) - object.exportContext = $root.google.cloud.sql.v1.ExportContext.toObject(message.exportContext, options); + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) + object.exportContext = $root.google.cloud.sql.v1.ExportContext.toObject(message.exportContext, options, q + 1); return object; }; @@ -42194,11 +43406,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesFailoverRequest.encode = function encode(message, writer) { + InstancesFailoverRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.failoverContext != null && Object.hasOwnProperty.call(message, "failoverContext")) - $root.google.cloud.sql.v1.FailoverContext.encode(message.failoverContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.FailoverContext.encode(message.failoverContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -42212,7 +43428,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesFailoverRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -42282,7 +43498,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.failoverContext != null && message.hasOwnProperty("failoverContext")) { + if (message.failoverContext != null && Object.hasOwnProperty.call(message, "failoverContext")) { var error = $root.google.cloud.sql.v1.FailoverContext.verify(message.failoverContext, long + 1); if (error) return "failoverContext." + error; @@ -42301,13 +43517,15 @@ InstancesFailoverRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesFailoverRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesFailoverRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesFailoverRequest(); if (object.failoverContext != null) { - if (typeof object.failoverContext !== "object") + if (!$util.isObject(object.failoverContext)) throw TypeError(".google.cloud.sql.v1.InstancesFailoverRequest.failoverContext: object expected"); message.failoverContext = $root.google.cloud.sql.v1.FailoverContext.fromObject(object.failoverContext, long + 1); } @@ -42323,14 +43541,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesFailoverRequest.toObject = function toObject(message, options) { + InstancesFailoverRequest.toObject = function toObject(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.failoverContext = null; - if (message.failoverContext != null && message.hasOwnProperty("failoverContext")) - object.failoverContext = $root.google.cloud.sql.v1.FailoverContext.toObject(message.failoverContext, options); + if (message.failoverContext != null && Object.hasOwnProperty.call(message, "failoverContext")) + object.failoverContext = $root.google.cloud.sql.v1.FailoverContext.toObject(message.failoverContext, options, q + 1); return object; }; @@ -42425,9 +43647,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsCreateEphemeralRequest.encode = function encode(message, writer) { + SslCertsCreateEphemeralRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.publicKey); if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) @@ -42445,7 +43671,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsCreateEphemeralRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -42519,10 +43745,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) if (!$util.isString(message.publicKey)) return "publicKey: string expected"; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) if (!$util.isString(message.accessToken)) return "accessToken: string expected"; return null; @@ -42539,6 +43765,8 @@ SslCertsCreateEphemeralRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SslCertsCreateEphemeralRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SslCertsCreateEphemeralRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -42560,17 +43788,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsCreateEphemeralRequest.toObject = function toObject(message, options) { + SslCertsCreateEphemeralRequest.toObject = function toObject(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.publicKey = ""; object.accessToken = ""; } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) object.publicKey = message.publicKey; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) object.accessToken = message.accessToken; return object; }; @@ -42657,11 +43889,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesImportRequest.encode = function encode(message, writer) { + InstancesImportRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) - $root.google.cloud.sql.v1.ImportContext.encode(message.importContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.ImportContext.encode(message.importContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -42675,7 +43911,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesImportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -42745,7 +43981,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.importContext != null && message.hasOwnProperty("importContext")) { + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) { var error = $root.google.cloud.sql.v1.ImportContext.verify(message.importContext, long + 1); if (error) return "importContext." + error; @@ -42764,13 +44000,15 @@ InstancesImportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesImportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesImportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesImportRequest(); if (object.importContext != null) { - if (typeof object.importContext !== "object") + if (!$util.isObject(object.importContext)) throw TypeError(".google.cloud.sql.v1.InstancesImportRequest.importContext: object expected"); message.importContext = $root.google.cloud.sql.v1.ImportContext.fromObject(object.importContext, long + 1); } @@ -42786,14 +44024,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesImportRequest.toObject = function toObject(message, options) { + InstancesImportRequest.toObject = function toObject(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.importContext = null; - if (message.importContext != null && message.hasOwnProperty("importContext")) - object.importContext = $root.google.cloud.sql.v1.ImportContext.toObject(message.importContext, options); + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) + object.importContext = $root.google.cloud.sql.v1.ImportContext.toObject(message.importContext, options, q + 1); return object; }; @@ -42879,11 +44121,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(message, writer) { + InstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) - $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -42897,7 +44143,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesPreCheckMajorVersionUpgradeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -42967,7 +44213,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) { + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) { var error = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.verify(message.preCheckMajorVersionUpgradeContext, long + 1); if (error) return "preCheckMajorVersionUpgradeContext." + error; @@ -42986,13 +44232,15 @@ InstancesPreCheckMajorVersionUpgradeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest(); if (object.preCheckMajorVersionUpgradeContext != null) { - if (typeof object.preCheckMajorVersionUpgradeContext !== "object") + if (!$util.isObject(object.preCheckMajorVersionUpgradeContext)) throw TypeError(".google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.preCheckMajorVersionUpgradeContext: object expected"); message.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.fromObject(object.preCheckMajorVersionUpgradeContext, long + 1); } @@ -43008,14 +44256,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(message, options) { + InstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(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.preCheckMajorVersionUpgradeContext = null; - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) - object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options); + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) + object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options, q + 1); return object; }; @@ -43130,17 +44382,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListResponse.encode = function encode(message, writer) { + InstancesListResponse.encode = function encode(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.warnings != null && message.warnings.length) for (var i = 0; i < message.warnings.length; ++i) - $root.google.cloud.sql.v1.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.DatabaseInstance.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.nextPageToken); return writer; @@ -43156,7 +44412,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -43242,10 +44498,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.warnings != null && message.hasOwnProperty("warnings")) { + if (message.warnings != null && Object.hasOwnProperty.call(message, "warnings")) { if (!Array.isArray(message.warnings)) return "warnings: array expected"; for (var i = 0; i < message.warnings.length; ++i) { @@ -43254,7 +44510,7 @@ return "warnings." + error; } } - if (message.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -43263,7 +44519,7 @@ return "items." + 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; @@ -43280,6 +44536,8 @@ InstancesListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43292,7 +44550,7 @@ throw TypeError(".google.cloud.sql.v1.InstancesListResponse.warnings: array expected"); message.warnings = []; for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") + if (!$util.isObject(object.warnings[i])) throw TypeError(".google.cloud.sql.v1.InstancesListResponse.warnings: object expected"); message.warnings[i] = $root.google.cloud.sql.v1.ApiWarning.fromObject(object.warnings[i], long + 1); } @@ -43302,7 +44560,7 @@ throw TypeError(".google.cloud.sql.v1.InstancesListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.InstancesListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.DatabaseInstance.fromObject(object.items[i], long + 1); } @@ -43321,9 +44579,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListResponse.toObject = function toObject(message, options) { + InstancesListResponse.toObject = function toObject(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.warnings = []; @@ -43333,19 +44595,19 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.warnings && message.warnings.length) { object.warnings = []; for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.sql.v1.ApiWarning.toObject(message.warnings[j], options); + object.warnings[j] = $root.google.cloud.sql.v1.ApiWarning.toObject(message.warnings[j], options, q + 1); } if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.items[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; }; @@ -43451,12 +44713,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListServerCasResponse.encode = function encode(message, writer) { + InstancesListServerCasResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certs != null && message.certs.length) for (var i = 0; i < message.certs.length; ++i) - $root.google.cloud.sql.v1.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.activeVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -43474,7 +44740,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListServerCasResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -43554,7 +44820,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certs != null && message.hasOwnProperty("certs")) { + if (message.certs != null && Object.hasOwnProperty.call(message, "certs")) { if (!Array.isArray(message.certs)) return "certs: array expected"; for (var i = 0; i < message.certs.length; ++i) { @@ -43563,10 +44829,10 @@ return "certs." + error; } } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) if (!$util.isString(message.activeVersion)) return "activeVersion: string expected"; - 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"; return null; @@ -43583,6 +44849,8 @@ InstancesListServerCasResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesListServerCasResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesListServerCasResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43593,7 +44861,7 @@ throw TypeError(".google.cloud.sql.v1.InstancesListServerCasResponse.certs: array expected"); message.certs = []; for (var i = 0; i < object.certs.length; ++i) { - if (typeof object.certs[i] !== "object") + if (!$util.isObject(object.certs[i])) throw TypeError(".google.cloud.sql.v1.InstancesListServerCasResponse.certs: object expected"); message.certs[i] = $root.google.cloud.sql.v1.SslCert.fromObject(object.certs[i], long + 1); } @@ -43614,9 +44882,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListServerCasResponse.toObject = function toObject(message, options) { + InstancesListServerCasResponse.toObject = function toObject(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.certs = []; @@ -43627,11 +44899,11 @@ if (message.certs && message.certs.length) { object.certs = []; for (var j = 0; j < message.certs.length; ++j) - object.certs[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.certs[j], options); + object.certs[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.certs[j], options, q + 1); } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) object.activeVersion = message.activeVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -43747,15 +45019,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListServerCertificatesResponse.encode = function encode(message, writer) { + InstancesListServerCertificatesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.caCerts != null && message.caCerts.length) for (var i = 0; i < message.caCerts.length; ++i) - $root.google.cloud.sql.v1.SslCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.serverCerts != null && message.serverCerts.length) for (var i = 0; i < message.serverCerts.length; ++i) - $root.google.cloud.sql.v1.SslCert.encode(message.serverCerts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.serverCerts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.activeVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -43773,7 +45049,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListServerCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -43859,7 +45135,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (message.caCerts != null && Object.hasOwnProperty.call(message, "caCerts")) { if (!Array.isArray(message.caCerts)) return "caCerts: array expected"; for (var i = 0; i < message.caCerts.length; ++i) { @@ -43868,7 +45144,7 @@ return "caCerts." + error; } } - if (message.serverCerts != null && message.hasOwnProperty("serverCerts")) { + if (message.serverCerts != null && Object.hasOwnProperty.call(message, "serverCerts")) { if (!Array.isArray(message.serverCerts)) return "serverCerts: array expected"; for (var i = 0; i < message.serverCerts.length; ++i) { @@ -43877,10 +45153,10 @@ return "serverCerts." + error; } } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) if (!$util.isString(message.activeVersion)) return "activeVersion: string expected"; - 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"; return null; @@ -43897,6 +45173,8 @@ InstancesListServerCertificatesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesListServerCertificatesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesListServerCertificatesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -43907,7 +45185,7 @@ throw TypeError(".google.cloud.sql.v1.InstancesListServerCertificatesResponse.caCerts: array expected"); message.caCerts = []; for (var i = 0; i < object.caCerts.length; ++i) { - if (typeof object.caCerts[i] !== "object") + if (!$util.isObject(object.caCerts[i])) throw TypeError(".google.cloud.sql.v1.InstancesListServerCertificatesResponse.caCerts: object expected"); message.caCerts[i] = $root.google.cloud.sql.v1.SslCert.fromObject(object.caCerts[i], long + 1); } @@ -43917,7 +45195,7 @@ throw TypeError(".google.cloud.sql.v1.InstancesListServerCertificatesResponse.serverCerts: array expected"); message.serverCerts = []; for (var i = 0; i < object.serverCerts.length; ++i) { - if (typeof object.serverCerts[i] !== "object") + if (!$util.isObject(object.serverCerts[i])) throw TypeError(".google.cloud.sql.v1.InstancesListServerCertificatesResponse.serverCerts: object expected"); message.serverCerts[i] = $root.google.cloud.sql.v1.SslCert.fromObject(object.serverCerts[i], long + 1); } @@ -43938,9 +45216,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListServerCertificatesResponse.toObject = function toObject(message, options) { + InstancesListServerCertificatesResponse.toObject = function toObject(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.caCerts = []; @@ -43953,16 +45235,16 @@ if (message.caCerts && message.caCerts.length) { object.caCerts = []; for (var j = 0; j < message.caCerts.length; ++j) - object.caCerts[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.caCerts[j], options); + object.caCerts[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.caCerts[j], options, q + 1); } if (message.serverCerts && message.serverCerts.length) { object.serverCerts = []; for (var j = 0; j < message.serverCerts.length; ++j) - object.serverCerts[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCerts[j], options); + object.serverCerts[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCerts[j], options, q + 1); } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) object.activeVersion = message.activeVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -44068,12 +45350,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListEntraIdCertificatesResponse.encode = function encode(message, writer) { + InstancesListEntraIdCertificatesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certs != null && message.certs.length) for (var i = 0; i < message.certs.length; ++i) - $root.google.cloud.sql.v1.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.activeVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -44091,7 +45377,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListEntraIdCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44171,7 +45457,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certs != null && message.hasOwnProperty("certs")) { + if (message.certs != null && Object.hasOwnProperty.call(message, "certs")) { if (!Array.isArray(message.certs)) return "certs: array expected"; for (var i = 0; i < message.certs.length; ++i) { @@ -44180,10 +45466,10 @@ return "certs." + error; } } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) if (!$util.isString(message.activeVersion)) return "activeVersion: string expected"; - 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"; return null; @@ -44200,6 +45486,8 @@ InstancesListEntraIdCertificatesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -44210,7 +45498,7 @@ throw TypeError(".google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.certs: array expected"); message.certs = []; for (var i = 0; i < object.certs.length; ++i) { - if (typeof object.certs[i] !== "object") + if (!$util.isObject(object.certs[i])) throw TypeError(".google.cloud.sql.v1.InstancesListEntraIdCertificatesResponse.certs: object expected"); message.certs[i] = $root.google.cloud.sql.v1.SslCert.fromObject(object.certs[i], long + 1); } @@ -44231,9 +45519,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListEntraIdCertificatesResponse.toObject = function toObject(message, options) { + InstancesListEntraIdCertificatesResponse.toObject = function toObject(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.certs = []; @@ -44244,11 +45536,11 @@ if (message.certs && message.certs.length) { object.certs = []; for (var j = 0; j < message.certs.length; ++j) - object.certs[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.certs[j], options); + object.certs[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.certs[j], options, q + 1); } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) object.activeVersion = message.activeVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -44372,15 +45664,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRestoreBackupRequest.encode = function encode(message, writer) { + InstancesRestoreBackupRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.restoreBackupContext != null && Object.hasOwnProperty.call(message, "restoreBackupContext")) - $root.google.cloud.sql.v1.RestoreBackupContext.encode(message.restoreBackupContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.RestoreBackupContext.encode(message.restoreBackupContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.backup); if (message.restoreInstanceSettings != null && Object.hasOwnProperty.call(message, "restoreInstanceSettings")) - $root.google.cloud.sql.v1.DatabaseInstance.encode(message.restoreInstanceSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.encode(message.restoreInstanceSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.backupdrBackup != null && Object.hasOwnProperty.call(message, "backupdrBackup")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupdrBackup); if (message.restoreInstanceClearOverridesFieldNames != null && message.restoreInstanceClearOverridesFieldNames.length) @@ -44399,7 +45695,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44487,23 +45783,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.restoreBackupContext != null && message.hasOwnProperty("restoreBackupContext")) { + if (message.restoreBackupContext != null && Object.hasOwnProperty.call(message, "restoreBackupContext")) { var error = $root.google.cloud.sql.v1.RestoreBackupContext.verify(message.restoreBackupContext, long + 1); if (error) return "restoreBackupContext." + error; } - 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.backupdrBackup != null && message.hasOwnProperty("backupdrBackup")) + if (message.backupdrBackup != null && Object.hasOwnProperty.call(message, "backupdrBackup")) if (!$util.isString(message.backupdrBackup)) return "backupdrBackup: string expected"; - if (message.restoreInstanceSettings != null && message.hasOwnProperty("restoreInstanceSettings")) { + if (message.restoreInstanceSettings != null && Object.hasOwnProperty.call(message, "restoreInstanceSettings")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.verify(message.restoreInstanceSettings, long + 1); if (error) return "restoreInstanceSettings." + error; } - if (message.restoreInstanceClearOverridesFieldNames != null && message.hasOwnProperty("restoreInstanceClearOverridesFieldNames")) { + if (message.restoreInstanceClearOverridesFieldNames != null && Object.hasOwnProperty.call(message, "restoreInstanceClearOverridesFieldNames")) { if (!Array.isArray(message.restoreInstanceClearOverridesFieldNames)) return "restoreInstanceClearOverridesFieldNames: array expected"; for (var i = 0; i < message.restoreInstanceClearOverridesFieldNames.length; ++i) @@ -44524,13 +45820,15 @@ InstancesRestoreBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesRestoreBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesRestoreBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesRestoreBackupRequest(); if (object.restoreBackupContext != null) { - if (typeof object.restoreBackupContext !== "object") + if (!$util.isObject(object.restoreBackupContext)) throw TypeError(".google.cloud.sql.v1.InstancesRestoreBackupRequest.restoreBackupContext: object expected"); message.restoreBackupContext = $root.google.cloud.sql.v1.RestoreBackupContext.fromObject(object.restoreBackupContext, long + 1); } @@ -44539,7 +45837,7 @@ if (object.backupdrBackup != null) message.backupdrBackup = String(object.backupdrBackup); if (object.restoreInstanceSettings != null) { - if (typeof object.restoreInstanceSettings !== "object") + if (!$util.isObject(object.restoreInstanceSettings)) throw TypeError(".google.cloud.sql.v1.InstancesRestoreBackupRequest.restoreInstanceSettings: object expected"); message.restoreInstanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.fromObject(object.restoreInstanceSettings, long + 1); } @@ -44562,9 +45860,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRestoreBackupRequest.toObject = function toObject(message, options) { + InstancesRestoreBackupRequest.toObject = function toObject(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.restoreInstanceClearOverridesFieldNames = []; @@ -44574,13 +45876,13 @@ object.restoreInstanceSettings = null; object.backupdrBackup = ""; } - if (message.restoreBackupContext != null && message.hasOwnProperty("restoreBackupContext")) - object.restoreBackupContext = $root.google.cloud.sql.v1.RestoreBackupContext.toObject(message.restoreBackupContext, options); - if (message.backup != null && message.hasOwnProperty("backup")) + if (message.restoreBackupContext != null && Object.hasOwnProperty.call(message, "restoreBackupContext")) + object.restoreBackupContext = $root.google.cloud.sql.v1.RestoreBackupContext.toObject(message.restoreBackupContext, options, q + 1); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) object.backup = message.backup; - if (message.restoreInstanceSettings != null && message.hasOwnProperty("restoreInstanceSettings")) - object.restoreInstanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.restoreInstanceSettings, options); - if (message.backupdrBackup != null && message.hasOwnProperty("backupdrBackup")) + if (message.restoreInstanceSettings != null && Object.hasOwnProperty.call(message, "restoreInstanceSettings")) + object.restoreInstanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.restoreInstanceSettings, options, q + 1); + if (message.backupdrBackup != null && Object.hasOwnProperty.call(message, "backupdrBackup")) object.backupdrBackup = message.backupdrBackup; if (message.restoreInstanceClearOverridesFieldNames && message.restoreInstanceClearOverridesFieldNames.length) { object.restoreInstanceClearOverridesFieldNames = []; @@ -44672,11 +45974,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRotateServerCaRequest.encode = function encode(message, writer) { + InstancesRotateServerCaRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rotateServerCaContext != null && Object.hasOwnProperty.call(message, "rotateServerCaContext")) - $root.google.cloud.sql.v1.RotateServerCaContext.encode(message.rotateServerCaContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.RotateServerCaContext.encode(message.rotateServerCaContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -44690,7 +45996,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRotateServerCaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44760,7 +46066,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rotateServerCaContext != null && message.hasOwnProperty("rotateServerCaContext")) { + if (message.rotateServerCaContext != null && Object.hasOwnProperty.call(message, "rotateServerCaContext")) { var error = $root.google.cloud.sql.v1.RotateServerCaContext.verify(message.rotateServerCaContext, long + 1); if (error) return "rotateServerCaContext." + error; @@ -44779,13 +46085,15 @@ InstancesRotateServerCaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesRotateServerCaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesRotateServerCaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesRotateServerCaRequest(); if (object.rotateServerCaContext != null) { - if (typeof object.rotateServerCaContext !== "object") + if (!$util.isObject(object.rotateServerCaContext)) throw TypeError(".google.cloud.sql.v1.InstancesRotateServerCaRequest.rotateServerCaContext: object expected"); message.rotateServerCaContext = $root.google.cloud.sql.v1.RotateServerCaContext.fromObject(object.rotateServerCaContext, long + 1); } @@ -44801,14 +46109,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRotateServerCaRequest.toObject = function toObject(message, options) { + InstancesRotateServerCaRequest.toObject = function toObject(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.rotateServerCaContext = null; - if (message.rotateServerCaContext != null && message.hasOwnProperty("rotateServerCaContext")) - object.rotateServerCaContext = $root.google.cloud.sql.v1.RotateServerCaContext.toObject(message.rotateServerCaContext, options); + if (message.rotateServerCaContext != null && Object.hasOwnProperty.call(message, "rotateServerCaContext")) + object.rotateServerCaContext = $root.google.cloud.sql.v1.RotateServerCaContext.toObject(message.rotateServerCaContext, options, q + 1); return object; }; @@ -44894,11 +46206,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRotateServerCertificateRequest.encode = function encode(message, writer) { + InstancesRotateServerCertificateRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rotateServerCertificateContext != null && Object.hasOwnProperty.call(message, "rotateServerCertificateContext")) - $root.google.cloud.sql.v1.RotateServerCertificateContext.encode(message.rotateServerCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.RotateServerCertificateContext.encode(message.rotateServerCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -44912,7 +46228,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRotateServerCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -44982,7 +46298,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rotateServerCertificateContext != null && message.hasOwnProperty("rotateServerCertificateContext")) { + if (message.rotateServerCertificateContext != null && Object.hasOwnProperty.call(message, "rotateServerCertificateContext")) { var error = $root.google.cloud.sql.v1.RotateServerCertificateContext.verify(message.rotateServerCertificateContext, long + 1); if (error) return "rotateServerCertificateContext." + error; @@ -45001,13 +46317,15 @@ InstancesRotateServerCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesRotateServerCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesRotateServerCertificateRequest(); if (object.rotateServerCertificateContext != null) { - if (typeof object.rotateServerCertificateContext !== "object") + if (!$util.isObject(object.rotateServerCertificateContext)) throw TypeError(".google.cloud.sql.v1.InstancesRotateServerCertificateRequest.rotateServerCertificateContext: object expected"); message.rotateServerCertificateContext = $root.google.cloud.sql.v1.RotateServerCertificateContext.fromObject(object.rotateServerCertificateContext, long + 1); } @@ -45023,14 +46341,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRotateServerCertificateRequest.toObject = function toObject(message, options) { + InstancesRotateServerCertificateRequest.toObject = function toObject(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.rotateServerCertificateContext = null; - if (message.rotateServerCertificateContext != null && message.hasOwnProperty("rotateServerCertificateContext")) - object.rotateServerCertificateContext = $root.google.cloud.sql.v1.RotateServerCertificateContext.toObject(message.rotateServerCertificateContext, options); + if (message.rotateServerCertificateContext != null && Object.hasOwnProperty.call(message, "rotateServerCertificateContext")) + object.rotateServerCertificateContext = $root.google.cloud.sql.v1.RotateServerCertificateContext.toObject(message.rotateServerCertificateContext, options, q + 1); return object; }; @@ -45116,11 +46438,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRotateEntraIdCertificateRequest.encode = function encode(message, writer) { + InstancesRotateEntraIdCertificateRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rotateEntraIdCertificateContext != null && Object.hasOwnProperty.call(message, "rotateEntraIdCertificateContext")) - $root.google.cloud.sql.v1.RotateEntraIdCertificateContext.encode(message.rotateEntraIdCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.RotateEntraIdCertificateContext.encode(message.rotateEntraIdCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -45134,7 +46460,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRotateEntraIdCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -45204,7 +46530,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rotateEntraIdCertificateContext != null && message.hasOwnProperty("rotateEntraIdCertificateContext")) { + if (message.rotateEntraIdCertificateContext != null && Object.hasOwnProperty.call(message, "rotateEntraIdCertificateContext")) { var error = $root.google.cloud.sql.v1.RotateEntraIdCertificateContext.verify(message.rotateEntraIdCertificateContext, long + 1); if (error) return "rotateEntraIdCertificateContext." + error; @@ -45223,13 +46549,15 @@ InstancesRotateEntraIdCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest(); if (object.rotateEntraIdCertificateContext != null) { - if (typeof object.rotateEntraIdCertificateContext !== "object") + if (!$util.isObject(object.rotateEntraIdCertificateContext)) throw TypeError(".google.cloud.sql.v1.InstancesRotateEntraIdCertificateRequest.rotateEntraIdCertificateContext: object expected"); message.rotateEntraIdCertificateContext = $root.google.cloud.sql.v1.RotateEntraIdCertificateContext.fromObject(object.rotateEntraIdCertificateContext, long + 1); } @@ -45245,14 +46573,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRotateEntraIdCertificateRequest.toObject = function toObject(message, options) { + InstancesRotateEntraIdCertificateRequest.toObject = function toObject(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.rotateEntraIdCertificateContext = null; - if (message.rotateEntraIdCertificateContext != null && message.hasOwnProperty("rotateEntraIdCertificateContext")) - object.rotateEntraIdCertificateContext = $root.google.cloud.sql.v1.RotateEntraIdCertificateContext.toObject(message.rotateEntraIdCertificateContext, options); + if (message.rotateEntraIdCertificateContext != null && Object.hasOwnProperty.call(message, "rotateEntraIdCertificateContext")) + object.rotateEntraIdCertificateContext = $root.google.cloud.sql.v1.RotateEntraIdCertificateContext.toObject(message.rotateEntraIdCertificateContext, options, q + 1); return object; }; @@ -45338,11 +46670,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesTruncateLogRequest.encode = function encode(message, writer) { + InstancesTruncateLogRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.truncateLogContext != null && Object.hasOwnProperty.call(message, "truncateLogContext")) - $root.google.cloud.sql.v1.TruncateLogContext.encode(message.truncateLogContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.TruncateLogContext.encode(message.truncateLogContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -45356,7 +46692,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesTruncateLogRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -45426,7 +46762,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.truncateLogContext != null && message.hasOwnProperty("truncateLogContext")) { + if (message.truncateLogContext != null && Object.hasOwnProperty.call(message, "truncateLogContext")) { var error = $root.google.cloud.sql.v1.TruncateLogContext.verify(message.truncateLogContext, long + 1); if (error) return "truncateLogContext." + error; @@ -45445,13 +46781,15 @@ InstancesTruncateLogRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesTruncateLogRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesTruncateLogRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesTruncateLogRequest(); if (object.truncateLogContext != null) { - if (typeof object.truncateLogContext !== "object") + if (!$util.isObject(object.truncateLogContext)) throw TypeError(".google.cloud.sql.v1.InstancesTruncateLogRequest.truncateLogContext: object expected"); message.truncateLogContext = $root.google.cloud.sql.v1.TruncateLogContext.fromObject(object.truncateLogContext, long + 1); } @@ -45467,14 +46805,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesTruncateLogRequest.toObject = function toObject(message, options) { + InstancesTruncateLogRequest.toObject = function toObject(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.truncateLogContext = null; - if (message.truncateLogContext != null && message.hasOwnProperty("truncateLogContext")) - object.truncateLogContext = $root.google.cloud.sql.v1.TruncateLogContext.toObject(message.truncateLogContext, options); + if (message.truncateLogContext != null && Object.hasOwnProperty.call(message, "truncateLogContext")) + object.truncateLogContext = $root.google.cloud.sql.v1.TruncateLogContext.toObject(message.truncateLogContext, options, q + 1); return object; }; @@ -45560,11 +46902,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesAcquireSsrsLeaseRequest.encode = function encode(message, writer) { + InstancesAcquireSsrsLeaseRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) - $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -45578,7 +46924,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesAcquireSsrsLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -45648,7 +46994,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) { + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) { var error = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.verify(message.acquireSsrsLeaseContext, long + 1); if (error) return "acquireSsrsLeaseContext." + error; @@ -45667,13 +47013,15 @@ InstancesAcquireSsrsLeaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest(); if (object.acquireSsrsLeaseContext != null) { - if (typeof object.acquireSsrsLeaseContext !== "object") + if (!$util.isObject(object.acquireSsrsLeaseContext)) throw TypeError(".google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.acquireSsrsLeaseContext: object expected"); message.acquireSsrsLeaseContext = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.fromObject(object.acquireSsrsLeaseContext, long + 1); } @@ -45689,14 +47037,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesAcquireSsrsLeaseRequest.toObject = function toObject(message, options) { + InstancesAcquireSsrsLeaseRequest.toObject = function toObject(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.acquireSsrsLeaseContext = null; - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) - object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options); + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) + object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options, q + 1); return object; }; @@ -45800,15 +47152,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(message, writer) { + SqlInstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -45822,7 +47178,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPreCheckMajorVersionUpgradeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -45900,13 +47256,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -45925,6 +47281,8 @@ SqlInstancesPreCheckMajorVersionUpgradeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -45935,7 +47293,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesPreCheckMajorVersionUpgradeRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.fromObject(object.body, long + 1); } @@ -45951,21 +47309,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(message, options) { + SqlInstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesPreCheckMajorVersionUpgradeRequest.toObject(message.body, options, q + 1); return object; }; @@ -46071,17 +47433,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesVerifyExternalSyncSettingsResponse.encode = function encode(message, writer) { + SqlInstancesVerifyExternalSyncSettingsResponse.encode = function encode(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.errors != null && message.errors.length) for (var i = 0; i < message.errors.length; ++i) - $root.google.cloud.sql.v1.SqlExternalSyncSettingError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlExternalSyncSettingError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.warnings != null && message.warnings.length) for (var i = 0; i < message.warnings.length; ++i) - $root.google.cloud.sql.v1.SqlExternalSyncSettingError.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlExternalSyncSettingError.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -46095,7 +47461,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesVerifyExternalSyncSettingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -46177,10 +47543,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.errors != null && message.hasOwnProperty("errors")) { + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { if (!Array.isArray(message.errors)) return "errors: array expected"; for (var i = 0; i < message.errors.length; ++i) { @@ -46189,7 +47555,7 @@ return "errors." + error; } } - if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (message.warnings != null && Object.hasOwnProperty.call(message, "warnings")) { if (!Array.isArray(message.warnings)) return "warnings: array expected"; for (var i = 0; i < message.warnings.length; ++i) { @@ -46212,6 +47578,8 @@ SqlInstancesVerifyExternalSyncSettingsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -46224,7 +47592,7 @@ throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.errors: array expected"); message.errors = []; for (var i = 0; i < object.errors.length; ++i) { - if (typeof object.errors[i] !== "object") + if (!$util.isObject(object.errors[i])) throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.errors: object expected"); message.errors[i] = $root.google.cloud.sql.v1.SqlExternalSyncSettingError.fromObject(object.errors[i], long + 1); } @@ -46234,7 +47602,7 @@ throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.warnings: array expected"); message.warnings = []; for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") + if (!$util.isObject(object.warnings[i])) throw TypeError(".google.cloud.sql.v1.SqlInstancesVerifyExternalSyncSettingsResponse.warnings: object expected"); message.warnings[i] = $root.google.cloud.sql.v1.SqlExternalSyncSettingError.fromObject(object.warnings[i], long + 1); } @@ -46251,9 +47619,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesVerifyExternalSyncSettingsResponse.toObject = function toObject(message, options) { + SqlInstancesVerifyExternalSyncSettingsResponse.toObject = function toObject(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.errors = []; @@ -46261,17 +47633,17 @@ } if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.errors && message.errors.length) { object.errors = []; for (var j = 0; j < message.errors.length; ++j) - object.errors[j] = $root.google.cloud.sql.v1.SqlExternalSyncSettingError.toObject(message.errors[j], options); + object.errors[j] = $root.google.cloud.sql.v1.SqlExternalSyncSettingError.toObject(message.errors[j], options, q + 1); } if (message.warnings && message.warnings.length) { object.warnings = []; for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.sql.v1.SqlExternalSyncSettingError.toObject(message.warnings[j], options); + object.warnings[j] = $root.google.cloud.sql.v1.SqlExternalSyncSettingError.toObject(message.warnings[j], options, q + 1); } return object; }; @@ -46376,9 +47748,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetDiskShrinkConfigResponse.encode = function encode(message, writer) { + SqlInstancesGetDiskShrinkConfigResponse.encode = function encode(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.minimalTargetSizeGb != null && Object.hasOwnProperty.call(message, "minimalTargetSizeGb")) @@ -46398,7 +47774,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetDiskShrinkConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -46476,13 +47852,13 @@ 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.minimalTargetSizeGb != null && message.hasOwnProperty("minimalTargetSizeGb")) + if (message.minimalTargetSizeGb != null && Object.hasOwnProperty.call(message, "minimalTargetSizeGb")) if (!$util.isInteger(message.minimalTargetSizeGb) && !(message.minimalTargetSizeGb && $util.isInteger(message.minimalTargetSizeGb.low) && $util.isInteger(message.minimalTargetSizeGb.high))) return "minimalTargetSizeGb: integer|Long 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; @@ -46499,6 +47875,8 @@ SqlInstancesGetDiskShrinkConfigResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesGetDiskShrinkConfigResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -46508,7 +47886,7 @@ message.kind = String(object.kind); if (object.minimalTargetSizeGb != null) if ($util.Long) - (message.minimalTargetSizeGb = $util.Long.fromValue(object.minimalTargetSizeGb)).unsigned = false; + message.minimalTargetSizeGb = $util.Long.fromValue(object.minimalTargetSizeGb, false); else if (typeof object.minimalTargetSizeGb === "string") message.minimalTargetSizeGb = parseInt(object.minimalTargetSizeGb, 10); else if (typeof object.minimalTargetSizeGb === "number") @@ -46529,27 +47907,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetDiskShrinkConfigResponse.toObject = function toObject(message, options) { + SqlInstancesGetDiskShrinkConfigResponse.toObject = function toObject(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 = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.minimalTargetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.minimalTargetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.minimalTargetSizeGb = options.longs === String ? "0" : 0; + object.minimalTargetSizeGb = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.message = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.minimalTargetSizeGb != null && message.hasOwnProperty("minimalTargetSizeGb")) - if (typeof message.minimalTargetSizeGb === "number") + if (message.minimalTargetSizeGb != null && Object.hasOwnProperty.call(message, "minimalTargetSizeGb")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.minimalTargetSizeGb = typeof message.minimalTargetSizeGb === "number" ? BigInt(message.minimalTargetSizeGb) : $util.Long.fromBits(message.minimalTargetSizeGb.low >>> 0, message.minimalTargetSizeGb.high >>> 0, false).toBigInt(); + else if (typeof message.minimalTargetSizeGb === "number") object.minimalTargetSizeGb = options.longs === String ? String(message.minimalTargetSizeGb) : message.minimalTargetSizeGb; else object.minimalTargetSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.minimalTargetSizeGb) : options.longs === Number ? new $util.LongBits(message.minimalTargetSizeGb.low >>> 0, message.minimalTargetSizeGb.high >>> 0).toNumber() : message.minimalTargetSizeGb; - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) object.message = message.message; return object; }; @@ -46663,15 +48047,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetLatestRecoveryTimeRequest.encode = function encode(message, writer) { + SqlInstancesGetLatestRecoveryTimeRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) - $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -46685,7 +48073,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetLatestRecoveryTimeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -46764,13 +48152,13 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { properties._sourceInstanceDeletionTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.sourceInstanceDeletionTime, long + 1); @@ -46792,6 +48180,8 @@ SqlInstancesGetLatestRecoveryTimeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -46802,7 +48192,7 @@ if (object.project != null) message.project = String(object.project); if (object.sourceInstanceDeletionTime != null) { - if (typeof object.sourceInstanceDeletionTime !== "object") + if (!$util.isObject(object.sourceInstanceDeletionTime)) throw TypeError(".google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeRequest.sourceInstanceDeletionTime: object expected"); message.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.fromObject(object.sourceInstanceDeletionTime, long + 1); } @@ -46818,20 +48208,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetLatestRecoveryTimeRequest.toObject = function toObject(message, options) { + SqlInstancesGetLatestRecoveryTimeRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { - object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options); + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { + object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options, q + 1); if (options.oneofs) object._sourceInstanceDeletionTime = "sourceInstanceDeletionTime"; } @@ -46938,15 +48332,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetLatestRecoveryTimeResponse.encode = function encode(message, writer) { + SqlInstancesGetLatestRecoveryTimeResponse.encode = function encode(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.latestRecoveryTime != null && Object.hasOwnProperty.call(message, "latestRecoveryTime")) - $root.google.protobuf.Timestamp.encode(message.latestRecoveryTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.latestRecoveryTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.earliestRecoveryTime != null && Object.hasOwnProperty.call(message, "earliestRecoveryTime")) - $root.google.protobuf.Timestamp.encode(message.earliestRecoveryTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.earliestRecoveryTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -46960,7 +48358,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetLatestRecoveryTimeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -47038,15 +48436,15 @@ 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.latestRecoveryTime != null && message.hasOwnProperty("latestRecoveryTime")) { + if (message.latestRecoveryTime != null && Object.hasOwnProperty.call(message, "latestRecoveryTime")) { var error = $root.google.protobuf.Timestamp.verify(message.latestRecoveryTime, long + 1); if (error) return "latestRecoveryTime." + error; } - if (message.earliestRecoveryTime != null && message.hasOwnProperty("earliestRecoveryTime")) { + if (message.earliestRecoveryTime != null && Object.hasOwnProperty.call(message, "earliestRecoveryTime")) { var error = $root.google.protobuf.Timestamp.verify(message.earliestRecoveryTime, long + 1); if (error) return "earliestRecoveryTime." + error; @@ -47065,6 +48463,8 @@ SqlInstancesGetLatestRecoveryTimeResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -47073,12 +48473,12 @@ if (object.kind != null) message.kind = String(object.kind); if (object.latestRecoveryTime != null) { - if (typeof object.latestRecoveryTime !== "object") + if (!$util.isObject(object.latestRecoveryTime)) throw TypeError(".google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.latestRecoveryTime: object expected"); message.latestRecoveryTime = $root.google.protobuf.Timestamp.fromObject(object.latestRecoveryTime, long + 1); } if (object.earliestRecoveryTime != null) { - if (typeof object.earliestRecoveryTime !== "object") + if (!$util.isObject(object.earliestRecoveryTime)) throw TypeError(".google.cloud.sql.v1.SqlInstancesGetLatestRecoveryTimeResponse.earliestRecoveryTime: object expected"); message.earliestRecoveryTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRecoveryTime, long + 1); } @@ -47094,21 +48494,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetLatestRecoveryTimeResponse.toObject = function toObject(message, options) { + SqlInstancesGetLatestRecoveryTimeResponse.toObject = function toObject(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.latestRecoveryTime = null; object.earliestRecoveryTime = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.latestRecoveryTime != null && message.hasOwnProperty("latestRecoveryTime")) - object.latestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.latestRecoveryTime, options); - if (message.earliestRecoveryTime != null && message.hasOwnProperty("earliestRecoveryTime")) - object.earliestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.earliestRecoveryTime, options); + if (message.latestRecoveryTime != null && Object.hasOwnProperty.call(message, "latestRecoveryTime")) + object.latestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.latestRecoveryTime, options, q + 1); + if (message.earliestRecoveryTime != null && Object.hasOwnProperty.call(message, "earliestRecoveryTime")) + object.earliestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.earliestRecoveryTime, options, q + 1); return object; }; @@ -47327,9 +48731,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloneContext.encode = function encode(message, writer) { + CloneContext.encode = function encode(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.pitrTimestampMs != null && Object.hasOwnProperty.call(message, "pitrTimestampMs")) @@ -47337,9 +48745,9 @@ if (message.destinationInstanceName != null && Object.hasOwnProperty.call(message, "destinationInstanceName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationInstanceName); if (message.binLogCoordinates != null && Object.hasOwnProperty.call(message, "binLogCoordinates")) - $root.google.cloud.sql.v1.BinLogCoordinates.encode(message.binLogCoordinates, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.BinLogCoordinates.encode(message.binLogCoordinates, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.allocatedIpRange); if (message.databaseNames != null && message.databaseNames.length) @@ -47350,7 +48758,7 @@ if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.preferredSecondaryZone); if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) - $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.destinationProject != null && Object.hasOwnProperty.call(message, "destinationProject")) writer.uint32(/* id 13, wireType 2 =*/106).string(message.destinationProject); if (message.destinationNetwork != null && Object.hasOwnProperty.call(message, "destinationNetwork")) @@ -47368,7 +48776,7 @@ * @returns {$protobuf.Writer} Writer */ CloneContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -47485,46 +48893,46 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.pitrTimestampMs != null && message.hasOwnProperty("pitrTimestampMs")) + if (message.pitrTimestampMs != null && Object.hasOwnProperty.call(message, "pitrTimestampMs")) if (!$util.isInteger(message.pitrTimestampMs) && !(message.pitrTimestampMs && $util.isInteger(message.pitrTimestampMs.low) && $util.isInteger(message.pitrTimestampMs.high))) return "pitrTimestampMs: integer|Long expected"; - if (message.destinationInstanceName != null && message.hasOwnProperty("destinationInstanceName")) + if (message.destinationInstanceName != null && Object.hasOwnProperty.call(message, "destinationInstanceName")) if (!$util.isString(message.destinationInstanceName)) return "destinationInstanceName: string expected"; - if (message.binLogCoordinates != null && message.hasOwnProperty("binLogCoordinates")) { + if (message.binLogCoordinates != null && Object.hasOwnProperty.call(message, "binLogCoordinates")) { var error = $root.google.cloud.sql.v1.BinLogCoordinates.verify(message.binLogCoordinates, long + 1); if (error) return "binLogCoordinates." + error; } - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) { var error = $root.google.protobuf.Timestamp.verify(message.pointInTime, long + 1); if (error) return "pointInTime." + error; } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) if (!$util.isString(message.allocatedIpRange)) return "allocatedIpRange: string expected"; - if (message.databaseNames != null && message.hasOwnProperty("databaseNames")) { + if (message.databaseNames != null && Object.hasOwnProperty.call(message, "databaseNames")) { if (!Array.isArray(message.databaseNames)) return "databaseNames: array expected"; for (var i = 0; i < message.databaseNames.length; ++i) if (!$util.isString(message.databaseNames[i])) return "databaseNames: string[] expected"; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { properties._preferredZone = 1; if (!$util.isString(message.preferredZone)) return "preferredZone: string expected"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { properties._preferredSecondaryZone = 1; if (!$util.isString(message.preferredSecondaryZone)) return "preferredSecondaryZone: string expected"; } - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { properties._sourceInstanceDeletionTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.sourceInstanceDeletionTime, long + 1); @@ -47532,12 +48940,12 @@ return "sourceInstanceDeletionTime." + error; } } - if (message.destinationProject != null && message.hasOwnProperty("destinationProject")) { + if (message.destinationProject != null && Object.hasOwnProperty.call(message, "destinationProject")) { properties._destinationProject = 1; if (!$util.isString(message.destinationProject)) return "destinationProject: string expected"; } - if (message.destinationNetwork != null && message.hasOwnProperty("destinationNetwork")) { + if (message.destinationNetwork != null && Object.hasOwnProperty.call(message, "destinationNetwork")) { properties._destinationNetwork = 1; if (!$util.isString(message.destinationNetwork)) return "destinationNetwork: string expected"; @@ -47556,6 +48964,8 @@ CloneContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.CloneContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.CloneContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -47565,7 +48975,7 @@ message.kind = String(object.kind); if (object.pitrTimestampMs != null) if ($util.Long) - (message.pitrTimestampMs = $util.Long.fromValue(object.pitrTimestampMs)).unsigned = false; + message.pitrTimestampMs = $util.Long.fromValue(object.pitrTimestampMs, false); else if (typeof object.pitrTimestampMs === "string") message.pitrTimestampMs = parseInt(object.pitrTimestampMs, 10); else if (typeof object.pitrTimestampMs === "number") @@ -47575,12 +48985,12 @@ if (object.destinationInstanceName != null) message.destinationInstanceName = String(object.destinationInstanceName); if (object.binLogCoordinates != null) { - if (typeof object.binLogCoordinates !== "object") + if (!$util.isObject(object.binLogCoordinates)) throw TypeError(".google.cloud.sql.v1.CloneContext.binLogCoordinates: object expected"); message.binLogCoordinates = $root.google.cloud.sql.v1.BinLogCoordinates.fromObject(object.binLogCoordinates, long + 1); } if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") + if (!$util.isObject(object.pointInTime)) throw TypeError(".google.cloud.sql.v1.CloneContext.pointInTime: object expected"); message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime, long + 1); } @@ -47598,7 +49008,7 @@ if (object.preferredSecondaryZone != null) message.preferredSecondaryZone = String(object.preferredSecondaryZone); if (object.sourceInstanceDeletionTime != null) { - if (typeof object.sourceInstanceDeletionTime !== "object") + if (!$util.isObject(object.sourceInstanceDeletionTime)) throw TypeError(".google.cloud.sql.v1.CloneContext.sourceInstanceDeletionTime: object expected"); message.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.fromObject(object.sourceInstanceDeletionTime, long + 1); } @@ -47618,9 +49028,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloneContext.toObject = function toObject(message, options) { + CloneContext.toObject = function toObject(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.databaseNames = []; @@ -47628,55 +49042,57 @@ object.kind = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.pitrTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.pitrTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.pitrTimestampMs = options.longs === String ? "0" : 0; + object.pitrTimestampMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.destinationInstanceName = ""; object.binLogCoordinates = null; object.pointInTime = null; object.allocatedIpRange = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.pitrTimestampMs != null && message.hasOwnProperty("pitrTimestampMs")) - if (typeof message.pitrTimestampMs === "number") + if (message.pitrTimestampMs != null && Object.hasOwnProperty.call(message, "pitrTimestampMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.pitrTimestampMs = typeof message.pitrTimestampMs === "number" ? BigInt(message.pitrTimestampMs) : $util.Long.fromBits(message.pitrTimestampMs.low >>> 0, message.pitrTimestampMs.high >>> 0, false).toBigInt(); + else if (typeof message.pitrTimestampMs === "number") object.pitrTimestampMs = options.longs === String ? String(message.pitrTimestampMs) : message.pitrTimestampMs; else object.pitrTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.pitrTimestampMs) : options.longs === Number ? new $util.LongBits(message.pitrTimestampMs.low >>> 0, message.pitrTimestampMs.high >>> 0).toNumber() : message.pitrTimestampMs; - if (message.destinationInstanceName != null && message.hasOwnProperty("destinationInstanceName")) + if (message.destinationInstanceName != null && Object.hasOwnProperty.call(message, "destinationInstanceName")) object.destinationInstanceName = message.destinationInstanceName; - if (message.binLogCoordinates != null && message.hasOwnProperty("binLogCoordinates")) - object.binLogCoordinates = $root.google.cloud.sql.v1.BinLogCoordinates.toObject(message.binLogCoordinates, options); - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.binLogCoordinates != null && Object.hasOwnProperty.call(message, "binLogCoordinates")) + object.binLogCoordinates = $root.google.cloud.sql.v1.BinLogCoordinates.toObject(message.binLogCoordinates, options, q + 1); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options, q + 1); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) object.allocatedIpRange = message.allocatedIpRange; if (message.databaseNames && message.databaseNames.length) { object.databaseNames = []; for (var j = 0; j < message.databaseNames.length; ++j) object.databaseNames[j] = message.databaseNames[j]; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { object.preferredZone = message.preferredZone; if (options.oneofs) object._preferredZone = "preferredZone"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { object.preferredSecondaryZone = message.preferredSecondaryZone; if (options.oneofs) object._preferredSecondaryZone = "preferredSecondaryZone"; } - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { - object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options); + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { + object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options, q + 1); if (options.oneofs) object._sourceInstanceDeletionTime = "sourceInstanceDeletionTime"; } - if (message.destinationProject != null && message.hasOwnProperty("destinationProject")) { + if (message.destinationProject != null && Object.hasOwnProperty.call(message, "destinationProject")) { object.destinationProject = message.destinationProject; if (options.oneofs) object._destinationProject = "destinationProject"; } - if (message.destinationNetwork != null && message.hasOwnProperty("destinationNetwork")) { + if (message.destinationNetwork != null && Object.hasOwnProperty.call(message, "destinationNetwork")) { object.destinationNetwork = message.destinationNetwork; if (options.oneofs) object._destinationNetwork = "destinationNetwork"; @@ -47893,13 +49309,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PointInTimeRestoreContext.encode = function encode(message, writer) { + PointInTimeRestoreContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.datasource != null && Object.hasOwnProperty.call(message, "datasource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasource); if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetInstance); if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) @@ -47911,7 +49331,7 @@ if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.preferredSecondaryZone); if (message.targetInstanceSettings != null && Object.hasOwnProperty.call(message, "targetInstanceSettings")) - $root.google.cloud.sql.v1.DatabaseInstance.encode(message.targetInstanceSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.encode(message.targetInstanceSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.targetInstanceClearSettingsFieldNames != null && message.targetInstanceClearSettingsFieldNames.length) for (var i = 0; i < message.targetInstanceClearSettingsFieldNames.length; ++i) writer.uint32(/* id 12, wireType 2 =*/98).string(message.targetInstanceClearSettingsFieldNames[i]); @@ -47930,7 +49350,7 @@ * @returns {$protobuf.Writer} Writer */ PointInTimeRestoreContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -48039,54 +49459,54 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.datasource != null && message.hasOwnProperty("datasource")) { + if (message.datasource != null && Object.hasOwnProperty.call(message, "datasource")) { properties._datasource = 1; if (!$util.isString(message.datasource)) return "datasource: string expected"; } - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) { var error = $root.google.protobuf.Timestamp.verify(message.pointInTime, long + 1); if (error) return "pointInTime." + error; } - if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) { + if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) { properties._targetInstance = 1; if (!$util.isString(message.targetInstance)) return "targetInstance: string expected"; } - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) { + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) { properties._privateNetwork = 1; if (!$util.isString(message.privateNetwork)) return "privateNetwork: string expected"; } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) { + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) { properties._allocatedIpRange = 1; if (!$util.isString(message.allocatedIpRange)) return "allocatedIpRange: string expected"; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { properties._preferredZone = 1; if (!$util.isString(message.preferredZone)) return "preferredZone: string expected"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { properties._preferredSecondaryZone = 1; if (!$util.isString(message.preferredSecondaryZone)) return "preferredSecondaryZone: string expected"; } - if (message.targetInstanceSettings != null && message.hasOwnProperty("targetInstanceSettings")) { + if (message.targetInstanceSettings != null && Object.hasOwnProperty.call(message, "targetInstanceSettings")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.verify(message.targetInstanceSettings, long + 1); if (error) return "targetInstanceSettings." + error; } - if (message.targetInstanceClearSettingsFieldNames != null && message.hasOwnProperty("targetInstanceClearSettingsFieldNames")) { + if (message.targetInstanceClearSettingsFieldNames != null && Object.hasOwnProperty.call(message, "targetInstanceClearSettingsFieldNames")) { if (!Array.isArray(message.targetInstanceClearSettingsFieldNames)) return "targetInstanceClearSettingsFieldNames: array expected"; for (var i = 0; i < message.targetInstanceClearSettingsFieldNames.length; ++i) if (!$util.isString(message.targetInstanceClearSettingsFieldNames[i])) return "targetInstanceClearSettingsFieldNames: string[] expected"; } - if (message.region != null && message.hasOwnProperty("region")) { + if (message.region != null && Object.hasOwnProperty.call(message, "region")) { properties._region = 1; if (!$util.isString(message.region)) return "region: string expected"; @@ -48105,6 +49525,8 @@ PointInTimeRestoreContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PointInTimeRestoreContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PointInTimeRestoreContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -48113,7 +49535,7 @@ if (object.datasource != null) message.datasource = String(object.datasource); if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") + if (!$util.isObject(object.pointInTime)) throw TypeError(".google.cloud.sql.v1.PointInTimeRestoreContext.pointInTime: object expected"); message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime, long + 1); } @@ -48128,7 +49550,7 @@ if (object.preferredSecondaryZone != null) message.preferredSecondaryZone = String(object.preferredSecondaryZone); if (object.targetInstanceSettings != null) { - if (typeof object.targetInstanceSettings !== "object") + if (!$util.isObject(object.targetInstanceSettings)) throw TypeError(".google.cloud.sql.v1.PointInTimeRestoreContext.targetInstanceSettings: object expected"); message.targetInstanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.fromObject(object.targetInstanceSettings, long + 1); } @@ -48153,9 +49575,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PointInTimeRestoreContext.toObject = function toObject(message, options) { + PointInTimeRestoreContext.toObject = function toObject(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.targetInstanceClearSettingsFieldNames = []; @@ -48163,46 +49589,46 @@ object.pointInTime = null; object.targetInstanceSettings = null; } - if (message.datasource != null && message.hasOwnProperty("datasource")) { + if (message.datasource != null && Object.hasOwnProperty.call(message, "datasource")) { object.datasource = message.datasource; if (options.oneofs) object._datasource = "datasource"; } - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); - if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) { + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options, q + 1); + if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) { object.targetInstance = message.targetInstance; if (options.oneofs) object._targetInstance = "targetInstance"; } - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) { + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) { object.privateNetwork = message.privateNetwork; if (options.oneofs) object._privateNetwork = "privateNetwork"; } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) { + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) { object.allocatedIpRange = message.allocatedIpRange; if (options.oneofs) object._allocatedIpRange = "allocatedIpRange"; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { object.preferredZone = message.preferredZone; if (options.oneofs) object._preferredZone = "preferredZone"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { object.preferredSecondaryZone = message.preferredSecondaryZone; if (options.oneofs) object._preferredSecondaryZone = "preferredSecondaryZone"; } - if (message.targetInstanceSettings != null && message.hasOwnProperty("targetInstanceSettings")) - object.targetInstanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.targetInstanceSettings, options); + if (message.targetInstanceSettings != null && Object.hasOwnProperty.call(message, "targetInstanceSettings")) + object.targetInstanceSettings = $root.google.cloud.sql.v1.DatabaseInstance.toObject(message.targetInstanceSettings, options, q + 1); if (message.targetInstanceClearSettingsFieldNames && message.targetInstanceClearSettingsFieldNames.length) { object.targetInstanceClearSettingsFieldNames = []; for (var j = 0; j < message.targetInstanceClearSettingsFieldNames.length; ++j) object.targetInstanceClearSettingsFieldNames[j] = message.targetInstanceClearSettingsFieldNames[j]; } - if (message.region != null && message.hasOwnProperty("region")) { + if (message.region != null && Object.hasOwnProperty.call(message, "region")) { object.region = message.region; if (options.oneofs) object._region = "region"; @@ -48310,9 +49736,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BinLogCoordinates.encode = function encode(message, writer) { + BinLogCoordinates.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.binLogFileName != null && Object.hasOwnProperty.call(message, "binLogFileName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.binLogFileName); if (message.binLogPosition != null && Object.hasOwnProperty.call(message, "binLogPosition")) @@ -48332,7 +49762,7 @@ * @returns {$protobuf.Writer} Writer */ BinLogCoordinates.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -48410,13 +49840,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.binLogFileName != null && message.hasOwnProperty("binLogFileName")) + if (message.binLogFileName != null && Object.hasOwnProperty.call(message, "binLogFileName")) if (!$util.isString(message.binLogFileName)) return "binLogFileName: string expected"; - if (message.binLogPosition != null && message.hasOwnProperty("binLogPosition")) + if (message.binLogPosition != null && Object.hasOwnProperty.call(message, "binLogPosition")) if (!$util.isInteger(message.binLogPosition) && !(message.binLogPosition && $util.isInteger(message.binLogPosition.low) && $util.isInteger(message.binLogPosition.high))) return "binLogPosition: integer|Long expected"; - 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"; return null; @@ -48433,6 +49863,8 @@ BinLogCoordinates.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.BinLogCoordinates) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.BinLogCoordinates: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -48442,7 +49874,7 @@ message.binLogFileName = String(object.binLogFileName); if (object.binLogPosition != null) if ($util.Long) - (message.binLogPosition = $util.Long.fromValue(object.binLogPosition)).unsigned = false; + message.binLogPosition = $util.Long.fromValue(object.binLogPosition, false); else if (typeof object.binLogPosition === "string") message.binLogPosition = parseInt(object.binLogPosition, 10); else if (typeof object.binLogPosition === "number") @@ -48463,27 +49895,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BinLogCoordinates.toObject = function toObject(message, options) { + BinLogCoordinates.toObject = function toObject(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.binLogFileName = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.binLogPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.binLogPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.binLogPosition = options.longs === String ? "0" : 0; + object.binLogPosition = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; } - if (message.binLogFileName != null && message.hasOwnProperty("binLogFileName")) + if (message.binLogFileName != null && Object.hasOwnProperty.call(message, "binLogFileName")) object.binLogFileName = message.binLogFileName; - if (message.binLogPosition != null && message.hasOwnProperty("binLogPosition")) - if (typeof message.binLogPosition === "number") + if (message.binLogPosition != null && Object.hasOwnProperty.call(message, "binLogPosition")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.binLogPosition = typeof message.binLogPosition === "number" ? BigInt(message.binLogPosition) : $util.Long.fromBits(message.binLogPosition.low >>> 0, message.binLogPosition.high >>> 0, false).toBigInt(); + else if (typeof message.binLogPosition === "number") object.binLogPosition = options.longs === String ? String(message.binLogPosition) : message.binLogPosition; else object.binLogPosition = options.longs === String ? $util.Long.prototype.toString.call(message.binLogPosition) : options.longs === Number ? new $util.LongBits(message.binLogPosition.low >>> 0, message.binLogPosition.high >>> 0).toNumber() : message.binLogPosition; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -49091,9 +50529,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseInstance.encode = function encode(message, writer) { + DatabaseInstance.encode = function encode(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.state != null && Object.hasOwnProperty.call(message, "state")) @@ -49101,25 +50543,25 @@ if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.databaseVersion); if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) - $root.google.cloud.sql.v1.Settings.encode(message.settings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.Settings.encode(message.settings, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); if (message.failoverReplica != null && Object.hasOwnProperty.call(message, "failoverReplica")) - $root.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.encode(message.failoverReplica, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.encode(message.failoverReplica, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.masterInstanceName); if (message.replicaNames != null && message.replicaNames.length) for (var i = 0; i < message.replicaNames.length; ++i) writer.uint32(/* id 8, wireType 2 =*/66).string(message.replicaNames[i]); if (message.maxDiskSize != null && Object.hasOwnProperty.call(message, "maxDiskSize")) - $root.google.protobuf.Int64Value.encode(message.maxDiskSize, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.maxDiskSize, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.currentDiskSize != null && Object.hasOwnProperty.call(message, "currentDiskSize")) - $root.google.protobuf.Int64Value.encode(message.currentDiskSize, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.currentDiskSize, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) - $root.google.cloud.sql.v1.SslCert.encode(message.serverCaCert, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.serverCaCert, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.instanceType); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -49129,9 +50571,9 @@ if (message.serviceAccountEmailAddress != null && Object.hasOwnProperty.call(message, "serviceAccountEmailAddress")) writer.uint32(/* id 16, wireType 2 =*/130).string(message.serviceAccountEmailAddress); if (message.onPremisesConfiguration != null && Object.hasOwnProperty.call(message, "onPremisesConfiguration")) - $root.google.cloud.sql.v1.OnPremisesConfiguration.encode(message.onPremisesConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1.OnPremisesConfiguration.encode(message.onPremisesConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) - $root.google.cloud.sql.v1.ReplicaConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.cloud.sql.v1.ReplicaConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) writer.uint32(/* id 19, wireType 0 =*/152).int32(message.backendType); if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) @@ -49151,21 +50593,21 @@ if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) writer.uint32(/* id 25, wireType 2 =*/202).string(message.gceZone); if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) - $root.google.cloud.sql.v1.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + $root.google.cloud.sql.v1.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) - $root.google.cloud.sql.v1.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.cloud.sql.v1.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) writer.uint32(/* id 29, wireType 2 =*/234).string(message.rootPassword); if (message.scheduledMaintenance != null && Object.hasOwnProperty.call(message, "scheduledMaintenance")) - $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.encode(message.scheduledMaintenance, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.encode(message.scheduledMaintenance, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) writer.uint32(/* id 34, wireType 2 =*/274).string(message.secondaryGceZone); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); if (message.outOfDiskReport != null && Object.hasOwnProperty.call(message, "outOfDiskReport")) - $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.encode(message.outOfDiskReport, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.encode(message.outOfDiskReport, writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 39, wireType 2 =*/314).fork(), q + 1).ldelim(); if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.databaseInstalledVersion); if (message.availableMaintenanceVersions != null && message.availableMaintenanceVersions.length) @@ -49175,7 +50617,7 @@ writer.uint32(/* id 42, wireType 2 =*/338).string(message.maintenanceVersion); if (message.upgradableDatabaseVersions != null && message.upgradableDatabaseVersions.length) for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) - $root.google.cloud.sql.v1.AvailableDatabaseVersion.encode(message.upgradableDatabaseVersions[i], writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + $root.google.cloud.sql.v1.AvailableDatabaseVersion.encode(message.upgradableDatabaseVersions[i], writer.uint32(/* id 45, wireType 2 =*/362).fork(), q + 1).ldelim(); if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) writer.uint32(/* id 47, wireType 0 =*/376).int32(message.sqlNetworkArchitecture); if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) @@ -49187,15 +50629,15 @@ if (message.writeEndpoint != null && Object.hasOwnProperty.call(message, "writeEndpoint")) writer.uint32(/* id 52, wireType 2 =*/418).string(message.writeEndpoint); if (message.replicationCluster != null && Object.hasOwnProperty.call(message, "replicationCluster")) - $root.google.cloud.sql.v1.ReplicationCluster.encode(message.replicationCluster, writer.uint32(/* id 54, wireType 2 =*/434).fork()).ldelim(); + $root.google.cloud.sql.v1.ReplicationCluster.encode(message.replicationCluster, writer.uint32(/* id 54, wireType 2 =*/434).fork(), q + 1).ldelim(); if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) - $root.google.cloud.sql.v1.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); + $root.google.cloud.sql.v1.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 55, wireType 2 =*/442).fork(), q + 1).ldelim(); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 56, wireType 2 =*/450).fork(), q + 1).ldelim(); if (message.switchTransactionLogsToCloudStorageEnabled != null && Object.hasOwnProperty.call(message, "switchTransactionLogsToCloudStorageEnabled")) - $root.google.protobuf.BoolValue.encode(message.switchTransactionLogsToCloudStorageEnabled, writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.switchTransactionLogsToCloudStorageEnabled, writer.uint32(/* id 57, wireType 2 =*/458).fork(), q + 1).ldelim(); if (message.includeReplicasForMajorVersionUpgrade != null && Object.hasOwnProperty.call(message, "includeReplicasForMajorVersionUpgrade")) - $root.google.protobuf.BoolValue.encode(message.includeReplicasForMajorVersionUpgrade, writer.uint32(/* id 59, wireType 2 =*/474).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.includeReplicasForMajorVersionUpgrade, writer.uint32(/* id 59, wireType 2 =*/474).fork(), q + 1).ldelim(); if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) writer.uint32(/* id 60, wireType 2 =*/482).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); @@ -49203,10 +50645,10 @@ writer.uint32(/* id 63, wireType 0 =*/504).int32(message.nodeCount); if (message.nodes != null && message.nodes.length) for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + $root.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork(), q + 1).ldelim(); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 67, wireType 2 =*/538).fork()).ldelim(); + $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 67, wireType 2 =*/538).fork(), q + 1).ldelim(); return writer; }; @@ -49220,7 +50662,7 @@ * @returns {$protobuf.Writer} Writer */ DatabaseInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -49531,10 +50973,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) switch (message.state) { default: return "state: enum value expected"; @@ -49549,7 +50991,7 @@ case 8: break; } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -49610,40 +51052,40 @@ case 551: break; } - if (message.settings != null && message.hasOwnProperty("settings")) { + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) { var error = $root.google.cloud.sql.v1.Settings.verify(message.settings, long + 1); if (error) return "settings." + error; } - 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.failoverReplica != null && message.hasOwnProperty("failoverReplica")) { + if (message.failoverReplica != null && Object.hasOwnProperty.call(message, "failoverReplica")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.verify(message.failoverReplica, long + 1); if (error) return "failoverReplica." + error; } - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) if (!$util.isString(message.masterInstanceName)) return "masterInstanceName: string expected"; - if (message.replicaNames != null && message.hasOwnProperty("replicaNames")) { + if (message.replicaNames != null && Object.hasOwnProperty.call(message, "replicaNames")) { if (!Array.isArray(message.replicaNames)) return "replicaNames: array expected"; for (var i = 0; i < message.replicaNames.length; ++i) if (!$util.isString(message.replicaNames[i])) return "replicaNames: string[] expected"; } - if (message.maxDiskSize != null && message.hasOwnProperty("maxDiskSize")) { + if (message.maxDiskSize != null && Object.hasOwnProperty.call(message, "maxDiskSize")) { var error = $root.google.protobuf.Int64Value.verify(message.maxDiskSize, long + 1); if (error) return "maxDiskSize." + error; } - if (message.currentDiskSize != null && message.hasOwnProperty("currentDiskSize")) { + if (message.currentDiskSize != null && Object.hasOwnProperty.call(message, "currentDiskSize")) { var error = $root.google.protobuf.Int64Value.verify(message.currentDiskSize, long + 1); if (error) return "currentDiskSize." + error; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -49652,12 +51094,12 @@ return "ipAddresses." + error; } } - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) { + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) { var error = $root.google.cloud.sql.v1.SslCert.verify(message.serverCaCert, long + 1); if (error) return "serverCaCert." + error; } - 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"; @@ -49668,26 +51110,26 @@ case 5: break; } - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) if (!$util.isString(message.ipv6Address)) return "ipv6Address: string expected"; - if (message.serviceAccountEmailAddress != null && message.hasOwnProperty("serviceAccountEmailAddress")) + if (message.serviceAccountEmailAddress != null && Object.hasOwnProperty.call(message, "serviceAccountEmailAddress")) if (!$util.isString(message.serviceAccountEmailAddress)) return "serviceAccountEmailAddress: string expected"; - if (message.onPremisesConfiguration != null && message.hasOwnProperty("onPremisesConfiguration")) { + if (message.onPremisesConfiguration != null && Object.hasOwnProperty.call(message, "onPremisesConfiguration")) { var error = $root.google.cloud.sql.v1.OnPremisesConfiguration.verify(message.onPremisesConfiguration, long + 1); if (error) return "onPremisesConfiguration." + error; } - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) { + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) { var error = $root.google.cloud.sql.v1.ReplicaConfiguration.verify(message.replicaConfiguration, long + 1); if (error) return "replicaConfiguration." + error; } - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) switch (message.backendType) { default: return "backendType: enum value expected"; @@ -49697,10 +51139,10 @@ case 3: break; } - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; - if (message.suspensionReason != null && message.hasOwnProperty("suspensionReason")) { + if (message.suspensionReason != null && Object.hasOwnProperty.call(message, "suspensionReason")) { if (!Array.isArray(message.suspensionReason)) return "suspensionReason: array expected"; for (var i = 0; i < message.suspensionReason.length; ++i) @@ -49716,48 +51158,48 @@ break; } } - if (message.connectionName != null && message.hasOwnProperty("connectionName")) + if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName")) if (!$util.isString(message.connectionName)) return "connectionName: string expected"; - 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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) if (!$util.isString(message.gceZone)) return "gceZone: string expected"; - if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) if (!$util.isString(message.secondaryGceZone)) return "secondaryGceZone: string expected"; - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) { + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) { var error = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.verify(message.diskEncryptionConfiguration, long + 1); if (error) return "diskEncryptionConfiguration." + error; } - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) { + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) { var error = $root.google.cloud.sql.v1.DiskEncryptionStatus.verify(message.diskEncryptionStatus, long + 1); if (error) return "diskEncryptionStatus." + error; } - if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) if (!$util.isString(message.rootPassword)) return "rootPassword: string expected"; - if (message.scheduledMaintenance != null && message.hasOwnProperty("scheduledMaintenance")) { + if (message.scheduledMaintenance != null && Object.hasOwnProperty.call(message, "scheduledMaintenance")) { var error = $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.verify(message.scheduledMaintenance, long + 1); if (error) return "scheduledMaintenance." + error; } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs, long + 1); if (error) return "satisfiesPzs." + error; } - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) if (!$util.isString(message.databaseInstalledVersion)) return "databaseInstalledVersion: string expected"; - if (message.outOfDiskReport != null && message.hasOwnProperty("outOfDiskReport")) { + if (message.outOfDiskReport != null && Object.hasOwnProperty.call(message, "outOfDiskReport")) { properties._outOfDiskReport = 1; { var error = $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.verify(message.outOfDiskReport, long + 1); @@ -49765,22 +51207,22 @@ return "outOfDiskReport." + 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.availableMaintenanceVersions != null && message.hasOwnProperty("availableMaintenanceVersions")) { + if (message.availableMaintenanceVersions != null && Object.hasOwnProperty.call(message, "availableMaintenanceVersions")) { if (!Array.isArray(message.availableMaintenanceVersions)) return "availableMaintenanceVersions: array expected"; for (var i = 0; i < message.availableMaintenanceVersions.length; ++i) if (!$util.isString(message.availableMaintenanceVersions[i])) return "availableMaintenanceVersions: string[] expected"; } - if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) + if (message.maintenanceVersion != null && Object.hasOwnProperty.call(message, "maintenanceVersion")) if (!$util.isString(message.maintenanceVersion)) return "maintenanceVersion: string expected"; - if (message.upgradableDatabaseVersions != null && message.hasOwnProperty("upgradableDatabaseVersions")) { + if (message.upgradableDatabaseVersions != null && Object.hasOwnProperty.call(message, "upgradableDatabaseVersions")) { if (!Array.isArray(message.upgradableDatabaseVersions)) return "upgradableDatabaseVersions: array expected"; for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) { @@ -49789,7 +51231,7 @@ return "upgradableDatabaseVersions." + error; } } - if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { + if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) { properties._sqlNetworkArchitecture = 1; switch (message.sqlNetworkArchitecture) { default: @@ -49800,32 +51242,32 @@ break; } } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { properties._pscServiceAttachmentLink = 1; if (!$util.isString(message.pscServiceAttachmentLink)) return "pscServiceAttachmentLink: string expected"; } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { properties._dnsName = 1; if (!$util.isString(message.dnsName)) return "dnsName: string expected"; } - if (message.primaryDnsName != null && message.hasOwnProperty("primaryDnsName")) { + if (message.primaryDnsName != null && Object.hasOwnProperty.call(message, "primaryDnsName")) { properties._primaryDnsName = 1; if (!$util.isString(message.primaryDnsName)) return "primaryDnsName: string expected"; } - if (message.writeEndpoint != null && message.hasOwnProperty("writeEndpoint")) { + if (message.writeEndpoint != null && Object.hasOwnProperty.call(message, "writeEndpoint")) { properties._writeEndpoint = 1; if (!$util.isString(message.writeEndpoint)) return "writeEndpoint: string expected"; } - if (message.replicationCluster != null && message.hasOwnProperty("replicationCluster")) { + if (message.replicationCluster != null && Object.hasOwnProperty.call(message, "replicationCluster")) { var error = $root.google.cloud.sql.v1.ReplicationCluster.verify(message.replicationCluster, long + 1); if (error) return "replicationCluster." + error; } - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) { properties._geminiConfig = 1; { var error = $root.google.cloud.sql.v1.GeminiInstanceConfig.verify(message.geminiConfig, long + 1); @@ -49833,12 +51275,12 @@ return "geminiConfig." + error; } } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzi, long + 1); if (error) return "satisfiesPzi." + error; } - if (message.switchTransactionLogsToCloudStorageEnabled != null && message.hasOwnProperty("switchTransactionLogsToCloudStorageEnabled")) { + if (message.switchTransactionLogsToCloudStorageEnabled != null && Object.hasOwnProperty.call(message, "switchTransactionLogsToCloudStorageEnabled")) { properties._switchTransactionLogsToCloudStorageEnabled = 1; { var error = $root.google.protobuf.BoolValue.verify(message.switchTransactionLogsToCloudStorageEnabled, long + 1); @@ -49846,7 +51288,7 @@ return "switchTransactionLogsToCloudStorageEnabled." + error; } } - if (message.includeReplicasForMajorVersionUpgrade != null && message.hasOwnProperty("includeReplicasForMajorVersionUpgrade")) { + if (message.includeReplicasForMajorVersionUpgrade != null && Object.hasOwnProperty.call(message, "includeReplicasForMajorVersionUpgrade")) { properties._includeReplicasForMajorVersionUpgrade = 1; { var error = $root.google.protobuf.BoolValue.verify(message.includeReplicasForMajorVersionUpgrade, long + 1); @@ -49854,7 +51296,7 @@ return "includeReplicasForMajorVersionUpgrade." + error; } } - if (message.tags != null && message.hasOwnProperty("tags")) { + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) { if (!$util.isObject(message.tags)) return "tags: object expected"; var key = Object.keys(message.tags); @@ -49862,12 +51304,12 @@ if (!$util.isString(message.tags[key[i]])) return "tags: string{k: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.nodes != null && message.hasOwnProperty("nodes")) { + if (message.nodes != null && Object.hasOwnProperty.call(message, "nodes")) { if (!Array.isArray(message.nodes)) return "nodes: array expected"; for (var i = 0; i < message.nodes.length; ++i) { @@ -49876,7 +51318,7 @@ return "nodes." + error; } } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -49899,6 +51341,8 @@ DatabaseInstance.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DatabaseInstance) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DatabaseInstance: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -50179,14 +51623,14 @@ break; } if (object.settings != null) { - if (typeof object.settings !== "object") + if (!$util.isObject(object.settings)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.settings: object expected"); message.settings = $root.google.cloud.sql.v1.Settings.fromObject(object.settings, long + 1); } if (object.etag != null) message.etag = String(object.etag); if (object.failoverReplica != null) { - if (typeof object.failoverReplica !== "object") + if (!$util.isObject(object.failoverReplica)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.failoverReplica: object expected"); message.failoverReplica = $root.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.fromObject(object.failoverReplica, long + 1); } @@ -50200,12 +51644,12 @@ message.replicaNames[i] = String(object.replicaNames[i]); } if (object.maxDiskSize != null) { - if (typeof object.maxDiskSize !== "object") + if (!$util.isObject(object.maxDiskSize)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.maxDiskSize: object expected"); message.maxDiskSize = $root.google.protobuf.Int64Value.fromObject(object.maxDiskSize, long + 1); } if (object.currentDiskSize != null) { - if (typeof object.currentDiskSize !== "object") + if (!$util.isObject(object.currentDiskSize)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.currentDiskSize: object expected"); message.currentDiskSize = $root.google.protobuf.Int64Value.fromObject(object.currentDiskSize, long + 1); } @@ -50214,13 +51658,13 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1.IpMapping.fromObject(object.ipAddresses[i], long + 1); } } if (object.serverCaCert != null) { - if (typeof object.serverCaCert !== "object") + if (!$util.isObject(object.serverCaCert)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.serverCaCert: object expected"); message.serverCaCert = $root.google.cloud.sql.v1.SslCert.fromObject(object.serverCaCert, long + 1); } @@ -50259,12 +51703,12 @@ if (object.serviceAccountEmailAddress != null) message.serviceAccountEmailAddress = String(object.serviceAccountEmailAddress); if (object.onPremisesConfiguration != null) { - if (typeof object.onPremisesConfiguration !== "object") + if (!$util.isObject(object.onPremisesConfiguration)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.onPremisesConfiguration: object expected"); message.onPremisesConfiguration = $root.google.cloud.sql.v1.OnPremisesConfiguration.fromObject(object.onPremisesConfiguration, long + 1); } if (object.replicaConfiguration != null) { - if (typeof object.replicaConfiguration !== "object") + if (!$util.isObject(object.replicaConfiguration)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.replicaConfiguration: object expected"); message.replicaConfiguration = $root.google.cloud.sql.v1.ReplicaConfiguration.fromObject(object.replicaConfiguration, long + 1); } @@ -50342,36 +51786,36 @@ if (object.secondaryGceZone != null) message.secondaryGceZone = String(object.secondaryGceZone); if (object.diskEncryptionConfiguration != null) { - if (typeof object.diskEncryptionConfiguration !== "object") + if (!$util.isObject(object.diskEncryptionConfiguration)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.diskEncryptionConfiguration: object expected"); message.diskEncryptionConfiguration = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.fromObject(object.diskEncryptionConfiguration, long + 1); } if (object.diskEncryptionStatus != null) { - if (typeof object.diskEncryptionStatus !== "object") + if (!$util.isObject(object.diskEncryptionStatus)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.diskEncryptionStatus: object expected"); message.diskEncryptionStatus = $root.google.cloud.sql.v1.DiskEncryptionStatus.fromObject(object.diskEncryptionStatus, long + 1); } if (object.rootPassword != null) message.rootPassword = String(object.rootPassword); if (object.scheduledMaintenance != null) { - if (typeof object.scheduledMaintenance !== "object") + if (!$util.isObject(object.scheduledMaintenance)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.scheduledMaintenance: object expected"); message.scheduledMaintenance = $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.fromObject(object.scheduledMaintenance, long + 1); } if (object.satisfiesPzs != null) { - if (typeof object.satisfiesPzs !== "object") + if (!$util.isObject(object.satisfiesPzs)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.satisfiesPzs: object expected"); message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs, long + 1); } if (object.databaseInstalledVersion != null) message.databaseInstalledVersion = String(object.databaseInstalledVersion); if (object.outOfDiskReport != null) { - if (typeof object.outOfDiskReport !== "object") + if (!$util.isObject(object.outOfDiskReport)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.outOfDiskReport: object expected"); message.outOfDiskReport = $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.fromObject(object.outOfDiskReport, long + 1); } if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } @@ -50389,7 +51833,7 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.upgradableDatabaseVersions: array expected"); message.upgradableDatabaseVersions = []; for (var i = 0; i < object.upgradableDatabaseVersions.length; ++i) { - if (typeof object.upgradableDatabaseVersions[i] !== "object") + if (!$util.isObject(object.upgradableDatabaseVersions[i])) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.upgradableDatabaseVersions: object expected"); message.upgradableDatabaseVersions[i] = $root.google.cloud.sql.v1.AvailableDatabaseVersion.fromObject(object.upgradableDatabaseVersions[i], long + 1); } @@ -50423,32 +51867,32 @@ if (object.writeEndpoint != null) message.writeEndpoint = String(object.writeEndpoint); if (object.replicationCluster != null) { - if (typeof object.replicationCluster !== "object") + if (!$util.isObject(object.replicationCluster)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.replicationCluster: object expected"); message.replicationCluster = $root.google.cloud.sql.v1.ReplicationCluster.fromObject(object.replicationCluster, long + 1); } if (object.geminiConfig != null) { - if (typeof object.geminiConfig !== "object") + if (!$util.isObject(object.geminiConfig)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.geminiConfig: object expected"); message.geminiConfig = $root.google.cloud.sql.v1.GeminiInstanceConfig.fromObject(object.geminiConfig, long + 1); } if (object.satisfiesPzi != null) { - if (typeof object.satisfiesPzi !== "object") + if (!$util.isObject(object.satisfiesPzi)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.satisfiesPzi: object expected"); message.satisfiesPzi = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzi, long + 1); } if (object.switchTransactionLogsToCloudStorageEnabled != null) { - if (typeof object.switchTransactionLogsToCloudStorageEnabled !== "object") + if (!$util.isObject(object.switchTransactionLogsToCloudStorageEnabled)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.switchTransactionLogsToCloudStorageEnabled: object expected"); message.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.fromObject(object.switchTransactionLogsToCloudStorageEnabled, long + 1); } if (object.includeReplicasForMajorVersionUpgrade != null) { - if (typeof object.includeReplicasForMajorVersionUpgrade !== "object") + if (!$util.isObject(object.includeReplicasForMajorVersionUpgrade)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.includeReplicasForMajorVersionUpgrade: object expected"); message.includeReplicasForMajorVersionUpgrade = $root.google.protobuf.BoolValue.fromObject(object.includeReplicasForMajorVersionUpgrade, long + 1); } if (object.tags) { - if (typeof object.tags !== "object") + if (!$util.isObject(object.tags)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.tags: object expected"); message.tags = {}; for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) { @@ -50464,7 +51908,7 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.nodes: array expected"); message.nodes = []; for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") + if (!$util.isObject(object.nodes[i])) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.nodes: object expected"); message.nodes[i] = $root.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.fromObject(object.nodes[i], long + 1); } @@ -50474,7 +51918,7 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -50491,9 +51935,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseInstance.toObject = function toObject(message, options) { + DatabaseInstance.toObject = function toObject(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.replicaNames = []; @@ -50541,139 +51989,139 @@ object.replicationCluster = null; object.satisfiesPzi = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState[message.state] === undefined ? message.state : $root.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.settings != null && message.hasOwnProperty("settings")) - object.settings = $root.google.cloud.sql.v1.Settings.toObject(message.settings, options); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + object.settings = $root.google.cloud.sql.v1.Settings.toObject(message.settings, options, q + 1); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.failoverReplica != null && message.hasOwnProperty("failoverReplica")) - object.failoverReplica = $root.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.toObject(message.failoverReplica, options); - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.failoverReplica != null && Object.hasOwnProperty.call(message, "failoverReplica")) + object.failoverReplica = $root.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.toObject(message.failoverReplica, options, q + 1); + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) object.masterInstanceName = message.masterInstanceName; if (message.replicaNames && message.replicaNames.length) { object.replicaNames = []; for (var j = 0; j < message.replicaNames.length; ++j) object.replicaNames[j] = message.replicaNames[j]; } - if (message.maxDiskSize != null && message.hasOwnProperty("maxDiskSize")) - object.maxDiskSize = $root.google.protobuf.Int64Value.toObject(message.maxDiskSize, options); - if (message.currentDiskSize != null && message.hasOwnProperty("currentDiskSize")) - object.currentDiskSize = $root.google.protobuf.Int64Value.toObject(message.currentDiskSize, options); + if (message.maxDiskSize != null && Object.hasOwnProperty.call(message, "maxDiskSize")) + object.maxDiskSize = $root.google.protobuf.Int64Value.toObject(message.maxDiskSize, options, q + 1); + if (message.currentDiskSize != null && Object.hasOwnProperty.call(message, "currentDiskSize")) + object.currentDiskSize = $root.google.protobuf.Int64Value.toObject(message.currentDiskSize, options, q + 1); if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) - object.serverCaCert = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCaCert, options); - if (message.instanceType != null && message.hasOwnProperty("instanceType")) + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) + object.serverCaCert = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCaCert, options, q + 1); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) object.instanceType = options.enums === String ? $root.google.cloud.sql.v1.SqlInstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.sql.v1.SqlInstanceType[message.instanceType] : message.instanceType; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) object.ipv6Address = message.ipv6Address; - if (message.serviceAccountEmailAddress != null && message.hasOwnProperty("serviceAccountEmailAddress")) + if (message.serviceAccountEmailAddress != null && Object.hasOwnProperty.call(message, "serviceAccountEmailAddress")) object.serviceAccountEmailAddress = message.serviceAccountEmailAddress; - if (message.onPremisesConfiguration != null && message.hasOwnProperty("onPremisesConfiguration")) - object.onPremisesConfiguration = $root.google.cloud.sql.v1.OnPremisesConfiguration.toObject(message.onPremisesConfiguration, options); - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) - object.replicaConfiguration = $root.google.cloud.sql.v1.ReplicaConfiguration.toObject(message.replicaConfiguration, options); - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.onPremisesConfiguration != null && Object.hasOwnProperty.call(message, "onPremisesConfiguration")) + object.onPremisesConfiguration = $root.google.cloud.sql.v1.OnPremisesConfiguration.toObject(message.onPremisesConfiguration, options, q + 1); + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) + object.replicaConfiguration = $root.google.cloud.sql.v1.ReplicaConfiguration.toObject(message.replicaConfiguration, options, q + 1); + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) object.backendType = options.enums === String ? $root.google.cloud.sql.v1.SqlBackendType[message.backendType] === undefined ? message.backendType : $root.google.cloud.sql.v1.SqlBackendType[message.backendType] : message.backendType; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; if (message.suspensionReason && message.suspensionReason.length) { object.suspensionReason = []; for (var j = 0; j < message.suspensionReason.length; ++j) object.suspensionReason[j] = options.enums === String ? $root.google.cloud.sql.v1.SqlSuspensionReason[message.suspensionReason[j]] === undefined ? message.suspensionReason[j] : $root.google.cloud.sql.v1.SqlSuspensionReason[message.suspensionReason[j]] : message.suspensionReason[j]; } - if (message.connectionName != null && message.hasOwnProperty("connectionName")) + if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName")) object.connectionName = message.connectionName; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) object.gceZone = message.gceZone; - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) - object.diskEncryptionConfiguration = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options); - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) - object.diskEncryptionStatus = $root.google.cloud.sql.v1.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options); - if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) + object.diskEncryptionConfiguration = $root.google.cloud.sql.v1.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options, q + 1); + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) + object.diskEncryptionStatus = $root.google.cloud.sql.v1.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options, q + 1); + if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) object.rootPassword = message.rootPassword; - if (message.scheduledMaintenance != null && message.hasOwnProperty("scheduledMaintenance")) - object.scheduledMaintenance = $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.toObject(message.scheduledMaintenance, options); - if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + if (message.scheduledMaintenance != null && Object.hasOwnProperty.call(message, "scheduledMaintenance")) + object.scheduledMaintenance = $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.toObject(message.scheduledMaintenance, options, q + 1); + if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) object.secondaryGceZone = message.secondaryGceZone; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); - if (message.outOfDiskReport != null && message.hasOwnProperty("outOfDiskReport")) { - object.outOfDiskReport = $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.toObject(message.outOfDiskReport, options); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options, q + 1); + if (message.outOfDiskReport != null && Object.hasOwnProperty.call(message, "outOfDiskReport")) { + object.outOfDiskReport = $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.toObject(message.outOfDiskReport, options, q + 1); if (options.oneofs) object._outOfDiskReport = "outOfDiskReport"; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) object.databaseInstalledVersion = message.databaseInstalledVersion; if (message.availableMaintenanceVersions && message.availableMaintenanceVersions.length) { object.availableMaintenanceVersions = []; for (var j = 0; j < message.availableMaintenanceVersions.length; ++j) object.availableMaintenanceVersions[j] = message.availableMaintenanceVersions[j]; } - if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) + if (message.maintenanceVersion != null && Object.hasOwnProperty.call(message, "maintenanceVersion")) object.maintenanceVersion = message.maintenanceVersion; if (message.upgradableDatabaseVersions && message.upgradableDatabaseVersions.length) { object.upgradableDatabaseVersions = []; for (var j = 0; j < message.upgradableDatabaseVersions.length; ++j) - object.upgradableDatabaseVersions[j] = $root.google.cloud.sql.v1.AvailableDatabaseVersion.toObject(message.upgradableDatabaseVersions[j], options); + object.upgradableDatabaseVersions[j] = $root.google.cloud.sql.v1.AvailableDatabaseVersion.toObject(message.upgradableDatabaseVersions[j], options, q + 1); } - if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { + if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) { object.sqlNetworkArchitecture = options.enums === String ? $root.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] === undefined ? message.sqlNetworkArchitecture : $root.google.cloud.sql.v1.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] : message.sqlNetworkArchitecture; if (options.oneofs) object._sqlNetworkArchitecture = "sqlNetworkArchitecture"; } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { object.pscServiceAttachmentLink = message.pscServiceAttachmentLink; if (options.oneofs) object._pscServiceAttachmentLink = "pscServiceAttachmentLink"; } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { object.dnsName = message.dnsName; if (options.oneofs) object._dnsName = "dnsName"; } - if (message.primaryDnsName != null && message.hasOwnProperty("primaryDnsName")) { + if (message.primaryDnsName != null && Object.hasOwnProperty.call(message, "primaryDnsName")) { object.primaryDnsName = message.primaryDnsName; if (options.oneofs) object._primaryDnsName = "primaryDnsName"; } - if (message.writeEndpoint != null && message.hasOwnProperty("writeEndpoint")) { + if (message.writeEndpoint != null && Object.hasOwnProperty.call(message, "writeEndpoint")) { object.writeEndpoint = message.writeEndpoint; if (options.oneofs) object._writeEndpoint = "writeEndpoint"; } - if (message.replicationCluster != null && message.hasOwnProperty("replicationCluster")) - object.replicationCluster = $root.google.cloud.sql.v1.ReplicationCluster.toObject(message.replicationCluster, options); - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { - object.geminiConfig = $root.google.cloud.sql.v1.GeminiInstanceConfig.toObject(message.geminiConfig, options); + if (message.replicationCluster != null && Object.hasOwnProperty.call(message, "replicationCluster")) + object.replicationCluster = $root.google.cloud.sql.v1.ReplicationCluster.toObject(message.replicationCluster, options, q + 1); + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) { + object.geminiConfig = $root.google.cloud.sql.v1.GeminiInstanceConfig.toObject(message.geminiConfig, options, q + 1); if (options.oneofs) object._geminiConfig = "geminiConfig"; } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options); - if (message.switchTransactionLogsToCloudStorageEnabled != null && message.hasOwnProperty("switchTransactionLogsToCloudStorageEnabled")) { - object.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.toObject(message.switchTransactionLogsToCloudStorageEnabled, options); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options, q + 1); + if (message.switchTransactionLogsToCloudStorageEnabled != null && Object.hasOwnProperty.call(message, "switchTransactionLogsToCloudStorageEnabled")) { + object.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.toObject(message.switchTransactionLogsToCloudStorageEnabled, options, q + 1); if (options.oneofs) object._switchTransactionLogsToCloudStorageEnabled = "switchTransactionLogsToCloudStorageEnabled"; } - if (message.includeReplicasForMajorVersionUpgrade != null && message.hasOwnProperty("includeReplicasForMajorVersionUpgrade")) { - object.includeReplicasForMajorVersionUpgrade = $root.google.protobuf.BoolValue.toObject(message.includeReplicasForMajorVersionUpgrade, options); + if (message.includeReplicasForMajorVersionUpgrade != null && Object.hasOwnProperty.call(message, "includeReplicasForMajorVersionUpgrade")) { + object.includeReplicasForMajorVersionUpgrade = $root.google.protobuf.BoolValue.toObject(message.includeReplicasForMajorVersionUpgrade, options, q + 1); if (options.oneofs) object._includeReplicasForMajorVersionUpgrade = "includeReplicasForMajorVersionUpgrade"; } @@ -50686,7 +52134,7 @@ object.tags[keys2[j]] = message.tags[keys2[j]]; } } - 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"; @@ -50694,12 +52142,12 @@ if (message.nodes && message.nodes.length) { object.nodes = []; for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.toObject(message.nodes[j], options); + object.nodes[j] = $root.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.toObject(message.nodes[j], options, q + 1); } if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } return object; }; @@ -50820,13 +52268,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlFailoverReplica.encode = function encode(message, writer) { + SqlFailoverReplica.encode = function encode(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.available != null && Object.hasOwnProperty.call(message, "available")) - $root.google.protobuf.BoolValue.encode(message.available, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.available, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -50840,7 +52292,7 @@ * @returns {$protobuf.Writer} Writer */ SqlFailoverReplica.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -50914,10 +52366,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.available != null && message.hasOwnProperty("available")) { + if (message.available != null && Object.hasOwnProperty.call(message, "available")) { var error = $root.google.protobuf.BoolValue.verify(message.available, long + 1); if (error) return "available." + error; @@ -50936,6 +52388,8 @@ SqlFailoverReplica.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -50944,7 +52398,7 @@ if (object.name != null) message.name = String(object.name); if (object.available != null) { - if (typeof object.available !== "object") + if (!$util.isObject(object.available)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.SqlFailoverReplica.available: object expected"); message.available = $root.google.protobuf.BoolValue.fromObject(object.available, long + 1); } @@ -50960,18 +52414,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlFailoverReplica.toObject = function toObject(message, options) { + SqlFailoverReplica.toObject = function toObject(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.available = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.available != null && message.hasOwnProperty("available")) - object.available = $root.google.protobuf.BoolValue.toObject(message.available, options); + if (message.available != null && Object.hasOwnProperty.call(message, "available")) + object.available = $root.google.protobuf.BoolValue.toObject(message.available, options, q + 1); return object; }; @@ -51093,17 +52551,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlScheduledMaintenance.encode = function encode(message, writer) { + SqlScheduledMaintenance.encode = function encode(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.canDefer != null && Object.hasOwnProperty.call(message, "canDefer")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.canDefer); if (message.canReschedule != null && Object.hasOwnProperty.call(message, "canReschedule")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canReschedule); if (message.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleDeadlineTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.scheduleDeadlineTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -51117,7 +52579,7 @@ * @returns {$protobuf.Writer} Writer */ SqlScheduledMaintenance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -51200,18 +52662,18 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.canDefer != null && message.hasOwnProperty("canDefer")) + if (message.canDefer != null && Object.hasOwnProperty.call(message, "canDefer")) if (typeof message.canDefer !== "boolean") return "canDefer: boolean expected"; - if (message.canReschedule != null && message.hasOwnProperty("canReschedule")) + if (message.canReschedule != null && Object.hasOwnProperty.call(message, "canReschedule")) if (typeof message.canReschedule !== "boolean") return "canReschedule: boolean expected"; - if (message.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) { + if (message.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) { properties._scheduleDeadlineTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.scheduleDeadlineTime, long + 1); @@ -51233,13 +52695,15 @@ SqlScheduledMaintenance.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance(); if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } @@ -51248,7 +52712,7 @@ if (object.canReschedule != null) message.canReschedule = Boolean(object.canReschedule); if (object.scheduleDeadlineTime != null) { - if (typeof object.scheduleDeadlineTime !== "object") + if (!$util.isObject(object.scheduleDeadlineTime)) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.SqlScheduledMaintenance.scheduleDeadlineTime: object expected"); message.scheduleDeadlineTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleDeadlineTime, long + 1); } @@ -51264,23 +52728,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlScheduledMaintenance.toObject = function toObject(message, options) { + SqlScheduledMaintenance.toObject = function toObject(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.startTime = null; object.canDefer = false; object.canReschedule = false; } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.canDefer != null && message.hasOwnProperty("canDefer")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.canDefer != null && Object.hasOwnProperty.call(message, "canDefer")) object.canDefer = message.canDefer; - if (message.canReschedule != null && message.hasOwnProperty("canReschedule")) + if (message.canReschedule != null && Object.hasOwnProperty.call(message, "canReschedule")) object.canReschedule = message.canReschedule; - if (message.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) { - object.scheduleDeadlineTime = $root.google.protobuf.Timestamp.toObject(message.scheduleDeadlineTime, options); + if (message.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) { + object.scheduleDeadlineTime = $root.google.protobuf.Timestamp.toObject(message.scheduleDeadlineTime, options, q + 1); if (options.oneofs) object._scheduleDeadlineTime = "scheduleDeadlineTime"; } @@ -51393,9 +52861,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOutOfDiskReport.encode = function encode(message, writer) { + SqlOutOfDiskReport.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sqlOutOfDiskState != null && Object.hasOwnProperty.call(message, "sqlOutOfDiskState")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sqlOutOfDiskState); if (message.sqlMinRecommendedIncreaseSizeGb != null && Object.hasOwnProperty.call(message, "sqlMinRecommendedIncreaseSizeGb")) @@ -51413,7 +52885,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOutOfDiskReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -51488,7 +52960,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.sqlOutOfDiskState != null && message.hasOwnProperty("sqlOutOfDiskState")) { + if (message.sqlOutOfDiskState != null && Object.hasOwnProperty.call(message, "sqlOutOfDiskState")) { properties._sqlOutOfDiskState = 1; switch (message.sqlOutOfDiskState) { default: @@ -51499,7 +52971,7 @@ break; } } - if (message.sqlMinRecommendedIncreaseSizeGb != null && message.hasOwnProperty("sqlMinRecommendedIncreaseSizeGb")) { + if (message.sqlMinRecommendedIncreaseSizeGb != null && Object.hasOwnProperty.call(message, "sqlMinRecommendedIncreaseSizeGb")) { properties._sqlMinRecommendedIncreaseSizeGb = 1; if (!$util.isInteger(message.sqlMinRecommendedIncreaseSizeGb)) return "sqlMinRecommendedIncreaseSizeGb: integer expected"; @@ -51518,6 +52990,8 @@ SqlOutOfDiskReport.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -51557,16 +53031,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOutOfDiskReport.toObject = function toObject(message, options) { + SqlOutOfDiskReport.toObject = function 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.sqlOutOfDiskState != null && message.hasOwnProperty("sqlOutOfDiskState")) { + if (message.sqlOutOfDiskState != null && Object.hasOwnProperty.call(message, "sqlOutOfDiskState")) { object.sqlOutOfDiskState = options.enums === String ? $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState[message.sqlOutOfDiskState] === undefined ? message.sqlOutOfDiskState : $root.google.cloud.sql.v1.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState[message.sqlOutOfDiskState] : message.sqlOutOfDiskState; if (options.oneofs) object._sqlOutOfDiskState = "sqlOutOfDiskState"; } - if (message.sqlMinRecommendedIncreaseSizeGb != null && message.hasOwnProperty("sqlMinRecommendedIncreaseSizeGb")) { + if (message.sqlMinRecommendedIncreaseSizeGb != null && Object.hasOwnProperty.call(message, "sqlMinRecommendedIncreaseSizeGb")) { object.sqlMinRecommendedIncreaseSizeGb = message.sqlMinRecommendedIncreaseSizeGb; if (options.oneofs) object._sqlMinRecommendedIncreaseSizeGb = "sqlMinRecommendedIncreaseSizeGb"; @@ -51787,28 +53265,32 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PoolNodeConfig.encode = function encode(message, writer) { + PoolNodeConfig.encode = function encode(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.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.gceZone); if (message.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.dnsName); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscServiceAttachmentLink); if (message.pscAutoConnections != null && message.pscAutoConnections.length) for (var i = 0; i < message.pscAutoConnections.length; ++i) - $root.google.cloud.sql.v1.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -51822,7 +53304,7 @@ * @returns {$protobuf.Writer} Writer */ PoolNodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -51927,17 +53409,17 @@ 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")) { properties._name = 1; if (!$util.isString(message.name)) return "name: string expected"; } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) { + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) { properties._gceZone = 1; if (!$util.isString(message.gceZone)) return "gceZone: string expected"; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -51946,12 +53428,12 @@ return "ipAddresses." + error; } } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { properties._dnsName = 1; if (!$util.isString(message.dnsName)) return "dnsName: string expected"; } - if (message.state != null && message.hasOwnProperty("state")) { + if (message.state != null && Object.hasOwnProperty.call(message, "state")) { properties._state = 1; switch (message.state) { default: @@ -51968,7 +53450,7 @@ break; } } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -51977,12 +53459,12 @@ return "dnsNames." + error; } } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { properties._pscServiceAttachmentLink = 1; if (!$util.isString(message.pscServiceAttachmentLink)) return "pscServiceAttachmentLink: string expected"; } - if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { + if (message.pscAutoConnections != null && Object.hasOwnProperty.call(message, "pscAutoConnections")) { if (!Array.isArray(message.pscAutoConnections)) return "pscAutoConnections: array expected"; for (var i = 0; i < message.pscAutoConnections.length; ++i) { @@ -52005,6 +53487,8 @@ PoolNodeConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52019,7 +53503,7 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1.IpMapping.fromObject(object.ipAddresses[i], long + 1); } @@ -52075,7 +53559,7 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -52087,7 +53571,7 @@ throw TypeError(".google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.pscAutoConnections: array expected"); message.pscAutoConnections = []; for (var i = 0; i < object.pscAutoConnections.length; ++i) { - if (typeof object.pscAutoConnections[i] !== "object") + if (!$util.isObject(object.pscAutoConnections[i])) throw TypeError(".google.cloud.sql.v1.DatabaseInstance.PoolNodeConfig.pscAutoConnections: object expected"); message.pscAutoConnections[i] = $root.google.cloud.sql.v1.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i], long + 1); } @@ -52104,21 +53588,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PoolNodeConfig.toObject = function toObject(message, options) { + PoolNodeConfig.toObject = function toObject(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.ipAddresses = []; object.dnsNames = []; object.pscAutoConnections = []; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { object.name = message.name; if (options.oneofs) object._name = "name"; } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) { + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) { object.gceZone = message.gceZone; if (options.oneofs) object._gceZone = "gceZone"; @@ -52126,14 +53614,14 @@ if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { object.dnsName = message.dnsName; if (options.oneofs) object._dnsName = "dnsName"; } - if (message.state != null && message.hasOwnProperty("state")) { + if (message.state != null && Object.hasOwnProperty.call(message, "state")) { object.state = options.enums === String ? $root.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState[message.state] === undefined ? message.state : $root.google.cloud.sql.v1.DatabaseInstance.SqlInstanceState[message.state] : message.state; if (options.oneofs) object._state = "state"; @@ -52141,9 +53629,9 @@ if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { object.pscServiceAttachmentLink = message.pscServiceAttachmentLink; if (options.oneofs) object._pscServiceAttachmentLink = "pscServiceAttachmentLink"; @@ -52151,7 +53639,7 @@ if (message.pscAutoConnections && message.pscAutoConnections.length) { object.pscAutoConnections = []; for (var j = 0; j < message.pscAutoConnections.length; ++j) - object.pscAutoConnections[j] = $root.google.cloud.sql.v1.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); + object.pscAutoConnections[j] = $root.google.cloud.sql.v1.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options, q + 1); } return object; }; @@ -52325,9 +53813,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeminiInstanceConfig.encode = function encode(message, writer) { + GeminiInstanceConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); if (message.googleVacuumMgmtEnabled != null && Object.hasOwnProperty.call(message, "googleVacuumMgmtEnabled")) @@ -52353,7 +53845,7 @@ * @returns {$protobuf.Writer} Writer */ GeminiInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -52444,32 +53936,32 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.entitled != null && message.hasOwnProperty("entitled")) { + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) { properties._entitled = 1; if (typeof message.entitled !== "boolean") return "entitled: boolean expected"; } - if (message.googleVacuumMgmtEnabled != null && message.hasOwnProperty("googleVacuumMgmtEnabled")) { + if (message.googleVacuumMgmtEnabled != null && Object.hasOwnProperty.call(message, "googleVacuumMgmtEnabled")) { properties._googleVacuumMgmtEnabled = 1; if (typeof message.googleVacuumMgmtEnabled !== "boolean") return "googleVacuumMgmtEnabled: boolean expected"; } - if (message.oomSessionCancelEnabled != null && message.hasOwnProperty("oomSessionCancelEnabled")) { + if (message.oomSessionCancelEnabled != null && Object.hasOwnProperty.call(message, "oomSessionCancelEnabled")) { properties._oomSessionCancelEnabled = 1; if (typeof message.oomSessionCancelEnabled !== "boolean") return "oomSessionCancelEnabled: boolean expected"; } - if (message.activeQueryEnabled != null && message.hasOwnProperty("activeQueryEnabled")) { + if (message.activeQueryEnabled != null && Object.hasOwnProperty.call(message, "activeQueryEnabled")) { properties._activeQueryEnabled = 1; if (typeof message.activeQueryEnabled !== "boolean") return "activeQueryEnabled: boolean expected"; } - if (message.indexAdvisorEnabled != null && message.hasOwnProperty("indexAdvisorEnabled")) { + if (message.indexAdvisorEnabled != null && Object.hasOwnProperty.call(message, "indexAdvisorEnabled")) { properties._indexAdvisorEnabled = 1; if (typeof message.indexAdvisorEnabled !== "boolean") return "indexAdvisorEnabled: boolean expected"; } - if (message.flagRecommenderEnabled != null && message.hasOwnProperty("flagRecommenderEnabled")) { + if (message.flagRecommenderEnabled != null && Object.hasOwnProperty.call(message, "flagRecommenderEnabled")) { properties._flagRecommenderEnabled = 1; if (typeof message.flagRecommenderEnabled !== "boolean") return "flagRecommenderEnabled: boolean expected"; @@ -52488,6 +53980,8 @@ GeminiInstanceConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.GeminiInstanceConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.GeminiInstanceConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52517,36 +54011,40 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeminiInstanceConfig.toObject = function toObject(message, options) { + GeminiInstanceConfig.toObject = function 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.entitled != null && message.hasOwnProperty("entitled")) { + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) { object.entitled = message.entitled; if (options.oneofs) object._entitled = "entitled"; } - if (message.googleVacuumMgmtEnabled != null && message.hasOwnProperty("googleVacuumMgmtEnabled")) { + if (message.googleVacuumMgmtEnabled != null && Object.hasOwnProperty.call(message, "googleVacuumMgmtEnabled")) { object.googleVacuumMgmtEnabled = message.googleVacuumMgmtEnabled; if (options.oneofs) object._googleVacuumMgmtEnabled = "googleVacuumMgmtEnabled"; } - if (message.oomSessionCancelEnabled != null && message.hasOwnProperty("oomSessionCancelEnabled")) { + if (message.oomSessionCancelEnabled != null && Object.hasOwnProperty.call(message, "oomSessionCancelEnabled")) { object.oomSessionCancelEnabled = message.oomSessionCancelEnabled; if (options.oneofs) object._oomSessionCancelEnabled = "oomSessionCancelEnabled"; } - if (message.activeQueryEnabled != null && message.hasOwnProperty("activeQueryEnabled")) { + if (message.activeQueryEnabled != null && Object.hasOwnProperty.call(message, "activeQueryEnabled")) { object.activeQueryEnabled = message.activeQueryEnabled; if (options.oneofs) object._activeQueryEnabled = "activeQueryEnabled"; } - if (message.indexAdvisorEnabled != null && message.hasOwnProperty("indexAdvisorEnabled")) { + if (message.indexAdvisorEnabled != null && Object.hasOwnProperty.call(message, "indexAdvisorEnabled")) { object.indexAdvisorEnabled = message.indexAdvisorEnabled; if (options.oneofs) object._indexAdvisorEnabled = "indexAdvisorEnabled"; } - if (message.flagRecommenderEnabled != null && message.hasOwnProperty("flagRecommenderEnabled")) { + if (message.flagRecommenderEnabled != null && Object.hasOwnProperty.call(message, "flagRecommenderEnabled")) { object.flagRecommenderEnabled = message.flagRecommenderEnabled; if (options.oneofs) object._flagRecommenderEnabled = "flagRecommenderEnabled"; @@ -52654,9 +54152,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicationCluster.encode = function encode(message, writer) { + ReplicationCluster.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.psaWriteEndpoint); if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) @@ -52676,7 +54178,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicationCluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -52754,13 +54256,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) + if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) if (!$util.isString(message.psaWriteEndpoint)) return "psaWriteEndpoint: string expected"; - if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) + if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) if (!$util.isString(message.failoverDrReplicaName)) return "failoverDrReplicaName: string expected"; - if (message.drReplica != null && message.hasOwnProperty("drReplica")) + if (message.drReplica != null && Object.hasOwnProperty.call(message, "drReplica")) if (typeof message.drReplica !== "boolean") return "drReplica: boolean expected"; return null; @@ -52777,6 +54279,8 @@ ReplicationCluster.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ReplicationCluster) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ReplicationCluster: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -52800,20 +54304,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicationCluster.toObject = function toObject(message, options) { + ReplicationCluster.toObject = function toObject(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.psaWriteEndpoint = ""; object.failoverDrReplicaName = ""; object.drReplica = false; } - if (message.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) + if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) object.psaWriteEndpoint = message.psaWriteEndpoint; - if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) + if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) object.failoverDrReplicaName = message.failoverDrReplicaName; - if (message.drReplica != null && message.hasOwnProperty("drReplica")) + if (message.drReplica != null && Object.hasOwnProperty.call(message, "drReplica")) object.drReplica = message.drReplica; return object; }; @@ -52939,9 +54447,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailableDatabaseVersion.encode = function encode(message, writer) { + AvailableDatabaseVersion.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.majorVersion); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -52961,7 +54473,7 @@ * @returns {$protobuf.Writer} Writer */ AvailableDatabaseVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -53040,17 +54552,17 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.majorVersion != null && message.hasOwnProperty("majorVersion")) { + if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) { properties._majorVersion = 1; if (!$util.isString(message.majorVersion)) return "majorVersion: string expected"; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { properties._name = 1; 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")) { properties._displayName = 1; if (!$util.isString(message.displayName)) return "displayName: string expected"; @@ -53069,6 +54581,8 @@ AvailableDatabaseVersion.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.AvailableDatabaseVersion) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.AvailableDatabaseVersion: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53092,21 +54606,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvailableDatabaseVersion.toObject = function toObject(message, options) { + AvailableDatabaseVersion.toObject = function 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.majorVersion != null && message.hasOwnProperty("majorVersion")) { + if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) { object.majorVersion = message.majorVersion; if (options.oneofs) object._majorVersion = "majorVersion"; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { object.name = message.name; if (options.oneofs) object._name = "name"; } - 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"; @@ -53196,11 +54714,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRescheduleMaintenanceRequestBody.encode = function encode(message, writer) { + SqlInstancesRescheduleMaintenanceRequestBody.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.reschedule != null && Object.hasOwnProperty.call(message, "reschedule")) - $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.encode(message.reschedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.encode(message.reschedule, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -53214,7 +54736,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRescheduleMaintenanceRequestBody.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -53284,7 +54806,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.reschedule != null && message.hasOwnProperty("reschedule")) { + if (message.reschedule != null && Object.hasOwnProperty.call(message, "reschedule")) { var error = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.verify(message.reschedule, long + 1); if (error) return "reschedule." + error; @@ -53303,13 +54825,15 @@ SqlInstancesRescheduleMaintenanceRequestBody.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody(); if (object.reschedule != null) { - if (typeof object.reschedule !== "object") + if (!$util.isObject(object.reschedule)) throw TypeError(".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.reschedule: object expected"); message.reschedule = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.fromObject(object.reschedule, long + 1); } @@ -53325,14 +54849,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRescheduleMaintenanceRequestBody.toObject = function toObject(message, options) { + SqlInstancesRescheduleMaintenanceRequestBody.toObject = function toObject(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.reschedule = null; - if (message.reschedule != null && message.hasOwnProperty("reschedule")) - object.reschedule = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.toObject(message.reschedule, options); + if (message.reschedule != null && Object.hasOwnProperty.call(message, "reschedule")) + object.reschedule = $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.toObject(message.reschedule, options, q + 1); return object; }; @@ -53442,13 +54970,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Reschedule.encode = function encode(message, writer) { + Reschedule.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rescheduleType != null && Object.hasOwnProperty.call(message, "rescheduleType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rescheduleType); if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -53462,7 +54994,7 @@ * @returns {$protobuf.Writer} Writer */ Reschedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -53536,7 +55068,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + if (message.rescheduleType != null && Object.hasOwnProperty.call(message, "rescheduleType")) switch (message.rescheduleType) { default: return "rescheduleType: enum value expected"; @@ -53546,7 +55078,7 @@ case 3: break; } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) { var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime, long + 1); if (error) return "scheduleTime." + error; @@ -53565,6 +55097,8 @@ Reschedule.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53595,7 +55129,7 @@ break; } if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") + if (!$util.isObject(object.scheduleTime)) throw TypeError(".google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.scheduleTime: object expected"); message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime, long + 1); } @@ -53611,18 +55145,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Reschedule.toObject = function toObject(message, options) { + Reschedule.toObject = function toObject(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.rescheduleType = options.enums === String ? "RESCHEDULE_TYPE_UNSPECIFIED" : 0; object.scheduleTime = null; } - if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + if (message.rescheduleType != null && Object.hasOwnProperty.call(message, "rescheduleType")) object.rescheduleType = options.enums === String ? $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType[message.rescheduleType] === undefined ? message.rescheduleType : $root.google.cloud.sql.v1.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType[message.rescheduleType] : message.rescheduleType; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); + if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options, q + 1); return object; }; @@ -53747,17 +55285,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteMasterContext.encode = function encode(message, writer) { + DemoteMasterContext.encode = function encode(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.verifyGtidConsistency != null && Object.hasOwnProperty.call(message, "verifyGtidConsistency")) - $root.google.protobuf.BoolValue.encode(message.verifyGtidConsistency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.verifyGtidConsistency, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterInstanceName); if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) - $root.google.cloud.sql.v1.DemoteMasterConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.DemoteMasterConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.skipReplicationSetup != null && Object.hasOwnProperty.call(message, "skipReplicationSetup")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipReplicationSetup); return writer; @@ -53773,7 +55315,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteMasterContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -53859,23 +55401,23 @@ 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.verifyGtidConsistency != null && message.hasOwnProperty("verifyGtidConsistency")) { + if (message.verifyGtidConsistency != null && Object.hasOwnProperty.call(message, "verifyGtidConsistency")) { var error = $root.google.protobuf.BoolValue.verify(message.verifyGtidConsistency, long + 1); if (error) return "verifyGtidConsistency." + error; } - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) if (!$util.isString(message.masterInstanceName)) return "masterInstanceName: string expected"; - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) { + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) { var error = $root.google.cloud.sql.v1.DemoteMasterConfiguration.verify(message.replicaConfiguration, long + 1); if (error) return "replicaConfiguration." + error; } - if (message.skipReplicationSetup != null && message.hasOwnProperty("skipReplicationSetup")) + if (message.skipReplicationSetup != null && Object.hasOwnProperty.call(message, "skipReplicationSetup")) if (typeof message.skipReplicationSetup !== "boolean") return "skipReplicationSetup: boolean expected"; return null; @@ -53892,6 +55434,8 @@ DemoteMasterContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DemoteMasterContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DemoteMasterContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -53900,14 +55444,14 @@ if (object.kind != null) message.kind = String(object.kind); if (object.verifyGtidConsistency != null) { - if (typeof object.verifyGtidConsistency !== "object") + if (!$util.isObject(object.verifyGtidConsistency)) throw TypeError(".google.cloud.sql.v1.DemoteMasterContext.verifyGtidConsistency: object expected"); message.verifyGtidConsistency = $root.google.protobuf.BoolValue.fromObject(object.verifyGtidConsistency, long + 1); } if (object.masterInstanceName != null) message.masterInstanceName = String(object.masterInstanceName); if (object.replicaConfiguration != null) { - if (typeof object.replicaConfiguration !== "object") + if (!$util.isObject(object.replicaConfiguration)) throw TypeError(".google.cloud.sql.v1.DemoteMasterContext.replicaConfiguration: object expected"); message.replicaConfiguration = $root.google.cloud.sql.v1.DemoteMasterConfiguration.fromObject(object.replicaConfiguration, long + 1); } @@ -53925,9 +55469,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteMasterContext.toObject = function toObject(message, options) { + DemoteMasterContext.toObject = function toObject(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 = ""; @@ -53936,15 +55484,15 @@ object.replicaConfiguration = null; object.skipReplicationSetup = false; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.verifyGtidConsistency != null && message.hasOwnProperty("verifyGtidConsistency")) - object.verifyGtidConsistency = $root.google.protobuf.BoolValue.toObject(message.verifyGtidConsistency, options); - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.verifyGtidConsistency != null && Object.hasOwnProperty.call(message, "verifyGtidConsistency")) + object.verifyGtidConsistency = $root.google.protobuf.BoolValue.toObject(message.verifyGtidConsistency, options, q + 1); + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) object.masterInstanceName = message.masterInstanceName; - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) - object.replicaConfiguration = $root.google.cloud.sql.v1.DemoteMasterConfiguration.toObject(message.replicaConfiguration, options); - if (message.skipReplicationSetup != null && message.hasOwnProperty("skipReplicationSetup")) + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) + object.replicaConfiguration = $root.google.cloud.sql.v1.DemoteMasterConfiguration.toObject(message.replicaConfiguration, options, q + 1); + if (message.skipReplicationSetup != null && Object.hasOwnProperty.call(message, "skipReplicationSetup")) object.skipReplicationSetup = message.skipReplicationSetup; return object; }; @@ -54040,9 +55588,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteContext.encode = function encode(message, writer) { + DemoteContext.encode = function encode(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.sourceRepresentativeInstanceName != null && Object.hasOwnProperty.call(message, "sourceRepresentativeInstanceName")) @@ -54060,7 +55612,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54134,10 +55686,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.sourceRepresentativeInstanceName != null && message.hasOwnProperty("sourceRepresentativeInstanceName")) + if (message.sourceRepresentativeInstanceName != null && Object.hasOwnProperty.call(message, "sourceRepresentativeInstanceName")) if (!$util.isString(message.sourceRepresentativeInstanceName)) return "sourceRepresentativeInstanceName: string expected"; return null; @@ -54154,6 +55706,8 @@ DemoteContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DemoteContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DemoteContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54175,17 +55729,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteContext.toObject = function toObject(message, options) { + DemoteContext.toObject = function toObject(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.sourceRepresentativeInstanceName = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.sourceRepresentativeInstanceName != null && message.hasOwnProperty("sourceRepresentativeInstanceName")) + if (message.sourceRepresentativeInstanceName != null && Object.hasOwnProperty.call(message, "sourceRepresentativeInstanceName")) object.sourceRepresentativeInstanceName = message.sourceRepresentativeInstanceName; return object; }; @@ -54281,9 +55839,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverContext.encode = function encode(message, writer) { + FailoverContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.settingsVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -54301,7 +55863,7 @@ * @returns {$protobuf.Writer} Writer */ FailoverContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54375,10 +55937,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) if (!$util.isInteger(message.settingsVersion) && !(message.settingsVersion && $util.isInteger(message.settingsVersion.low) && $util.isInteger(message.settingsVersion.high))) return "settingsVersion: integer|Long expected"; - 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"; return null; @@ -54395,6 +55957,8 @@ FailoverContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.FailoverContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.FailoverContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54402,7 +55966,7 @@ var message = new $root.google.cloud.sql.v1.FailoverContext(); if (object.settingsVersion != null) if ($util.Long) - (message.settingsVersion = $util.Long.fromValue(object.settingsVersion)).unsigned = false; + message.settingsVersion = $util.Long.fromValue(object.settingsVersion, false); else if (typeof object.settingsVersion === "string") message.settingsVersion = parseInt(object.settingsVersion, 10); else if (typeof object.settingsVersion === "number") @@ -54423,24 +55987,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FailoverContext.toObject = function toObject(message, options) { + FailoverContext.toObject = function toObject(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.settingsVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.settingsVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.settingsVersion = options.longs === String ? "0" : 0; + object.settingsVersion = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; } - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) - if (typeof message.settingsVersion === "number") + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.settingsVersion = typeof message.settingsVersion === "number" ? BigInt(message.settingsVersion) : $util.Long.fromBits(message.settingsVersion.low >>> 0, message.settingsVersion.high >>> 0, false).toBigInt(); + else if (typeof message.settingsVersion === "number") object.settingsVersion = options.longs === String ? String(message.settingsVersion) : message.settingsVersion; else object.settingsVersion = options.longs === String ? $util.Long.prototype.toString.call(message.settingsVersion) : options.longs === Number ? new $util.LongBits(message.settingsVersion.low >>> 0, message.settingsVersion.high >>> 0).toNumber() : message.settingsVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -54554,9 +56124,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreBackupContext.encode = function encode(message, writer) { + RestoreBackupContext.encode = function encode(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.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) @@ -54578,7 +56152,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreBackupContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54660,16 +56234,16 @@ 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.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) return "backupRunId: integer|Long 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -54686,6 +56260,8 @@ RestoreBackupContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.RestoreBackupContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.RestoreBackupContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54695,7 +56271,7 @@ message.kind = String(object.kind); if (object.backupRunId != null) if ($util.Long) - (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; + message.backupRunId = $util.Long.fromValue(object.backupRunId, false); else if (typeof object.backupRunId === "string") message.backupRunId = parseInt(object.backupRunId, 10); else if (typeof object.backupRunId === "number") @@ -54718,30 +56294,36 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreBackupContext.toObject = function toObject(message, options) { + RestoreBackupContext.toObject = function toObject(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 = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.backupRunId = options.longs === String ? "0" : 0; + object.backupRunId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.instanceId = ""; object.project = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (typeof message.backupRunId === "number") + if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.backupRunId = typeof message.backupRunId === "number" ? BigInt(message.backupRunId) : $util.Long.fromBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0, false).toBigInt(); + else if (typeof message.backupRunId === "number") object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; else object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -54837,9 +56419,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RotateServerCaContext.encode = function encode(message, writer) { + RotateServerCaContext.encode = function encode(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.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) @@ -54857,7 +56443,7 @@ * @returns {$protobuf.Writer} Writer */ RotateServerCaContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -54931,10 +56517,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.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) if (!$util.isString(message.nextVersion)) return "nextVersion: string expected"; return null; @@ -54951,6 +56537,8 @@ RotateServerCaContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.RotateServerCaContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.RotateServerCaContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -54972,17 +56560,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RotateServerCaContext.toObject = function toObject(message, options) { + RotateServerCaContext.toObject = function toObject(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.nextVersion = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) object.nextVersion = message.nextVersion; return object; }; @@ -55078,9 +56670,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RotateServerCertificateContext.encode = function encode(message, writer) { + RotateServerCertificateContext.encode = function encode(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.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) @@ -55098,7 +56694,7 @@ * @returns {$protobuf.Writer} Writer */ RotateServerCertificateContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -55172,10 +56768,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.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) if (!$util.isString(message.nextVersion)) return "nextVersion: string expected"; return null; @@ -55192,6 +56788,8 @@ RotateServerCertificateContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.RotateServerCertificateContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.RotateServerCertificateContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -55213,17 +56811,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RotateServerCertificateContext.toObject = function toObject(message, options) { + RotateServerCertificateContext.toObject = function toObject(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.nextVersion = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) object.nextVersion = message.nextVersion; return object; }; @@ -55319,9 +56921,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RotateEntraIdCertificateContext.encode = function encode(message, writer) { + RotateEntraIdCertificateContext.encode = function encode(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.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) @@ -55339,7 +56945,7 @@ * @returns {$protobuf.Writer} Writer */ RotateEntraIdCertificateContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -55413,10 +57019,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.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) if (!$util.isString(message.nextVersion)) return "nextVersion: string expected"; return null; @@ -55433,6 +57039,8 @@ RotateEntraIdCertificateContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.RotateEntraIdCertificateContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.RotateEntraIdCertificateContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -55454,17 +57062,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RotateEntraIdCertificateContext.toObject = function toObject(message, options) { + RotateEntraIdCertificateContext.toObject = function toObject(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.nextVersion = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) object.nextVersion = message.nextVersion; return object; }; @@ -55560,9 +57172,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TruncateLogContext.encode = function encode(message, writer) { + TruncateLogContext.encode = function encode(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.logType != null && Object.hasOwnProperty.call(message, "logType")) @@ -55580,7 +57196,7 @@ * @returns {$protobuf.Writer} Writer */ TruncateLogContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -55654,10 +57270,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.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; @@ -55674,6 +57290,8 @@ TruncateLogContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.TruncateLogContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.TruncateLogContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -55695,17 +57313,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TruncateLogContext.toObject = function toObject(message, options) { + TruncateLogContext.toObject = function toObject(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.logType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) object.logType = message.logType; return object; }; @@ -55810,9 +57432,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlExternalSyncSettingError.encode = function encode(message, writer) { + SqlExternalSyncSettingError.encode = function encode(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.type != null && Object.hasOwnProperty.call(message, "type")) @@ -55832,7 +57458,7 @@ * @returns {$protobuf.Writer} Writer */ SqlExternalSyncSettingError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -55910,10 +57536,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.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) switch (message.type) { default: return "type: enum value expected"; @@ -55978,7 +57604,7 @@ case 58: break; } - 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; @@ -55995,6 +57621,8 @@ SqlExternalSyncSettingError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlExternalSyncSettingError) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlExternalSyncSettingError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56260,20 +57888,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlExternalSyncSettingError.toObject = function toObject(message, options) { + SqlExternalSyncSettingError.toObject = function toObject(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.type = options.enums === String ? "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" : 0; object.detail = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType[message.type] : message.type; - if (message.detail != null && message.hasOwnProperty("detail")) + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) object.detail = message.detail; return object; }; @@ -56488,9 +58120,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SelectedObjects.encode = function encode(message, writer) { + SelectedObjects.encode = function encode(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; @@ -56506,7 +58142,7 @@ * @returns {$protobuf.Writer} Writer */ SelectedObjects.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -56576,7 +58212,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; @@ -56593,6 +58229,8 @@ SelectedObjects.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SelectedObjects) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SelectedObjects: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -56612,13 +58250,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SelectedObjects.toObject = function toObject(message, options) { + SelectedObjects.toObject = function toObject(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; }; @@ -56796,9 +58438,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OnPremisesConfiguration.encode = function encode(message, writer) { + OnPremisesConfiguration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -56816,10 +58462,10 @@ if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.dumpFilePath); if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) - $root.google.cloud.sql.v1.InstanceReference.encode(message.sourceInstance, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + $root.google.cloud.sql.v1.InstanceReference.encode(message.sourceInstance, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); if (message.selectedObjects != null && message.selectedObjects.length) for (var i = 0; i < message.selectedObjects.length; ++i) - $root.google.cloud.sql.v1.SelectedObjects.encode(message.selectedObjects[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + $root.google.cloud.sql.v1.SelectedObjects.encode(message.selectedObjects[i], writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); if (message.sslOption != null && Object.hasOwnProperty.call(message, "sslOption")) writer.uint32(/* id 18, wireType 0 =*/144).int32(message.sslOption); return writer; @@ -56835,7 +58481,7 @@ * @returns {$protobuf.Writer} Writer */ OnPremisesConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -56947,36 +58593,36 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) if (!$util.isString(message.hostPort)) return "hostPort: string expected"; - 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.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) if (!$util.isString(message.username)) return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: string expected"; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) if (!$util.isString(message.caCertificate)) return "caCertificate: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) if (!$util.isString(message.clientCertificate)) return "clientCertificate: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) if (!$util.isString(message.clientKey)) return "clientKey: string expected"; - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) if (!$util.isString(message.dumpFilePath)) return "dumpFilePath: string expected"; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) { var error = $root.google.cloud.sql.v1.InstanceReference.verify(message.sourceInstance, long + 1); if (error) return "sourceInstance." + error; } - if (message.selectedObjects != null && message.hasOwnProperty("selectedObjects")) { + if (message.selectedObjects != null && Object.hasOwnProperty.call(message, "selectedObjects")) { if (!Array.isArray(message.selectedObjects)) return "selectedObjects: array expected"; for (var i = 0; i < message.selectedObjects.length; ++i) { @@ -56985,7 +58631,7 @@ return "selectedObjects." + error; } } - if (message.sslOption != null && message.hasOwnProperty("sslOption")) + if (message.sslOption != null && Object.hasOwnProperty.call(message, "sslOption")) switch (message.sslOption) { default: return "sslOption: enum value expected"; @@ -57009,6 +58655,8 @@ OnPremisesConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.OnPremisesConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.OnPremisesConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -57031,7 +58679,7 @@ if (object.dumpFilePath != null) message.dumpFilePath = String(object.dumpFilePath); if (object.sourceInstance != null) { - if (typeof object.sourceInstance !== "object") + if (!$util.isObject(object.sourceInstance)) throw TypeError(".google.cloud.sql.v1.OnPremisesConfiguration.sourceInstance: object expected"); message.sourceInstance = $root.google.cloud.sql.v1.InstanceReference.fromObject(object.sourceInstance, long + 1); } @@ -57040,7 +58688,7 @@ throw TypeError(".google.cloud.sql.v1.OnPremisesConfiguration.selectedObjects: array expected"); message.selectedObjects = []; for (var i = 0; i < object.selectedObjects.length; ++i) { - if (typeof object.selectedObjects[i] !== "object") + if (!$util.isObject(object.selectedObjects[i])) throw TypeError(".google.cloud.sql.v1.OnPremisesConfiguration.selectedObjects: object expected"); message.selectedObjects[i] = $root.google.cloud.sql.v1.SelectedObjects.fromObject(object.selectedObjects[i], long + 1); } @@ -57081,9 +58729,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OnPremisesConfiguration.toObject = function toObject(message, options) { + OnPremisesConfiguration.toObject = function toObject(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.selectedObjects = []; @@ -57099,30 +58751,30 @@ object.sourceInstance = null; object.sslOption = options.enums === String ? "SSL_OPTION_UNSPECIFIED" : 0; } - if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) object.hostPort = message.hostPort; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) object.caCertificate = message.caCertificate; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) object.clientCertificate = message.clientCertificate; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) object.clientKey = message.clientKey; - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) object.dumpFilePath = message.dumpFilePath; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) - object.sourceInstance = $root.google.cloud.sql.v1.InstanceReference.toObject(message.sourceInstance, options); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + object.sourceInstance = $root.google.cloud.sql.v1.InstanceReference.toObject(message.sourceInstance, options, q + 1); if (message.selectedObjects && message.selectedObjects.length) { object.selectedObjects = []; for (var j = 0; j < message.selectedObjects.length; ++j) - object.selectedObjects[j] = $root.google.cloud.sql.v1.SelectedObjects.toObject(message.selectedObjects[j], options); + object.selectedObjects[j] = $root.google.cloud.sql.v1.SelectedObjects.toObject(message.selectedObjects[j], options, q + 1); } - if (message.sslOption != null && message.hasOwnProperty("sslOption")) + if (message.sslOption != null && Object.hasOwnProperty.call(message, "sslOption")) object.sslOption = options.enums === String ? $root.google.cloud.sql.v1.OnPremisesConfiguration.SslOption[message.sslOption] === undefined ? message.sslOption : $root.google.cloud.sql.v1.OnPremisesConfiguration.SslOption[message.sslOption] : message.sslOption; return object; }; @@ -57254,17 +58906,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicaConfiguration.encode = function encode(message, writer) { + ReplicaConfiguration.encode = function encode(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.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) - $root.google.cloud.sql.v1.MySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.MySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.failoverTarget != null && Object.hasOwnProperty.call(message, "failoverTarget")) - $root.google.protobuf.BoolValue.encode(message.failoverTarget, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.failoverTarget, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.cascadableReplica != null && Object.hasOwnProperty.call(message, "cascadableReplica")) - $root.google.protobuf.BoolValue.encode(message.cascadableReplica, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.cascadableReplica, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -57278,7 +58934,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicaConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -57360,20 +59016,20 @@ 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.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) { + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) { var error = $root.google.cloud.sql.v1.MySqlReplicaConfiguration.verify(message.mysqlReplicaConfiguration, long + 1); if (error) return "mysqlReplicaConfiguration." + error; } - if (message.failoverTarget != null && message.hasOwnProperty("failoverTarget")) { + if (message.failoverTarget != null && Object.hasOwnProperty.call(message, "failoverTarget")) { var error = $root.google.protobuf.BoolValue.verify(message.failoverTarget, long + 1); if (error) return "failoverTarget." + error; } - if (message.cascadableReplica != null && message.hasOwnProperty("cascadableReplica")) { + if (message.cascadableReplica != null && Object.hasOwnProperty.call(message, "cascadableReplica")) { var error = $root.google.protobuf.BoolValue.verify(message.cascadableReplica, long + 1); if (error) return "cascadableReplica." + error; @@ -57392,6 +59048,8 @@ ReplicaConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ReplicaConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ReplicaConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -57400,17 +59058,17 @@ if (object.kind != null) message.kind = String(object.kind); if (object.mysqlReplicaConfiguration != null) { - if (typeof object.mysqlReplicaConfiguration !== "object") + if (!$util.isObject(object.mysqlReplicaConfiguration)) throw TypeError(".google.cloud.sql.v1.ReplicaConfiguration.mysqlReplicaConfiguration: object expected"); message.mysqlReplicaConfiguration = $root.google.cloud.sql.v1.MySqlReplicaConfiguration.fromObject(object.mysqlReplicaConfiguration, long + 1); } if (object.failoverTarget != null) { - if (typeof object.failoverTarget !== "object") + if (!$util.isObject(object.failoverTarget)) throw TypeError(".google.cloud.sql.v1.ReplicaConfiguration.failoverTarget: object expected"); message.failoverTarget = $root.google.protobuf.BoolValue.fromObject(object.failoverTarget, long + 1); } if (object.cascadableReplica != null) { - if (typeof object.cascadableReplica !== "object") + if (!$util.isObject(object.cascadableReplica)) throw TypeError(".google.cloud.sql.v1.ReplicaConfiguration.cascadableReplica: object expected"); message.cascadableReplica = $root.google.protobuf.BoolValue.fromObject(object.cascadableReplica, long + 1); } @@ -57426,9 +59084,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicaConfiguration.toObject = function toObject(message, options) { + ReplicaConfiguration.toObject = function toObject(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 = ""; @@ -57436,14 +59098,14 @@ object.failoverTarget = null; object.cascadableReplica = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) - object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1.MySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options); - if (message.failoverTarget != null && message.hasOwnProperty("failoverTarget")) - object.failoverTarget = $root.google.protobuf.BoolValue.toObject(message.failoverTarget, options); - if (message.cascadableReplica != null && message.hasOwnProperty("cascadableReplica")) - object.cascadableReplica = $root.google.protobuf.BoolValue.toObject(message.cascadableReplica, options); + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) + object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1.MySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options, q + 1); + if (message.failoverTarget != null && Object.hasOwnProperty.call(message, "failoverTarget")) + object.failoverTarget = $root.google.protobuf.BoolValue.toObject(message.failoverTarget, options, q + 1); + if (message.cascadableReplica != null && Object.hasOwnProperty.call(message, "cascadableReplica")) + object.cascadableReplica = $root.google.protobuf.BoolValue.toObject(message.cascadableReplica, options, q + 1); return object; }; @@ -57547,15 +59209,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesExecuteSqlRequest.encode = function encode(message, writer) { + SqlInstancesExecuteSqlRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.ExecuteSqlPayload.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.ExecuteSqlPayload.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -57569,7 +59235,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -57647,13 +59313,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.ExecuteSqlPayload.verify(message.body, long + 1); if (error) return "body." + error; @@ -57672,6 +59338,8 @@ SqlInstancesExecuteSqlRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesExecuteSqlRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -57682,7 +59350,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.ExecuteSqlPayload.fromObject(object.body, long + 1); } @@ -57698,21 +59366,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesExecuteSqlRequest.toObject = function toObject(message, options) { + SqlInstancesExecuteSqlRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.ExecuteSqlPayload.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.ExecuteSqlPayload.toObject(message.body, options, q + 1); return object; }; @@ -57866,9 +59538,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteSqlPayload.encode = function encode(message, writer) { + ExecuteSqlPayload.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.user != null && Object.hasOwnProperty.call(message, "user")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) @@ -57896,7 +59572,7 @@ * @returns {$protobuf.Writer} Writer */ ExecuteSqlPayload.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -57991,24 +59667,24 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) if (!$util.isString(message.user)) return "user: string expected"; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) if (!$util.isString(message.sqlStatement)) return "sqlStatement: 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.autoIamAuthn != null && message.hasOwnProperty("autoIamAuthn")) { + if (message.autoIamAuthn != null && Object.hasOwnProperty.call(message, "autoIamAuthn")) { properties.userPassword = 1; if (typeof message.autoIamAuthn !== "boolean") return "autoIamAuthn: boolean expected"; } - if (message.rowLimit != null && message.hasOwnProperty("rowLimit")) + if (message.rowLimit != null && Object.hasOwnProperty.call(message, "rowLimit")) if (!$util.isInteger(message.rowLimit) && !(message.rowLimit && $util.isInteger(message.rowLimit.low) && $util.isInteger(message.rowLimit.high))) return "rowLimit: integer|Long expected"; - if (message.partialResultMode != null && message.hasOwnProperty("partialResultMode")) + if (message.partialResultMode != null && Object.hasOwnProperty.call(message, "partialResultMode")) switch (message.partialResultMode) { default: return "partialResultMode: enum value expected"; @@ -58017,7 +59693,7 @@ case 2: break; } - if (message.application != null && message.hasOwnProperty("application")) + if (message.application != null && Object.hasOwnProperty.call(message, "application")) if (!$util.isString(message.application)) return "application: string expected"; return null; @@ -58034,6 +59710,8 @@ ExecuteSqlPayload.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ExecuteSqlPayload) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ExecuteSqlPayload: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -58049,7 +59727,7 @@ message.autoIamAuthn = Boolean(object.autoIamAuthn); if (object.rowLimit != null) if ($util.Long) - (message.rowLimit = $util.Long.fromValue(object.rowLimit)).unsigned = false; + message.rowLimit = $util.Long.fromValue(object.rowLimit, false); else if (typeof object.rowLimit === "string") message.rowLimit = parseInt(object.rowLimit, 10); else if (typeof object.rowLimit === "number") @@ -58090,9 +59768,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteSqlPayload.toObject = function toObject(message, options) { + ExecuteSqlPayload.toObject = function toObject(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.user = ""; @@ -58100,31 +59782,33 @@ object.database = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.rowLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.rowLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.rowLimit = options.longs === String ? "0" : 0; + object.rowLimit = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.partialResultMode = options.enums === String ? "PARTIAL_RESULT_MODE_UNSPECIFIED" : 0; object.application = ""; } - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) object.user = message.user; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) object.sqlStatement = message.sqlStatement; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.rowLimit != null && message.hasOwnProperty("rowLimit")) - if (typeof message.rowLimit === "number") + if (message.rowLimit != null && Object.hasOwnProperty.call(message, "rowLimit")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.rowLimit = typeof message.rowLimit === "number" ? BigInt(message.rowLimit) : $util.Long.fromBits(message.rowLimit.low >>> 0, message.rowLimit.high >>> 0, false).toBigInt(); + else if (typeof message.rowLimit === "number") object.rowLimit = options.longs === String ? String(message.rowLimit) : message.rowLimit; else object.rowLimit = options.longs === String ? $util.Long.prototype.toString.call(message.rowLimit) : options.longs === Number ? new $util.LongBits(message.rowLimit.low >>> 0, message.rowLimit.high >>> 0).toNumber() : message.rowLimit; - if (message.autoIamAuthn != null && message.hasOwnProperty("autoIamAuthn")) { + if (message.autoIamAuthn != null && Object.hasOwnProperty.call(message, "autoIamAuthn")) { object.autoIamAuthn = message.autoIamAuthn; if (options.oneofs) object.userPassword = "autoIamAuthn"; } - if (message.partialResultMode != null && message.hasOwnProperty("partialResultMode")) + if (message.partialResultMode != null && Object.hasOwnProperty.call(message, "partialResultMode")) object.partialResultMode = options.enums === String ? $root.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode[message.partialResultMode] === undefined ? message.partialResultMode : $root.google.cloud.sql.v1.ExecuteSqlPayload.PartialResultMode[message.partialResultMode] : message.partialResultMode; - if (message.application != null && message.hasOwnProperty("application")) + if (message.application != null && Object.hasOwnProperty.call(message, "application")) object.application = message.application; return object; }; @@ -58256,19 +59940,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesExecuteSqlResponse.encode = function encode(message, writer) { + SqlInstancesExecuteSqlResponse.encode = function encode(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.cloud.sql.v1.Metadata.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1.Metadata.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.sql.v1.QueryResult.encode(message.results[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.sql.v1.QueryResult.encode(message.results[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.messages != null && message.messages.length) for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.encode(message.messages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.encode(message.messages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -58282,7 +59970,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -58368,7 +60056,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.messages != null && message.hasOwnProperty("messages")) { + if (message.messages != null && Object.hasOwnProperty.call(message, "messages")) { if (!Array.isArray(message.messages)) return "messages: array expected"; for (var i = 0; i < message.messages.length; ++i) { @@ -58377,12 +60065,12 @@ return "messages." + error; } } - if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { var error = $root.google.cloud.sql.v1.Metadata.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.results != null && message.hasOwnProperty("results")) { + if (message.results != null && Object.hasOwnProperty.call(message, "results")) { if (!Array.isArray(message.results)) return "results: array expected"; for (var i = 0; i < message.results.length; ++i) { @@ -58391,7 +60079,7 @@ return "results." + 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; @@ -58410,6 +60098,8 @@ SqlInstancesExecuteSqlResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -58420,13 +60110,13 @@ throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.messages: array expected"); message.messages = []; for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") + if (!$util.isObject(object.messages[i])) throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.messages: object expected"); message.messages[i] = $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.fromObject(object.messages[i], long + 1); } } if (object.metadata != null) { - if (typeof object.metadata !== "object") + if (!$util.isObject(object.metadata)) throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.metadata: object expected"); message.metadata = $root.google.cloud.sql.v1.Metadata.fromObject(object.metadata, long + 1); } @@ -58435,13 +60125,13 @@ throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.results: array expected"); message.results = []; for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") + if (!$util.isObject(object.results[i])) throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.results: object expected"); message.results[i] = $root.google.cloud.sql.v1.QueryResult.fromObject(object.results[i], long + 1); } } if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } @@ -58457,9 +60147,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesExecuteSqlResponse.toObject = function toObject(message, options) { + SqlInstancesExecuteSqlResponse.toObject = function toObject(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.results = []; @@ -58469,19 +60163,19 @@ object.metadata = null; object.status = null; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.sql.v1.Metadata.toObject(message.metadata, options); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.cloud.sql.v1.Metadata.toObject(message.metadata, options, q + 1); if (message.results && message.results.length) { object.results = []; for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.sql.v1.QueryResult.toObject(message.results[j], options); + object.results[j] = $root.google.cloud.sql.v1.QueryResult.toObject(message.results[j], options, q + 1); } - 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 (message.messages && message.messages.length) { object.messages = []; for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.toObject(message.messages[j], options); + object.messages[j] = $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message.toObject(message.messages[j], options, q + 1); } return object; }; @@ -58589,9 +60283,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Message.encode = function encode(message, writer) { + Message.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) @@ -58609,7 +60307,7 @@ * @returns {$protobuf.Writer} Writer */ Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -58684,12 +60382,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { properties._message = 1; if (!$util.isString(message.message)) return "message: string expected"; } - if (message.severity != null && message.hasOwnProperty("severity")) { + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) { properties._severity = 1; if (!$util.isString(message.severity)) return "severity: string expected"; @@ -58708,6 +60406,8 @@ Message.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesExecuteSqlResponse.Message: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -58729,16 +60429,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Message.toObject = function toObject(message, options) { + Message.toObject = function 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.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { object.message = message.message; if (options.oneofs) object._message = "message"; } - if (message.severity != null && message.hasOwnProperty("severity")) { + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) { object.severity = message.severity; if (options.oneofs) object._severity = "severity"; @@ -58869,21 +60573,25 @@ * @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.columns != null && message.columns.length) for (var i = 0; i < message.columns.length; ++i) - $root.google.cloud.sql.v1.Column.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.Column.encode(message.columns[i], 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.cloud.sql.v1.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.partialResult); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -58897,7 +60605,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(); }; /** @@ -58987,7 +60695,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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) { @@ -58996,7 +60704,7 @@ return "columns." + 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) { @@ -59005,13 +60713,13 @@ return "rows." + error; } } - 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.partialResult != null && message.hasOwnProperty("partialResult")) + if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) if (typeof message.partialResult !== "boolean") return "partialResult: boolean 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; @@ -59030,6 +60738,8 @@ QueryResult.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.QueryResult) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.QueryResult: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59040,7 +60750,7 @@ throw TypeError(".google.cloud.sql.v1.QueryResult.columns: array expected"); message.columns = []; for (var i = 0; i < object.columns.length; ++i) { - if (typeof object.columns[i] !== "object") + if (!$util.isObject(object.columns[i])) throw TypeError(".google.cloud.sql.v1.QueryResult.columns: object expected"); message.columns[i] = $root.google.cloud.sql.v1.Column.fromObject(object.columns[i], long + 1); } @@ -59050,7 +60760,7 @@ throw TypeError(".google.cloud.sql.v1.QueryResult.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.cloud.sql.v1.QueryResult.rows: object expected"); message.rows[i] = $root.google.cloud.sql.v1.Row.fromObject(object.rows[i], long + 1); } @@ -59060,7 +60770,7 @@ if (object.partialResult != null) message.partialResult = Boolean(object.partialResult); if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.cloud.sql.v1.QueryResult.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } @@ -59076,9 +60786,13 @@ * @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.columns = []; @@ -59092,19 +60806,19 @@ if (message.columns && message.columns.length) { object.columns = []; for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = $root.google.cloud.sql.v1.Column.toObject(message.columns[j], options); + object.columns[j] = $root.google.cloud.sql.v1.Column.toObject(message.columns[j], 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.cloud.sql.v1.Row.toObject(message.rows[j], options); + object.rows[j] = $root.google.cloud.sql.v1.Row.toObject(message.rows[j], options, q + 1); } - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) object.message = message.message; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) + if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) object.partialResult = message.partialResult; - 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; }; @@ -59199,9 +60913,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Column.encode = function encode(message, writer) { + Column.encode = function encode(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")) @@ -59219,7 +60937,7 @@ * @returns {$protobuf.Writer} Writer */ Column.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -59293,10 +61011,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")) if (!$util.isString(message.type)) return "type: string expected"; return null; @@ -59313,6 +61031,8 @@ Column.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Column) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Column: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59334,17 +61054,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Column.toObject = function toObject(message, options) { + Column.toObject = function toObject(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 = ""; } - 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; return object; }; @@ -59432,12 +61156,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Row.encode = function encode(message, writer) { + Row.encode = function encode(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.cloud.sql.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -59451,7 +61179,7 @@ * @returns {$protobuf.Writer} Writer */ Row.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -59523,7 +61251,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) { @@ -59546,6 +61274,8 @@ Row.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Row) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Row: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59556,7 +61286,7 @@ throw TypeError(".google.cloud.sql.v1.Row.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.cloud.sql.v1.Row.values: object expected"); message.values[i] = $root.google.cloud.sql.v1.Value.fromObject(object.values[i], long + 1); } @@ -59573,16 +61303,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Row.toObject = function toObject(message, options) { + Row.toObject = function toObject(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.cloud.sql.v1.Value.toObject(message.values[j], options); + object.values[j] = $root.google.cloud.sql.v1.Value.toObject(message.values[j], options, q + 1); } return object; }; @@ -59678,9 +61412,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.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) @@ -59698,7 +61436,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(); }; /** @@ -59772,10 +61510,10 @@ 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 (!$util.isString(message.value)) return "value: string expected"; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) if (typeof message.nullValue !== "boolean") return "nullValue: boolean expected"; return null; @@ -59792,6 +61530,8 @@ Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -59813,17 +61553,21 @@ * @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 (options.defaults) { object.value = ""; object.nullValue = false; } - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) object.nullValue = message.nullValue; return object; }; @@ -59910,11 +61654,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Metadata.encode = function encode(message, writer) { + Metadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sqlStatementExecutionTime != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionTime")) - $root.google.protobuf.Duration.encode(message.sqlStatementExecutionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.sqlStatementExecutionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -59928,7 +61676,7 @@ * @returns {$protobuf.Writer} Writer */ Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -59998,7 +61746,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.sqlStatementExecutionTime != null && message.hasOwnProperty("sqlStatementExecutionTime")) { + if (message.sqlStatementExecutionTime != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionTime")) { var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionTime, long + 1); if (error) return "sqlStatementExecutionTime." + error; @@ -60017,13 +61765,15 @@ Metadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Metadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Metadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.Metadata(); if (object.sqlStatementExecutionTime != null) { - if (typeof object.sqlStatementExecutionTime !== "object") + if (!$util.isObject(object.sqlStatementExecutionTime)) throw TypeError(".google.cloud.sql.v1.Metadata.sqlStatementExecutionTime: object expected"); message.sqlStatementExecutionTime = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionTime, long + 1); } @@ -60039,14 +61789,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Metadata.toObject = function toObject(message, options) { + Metadata.toObject = function toObject(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.sqlStatementExecutionTime = null; - if (message.sqlStatementExecutionTime != null && message.hasOwnProperty("sqlStatementExecutionTime")) - object.sqlStatementExecutionTime = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionTime, options); + if (message.sqlStatementExecutionTime != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionTime")) + object.sqlStatementExecutionTime = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionTime, options, q + 1); return object; }; @@ -60150,15 +61904,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAcquireSsrsLeaseRequest.encode = function encode(message, writer) { + SqlInstancesAcquireSsrsLeaseRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -60172,7 +61930,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAcquireSsrsLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -60250,13 +62008,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -60275,6 +62033,8 @@ SqlInstancesAcquireSsrsLeaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60285,7 +62045,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.fromObject(object.body, long + 1); } @@ -60301,21 +62061,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAcquireSsrsLeaseRequest.toObject = function toObject(message, options) { + SqlInstancesAcquireSsrsLeaseRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.InstancesAcquireSsrsLeaseRequest.toObject(message.body, options, q + 1); return object; }; @@ -60401,9 +62165,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAcquireSsrsLeaseResponse.encode = function encode(message, writer) { + SqlInstancesAcquireSsrsLeaseResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.operationId); return writer; @@ -60419,7 +62187,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAcquireSsrsLeaseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -60489,7 +62257,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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"; return null; @@ -60506,6 +62274,8 @@ SqlInstancesAcquireSsrsLeaseResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesAcquireSsrsLeaseResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60525,13 +62295,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAcquireSsrsLeaseResponse.toObject = function toObject(message, options) { + SqlInstancesAcquireSsrsLeaseResponse.toObject = function toObject(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.operationId = ""; - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) object.operationId = message.operationId; return object; }; @@ -60627,9 +62401,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesReleaseSsrsLeaseRequest.encode = function encode(message, writer) { + SqlInstancesReleaseSsrsLeaseRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -60647,7 +62425,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesReleaseSsrsLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -60721,10 +62499,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -60741,6 +62519,8 @@ SqlInstancesReleaseSsrsLeaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60762,17 +62542,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesReleaseSsrsLeaseRequest.toObject = function toObject(message, options) { + SqlInstancesReleaseSsrsLeaseRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -60859,9 +62643,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesReleaseSsrsLeaseResponse.encode = function encode(message, writer) { + SqlInstancesReleaseSsrsLeaseResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.operationId); return writer; @@ -60877,7 +62665,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesReleaseSsrsLeaseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -60947,7 +62735,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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"; return null; @@ -60964,6 +62752,8 @@ SqlInstancesReleaseSsrsLeaseResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesReleaseSsrsLeaseResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -60983,13 +62773,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesReleaseSsrsLeaseResponse.toObject = function toObject(message, options) { + SqlInstancesReleaseSsrsLeaseResponse.toObject = function toObject(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.operationId = ""; - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) object.operationId = message.operationId; return object; }; @@ -61085,13 +62879,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPointInTimeRestoreRequest.encode = function encode(message, writer) { + SqlInstancesPointInTimeRestoreRequest.encode = function encode(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.context != null && Object.hasOwnProperty.call(message, "context")) - $root.google.cloud.sql.v1.PointInTimeRestoreContext.encode(message.context, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.PointInTimeRestoreContext.encode(message.context, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -61105,7 +62903,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPointInTimeRestoreRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -61179,10 +62977,10 @@ 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.context != null && message.hasOwnProperty("context")) { + if (message.context != null && Object.hasOwnProperty.call(message, "context")) { var error = $root.google.cloud.sql.v1.PointInTimeRestoreContext.verify(message.context, long + 1); if (error) return "context." + error; @@ -61201,6 +62999,8 @@ SqlInstancesPointInTimeRestoreRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -61209,7 +63009,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.context != null) { - if (typeof object.context !== "object") + if (!$util.isObject(object.context)) throw TypeError(".google.cloud.sql.v1.SqlInstancesPointInTimeRestoreRequest.context: object expected"); message.context = $root.google.cloud.sql.v1.PointInTimeRestoreContext.fromObject(object.context, long + 1); } @@ -61225,18 +63025,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPointInTimeRestoreRequest.toObject = function toObject(message, options) { + SqlInstancesPointInTimeRestoreRequest.toObject = function toObject(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.context = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.context != null && message.hasOwnProperty("context")) - object.context = $root.google.cloud.sql.v1.PointInTimeRestoreContext.toObject(message.context, options); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + object.context = $root.google.cloud.sql.v1.PointInTimeRestoreContext.toObject(message.context, options, q + 1); return object; }; @@ -61363,7 +63167,7 @@ * @variation 1 */ Object.defineProperty(SqlConnectService.prototype.getConnectSettings = function getConnectSettings(request, callback) { - return this.rpcCall(getConnectSettings, $root.google.cloud.sql.v1.GetConnectSettingsRequest, $root.google.cloud.sql.v1.ConnectSettings, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getConnectSettings, $root.google.cloud.sql.v1.GetConnectSettingsRequest, $root.google.cloud.sql.v1.ConnectSettings, request, callback); }, "name", { value: "GetConnectSettings" }); /** @@ -61396,7 +63200,7 @@ * @variation 1 */ Object.defineProperty(SqlConnectService.prototype.generateEphemeralCert = function generateEphemeralCert(request, callback) { - return this.rpcCall(generateEphemeralCert, $root.google.cloud.sql.v1.GenerateEphemeralCertRequest, $root.google.cloud.sql.v1.GenerateEphemeralCertResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, generateEphemeralCert, $root.google.cloud.sql.v1.GenerateEphemeralCertRequest, $root.google.cloud.sql.v1.GenerateEphemeralCertResponse, request, callback); }, "name", { value: "GenerateEphemeralCert" }); /** @@ -61483,15 +63287,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectSettingsRequest.encode = function encode(message, writer) { + GetConnectSettingsRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -61505,7 +63313,7 @@ * @returns {$protobuf.Writer} Writer */ GetConnectSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -61583,13 +63391,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime, long + 1); if (error) return "readTime." + error; @@ -61608,6 +63416,8 @@ GetConnectSettingsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.GetConnectSettingsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.GetConnectSettingsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -61618,7 +63428,7 @@ if (object.project != null) message.project = String(object.project); if (object.readTime != null) { - if (typeof object.readTime !== "object") + if (!$util.isObject(object.readTime)) throw TypeError(".google.cloud.sql.v1.GetConnectSettingsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime, long + 1); } @@ -61634,21 +63444,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetConnectSettingsRequest.toObject = function toObject(message, options) { + GetConnectSettingsRequest.toObject = function toObject(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 = ""; object.project = ""; object.readTime = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options, q + 1); return object; }; @@ -61865,16 +63679,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectSettings.encode = function encode(message, writer) { + ConnectSettings.encode = function encode(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.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) - $root.google.cloud.sql.v1.SslCert.encode(message.serverCaCert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.serverCaCert, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.region != null && Object.hasOwnProperty.call(message, "region")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.region); if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) @@ -61892,7 +63710,7 @@ writer.uint32(/* id 37, wireType 2 =*/298).string(message.customSubjectAlternativeNames[i]); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); if (message.mdxProtocolSupport != null && message.mdxProtocolSupport.length) { writer.uint32(/* id 39, wireType 2 =*/314).fork(); for (var i = 0; i < message.mdxProtocolSupport.length; ++i) @@ -61903,7 +63721,7 @@ writer.uint32(/* id 63, wireType 0 =*/504).int32(message.nodeCount); if (message.nodes != null && message.nodes.length) for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + $root.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork(), q + 1).ldelim(); return writer; }; @@ -61917,7 +63735,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -62055,15 +63873,15 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.serverCaCert != null && message.hasOwnProperty("serverCaCert")) { + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) { var error = $root.google.cloud.sql.v1.SslCert.verify(message.serverCaCert, long + 1); if (error) return "serverCaCert." + error; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -62072,10 +63890,10 @@ return "ipAddresses." + error; } } - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -62136,7 +63954,7 @@ case 551: break; } - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) switch (message.backendType) { default: return "backendType: enum value expected"; @@ -62146,13 +63964,13 @@ case 3: break; } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) if (typeof message.pscEnabled !== "boolean") return "pscEnabled: boolean expected"; - if (message.dnsName != null && message.hasOwnProperty("dnsName")) + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) if (!$util.isString(message.dnsName)) return "dnsName: string expected"; - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) switch (message.serverCaMode) { default: return "serverCaMode: enum value expected"; @@ -62162,14 +63980,14 @@ case 3: break; } - if (message.customSubjectAlternativeNames != null && message.hasOwnProperty("customSubjectAlternativeNames")) { + if (message.customSubjectAlternativeNames != null && Object.hasOwnProperty.call(message, "customSubjectAlternativeNames")) { if (!Array.isArray(message.customSubjectAlternativeNames)) return "customSubjectAlternativeNames: array expected"; for (var i = 0; i < message.customSubjectAlternativeNames.length; ++i) if (!$util.isString(message.customSubjectAlternativeNames[i])) return "customSubjectAlternativeNames: string[] expected"; } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -62178,12 +63996,12 @@ return "dnsNames." + error; } } - 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.nodes != null && message.hasOwnProperty("nodes")) { + if (message.nodes != null && Object.hasOwnProperty.call(message, "nodes")) { if (!Array.isArray(message.nodes)) return "nodes: array expected"; for (var i = 0; i < message.nodes.length; ++i) { @@ -62192,7 +64010,7 @@ return "nodes." + error; } } - if (message.mdxProtocolSupport != null && message.hasOwnProperty("mdxProtocolSupport")) { + if (message.mdxProtocolSupport != null && Object.hasOwnProperty.call(message, "mdxProtocolSupport")) { if (!Array.isArray(message.mdxProtocolSupport)) return "mdxProtocolSupport: array expected"; for (var i = 0; i < message.mdxProtocolSupport.length; ++i) @@ -62218,6 +64036,8 @@ ConnectSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ConnectSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ConnectSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -62226,7 +64046,7 @@ if (object.kind != null) message.kind = String(object.kind); if (object.serverCaCert != null) { - if (typeof object.serverCaCert !== "object") + if (!$util.isObject(object.serverCaCert)) throw TypeError(".google.cloud.sql.v1.ConnectSettings.serverCaCert: object expected"); message.serverCaCert = $root.google.cloud.sql.v1.SslCert.fromObject(object.serverCaCert, long + 1); } @@ -62235,7 +64055,7 @@ throw TypeError(".google.cloud.sql.v1.ConnectSettings.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1.ConnectSettings.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1.IpMapping.fromObject(object.ipAddresses[i], long + 1); } @@ -62534,7 +64354,7 @@ throw TypeError(".google.cloud.sql.v1.ConnectSettings.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1.ConnectSettings.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -62546,7 +64366,7 @@ throw TypeError(".google.cloud.sql.v1.ConnectSettings.nodes: array expected"); message.nodes = []; for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") + if (!$util.isObject(object.nodes[i])) throw TypeError(".google.cloud.sql.v1.ConnectSettings.nodes: object expected"); message.nodes[i] = $root.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.fromObject(object.nodes[i], long + 1); } @@ -62584,9 +64404,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectSettings.toObject = function toObject(message, options) { + ConnectSettings.toObject = function toObject(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.ipAddresses = []; @@ -62605,26 +64429,26 @@ object.dnsName = ""; object.serverCaMode = options.enums === String ? "CA_MODE_UNSPECIFIED" : 0; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) - object.serverCaCert = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCaCert, options); + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) + object.serverCaCert = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCaCert, options, q + 1); if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) object.backendType = options.enums === String ? $root.google.cloud.sql.v1.SqlBackendType[message.backendType] === undefined ? message.backendType : $root.google.cloud.sql.v1.SqlBackendType[message.backendType] : message.backendType; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) object.pscEnabled = message.pscEnabled; - if (message.dnsName != null && message.hasOwnProperty("dnsName")) + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) object.dnsName = message.dnsName; - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) object.serverCaMode = options.enums === String ? $root.google.cloud.sql.v1.ConnectSettings.CaMode[message.serverCaMode] === undefined ? message.serverCaMode : $root.google.cloud.sql.v1.ConnectSettings.CaMode[message.serverCaMode] : message.serverCaMode; if (message.customSubjectAlternativeNames && message.customSubjectAlternativeNames.length) { object.customSubjectAlternativeNames = []; @@ -62634,14 +64458,14 @@ if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } if (message.mdxProtocolSupport && message.mdxProtocolSupport.length) { object.mdxProtocolSupport = []; for (var j = 0; j < message.mdxProtocolSupport.length; ++j) object.mdxProtocolSupport[j] = options.enums === String ? $root.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport[message.mdxProtocolSupport[j]] === undefined ? message.mdxProtocolSupport[j] : $root.google.cloud.sql.v1.ConnectSettings.MdxProtocolSupport[message.mdxProtocolSupport[j]] : message.mdxProtocolSupport[j]; } - 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"; @@ -62649,7 +64473,7 @@ if (message.nodes && message.nodes.length) { object.nodes = []; for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.toObject(message.nodes[j], options); + object.nodes[j] = $root.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.toObject(message.nodes[j], options, q + 1); } return object; }; @@ -62795,19 +64619,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectPoolNodeConfig.encode = function encode(message, writer) { + ConnectPoolNodeConfig.encode = function encode(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.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.dnsName); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -62821,7 +64649,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectPoolNodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -62908,12 +64736,12 @@ 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")) { properties._name = 1; if (!$util.isString(message.name)) return "name: string expected"; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -62922,12 +64750,12 @@ return "ipAddresses." + error; } } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { properties._dnsName = 1; if (!$util.isString(message.dnsName)) return "dnsName: string expected"; } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -62950,6 +64778,8 @@ ConnectPoolNodeConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -62962,7 +64792,7 @@ throw TypeError(".google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1.IpMapping.fromObject(object.ipAddresses[i], long + 1); } @@ -62974,7 +64804,7 @@ throw TypeError(".google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1.ConnectSettings.ConnectPoolNodeConfig.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -62991,15 +64821,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectPoolNodeConfig.toObject = function toObject(message, options) { + ConnectPoolNodeConfig.toObject = function toObject(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.ipAddresses = []; object.dnsNames = []; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { object.name = message.name; if (options.oneofs) object._name = "name"; @@ -63007,9 +64841,9 @@ if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { object.dnsName = message.dnsName; if (options.oneofs) object._dnsName = "dnsName"; @@ -63017,7 +64851,7 @@ if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } return object; }; @@ -63166,9 +65000,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateEphemeralCertRequest.encode = function encode(message, writer) { + GenerateEphemeralCertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -63178,9 +65016,9 @@ if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.accessToken); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.validDuration != null && Object.hasOwnProperty.call(message, "validDuration")) - $root.google.protobuf.Duration.encode(message.validDuration, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.validDuration, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); return writer; }; @@ -63194,7 +65032,7 @@ * @returns {$protobuf.Writer} Writer */ GenerateEphemeralCertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -63284,24 +65122,24 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) if (!$util.isString(message.publicKey)) return "publicKey: string expected"; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) if (!$util.isString(message.accessToken)) return "accessToken: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime, long + 1); if (error) return "readTime." + error; } - if (message.validDuration != null && message.hasOwnProperty("validDuration")) { + if (message.validDuration != null && Object.hasOwnProperty.call(message, "validDuration")) { var error = $root.google.protobuf.Duration.verify(message.validDuration, long + 1); if (error) return "validDuration." + error; @@ -63320,6 +65158,8 @@ GenerateEphemeralCertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.GenerateEphemeralCertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.GenerateEphemeralCertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -63334,12 +65174,12 @@ if (object.accessToken != null) message.accessToken = String(object.accessToken); if (object.readTime != null) { - if (typeof object.readTime !== "object") + if (!$util.isObject(object.readTime)) throw TypeError(".google.cloud.sql.v1.GenerateEphemeralCertRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime, long + 1); } if (object.validDuration != null) { - if (typeof object.validDuration !== "object") + if (!$util.isObject(object.validDuration)) throw TypeError(".google.cloud.sql.v1.GenerateEphemeralCertRequest.validDuration: object expected"); message.validDuration = $root.google.protobuf.Duration.fromObject(object.validDuration, long + 1); } @@ -63355,9 +65195,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateEphemeralCertRequest.toObject = function toObject(message, options) { + GenerateEphemeralCertRequest.toObject = function toObject(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 = ""; @@ -63367,18 +65211,18 @@ object.readTime = null; object.validDuration = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) object.publicKey = message.publicKey; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) object.accessToken = message.accessToken; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.validDuration != null && message.hasOwnProperty("validDuration")) - object.validDuration = $root.google.protobuf.Duration.toObject(message.validDuration, options); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options, q + 1); + if (message.validDuration != null && Object.hasOwnProperty.call(message, "validDuration")) + object.validDuration = $root.google.protobuf.Duration.toObject(message.validDuration, options, q + 1); return object; }; @@ -63464,11 +65308,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateEphemeralCertResponse.encode = function encode(message, writer) { + GenerateEphemeralCertResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.ephemeralCert != null && Object.hasOwnProperty.call(message, "ephemeralCert")) - $root.google.cloud.sql.v1.SslCert.encode(message.ephemeralCert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.ephemeralCert, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -63482,7 +65330,7 @@ * @returns {$protobuf.Writer} Writer */ GenerateEphemeralCertResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -63552,7 +65400,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.ephemeralCert != null && message.hasOwnProperty("ephemeralCert")) { + if (message.ephemeralCert != null && Object.hasOwnProperty.call(message, "ephemeralCert")) { var error = $root.google.cloud.sql.v1.SslCert.verify(message.ephemeralCert, long + 1); if (error) return "ephemeralCert." + error; @@ -63571,13 +65419,15 @@ GenerateEphemeralCertResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.GenerateEphemeralCertResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.GenerateEphemeralCertResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1.GenerateEphemeralCertResponse(); if (object.ephemeralCert != null) { - if (typeof object.ephemeralCert !== "object") + if (!$util.isObject(object.ephemeralCert)) throw TypeError(".google.cloud.sql.v1.GenerateEphemeralCertResponse.ephemeralCert: object expected"); message.ephemeralCert = $root.google.cloud.sql.v1.SslCert.fromObject(object.ephemeralCert, long + 1); } @@ -63593,14 +65443,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateEphemeralCertResponse.toObject = function toObject(message, options) { + GenerateEphemeralCertResponse.toObject = function toObject(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.ephemeralCert = null; - if (message.ephemeralCert != null && message.hasOwnProperty("ephemeralCert")) - object.ephemeralCert = $root.google.cloud.sql.v1.SslCert.toObject(message.ephemeralCert, options); + if (message.ephemeralCert != null && Object.hasOwnProperty.call(message, "ephemeralCert")) + object.ephemeralCert = $root.google.cloud.sql.v1.SslCert.toObject(message.ephemeralCert, options, q + 1); return object; }; @@ -63685,7 +65539,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1.SqlDatabasesDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1.SqlDatabasesDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -63718,7 +65572,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1.SqlDatabasesGetRequest, $root.google.cloud.sql.v1.Database, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1.SqlDatabasesGetRequest, $root.google.cloud.sql.v1.Database, request, callback); }, "name", { value: "Get" }); /** @@ -63751,7 +65605,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1.SqlDatabasesInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1.SqlDatabasesInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -63784,7 +65638,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlDatabasesListRequest, $root.google.cloud.sql.v1.DatabasesListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlDatabasesListRequest, $root.google.cloud.sql.v1.DatabasesListResponse, request, callback); }, "name", { value: "List" }); /** @@ -63817,7 +65671,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.patch = function patch(request, callback) { - return this.rpcCall(patch, $root.google.cloud.sql.v1.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, patch, $root.google.cloud.sql.v1.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Patch" }); /** @@ -63850,7 +65704,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.update = function update(request, callback) { - return this.rpcCall(update, $root.google.cloud.sql.v1.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, update, $root.google.cloud.sql.v1.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Update" }); /** @@ -63937,9 +65791,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesDeleteRequest.encode = function encode(message, writer) { + SqlDatabasesDeleteRequest.encode = function encode(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.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -63959,7 +65817,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -64037,13 +65895,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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -64060,6 +65918,8 @@ SqlDatabasesDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlDatabasesDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlDatabasesDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64083,20 +65943,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesDeleteRequest.toObject = function toObject(message, options) { + SqlDatabasesDeleteRequest.toObject = function toObject(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.instance = ""; object.project = ""; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -64201,9 +66065,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesGetRequest.encode = function encode(message, writer) { + SqlDatabasesGetRequest.encode = function encode(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.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -64223,7 +66091,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -64301,13 +66169,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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -64324,6 +66192,8 @@ SqlDatabasesGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlDatabasesGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlDatabasesGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64347,20 +66217,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesGetRequest.toObject = function toObject(message, options) { + SqlDatabasesGetRequest.toObject = function toObject(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.instance = ""; object.project = ""; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -64465,15 +66339,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesInsertRequest.encode = function encode(message, writer) { + SqlDatabasesInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -64487,7 +66365,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -64565,13 +66443,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.Database.verify(message.body, long + 1); if (error) return "body." + error; @@ -64590,6 +66468,8 @@ SqlDatabasesInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlDatabasesInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlDatabasesInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64600,7 +66480,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlDatabasesInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.Database.fromObject(object.body, long + 1); } @@ -64616,21 +66496,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesInsertRequest.toObject = function toObject(message, options) { + SqlDatabasesInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.Database.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.Database.toObject(message.body, options, q + 1); return object; }; @@ -64725,9 +66609,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesListRequest.encode = function encode(message, writer) { + SqlDatabasesListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -64745,7 +66633,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -64819,10 +66707,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -64839,6 +66727,8 @@ SqlDatabasesListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlDatabasesListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlDatabasesListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -64860,17 +66750,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesListRequest.toObject = function toObject(message, options) { + SqlDatabasesListRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -64984,9 +66878,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesUpdateRequest.encode = function encode(message, writer) { + SqlDatabasesUpdateRequest.encode = function encode(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.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -64994,7 +66892,7 @@ if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -65008,7 +66906,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -65090,16 +66988,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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.Database.verify(message.body, long + 1); if (error) return "body." + error; @@ -65118,6 +67016,8 @@ SqlDatabasesUpdateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlDatabasesUpdateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlDatabasesUpdateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65130,7 +67030,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlDatabasesUpdateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.Database.fromObject(object.body, long + 1); } @@ -65146,9 +67046,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesUpdateRequest.toObject = function toObject(message, options) { + SqlDatabasesUpdateRequest.toObject = function toObject(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 = ""; @@ -65156,14 +67060,14 @@ object.project = ""; object.body = null; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.Database.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.Database.toObject(message.body, options, q + 1); return object; }; @@ -65259,14 +67163,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabasesListResponse.encode = function encode(message, writer) { + DatabasesListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.Database.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.Database.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -65280,7 +67188,7 @@ * @returns {$protobuf.Writer} Writer */ DatabasesListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -65356,10 +67264,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -65382,6 +67290,8 @@ DatabasesListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.DatabasesListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.DatabasesListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65394,7 +67304,7 @@ throw TypeError(".google.cloud.sql.v1.DatabasesListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.DatabasesListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.Database.fromObject(object.items[i], long + 1); } @@ -65411,20 +67321,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabasesListResponse.toObject = function toObject(message, options) { + DatabasesListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.Database.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.Database.toObject(message.items[j], options, q + 1); } return object; }; @@ -65580,7 +67494,7 @@ * @variation 1 */ Object.defineProperty(SqlFlagsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlFlagsListRequest, $root.google.cloud.sql.v1.FlagsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlFlagsListRequest, $root.google.cloud.sql.v1.FlagsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -65667,9 +67581,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlFlagsListRequest.encode = function encode(message, writer) { + SqlFlagsListRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.databaseVersion); if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) @@ -65687,7 +67605,7 @@ * @returns {$protobuf.Writer} Writer */ SqlFlagsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -65762,10 +67680,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) if (!$util.isString(message.databaseVersion)) return "databaseVersion: string expected"; - if (message.flagScope != null && message.hasOwnProperty("flagScope")) { + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) { properties._flagScope = 1; switch (message.flagScope) { default: @@ -65790,6 +67708,8 @@ SqlFlagsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlFlagsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlFlagsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -65829,15 +67749,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlFlagsListRequest.toObject = function toObject(message, options) { + SqlFlagsListRequest.toObject = function toObject(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.databaseVersion = ""; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = message.databaseVersion; - if (message.flagScope != null && message.hasOwnProperty("flagScope")) { + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) { object.flagScope = options.enums === String ? $root.google.cloud.sql.v1.SqlFlagScope[message.flagScope] === undefined ? message.flagScope : $root.google.cloud.sql.v1.SqlFlagScope[message.flagScope] : message.flagScope; if (options.oneofs) object._flagScope = "flagScope"; @@ -65937,14 +67861,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FlagsListResponse.encode = function encode(message, writer) { + FlagsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.Flag.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.Flag.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -65958,7 +67886,7 @@ * @returns {$protobuf.Writer} Writer */ FlagsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -66034,10 +67962,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -66060,6 +67988,8 @@ FlagsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.FlagsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.FlagsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66072,7 +68002,7 @@ throw TypeError(".google.cloud.sql.v1.FlagsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.FlagsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.Flag.fromObject(object.items[i], long + 1); } @@ -66089,20 +68019,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FlagsListResponse.toObject = function toObject(message, options) { + FlagsListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.Flag.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.Flag.toObject(message.items[j], options, q + 1); } return object; }; @@ -66314,9 +68248,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Flag.encode = function encode(message, writer) { + Flag.encode = function encode(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")) @@ -66331,15 +68269,15 @@ for (var i = 0; i < message.allowedStringValues.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedStringValues[i]); if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.requiresRestart != null && Object.hasOwnProperty.call(message, "requiresRestart")) - $root.google.protobuf.BoolValue.encode(message.requiresRestart, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.requiresRestart, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.kind); if (message.inBeta != null && Object.hasOwnProperty.call(message, "inBeta")) - $root.google.protobuf.BoolValue.encode(message.inBeta, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.inBeta, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.allowedIntValues != null && message.allowedIntValues.length) { writer.uint32(/* id 10, wireType 2 =*/82).fork(); for (var i = 0; i < message.allowedIntValues.length; ++i) @@ -66351,7 +68289,7 @@ if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) writer.uint32(/* id 16, wireType 2 =*/130).string(message.recommendedStringValue); if (message.recommendedIntValue != null && Object.hasOwnProperty.call(message, "recommendedIntValue")) - $root.google.protobuf.Int64Value.encode(message.recommendedIntValue, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.recommendedIntValue, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); return writer; }; @@ -66365,7 +68303,7 @@ * @returns {$protobuf.Writer} Writer */ Flag.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -66500,10 +68438,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.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) switch (message.type) { default: return "type: enum value expected"; @@ -66517,7 +68455,7 @@ case 7: break; } - if (message.appliesTo != null && message.hasOwnProperty("appliesTo")) { + if (message.appliesTo != null && Object.hasOwnProperty.call(message, "appliesTo")) { if (!Array.isArray(message.appliesTo)) return "appliesTo: array expected"; for (var i = 0; i < message.appliesTo.length; ++i) @@ -66582,44 +68520,44 @@ break; } } - if (message.allowedStringValues != null && message.hasOwnProperty("allowedStringValues")) { + if (message.allowedStringValues != null && Object.hasOwnProperty.call(message, "allowedStringValues")) { if (!Array.isArray(message.allowedStringValues)) return "allowedStringValues: array expected"; for (var i = 0; i < message.allowedStringValues.length; ++i) if (!$util.isString(message.allowedStringValues[i])) return "allowedStringValues: string[] expected"; } - if (message.minValue != null && message.hasOwnProperty("minValue")) { + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) { var error = $root.google.protobuf.Int64Value.verify(message.minValue, long + 1); if (error) return "minValue." + error; } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) { var error = $root.google.protobuf.Int64Value.verify(message.maxValue, long + 1); if (error) return "maxValue." + error; } - if (message.requiresRestart != null && message.hasOwnProperty("requiresRestart")) { + if (message.requiresRestart != null && Object.hasOwnProperty.call(message, "requiresRestart")) { var error = $root.google.protobuf.BoolValue.verify(message.requiresRestart, long + 1); if (error) return "requiresRestart." + error; } - 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.inBeta != null && message.hasOwnProperty("inBeta")) { + if (message.inBeta != null && Object.hasOwnProperty.call(message, "inBeta")) { var error = $root.google.protobuf.BoolValue.verify(message.inBeta, long + 1); if (error) return "inBeta." + error; } - if (message.allowedIntValues != null && message.hasOwnProperty("allowedIntValues")) { + if (message.allowedIntValues != null && Object.hasOwnProperty.call(message, "allowedIntValues")) { if (!Array.isArray(message.allowedIntValues)) return "allowedIntValues: array expected"; for (var i = 0; i < message.allowedIntValues.length; ++i) if (!$util.isInteger(message.allowedIntValues[i]) && !(message.allowedIntValues[i] && $util.isInteger(message.allowedIntValues[i].low) && $util.isInteger(message.allowedIntValues[i].high))) return "allowedIntValues: integer|Long[] expected"; } - if (message.flagScope != null && message.hasOwnProperty("flagScope")) + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) switch (message.flagScope) { default: return "flagScope: enum value expected"; @@ -66628,12 +68566,12 @@ case 2: break; } - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) { properties.recommendedValue = 1; if (!$util.isString(message.recommendedStringValue)) return "recommendedStringValue: string expected"; } - if (message.recommendedIntValue != null && message.hasOwnProperty("recommendedIntValue")) { + if (message.recommendedIntValue != null && Object.hasOwnProperty.call(message, "recommendedIntValue")) { if (properties.recommendedValue === 1) return "recommendedValue: multiple values"; properties.recommendedValue = 1; @@ -66657,6 +68595,8 @@ Flag.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Flag) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Flag: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -66945,24 +68885,24 @@ message.allowedStringValues[i] = String(object.allowedStringValues[i]); } if (object.minValue != null) { - if (typeof object.minValue !== "object") + if (!$util.isObject(object.minValue)) throw TypeError(".google.cloud.sql.v1.Flag.minValue: object expected"); message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue, long + 1); } if (object.maxValue != null) { - if (typeof object.maxValue !== "object") + if (!$util.isObject(object.maxValue)) throw TypeError(".google.cloud.sql.v1.Flag.maxValue: object expected"); message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue, long + 1); } if (object.requiresRestart != null) { - if (typeof object.requiresRestart !== "object") + if (!$util.isObject(object.requiresRestart)) throw TypeError(".google.cloud.sql.v1.Flag.requiresRestart: object expected"); message.requiresRestart = $root.google.protobuf.BoolValue.fromObject(object.requiresRestart, long + 1); } if (object.kind != null) message.kind = String(object.kind); if (object.inBeta != null) { - if (typeof object.inBeta !== "object") + if (!$util.isObject(object.inBeta)) throw TypeError(".google.cloud.sql.v1.Flag.inBeta: object expected"); message.inBeta = $root.google.protobuf.BoolValue.fromObject(object.inBeta, long + 1); } @@ -66972,7 +68912,7 @@ message.allowedIntValues = []; for (var i = 0; i < object.allowedIntValues.length; ++i) if ($util.Long) - (message.allowedIntValues[i] = $util.Long.fromValue(object.allowedIntValues[i])).unsigned = false; + message.allowedIntValues[i] = $util.Long.fromValue(object.allowedIntValues[i], false); else if (typeof object.allowedIntValues[i] === "string") message.allowedIntValues[i] = parseInt(object.allowedIntValues[i], 10); else if (typeof object.allowedIntValues[i] === "number") @@ -67003,7 +68943,7 @@ if (object.recommendedStringValue != null) message.recommendedStringValue = String(object.recommendedStringValue); if (object.recommendedIntValue != null) { - if (typeof object.recommendedIntValue !== "object") + if (!$util.isObject(object.recommendedIntValue)) throw TypeError(".google.cloud.sql.v1.Flag.recommendedIntValue: object expected"); message.recommendedIntValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntValue, long + 1); } @@ -67019,9 +68959,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Flag.toObject = function toObject(message, options) { + Flag.toObject = function toObject(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.appliesTo = []; @@ -67038,9 +68982,9 @@ object.inBeta = null; object.flagScope = options.enums === String ? "SQL_FLAG_SCOPE_UNSPECIFIED" : 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 = options.enums === String ? $root.google.cloud.sql.v1.SqlFlagType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1.SqlFlagType[message.type] : message.type; if (message.appliesTo && message.appliesTo.length) { object.appliesTo = []; @@ -67052,33 +68996,35 @@ for (var j = 0; j < message.allowedStringValues.length; ++j) object.allowedStringValues[j] = message.allowedStringValues[j]; } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); - if (message.requiresRestart != null && message.hasOwnProperty("requiresRestart")) - object.requiresRestart = $root.google.protobuf.BoolValue.toObject(message.requiresRestart, options); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options, q + 1); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options, q + 1); + if (message.requiresRestart != null && Object.hasOwnProperty.call(message, "requiresRestart")) + object.requiresRestart = $root.google.protobuf.BoolValue.toObject(message.requiresRestart, options, q + 1); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.inBeta != null && message.hasOwnProperty("inBeta")) - object.inBeta = $root.google.protobuf.BoolValue.toObject(message.inBeta, options); + if (message.inBeta != null && Object.hasOwnProperty.call(message, "inBeta")) + object.inBeta = $root.google.protobuf.BoolValue.toObject(message.inBeta, options, q + 1); if (message.allowedIntValues && message.allowedIntValues.length) { object.allowedIntValues = []; for (var j = 0; j < message.allowedIntValues.length; ++j) - if (typeof message.allowedIntValues[j] === "number") + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.allowedIntValues[j] = typeof message.allowedIntValues[j] === "number" ? BigInt(message.allowedIntValues[j]) : $util.Long.fromBits(message.allowedIntValues[j].low >>> 0, message.allowedIntValues[j].high >>> 0, false).toBigInt(); + else if (typeof message.allowedIntValues[j] === "number") object.allowedIntValues[j] = options.longs === String ? String(message.allowedIntValues[j]) : message.allowedIntValues[j]; else object.allowedIntValues[j] = options.longs === String ? $util.Long.prototype.toString.call(message.allowedIntValues[j]) : options.longs === Number ? new $util.LongBits(message.allowedIntValues[j].low >>> 0, message.allowedIntValues[j].high >>> 0).toNumber() : message.allowedIntValues[j]; } - if (message.flagScope != null && message.hasOwnProperty("flagScope")) + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) object.flagScope = options.enums === String ? $root.google.cloud.sql.v1.SqlFlagScope[message.flagScope] === undefined ? message.flagScope : $root.google.cloud.sql.v1.SqlFlagScope[message.flagScope] : message.flagScope; - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) { object.recommendedStringValue = message.recommendedStringValue; if (options.oneofs) object.recommendedValue = "recommendedStringValue"; } - if (message.recommendedIntValue != null && message.hasOwnProperty("recommendedIntValue")) { - object.recommendedIntValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntValue, options); + if (message.recommendedIntValue != null && Object.hasOwnProperty.call(message, "recommendedIntValue")) { + object.recommendedIntValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntValue, options, q + 1); if (options.oneofs) object.recommendedValue = "recommendedIntValue"; } @@ -67278,7 +69224,7 @@ * @variation 1 */ Object.defineProperty(SqlOperationsService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1.SqlOperationsGetRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1.SqlOperationsGetRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Get" }); /** @@ -67311,7 +69257,7 @@ * @variation 1 */ Object.defineProperty(SqlOperationsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlOperationsListRequest, $root.google.cloud.sql.v1.OperationsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlOperationsListRequest, $root.google.cloud.sql.v1.OperationsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -67344,7 +69290,7 @@ * @variation 1 */ Object.defineProperty(SqlOperationsService.prototype.cancel = function cancel(request, callback) { - return this.rpcCall(cancel, $root.google.cloud.sql.v1.SqlOperationsCancelRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, cancel, $root.google.cloud.sql.v1.SqlOperationsCancelRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "Cancel" }); /** @@ -67422,9 +69368,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOperationsGetRequest.encode = function encode(message, writer) { + SqlOperationsGetRequest.encode = function encode(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); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -67442,7 +69392,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOperationsGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -67516,10 +69466,10 @@ 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"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -67536,6 +69486,8 @@ SqlOperationsGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlOperationsGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlOperationsGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -67557,17 +69509,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOperationsGetRequest.toObject = function toObject(message, options) { + SqlOperationsGetRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) object.operation = message.operation; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -67681,9 +69637,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOperationsListRequest.encode = function encode(message, writer) { + SqlOperationsListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) @@ -67705,7 +69665,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOperationsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -67787,16 +69747,16 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) if (!$util.isInteger(message.maxResults)) return "maxResults: 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -67813,6 +69773,8 @@ SqlOperationsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlOperationsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlOperationsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -67838,9 +69800,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOperationsListRequest.toObject = function toObject(message, options) { + SqlOperationsListRequest.toObject = function toObject(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 = ""; @@ -67848,13 +69814,13 @@ object.pageToken = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) object.maxResults = message.maxResults; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -67960,14 +69926,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationsListResponse.encode = function encode(message, writer) { + OperationsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.Operation.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.Operation.encode(message.items[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); return writer; @@ -67983,7 +69953,7 @@ * @returns {$protobuf.Writer} Writer */ OperationsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -68063,10 +70033,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -68075,7 +70045,7 @@ return "items." + 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; @@ -68092,6 +70062,8 @@ OperationsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.OperationsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.OperationsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68104,7 +70076,7 @@ throw TypeError(".google.cloud.sql.v1.OperationsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.OperationsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.Operation.fromObject(object.items[i], long + 1); } @@ -68123,9 +70095,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationsListResponse.toObject = function toObject(message, options) { + OperationsListResponse.toObject = function toObject(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.items = []; @@ -68133,14 +70109,14 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.Operation.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.Operation.toObject(message.items[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; }; @@ -68236,9 +70212,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOperationsCancelRequest.encode = function encode(message, writer) { + SqlOperationsCancelRequest.encode = function encode(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); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -68256,7 +70236,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOperationsCancelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -68330,10 +70310,10 @@ 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"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -68350,6 +70330,8 @@ SqlOperationsCancelRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlOperationsCancelRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlOperationsCancelRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68371,17 +70353,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOperationsCancelRequest.toObject = function toObject(message, options) { + SqlOperationsCancelRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) object.operation = message.operation; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -68502,7 +70488,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1.SqlSslCertsDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1.SqlSslCertsDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -68535,7 +70521,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1.SqlSslCertsGetRequest, $root.google.cloud.sql.v1.SslCert, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1.SqlSslCertsGetRequest, $root.google.cloud.sql.v1.SslCert, request, callback); }, "name", { value: "Get" }); /** @@ -68568,7 +70554,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1.SqlSslCertsInsertRequest, $root.google.cloud.sql.v1.SslCertsInsertResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1.SqlSslCertsInsertRequest, $root.google.cloud.sql.v1.SslCertsInsertResponse, request, callback); }, "name", { value: "Insert" }); /** @@ -68601,7 +70587,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlSslCertsListRequest, $root.google.cloud.sql.v1.SslCertsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlSslCertsListRequest, $root.google.cloud.sql.v1.SslCertsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -68688,9 +70674,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsDeleteRequest.encode = function encode(message, writer) { + SqlSslCertsDeleteRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -68710,7 +70700,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -68788,13 +70778,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) if (!$util.isString(message.sha1Fingerprint)) return "sha1Fingerprint: string expected"; return null; @@ -68811,6 +70801,8 @@ SqlSslCertsDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlSslCertsDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlSslCertsDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -68834,20 +70826,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsDeleteRequest.toObject = function toObject(message, options) { + SqlSslCertsDeleteRequest.toObject = function toObject(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 = ""; object.project = ""; object.sha1Fingerprint = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) object.sha1Fingerprint = message.sha1Fingerprint; return object; }; @@ -68952,9 +70948,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsGetRequest.encode = function encode(message, writer) { + SqlSslCertsGetRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -68974,7 +70974,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -69052,13 +71052,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) if (!$util.isString(message.sha1Fingerprint)) return "sha1Fingerprint: string expected"; return null; @@ -69075,6 +71075,8 @@ SqlSslCertsGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlSslCertsGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlSslCertsGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69098,20 +71100,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsGetRequest.toObject = function toObject(message, options) { + SqlSslCertsGetRequest.toObject = function toObject(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 = ""; object.project = ""; object.sha1Fingerprint = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) object.sha1Fingerprint = message.sha1Fingerprint; return object; }; @@ -69216,15 +71222,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsInsertRequest.encode = function encode(message, writer) { + SqlSslCertsInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.SslCertsInsertRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCertsInsertRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -69238,7 +71248,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -69316,13 +71326,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.SslCertsInsertRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -69341,6 +71351,8 @@ SqlSslCertsInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlSslCertsInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlSslCertsInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69351,7 +71363,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlSslCertsInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.SslCertsInsertRequest.fromObject(object.body, long + 1); } @@ -69367,21 +71379,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsInsertRequest.toObject = function toObject(message, options) { + SqlSslCertsInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.SslCertsInsertRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.SslCertsInsertRequest.toObject(message.body, options, q + 1); return object; }; @@ -69476,9 +71492,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsListRequest.encode = function encode(message, writer) { + SqlSslCertsListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -69496,7 +71516,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -69570,10 +71590,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -69590,6 +71610,8 @@ SqlSslCertsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlSslCertsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlSslCertsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69611,17 +71633,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsListRequest.toObject = function toObject(message, options) { + SqlSslCertsListRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -69708,9 +71734,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsInsertRequest.encode = function encode(message, writer) { + SslCertsInsertRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.commonName); return writer; @@ -69726,7 +71756,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -69796,7 +71826,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.commonName != null && message.hasOwnProperty("commonName")) + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) if (!$util.isString(message.commonName)) return "commonName: string expected"; return null; @@ -69813,6 +71843,8 @@ SslCertsInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SslCertsInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SslCertsInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -69832,13 +71864,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsInsertRequest.toObject = function toObject(message, options) { + SslCertsInsertRequest.toObject = function toObject(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.commonName = ""; - if (message.commonName != null && message.hasOwnProperty("commonName")) + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) object.commonName = message.commonName; return object; }; @@ -69952,17 +71988,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsInsertResponse.encode = function encode(message, writer) { + SslCertsInsertResponse.encode = function encode(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.operation != null && Object.hasOwnProperty.call(message, "operation")) - $root.google.cloud.sql.v1.Operation.encode(message.operation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.Operation.encode(message.operation, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) - $root.google.cloud.sql.v1.SslCert.encode(message.serverCaCert, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.serverCaCert, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.clientCert != null && Object.hasOwnProperty.call(message, "clientCert")) - $root.google.cloud.sql.v1.SslCertDetail.encode(message.clientCert, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCertDetail.encode(message.clientCert, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -69976,7 +72016,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsInsertResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70058,20 +72098,20 @@ 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.operation != null && message.hasOwnProperty("operation")) { + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) { var error = $root.google.cloud.sql.v1.Operation.verify(message.operation, long + 1); if (error) return "operation." + error; } - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) { + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) { var error = $root.google.cloud.sql.v1.SslCert.verify(message.serverCaCert, long + 1); if (error) return "serverCaCert." + error; } - if (message.clientCert != null && message.hasOwnProperty("clientCert")) { + if (message.clientCert != null && Object.hasOwnProperty.call(message, "clientCert")) { var error = $root.google.cloud.sql.v1.SslCertDetail.verify(message.clientCert, long + 1); if (error) return "clientCert." + error; @@ -70090,6 +72130,8 @@ SslCertsInsertResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SslCertsInsertResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SslCertsInsertResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70098,17 +72140,17 @@ if (object.kind != null) message.kind = String(object.kind); if (object.operation != null) { - if (typeof object.operation !== "object") + if (!$util.isObject(object.operation)) throw TypeError(".google.cloud.sql.v1.SslCertsInsertResponse.operation: object expected"); message.operation = $root.google.cloud.sql.v1.Operation.fromObject(object.operation, long + 1); } if (object.serverCaCert != null) { - if (typeof object.serverCaCert !== "object") + if (!$util.isObject(object.serverCaCert)) throw TypeError(".google.cloud.sql.v1.SslCertsInsertResponse.serverCaCert: object expected"); message.serverCaCert = $root.google.cloud.sql.v1.SslCert.fromObject(object.serverCaCert, long + 1); } if (object.clientCert != null) { - if (typeof object.clientCert !== "object") + if (!$util.isObject(object.clientCert)) throw TypeError(".google.cloud.sql.v1.SslCertsInsertResponse.clientCert: object expected"); message.clientCert = $root.google.cloud.sql.v1.SslCertDetail.fromObject(object.clientCert, long + 1); } @@ -70124,9 +72166,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsInsertResponse.toObject = function toObject(message, options) { + SslCertsInsertResponse.toObject = function toObject(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 = ""; @@ -70134,14 +72180,14 @@ object.serverCaCert = null; object.clientCert = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = $root.google.cloud.sql.v1.Operation.toObject(message.operation, options); - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) - object.serverCaCert = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCaCert, options); - if (message.clientCert != null && message.hasOwnProperty("clientCert")) - object.clientCert = $root.google.cloud.sql.v1.SslCertDetail.toObject(message.clientCert, options); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + object.operation = $root.google.cloud.sql.v1.Operation.toObject(message.operation, options, q + 1); + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) + object.serverCaCert = $root.google.cloud.sql.v1.SslCert.toObject(message.serverCaCert, options, q + 1); + if (message.clientCert != null && Object.hasOwnProperty.call(message, "clientCert")) + object.clientCert = $root.google.cloud.sql.v1.SslCertDetail.toObject(message.clientCert, options, q + 1); return object; }; @@ -70237,14 +72283,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsListResponse.encode = function encode(message, writer) { + SslCertsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.SslCert.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.SslCert.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -70258,7 +72308,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70334,10 +72384,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -70360,6 +72410,8 @@ SslCertsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SslCertsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SslCertsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70372,7 +72424,7 @@ throw TypeError(".google.cloud.sql.v1.SslCertsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.SslCertsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.SslCert.fromObject(object.items[i], long + 1); } @@ -70389,20 +72441,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsListResponse.toObject = function toObject(message, options) { + SslCertsListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.SslCert.toObject(message.items[j], options, q + 1); } return object; }; @@ -70488,7 +72544,7 @@ * @variation 1 */ Object.defineProperty(SqlTiersService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlTiersListRequest, $root.google.cloud.sql.v1.TiersListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlTiersListRequest, $root.google.cloud.sql.v1.TiersListResponse, request, callback); }, "name", { value: "List" }); /** @@ -70557,9 +72613,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlTiersListRequest.encode = function encode(message, writer) { + SqlTiersListRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); return writer; @@ -70575,7 +72635,7 @@ * @returns {$protobuf.Writer} Writer */ SqlTiersListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70645,7 +72705,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -70662,6 +72722,8 @@ SqlTiersListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlTiersListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlTiersListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70681,13 +72743,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlTiersListRequest.toObject = function toObject(message, options) { + SqlTiersListRequest.toObject = function toObject(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.project = ""; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -70784,14 +72850,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TiersListResponse.encode = function encode(message, writer) { + TiersListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.Tier.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.Tier.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -70805,7 +72875,7 @@ * @returns {$protobuf.Writer} Writer */ TiersListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -70881,10 +72951,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -70907,6 +72977,8 @@ TiersListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.TiersListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.TiersListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -70919,7 +72991,7 @@ throw TypeError(".google.cloud.sql.v1.TiersListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.TiersListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.Tier.fromObject(object.items[i], long + 1); } @@ -70936,20 +73008,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TiersListResponse.toObject = function toObject(message, options) { + TiersListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.Tier.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.Tier.toObject(message.items[j], options, q + 1); } return object; }; @@ -71073,9 +73149,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tier.encode = function encode(message, writer) { + Tier.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.tier); if (message.RAM != null && Object.hasOwnProperty.call(message, "RAM")) @@ -71100,7 +73180,7 @@ * @returns {$protobuf.Writer} Writer */ Tier.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -71188,19 +73268,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) if (!$util.isString(message.tier)) return "tier: string expected"; - if (message.RAM != null && message.hasOwnProperty("RAM")) + if (message.RAM != null && Object.hasOwnProperty.call(message, "RAM")) if (!$util.isInteger(message.RAM) && !(message.RAM && $util.isInteger(message.RAM.low) && $util.isInteger(message.RAM.high))) return "RAM: integer|Long expected"; - 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.Disk_Quota != null && message.hasOwnProperty("Disk_Quota")) + if (message.Disk_Quota != null && Object.hasOwnProperty.call(message, "Disk_Quota")) if (!$util.isInteger(message.Disk_Quota) && !(message.Disk_Quota && $util.isInteger(message.Disk_Quota.low) && $util.isInteger(message.Disk_Quota.high))) return "Disk_Quota: integer|Long expected"; - if (message.region != null && message.hasOwnProperty("region")) { + if (message.region != null && Object.hasOwnProperty.call(message, "region")) { if (!Array.isArray(message.region)) return "region: array expected"; for (var i = 0; i < message.region.length; ++i) @@ -71221,6 +73301,8 @@ Tier.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.Tier) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.Tier: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -71230,7 +73312,7 @@ message.tier = String(object.tier); if (object.RAM != null) if ($util.Long) - (message.RAM = $util.Long.fromValue(object.RAM)).unsigned = false; + message.RAM = $util.Long.fromValue(object.RAM, false); else if (typeof object.RAM === "string") message.RAM = parseInt(object.RAM, 10); else if (typeof object.RAM === "number") @@ -71241,7 +73323,7 @@ message.kind = String(object.kind); if (object.Disk_Quota != null) if ($util.Long) - (message.Disk_Quota = $util.Long.fromValue(object.Disk_Quota)).unsigned = false; + message.Disk_Quota = $util.Long.fromValue(object.Disk_Quota, false); else if (typeof object.Disk_Quota === "string") message.Disk_Quota = parseInt(object.Disk_Quota, 10); else if (typeof object.Disk_Quota === "number") @@ -71267,9 +73349,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Tier.toObject = function toObject(message, options) { + Tier.toObject = function toObject(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.region = []; @@ -71277,27 +73363,31 @@ object.tier = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.RAM = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.RAM = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.RAM = options.longs === String ? "0" : 0; + object.RAM = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.Disk_Quota = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.Disk_Quota = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.Disk_Quota = options.longs === String ? "0" : 0; + object.Disk_Quota = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; } - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) object.tier = message.tier; - if (message.RAM != null && message.hasOwnProperty("RAM")) - if (typeof message.RAM === "number") + if (message.RAM != null && Object.hasOwnProperty.call(message, "RAM")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.RAM = typeof message.RAM === "number" ? BigInt(message.RAM) : $util.Long.fromBits(message.RAM.low >>> 0, message.RAM.high >>> 0, false).toBigInt(); + else if (typeof message.RAM === "number") object.RAM = options.longs === String ? String(message.RAM) : message.RAM; else object.RAM = options.longs === String ? $util.Long.prototype.toString.call(message.RAM) : options.longs === Number ? new $util.LongBits(message.RAM.low >>> 0, message.RAM.high >>> 0).toNumber() : message.RAM; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.Disk_Quota != null && message.hasOwnProperty("Disk_Quota")) - if (typeof message.Disk_Quota === "number") + if (message.Disk_Quota != null && Object.hasOwnProperty.call(message, "Disk_Quota")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.Disk_Quota = typeof message.Disk_Quota === "number" ? BigInt(message.Disk_Quota) : $util.Long.fromBits(message.Disk_Quota.low >>> 0, message.Disk_Quota.high >>> 0, false).toBigInt(); + else if (typeof message.Disk_Quota === "number") object.Disk_Quota = options.longs === String ? String(message.Disk_Quota) : message.Disk_Quota; else object.Disk_Quota = options.longs === String ? $util.Long.prototype.toString.call(message.Disk_Quota) : options.longs === Number ? new $util.LongBits(message.Disk_Quota.low >>> 0, message.Disk_Quota.high >>> 0).toNumber() : message.Disk_Quota; @@ -71390,7 +73480,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1.SqlUsersDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1.SqlUsersDeleteRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -71423,7 +73513,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1.SqlUsersGetRequest, $root.google.cloud.sql.v1.User, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1.SqlUsersGetRequest, $root.google.cloud.sql.v1.User, request, callback); }, "name", { value: "Get" }); /** @@ -71456,7 +73546,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1.SqlUsersInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1.SqlUsersInsertRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -71489,7 +73579,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1.SqlUsersListRequest, $root.google.cloud.sql.v1.UsersListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1.SqlUsersListRequest, $root.google.cloud.sql.v1.UsersListResponse, request, callback); }, "name", { value: "List" }); /** @@ -71522,7 +73612,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.update = function update(request, callback) { - return this.rpcCall(update, $root.google.cloud.sql.v1.SqlUsersUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, update, $root.google.cloud.sql.v1.SqlUsersUpdateRequest, $root.google.cloud.sql.v1.Operation, request, callback); }, "name", { value: "Update" }); /** @@ -71618,9 +73708,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersDeleteRequest.encode = function encode(message, writer) { + SqlUsersDeleteRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.host != null && Object.hasOwnProperty.call(message, "host")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -71642,7 +73736,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -71724,16 +73818,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -71750,6 +73844,8 @@ SqlUsersDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlUsersDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlUsersDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -71775,9 +73871,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersDeleteRequest.toObject = function toObject(message, options) { + SqlUsersDeleteRequest.toObject = function toObject(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.host = ""; @@ -71785,13 +73885,13 @@ object.name = ""; object.project = ""; } - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -71905,9 +74005,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersGetRequest.encode = function encode(message, writer) { + SqlUsersGetRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -71929,7 +74033,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -72011,16 +74115,16 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; return null; @@ -72037,6 +74141,8 @@ SqlUsersGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlUsersGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlUsersGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -72062,9 +74168,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersGetRequest.toObject = function toObject(message, options) { + SqlUsersGetRequest.toObject = function toObject(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 = ""; @@ -72072,13 +74182,13 @@ object.project = ""; object.host = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; return object; }; @@ -72183,15 +74293,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersInsertRequest.encode = function encode(message, writer) { + SqlUsersInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -72205,7 +74319,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -72283,13 +74397,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.User.verify(message.body, long + 1); if (error) return "body." + error; @@ -72308,6 +74422,8 @@ SqlUsersInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlUsersInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlUsersInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -72318,7 +74434,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlUsersInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.User.fromObject(object.body, long + 1); } @@ -72334,21 +74450,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersInsertRequest.toObject = function toObject(message, options) { + SqlUsersInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.User.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.User.toObject(message.body, options, q + 1); return object; }; @@ -72443,9 +74563,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersListRequest.encode = function encode(message, writer) { + SqlUsersListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -72463,7 +74587,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -72537,10 +74661,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -72557,6 +74681,8 @@ SqlUsersListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlUsersListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlUsersListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -72578,17 +74704,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersListRequest.toObject = function toObject(message, options) { + SqlUsersListRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -72739,9 +74869,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersUpdateRequest.encode = function encode(message, writer) { + SqlUsersUpdateRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.host != null && Object.hasOwnProperty.call(message, "host")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -72756,7 +74890,7 @@ if (message.revokeExistingRoles != null && Object.hasOwnProperty.call(message, "revokeExistingRoles")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.revokeExistingRoles); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -72770,7 +74904,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -72867,31 +75001,31 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - 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) if (!$util.isString(message.databaseRoles[i])) return "databaseRoles: string[] expected"; } - if (message.revokeExistingRoles != null && message.hasOwnProperty("revokeExistingRoles")) { + if (message.revokeExistingRoles != null && Object.hasOwnProperty.call(message, "revokeExistingRoles")) { properties._revokeExistingRoles = 1; if (typeof message.revokeExistingRoles !== "boolean") return "revokeExistingRoles: boolean expected"; } - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1.User.verify(message.body, long + 1); if (error) return "body." + error; @@ -72910,6 +75044,8 @@ SqlUsersUpdateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlUsersUpdateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlUsersUpdateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -72933,7 +75069,7 @@ if (object.revokeExistingRoles != null) message.revokeExistingRoles = Boolean(object.revokeExistingRoles); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1.SqlUsersUpdateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1.User.fromObject(object.body, long + 1); } @@ -72949,9 +75085,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersUpdateRequest.toObject = function toObject(message, options) { + SqlUsersUpdateRequest.toObject = function toObject(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 = []; @@ -72962,26 +75102,26 @@ object.project = ""; object.body = null; } - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; if (message.databaseRoles && message.databaseRoles.length) { object.databaseRoles = []; for (var j = 0; j < message.databaseRoles.length; ++j) object.databaseRoles[j] = message.databaseRoles[j]; } - if (message.revokeExistingRoles != null && message.hasOwnProperty("revokeExistingRoles")) { + if (message.revokeExistingRoles != null && Object.hasOwnProperty.call(message, "revokeExistingRoles")) { object.revokeExistingRoles = message.revokeExistingRoles; if (options.oneofs) object._revokeExistingRoles = "revokeExistingRoles"; } - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1.User.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1.User.toObject(message.body, options, q + 1); return object; }; @@ -73103,17 +75243,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserPasswordValidationPolicy.encode = function encode(message, writer) { + UserPasswordValidationPolicy.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.allowedFailedAttempts != null && Object.hasOwnProperty.call(message, "allowedFailedAttempts")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.allowedFailedAttempts); if (message.passwordExpirationDuration != null && Object.hasOwnProperty.call(message, "passwordExpirationDuration")) - $root.google.protobuf.Duration.encode(message.passwordExpirationDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.passwordExpirationDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.enableFailedAttemptsCheck != null && Object.hasOwnProperty.call(message, "enableFailedAttemptsCheck")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableFailedAttemptsCheck); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.sql.v1.PasswordStatus.encode(message.status, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1.PasswordStatus.encode(message.status, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.enablePasswordVerification != null && Object.hasOwnProperty.call(message, "enablePasswordVerification")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enablePasswordVerification); return writer; @@ -73129,7 +75273,7 @@ * @returns {$protobuf.Writer} Writer */ UserPasswordValidationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -73215,23 +75359,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.allowedFailedAttempts != null && message.hasOwnProperty("allowedFailedAttempts")) + if (message.allowedFailedAttempts != null && Object.hasOwnProperty.call(message, "allowedFailedAttempts")) if (!$util.isInteger(message.allowedFailedAttempts)) return "allowedFailedAttempts: integer expected"; - if (message.passwordExpirationDuration != null && message.hasOwnProperty("passwordExpirationDuration")) { + if (message.passwordExpirationDuration != null && Object.hasOwnProperty.call(message, "passwordExpirationDuration")) { var error = $root.google.protobuf.Duration.verify(message.passwordExpirationDuration, long + 1); if (error) return "passwordExpirationDuration." + error; } - if (message.enableFailedAttemptsCheck != null && message.hasOwnProperty("enableFailedAttemptsCheck")) + if (message.enableFailedAttemptsCheck != null && Object.hasOwnProperty.call(message, "enableFailedAttemptsCheck")) if (typeof message.enableFailedAttemptsCheck !== "boolean") return "enableFailedAttemptsCheck: boolean expected"; - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { var error = $root.google.cloud.sql.v1.PasswordStatus.verify(message.status, long + 1); if (error) return "status." + error; } - if (message.enablePasswordVerification != null && message.hasOwnProperty("enablePasswordVerification")) + if (message.enablePasswordVerification != null && Object.hasOwnProperty.call(message, "enablePasswordVerification")) if (typeof message.enablePasswordVerification !== "boolean") return "enablePasswordVerification: boolean expected"; return null; @@ -73248,6 +75392,8 @@ UserPasswordValidationPolicy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.UserPasswordValidationPolicy) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.UserPasswordValidationPolicy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -73256,14 +75402,14 @@ if (object.allowedFailedAttempts != null) message.allowedFailedAttempts = object.allowedFailedAttempts | 0; if (object.passwordExpirationDuration != null) { - if (typeof object.passwordExpirationDuration !== "object") + if (!$util.isObject(object.passwordExpirationDuration)) throw TypeError(".google.cloud.sql.v1.UserPasswordValidationPolicy.passwordExpirationDuration: object expected"); message.passwordExpirationDuration = $root.google.protobuf.Duration.fromObject(object.passwordExpirationDuration, long + 1); } if (object.enableFailedAttemptsCheck != null) message.enableFailedAttemptsCheck = Boolean(object.enableFailedAttemptsCheck); if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.cloud.sql.v1.UserPasswordValidationPolicy.status: object expected"); message.status = $root.google.cloud.sql.v1.PasswordStatus.fromObject(object.status, long + 1); } @@ -73281,9 +75427,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserPasswordValidationPolicy.toObject = function toObject(message, options) { + UserPasswordValidationPolicy.toObject = function toObject(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.allowedFailedAttempts = 0; @@ -73292,15 +75442,15 @@ object.status = null; object.enablePasswordVerification = false; } - if (message.allowedFailedAttempts != null && message.hasOwnProperty("allowedFailedAttempts")) + if (message.allowedFailedAttempts != null && Object.hasOwnProperty.call(message, "allowedFailedAttempts")) object.allowedFailedAttempts = message.allowedFailedAttempts; - if (message.passwordExpirationDuration != null && message.hasOwnProperty("passwordExpirationDuration")) - object.passwordExpirationDuration = $root.google.protobuf.Duration.toObject(message.passwordExpirationDuration, options); - if (message.enableFailedAttemptsCheck != null && message.hasOwnProperty("enableFailedAttemptsCheck")) + if (message.passwordExpirationDuration != null && Object.hasOwnProperty.call(message, "passwordExpirationDuration")) + object.passwordExpirationDuration = $root.google.protobuf.Duration.toObject(message.passwordExpirationDuration, options, q + 1); + if (message.enableFailedAttemptsCheck != null && Object.hasOwnProperty.call(message, "enableFailedAttemptsCheck")) object.enableFailedAttemptsCheck = message.enableFailedAttemptsCheck; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.sql.v1.PasswordStatus.toObject(message.status, options); - if (message.enablePasswordVerification != null && message.hasOwnProperty("enablePasswordVerification")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = $root.google.cloud.sql.v1.PasswordStatus.toObject(message.status, options, q + 1); + if (message.enablePasswordVerification != null && Object.hasOwnProperty.call(message, "enablePasswordVerification")) object.enablePasswordVerification = message.enablePasswordVerification; return object; }; @@ -73396,13 +75546,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PasswordStatus.encode = function encode(message, writer) { + PasswordStatus.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.locked); if (message.passwordExpirationTime != null && Object.hasOwnProperty.call(message, "passwordExpirationTime")) - $root.google.protobuf.Timestamp.encode(message.passwordExpirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.passwordExpirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -73416,7 +75570,7 @@ * @returns {$protobuf.Writer} Writer */ PasswordStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -73490,10 +75644,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.locked != null && message.hasOwnProperty("locked")) + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) if (typeof message.locked !== "boolean") return "locked: boolean expected"; - if (message.passwordExpirationTime != null && message.hasOwnProperty("passwordExpirationTime")) { + if (message.passwordExpirationTime != null && Object.hasOwnProperty.call(message, "passwordExpirationTime")) { var error = $root.google.protobuf.Timestamp.verify(message.passwordExpirationTime, long + 1); if (error) return "passwordExpirationTime." + error; @@ -73512,6 +75666,8 @@ PasswordStatus.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.PasswordStatus) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.PasswordStatus: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -73520,7 +75676,7 @@ if (object.locked != null) message.locked = Boolean(object.locked); if (object.passwordExpirationTime != null) { - if (typeof object.passwordExpirationTime !== "object") + if (!$util.isObject(object.passwordExpirationTime)) throw TypeError(".google.cloud.sql.v1.PasswordStatus.passwordExpirationTime: object expected"); message.passwordExpirationTime = $root.google.protobuf.Timestamp.fromObject(object.passwordExpirationTime, long + 1); } @@ -73536,18 +75692,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PasswordStatus.toObject = function toObject(message, options) { + PasswordStatus.toObject = function toObject(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.locked = false; object.passwordExpirationTime = null; } - if (message.locked != null && message.hasOwnProperty("locked")) + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) object.locked = message.locked; - if (message.passwordExpirationTime != null && message.hasOwnProperty("passwordExpirationTime")) - object.passwordExpirationTime = $root.google.protobuf.Timestamp.toObject(message.passwordExpirationTime, options); + if (message.passwordExpirationTime != null && Object.hasOwnProperty.call(message, "passwordExpirationTime")) + object.passwordExpirationTime = $root.google.protobuf.Timestamp.toObject(message.passwordExpirationTime, options, q + 1); return object; }; @@ -73777,9 +75937,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - User.encode = function encode(message, writer) { + User.encode = function encode(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.password != null && Object.hasOwnProperty.call(message, "password")) @@ -73797,11 +75961,11 @@ if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); if (message.sqlserverUserDetails != null && Object.hasOwnProperty.call(message, "sqlserverUserDetails")) - $root.google.cloud.sql.v1.SqlServerUserDetails.encode(message.sqlserverUserDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1.SqlServerUserDetails.encode(message.sqlserverUserDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.iamEmail != null && Object.hasOwnProperty.call(message, "iamEmail")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.iamEmail); if (message.passwordPolicy != null && Object.hasOwnProperty.call(message, "passwordPolicy")) - $root.google.cloud.sql.v1.UserPasswordValidationPolicy.encode(message.passwordPolicy, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.cloud.sql.v1.UserPasswordValidationPolicy.encode(message.passwordPolicy, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.dualPasswordType != null && Object.hasOwnProperty.call(message, "dualPasswordType")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.dualPasswordType); if (message.iamStatus != null && Object.hasOwnProperty.call(message, "iamStatus")) @@ -73822,7 +75986,7 @@ * @returns {$protobuf.Writer} Writer */ User.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -73947,28 +76111,28 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: 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.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.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: 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"; @@ -73981,7 +76145,7 @@ case 7: break; } - if (message.sqlserverUserDetails != null && message.hasOwnProperty("sqlserverUserDetails")) { + if (message.sqlserverUserDetails != null && Object.hasOwnProperty.call(message, "sqlserverUserDetails")) { properties.userDetails = 1; { var error = $root.google.cloud.sql.v1.SqlServerUserDetails.verify(message.sqlserverUserDetails, long + 1); @@ -73989,15 +76153,15 @@ return "sqlserverUserDetails." + error; } } - if (message.iamEmail != null && message.hasOwnProperty("iamEmail")) + if (message.iamEmail != null && Object.hasOwnProperty.call(message, "iamEmail")) if (!$util.isString(message.iamEmail)) return "iamEmail: string expected"; - if (message.passwordPolicy != null && message.hasOwnProperty("passwordPolicy")) { + if (message.passwordPolicy != null && Object.hasOwnProperty.call(message, "passwordPolicy")) { var error = $root.google.cloud.sql.v1.UserPasswordValidationPolicy.verify(message.passwordPolicy, long + 1); if (error) return "passwordPolicy." + error; } - if (message.dualPasswordType != null && message.hasOwnProperty("dualPasswordType")) { + if (message.dualPasswordType != null && Object.hasOwnProperty.call(message, "dualPasswordType")) { properties._dualPasswordType = 1; switch (message.dualPasswordType) { default: @@ -74009,7 +76173,7 @@ break; } } - if (message.iamStatus != null && message.hasOwnProperty("iamStatus")) { + if (message.iamStatus != null && Object.hasOwnProperty.call(message, "iamStatus")) { properties._iamStatus = 1; switch (message.iamStatus) { default: @@ -74020,7 +76184,7 @@ break; } } - 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) @@ -74041,6 +76205,8 @@ User.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.User) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.User: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74097,14 +76263,14 @@ break; } if (object.sqlserverUserDetails != null) { - if (typeof object.sqlserverUserDetails !== "object") + if (!$util.isObject(object.sqlserverUserDetails)) throw TypeError(".google.cloud.sql.v1.User.sqlserverUserDetails: object expected"); message.sqlserverUserDetails = $root.google.cloud.sql.v1.SqlServerUserDetails.fromObject(object.sqlserverUserDetails, long + 1); } if (object.iamEmail != null) message.iamEmail = String(object.iamEmail); if (object.passwordPolicy != null) { - if (typeof object.passwordPolicy !== "object") + if (!$util.isObject(object.passwordPolicy)) throw TypeError(".google.cloud.sql.v1.User.passwordPolicy: object expected"); message.passwordPolicy = $root.google.cloud.sql.v1.UserPasswordValidationPolicy.fromObject(object.passwordPolicy, long + 1); } @@ -74171,9 +76337,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - User.toObject = function toObject(message, options) { + User.toObject = function toObject(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 = []; @@ -74189,37 +76359,37 @@ object.iamEmail = ""; object.passwordPolicy = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1.User.SqlUserType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1.User.SqlUserType[message.type] : message.type; - if (message.sqlserverUserDetails != null && message.hasOwnProperty("sqlserverUserDetails")) { - object.sqlserverUserDetails = $root.google.cloud.sql.v1.SqlServerUserDetails.toObject(message.sqlserverUserDetails, options); + if (message.sqlserverUserDetails != null && Object.hasOwnProperty.call(message, "sqlserverUserDetails")) { + object.sqlserverUserDetails = $root.google.cloud.sql.v1.SqlServerUserDetails.toObject(message.sqlserverUserDetails, options, q + 1); if (options.oneofs) object.userDetails = "sqlserverUserDetails"; } - if (message.iamEmail != null && message.hasOwnProperty("iamEmail")) + if (message.iamEmail != null && Object.hasOwnProperty.call(message, "iamEmail")) object.iamEmail = message.iamEmail; - if (message.passwordPolicy != null && message.hasOwnProperty("passwordPolicy")) - object.passwordPolicy = $root.google.cloud.sql.v1.UserPasswordValidationPolicy.toObject(message.passwordPolicy, options); - if (message.dualPasswordType != null && message.hasOwnProperty("dualPasswordType")) { + if (message.passwordPolicy != null && Object.hasOwnProperty.call(message, "passwordPolicy")) + object.passwordPolicy = $root.google.cloud.sql.v1.UserPasswordValidationPolicy.toObject(message.passwordPolicy, options, q + 1); + if (message.dualPasswordType != null && Object.hasOwnProperty.call(message, "dualPasswordType")) { object.dualPasswordType = options.enums === String ? $root.google.cloud.sql.v1.User.DualPasswordType[message.dualPasswordType] === undefined ? message.dualPasswordType : $root.google.cloud.sql.v1.User.DualPasswordType[message.dualPasswordType] : message.dualPasswordType; if (options.oneofs) object._dualPasswordType = "dualPasswordType"; } - if (message.iamStatus != null && message.hasOwnProperty("iamStatus")) { + if (message.iamStatus != null && Object.hasOwnProperty.call(message, "iamStatus")) { object.iamStatus = options.enums === String ? $root.google.cloud.sql.v1.User.IamStatus[message.iamStatus] === undefined ? message.iamStatus : $root.google.cloud.sql.v1.User.IamStatus[message.iamStatus] : message.iamStatus; if (options.oneofs) object._iamStatus = "iamStatus"; @@ -74382,9 +76552,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerUserDetails.encode = function encode(message, writer) { + SqlServerUserDetails.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disabled); if (message.serverRoles != null && message.serverRoles.length) @@ -74403,7 +76577,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerUserDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -74479,10 +76653,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.disabled != null && message.hasOwnProperty("disabled")) + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) if (typeof message.disabled !== "boolean") return "disabled: boolean expected"; - if (message.serverRoles != null && message.hasOwnProperty("serverRoles")) { + if (message.serverRoles != null && Object.hasOwnProperty.call(message, "serverRoles")) { if (!Array.isArray(message.serverRoles)) return "serverRoles: array expected"; for (var i = 0; i < message.serverRoles.length; ++i) @@ -74503,6 +76677,8 @@ SqlServerUserDetails.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.SqlServerUserDetails) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.SqlServerUserDetails: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74529,15 +76705,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerUserDetails.toObject = function toObject(message, options) { + SqlServerUserDetails.toObject = function toObject(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.serverRoles = []; if (options.defaults) object.disabled = false; - if (message.disabled != null && message.hasOwnProperty("disabled")) + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) object.disabled = message.disabled; if (message.serverRoles && message.serverRoles.length) { object.serverRoles = []; @@ -74648,14 +76828,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UsersListResponse.encode = function encode(message, writer) { + UsersListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1.User.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1.User.encode(message.items[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); return writer; @@ -74671,7 +76855,7 @@ * @returns {$protobuf.Writer} Writer */ UsersListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -74751,10 +76935,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -74763,7 +76947,7 @@ return "items." + 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; @@ -74780,6 +76964,8 @@ UsersListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1.UsersListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1.UsersListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -74792,7 +76978,7 @@ throw TypeError(".google.cloud.sql.v1.UsersListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1.UsersListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1.User.fromObject(object.items[i], long + 1); } @@ -74811,9 +76997,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UsersListResponse.toObject = function toObject(message, options) { + UsersListResponse.toObject = function toObject(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.items = []; @@ -74821,14 +77011,14 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1.User.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1.User.toObject(message.items[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; }; @@ -74926,7 +77116,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -74959,7 +77149,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest, $root.google.cloud.sql.v1beta4.BackupRun, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest, $root.google.cloud.sql.v1beta4.BackupRun, request, callback); }, "name", { value: "Get" }); /** @@ -74992,7 +77182,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -75025,7 +77215,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupRunsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlBackupRunsListRequest, $root.google.cloud.sql.v1beta4.BackupRunsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlBackupRunsListRequest, $root.google.cloud.sql.v1beta4.BackupRunsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -75093,7 +77283,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -75126,7 +77316,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1beta4.SqlDatabasesGetRequest, $root.google.cloud.sql.v1beta4.Database, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1beta4.SqlDatabasesGetRequest, $root.google.cloud.sql.v1beta4.Database, request, callback); }, "name", { value: "Get" }); /** @@ -75159,7 +77349,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -75192,7 +77382,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlDatabasesListRequest, $root.google.cloud.sql.v1beta4.DatabasesListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlDatabasesListRequest, $root.google.cloud.sql.v1beta4.DatabasesListResponse, request, callback); }, "name", { value: "List" }); /** @@ -75225,7 +77415,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.patch = function patch(request, callback) { - return this.rpcCall(patch, $root.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, patch, $root.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Patch" }); /** @@ -75258,7 +77448,7 @@ * @variation 1 */ Object.defineProperty(SqlDatabasesService.prototype.update = function update(request, callback) { - return this.rpcCall(update, $root.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, update, $root.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Update" }); /** @@ -75326,7 +77516,7 @@ * @variation 1 */ Object.defineProperty(SqlFlagsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlFlagsListRequest, $root.google.cloud.sql.v1beta4.FlagsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlFlagsListRequest, $root.google.cloud.sql.v1beta4.FlagsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -75394,7 +77584,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.addServerCa = function addServerCa(request, callback) { - return this.rpcCall(addServerCa, $root.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, addServerCa, $root.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "AddServerCa" }); /** @@ -75427,7 +77617,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.addServerCertificate = function addServerCertificate(request, callback) { - return this.rpcCall(addServerCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, addServerCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "AddServerCertificate" }); /** @@ -75460,7 +77650,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.addEntraIdCertificate = function addEntraIdCertificate(request, callback) { - return this.rpcCall(addEntraIdCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, addEntraIdCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "AddEntraIdCertificate" }); /** @@ -75493,7 +77683,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.clone = function clone(request, callback) { - return this.rpcCall(clone, $root.google.cloud.sql.v1beta4.SqlInstancesCloneRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, clone, $root.google.cloud.sql.v1beta4.SqlInstancesCloneRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Clone" }); /** @@ -75526,7 +77716,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -75559,7 +77749,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.demoteMaster = function demoteMaster(request, callback) { - return this.rpcCall(demoteMaster, $root.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, demoteMaster, $root.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "DemoteMaster" }); /** @@ -75592,7 +77782,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.demote = function demote(request, callback) { - return this.rpcCall(demote, $root.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, demote, $root.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Demote" }); /** @@ -75625,7 +77815,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.google.cloud.sql.v1beta4.SqlInstancesExportRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, export_, $root.google.cloud.sql.v1beta4.SqlInstancesExportRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Export" }); /** @@ -75658,7 +77848,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.failover = function failover(request, callback) { - return this.rpcCall(failover, $root.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, failover, $root.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Failover" }); /** @@ -75691,7 +77881,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.reencrypt = function reencrypt(request, callback) { - return this.rpcCall(reencrypt, $root.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, reencrypt, $root.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Reencrypt" }); /** @@ -75724,7 +77914,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1beta4.SqlInstancesGetRequest, $root.google.cloud.sql.v1beta4.DatabaseInstance, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1beta4.SqlInstancesGetRequest, $root.google.cloud.sql.v1beta4.DatabaseInstance, request, callback); }, "name", { value: "Get" }); /** @@ -75757,7 +77947,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype["import"] = function import_(request, callback) { - return this.rpcCall(import_, $root.google.cloud.sql.v1beta4.SqlInstancesImportRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, import_, $root.google.cloud.sql.v1beta4.SqlInstancesImportRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Import" }); /** @@ -75790,7 +77980,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1beta4.SqlInstancesInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1beta4.SqlInstancesInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -75823,7 +78013,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlInstancesListRequest, $root.google.cloud.sql.v1beta4.InstancesListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlInstancesListRequest, $root.google.cloud.sql.v1beta4.InstancesListResponse, request, callback); }, "name", { value: "List" }); /** @@ -75856,7 +78046,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.listServerCas = function listServerCas(request, callback) { - return this.rpcCall(listServerCas, $root.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest, $root.google.cloud.sql.v1beta4.InstancesListServerCasResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listServerCas, $root.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest, $root.google.cloud.sql.v1beta4.InstancesListServerCasResponse, request, callback); }, "name", { value: "ListServerCas" }); /** @@ -75889,7 +78079,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.listServerCertificates = function listServerCertificates(request, callback) { - return this.rpcCall(listServerCertificates, $root.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest, $root.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listServerCertificates, $root.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest, $root.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse, request, callback); }, "name", { value: "ListServerCertificates" }); /** @@ -75922,7 +78112,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.listEntraIdCertificates = function listEntraIdCertificates(request, callback) { - return this.rpcCall(listEntraIdCertificates, $root.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest, $root.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listEntraIdCertificates, $root.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest, $root.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse, request, callback); }, "name", { value: "ListEntraIdCertificates" }); /** @@ -75955,7 +78145,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.patch = function patch(request, callback) { - return this.rpcCall(patch, $root.google.cloud.sql.v1beta4.SqlInstancesPatchRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, patch, $root.google.cloud.sql.v1beta4.SqlInstancesPatchRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Patch" }); /** @@ -75988,7 +78178,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.promoteReplica = function promoteReplica(request, callback) { - return this.rpcCall(promoteReplica, $root.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, promoteReplica, $root.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "PromoteReplica" }); /** @@ -76021,7 +78211,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.switchover = function switchover(request, callback) { - return this.rpcCall(switchover, $root.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, switchover, $root.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Switchover" }); /** @@ -76054,7 +78244,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.resetSslConfig = function resetSslConfig(request, callback) { - return this.rpcCall(resetSslConfig, $root.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, resetSslConfig, $root.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "ResetSslConfig" }); /** @@ -76087,7 +78277,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.restart = function restart(request, callback) { - return this.rpcCall(restart, $root.google.cloud.sql.v1beta4.SqlInstancesRestartRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, restart, $root.google.cloud.sql.v1beta4.SqlInstancesRestartRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Restart" }); /** @@ -76120,7 +78310,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.restoreBackup = function restoreBackup(request, callback) { - return this.rpcCall(restoreBackup, $root.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, restoreBackup, $root.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "RestoreBackup" }); /** @@ -76153,7 +78343,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rotateServerCa = function rotateServerCa(request, callback) { - return this.rpcCall(rotateServerCa, $root.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rotateServerCa, $root.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "RotateServerCa" }); /** @@ -76186,7 +78376,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rotateServerCertificate = function rotateServerCertificate(request, callback) { - return this.rpcCall(rotateServerCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rotateServerCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "RotateServerCertificate" }); /** @@ -76219,7 +78409,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rotateEntraIdCertificate = function rotateEntraIdCertificate(request, callback) { - return this.rpcCall(rotateEntraIdCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rotateEntraIdCertificate, $root.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "RotateEntraIdCertificate" }); /** @@ -76252,7 +78442,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.startReplica = function startReplica(request, callback) { - return this.rpcCall(startReplica, $root.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, startReplica, $root.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "StartReplica" }); /** @@ -76285,7 +78475,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.stopReplica = function stopReplica(request, callback) { - return this.rpcCall(stopReplica, $root.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, stopReplica, $root.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "StopReplica" }); /** @@ -76318,7 +78508,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.truncateLog = function truncateLog(request, callback) { - return this.rpcCall(truncateLog, $root.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, truncateLog, $root.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "TruncateLog" }); /** @@ -76351,7 +78541,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.update = function update(request, callback) { - return this.rpcCall(update, $root.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, update, $root.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Update" }); /** @@ -76384,7 +78574,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.createEphemeral = function createEphemeral(request, callback) { - return this.rpcCall(createEphemeral, $root.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest, $root.google.cloud.sql.v1beta4.SslCert, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createEphemeral, $root.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest, $root.google.cloud.sql.v1beta4.SslCert, request, callback); }, "name", { value: "CreateEphemeral" }); /** @@ -76417,7 +78607,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.rescheduleMaintenance = function rescheduleMaintenance(request, callback) { - return this.rpcCall(rescheduleMaintenance, $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, rescheduleMaintenance, $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "RescheduleMaintenance" }); /** @@ -76450,7 +78640,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.verifyExternalSyncSettings = function verifyExternalSyncSettings(request, callback) { - return this.rpcCall(verifyExternalSyncSettings, $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest, $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, verifyExternalSyncSettings, $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest, $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse, request, callback); }, "name", { value: "VerifyExternalSyncSettings" }); /** @@ -76483,7 +78673,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.startExternalSync = function startExternalSync(request, callback) { - return this.rpcCall(startExternalSync, $root.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, startExternalSync, $root.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "StartExternalSync" }); /** @@ -76516,7 +78706,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.performDiskShrink = function performDiskShrink(request, callback) { - return this.rpcCall(performDiskShrink, $root.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, performDiskShrink, $root.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "PerformDiskShrink" }); /** @@ -76549,7 +78739,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.getDiskShrinkConfig = function getDiskShrinkConfig(request, callback) { - return this.rpcCall(getDiskShrinkConfig, $root.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest, $root.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getDiskShrinkConfig, $root.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest, $root.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse, request, callback); }, "name", { value: "GetDiskShrinkConfig" }); /** @@ -76582,7 +78772,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.resetReplicaSize = function resetReplicaSize(request, callback) { - return this.rpcCall(resetReplicaSize, $root.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, resetReplicaSize, $root.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "ResetReplicaSize" }); /** @@ -76615,7 +78805,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.getLatestRecoveryTime = function getLatestRecoveryTime(request, callback) { - return this.rpcCall(getLatestRecoveryTime, $root.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest, $root.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getLatestRecoveryTime, $root.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest, $root.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse, request, callback); }, "name", { value: "GetLatestRecoveryTime" }); /** @@ -76648,7 +78838,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.executeSql = function executeSql(request, callback) { - return this.rpcCall(executeSql, $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest, $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, executeSql, $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest, $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse, request, callback); }, "name", { value: "ExecuteSql" }); /** @@ -76681,7 +78871,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.acquireSsrsLease = function acquireSsrsLease(request, callback) { - return this.rpcCall(acquireSsrsLease, $root.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest, $root.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, acquireSsrsLease, $root.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest, $root.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse, request, callback); }, "name", { value: "AcquireSsrsLease" }); /** @@ -76714,7 +78904,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.releaseSsrsLease = function releaseSsrsLease(request, callback) { - return this.rpcCall(releaseSsrsLease, $root.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest, $root.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, releaseSsrsLease, $root.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest, $root.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse, request, callback); }, "name", { value: "ReleaseSsrsLease" }); /** @@ -76747,7 +78937,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.preCheckMajorVersionUpgrade = function preCheckMajorVersionUpgrade(request, callback) { - return this.rpcCall(preCheckMajorVersionUpgrade, $root.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, preCheckMajorVersionUpgrade, $root.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "PreCheckMajorVersionUpgrade" }); /** @@ -76780,7 +78970,7 @@ * @variation 1 */ Object.defineProperty(SqlInstancesService.prototype.pointInTimeRestore = function pointInTimeRestore(request, callback) { - return this.rpcCall(pointInTimeRestore, $root.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, pointInTimeRestore, $root.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "PointInTimeRestore" }); /** @@ -76848,7 +79038,7 @@ * @variation 1 */ Object.defineProperty(SqlOperationsService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1beta4.SqlOperationsGetRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1beta4.SqlOperationsGetRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Get" }); /** @@ -76881,7 +79071,7 @@ * @variation 1 */ Object.defineProperty(SqlOperationsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlOperationsListRequest, $root.google.cloud.sql.v1beta4.OperationsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlOperationsListRequest, $root.google.cloud.sql.v1beta4.OperationsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -76914,7 +79104,7 @@ * @variation 1 */ Object.defineProperty(SqlOperationsService.prototype.cancel = function cancel(request, callback) { - return this.rpcCall(cancel, $root.google.cloud.sql.v1beta4.SqlOperationsCancelRequest, $root.google.protobuf.Empty, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, cancel, $root.google.cloud.sql.v1beta4.SqlOperationsCancelRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "Cancel" }); /** @@ -76982,7 +79172,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -77015,7 +79205,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1beta4.SqlSslCertsGetRequest, $root.google.cloud.sql.v1beta4.SslCert, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1beta4.SqlSslCertsGetRequest, $root.google.cloud.sql.v1beta4.SslCert, request, callback); }, "name", { value: "Get" }); /** @@ -77048,7 +79238,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest, $root.google.cloud.sql.v1beta4.SslCertsInsertResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest, $root.google.cloud.sql.v1beta4.SslCertsInsertResponse, request, callback); }, "name", { value: "Insert" }); /** @@ -77081,7 +79271,7 @@ * @variation 1 */ Object.defineProperty(SqlSslCertsService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlSslCertsListRequest, $root.google.cloud.sql.v1beta4.SslCertsListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlSslCertsListRequest, $root.google.cloud.sql.v1beta4.SslCertsListResponse, request, callback); }, "name", { value: "List" }); /** @@ -77149,7 +79339,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.createBackup = function createBackup(request, callback) { - return this.rpcCall(createBackup, $root.google.cloud.sql.v1beta4.CreateBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, createBackup, $root.google.cloud.sql.v1beta4.CreateBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "CreateBackup" }); /** @@ -77182,7 +79372,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.sql.v1beta4.GetBackupRequest, $root.google.cloud.sql.v1beta4.Backup, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getBackup, $root.google.cloud.sql.v1beta4.GetBackupRequest, $root.google.cloud.sql.v1beta4.Backup, request, callback); }, "name", { value: "GetBackup" }); /** @@ -77215,7 +79405,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.sql.v1beta4.ListBackupsRequest, $root.google.cloud.sql.v1beta4.ListBackupsResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, listBackups, $root.google.cloud.sql.v1beta4.ListBackupsRequest, $root.google.cloud.sql.v1beta4.ListBackupsResponse, request, callback); }, "name", { value: "ListBackups" }); /** @@ -77248,7 +79438,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.sql.v1beta4.UpdateBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, updateBackup, $root.google.cloud.sql.v1beta4.UpdateBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "UpdateBackup" }); /** @@ -77281,7 +79471,7 @@ * @variation 1 */ Object.defineProperty(SqlBackupsService.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.sql.v1beta4.DeleteBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, deleteBackup, $root.google.cloud.sql.v1beta4.DeleteBackupRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "DeleteBackup" }); /** @@ -77359,13 +79549,17 @@ * @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.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.sql.v1beta4.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -77379,7 +79573,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(); }; /** @@ -77453,10 +79647,10 @@ 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.backup != null && message.hasOwnProperty("backup")) { + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) { var error = $root.google.cloud.sql.v1beta4.Backup.verify(message.backup, long + 1); if (error) return "backup." + error; @@ -77475,6 +79669,8 @@ CreateBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.CreateBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.CreateBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77483,7 +79679,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.backup != null) { - if (typeof object.backup !== "object") + if (!$util.isObject(object.backup)) throw TypeError(".google.cloud.sql.v1beta4.CreateBackupRequest.backup: object expected"); message.backup = $root.google.cloud.sql.v1beta4.Backup.fromObject(object.backup, long + 1); } @@ -77499,18 +79695,22 @@ * @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 = ""; object.backup = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.sql.v1beta4.Backup.toObject(message.backup, options); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + object.backup = $root.google.cloud.sql.v1beta4.Backup.toObject(message.backup, options, q + 1); return object; }; @@ -77596,9 +79796,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; @@ -77614,7 +79818,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(); }; /** @@ -77684,7 +79888,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; @@ -77701,6 +79905,8 @@ GetBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.GetBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.GetBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77720,13 +79926,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; }; @@ -77840,9 +80050,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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -77864,7 +80078,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(); }; /** @@ -77946,16 +80160,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.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; @@ -77972,6 +80186,8 @@ ListBackupsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ListBackupsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ListBackupsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -77997,9 +80213,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 = ""; @@ -78007,13 +80227,13 @@ object.pageToken = ""; object.filter = ""; } - 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; return object; }; @@ -78120,17 +80340,21 @@ * @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.cloud.sql.v1beta4.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.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); if (message.warnings != null && message.warnings.length) for (var i = 0; i < message.warnings.length; ++i) - $root.google.cloud.sql.v1beta4.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -78144,7 +80368,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(); }; /** @@ -78226,7 +80450,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) { @@ -78235,10 +80459,10 @@ 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"; - if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (message.warnings != null && Object.hasOwnProperty.call(message, "warnings")) { if (!Array.isArray(message.warnings)) return "warnings: array expected"; for (var i = 0; i < message.warnings.length; ++i) { @@ -78261,6 +80485,8 @@ ListBackupsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ListBackupsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ListBackupsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -78271,7 +80497,7 @@ throw TypeError(".google.cloud.sql.v1beta4.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.cloud.sql.v1beta4.ListBackupsResponse.backups: object expected"); message.backups[i] = $root.google.cloud.sql.v1beta4.Backup.fromObject(object.backups[i], long + 1); } @@ -78283,7 +80509,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ListBackupsResponse.warnings: array expected"); message.warnings = []; for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") + if (!$util.isObject(object.warnings[i])) throw TypeError(".google.cloud.sql.v1beta4.ListBackupsResponse.warnings: object expected"); message.warnings[i] = $root.google.cloud.sql.v1beta4.ApiWarning.fromObject(object.warnings[i], long + 1); } @@ -78300,9 +80526,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 = []; @@ -78313,14 +80543,14 @@ if (message.backups && message.backups.length) { object.backups = []; for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.sql.v1beta4.Backup.toObject(message.backups[j], options); + object.backups[j] = $root.google.cloud.sql.v1beta4.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; if (message.warnings && message.warnings.length) { object.warnings = []; for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.sql.v1beta4.ApiWarning.toObject(message.warnings[j], options); + object.warnings[j] = $root.google.cloud.sql.v1beta4.ApiWarning.toObject(message.warnings[j], options, q + 1); } return object; }; @@ -78416,13 +80646,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.cloud.sql.v1beta4.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.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; }; @@ -78436,7 +80670,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(); }; /** @@ -78510,12 +80744,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.cloud.sql.v1beta4.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; @@ -78534,18 +80768,20 @@ UpdateBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.UpdateBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.UpdateBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.UpdateBackupRequest(); if (object.backup != null) { - if (typeof object.backup !== "object") + if (!$util.isObject(object.backup)) throw TypeError(".google.cloud.sql.v1beta4.UpdateBackupRequest.backup: object expected"); message.backup = $root.google.cloud.sql.v1beta4.Backup.fromObject(object.backup, long + 1); } if (object.updateMask != null) { - if (typeof object.updateMask !== "object") + if (!$util.isObject(object.updateMask)) throw TypeError(".google.cloud.sql.v1beta4.UpdateBackupRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask, long + 1); } @@ -78561,18 +80797,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.cloud.sql.v1beta4.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.cloud.sql.v1beta4.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; }; @@ -78658,9 +80898,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; @@ -78676,7 +80920,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(); }; /** @@ -78746,7 +80990,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; @@ -78763,6 +81007,8 @@ DeleteBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DeleteBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DeleteBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -78782,13 +81028,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; }; @@ -78893,9 +81143,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsDeleteRequest.encode = function encode(message, writer) { + SqlBackupRunsDeleteRequest.encode = function encode(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 0 =*/8).int64(message.id); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -78915,7 +81169,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -78993,13 +81247,13 @@ 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 (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) return "id: integer|Long expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -79016,6 +81270,8 @@ SqlBackupRunsDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79023,7 +81279,7 @@ var message = new $root.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest(); if (object.id != null) if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; + message.id = $util.Long.fromValue(object.id, false); else if (typeof object.id === "string") message.id = parseInt(object.id, 10); else if (typeof object.id === "number") @@ -79046,27 +81302,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsDeleteRequest.toObject = function toObject(message, options) { + SqlBackupRunsDeleteRequest.toObject = function toObject(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.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.id = options.longs === String ? "0" : 0; + object.id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.instance = ""; object.project = ""; } - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.id = typeof message.id === "number" ? BigInt(message.id) : $util.Long.fromBits(message.id.low >>> 0, message.id.high >>> 0, false).toBigInt(); + else if (typeof message.id === "number") object.id = options.longs === String ? String(message.id) : message.id; else object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -79171,9 +81433,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsGetRequest.encode = function encode(message, writer) { + SqlBackupRunsGetRequest.encode = function encode(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 0 =*/8).int64(message.id); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -79193,7 +81459,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -79271,13 +81537,13 @@ 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 (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) return "id: integer|Long expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -79294,6 +81560,8 @@ SqlBackupRunsGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlBackupRunsGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79301,7 +81569,7 @@ var message = new $root.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest(); if (object.id != null) if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; + message.id = $util.Long.fromValue(object.id, false); else if (typeof object.id === "string") message.id = parseInt(object.id, 10); else if (typeof object.id === "number") @@ -79324,27 +81592,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsGetRequest.toObject = function toObject(message, options) { + SqlBackupRunsGetRequest.toObject = function toObject(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.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.id = options.longs === String ? "0" : 0; + object.id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.instance = ""; object.project = ""; } - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.id = typeof message.id === "number" ? BigInt(message.id) : $util.Long.fromBits(message.id.low >>> 0, message.id.high >>> 0, false).toBigInt(); + else if (typeof message.id === "number") object.id = options.longs === String ? String(message.id) : message.id; else object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -79449,15 +81723,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsInsertRequest.encode = function encode(message, writer) { + SqlBackupRunsInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.BackupRun.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.BackupRun.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -79471,7 +81749,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -79549,13 +81827,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.BackupRun.verify(message.body, long + 1); if (error) return "body." + error; @@ -79574,6 +81852,8 @@ SqlBackupRunsInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79584,7 +81864,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.BackupRun.fromObject(object.body, long + 1); } @@ -79600,21 +81880,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsInsertRequest.toObject = function toObject(message, options) { + SqlBackupRunsInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.BackupRun.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.BackupRun.toObject(message.body, options, q + 1); return object; }; @@ -79727,9 +82011,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBackupRunsListRequest.encode = function encode(message, writer) { + SqlBackupRunsListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) @@ -79751,7 +82039,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBackupRunsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -79833,16 +82121,16 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) if (!$util.isInteger(message.maxResults)) return "maxResults: 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -79859,6 +82147,8 @@ SqlBackupRunsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlBackupRunsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlBackupRunsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -79884,9 +82174,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBackupRunsListRequest.toObject = function toObject(message, options) { + SqlBackupRunsListRequest.toObject = function toObject(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 = ""; @@ -79894,13 +82188,13 @@ object.pageToken = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) object.maxResults = message.maxResults; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -80005,9 +82299,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesDeleteRequest.encode = function encode(message, writer) { + SqlDatabasesDeleteRequest.encode = function encode(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.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -80027,7 +82325,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -80105,13 +82403,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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -80128,6 +82426,8 @@ SqlDatabasesDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlDatabasesDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80151,20 +82451,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesDeleteRequest.toObject = function toObject(message, options) { + SqlDatabasesDeleteRequest.toObject = function toObject(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.instance = ""; object.project = ""; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -80269,9 +82573,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesGetRequest.encode = function encode(message, writer) { + SqlDatabasesGetRequest.encode = function encode(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.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -80291,7 +82599,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -80369,13 +82677,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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -80392,6 +82700,8 @@ SqlDatabasesGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlDatabasesGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlDatabasesGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80415,20 +82725,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesGetRequest.toObject = function toObject(message, options) { + SqlDatabasesGetRequest.toObject = function toObject(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.instance = ""; object.project = ""; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -80533,15 +82847,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesInsertRequest.encode = function encode(message, writer) { + SqlDatabasesInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -80555,7 +82873,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -80633,13 +82951,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.Database.verify(message.body, long + 1); if (error) return "body." + error; @@ -80658,6 +82976,8 @@ SqlDatabasesInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlDatabasesInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlDatabasesInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80668,7 +82988,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlDatabasesInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.Database.fromObject(object.body, long + 1); } @@ -80684,21 +83004,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesInsertRequest.toObject = function toObject(message, options) { + SqlDatabasesInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.Database.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.Database.toObject(message.body, options, q + 1); return object; }; @@ -80793,9 +83117,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesListRequest.encode = function encode(message, writer) { + SqlDatabasesListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -80813,7 +83141,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -80887,10 +83215,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -80907,6 +83235,8 @@ SqlDatabasesListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlDatabasesListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlDatabasesListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -80928,17 +83258,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesListRequest.toObject = function toObject(message, options) { + SqlDatabasesListRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -81052,9 +83386,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlDatabasesUpdateRequest.encode = function encode(message, writer) { + SqlDatabasesUpdateRequest.encode = function encode(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.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -81062,7 +83400,7 @@ if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Database.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -81076,7 +83414,7 @@ * @returns {$protobuf.Writer} Writer */ SqlDatabasesUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81158,16 +83496,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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.Database.verify(message.body, long + 1); if (error) return "body." + error; @@ -81186,6 +83524,8 @@ SqlDatabasesUpdateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81198,7 +83538,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlDatabasesUpdateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.Database.fromObject(object.body, long + 1); } @@ -81214,9 +83554,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlDatabasesUpdateRequest.toObject = function toObject(message, options) { + SqlDatabasesUpdateRequest.toObject = function toObject(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 = ""; @@ -81224,14 +83568,14 @@ object.project = ""; object.body = null; } - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.Database.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.Database.toObject(message.body, options, q + 1); return object; }; @@ -81335,9 +83679,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlFlagsListRequest.encode = function encode(message, writer) { + SqlFlagsListRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.databaseVersion); if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) @@ -81355,7 +83703,7 @@ * @returns {$protobuf.Writer} Writer */ SqlFlagsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81430,10 +83778,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) if (!$util.isString(message.databaseVersion)) return "databaseVersion: string expected"; - if (message.flagScope != null && message.hasOwnProperty("flagScope")) { + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) { properties._flagScope = 1; switch (message.flagScope) { default: @@ -81458,6 +83806,8 @@ SqlFlagsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlFlagsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlFlagsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81497,15 +83847,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlFlagsListRequest.toObject = function toObject(message, options) { + SqlFlagsListRequest.toObject = function toObject(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.databaseVersion = ""; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = message.databaseVersion; - if (message.flagScope != null && message.hasOwnProperty("flagScope")) { + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) { object.flagScope = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlFlagScope[message.flagScope] === undefined ? message.flagScope : $root.google.cloud.sql.v1beta4.SqlFlagScope[message.flagScope] : message.flagScope; if (options.oneofs) object._flagScope = "flagScope"; @@ -81604,9 +83958,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAddServerCaRequest.encode = function encode(message, writer) { + SqlInstancesAddServerCaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -81624,7 +83982,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAddServerCaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81698,10 +84056,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -81718,6 +84076,8 @@ SqlInstancesAddServerCaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesAddServerCaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81739,17 +84099,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAddServerCaRequest.toObject = function toObject(message, options) { + SqlInstancesAddServerCaRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -81845,9 +84209,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAddServerCertificateRequest.encode = function encode(message, writer) { + SqlInstancesAddServerCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -81865,7 +84233,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAddServerCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -81939,10 +84307,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -81959,6 +84327,8 @@ SqlInstancesAddServerCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesAddServerCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -81980,17 +84350,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAddServerCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesAddServerCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -82086,9 +84460,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAddEntraIdCertificateRequest.encode = function encode(message, writer) { + SqlInstancesAddEntraIdCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -82106,7 +84484,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAddEntraIdCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -82180,10 +84558,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -82200,6 +84578,8 @@ SqlInstancesAddEntraIdCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesAddEntraIdCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82221,17 +84601,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAddEntraIdCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesAddEntraIdCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -82336,15 +84720,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesCloneRequest.encode = function encode(message, writer) { + SqlInstancesCloneRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesCloneRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesCloneRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -82358,7 +84746,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesCloneRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -82436,13 +84824,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesCloneRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -82461,6 +84849,8 @@ SqlInstancesCloneRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesCloneRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesCloneRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82471,7 +84861,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesCloneRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesCloneRequest.fromObject(object.body, long + 1); } @@ -82487,21 +84877,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesCloneRequest.toObject = function toObject(message, options) { + SqlInstancesCloneRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesCloneRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesCloneRequest.toObject(message.body, options, q + 1); return object; }; @@ -82652,9 +85046,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesDeleteRequest.encode = function encode(message, writer) { + SqlInstancesDeleteRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -82664,7 +85062,7 @@ if (message.finalBackupDescription != null && Object.hasOwnProperty.call(message, "finalBackupDescription")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.finalBackupDescription); if (message.finalBackupExpiryTime != null && Object.hasOwnProperty.call(message, "finalBackupExpiryTime")) - $root.google.protobuf.Timestamp.encode(message.finalBackupExpiryTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.finalBackupExpiryTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.enableFinalBackup != null && Object.hasOwnProperty.call(message, "enableFinalBackup")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFinalBackup); return writer; @@ -82680,7 +85078,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -82771,23 +85169,23 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.enableFinalBackup != null && message.hasOwnProperty("enableFinalBackup")) { + if (message.enableFinalBackup != null && Object.hasOwnProperty.call(message, "enableFinalBackup")) { properties._enableFinalBackup = 1; if (typeof message.enableFinalBackup !== "boolean") return "enableFinalBackup: boolean expected"; } - if (message.finalBackupTtlDays != null && message.hasOwnProperty("finalBackupTtlDays")) { + if (message.finalBackupTtlDays != null && Object.hasOwnProperty.call(message, "finalBackupTtlDays")) { properties.expiration = 1; if (!$util.isInteger(message.finalBackupTtlDays) && !(message.finalBackupTtlDays && $util.isInteger(message.finalBackupTtlDays.low) && $util.isInteger(message.finalBackupTtlDays.high))) return "finalBackupTtlDays: integer|Long expected"; } - if (message.finalBackupExpiryTime != null && message.hasOwnProperty("finalBackupExpiryTime")) { + if (message.finalBackupExpiryTime != null && Object.hasOwnProperty.call(message, "finalBackupExpiryTime")) { if (properties.expiration === 1) return "expiration: multiple values"; properties.expiration = 1; @@ -82797,7 +85195,7 @@ return "finalBackupExpiryTime." + error; } } - if (message.finalBackupDescription != null && message.hasOwnProperty("finalBackupDescription")) + if (message.finalBackupDescription != null && Object.hasOwnProperty.call(message, "finalBackupDescription")) if (!$util.isString(message.finalBackupDescription)) return "finalBackupDescription: string expected"; return null; @@ -82814,6 +85212,8 @@ SqlInstancesDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -82827,7 +85227,7 @@ message.enableFinalBackup = Boolean(object.enableFinalBackup); if (object.finalBackupTtlDays != null) if ($util.Long) - (message.finalBackupTtlDays = $util.Long.fromValue(object.finalBackupTtlDays)).unsigned = false; + message.finalBackupTtlDays = $util.Long.fromValue(object.finalBackupTtlDays, false); else if (typeof object.finalBackupTtlDays === "string") message.finalBackupTtlDays = parseInt(object.finalBackupTtlDays, 10); else if (typeof object.finalBackupTtlDays === "number") @@ -82835,7 +85235,7 @@ else if (typeof object.finalBackupTtlDays === "object") message.finalBackupTtlDays = new $util.LongBits(object.finalBackupTtlDays.low >>> 0, object.finalBackupTtlDays.high >>> 0).toNumber(); if (object.finalBackupExpiryTime != null) { - if (typeof object.finalBackupExpiryTime !== "object") + if (!$util.isObject(object.finalBackupExpiryTime)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesDeleteRequest.finalBackupExpiryTime: object expected"); message.finalBackupExpiryTime = $root.google.protobuf.Timestamp.fromObject(object.finalBackupExpiryTime, long + 1); } @@ -82853,35 +85253,41 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesDeleteRequest.toObject = function toObject(message, options) { + SqlInstancesDeleteRequest.toObject = function toObject(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 = ""; object.project = ""; object.finalBackupDescription = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.finalBackupTtlDays != null && message.hasOwnProperty("finalBackupTtlDays")) { - if (typeof message.finalBackupTtlDays === "number") + if (message.finalBackupTtlDays != null && Object.hasOwnProperty.call(message, "finalBackupTtlDays")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.finalBackupTtlDays = typeof message.finalBackupTtlDays === "number" ? BigInt(message.finalBackupTtlDays) : $util.Long.fromBits(message.finalBackupTtlDays.low >>> 0, message.finalBackupTtlDays.high >>> 0, false).toBigInt(); + else if (typeof message.finalBackupTtlDays === "number") object.finalBackupTtlDays = options.longs === String ? String(message.finalBackupTtlDays) : message.finalBackupTtlDays; else object.finalBackupTtlDays = options.longs === String ? $util.Long.prototype.toString.call(message.finalBackupTtlDays) : options.longs === Number ? new $util.LongBits(message.finalBackupTtlDays.low >>> 0, message.finalBackupTtlDays.high >>> 0).toNumber() : message.finalBackupTtlDays; if (options.oneofs) object.expiration = "finalBackupTtlDays"; } - if (message.finalBackupDescription != null && message.hasOwnProperty("finalBackupDescription")) + if (message.finalBackupDescription != null && Object.hasOwnProperty.call(message, "finalBackupDescription")) object.finalBackupDescription = message.finalBackupDescription; - if (message.finalBackupExpiryTime != null && message.hasOwnProperty("finalBackupExpiryTime")) { - object.finalBackupExpiryTime = $root.google.protobuf.Timestamp.toObject(message.finalBackupExpiryTime, options); + if (message.finalBackupExpiryTime != null && Object.hasOwnProperty.call(message, "finalBackupExpiryTime")) { + object.finalBackupExpiryTime = $root.google.protobuf.Timestamp.toObject(message.finalBackupExpiryTime, options, q + 1); if (options.oneofs) object.expiration = "finalBackupExpiryTime"; } - if (message.enableFinalBackup != null && message.hasOwnProperty("enableFinalBackup")) { + if (message.enableFinalBackup != null && Object.hasOwnProperty.call(message, "enableFinalBackup")) { object.enableFinalBackup = message.enableFinalBackup; if (options.oneofs) object._enableFinalBackup = "enableFinalBackup"; @@ -82989,15 +85395,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesDemoteMasterRequest.encode = function encode(message, writer) { + SqlInstancesDemoteMasterRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -83011,7 +85421,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesDemoteMasterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -83089,13 +85499,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -83114,6 +85524,8 @@ SqlInstancesDemoteMasterRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83124,7 +85536,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesDemoteMasterRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.fromObject(object.body, long + 1); } @@ -83140,21 +85552,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesDemoteMasterRequest.toObject = function toObject(message, options) { + SqlInstancesDemoteMasterRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.toObject(message.body, options, q + 1); return object; }; @@ -83258,15 +85674,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesDemoteRequest.encode = function encode(message, writer) { + SqlInstancesDemoteRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesDemoteRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesDemoteRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -83280,7 +85700,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesDemoteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -83358,13 +85778,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesDemoteRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -83383,6 +85803,8 @@ SqlInstancesDemoteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesDemoteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesDemoteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83393,7 +85815,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesDemoteRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesDemoteRequest.fromObject(object.body, long + 1); } @@ -83409,21 +85831,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesDemoteRequest.toObject = function toObject(message, options) { + SqlInstancesDemoteRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesDemoteRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesDemoteRequest.toObject(message.body, options, q + 1); return object; }; @@ -83527,15 +85953,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesExportRequest.encode = function encode(message, writer) { + SqlInstancesExportRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesExportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesExportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -83549,7 +85979,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -83627,13 +86057,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesExportRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -83652,6 +86082,8 @@ SqlInstancesExportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesExportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83662,7 +86094,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExportRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesExportRequest.fromObject(object.body, long + 1); } @@ -83678,21 +86110,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesExportRequest.toObject = function toObject(message, options) { + SqlInstancesExportRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesExportRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesExportRequest.toObject(message.body, options, q + 1); return object; }; @@ -83796,15 +86232,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesFailoverRequest.encode = function encode(message, writer) { + SqlInstancesFailoverRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesFailoverRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesFailoverRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -83818,7 +86258,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesFailoverRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -83896,13 +86336,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesFailoverRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -83921,6 +86361,8 @@ SqlInstancesFailoverRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesFailoverRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesFailoverRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -83931,7 +86373,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesFailoverRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesFailoverRequest.fromObject(object.body, long + 1); } @@ -83947,21 +86389,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesFailoverRequest.toObject = function toObject(message, options) { + SqlInstancesFailoverRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesFailoverRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesFailoverRequest.toObject(message.body, options, q + 1); return object; }; @@ -84056,9 +86502,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetRequest.encode = function encode(message, writer) { + SqlInstancesGetRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -84076,7 +86526,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -84150,10 +86600,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -84170,6 +86620,8 @@ SqlInstancesGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -84191,17 +86643,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetRequest.toObject = function toObject(message, options) { + SqlInstancesGetRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -84306,15 +86762,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesImportRequest.encode = function encode(message, writer) { + SqlInstancesImportRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesImportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesImportRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -84328,7 +86788,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesImportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -84406,13 +86866,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesImportRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -84431,6 +86891,8 @@ SqlInstancesImportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesImportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesImportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -84441,7 +86903,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesImportRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesImportRequest.fromObject(object.body, long + 1); } @@ -84457,21 +86919,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesImportRequest.toObject = function toObject(message, options) { + SqlInstancesImportRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesImportRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesImportRequest.toObject(message.body, options, q + 1); return object; }; @@ -84566,13 +87032,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesInsertRequest.encode = function encode(message, writer) { + SqlInstancesInsertRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -84586,7 +87056,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -84660,10 +87130,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.verify(message.body, long + 1); if (error) return "body." + error; @@ -84682,6 +87152,8 @@ SqlInstancesInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -84690,7 +87162,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.fromObject(object.body, long + 1); } @@ -84706,18 +87178,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesInsertRequest.toObject = function toObject(message, options) { + SqlInstancesInsertRequest.toObject = function toObject(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.project = ""; object.body = null; } - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.body, options, q + 1); return object; }; @@ -84830,9 +87306,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListRequest.encode = function encode(message, writer) { + SqlInstancesListRequest.encode = function encode(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.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) @@ -84854,7 +87334,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -84936,16 +87416,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) if (!$util.isInteger(message.maxResults)) return "maxResults: 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -84962,6 +87442,8 @@ SqlInstancesListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -84987,9 +87469,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListRequest.toObject = function toObject(message, options) { + SqlInstancesListRequest.toObject = function toObject(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 = ""; @@ -84997,13 +87483,13 @@ object.pageToken = ""; object.project = ""; } - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) object.filter = message.filter; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) object.maxResults = message.maxResults; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -85099,9 +87585,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListServerCasRequest.encode = function encode(message, writer) { + SqlInstancesListServerCasRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -85119,7 +87609,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListServerCasRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -85193,10 +87683,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -85213,6 +87703,8 @@ SqlInstancesListServerCasRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesListServerCasRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -85234,17 +87726,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListServerCasRequest.toObject = function toObject(message, options) { + SqlInstancesListServerCasRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -85340,9 +87836,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListServerCertificatesRequest.encode = function encode(message, writer) { + SqlInstancesListServerCertificatesRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -85360,7 +87860,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListServerCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -85434,10 +87934,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -85454,6 +87954,8 @@ SqlInstancesListServerCertificatesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesListServerCertificatesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -85475,17 +87977,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListServerCertificatesRequest.toObject = function toObject(message, options) { + SqlInstancesListServerCertificatesRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -85581,9 +88087,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesListEntraIdCertificatesRequest.encode = function encode(message, writer) { + SqlInstancesListEntraIdCertificatesRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -85601,7 +88111,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesListEntraIdCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -85675,10 +88185,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -85695,6 +88205,8 @@ SqlInstancesListEntraIdCertificatesRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesListEntraIdCertificatesRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -85716,17 +88228,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesListEntraIdCertificatesRequest.toObject = function toObject(message, options) { + SqlInstancesListEntraIdCertificatesRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -85864,9 +88380,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPatchRequest.encode = function encode(message, writer) { + SqlInstancesPatchRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -85876,7 +88396,7 @@ if (message.reconcilePscNetworkingForce != null && Object.hasOwnProperty.call(message, "reconcilePscNetworkingForce")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reconcilePscNetworkingForce); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -85890,7 +88410,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPatchRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -85977,23 +88497,23 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.reconcilePscNetworking != null && message.hasOwnProperty("reconcilePscNetworking")) { + if (message.reconcilePscNetworking != null && Object.hasOwnProperty.call(message, "reconcilePscNetworking")) { properties._reconcilePscNetworking = 1; if (typeof message.reconcilePscNetworking !== "boolean") return "reconcilePscNetworking: boolean expected"; } - if (message.reconcilePscNetworkingForce != null && message.hasOwnProperty("reconcilePscNetworkingForce")) { + if (message.reconcilePscNetworkingForce != null && Object.hasOwnProperty.call(message, "reconcilePscNetworkingForce")) { properties._reconcilePscNetworkingForce = 1; if (typeof message.reconcilePscNetworkingForce !== "boolean") return "reconcilePscNetworkingForce: boolean expected"; } - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.verify(message.body, long + 1); if (error) return "body." + error; @@ -86012,6 +88532,8 @@ SqlInstancesPatchRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesPatchRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPatchRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -86026,7 +88548,7 @@ if (object.reconcilePscNetworkingForce != null) message.reconcilePscNetworkingForce = Boolean(object.reconcilePscNetworkingForce); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPatchRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.fromObject(object.body, long + 1); } @@ -86042,31 +88564,35 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPatchRequest.toObject = function toObject(message, options) { + SqlInstancesPatchRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.reconcilePscNetworking != null && message.hasOwnProperty("reconcilePscNetworking")) { + if (message.reconcilePscNetworking != null && Object.hasOwnProperty.call(message, "reconcilePscNetworking")) { object.reconcilePscNetworking = message.reconcilePscNetworking; if (options.oneofs) object._reconcilePscNetworking = "reconcilePscNetworking"; } - if (message.reconcilePscNetworkingForce != null && message.hasOwnProperty("reconcilePscNetworkingForce")) { + if (message.reconcilePscNetworkingForce != null && Object.hasOwnProperty.call(message, "reconcilePscNetworkingForce")) { object.reconcilePscNetworkingForce = message.reconcilePscNetworkingForce; if (options.oneofs) object._reconcilePscNetworkingForce = "reconcilePscNetworkingForce"; } - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.body, options, q + 1); return object; }; @@ -86170,9 +88696,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPromoteReplicaRequest.encode = function encode(message, writer) { + SqlInstancesPromoteReplicaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -86192,7 +88722,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPromoteReplicaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -86270,13 +88800,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.failover != null && message.hasOwnProperty("failover")) + if (message.failover != null && Object.hasOwnProperty.call(message, "failover")) if (typeof message.failover !== "boolean") return "failover: boolean expected"; return null; @@ -86293,6 +88823,8 @@ SqlInstancesPromoteReplicaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPromoteReplicaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -86316,20 +88848,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPromoteReplicaRequest.toObject = function toObject(message, options) { + SqlInstancesPromoteReplicaRequest.toObject = function toObject(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 = ""; object.project = ""; object.failover = false; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.failover != null && message.hasOwnProperty("failover")) + if (message.failover != null && Object.hasOwnProperty.call(message, "failover")) object.failover = message.failover; return object; }; @@ -86434,15 +88970,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesSwitchoverRequest.encode = function encode(message, writer) { + SqlInstancesSwitchoverRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.dbTimeout != null && Object.hasOwnProperty.call(message, "dbTimeout")) - $root.google.protobuf.Duration.encode(message.dbTimeout, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.dbTimeout, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -86456,7 +88996,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesSwitchoverRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -86534,13 +89074,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.dbTimeout != null && message.hasOwnProperty("dbTimeout")) { + if (message.dbTimeout != null && Object.hasOwnProperty.call(message, "dbTimeout")) { var error = $root.google.protobuf.Duration.verify(message.dbTimeout, long + 1); if (error) return "dbTimeout." + error; @@ -86559,6 +89099,8 @@ SqlInstancesSwitchoverRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -86569,7 +89111,7 @@ if (object.project != null) message.project = String(object.project); if (object.dbTimeout != null) { - if (typeof object.dbTimeout !== "object") + if (!$util.isObject(object.dbTimeout)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesSwitchoverRequest.dbTimeout: object expected"); message.dbTimeout = $root.google.protobuf.Duration.fromObject(object.dbTimeout, long + 1); } @@ -86585,21 +89127,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesSwitchoverRequest.toObject = function toObject(message, options) { + SqlInstancesSwitchoverRequest.toObject = function toObject(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 = ""; object.project = ""; object.dbTimeout = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.dbTimeout != null && message.hasOwnProperty("dbTimeout")) - object.dbTimeout = $root.google.protobuf.Duration.toObject(message.dbTimeout, options); + if (message.dbTimeout != null && Object.hasOwnProperty.call(message, "dbTimeout")) + object.dbTimeout = $root.google.protobuf.Duration.toObject(message.dbTimeout, options, q + 1); return object; }; @@ -86703,9 +89249,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesResetSslConfigRequest.encode = function encode(message, writer) { + SqlInstancesResetSslConfigRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -86725,7 +89275,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesResetSslConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -86803,13 +89353,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - 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"; @@ -86832,6 +89382,8 @@ SqlInstancesResetSslConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -86873,20 +89425,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesResetSslConfigRequest.toObject = function toObject(message, options) { + SqlInstancesResetSslConfigRequest.toObject = function toObject(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 = ""; object.project = ""; object.mode = options.enums === String ? "RESET_SSL_MODE_UNSPECIFIED" : 0; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) object.mode = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode[message.mode] === undefined ? message.mode : $root.google.cloud.sql.v1beta4.SqlInstancesResetSslConfigRequest.ResetSslMode[message.mode] : message.mode; return object; }; @@ -86998,9 +89554,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRestartRequest.encode = function encode(message, writer) { + SqlInstancesRestartRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -87018,7 +89578,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRestartRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -87092,10 +89652,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -87112,6 +89672,8 @@ SqlInstancesRestartRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRestartRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRestartRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -87133,17 +89695,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRestartRequest.toObject = function toObject(message, options) { + SqlInstancesRestartRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -87248,15 +89814,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRestoreBackupRequest.encode = function encode(message, writer) { + SqlInstancesRestoreBackupRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -87270,7 +89840,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -87348,13 +89918,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -87373,6 +89943,8 @@ SqlInstancesRestoreBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -87383,7 +89955,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRestoreBackupRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.fromObject(object.body, long + 1); } @@ -87399,21 +89971,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRestoreBackupRequest.toObject = function toObject(message, options) { + SqlInstancesRestoreBackupRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.toObject(message.body, options, q + 1); return object; }; @@ -87517,15 +90093,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRotateServerCaRequest.encode = function encode(message, writer) { + SqlInstancesRotateServerCaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -87539,7 +90119,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRotateServerCaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -87617,13 +90197,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -87642,6 +90222,8 @@ SqlInstancesRotateServerCaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -87652,7 +90234,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRotateServerCaRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.fromObject(object.body, long + 1); } @@ -87668,21 +90250,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRotateServerCaRequest.toObject = function toObject(message, options) { + SqlInstancesRotateServerCaRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.toObject(message.body, options, q + 1); return object; }; @@ -87786,15 +90372,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRotateServerCertificateRequest.encode = function encode(message, writer) { + SqlInstancesRotateServerCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -87808,7 +90398,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRotateServerCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -87886,13 +90476,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -87911,6 +90501,8 @@ SqlInstancesRotateServerCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -87921,7 +90513,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRotateServerCertificateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.fromObject(object.body, long + 1); } @@ -87937,21 +90529,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRotateServerCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesRotateServerCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.toObject(message.body, options, q + 1); return object; }; @@ -88055,15 +90651,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRotateEntraIdCertificateRequest.encode = function encode(message, writer) { + SqlInstancesRotateEntraIdCertificateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -88077,7 +90677,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRotateEntraIdCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -88155,13 +90755,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -88180,6 +90780,8 @@ SqlInstancesRotateEntraIdCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -88190,7 +90792,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRotateEntraIdCertificateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.fromObject(object.body, long + 1); } @@ -88206,21 +90808,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRotateEntraIdCertificateRequest.toObject = function toObject(message, options) { + SqlInstancesRotateEntraIdCertificateRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.toObject(message.body, options, q + 1); return object; }; @@ -88315,9 +90921,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesStartReplicaRequest.encode = function encode(message, writer) { + SqlInstancesStartReplicaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -88335,7 +90945,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesStartReplicaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -88409,10 +91019,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -88429,6 +91039,8 @@ SqlInstancesStartReplicaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesStartReplicaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -88450,17 +91062,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesStartReplicaRequest.toObject = function toObject(message, options) { + SqlInstancesStartReplicaRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -88556,9 +91172,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesStopReplicaRequest.encode = function encode(message, writer) { + SqlInstancesStopReplicaRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -88576,7 +91196,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesStopReplicaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -88650,10 +91270,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -88670,6 +91290,8 @@ SqlInstancesStopReplicaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesStopReplicaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -88691,17 +91313,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesStopReplicaRequest.toObject = function toObject(message, options) { + SqlInstancesStopReplicaRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -88806,15 +91432,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesTruncateLogRequest.encode = function encode(message, writer) { + SqlInstancesTruncateLogRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -88828,7 +91458,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesTruncateLogRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -88906,13 +91536,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -88931,6 +91561,8 @@ SqlInstancesTruncateLogRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -88941,7 +91573,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesTruncateLogRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.fromObject(object.body, long + 1); } @@ -88957,21 +91589,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesTruncateLogRequest.toObject = function toObject(message, options) { + SqlInstancesTruncateLogRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest.toObject(message.body, options, q + 1); return object; }; @@ -89075,15 +91711,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesUpdateRequest.encode = function encode(message, writer) { + SqlInstancesUpdateRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -89097,7 +91737,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89175,13 +91815,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.verify(message.body, long + 1); if (error) return "body." + error; @@ -89200,6 +91840,8 @@ SqlInstancesUpdateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesUpdateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesUpdateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -89210,7 +91852,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesUpdateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.fromObject(object.body, long + 1); } @@ -89226,21 +91868,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesUpdateRequest.toObject = function toObject(message, options) { + SqlInstancesUpdateRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.body, options, q + 1); return object; }; @@ -89344,15 +91990,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesReencryptRequest.encode = function encode(message, writer) { + SqlInstancesReencryptRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesReencryptRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesReencryptRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -89366,7 +92016,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesReencryptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89444,13 +92094,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesReencryptRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -89469,6 +92119,8 @@ SqlInstancesReencryptRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesReencryptRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesReencryptRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -89479,7 +92131,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesReencryptRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesReencryptRequest.fromObject(object.body, long + 1); } @@ -89495,21 +92147,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesReencryptRequest.toObject = function toObject(message, options) { + SqlInstancesReencryptRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesReencryptRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesReencryptRequest.toObject(message.body, options, q + 1); return object; }; @@ -89604,11 +92260,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesReencryptRequest.encode = function encode(message, writer) { + InstancesReencryptRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupReencryptionConfig != null && Object.hasOwnProperty.call(message, "backupReencryptionConfig")) - $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.encode(message.backupReencryptionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.encode(message.backupReencryptionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -89622,7 +92282,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesReencryptRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89693,7 +92353,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.backupReencryptionConfig != null && message.hasOwnProperty("backupReencryptionConfig")) { + if (message.backupReencryptionConfig != null && Object.hasOwnProperty.call(message, "backupReencryptionConfig")) { properties._backupReencryptionConfig = 1; { var error = $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.verify(message.backupReencryptionConfig, long + 1); @@ -89715,13 +92375,15 @@ InstancesReencryptRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesReencryptRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesReencryptRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesReencryptRequest(); if (object.backupReencryptionConfig != null) { - if (typeof object.backupReencryptionConfig !== "object") + if (!$util.isObject(object.backupReencryptionConfig)) throw TypeError(".google.cloud.sql.v1beta4.InstancesReencryptRequest.backupReencryptionConfig: object expected"); message.backupReencryptionConfig = $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.fromObject(object.backupReencryptionConfig, long + 1); } @@ -89737,12 +92399,16 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesReencryptRequest.toObject = function toObject(message, options) { + InstancesReencryptRequest.toObject = function 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.backupReencryptionConfig != null && message.hasOwnProperty("backupReencryptionConfig")) { - object.backupReencryptionConfig = $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.toObject(message.backupReencryptionConfig, options); + if (message.backupReencryptionConfig != null && Object.hasOwnProperty.call(message, "backupReencryptionConfig")) { + object.backupReencryptionConfig = $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.toObject(message.backupReencryptionConfig, options, q + 1); if (options.oneofs) object._backupReencryptionConfig = "backupReencryptionConfig"; } @@ -89855,9 +92521,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupReencryptionConfig.encode = function encode(message, writer) { + BackupReencryptionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupLimit != null && Object.hasOwnProperty.call(message, "backupLimit")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.backupLimit); if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) @@ -89875,7 +92545,7 @@ * @returns {$protobuf.Writer} Writer */ BackupReencryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -89950,12 +92620,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.backupLimit != null && message.hasOwnProperty("backupLimit")) { + if (message.backupLimit != null && Object.hasOwnProperty.call(message, "backupLimit")) { properties._backupLimit = 1; if (!$util.isInteger(message.backupLimit)) return "backupLimit: integer expected"; } - if (message.backupType != null && message.hasOwnProperty("backupType")) { + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) { properties._backupType = 1; switch (message.backupType) { default: @@ -89980,6 +92650,8 @@ BackupReencryptionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.BackupReencryptionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.BackupReencryptionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -90019,16 +92691,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupReencryptionConfig.toObject = function toObject(message, options) { + BackupReencryptionConfig.toObject = function 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.backupLimit != null && message.hasOwnProperty("backupLimit")) { + if (message.backupLimit != null && Object.hasOwnProperty.call(message, "backupLimit")) { object.backupLimit = message.backupLimit; if (options.oneofs) object._backupLimit = "backupLimit"; } - if (message.backupType != null && message.hasOwnProperty("backupType")) { + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) { object.backupType = options.enums === String ? $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType[message.backupType] === undefined ? message.backupType : $root.google.cloud.sql.v1beta4.BackupReencryptionConfig.BackupType[message.backupType] : message.backupType; if (options.oneofs) object._backupType = "backupType"; @@ -90152,15 +92828,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRescheduleMaintenanceRequest.encode = function encode(message, writer) { + SqlInstancesRescheduleMaintenanceRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -90174,7 +92854,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRescheduleMaintenanceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -90252,13 +92932,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.verify(message.body, long + 1); if (error) return "body." + error; @@ -90277,6 +92957,8 @@ SqlInstancesRescheduleMaintenanceRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -90287,7 +92969,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.fromObject(object.body, long + 1); } @@ -90303,21 +92985,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRescheduleMaintenanceRequest.toObject = function toObject(message, options) { + SqlInstancesRescheduleMaintenanceRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.toObject(message.body, options, q + 1); return object; }; @@ -90421,15 +93107,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPerformDiskShrinkRequest.encode = function encode(message, writer) { + SqlInstancesPerformDiskShrinkRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -90443,7 +93133,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPerformDiskShrinkRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -90521,13 +93211,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext.verify(message.body, long + 1); if (error) return "body." + error; @@ -90546,6 +93236,8 @@ SqlInstancesPerformDiskShrinkRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -90556,7 +93248,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPerformDiskShrinkRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext.fromObject(object.body, long + 1); } @@ -90572,21 +93264,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPerformDiskShrinkRequest.toObject = function toObject(message, options) { + SqlInstancesPerformDiskShrinkRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext.toObject(message.body, options, q + 1); return object; }; @@ -90690,9 +93386,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalSyncSelectedObject.encode = function encode(message, writer) { + ExternalSyncSelectedObject.encode = function encode(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; @@ -90708,7 +93408,7 @@ * @returns {$protobuf.Writer} Writer */ ExternalSyncSelectedObject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -90778,7 +93478,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; @@ -90795,6 +93495,8 @@ ExternalSyncSelectedObject.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExternalSyncSelectedObject) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExternalSyncSelectedObject: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -90814,13 +93516,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExternalSyncSelectedObject.toObject = function toObject(message, options) { + ExternalSyncSelectedObject.toObject = function toObject(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; }; @@ -90994,9 +93700,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesVerifyExternalSyncSettingsRequest.encode = function encode(message, writer) { + SqlInstancesVerifyExternalSyncSettingsRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -91008,14 +93718,14 @@ if (message.verifyReplicationOnly != null && Object.hasOwnProperty.call(message, "verifyReplicationOnly")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.verifyReplicationOnly); if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) - $root.google.cloud.sql.v1beta4.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.migrationType); if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.syncParallelLevel); if (message.selectedObjects != null && message.selectedObjects.length) for (var i = 0; i < message.selectedObjects.length; ++i) - $root.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.encode(message.selectedObjects[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.encode(message.selectedObjects[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -91029,7 +93739,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesVerifyExternalSyncSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -91134,16 +93844,16 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.verifyConnectionOnly != null && message.hasOwnProperty("verifyConnectionOnly")) + if (message.verifyConnectionOnly != null && Object.hasOwnProperty.call(message, "verifyConnectionOnly")) if (typeof message.verifyConnectionOnly !== "boolean") return "verifyConnectionOnly: boolean expected"; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) switch (message.syncMode) { default: return "syncMode: enum value expected"; @@ -91152,10 +93862,10 @@ case 2: break; } - if (message.verifyReplicationOnly != null && message.hasOwnProperty("verifyReplicationOnly")) + if (message.verifyReplicationOnly != null && Object.hasOwnProperty.call(message, "verifyReplicationOnly")) if (typeof message.verifyReplicationOnly !== "boolean") return "verifyReplicationOnly: boolean expected"; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { properties.syncConfig = 1; { var error = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.verify(message.mysqlSyncConfig, long + 1); @@ -91163,7 +93873,7 @@ return "mysqlSyncConfig." + error; } } - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) switch (message.migrationType) { default: return "migrationType: enum value expected"; @@ -91172,7 +93882,7 @@ case 2: break; } - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) switch (message.syncParallelLevel) { default: return "syncParallelLevel: enum value expected"; @@ -91182,7 +93892,7 @@ case 3: break; } - if (message.selectedObjects != null && message.hasOwnProperty("selectedObjects")) { + if (message.selectedObjects != null && Object.hasOwnProperty.call(message, "selectedObjects")) { if (!Array.isArray(message.selectedObjects)) return "selectedObjects: array expected"; for (var i = 0; i < message.selectedObjects.length; ++i) { @@ -91205,6 +93915,8 @@ SqlInstancesVerifyExternalSyncSettingsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -91239,7 +93951,7 @@ if (object.verifyReplicationOnly != null) message.verifyReplicationOnly = Boolean(object.verifyReplicationOnly); if (object.mysqlSyncConfig != null) { - if (typeof object.mysqlSyncConfig !== "object") + if (!$util.isObject(object.mysqlSyncConfig)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.mysqlSyncConfig: object expected"); message.mysqlSyncConfig = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.fromObject(object.mysqlSyncConfig, long + 1); } @@ -91292,7 +94004,7 @@ throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.selectedObjects: array expected"); message.selectedObjects = []; for (var i = 0; i < object.selectedObjects.length; ++i) { - if (typeof object.selectedObjects[i] !== "object") + if (!$util.isObject(object.selectedObjects[i])) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.selectedObjects: object expected"); message.selectedObjects[i] = $root.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.fromObject(object.selectedObjects[i], long + 1); } @@ -91309,9 +94021,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesVerifyExternalSyncSettingsRequest.toObject = function toObject(message, options) { + SqlInstancesVerifyExternalSyncSettingsRequest.toObject = function toObject(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.selectedObjects = []; @@ -91324,29 +94040,29 @@ object.migrationType = options.enums === String ? "MIGRATION_TYPE_UNSPECIFIED" : 0; object.syncParallelLevel = options.enums === String ? "EXTERNAL_SYNC_PARALLEL_LEVEL_UNSPECIFIED" : 0; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.verifyConnectionOnly != null && message.hasOwnProperty("verifyConnectionOnly")) + if (message.verifyConnectionOnly != null && Object.hasOwnProperty.call(message, "verifyConnectionOnly")) object.verifyConnectionOnly = message.verifyConnectionOnly; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) object.syncMode = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] === undefined ? message.syncMode : $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] : message.syncMode; - if (message.verifyReplicationOnly != null && message.hasOwnProperty("verifyReplicationOnly")) + if (message.verifyReplicationOnly != null && Object.hasOwnProperty.call(message, "verifyReplicationOnly")) object.verifyReplicationOnly = message.verifyReplicationOnly; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { - object.mysqlSyncConfig = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options); + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { + object.mysqlSyncConfig = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options, q + 1); if (options.oneofs) object.syncConfig = "mysqlSyncConfig"; } - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) object.migrationType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] === undefined ? message.migrationType : $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] : message.migrationType; - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) object.syncParallelLevel = options.enums === String ? $root.google.cloud.sql.v1beta4.ExternalSyncParallelLevel[message.syncParallelLevel] === undefined ? message.syncParallelLevel : $root.google.cloud.sql.v1beta4.ExternalSyncParallelLevel[message.syncParallelLevel] : message.syncParallelLevel; if (message.selectedObjects && message.selectedObjects.length) { object.selectedObjects = []; for (var j = 0; j < message.selectedObjects.length; ++j) - object.selectedObjects[j] = $root.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.toObject(message.selectedObjects[j], options); + object.selectedObjects[j] = $root.google.cloud.sql.v1beta4.ExternalSyncSelectedObject.toObject(message.selectedObjects[j], options, q + 1); } return object; }; @@ -91542,9 +94258,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesStartExternalSyncRequest.encode = function encode(message, writer) { + SqlInstancesStartExternalSyncRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -91554,7 +94274,7 @@ if (message.skipVerification != null && Object.hasOwnProperty.call(message, "skipVerification")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.skipVerification); if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) - $root.google.cloud.sql.v1beta4.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.MySqlSyncConfig.encode(message.mysqlSyncConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.syncParallelLevel); if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) @@ -91574,7 +94294,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesStartExternalSyncRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -91673,13 +94393,13 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) switch (message.syncMode) { default: return "syncMode: enum value expected"; @@ -91688,10 +94408,10 @@ case 2: break; } - if (message.skipVerification != null && message.hasOwnProperty("skipVerification")) + if (message.skipVerification != null && Object.hasOwnProperty.call(message, "skipVerification")) if (typeof message.skipVerification !== "boolean") return "skipVerification: boolean expected"; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { properties.syncConfig = 1; { var error = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.verify(message.mysqlSyncConfig, long + 1); @@ -91699,7 +94419,7 @@ return "mysqlSyncConfig." + error; } } - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) switch (message.syncParallelLevel) { default: return "syncParallelLevel: enum value expected"; @@ -91709,7 +94429,7 @@ case 3: break; } - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) switch (message.migrationType) { default: return "migrationType: enum value expected"; @@ -91718,7 +94438,7 @@ case 2: break; } - if (message.replicaOverwriteEnabled != null && message.hasOwnProperty("replicaOverwriteEnabled")) + if (message.replicaOverwriteEnabled != null && Object.hasOwnProperty.call(message, "replicaOverwriteEnabled")) if (typeof message.replicaOverwriteEnabled !== "boolean") return "replicaOverwriteEnabled: boolean expected"; return null; @@ -91735,6 +94455,8 @@ SqlInstancesStartExternalSyncRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -91767,7 +94489,7 @@ if (object.skipVerification != null) message.skipVerification = Boolean(object.skipVerification); if (object.mysqlSyncConfig != null) { - if (typeof object.mysqlSyncConfig !== "object") + if (!$util.isObject(object.mysqlSyncConfig)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesStartExternalSyncRequest.mysqlSyncConfig: object expected"); message.mysqlSyncConfig = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.fromObject(object.mysqlSyncConfig, long + 1); } @@ -91829,9 +94551,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesStartExternalSyncRequest.toObject = function toObject(message, options) { + SqlInstancesStartExternalSyncRequest.toObject = function toObject(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 = ""; @@ -91842,24 +94568,24 @@ object.migrationType = options.enums === String ? "MIGRATION_TYPE_UNSPECIFIED" : 0; object.replicaOverwriteEnabled = false; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.syncMode != null && message.hasOwnProperty("syncMode")) + if (message.syncMode != null && Object.hasOwnProperty.call(message, "syncMode")) object.syncMode = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] === undefined ? message.syncMode : $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.ExternalSyncMode[message.syncMode] : message.syncMode; - if (message.skipVerification != null && message.hasOwnProperty("skipVerification")) + if (message.skipVerification != null && Object.hasOwnProperty.call(message, "skipVerification")) object.skipVerification = message.skipVerification; - if (message.mysqlSyncConfig != null && message.hasOwnProperty("mysqlSyncConfig")) { - object.mysqlSyncConfig = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options); + if (message.mysqlSyncConfig != null && Object.hasOwnProperty.call(message, "mysqlSyncConfig")) { + object.mysqlSyncConfig = $root.google.cloud.sql.v1beta4.MySqlSyncConfig.toObject(message.mysqlSyncConfig, options, q + 1); if (options.oneofs) object.syncConfig = "mysqlSyncConfig"; } - if (message.syncParallelLevel != null && message.hasOwnProperty("syncParallelLevel")) + if (message.syncParallelLevel != null && Object.hasOwnProperty.call(message, "syncParallelLevel")) object.syncParallelLevel = options.enums === String ? $root.google.cloud.sql.v1beta4.ExternalSyncParallelLevel[message.syncParallelLevel] === undefined ? message.syncParallelLevel : $root.google.cloud.sql.v1beta4.ExternalSyncParallelLevel[message.syncParallelLevel] : message.syncParallelLevel; - if (message.migrationType != null && message.hasOwnProperty("migrationType")) + if (message.migrationType != null && Object.hasOwnProperty.call(message, "migrationType")) object.migrationType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] === undefined ? message.migrationType : $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest.MigrationType[message.migrationType] : message.migrationType; - if (message.replicaOverwriteEnabled != null && message.hasOwnProperty("replicaOverwriteEnabled")) + if (message.replicaOverwriteEnabled != null && Object.hasOwnProperty.call(message, "replicaOverwriteEnabled")) object.replicaOverwriteEnabled = message.replicaOverwriteEnabled; return object; }; @@ -91955,9 +94681,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesResetReplicaSizeRequest.encode = function encode(message, writer) { + SqlInstancesResetReplicaSizeRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -91975,7 +94705,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesResetReplicaSizeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -92049,10 +94779,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -92069,6 +94799,8 @@ SqlInstancesResetReplicaSizeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesResetReplicaSizeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -92090,17 +94822,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesResetReplicaSizeRequest.toObject = function toObject(message, options) { + SqlInstancesResetReplicaSizeRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -92196,9 +94932,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOperationsGetRequest.encode = function encode(message, writer) { + SqlOperationsGetRequest.encode = function encode(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); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -92216,7 +94956,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOperationsGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -92290,10 +95030,10 @@ 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"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -92310,6 +95050,8 @@ SqlOperationsGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlOperationsGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlOperationsGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -92331,17 +95073,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOperationsGetRequest.toObject = function toObject(message, options) { + SqlOperationsGetRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) object.operation = message.operation; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -92455,9 +95201,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOperationsListRequest.encode = function encode(message, writer) { + SqlOperationsListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) @@ -92479,7 +95229,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOperationsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -92561,16 +95311,16 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) if (!$util.isInteger(message.maxResults)) return "maxResults: 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -92587,6 +95337,8 @@ SqlOperationsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlOperationsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlOperationsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -92612,9 +95364,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOperationsListRequest.toObject = function toObject(message, options) { + SqlOperationsListRequest.toObject = function toObject(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 = ""; @@ -92622,13 +95378,13 @@ object.pageToken = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) object.maxResults = message.maxResults; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) object.pageToken = message.pageToken; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -92724,9 +95480,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOperationsCancelRequest.encode = function encode(message, writer) { + SqlOperationsCancelRequest.encode = function encode(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); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -92744,7 +95504,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOperationsCancelRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -92818,10 +95578,10 @@ 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"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -92838,6 +95598,8 @@ SqlOperationsCancelRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlOperationsCancelRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlOperationsCancelRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -92859,17 +95621,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOperationsCancelRequest.toObject = function toObject(message, options) { + SqlOperationsCancelRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.operation != null && message.hasOwnProperty("operation")) + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) object.operation = message.operation; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -92974,15 +95740,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesCreateEphemeralCertRequest.encode = function encode(message, writer) { + SqlInstancesCreateEphemeralCertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -92996,7 +95766,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesCreateEphemeralCertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -93074,13 +95844,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -93099,6 +95869,8 @@ SqlInstancesCreateEphemeralCertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -93109,7 +95881,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesCreateEphemeralCertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.fromObject(object.body, long + 1); } @@ -93125,21 +95897,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesCreateEphemeralCertRequest.toObject = function toObject(message, options) { + SqlInstancesCreateEphemeralCertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest.toObject(message.body, options, q + 1); return object; }; @@ -93243,9 +96019,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsDeleteRequest.encode = function encode(message, writer) { + SqlSslCertsDeleteRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -93265,7 +96045,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -93343,13 +96123,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) if (!$util.isString(message.sha1Fingerprint)) return "sha1Fingerprint: string expected"; return null; @@ -93366,6 +96146,8 @@ SqlSslCertsDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlSslCertsDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -93389,20 +96171,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsDeleteRequest.toObject = function toObject(message, options) { + SqlSslCertsDeleteRequest.toObject = function toObject(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 = ""; object.project = ""; object.sha1Fingerprint = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) object.sha1Fingerprint = message.sha1Fingerprint; return object; }; @@ -93507,9 +96293,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsGetRequest.encode = function encode(message, writer) { + SqlSslCertsGetRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -93529,7 +96319,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -93607,13 +96397,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) if (!$util.isString(message.sha1Fingerprint)) return "sha1Fingerprint: string expected"; return null; @@ -93630,6 +96420,8 @@ SqlSslCertsGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlSslCertsGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlSslCertsGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -93653,20 +96445,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsGetRequest.toObject = function toObject(message, options) { + SqlSslCertsGetRequest.toObject = function toObject(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 = ""; object.project = ""; object.sha1Fingerprint = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) object.sha1Fingerprint = message.sha1Fingerprint; return object; }; @@ -93771,15 +96567,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsInsertRequest.encode = function encode(message, writer) { + SqlSslCertsInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.SslCertsInsertRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCertsInsertRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -93793,7 +96593,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -93871,13 +96671,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.SslCertsInsertRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -93896,6 +96696,8 @@ SqlSslCertsInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlSslCertsInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlSslCertsInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -93906,7 +96708,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlSslCertsInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.SslCertsInsertRequest.fromObject(object.body, long + 1); } @@ -93922,21 +96724,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsInsertRequest.toObject = function toObject(message, options) { + SqlSslCertsInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.SslCertsInsertRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.SslCertsInsertRequest.toObject(message.body, options, q + 1); return object; }; @@ -94031,9 +96837,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSslCertsListRequest.encode = function encode(message, writer) { + SqlSslCertsListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -94051,7 +96861,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSslCertsListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -94125,10 +96935,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -94145,6 +96955,8 @@ SqlSslCertsListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlSslCertsListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlSslCertsListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -94166,17 +96978,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSslCertsListRequest.toObject = function toObject(message, options) { + SqlSslCertsListRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -94272,9 +97088,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetDiskShrinkConfigRequest.encode = function encode(message, writer) { + SqlInstancesGetDiskShrinkConfigRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -94292,7 +97112,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetDiskShrinkConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -94366,10 +97186,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -94386,6 +97206,8 @@ SqlInstancesGetDiskShrinkConfigRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -94407,17 +97229,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetDiskShrinkConfigRequest.toObject = function toObject(message, options) { + SqlInstancesGetDiskShrinkConfigRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -94531,15 +97357,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetLatestRecoveryTimeRequest.encode = function encode(message, writer) { + SqlInstancesGetLatestRecoveryTimeRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) - $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -94553,7 +97383,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetLatestRecoveryTimeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -94632,13 +97462,13 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { properties._sourceInstanceDeletionTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.sourceInstanceDeletionTime, long + 1); @@ -94660,6 +97490,8 @@ SqlInstancesGetLatestRecoveryTimeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -94670,7 +97502,7 @@ if (object.project != null) message.project = String(object.project); if (object.sourceInstanceDeletionTime != null) { - if (typeof object.sourceInstanceDeletionTime !== "object") + if (!$util.isObject(object.sourceInstanceDeletionTime)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeRequest.sourceInstanceDeletionTime: object expected"); message.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.fromObject(object.sourceInstanceDeletionTime, long + 1); } @@ -94686,20 +97518,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetLatestRecoveryTimeRequest.toObject = function toObject(message, options) { + SqlInstancesGetLatestRecoveryTimeRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { - object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options); + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { + object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options, q + 1); if (options.oneofs) object._sourceInstanceDeletionTime = "sourceInstanceDeletionTime"; } @@ -94806,15 +97642,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetLatestRecoveryTimeResponse.encode = function encode(message, writer) { + SqlInstancesGetLatestRecoveryTimeResponse.encode = function encode(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.latestRecoveryTime != null && Object.hasOwnProperty.call(message, "latestRecoveryTime")) - $root.google.protobuf.Timestamp.encode(message.latestRecoveryTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.latestRecoveryTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.earliestRecoveryTime != null && Object.hasOwnProperty.call(message, "earliestRecoveryTime")) - $root.google.protobuf.Timestamp.encode(message.earliestRecoveryTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.earliestRecoveryTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -94828,7 +97668,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetLatestRecoveryTimeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -94906,15 +97746,15 @@ 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.latestRecoveryTime != null && message.hasOwnProperty("latestRecoveryTime")) { + if (message.latestRecoveryTime != null && Object.hasOwnProperty.call(message, "latestRecoveryTime")) { var error = $root.google.protobuf.Timestamp.verify(message.latestRecoveryTime, long + 1); if (error) return "latestRecoveryTime." + error; } - if (message.earliestRecoveryTime != null && message.hasOwnProperty("earliestRecoveryTime")) { + if (message.earliestRecoveryTime != null && Object.hasOwnProperty.call(message, "earliestRecoveryTime")) { var error = $root.google.protobuf.Timestamp.verify(message.earliestRecoveryTime, long + 1); if (error) return "earliestRecoveryTime." + error; @@ -94933,6 +97773,8 @@ SqlInstancesGetLatestRecoveryTimeResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -94941,12 +97783,12 @@ if (object.kind != null) message.kind = String(object.kind); if (object.latestRecoveryTime != null) { - if (typeof object.latestRecoveryTime !== "object") + if (!$util.isObject(object.latestRecoveryTime)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.latestRecoveryTime: object expected"); message.latestRecoveryTime = $root.google.protobuf.Timestamp.fromObject(object.latestRecoveryTime, long + 1); } if (object.earliestRecoveryTime != null) { - if (typeof object.earliestRecoveryTime !== "object") + if (!$util.isObject(object.earliestRecoveryTime)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetLatestRecoveryTimeResponse.earliestRecoveryTime: object expected"); message.earliestRecoveryTime = $root.google.protobuf.Timestamp.fromObject(object.earliestRecoveryTime, long + 1); } @@ -94962,21 +97804,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetLatestRecoveryTimeResponse.toObject = function toObject(message, options) { + SqlInstancesGetLatestRecoveryTimeResponse.toObject = function toObject(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.latestRecoveryTime = null; object.earliestRecoveryTime = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.latestRecoveryTime != null && message.hasOwnProperty("latestRecoveryTime")) - object.latestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.latestRecoveryTime, options); - if (message.earliestRecoveryTime != null && message.hasOwnProperty("earliestRecoveryTime")) - object.earliestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.earliestRecoveryTime, options); + if (message.latestRecoveryTime != null && Object.hasOwnProperty.call(message, "latestRecoveryTime")) + object.latestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.latestRecoveryTime, options, q + 1); + if (message.earliestRecoveryTime != null && Object.hasOwnProperty.call(message, "earliestRecoveryTime")) + object.earliestRecoveryTime = $root.google.protobuf.Timestamp.toObject(message.earliestRecoveryTime, options, q + 1); return object; }; @@ -95080,15 +97926,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesExecuteSqlRequest.encode = function encode(message, writer) { + SqlInstancesExecuteSqlRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -95102,7 +97952,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesExecuteSqlRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -95180,13 +98030,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.verify(message.body, long + 1); if (error) return "body." + error; @@ -95205,6 +98055,8 @@ SqlInstancesExecuteSqlRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -95215,7 +98067,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.fromObject(object.body, long + 1); } @@ -95231,21 +98083,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesExecuteSqlRequest.toObject = function toObject(message, options) { + SqlInstancesExecuteSqlRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.toObject(message.body, options, q + 1); return object; }; @@ -95340,9 +98196,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesReleaseSsrsLeaseRequest.encode = function encode(message, writer) { + SqlInstancesReleaseSsrsLeaseRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -95360,7 +98220,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesReleaseSsrsLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -95434,10 +98294,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -95454,6 +98314,8 @@ SqlInstancesReleaseSsrsLeaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -95475,17 +98337,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesReleaseSsrsLeaseRequest.toObject = function toObject(message, options) { + SqlInstancesReleaseSsrsLeaseRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -95572,9 +98438,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesReleaseSsrsLeaseResponse.encode = function encode(message, writer) { + SqlInstancesReleaseSsrsLeaseResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.operationId); return writer; @@ -95590,7 +98460,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesReleaseSsrsLeaseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -95660,7 +98530,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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"; return null; @@ -95677,6 +98547,8 @@ SqlInstancesReleaseSsrsLeaseResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesReleaseSsrsLeaseResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -95696,13 +98568,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesReleaseSsrsLeaseResponse.toObject = function toObject(message, options) { + SqlInstancesReleaseSsrsLeaseResponse.toObject = function toObject(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.operationId = ""; - if (message.operationId != null && message.hasOwnProperty("operationId")) + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) object.operationId = message.operationId; return object; }; @@ -95857,9 +98733,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteSqlPayload.encode = function encode(message, writer) { + ExecuteSqlPayload.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.user != null && Object.hasOwnProperty.call(message, "user")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.user); if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) @@ -95887,7 +98767,7 @@ * @returns {$protobuf.Writer} Writer */ ExecuteSqlPayload.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -95982,24 +98862,24 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) if (!$util.isString(message.user)) return "user: string expected"; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) if (!$util.isString(message.sqlStatement)) return "sqlStatement: 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.autoIamAuthn != null && message.hasOwnProperty("autoIamAuthn")) { + if (message.autoIamAuthn != null && Object.hasOwnProperty.call(message, "autoIamAuthn")) { properties.userPassword = 1; if (typeof message.autoIamAuthn !== "boolean") return "autoIamAuthn: boolean expected"; } - if (message.rowLimit != null && message.hasOwnProperty("rowLimit")) + if (message.rowLimit != null && Object.hasOwnProperty.call(message, "rowLimit")) if (!$util.isInteger(message.rowLimit) && !(message.rowLimit && $util.isInteger(message.rowLimit.low) && $util.isInteger(message.rowLimit.high))) return "rowLimit: integer|Long expected"; - if (message.partialResultMode != null && message.hasOwnProperty("partialResultMode")) + if (message.partialResultMode != null && Object.hasOwnProperty.call(message, "partialResultMode")) switch (message.partialResultMode) { default: return "partialResultMode: enum value expected"; @@ -96008,7 +98888,7 @@ case 2: break; } - if (message.application != null && message.hasOwnProperty("application")) + if (message.application != null && Object.hasOwnProperty.call(message, "application")) if (!$util.isString(message.application)) return "application: string expected"; return null; @@ -96025,6 +98905,8 @@ ExecuteSqlPayload.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExecuteSqlPayload) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExecuteSqlPayload: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -96040,7 +98922,7 @@ message.autoIamAuthn = Boolean(object.autoIamAuthn); if (object.rowLimit != null) if ($util.Long) - (message.rowLimit = $util.Long.fromValue(object.rowLimit)).unsigned = false; + message.rowLimit = $util.Long.fromValue(object.rowLimit, false); else if (typeof object.rowLimit === "string") message.rowLimit = parseInt(object.rowLimit, 10); else if (typeof object.rowLimit === "number") @@ -96081,9 +98963,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteSqlPayload.toObject = function toObject(message, options) { + ExecuteSqlPayload.toObject = function toObject(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.user = ""; @@ -96091,31 +98977,33 @@ object.database = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.rowLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.rowLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.rowLimit = options.longs === String ? "0" : 0; + object.rowLimit = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.partialResultMode = options.enums === String ? "PARTIAL_RESULT_MODE_UNSPECIFIED" : 0; object.application = ""; } - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) object.user = message.user; - if (message.sqlStatement != null && message.hasOwnProperty("sqlStatement")) + if (message.sqlStatement != null && Object.hasOwnProperty.call(message, "sqlStatement")) object.sqlStatement = message.sqlStatement; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.rowLimit != null && message.hasOwnProperty("rowLimit")) - if (typeof message.rowLimit === "number") + if (message.rowLimit != null && Object.hasOwnProperty.call(message, "rowLimit")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.rowLimit = typeof message.rowLimit === "number" ? BigInt(message.rowLimit) : $util.Long.fromBits(message.rowLimit.low >>> 0, message.rowLimit.high >>> 0, false).toBigInt(); + else if (typeof message.rowLimit === "number") object.rowLimit = options.longs === String ? String(message.rowLimit) : message.rowLimit; else object.rowLimit = options.longs === String ? $util.Long.prototype.toString.call(message.rowLimit) : options.longs === Number ? new $util.LongBits(message.rowLimit.low >>> 0, message.rowLimit.high >>> 0).toNumber() : message.rowLimit; - if (message.autoIamAuthn != null && message.hasOwnProperty("autoIamAuthn")) { + if (message.autoIamAuthn != null && Object.hasOwnProperty.call(message, "autoIamAuthn")) { object.autoIamAuthn = message.autoIamAuthn; if (options.oneofs) object.userPassword = "autoIamAuthn"; } - if (message.partialResultMode != null && message.hasOwnProperty("partialResultMode")) + if (message.partialResultMode != null && Object.hasOwnProperty.call(message, "partialResultMode")) object.partialResultMode = options.enums === String ? $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode[message.partialResultMode] === undefined ? message.partialResultMode : $root.google.cloud.sql.v1beta4.ExecuteSqlPayload.PartialResultMode[message.partialResultMode] : message.partialResultMode; - if (message.application != null && message.hasOwnProperty("application")) + if (message.application != null && Object.hasOwnProperty.call(message, "application")) object.application = message.application; return object; }; @@ -96247,19 +99135,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesExecuteSqlResponse.encode = function encode(message, writer) { + SqlInstancesExecuteSqlResponse.encode = function encode(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.cloud.sql.v1beta4.Metadata.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Metadata.encode(message.metadata, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.results != null && message.results.length) for (var i = 0; i < message.results.length; ++i) - $root.google.cloud.sql.v1beta4.QueryResult.encode(message.results[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.QueryResult.encode(message.results[i], writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.messages != null && message.messages.length) for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.encode(message.messages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.encode(message.messages[i], writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -96273,7 +99165,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesExecuteSqlResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -96359,7 +99251,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.messages != null && message.hasOwnProperty("messages")) { + if (message.messages != null && Object.hasOwnProperty.call(message, "messages")) { if (!Array.isArray(message.messages)) return "messages: array expected"; for (var i = 0; i < message.messages.length; ++i) { @@ -96368,12 +99260,12 @@ return "messages." + error; } } - if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) { var error = $root.google.cloud.sql.v1beta4.Metadata.verify(message.metadata, long + 1); if (error) return "metadata." + error; } - if (message.results != null && message.hasOwnProperty("results")) { + if (message.results != null && Object.hasOwnProperty.call(message, "results")) { if (!Array.isArray(message.results)) return "results: array expected"; for (var i = 0; i < message.results.length; ++i) { @@ -96382,7 +99274,7 @@ return "results." + 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; @@ -96401,6 +99293,8 @@ SqlInstancesExecuteSqlResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -96411,13 +99305,13 @@ throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.messages: array expected"); message.messages = []; for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") + if (!$util.isObject(object.messages[i])) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.messages: object expected"); message.messages[i] = $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.fromObject(object.messages[i], long + 1); } } if (object.metadata != null) { - if (typeof object.metadata !== "object") + if (!$util.isObject(object.metadata)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.metadata: object expected"); message.metadata = $root.google.cloud.sql.v1beta4.Metadata.fromObject(object.metadata, long + 1); } @@ -96426,13 +99320,13 @@ throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.results: array expected"); message.results = []; for (var i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") + if (!$util.isObject(object.results[i])) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.results: object expected"); message.results[i] = $root.google.cloud.sql.v1beta4.QueryResult.fromObject(object.results[i], long + 1); } } if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } @@ -96448,9 +99342,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesExecuteSqlResponse.toObject = function toObject(message, options) { + SqlInstancesExecuteSqlResponse.toObject = function toObject(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.results = []; @@ -96460,19 +99358,19 @@ object.metadata = null; object.status = null; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.sql.v1beta4.Metadata.toObject(message.metadata, options); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + object.metadata = $root.google.cloud.sql.v1beta4.Metadata.toObject(message.metadata, options, q + 1); if (message.results && message.results.length) { object.results = []; for (var j = 0; j < message.results.length; ++j) - object.results[j] = $root.google.cloud.sql.v1beta4.QueryResult.toObject(message.results[j], options); + object.results[j] = $root.google.cloud.sql.v1beta4.QueryResult.toObject(message.results[j], options, q + 1); } - 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 (message.messages && message.messages.length) { object.messages = []; for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.toObject(message.messages[j], options); + object.messages[j] = $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message.toObject(message.messages[j], options, q + 1); } return object; }; @@ -96580,9 +99478,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Message.encode = function encode(message, writer) { + Message.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) @@ -96600,7 +99502,7 @@ * @returns {$protobuf.Writer} Writer */ Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -96675,12 +99577,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { properties._message = 1; if (!$util.isString(message.message)) return "message: string expected"; } - if (message.severity != null && message.hasOwnProperty("severity")) { + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) { properties._severity = 1; if (!$util.isString(message.severity)) return "severity: string expected"; @@ -96699,6 +99601,8 @@ Message.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesExecuteSqlResponse.Message: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -96720,16 +99624,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Message.toObject = function toObject(message, options) { + Message.toObject = function 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.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { object.message = message.message; if (options.oneofs) object._message = "message"; } - if (message.severity != null && message.hasOwnProperty("severity")) { + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) { object.severity = message.severity; if (options.oneofs) object._severity = "severity"; @@ -96860,21 +99768,25 @@ * @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.columns != null && message.columns.length) for (var i = 0; i < message.columns.length; ++i) - $root.google.cloud.sql.v1beta4.Column.encode(message.columns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Column.encode(message.columns[i], 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.cloud.sql.v1beta4.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.message); if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.partialResult); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -96888,7 +99800,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(); }; /** @@ -96978,7 +99890,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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) { @@ -96987,7 +99899,7 @@ return "columns." + 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) { @@ -96996,13 +99908,13 @@ return "rows." + error; } } - 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.partialResult != null && message.hasOwnProperty("partialResult")) + if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) if (typeof message.partialResult !== "boolean") return "partialResult: boolean 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; @@ -97021,6 +99933,8 @@ QueryResult.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.QueryResult) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.QueryResult: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -97031,7 +99945,7 @@ throw TypeError(".google.cloud.sql.v1beta4.QueryResult.columns: array expected"); message.columns = []; for (var i = 0; i < object.columns.length; ++i) { - if (typeof object.columns[i] !== "object") + if (!$util.isObject(object.columns[i])) throw TypeError(".google.cloud.sql.v1beta4.QueryResult.columns: object expected"); message.columns[i] = $root.google.cloud.sql.v1beta4.Column.fromObject(object.columns[i], long + 1); } @@ -97041,7 +99955,7 @@ throw TypeError(".google.cloud.sql.v1beta4.QueryResult.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.cloud.sql.v1beta4.QueryResult.rows: object expected"); message.rows[i] = $root.google.cloud.sql.v1beta4.Row.fromObject(object.rows[i], long + 1); } @@ -97051,7 +99965,7 @@ if (object.partialResult != null) message.partialResult = Boolean(object.partialResult); if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.cloud.sql.v1beta4.QueryResult.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } @@ -97067,9 +99981,13 @@ * @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.columns = []; @@ -97083,19 +100001,19 @@ if (message.columns && message.columns.length) { object.columns = []; for (var j = 0; j < message.columns.length; ++j) - object.columns[j] = $root.google.cloud.sql.v1beta4.Column.toObject(message.columns[j], options); + object.columns[j] = $root.google.cloud.sql.v1beta4.Column.toObject(message.columns[j], 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.cloud.sql.v1beta4.Row.toObject(message.rows[j], options); + object.rows[j] = $root.google.cloud.sql.v1beta4.Row.toObject(message.rows[j], options, q + 1); } - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) object.message = message.message; - if (message.partialResult != null && message.hasOwnProperty("partialResult")) + if (message.partialResult != null && Object.hasOwnProperty.call(message, "partialResult")) object.partialResult = message.partialResult; - 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; }; @@ -97190,9 +100108,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Column.encode = function encode(message, writer) { + Column.encode = function encode(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")) @@ -97210,7 +100132,7 @@ * @returns {$protobuf.Writer} Writer */ Column.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -97284,10 +100206,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")) if (!$util.isString(message.type)) return "type: string expected"; return null; @@ -97304,6 +100226,8 @@ Column.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Column) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Column: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -97325,17 +100249,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Column.toObject = function toObject(message, options) { + Column.toObject = function toObject(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 = ""; } - 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; return object; }; @@ -97423,12 +100351,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Row.encode = function encode(message, writer) { + Row.encode = function encode(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.cloud.sql.v1beta4.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -97442,7 +100374,7 @@ * @returns {$protobuf.Writer} Writer */ Row.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -97514,7 +100446,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) { @@ -97537,6 +100469,8 @@ Row.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Row) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Row: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -97547,7 +100481,7 @@ throw TypeError(".google.cloud.sql.v1beta4.Row.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.cloud.sql.v1beta4.Row.values: object expected"); message.values[i] = $root.google.cloud.sql.v1beta4.Value.fromObject(object.values[i], long + 1); } @@ -97564,16 +100498,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Row.toObject = function toObject(message, options) { + Row.toObject = function toObject(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.cloud.sql.v1beta4.Value.toObject(message.values[j], options); + object.values[j] = $root.google.cloud.sql.v1beta4.Value.toObject(message.values[j], options, q + 1); } return object; }; @@ -97669,9 +100607,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.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) @@ -97689,7 +100631,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(); }; /** @@ -97763,10 +100705,10 @@ 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 (!$util.isString(message.value)) return "value: string expected"; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) if (typeof message.nullValue !== "boolean") return "nullValue: boolean expected"; return null; @@ -97783,6 +100725,8 @@ Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -97804,17 +100748,21 @@ * @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 (options.defaults) { object.value = ""; object.nullValue = false; } - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) object.nullValue = message.nullValue; return object; }; @@ -97901,11 +100849,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Metadata.encode = function encode(message, writer) { + Metadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sqlStatementExecutionTime != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionTime")) - $root.google.protobuf.Duration.encode(message.sqlStatementExecutionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.sqlStatementExecutionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -97919,7 +100871,7 @@ * @returns {$protobuf.Writer} Writer */ Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -97989,7 +100941,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.sqlStatementExecutionTime != null && message.hasOwnProperty("sqlStatementExecutionTime")) { + if (message.sqlStatementExecutionTime != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionTime")) { var error = $root.google.protobuf.Duration.verify(message.sqlStatementExecutionTime, long + 1); if (error) return "sqlStatementExecutionTime." + error; @@ -98008,13 +100960,15 @@ Metadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Metadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Metadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.Metadata(); if (object.sqlStatementExecutionTime != null) { - if (typeof object.sqlStatementExecutionTime !== "object") + if (!$util.isObject(object.sqlStatementExecutionTime)) throw TypeError(".google.cloud.sql.v1beta4.Metadata.sqlStatementExecutionTime: object expected"); message.sqlStatementExecutionTime = $root.google.protobuf.Duration.fromObject(object.sqlStatementExecutionTime, long + 1); } @@ -98030,14 +100984,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Metadata.toObject = function toObject(message, options) { + Metadata.toObject = function toObject(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.sqlStatementExecutionTime = null; - if (message.sqlStatementExecutionTime != null && message.hasOwnProperty("sqlStatementExecutionTime")) - object.sqlStatementExecutionTime = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionTime, options); + if (message.sqlStatementExecutionTime != null && Object.hasOwnProperty.call(message, "sqlStatementExecutionTime")) + object.sqlStatementExecutionTime = $root.google.protobuf.Duration.toObject(message.sqlStatementExecutionTime, options, q + 1); return object; }; @@ -98141,15 +101099,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAcquireSsrsLeaseRequest.encode = function encode(message, writer) { + SqlInstancesAcquireSsrsLeaseRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -98163,7 +101125,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAcquireSsrsLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -98241,13 +101203,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -98266,6 +101228,8 @@ SqlInstancesAcquireSsrsLeaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -98276,7 +101240,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.fromObject(object.body, long + 1); } @@ -98292,21 +101256,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAcquireSsrsLeaseRequest.toObject = function toObject(message, options) { + SqlInstancesAcquireSsrsLeaseRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.toObject(message.body, options, q + 1); return object; }; @@ -98410,15 +101378,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(message, writer) { + SqlInstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.encode(message.body, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -98432,7 +101404,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPreCheckMajorVersionUpgradeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -98510,13 +101482,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.verify(message.body, long + 1); if (error) return "body." + error; @@ -98535,6 +101507,8 @@ SqlInstancesPreCheckMajorVersionUpgradeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -98545,7 +101519,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.fromObject(object.body, long + 1); } @@ -98561,21 +101535,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(message, options) { + SqlInstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.toObject(message.body, options, q + 1); return object; }; @@ -98670,9 +101648,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesAcquireSsrsLeaseResponse.encode = function encode(message, writer) { + SqlInstancesAcquireSsrsLeaseResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.operationId); return writer; @@ -98688,7 +101670,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesAcquireSsrsLeaseResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -98759,7 +101741,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.operationId != null && message.hasOwnProperty("operationId")) { + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) { properties._operationId = 1; if (!$util.isString(message.operationId)) return "operationId: string expected"; @@ -98778,6 +101760,8 @@ SqlInstancesAcquireSsrsLeaseResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesAcquireSsrsLeaseResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -98797,11 +101781,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesAcquireSsrsLeaseResponse.toObject = function toObject(message, options) { + SqlInstancesAcquireSsrsLeaseResponse.toObject = function 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.operationId != null && message.hasOwnProperty("operationId")) { + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) { object.operationId = message.operationId; if (options.oneofs) object._operationId = "operationId"; @@ -98900,13 +101888,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesPointInTimeRestoreRequest.encode = function encode(message, writer) { + SqlInstancesPointInTimeRestoreRequest.encode = function encode(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.context != null && Object.hasOwnProperty.call(message, "context")) - $root.google.cloud.sql.v1beta4.PointInTimeRestoreContext.encode(message.context, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PointInTimeRestoreContext.encode(message.context, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -98920,7 +101912,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesPointInTimeRestoreRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -98994,10 +101986,10 @@ 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.context != null && message.hasOwnProperty("context")) { + if (message.context != null && Object.hasOwnProperty.call(message, "context")) { var error = $root.google.cloud.sql.v1beta4.PointInTimeRestoreContext.verify(message.context, long + 1); if (error) return "context." + error; @@ -99016,6 +102008,8 @@ SqlInstancesPointInTimeRestoreRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -99024,7 +102018,7 @@ if (object.parent != null) message.parent = String(object.parent); if (object.context != null) { - if (typeof object.context !== "object") + if (!$util.isObject(object.context)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesPointInTimeRestoreRequest.context: object expected"); message.context = $root.google.cloud.sql.v1beta4.PointInTimeRestoreContext.fromObject(object.context, long + 1); } @@ -99040,18 +102034,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesPointInTimeRestoreRequest.toObject = function toObject(message, options) { + SqlInstancesPointInTimeRestoreRequest.toObject = function toObject(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.context = null; } - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) object.parent = message.parent; - if (message.context != null && message.hasOwnProperty("context")) - object.context = $root.google.cloud.sql.v1beta4.PointInTimeRestoreContext.toObject(message.context, options); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + object.context = $root.google.cloud.sql.v1beta4.PointInTimeRestoreContext.toObject(message.context, options, q + 1); return object; }; @@ -99164,13 +102162,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AclEntry.encode = function encode(message, writer) { + AclEntry.encode = function encode(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 1, wireType 2 =*/10).string(message.value); if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) - $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -99188,7 +102190,7 @@ * @returns {$protobuf.Writer} Writer */ AclEntry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -99270,18 +102272,18 @@ 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 (!$util.isString(message.value)) return "value: string expected"; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) { + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expirationTime, long + 1); if (error) return "expirationTime." + 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.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) if (!$util.isString(message.kind)) return "kind: string expected"; return null; @@ -99298,6 +102300,8 @@ AclEntry.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.AclEntry) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.AclEntry: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -99306,7 +102310,7 @@ if (object.value != null) message.value = String(object.value); if (object.expirationTime != null) { - if (typeof object.expirationTime !== "object") + if (!$util.isObject(object.expirationTime)) throw TypeError(".google.cloud.sql.v1beta4.AclEntry.expirationTime: object expected"); message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime, long + 1); } @@ -99326,9 +102330,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AclEntry.toObject = function toObject(message, options) { + AclEntry.toObject = function toObject(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 = ""; @@ -99336,13 +102344,13 @@ object.name = ""; object.kind = ""; } - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) - object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options); - if (message.name != null && message.hasOwnProperty("name")) + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options, q + 1); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -99447,9 +102455,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ApiWarning.encode = function encode(message, writer) { + ApiWarning.encode = function encode(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")) @@ -99469,7 +102481,7 @@ * @returns {$protobuf.Writer} Writer */ ApiWarning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -99547,7 +102559,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"; @@ -99558,10 +102570,10 @@ case 4: break; } - 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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; return null; @@ -99578,6 +102590,8 @@ ApiWarning.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ApiWarning) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ApiWarning: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -99627,20 +102641,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ApiWarning.toObject = function toObject(message, options) { + ApiWarning.toObject = function toObject(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 ? "SQL_API_WARNING_CODE_UNSPECIFIED" : 0; object.message = ""; object.region = ""; } - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) object.code = options.enums === String ? $root.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode[message.code] === undefined ? message.code : $root.google.cloud.sql.v1beta4.ApiWarning.SqlApiWarningCode[message.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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; return object; }; @@ -99756,13 +102774,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupRetentionSettings.encode = function encode(message, writer) { + BackupRetentionSettings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.retentionUnit != null && Object.hasOwnProperty.call(message, "retentionUnit")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionUnit); if (message.retainedBackups != null && Object.hasOwnProperty.call(message, "retainedBackups")) - $root.google.protobuf.Int32Value.encode(message.retainedBackups, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.retainedBackups, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -99776,7 +102798,7 @@ * @returns {$protobuf.Writer} Writer */ BackupRetentionSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -99850,7 +102872,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.retentionUnit != null && message.hasOwnProperty("retentionUnit")) + if (message.retentionUnit != null && Object.hasOwnProperty.call(message, "retentionUnit")) switch (message.retentionUnit) { default: return "retentionUnit: enum value expected"; @@ -99858,7 +102880,7 @@ case 1: break; } - if (message.retainedBackups != null && message.hasOwnProperty("retainedBackups")) { + if (message.retainedBackups != null && Object.hasOwnProperty.call(message, "retainedBackups")) { var error = $root.google.protobuf.Int32Value.verify(message.retainedBackups, long + 1); if (error) return "retainedBackups." + error; @@ -99877,6 +102899,8 @@ BackupRetentionSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.BackupRetentionSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.BackupRetentionSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -99899,7 +102923,7 @@ break; } if (object.retainedBackups != null) { - if (typeof object.retainedBackups !== "object") + if (!$util.isObject(object.retainedBackups)) throw TypeError(".google.cloud.sql.v1beta4.BackupRetentionSettings.retainedBackups: object expected"); message.retainedBackups = $root.google.protobuf.Int32Value.fromObject(object.retainedBackups, long + 1); } @@ -99915,18 +102939,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupRetentionSettings.toObject = function toObject(message, options) { + BackupRetentionSettings.toObject = function toObject(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.retentionUnit = options.enums === String ? "RETENTION_UNIT_UNSPECIFIED" : 0; object.retainedBackups = null; } - if (message.retentionUnit != null && message.hasOwnProperty("retentionUnit")) + if (message.retentionUnit != null && Object.hasOwnProperty.call(message, "retentionUnit")) object.retentionUnit = options.enums === String ? $root.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit[message.retentionUnit] === undefined ? message.retentionUnit : $root.google.cloud.sql.v1beta4.BackupRetentionSettings.RetentionUnit[message.retentionUnit] : message.retentionUnit; - if (message.retainedBackups != null && message.hasOwnProperty("retainedBackups")) - object.retainedBackups = $root.google.protobuf.Int32Value.toObject(message.retainedBackups, options); + if (message.retainedBackups != null && Object.hasOwnProperty.call(message, "retainedBackups")) + object.retainedBackups = $root.google.protobuf.Int32Value.toObject(message.retainedBackups, options, q + 1); return object; }; @@ -100131,27 +103159,31 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupConfiguration.encode = function encode(message, writer) { + BackupConfiguration.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.startTime); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) - $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enabled, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.kind); if (message.binaryLogEnabled != null && Object.hasOwnProperty.call(message, "binaryLogEnabled")) - $root.google.protobuf.BoolValue.encode(message.binaryLogEnabled, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.binaryLogEnabled, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.replicationLogArchivingEnabled != null && Object.hasOwnProperty.call(message, "replicationLogArchivingEnabled")) - $root.google.protobuf.BoolValue.encode(message.replicationLogArchivingEnabled, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.replicationLogArchivingEnabled, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); if (message.pointInTimeRecoveryEnabled != null && Object.hasOwnProperty.call(message, "pointInTimeRecoveryEnabled")) - $root.google.protobuf.BoolValue.encode(message.pointInTimeRecoveryEnabled, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.pointInTimeRecoveryEnabled, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.transactionLogRetentionDays != null && Object.hasOwnProperty.call(message, "transactionLogRetentionDays")) - $root.google.protobuf.Int32Value.encode(message.transactionLogRetentionDays, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.transactionLogRetentionDays, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.backupRetentionSettings != null && Object.hasOwnProperty.call(message, "backupRetentionSettings")) - $root.google.cloud.sql.v1beta4.BackupRetentionSettings.encode(message.backupRetentionSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.BackupRetentionSettings.encode(message.backupRetentionSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.transactionalLogStorageState != null && Object.hasOwnProperty.call(message, "transactionalLogStorageState")) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.transactionalLogStorageState); if (message.backupTier != null && Object.hasOwnProperty.call(message, "backupTier")) @@ -100169,7 +103201,7 @@ * @returns {$protobuf.Writer} Writer */ BackupConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -100280,46 +103312,46 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) if (!$util.isString(message.startTime)) return "startTime: string expected"; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { var error = $root.google.protobuf.BoolValue.verify(message.enabled, long + 1); if (error) return "enabled." + error; } - 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.binaryLogEnabled != null && message.hasOwnProperty("binaryLogEnabled")) { + if (message.binaryLogEnabled != null && Object.hasOwnProperty.call(message, "binaryLogEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.binaryLogEnabled, long + 1); if (error) return "binaryLogEnabled." + error; } - if (message.replicationLogArchivingEnabled != null && message.hasOwnProperty("replicationLogArchivingEnabled")) { + if (message.replicationLogArchivingEnabled != null && Object.hasOwnProperty.call(message, "replicationLogArchivingEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.replicationLogArchivingEnabled, long + 1); if (error) return "replicationLogArchivingEnabled." + error; } - 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.pointInTimeRecoveryEnabled != null && message.hasOwnProperty("pointInTimeRecoveryEnabled")) { + if (message.pointInTimeRecoveryEnabled != null && Object.hasOwnProperty.call(message, "pointInTimeRecoveryEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.pointInTimeRecoveryEnabled, long + 1); if (error) return "pointInTimeRecoveryEnabled." + error; } - if (message.transactionLogRetentionDays != null && message.hasOwnProperty("transactionLogRetentionDays")) { + if (message.transactionLogRetentionDays != null && Object.hasOwnProperty.call(message, "transactionLogRetentionDays")) { var error = $root.google.protobuf.Int32Value.verify(message.transactionLogRetentionDays, long + 1); if (error) return "transactionLogRetentionDays." + error; } - if (message.backupRetentionSettings != null && message.hasOwnProperty("backupRetentionSettings")) { + if (message.backupRetentionSettings != null && Object.hasOwnProperty.call(message, "backupRetentionSettings")) { var error = $root.google.cloud.sql.v1beta4.BackupRetentionSettings.verify(message.backupRetentionSettings, long + 1); if (error) return "backupRetentionSettings." + error; } - if (message.transactionalLogStorageState != null && message.hasOwnProperty("transactionalLogStorageState")) { + if (message.transactionalLogStorageState != null && Object.hasOwnProperty.call(message, "transactionalLogStorageState")) { properties._transactionalLogStorageState = 1; switch (message.transactionalLogStorageState) { default: @@ -100332,7 +103364,7 @@ break; } } - if (message.backupTier != null && message.hasOwnProperty("backupTier")) { + if (message.backupTier != null && Object.hasOwnProperty.call(message, "backupTier")) { properties._backupTier = 1; switch (message.backupTier) { default: @@ -100358,6 +103390,8 @@ BackupConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.BackupConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.BackupConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -100366,36 +103400,36 @@ if (object.startTime != null) message.startTime = String(object.startTime); if (object.enabled != null) { - if (typeof object.enabled !== "object") + if (!$util.isObject(object.enabled)) throw TypeError(".google.cloud.sql.v1beta4.BackupConfiguration.enabled: object expected"); message.enabled = $root.google.protobuf.BoolValue.fromObject(object.enabled, long + 1); } if (object.kind != null) message.kind = String(object.kind); if (object.binaryLogEnabled != null) { - if (typeof object.binaryLogEnabled !== "object") + if (!$util.isObject(object.binaryLogEnabled)) throw TypeError(".google.cloud.sql.v1beta4.BackupConfiguration.binaryLogEnabled: object expected"); message.binaryLogEnabled = $root.google.protobuf.BoolValue.fromObject(object.binaryLogEnabled, long + 1); } if (object.replicationLogArchivingEnabled != null) { - if (typeof object.replicationLogArchivingEnabled !== "object") + if (!$util.isObject(object.replicationLogArchivingEnabled)) throw TypeError(".google.cloud.sql.v1beta4.BackupConfiguration.replicationLogArchivingEnabled: object expected"); message.replicationLogArchivingEnabled = $root.google.protobuf.BoolValue.fromObject(object.replicationLogArchivingEnabled, long + 1); } if (object.location != null) message.location = String(object.location); if (object.pointInTimeRecoveryEnabled != null) { - if (typeof object.pointInTimeRecoveryEnabled !== "object") + if (!$util.isObject(object.pointInTimeRecoveryEnabled)) throw TypeError(".google.cloud.sql.v1beta4.BackupConfiguration.pointInTimeRecoveryEnabled: object expected"); message.pointInTimeRecoveryEnabled = $root.google.protobuf.BoolValue.fromObject(object.pointInTimeRecoveryEnabled, long + 1); } if (object.transactionLogRetentionDays != null) { - if (typeof object.transactionLogRetentionDays !== "object") + if (!$util.isObject(object.transactionLogRetentionDays)) throw TypeError(".google.cloud.sql.v1beta4.BackupConfiguration.transactionLogRetentionDays: object expected"); message.transactionLogRetentionDays = $root.google.protobuf.Int32Value.fromObject(object.transactionLogRetentionDays, long + 1); } if (object.backupRetentionSettings != null) { - if (typeof object.backupRetentionSettings !== "object") + if (!$util.isObject(object.backupRetentionSettings)) throw TypeError(".google.cloud.sql.v1beta4.BackupConfiguration.backupRetentionSettings: object expected"); message.backupRetentionSettings = $root.google.cloud.sql.v1beta4.BackupRetentionSettings.fromObject(object.backupRetentionSettings, long + 1); } @@ -100463,9 +103497,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupConfiguration.toObject = function toObject(message, options) { + BackupConfiguration.toObject = function toObject(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.startTime = ""; @@ -100478,30 +103516,30 @@ object.transactionLogRetentionDays = null; object.backupRetentionSettings = null; } - if (message.startTime != null && message.hasOwnProperty("startTime")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) object.startTime = message.startTime; - if (message.enabled != null && message.hasOwnProperty("enabled")) - object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + object.enabled = $root.google.protobuf.BoolValue.toObject(message.enabled, options, q + 1); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.binaryLogEnabled != null && message.hasOwnProperty("binaryLogEnabled")) - object.binaryLogEnabled = $root.google.protobuf.BoolValue.toObject(message.binaryLogEnabled, options); - if (message.replicationLogArchivingEnabled != null && message.hasOwnProperty("replicationLogArchivingEnabled")) - object.replicationLogArchivingEnabled = $root.google.protobuf.BoolValue.toObject(message.replicationLogArchivingEnabled, options); - if (message.location != null && message.hasOwnProperty("location")) + if (message.binaryLogEnabled != null && Object.hasOwnProperty.call(message, "binaryLogEnabled")) + object.binaryLogEnabled = $root.google.protobuf.BoolValue.toObject(message.binaryLogEnabled, options, q + 1); + if (message.replicationLogArchivingEnabled != null && Object.hasOwnProperty.call(message, "replicationLogArchivingEnabled")) + object.replicationLogArchivingEnabled = $root.google.protobuf.BoolValue.toObject(message.replicationLogArchivingEnabled, options, q + 1); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.pointInTimeRecoveryEnabled != null && message.hasOwnProperty("pointInTimeRecoveryEnabled")) - object.pointInTimeRecoveryEnabled = $root.google.protobuf.BoolValue.toObject(message.pointInTimeRecoveryEnabled, options); - if (message.transactionLogRetentionDays != null && message.hasOwnProperty("transactionLogRetentionDays")) - object.transactionLogRetentionDays = $root.google.protobuf.Int32Value.toObject(message.transactionLogRetentionDays, options); - if (message.backupRetentionSettings != null && message.hasOwnProperty("backupRetentionSettings")) - object.backupRetentionSettings = $root.google.cloud.sql.v1beta4.BackupRetentionSettings.toObject(message.backupRetentionSettings, options); - if (message.transactionalLogStorageState != null && message.hasOwnProperty("transactionalLogStorageState")) { + if (message.pointInTimeRecoveryEnabled != null && Object.hasOwnProperty.call(message, "pointInTimeRecoveryEnabled")) + object.pointInTimeRecoveryEnabled = $root.google.protobuf.BoolValue.toObject(message.pointInTimeRecoveryEnabled, options, q + 1); + if (message.transactionLogRetentionDays != null && Object.hasOwnProperty.call(message, "transactionLogRetentionDays")) + object.transactionLogRetentionDays = $root.google.protobuf.Int32Value.toObject(message.transactionLogRetentionDays, options, q + 1); + if (message.backupRetentionSettings != null && Object.hasOwnProperty.call(message, "backupRetentionSettings")) + object.backupRetentionSettings = $root.google.cloud.sql.v1beta4.BackupRetentionSettings.toObject(message.backupRetentionSettings, options, q + 1); + if (message.transactionalLogStorageState != null && Object.hasOwnProperty.call(message, "transactionalLogStorageState")) { object.transactionalLogStorageState = options.enums === String ? $root.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState[message.transactionalLogStorageState] === undefined ? message.transactionalLogStorageState : $root.google.cloud.sql.v1beta4.BackupConfiguration.TransactionalLogStorageState[message.transactionalLogStorageState] : message.transactionalLogStorageState; if (options.oneofs) object._transactionalLogStorageState = "transactionalLogStorageState"; } - if (message.backupTier != null && message.hasOwnProperty("backupTier")) { + if (message.backupTier != null && Object.hasOwnProperty.call(message, "backupTier")) { object.backupTier = options.enums === String ? $root.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier[message.backupTier] === undefined ? message.backupTier : $root.google.cloud.sql.v1beta4.BackupConfiguration.BackupTier[message.backupTier] : message.backupTier; if (options.oneofs) object._backupTier = "backupTier"; @@ -100800,29 +103838,33 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupRun.encode = function encode(message, writer) { + BackupRun.encode = function encode(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.status != null && Object.hasOwnProperty.call(message, "status")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); if (message.enqueuedTime != null && Object.hasOwnProperty.call(message, "enqueuedTime")) - $root.google.protobuf.Timestamp.encode(message.enqueuedTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.enqueuedTime, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.id); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.sql.v1beta4.OperationError.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.OperationError.encode(message.error, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); if (message.windowStartTime != null && Object.hasOwnProperty.call(message, "windowStartTime")) - $root.google.protobuf.Timestamp.encode(message.windowStartTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.windowStartTime, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.instance); if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) @@ -100832,9 +103874,9 @@ if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.databaseVersion); if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) - $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) - $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) writer.uint32(/* id 19, wireType 0 =*/152).int32(message.backupKind); if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) @@ -100854,7 +103896,7 @@ * @returns {$protobuf.Writer} Writer */ BackupRun.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -100997,10 +104039,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) switch (message.status) { default: return "status: enum value expected"; @@ -101016,30 +104058,30 @@ case 9: break; } - if (message.enqueuedTime != null && message.hasOwnProperty("enqueuedTime")) { + if (message.enqueuedTime != null && Object.hasOwnProperty.call(message, "enqueuedTime")) { var error = $root.google.protobuf.Timestamp.verify(message.enqueuedTime, long + 1); if (error) return "enqueuedTime." + error; } - if (message.id != null && message.hasOwnProperty("id")) + if (message.id != null && Object.hasOwnProperty.call(message, "id")) if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) return "id: integer|Long 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; } - if (message.error != null && message.hasOwnProperty("error")) { + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { var error = $root.google.cloud.sql.v1beta4.OperationError.verify(message.error, long + 1); if (error) return "error." + error; } - 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"; @@ -101048,24 +104090,24 @@ case 2: break; } - 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.windowStartTime != null && message.hasOwnProperty("windowStartTime")) { + if (message.windowStartTime != null && Object.hasOwnProperty.call(message, "windowStartTime")) { var error = $root.google.protobuf.Timestamp.verify(message.windowStartTime, long + 1); if (error) return "windowStartTime." + error; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: 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.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -101127,17 +104169,17 @@ case 551: break; } - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) { + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) { var error = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.verify(message.diskEncryptionConfiguration, long + 1); if (error) return "diskEncryptionConfiguration." + error; } - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) { + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) { var error = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.verify(message.diskEncryptionStatus, long + 1); if (error) return "diskEncryptionStatus." + error; } - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) switch (message.backupKind) { default: return "backupKind: enum value expected"; @@ -101146,10 +104188,10 @@ case 2: break; } - 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.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { properties._maxChargeableBytes = 1; if (!$util.isInteger(message.maxChargeableBytes) && !(message.maxChargeableBytes && $util.isInteger(message.maxChargeableBytes.low) && $util.isInteger(message.maxChargeableBytes.high))) return "maxChargeableBytes: integer|Long expected"; @@ -101168,6 +104210,8 @@ BackupRun.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.BackupRun) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.BackupRun: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -101224,13 +104268,13 @@ break; } if (object.enqueuedTime != null) { - if (typeof object.enqueuedTime !== "object") + if (!$util.isObject(object.enqueuedTime)) throw TypeError(".google.cloud.sql.v1beta4.BackupRun.enqueuedTime: object expected"); message.enqueuedTime = $root.google.protobuf.Timestamp.fromObject(object.enqueuedTime, long + 1); } if (object.id != null) if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; + message.id = $util.Long.fromValue(object.id, false); else if (typeof object.id === "string") message.id = parseInt(object.id, 10); else if (typeof object.id === "number") @@ -101238,17 +104282,17 @@ else if (typeof object.id === "object") message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.cloud.sql.v1beta4.BackupRun.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.cloud.sql.v1beta4.BackupRun.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } if (object.error != null) { - if (typeof object.error !== "object") + if (!$util.isObject(object.error)) throw TypeError(".google.cloud.sql.v1beta4.BackupRun.error: object expected"); message.error = $root.google.cloud.sql.v1beta4.OperationError.fromObject(object.error, long + 1); } @@ -101275,7 +104319,7 @@ if (object.description != null) message.description = String(object.description); if (object.windowStartTime != null) { - if (typeof object.windowStartTime !== "object") + if (!$util.isObject(object.windowStartTime)) throw TypeError(".google.cloud.sql.v1beta4.BackupRun.windowStartTime: object expected"); message.windowStartTime = $root.google.protobuf.Timestamp.fromObject(object.windowStartTime, long + 1); } @@ -101518,12 +104562,12 @@ break; } if (object.diskEncryptionConfiguration != null) { - if (typeof object.diskEncryptionConfiguration !== "object") + if (!$util.isObject(object.diskEncryptionConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.BackupRun.diskEncryptionConfiguration: object expected"); message.diskEncryptionConfiguration = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.fromObject(object.diskEncryptionConfiguration, long + 1); } if (object.diskEncryptionStatus != null) { - if (typeof object.diskEncryptionStatus !== "object") + if (!$util.isObject(object.diskEncryptionStatus)) throw TypeError(".google.cloud.sql.v1beta4.BackupRun.diskEncryptionStatus: object expected"); message.diskEncryptionStatus = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.fromObject(object.diskEncryptionStatus, long + 1); } @@ -101551,7 +104595,7 @@ message.timeZone = String(object.timeZone); if (object.maxChargeableBytes != null) if ($util.Long) - (message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes)).unsigned = false; + message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes, false); else if (typeof object.maxChargeableBytes === "string") message.maxChargeableBytes = parseInt(object.maxChargeableBytes, 10); else if (typeof object.maxChargeableBytes === "number") @@ -101570,9 +104614,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupRun.toObject = function toObject(message, options) { + BackupRun.toObject = function toObject(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 = ""; @@ -101580,9 +104628,9 @@ object.enqueuedTime = null; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.id = options.longs === String ? "0" : 0; + object.id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.startTime = null; object.endTime = null; object.error = null; @@ -101598,47 +104646,51 @@ object.backupKind = options.enums === String ? "SQL_BACKUP_KIND_UNSPECIFIED" : 0; object.timeZone = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) object.status = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlBackupRunStatus[message.status] === undefined ? message.status : $root.google.cloud.sql.v1beta4.SqlBackupRunStatus[message.status] : message.status; - if (message.enqueuedTime != null && message.hasOwnProperty("enqueuedTime")) - object.enqueuedTime = $root.google.protobuf.Timestamp.toObject(message.enqueuedTime, options); - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") + if (message.enqueuedTime != null && Object.hasOwnProperty.call(message, "enqueuedTime")) + object.enqueuedTime = $root.google.protobuf.Timestamp.toObject(message.enqueuedTime, options, q + 1); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.id = typeof message.id === "number" ? BigInt(message.id) : $util.Long.fromBits(message.id.low >>> 0, message.id.high >>> 0, false).toBigInt(); + else if (typeof message.id === "number") object.id = options.longs === String ? String(message.id) : message.id; else object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - 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.error != null && message.hasOwnProperty("error")) - object.error = $root.google.cloud.sql.v1beta4.OperationError.toObject(message.error, options); - if (message.type != null && message.hasOwnProperty("type")) + 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 (message.error != null && Object.hasOwnProperty.call(message, "error")) + object.error = $root.google.cloud.sql.v1beta4.OperationError.toObject(message.error, options, q + 1); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlBackupRunType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1beta4.SqlBackupRunType[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; - if (message.windowStartTime != null && message.hasOwnProperty("windowStartTime")) - object.windowStartTime = $root.google.protobuf.Timestamp.toObject(message.windowStartTime, options); - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.windowStartTime != null && Object.hasOwnProperty.call(message, "windowStartTime")) + object.windowStartTime = $root.google.protobuf.Timestamp.toObject(message.windowStartTime, options, q + 1); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) - object.diskEncryptionConfiguration = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options); - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) - object.diskEncryptionStatus = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options); - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) + object.diskEncryptionConfiguration = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options, q + 1); + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) + object.diskEncryptionStatus = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options, q + 1); + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) object.backupKind = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlBackupKind[message.backupKind] === undefined ? message.backupKind : $root.google.cloud.sql.v1beta4.SqlBackupKind[message.backupKind] : message.backupKind; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) object.timeZone = message.timeZone; - if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { - if (typeof message.maxChargeableBytes === "number") + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxChargeableBytes = typeof message.maxChargeableBytes === "number" ? BigInt(message.maxChargeableBytes) : $util.Long.fromBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0, false).toBigInt(); + else if (typeof message.maxChargeableBytes === "number") object.maxChargeableBytes = options.longs === String ? String(message.maxChargeableBytes) : message.maxChargeableBytes; else object.maxChargeableBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxChargeableBytes) : options.longs === Number ? new $util.LongBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0).toNumber() : message.maxChargeableBytes; @@ -101948,9 +105000,13 @@ * @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.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -101966,11 +105022,11 @@ if (message.location != null && Object.hasOwnProperty.call(message, "location")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.location); if (message.backupInterval != null && Object.hasOwnProperty.call(message, "backupInterval")) - $root.google.type.Interval.encode(message.backupInterval, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.type.Interval.encode(message.backupInterval, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.sql.v1beta4.OperationError.encode(message.error, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.OperationError.encode(message.error, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.kmsKey); if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) @@ -101982,21 +105038,21 @@ if (message.ttlDays != null && Object.hasOwnProperty.call(message, "ttlDays")) writer.uint32(/* id 16, wireType 0 =*/128).int64(message.ttlDays); if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) - $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expiryTime, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 20, wireType 0 =*/160).int32(message.databaseVersion); if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) writer.uint32(/* id 23, wireType 0 =*/184).int64(message.maxChargeableBytes); if (message.instanceDeletionTime != null && Object.hasOwnProperty.call(message, "instanceDeletionTime")) - $root.google.protobuf.Timestamp.encode(message.instanceDeletionTime, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.instanceDeletionTime, writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); if (message.instanceSettings != null && Object.hasOwnProperty.call(message, "instanceSettings")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.instanceSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.instanceSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); if (message.backupRun != null && Object.hasOwnProperty.call(message, "backupRun")) writer.uint32(/* id 26, wireType 2 =*/210).string(message.backupRun); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 28, wireType 2 =*/226).fork(), q + 1).ldelim(); return writer; }; @@ -102010,7 +105066,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(); }; /** @@ -102169,16 +105225,16 @@ 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.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.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: 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"; @@ -102188,21 +105244,21 @@ case 3: break; } - 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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: 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.backupInterval != null && message.hasOwnProperty("backupInterval")) { + if (message.backupInterval != null && Object.hasOwnProperty.call(message, "backupInterval")) { var error = $root.google.type.Interval.verify(message.backupInterval, long + 1); if (error) return "backupInterval." + 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"; @@ -102215,18 +105271,18 @@ case 6: break; } - if (message.error != null && message.hasOwnProperty("error")) { + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { var error = $root.google.cloud.sql.v1beta4.OperationError.verify(message.error, long + 1); if (error) return "error." + error; } - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) if (!$util.isString(message.kmsKey)) return "kmsKey: string expected"; - 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"; - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) switch (message.backupKind) { default: return "backupKind: enum value expected"; @@ -102235,15 +105291,15 @@ case 2: break; } - 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.ttlDays != null && message.hasOwnProperty("ttlDays")) { + if (message.ttlDays != null && Object.hasOwnProperty.call(message, "ttlDays")) { properties.expiration = 1; if (!$util.isInteger(message.ttlDays) && !(message.ttlDays && $util.isInteger(message.ttlDays.low) && $util.isInteger(message.ttlDays.high))) return "ttlDays: integer|Long expected"; } - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) { if (properties.expiration === 1) return "expiration: multiple values"; properties.expiration = 1; @@ -102253,7 +105309,7 @@ return "expiryTime." + error; } } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -102315,30 +105371,30 @@ case 551: break; } - if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { properties._maxChargeableBytes = 1; if (!$util.isInteger(message.maxChargeableBytes) && !(message.maxChargeableBytes && $util.isInteger(message.maxChargeableBytes.low) && $util.isInteger(message.maxChargeableBytes.high))) return "maxChargeableBytes: integer|Long expected"; } - if (message.instanceDeletionTime != null && message.hasOwnProperty("instanceDeletionTime")) { + if (message.instanceDeletionTime != null && Object.hasOwnProperty.call(message, "instanceDeletionTime")) { var error = $root.google.protobuf.Timestamp.verify(message.instanceDeletionTime, long + 1); if (error) return "instanceDeletionTime." + error; } - if (message.instanceSettings != null && message.hasOwnProperty("instanceSettings")) { + if (message.instanceSettings != null && Object.hasOwnProperty.call(message, "instanceSettings")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.verify(message.instanceSettings, long + 1); if (error) return "instanceSettings." + error; } - if (message.backupRun != null && message.hasOwnProperty("backupRun")) + if (message.backupRun != null && Object.hasOwnProperty.call(message, "backupRun")) if (!$util.isString(message.backupRun)) return "backupRun: string expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs, long + 1); if (error) return "satisfiesPzs." + error; } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzi, long + 1); if (error) return "satisfiesPzi." + error; @@ -102357,6 +105413,8 @@ Backup.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Backup) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Backup: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -102399,7 +105457,7 @@ if (object.location != null) message.location = String(object.location); if (object.backupInterval != null) { - if (typeof object.backupInterval !== "object") + if (!$util.isObject(object.backupInterval)) throw TypeError(".google.cloud.sql.v1beta4.Backup.backupInterval: object expected"); message.backupInterval = $root.google.type.Interval.fromObject(object.backupInterval, long + 1); } @@ -102440,7 +105498,7 @@ break; } if (object.error != null) { - if (typeof object.error !== "object") + if (!$util.isObject(object.error)) throw TypeError(".google.cloud.sql.v1beta4.Backup.error: object expected"); message.error = $root.google.cloud.sql.v1beta4.OperationError.fromObject(object.error, long + 1); } @@ -102472,7 +105530,7 @@ message.timeZone = String(object.timeZone); if (object.ttlDays != null) if ($util.Long) - (message.ttlDays = $util.Long.fromValue(object.ttlDays)).unsigned = false; + message.ttlDays = $util.Long.fromValue(object.ttlDays, false); else if (typeof object.ttlDays === "string") message.ttlDays = parseInt(object.ttlDays, 10); else if (typeof object.ttlDays === "number") @@ -102480,7 +105538,7 @@ else if (typeof object.ttlDays === "object") message.ttlDays = new $util.LongBits(object.ttlDays.low >>> 0, object.ttlDays.high >>> 0).toNumber(); if (object.expiryTime != null) { - if (typeof object.expiryTime !== "object") + if (!$util.isObject(object.expiryTime)) throw TypeError(".google.cloud.sql.v1beta4.Backup.expiryTime: object expected"); message.expiryTime = $root.google.protobuf.Timestamp.fromObject(object.expiryTime, long + 1); } @@ -102718,7 +105776,7 @@ } if (object.maxChargeableBytes != null) if ($util.Long) - (message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes)).unsigned = false; + message.maxChargeableBytes = $util.Long.fromValue(object.maxChargeableBytes, false); else if (typeof object.maxChargeableBytes === "string") message.maxChargeableBytes = parseInt(object.maxChargeableBytes, 10); else if (typeof object.maxChargeableBytes === "number") @@ -102726,24 +105784,24 @@ else if (typeof object.maxChargeableBytes === "object") message.maxChargeableBytes = new $util.LongBits(object.maxChargeableBytes.low >>> 0, object.maxChargeableBytes.high >>> 0).toNumber(); if (object.instanceDeletionTime != null) { - if (typeof object.instanceDeletionTime !== "object") + if (!$util.isObject(object.instanceDeletionTime)) throw TypeError(".google.cloud.sql.v1beta4.Backup.instanceDeletionTime: object expected"); message.instanceDeletionTime = $root.google.protobuf.Timestamp.fromObject(object.instanceDeletionTime, long + 1); } if (object.instanceSettings != null) { - if (typeof object.instanceSettings !== "object") + if (!$util.isObject(object.instanceSettings)) throw TypeError(".google.cloud.sql.v1beta4.Backup.instanceSettings: object expected"); message.instanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.fromObject(object.instanceSettings, long + 1); } if (object.backupRun != null) message.backupRun = String(object.backupRun); if (object.satisfiesPzs != null) { - if (typeof object.satisfiesPzs !== "object") + if (!$util.isObject(object.satisfiesPzs)) throw TypeError(".google.cloud.sql.v1beta4.Backup.satisfiesPzs: object expected"); message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs, long + 1); } if (object.satisfiesPzi != null) { - if (typeof object.satisfiesPzi !== "object") + if (!$util.isObject(object.satisfiesPzi)) throw TypeError(".google.cloud.sql.v1beta4.Backup.satisfiesPzi: object expected"); message.satisfiesPzi = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzi, long + 1); } @@ -102759,9 +105817,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.defaults) { object.name = ""; @@ -102785,67 +105847,71 @@ object.satisfiesPzs = null; object.satisfiesPzi = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1beta4.Backup.SqlBackupType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1beta4.Backup.SqlBackupType[message.type] : message.type; - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) object.description = message.description; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; - if (message.backupInterval != null && message.hasOwnProperty("backupInterval")) - object.backupInterval = $root.google.type.Interval.toObject(message.backupInterval, options); - if (message.state != null && message.hasOwnProperty("state")) + if (message.backupInterval != null && Object.hasOwnProperty.call(message, "backupInterval")) + object.backupInterval = $root.google.type.Interval.toObject(message.backupInterval, options, q + 1); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.cloud.sql.v1beta4.Backup.SqlBackupState[message.state] === undefined ? message.state : $root.google.cloud.sql.v1beta4.Backup.SqlBackupState[message.state] : message.state; - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.cloud.sql.v1beta4.OperationError.toObject(message.error, options); - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + object.error = $root.google.cloud.sql.v1beta4.OperationError.toObject(message.error, options, q + 1); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) object.kmsKey = message.kmsKey; - if (message.kmsKeyVersion != null && message.hasOwnProperty("kmsKeyVersion")) + if (message.kmsKeyVersion != null && Object.hasOwnProperty.call(message, "kmsKeyVersion")) object.kmsKeyVersion = message.kmsKeyVersion; - if (message.backupKind != null && message.hasOwnProperty("backupKind")) + if (message.backupKind != null && Object.hasOwnProperty.call(message, "backupKind")) object.backupKind = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlBackupKind[message.backupKind] === undefined ? message.backupKind : $root.google.cloud.sql.v1beta4.SqlBackupKind[message.backupKind] : message.backupKind; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) object.timeZone = message.timeZone; - if (message.ttlDays != null && message.hasOwnProperty("ttlDays")) { - if (typeof message.ttlDays === "number") + if (message.ttlDays != null && Object.hasOwnProperty.call(message, "ttlDays")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.ttlDays = typeof message.ttlDays === "number" ? BigInt(message.ttlDays) : $util.Long.fromBits(message.ttlDays.low >>> 0, message.ttlDays.high >>> 0, false).toBigInt(); + else if (typeof message.ttlDays === "number") object.ttlDays = options.longs === String ? String(message.ttlDays) : message.ttlDays; else object.ttlDays = options.longs === String ? $util.Long.prototype.toString.call(message.ttlDays) : options.longs === Number ? new $util.LongBits(message.ttlDays.low >>> 0, message.ttlDays.high >>> 0).toNumber() : message.ttlDays; if (options.oneofs) object.expiration = "ttlDays"; } - if (message.expiryTime != null && message.hasOwnProperty("expiryTime")) { - object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options); + if (message.expiryTime != null && Object.hasOwnProperty.call(message, "expiryTime")) { + object.expiryTime = $root.google.protobuf.Timestamp.toObject(message.expiryTime, options, q + 1); if (options.oneofs) object.expiration = "expiryTime"; } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.maxChargeableBytes != null && message.hasOwnProperty("maxChargeableBytes")) { - if (typeof message.maxChargeableBytes === "number") + if (message.maxChargeableBytes != null && Object.hasOwnProperty.call(message, "maxChargeableBytes")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.maxChargeableBytes = typeof message.maxChargeableBytes === "number" ? BigInt(message.maxChargeableBytes) : $util.Long.fromBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0, false).toBigInt(); + else if (typeof message.maxChargeableBytes === "number") object.maxChargeableBytes = options.longs === String ? String(message.maxChargeableBytes) : message.maxChargeableBytes; else object.maxChargeableBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxChargeableBytes) : options.longs === Number ? new $util.LongBits(message.maxChargeableBytes.low >>> 0, message.maxChargeableBytes.high >>> 0).toNumber() : message.maxChargeableBytes; if (options.oneofs) object._maxChargeableBytes = "maxChargeableBytes"; } - if (message.instanceDeletionTime != null && message.hasOwnProperty("instanceDeletionTime")) - object.instanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.instanceDeletionTime, options); - if (message.instanceSettings != null && message.hasOwnProperty("instanceSettings")) - object.instanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.instanceSettings, options); - if (message.backupRun != null && message.hasOwnProperty("backupRun")) + if (message.instanceDeletionTime != null && Object.hasOwnProperty.call(message, "instanceDeletionTime")) + object.instanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.instanceDeletionTime, options, q + 1); + if (message.instanceSettings != null && Object.hasOwnProperty.call(message, "instanceSettings")) + object.instanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.instanceSettings, options, q + 1); + if (message.backupRun != null && Object.hasOwnProperty.call(message, "backupRun")) object.backupRun = message.backupRun; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options, q + 1); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options, q + 1); return object; }; @@ -102992,14 +106058,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupRunsListResponse.encode = function encode(message, writer) { + BackupRunsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.BackupRun.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.BackupRun.encode(message.items[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); return writer; @@ -103015,7 +106085,7 @@ * @returns {$protobuf.Writer} Writer */ BackupRunsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -103095,10 +106165,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -103107,7 +106177,7 @@ return "items." + 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; @@ -103124,6 +106194,8 @@ BackupRunsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.BackupRunsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.BackupRunsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -103136,7 +106208,7 @@ throw TypeError(".google.cloud.sql.v1beta4.BackupRunsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.BackupRunsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.BackupRun.fromObject(object.items[i], long + 1); } @@ -103155,9 +106227,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupRunsListResponse.toObject = function toObject(message, options) { + BackupRunsListResponse.toObject = function toObject(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.items = []; @@ -103165,14 +106241,14 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.BackupRun.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.BackupRun.toObject(message.items[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; }; @@ -103277,9 +106353,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BinLogCoordinates.encode = function encode(message, writer) { + BinLogCoordinates.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.binLogFileName != null && Object.hasOwnProperty.call(message, "binLogFileName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.binLogFileName); if (message.binLogPosition != null && Object.hasOwnProperty.call(message, "binLogPosition")) @@ -103299,7 +106379,7 @@ * @returns {$protobuf.Writer} Writer */ BinLogCoordinates.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -103377,13 +106457,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.binLogFileName != null && message.hasOwnProperty("binLogFileName")) + if (message.binLogFileName != null && Object.hasOwnProperty.call(message, "binLogFileName")) if (!$util.isString(message.binLogFileName)) return "binLogFileName: string expected"; - if (message.binLogPosition != null && message.hasOwnProperty("binLogPosition")) + if (message.binLogPosition != null && Object.hasOwnProperty.call(message, "binLogPosition")) if (!$util.isInteger(message.binLogPosition) && !(message.binLogPosition && $util.isInteger(message.binLogPosition.low) && $util.isInteger(message.binLogPosition.high))) return "binLogPosition: integer|Long expected"; - 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"; return null; @@ -103400,6 +106480,8 @@ BinLogCoordinates.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.BinLogCoordinates) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.BinLogCoordinates: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -103409,7 +106491,7 @@ message.binLogFileName = String(object.binLogFileName); if (object.binLogPosition != null) if ($util.Long) - (message.binLogPosition = $util.Long.fromValue(object.binLogPosition)).unsigned = false; + message.binLogPosition = $util.Long.fromValue(object.binLogPosition, false); else if (typeof object.binLogPosition === "string") message.binLogPosition = parseInt(object.binLogPosition, 10); else if (typeof object.binLogPosition === "number") @@ -103430,27 +106512,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BinLogCoordinates.toObject = function toObject(message, options) { + BinLogCoordinates.toObject = function toObject(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.binLogFileName = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.binLogPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.binLogPosition = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.binLogPosition = options.longs === String ? "0" : 0; + object.binLogPosition = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; } - if (message.binLogFileName != null && message.hasOwnProperty("binLogFileName")) + if (message.binLogFileName != null && Object.hasOwnProperty.call(message, "binLogFileName")) object.binLogFileName = message.binLogFileName; - if (message.binLogPosition != null && message.hasOwnProperty("binLogPosition")) - if (typeof message.binLogPosition === "number") + if (message.binLogPosition != null && Object.hasOwnProperty.call(message, "binLogPosition")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.binLogPosition = typeof message.binLogPosition === "number" ? BigInt(message.binLogPosition) : $util.Long.fromBits(message.binLogPosition.low >>> 0, message.binLogPosition.high >>> 0, false).toBigInt(); + else if (typeof message.binLogPosition === "number") object.binLogPosition = options.longs === String ? String(message.binLogPosition) : message.binLogPosition; else object.binLogPosition = options.longs === String ? $util.Long.prototype.toString.call(message.binLogPosition) : options.longs === Number ? new $util.LongBits(message.binLogPosition.low >>> 0, message.binLogPosition.high >>> 0).toNumber() : message.binLogPosition; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -103555,9 +106643,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BackupContext.encode = function encode(message, writer) { + BackupContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.backupId); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -103577,7 +106669,7 @@ * @returns {$protobuf.Writer} Writer */ BackupContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -103655,13 +106747,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.backupId != null && message.hasOwnProperty("backupId")) + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) if (!$util.isInteger(message.backupId) && !(message.backupId && $util.isInteger(message.backupId.low) && $util.isInteger(message.backupId.high))) return "backupId: integer|Long expected"; - 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.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; @@ -103678,6 +106770,8 @@ BackupContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.BackupContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.BackupContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -103685,7 +106779,7 @@ var message = new $root.google.cloud.sql.v1beta4.BackupContext(); if (object.backupId != null) if ($util.Long) - (message.backupId = $util.Long.fromValue(object.backupId)).unsigned = false; + message.backupId = $util.Long.fromValue(object.backupId, false); else if (typeof object.backupId === "string") message.backupId = parseInt(object.backupId, 10); else if (typeof object.backupId === "number") @@ -103708,27 +106802,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BackupContext.toObject = function toObject(message, options) { + BackupContext.toObject = function toObject(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.backupId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.backupId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.backupId = options.longs === String ? "0" : 0; + object.backupId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; object.name = ""; } - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (typeof message.backupId === "number") + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.backupId = typeof message.backupId === "number" ? BigInt(message.backupId) : $util.Long.fromBits(message.backupId.low >>> 0, message.backupId.high >>> 0, false).toBigInt(); + else if (typeof message.backupId === "number") object.backupId = options.longs === String ? String(message.backupId) : message.backupId; else object.backupId = options.longs === String ? $util.Long.prototype.toString.call(message.backupId) : options.longs === Number ? new $util.LongBits(message.backupId.low >>> 0, message.backupId.high >>> 0).toNumber() : message.backupId; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -103948,9 +107048,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloneContext.encode = function encode(message, writer) { + CloneContext.encode = function encode(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.pitrTimestampMs != null && Object.hasOwnProperty.call(message, "pitrTimestampMs")) @@ -103958,9 +107062,9 @@ if (message.destinationInstanceName != null && Object.hasOwnProperty.call(message, "destinationInstanceName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.destinationInstanceName); if (message.binLogCoordinates != null && Object.hasOwnProperty.call(message, "binLogCoordinates")) - $root.google.cloud.sql.v1beta4.BinLogCoordinates.encode(message.binLogCoordinates, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.BinLogCoordinates.encode(message.binLogCoordinates, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.allocatedIpRange); if (message.databaseNames != null && message.databaseNames.length) @@ -103971,7 +107075,7 @@ if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.preferredSecondaryZone); if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) - $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.sourceInstanceDeletionTime, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.destinationProject != null && Object.hasOwnProperty.call(message, "destinationProject")) writer.uint32(/* id 13, wireType 2 =*/106).string(message.destinationProject); if (message.destinationNetwork != null && Object.hasOwnProperty.call(message, "destinationNetwork")) @@ -103989,7 +107093,7 @@ * @returns {$protobuf.Writer} Writer */ CloneContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -104106,46 +107210,46 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.pitrTimestampMs != null && message.hasOwnProperty("pitrTimestampMs")) + if (message.pitrTimestampMs != null && Object.hasOwnProperty.call(message, "pitrTimestampMs")) if (!$util.isInteger(message.pitrTimestampMs) && !(message.pitrTimestampMs && $util.isInteger(message.pitrTimestampMs.low) && $util.isInteger(message.pitrTimestampMs.high))) return "pitrTimestampMs: integer|Long expected"; - if (message.destinationInstanceName != null && message.hasOwnProperty("destinationInstanceName")) + if (message.destinationInstanceName != null && Object.hasOwnProperty.call(message, "destinationInstanceName")) if (!$util.isString(message.destinationInstanceName)) return "destinationInstanceName: string expected"; - if (message.binLogCoordinates != null && message.hasOwnProperty("binLogCoordinates")) { + if (message.binLogCoordinates != null && Object.hasOwnProperty.call(message, "binLogCoordinates")) { var error = $root.google.cloud.sql.v1beta4.BinLogCoordinates.verify(message.binLogCoordinates, long + 1); if (error) return "binLogCoordinates." + error; } - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) { var error = $root.google.protobuf.Timestamp.verify(message.pointInTime, long + 1); if (error) return "pointInTime." + error; } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) if (!$util.isString(message.allocatedIpRange)) return "allocatedIpRange: string expected"; - if (message.databaseNames != null && message.hasOwnProperty("databaseNames")) { + if (message.databaseNames != null && Object.hasOwnProperty.call(message, "databaseNames")) { if (!Array.isArray(message.databaseNames)) return "databaseNames: array expected"; for (var i = 0; i < message.databaseNames.length; ++i) if (!$util.isString(message.databaseNames[i])) return "databaseNames: string[] expected"; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { properties._preferredZone = 1; if (!$util.isString(message.preferredZone)) return "preferredZone: string expected"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { properties._preferredSecondaryZone = 1; if (!$util.isString(message.preferredSecondaryZone)) return "preferredSecondaryZone: string expected"; } - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { properties._sourceInstanceDeletionTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.sourceInstanceDeletionTime, long + 1); @@ -104153,12 +107257,12 @@ return "sourceInstanceDeletionTime." + error; } } - if (message.destinationProject != null && message.hasOwnProperty("destinationProject")) { + if (message.destinationProject != null && Object.hasOwnProperty.call(message, "destinationProject")) { properties._destinationProject = 1; if (!$util.isString(message.destinationProject)) return "destinationProject: string expected"; } - if (message.destinationNetwork != null && message.hasOwnProperty("destinationNetwork")) { + if (message.destinationNetwork != null && Object.hasOwnProperty.call(message, "destinationNetwork")) { properties._destinationNetwork = 1; if (!$util.isString(message.destinationNetwork)) return "destinationNetwork: string expected"; @@ -104177,6 +107281,8 @@ CloneContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.CloneContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.CloneContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -104186,7 +107292,7 @@ message.kind = String(object.kind); if (object.pitrTimestampMs != null) if ($util.Long) - (message.pitrTimestampMs = $util.Long.fromValue(object.pitrTimestampMs)).unsigned = false; + message.pitrTimestampMs = $util.Long.fromValue(object.pitrTimestampMs, false); else if (typeof object.pitrTimestampMs === "string") message.pitrTimestampMs = parseInt(object.pitrTimestampMs, 10); else if (typeof object.pitrTimestampMs === "number") @@ -104196,12 +107302,12 @@ if (object.destinationInstanceName != null) message.destinationInstanceName = String(object.destinationInstanceName); if (object.binLogCoordinates != null) { - if (typeof object.binLogCoordinates !== "object") + if (!$util.isObject(object.binLogCoordinates)) throw TypeError(".google.cloud.sql.v1beta4.CloneContext.binLogCoordinates: object expected"); message.binLogCoordinates = $root.google.cloud.sql.v1beta4.BinLogCoordinates.fromObject(object.binLogCoordinates, long + 1); } if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") + if (!$util.isObject(object.pointInTime)) throw TypeError(".google.cloud.sql.v1beta4.CloneContext.pointInTime: object expected"); message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime, long + 1); } @@ -104219,7 +107325,7 @@ if (object.preferredSecondaryZone != null) message.preferredSecondaryZone = String(object.preferredSecondaryZone); if (object.sourceInstanceDeletionTime != null) { - if (typeof object.sourceInstanceDeletionTime !== "object") + if (!$util.isObject(object.sourceInstanceDeletionTime)) throw TypeError(".google.cloud.sql.v1beta4.CloneContext.sourceInstanceDeletionTime: object expected"); message.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.fromObject(object.sourceInstanceDeletionTime, long + 1); } @@ -104239,9 +107345,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloneContext.toObject = function toObject(message, options) { + CloneContext.toObject = function toObject(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.databaseNames = []; @@ -104249,55 +107359,57 @@ object.kind = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.pitrTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.pitrTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.pitrTimestampMs = options.longs === String ? "0" : 0; + object.pitrTimestampMs = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.destinationInstanceName = ""; object.binLogCoordinates = null; object.pointInTime = null; object.allocatedIpRange = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.pitrTimestampMs != null && message.hasOwnProperty("pitrTimestampMs")) - if (typeof message.pitrTimestampMs === "number") + if (message.pitrTimestampMs != null && Object.hasOwnProperty.call(message, "pitrTimestampMs")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.pitrTimestampMs = typeof message.pitrTimestampMs === "number" ? BigInt(message.pitrTimestampMs) : $util.Long.fromBits(message.pitrTimestampMs.low >>> 0, message.pitrTimestampMs.high >>> 0, false).toBigInt(); + else if (typeof message.pitrTimestampMs === "number") object.pitrTimestampMs = options.longs === String ? String(message.pitrTimestampMs) : message.pitrTimestampMs; else object.pitrTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.pitrTimestampMs) : options.longs === Number ? new $util.LongBits(message.pitrTimestampMs.low >>> 0, message.pitrTimestampMs.high >>> 0).toNumber() : message.pitrTimestampMs; - if (message.destinationInstanceName != null && message.hasOwnProperty("destinationInstanceName")) + if (message.destinationInstanceName != null && Object.hasOwnProperty.call(message, "destinationInstanceName")) object.destinationInstanceName = message.destinationInstanceName; - if (message.binLogCoordinates != null && message.hasOwnProperty("binLogCoordinates")) - object.binLogCoordinates = $root.google.cloud.sql.v1beta4.BinLogCoordinates.toObject(message.binLogCoordinates, options); - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.binLogCoordinates != null && Object.hasOwnProperty.call(message, "binLogCoordinates")) + object.binLogCoordinates = $root.google.cloud.sql.v1beta4.BinLogCoordinates.toObject(message.binLogCoordinates, options, q + 1); + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options, q + 1); + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) object.allocatedIpRange = message.allocatedIpRange; if (message.databaseNames && message.databaseNames.length) { object.databaseNames = []; for (var j = 0; j < message.databaseNames.length; ++j) object.databaseNames[j] = message.databaseNames[j]; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { object.preferredZone = message.preferredZone; if (options.oneofs) object._preferredZone = "preferredZone"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { object.preferredSecondaryZone = message.preferredSecondaryZone; if (options.oneofs) object._preferredSecondaryZone = "preferredSecondaryZone"; } - if (message.sourceInstanceDeletionTime != null && message.hasOwnProperty("sourceInstanceDeletionTime")) { - object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options); + if (message.sourceInstanceDeletionTime != null && Object.hasOwnProperty.call(message, "sourceInstanceDeletionTime")) { + object.sourceInstanceDeletionTime = $root.google.protobuf.Timestamp.toObject(message.sourceInstanceDeletionTime, options, q + 1); if (options.oneofs) object._sourceInstanceDeletionTime = "sourceInstanceDeletionTime"; } - if (message.destinationProject != null && message.hasOwnProperty("destinationProject")) { + if (message.destinationProject != null && Object.hasOwnProperty.call(message, "destinationProject")) { object.destinationProject = message.destinationProject; if (options.oneofs) object._destinationProject = "destinationProject"; } - if (message.destinationNetwork != null && message.hasOwnProperty("destinationNetwork")) { + if (message.destinationNetwork != null && Object.hasOwnProperty.call(message, "destinationNetwork")) { object.destinationNetwork = message.destinationNetwork; if (options.oneofs) object._destinationNetwork = "destinationNetwork"; @@ -104473,9 +107585,13 @@ * @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.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) @@ -104493,7 +107609,7 @@ if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.project); if (message.sqlserverDatabaseDetails != null && Object.hasOwnProperty.call(message, "sqlserverDatabaseDetails")) - $root.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.encode(message.sqlserverDatabaseDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.encode(message.sqlserverDatabaseDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -104507,7 +107623,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(); }; /** @@ -104610,31 +107726,31 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.charset != null && message.hasOwnProperty("charset")) + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) if (!$util.isString(message.charset)) return "charset: string expected"; - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) if (!$util.isString(message.collation)) return "collation: 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.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.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.sqlserverDatabaseDetails != null && message.hasOwnProperty("sqlserverDatabaseDetails")) { + if (message.sqlserverDatabaseDetails != null && Object.hasOwnProperty.call(message, "sqlserverDatabaseDetails")) { properties.databaseDetails = 1; { var error = $root.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.verify(message.sqlserverDatabaseDetails, long + 1); @@ -104656,6 +107772,8 @@ Database.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Database) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Database: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -104678,7 +107796,7 @@ if (object.project != null) message.project = String(object.project); if (object.sqlserverDatabaseDetails != null) { - if (typeof object.sqlserverDatabaseDetails !== "object") + if (!$util.isObject(object.sqlserverDatabaseDetails)) throw TypeError(".google.cloud.sql.v1beta4.Database.sqlserverDatabaseDetails: object expected"); message.sqlserverDatabaseDetails = $root.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.fromObject(object.sqlserverDatabaseDetails, long + 1); } @@ -104694,9 +107812,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.defaults) { object.kind = ""; @@ -104708,24 +107830,24 @@ object.selfLink = ""; object.project = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.charset != null && message.hasOwnProperty("charset")) + if (message.charset != null && Object.hasOwnProperty.call(message, "charset")) object.charset = message.charset; - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) object.collation = message.collation; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.sqlserverDatabaseDetails != null && message.hasOwnProperty("sqlserverDatabaseDetails")) { - object.sqlserverDatabaseDetails = $root.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.toObject(message.sqlserverDatabaseDetails, options); + if (message.sqlserverDatabaseDetails != null && Object.hasOwnProperty.call(message, "sqlserverDatabaseDetails")) { + object.sqlserverDatabaseDetails = $root.google.cloud.sql.v1beta4.SqlServerDatabaseDetails.toObject(message.sqlserverDatabaseDetails, options, q + 1); if (options.oneofs) object.databaseDetails = "sqlserverDatabaseDetails"; } @@ -104823,9 +107945,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerDatabaseDetails.encode = function encode(message, writer) { + SqlServerDatabaseDetails.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.compatibilityLevel != null && Object.hasOwnProperty.call(message, "compatibilityLevel")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.compatibilityLevel); if (message.recoveryModel != null && Object.hasOwnProperty.call(message, "recoveryModel")) @@ -104843,7 +107969,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerDatabaseDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -104917,10 +108043,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.compatibilityLevel != null && message.hasOwnProperty("compatibilityLevel")) + if (message.compatibilityLevel != null && Object.hasOwnProperty.call(message, "compatibilityLevel")) if (!$util.isInteger(message.compatibilityLevel)) return "compatibilityLevel: integer expected"; - if (message.recoveryModel != null && message.hasOwnProperty("recoveryModel")) + if (message.recoveryModel != null && Object.hasOwnProperty.call(message, "recoveryModel")) if (!$util.isString(message.recoveryModel)) return "recoveryModel: string expected"; return null; @@ -104937,6 +108063,8 @@ SqlServerDatabaseDetails.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlServerDatabaseDetails) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlServerDatabaseDetails: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -104958,17 +108086,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerDatabaseDetails.toObject = function toObject(message, options) { + SqlServerDatabaseDetails.toObject = function toObject(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.compatibilityLevel = 0; object.recoveryModel = ""; } - if (message.compatibilityLevel != null && message.hasOwnProperty("compatibilityLevel")) + if (message.compatibilityLevel != null && Object.hasOwnProperty.call(message, "compatibilityLevel")) object.compatibilityLevel = message.compatibilityLevel; - if (message.recoveryModel != null && message.hasOwnProperty("recoveryModel")) + if (message.recoveryModel != null && Object.hasOwnProperty.call(message, "recoveryModel")) object.recoveryModel = message.recoveryModel; return object; }; @@ -105064,9 +108196,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseFlags.encode = function encode(message, writer) { + DatabaseFlags.encode = function encode(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 && Object.hasOwnProperty.call(message, "value")) @@ -105084,7 +108220,7 @@ * @returns {$protobuf.Writer} Writer */ DatabaseFlags.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -105158,10 +108294,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 (!$util.isString(message.value)) return "value: string expected"; return null; @@ -105178,6 +108314,8 @@ DatabaseFlags.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DatabaseFlags) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DatabaseFlags: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -105199,17 +108337,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseFlags.toObject = function toObject(message, options) { + DatabaseFlags.toObject = function toObject(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.value = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -105305,9 +108447,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncFlags.encode = function encode(message, writer) { + SyncFlags.encode = function encode(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 && Object.hasOwnProperty.call(message, "value")) @@ -105325,7 +108471,7 @@ * @returns {$protobuf.Writer} Writer */ SyncFlags.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -105399,10 +108545,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 (!$util.isString(message.value)) return "value: string expected"; return null; @@ -105419,6 +108565,8 @@ SyncFlags.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SyncFlags) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SyncFlags: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -105440,17 +108588,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncFlags.toObject = function toObject(message, options) { + SyncFlags.toObject = function toObject(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.value = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -105555,9 +108707,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstanceReference.encode = function encode(message, writer) { + InstanceReference.encode = function encode(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.region != null && Object.hasOwnProperty.call(message, "region")) @@ -105577,7 +108733,7 @@ * @returns {$protobuf.Writer} Writer */ InstanceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -105655,13 +108811,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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -105678,6 +108834,8 @@ InstanceReference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstanceReference) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstanceReference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -105701,20 +108859,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstanceReference.toObject = function toObject(message, options) { + InstanceReference.toObject = function toObject(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.region = ""; object.project = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -106328,9 +109490,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabaseInstance.encode = function encode(message, writer) { + DatabaseInstance.encode = function encode(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.state != null && Object.hasOwnProperty.call(message, "state")) @@ -106338,25 +109504,25 @@ if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.databaseVersion); if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) - $root.google.cloud.sql.v1beta4.Settings.encode(message.settings, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Settings.encode(message.settings, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); if (message.failoverReplica != null && Object.hasOwnProperty.call(message, "failoverReplica")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.encode(message.failoverReplica, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.encode(message.failoverReplica, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.masterInstanceName); if (message.replicaNames != null && message.replicaNames.length) for (var i = 0; i < message.replicaNames.length; ++i) writer.uint32(/* id 8, wireType 2 =*/66).string(message.replicaNames[i]); if (message.maxDiskSize != null && Object.hasOwnProperty.call(message, "maxDiskSize")) - $root.google.protobuf.Int64Value.encode(message.maxDiskSize, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.maxDiskSize, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.currentDiskSize != null && Object.hasOwnProperty.call(message, "currentDiskSize")) - $root.google.protobuf.Int64Value.encode(message.currentDiskSize, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.currentDiskSize, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCaCert, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCaCert, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.instanceType); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -106366,9 +109532,9 @@ if (message.serviceAccountEmailAddress != null && Object.hasOwnProperty.call(message, "serviceAccountEmailAddress")) writer.uint32(/* id 16, wireType 2 =*/130).string(message.serviceAccountEmailAddress); if (message.onPremisesConfiguration != null && Object.hasOwnProperty.call(message, "onPremisesConfiguration")) - $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.encode(message.onPremisesConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.encode(message.onPremisesConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) - $root.google.cloud.sql.v1beta4.ReplicaConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ReplicaConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) writer.uint32(/* id 19, wireType 0 =*/152).int32(message.backendType); if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) @@ -106388,21 +109554,21 @@ if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) writer.uint32(/* id 25, wireType 2 =*/202).string(message.gceZone); if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) - $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.encode(message.diskEncryptionConfiguration, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim(); if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) - $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.encode(message.diskEncryptionStatus, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) writer.uint32(/* id 29, wireType 2 =*/234).string(message.rootPassword); if (message.scheduledMaintenance != null && Object.hasOwnProperty.call(message, "scheduledMaintenance")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.encode(message.scheduledMaintenance, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.encode(message.scheduledMaintenance, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim(); if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) writer.uint32(/* id 34, wireType 2 =*/274).string(message.secondaryGceZone); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); if (message.outOfDiskReport != null && Object.hasOwnProperty.call(message, "outOfDiskReport")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.encode(message.outOfDiskReport, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.encode(message.outOfDiskReport, writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 39, wireType 2 =*/314).fork(), q + 1).ldelim(); if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.databaseInstalledVersion); if (message.availableMaintenanceVersions != null && message.availableMaintenanceVersions.length) @@ -106412,7 +109578,7 @@ writer.uint32(/* id 42, wireType 2 =*/338).string(message.maintenanceVersion); if (message.upgradableDatabaseVersions != null && message.upgradableDatabaseVersions.length) for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) - $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.encode(message.upgradableDatabaseVersions[i], writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.encode(message.upgradableDatabaseVersions[i], writer.uint32(/* id 45, wireType 2 =*/362).fork(), q + 1).ldelim(); if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) writer.uint32(/* id 47, wireType 0 =*/376).int32(message.sqlNetworkArchitecture); if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) @@ -106424,15 +109590,15 @@ if (message.writeEndpoint != null && Object.hasOwnProperty.call(message, "writeEndpoint")) writer.uint32(/* id 52, wireType 2 =*/418).string(message.writeEndpoint); if (message.replicationCluster != null && Object.hasOwnProperty.call(message, "replicationCluster")) - $root.google.cloud.sql.v1beta4.ReplicationCluster.encode(message.replicationCluster, writer.uint32(/* id 54, wireType 2 =*/434).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ReplicationCluster.encode(message.replicationCluster, writer.uint32(/* id 54, wireType 2 =*/434).fork(), q + 1).ldelim(); if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) - $root.google.cloud.sql.v1beta4.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.GeminiInstanceConfig.encode(message.geminiConfig, writer.uint32(/* id 55, wireType 2 =*/442).fork(), q + 1).ldelim(); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.satisfiesPzi, writer.uint32(/* id 56, wireType 2 =*/450).fork(), q + 1).ldelim(); if (message.switchTransactionLogsToCloudStorageEnabled != null && Object.hasOwnProperty.call(message, "switchTransactionLogsToCloudStorageEnabled")) - $root.google.protobuf.BoolValue.encode(message.switchTransactionLogsToCloudStorageEnabled, writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.switchTransactionLogsToCloudStorageEnabled, writer.uint32(/* id 57, wireType 2 =*/458).fork(), q + 1).ldelim(); if (message.includeReplicasForMajorVersionUpgrade != null && Object.hasOwnProperty.call(message, "includeReplicasForMajorVersionUpgrade")) - $root.google.protobuf.BoolValue.encode(message.includeReplicasForMajorVersionUpgrade, writer.uint32(/* id 59, wireType 2 =*/474).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.includeReplicasForMajorVersionUpgrade, writer.uint32(/* id 59, wireType 2 =*/474).fork(), q + 1).ldelim(); if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) for (var keys = Object.keys(message.tags), i = 0; i < keys.length; ++i) writer.uint32(/* id 60, wireType 2 =*/482).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.tags[keys[i]]).ldelim(); @@ -106440,10 +109606,10 @@ writer.uint32(/* id 63, wireType 0 =*/504).int32(message.nodeCount); if (message.nodes != null && message.nodes.length) for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork(), q + 1).ldelim(); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 67, wireType 2 =*/538).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 67, wireType 2 =*/538).fork(), q + 1).ldelim(); return writer; }; @@ -106457,7 +109623,7 @@ * @returns {$protobuf.Writer} Writer */ DatabaseInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -106768,10 +109934,10 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) switch (message.state) { default: return "state: enum value expected"; @@ -106786,7 +109952,7 @@ case 8: break; } - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -106848,40 +110014,40 @@ case 551: break; } - if (message.settings != null && message.hasOwnProperty("settings")) { + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) { var error = $root.google.cloud.sql.v1beta4.Settings.verify(message.settings, long + 1); if (error) return "settings." + error; } - 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.failoverReplica != null && message.hasOwnProperty("failoverReplica")) { + if (message.failoverReplica != null && Object.hasOwnProperty.call(message, "failoverReplica")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.verify(message.failoverReplica, long + 1); if (error) return "failoverReplica." + error; } - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) if (!$util.isString(message.masterInstanceName)) return "masterInstanceName: string expected"; - if (message.replicaNames != null && message.hasOwnProperty("replicaNames")) { + if (message.replicaNames != null && Object.hasOwnProperty.call(message, "replicaNames")) { if (!Array.isArray(message.replicaNames)) return "replicaNames: array expected"; for (var i = 0; i < message.replicaNames.length; ++i) if (!$util.isString(message.replicaNames[i])) return "replicaNames: string[] expected"; } - if (message.maxDiskSize != null && message.hasOwnProperty("maxDiskSize")) { + if (message.maxDiskSize != null && Object.hasOwnProperty.call(message, "maxDiskSize")) { var error = $root.google.protobuf.Int64Value.verify(message.maxDiskSize, long + 1); if (error) return "maxDiskSize." + error; } - if (message.currentDiskSize != null && message.hasOwnProperty("currentDiskSize")) { + if (message.currentDiskSize != null && Object.hasOwnProperty.call(message, "currentDiskSize")) { var error = $root.google.protobuf.Int64Value.verify(message.currentDiskSize, long + 1); if (error) return "currentDiskSize." + error; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -106890,12 +110056,12 @@ return "ipAddresses." + error; } } - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) { + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) { var error = $root.google.cloud.sql.v1beta4.SslCert.verify(message.serverCaCert, long + 1); if (error) return "serverCaCert." + error; } - 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"; @@ -106906,26 +110072,26 @@ case 5: break; } - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) if (!$util.isString(message.ipv6Address)) return "ipv6Address: string expected"; - if (message.serviceAccountEmailAddress != null && message.hasOwnProperty("serviceAccountEmailAddress")) + if (message.serviceAccountEmailAddress != null && Object.hasOwnProperty.call(message, "serviceAccountEmailAddress")) if (!$util.isString(message.serviceAccountEmailAddress)) return "serviceAccountEmailAddress: string expected"; - if (message.onPremisesConfiguration != null && message.hasOwnProperty("onPremisesConfiguration")) { + if (message.onPremisesConfiguration != null && Object.hasOwnProperty.call(message, "onPremisesConfiguration")) { var error = $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.verify(message.onPremisesConfiguration, long + 1); if (error) return "onPremisesConfiguration." + error; } - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) { + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) { var error = $root.google.cloud.sql.v1beta4.ReplicaConfiguration.verify(message.replicaConfiguration, long + 1); if (error) return "replicaConfiguration." + error; } - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) switch (message.backendType) { default: return "backendType: enum value expected"; @@ -106935,10 +110101,10 @@ case 3: break; } - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; - if (message.suspensionReason != null && message.hasOwnProperty("suspensionReason")) { + if (message.suspensionReason != null && Object.hasOwnProperty.call(message, "suspensionReason")) { if (!Array.isArray(message.suspensionReason)) return "suspensionReason: array expected"; for (var i = 0; i < message.suspensionReason.length; ++i) @@ -106954,48 +110120,48 @@ break; } } - if (message.connectionName != null && message.hasOwnProperty("connectionName")) + if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName")) if (!$util.isString(message.connectionName)) return "connectionName: string expected"; - 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.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) if (!$util.isString(message.gceZone)) return "gceZone: string expected"; - if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) if (!$util.isString(message.secondaryGceZone)) return "secondaryGceZone: string expected"; - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) { + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) { var error = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.verify(message.diskEncryptionConfiguration, long + 1); if (error) return "diskEncryptionConfiguration." + error; } - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) { + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) { var error = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.verify(message.diskEncryptionStatus, long + 1); if (error) return "diskEncryptionStatus." + error; } - if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) if (!$util.isString(message.rootPassword)) return "rootPassword: string expected"; - if (message.scheduledMaintenance != null && message.hasOwnProperty("scheduledMaintenance")) { + if (message.scheduledMaintenance != null && Object.hasOwnProperty.call(message, "scheduledMaintenance")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.verify(message.scheduledMaintenance, long + 1); if (error) return "scheduledMaintenance." + error; } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs, long + 1); if (error) return "satisfiesPzs." + error; } - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) if (!$util.isString(message.databaseInstalledVersion)) return "databaseInstalledVersion: string expected"; - if (message.outOfDiskReport != null && message.hasOwnProperty("outOfDiskReport")) { + if (message.outOfDiskReport != null && Object.hasOwnProperty.call(message, "outOfDiskReport")) { properties._outOfDiskReport = 1; { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.verify(message.outOfDiskReport, long + 1); @@ -107003,22 +110169,22 @@ return "outOfDiskReport." + 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.availableMaintenanceVersions != null && message.hasOwnProperty("availableMaintenanceVersions")) { + if (message.availableMaintenanceVersions != null && Object.hasOwnProperty.call(message, "availableMaintenanceVersions")) { if (!Array.isArray(message.availableMaintenanceVersions)) return "availableMaintenanceVersions: array expected"; for (var i = 0; i < message.availableMaintenanceVersions.length; ++i) if (!$util.isString(message.availableMaintenanceVersions[i])) return "availableMaintenanceVersions: string[] expected"; } - if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) + if (message.maintenanceVersion != null && Object.hasOwnProperty.call(message, "maintenanceVersion")) if (!$util.isString(message.maintenanceVersion)) return "maintenanceVersion: string expected"; - if (message.upgradableDatabaseVersions != null && message.hasOwnProperty("upgradableDatabaseVersions")) { + if (message.upgradableDatabaseVersions != null && Object.hasOwnProperty.call(message, "upgradableDatabaseVersions")) { if (!Array.isArray(message.upgradableDatabaseVersions)) return "upgradableDatabaseVersions: array expected"; for (var i = 0; i < message.upgradableDatabaseVersions.length; ++i) { @@ -107027,7 +110193,7 @@ return "upgradableDatabaseVersions." + error; } } - if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { + if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) { properties._sqlNetworkArchitecture = 1; switch (message.sqlNetworkArchitecture) { default: @@ -107038,27 +110204,27 @@ break; } } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { properties._pscServiceAttachmentLink = 1; if (!$util.isString(message.pscServiceAttachmentLink)) return "pscServiceAttachmentLink: string expected"; } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { properties._dnsName = 1; if (!$util.isString(message.dnsName)) return "dnsName: string expected"; } - if (message.primaryDnsName != null && message.hasOwnProperty("primaryDnsName")) { + if (message.primaryDnsName != null && Object.hasOwnProperty.call(message, "primaryDnsName")) { properties._primaryDnsName = 1; if (!$util.isString(message.primaryDnsName)) return "primaryDnsName: string expected"; } - if (message.writeEndpoint != null && message.hasOwnProperty("writeEndpoint")) { + if (message.writeEndpoint != null && Object.hasOwnProperty.call(message, "writeEndpoint")) { properties._writeEndpoint = 1; if (!$util.isString(message.writeEndpoint)) return "writeEndpoint: string expected"; } - if (message.replicationCluster != null && message.hasOwnProperty("replicationCluster")) { + if (message.replicationCluster != null && Object.hasOwnProperty.call(message, "replicationCluster")) { properties._replicationCluster = 1; { var error = $root.google.cloud.sql.v1beta4.ReplicationCluster.verify(message.replicationCluster, long + 1); @@ -107066,7 +110232,7 @@ return "replicationCluster." + error; } } - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) { properties._geminiConfig = 1; { var error = $root.google.cloud.sql.v1beta4.GeminiInstanceConfig.verify(message.geminiConfig, long + 1); @@ -107074,12 +110240,12 @@ return "geminiConfig." + error; } } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) { var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzi, long + 1); if (error) return "satisfiesPzi." + error; } - if (message.switchTransactionLogsToCloudStorageEnabled != null && message.hasOwnProperty("switchTransactionLogsToCloudStorageEnabled")) { + if (message.switchTransactionLogsToCloudStorageEnabled != null && Object.hasOwnProperty.call(message, "switchTransactionLogsToCloudStorageEnabled")) { properties._switchTransactionLogsToCloudStorageEnabled = 1; { var error = $root.google.protobuf.BoolValue.verify(message.switchTransactionLogsToCloudStorageEnabled, long + 1); @@ -107087,7 +110253,7 @@ return "switchTransactionLogsToCloudStorageEnabled." + error; } } - if (message.includeReplicasForMajorVersionUpgrade != null && message.hasOwnProperty("includeReplicasForMajorVersionUpgrade")) { + if (message.includeReplicasForMajorVersionUpgrade != null && Object.hasOwnProperty.call(message, "includeReplicasForMajorVersionUpgrade")) { properties._includeReplicasForMajorVersionUpgrade = 1; { var error = $root.google.protobuf.BoolValue.verify(message.includeReplicasForMajorVersionUpgrade, long + 1); @@ -107095,7 +110261,7 @@ return "includeReplicasForMajorVersionUpgrade." + error; } } - if (message.tags != null && message.hasOwnProperty("tags")) { + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) { if (!$util.isObject(message.tags)) return "tags: object expected"; var key = Object.keys(message.tags); @@ -107103,12 +110269,12 @@ if (!$util.isString(message.tags[key[i]])) return "tags: string{k: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.nodes != null && message.hasOwnProperty("nodes")) { + if (message.nodes != null && Object.hasOwnProperty.call(message, "nodes")) { if (!Array.isArray(message.nodes)) return "nodes: array expected"; for (var i = 0; i < message.nodes.length; ++i) { @@ -107117,7 +110283,7 @@ return "nodes." + error; } } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -107140,6 +110306,8 @@ DatabaseInstance.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DatabaseInstance) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -107424,14 +110592,14 @@ break; } if (object.settings != null) { - if (typeof object.settings !== "object") + if (!$util.isObject(object.settings)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.settings: object expected"); message.settings = $root.google.cloud.sql.v1beta4.Settings.fromObject(object.settings, long + 1); } if (object.etag != null) message.etag = String(object.etag); if (object.failoverReplica != null) { - if (typeof object.failoverReplica !== "object") + if (!$util.isObject(object.failoverReplica)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.failoverReplica: object expected"); message.failoverReplica = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.fromObject(object.failoverReplica, long + 1); } @@ -107445,12 +110613,12 @@ message.replicaNames[i] = String(object.replicaNames[i]); } if (object.maxDiskSize != null) { - if (typeof object.maxDiskSize !== "object") + if (!$util.isObject(object.maxDiskSize)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.maxDiskSize: object expected"); message.maxDiskSize = $root.google.protobuf.Int64Value.fromObject(object.maxDiskSize, long + 1); } if (object.currentDiskSize != null) { - if (typeof object.currentDiskSize !== "object") + if (!$util.isObject(object.currentDiskSize)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.currentDiskSize: object expected"); message.currentDiskSize = $root.google.protobuf.Int64Value.fromObject(object.currentDiskSize, long + 1); } @@ -107459,13 +110627,13 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1beta4.IpMapping.fromObject(object.ipAddresses[i], long + 1); } } if (object.serverCaCert != null) { - if (typeof object.serverCaCert !== "object") + if (!$util.isObject(object.serverCaCert)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.serverCaCert: object expected"); message.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.serverCaCert, long + 1); } @@ -107504,12 +110672,12 @@ if (object.serviceAccountEmailAddress != null) message.serviceAccountEmailAddress = String(object.serviceAccountEmailAddress); if (object.onPremisesConfiguration != null) { - if (typeof object.onPremisesConfiguration !== "object") + if (!$util.isObject(object.onPremisesConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.onPremisesConfiguration: object expected"); message.onPremisesConfiguration = $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.fromObject(object.onPremisesConfiguration, long + 1); } if (object.replicaConfiguration != null) { - if (typeof object.replicaConfiguration !== "object") + if (!$util.isObject(object.replicaConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.replicaConfiguration: object expected"); message.replicaConfiguration = $root.google.cloud.sql.v1beta4.ReplicaConfiguration.fromObject(object.replicaConfiguration, long + 1); } @@ -107587,36 +110755,36 @@ if (object.secondaryGceZone != null) message.secondaryGceZone = String(object.secondaryGceZone); if (object.diskEncryptionConfiguration != null) { - if (typeof object.diskEncryptionConfiguration !== "object") + if (!$util.isObject(object.diskEncryptionConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.diskEncryptionConfiguration: object expected"); message.diskEncryptionConfiguration = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.fromObject(object.diskEncryptionConfiguration, long + 1); } if (object.diskEncryptionStatus != null) { - if (typeof object.diskEncryptionStatus !== "object") + if (!$util.isObject(object.diskEncryptionStatus)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.diskEncryptionStatus: object expected"); message.diskEncryptionStatus = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.fromObject(object.diskEncryptionStatus, long + 1); } if (object.rootPassword != null) message.rootPassword = String(object.rootPassword); if (object.scheduledMaintenance != null) { - if (typeof object.scheduledMaintenance !== "object") + if (!$util.isObject(object.scheduledMaintenance)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.scheduledMaintenance: object expected"); message.scheduledMaintenance = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.fromObject(object.scheduledMaintenance, long + 1); } if (object.satisfiesPzs != null) { - if (typeof object.satisfiesPzs !== "object") + if (!$util.isObject(object.satisfiesPzs)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.satisfiesPzs: object expected"); message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs, long + 1); } if (object.databaseInstalledVersion != null) message.databaseInstalledVersion = String(object.databaseInstalledVersion); if (object.outOfDiskReport != null) { - if (typeof object.outOfDiskReport !== "object") + if (!$util.isObject(object.outOfDiskReport)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.outOfDiskReport: object expected"); message.outOfDiskReport = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.fromObject(object.outOfDiskReport, long + 1); } if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } @@ -107634,7 +110802,7 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.upgradableDatabaseVersions: array expected"); message.upgradableDatabaseVersions = []; for (var i = 0; i < object.upgradableDatabaseVersions.length; ++i) { - if (typeof object.upgradableDatabaseVersions[i] !== "object") + if (!$util.isObject(object.upgradableDatabaseVersions[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.upgradableDatabaseVersions: object expected"); message.upgradableDatabaseVersions[i] = $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.fromObject(object.upgradableDatabaseVersions[i], long + 1); } @@ -107668,32 +110836,32 @@ if (object.writeEndpoint != null) message.writeEndpoint = String(object.writeEndpoint); if (object.replicationCluster != null) { - if (typeof object.replicationCluster !== "object") + if (!$util.isObject(object.replicationCluster)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.replicationCluster: object expected"); message.replicationCluster = $root.google.cloud.sql.v1beta4.ReplicationCluster.fromObject(object.replicationCluster, long + 1); } if (object.geminiConfig != null) { - if (typeof object.geminiConfig !== "object") + if (!$util.isObject(object.geminiConfig)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.geminiConfig: object expected"); message.geminiConfig = $root.google.cloud.sql.v1beta4.GeminiInstanceConfig.fromObject(object.geminiConfig, long + 1); } if (object.satisfiesPzi != null) { - if (typeof object.satisfiesPzi !== "object") + if (!$util.isObject(object.satisfiesPzi)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.satisfiesPzi: object expected"); message.satisfiesPzi = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzi, long + 1); } if (object.switchTransactionLogsToCloudStorageEnabled != null) { - if (typeof object.switchTransactionLogsToCloudStorageEnabled !== "object") + if (!$util.isObject(object.switchTransactionLogsToCloudStorageEnabled)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.switchTransactionLogsToCloudStorageEnabled: object expected"); message.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.fromObject(object.switchTransactionLogsToCloudStorageEnabled, long + 1); } if (object.includeReplicasForMajorVersionUpgrade != null) { - if (typeof object.includeReplicasForMajorVersionUpgrade !== "object") + if (!$util.isObject(object.includeReplicasForMajorVersionUpgrade)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.includeReplicasForMajorVersionUpgrade: object expected"); message.includeReplicasForMajorVersionUpgrade = $root.google.protobuf.BoolValue.fromObject(object.includeReplicasForMajorVersionUpgrade, long + 1); } if (object.tags) { - if (typeof object.tags !== "object") + if (!$util.isObject(object.tags)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.tags: object expected"); message.tags = {}; for (var keys = Object.keys(object.tags), i = 0; i < keys.length; ++i) { @@ -107709,7 +110877,7 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.nodes: array expected"); message.nodes = []; for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") + if (!$util.isObject(object.nodes[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.nodes: object expected"); message.nodes[i] = $root.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.fromObject(object.nodes[i], long + 1); } @@ -107719,7 +110887,7 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1beta4.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -107736,9 +110904,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabaseInstance.toObject = function toObject(message, options) { + DatabaseInstance.toObject = function toObject(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.replicaNames = []; @@ -107785,142 +110957,142 @@ object.maintenanceVersion = ""; object.satisfiesPzi = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.state != null && message.hasOwnProperty("state")) + if (message.state != null && Object.hasOwnProperty.call(message, "state")) object.state = options.enums === String ? $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState[message.state] === undefined ? message.state : $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState[message.state] : message.state; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.settings != null && message.hasOwnProperty("settings")) - object.settings = $root.google.cloud.sql.v1beta4.Settings.toObject(message.settings, options); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.settings != null && Object.hasOwnProperty.call(message, "settings")) + object.settings = $root.google.cloud.sql.v1beta4.Settings.toObject(message.settings, options, q + 1); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.failoverReplica != null && message.hasOwnProperty("failoverReplica")) - object.failoverReplica = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.toObject(message.failoverReplica, options); - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.failoverReplica != null && Object.hasOwnProperty.call(message, "failoverReplica")) + object.failoverReplica = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.toObject(message.failoverReplica, options, q + 1); + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) object.masterInstanceName = message.masterInstanceName; if (message.replicaNames && message.replicaNames.length) { object.replicaNames = []; for (var j = 0; j < message.replicaNames.length; ++j) object.replicaNames[j] = message.replicaNames[j]; } - if (message.maxDiskSize != null && message.hasOwnProperty("maxDiskSize")) - object.maxDiskSize = $root.google.protobuf.Int64Value.toObject(message.maxDiskSize, options); - if (message.currentDiskSize != null && message.hasOwnProperty("currentDiskSize")) - object.currentDiskSize = $root.google.protobuf.Int64Value.toObject(message.currentDiskSize, options); + if (message.maxDiskSize != null && Object.hasOwnProperty.call(message, "maxDiskSize")) + object.maxDiskSize = $root.google.protobuf.Int64Value.toObject(message.maxDiskSize, options, q + 1); + if (message.currentDiskSize != null && Object.hasOwnProperty.call(message, "currentDiskSize")) + object.currentDiskSize = $root.google.protobuf.Int64Value.toObject(message.currentDiskSize, options, q + 1); if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) - object.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCaCert, options); - if (message.instanceType != null && message.hasOwnProperty("instanceType")) + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) + object.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCaCert, options, q + 1); + if (message.instanceType != null && Object.hasOwnProperty.call(message, "instanceType")) object.instanceType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlInstanceType[message.instanceType] === undefined ? message.instanceType : $root.google.cloud.sql.v1beta4.SqlInstanceType[message.instanceType] : message.instanceType; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) object.ipv6Address = message.ipv6Address; - if (message.serviceAccountEmailAddress != null && message.hasOwnProperty("serviceAccountEmailAddress")) + if (message.serviceAccountEmailAddress != null && Object.hasOwnProperty.call(message, "serviceAccountEmailAddress")) object.serviceAccountEmailAddress = message.serviceAccountEmailAddress; - if (message.onPremisesConfiguration != null && message.hasOwnProperty("onPremisesConfiguration")) - object.onPremisesConfiguration = $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.toObject(message.onPremisesConfiguration, options); - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) - object.replicaConfiguration = $root.google.cloud.sql.v1beta4.ReplicaConfiguration.toObject(message.replicaConfiguration, options); - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.onPremisesConfiguration != null && Object.hasOwnProperty.call(message, "onPremisesConfiguration")) + object.onPremisesConfiguration = $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.toObject(message.onPremisesConfiguration, options, q + 1); + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) + object.replicaConfiguration = $root.google.cloud.sql.v1beta4.ReplicaConfiguration.toObject(message.replicaConfiguration, options, q + 1); + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) object.backendType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlBackendType[message.backendType] === undefined ? message.backendType : $root.google.cloud.sql.v1beta4.SqlBackendType[message.backendType] : message.backendType; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; if (message.suspensionReason && message.suspensionReason.length) { object.suspensionReason = []; for (var j = 0; j < message.suspensionReason.length; ++j) object.suspensionReason[j] = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlSuspensionReason[message.suspensionReason[j]] === undefined ? message.suspensionReason[j] : $root.google.cloud.sql.v1beta4.SqlSuspensionReason[message.suspensionReason[j]] : message.suspensionReason[j]; } - if (message.connectionName != null && message.hasOwnProperty("connectionName")) + if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName")) object.connectionName = message.connectionName; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; - if (message.gceZone != null && message.hasOwnProperty("gceZone")) + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) object.gceZone = message.gceZone; - if (message.diskEncryptionConfiguration != null && message.hasOwnProperty("diskEncryptionConfiguration")) - object.diskEncryptionConfiguration = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options); - if (message.diskEncryptionStatus != null && message.hasOwnProperty("diskEncryptionStatus")) - object.diskEncryptionStatus = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options); - if (message.rootPassword != null && message.hasOwnProperty("rootPassword")) + if (message.diskEncryptionConfiguration != null && Object.hasOwnProperty.call(message, "diskEncryptionConfiguration")) + object.diskEncryptionConfiguration = $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration.toObject(message.diskEncryptionConfiguration, options, q + 1); + if (message.diskEncryptionStatus != null && Object.hasOwnProperty.call(message, "diskEncryptionStatus")) + object.diskEncryptionStatus = $root.google.cloud.sql.v1beta4.DiskEncryptionStatus.toObject(message.diskEncryptionStatus, options, q + 1); + if (message.rootPassword != null && Object.hasOwnProperty.call(message, "rootPassword")) object.rootPassword = message.rootPassword; - if (message.scheduledMaintenance != null && message.hasOwnProperty("scheduledMaintenance")) - object.scheduledMaintenance = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.toObject(message.scheduledMaintenance, options); - if (message.secondaryGceZone != null && message.hasOwnProperty("secondaryGceZone")) + if (message.scheduledMaintenance != null && Object.hasOwnProperty.call(message, "scheduledMaintenance")) + object.scheduledMaintenance = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.toObject(message.scheduledMaintenance, options, q + 1); + if (message.secondaryGceZone != null && Object.hasOwnProperty.call(message, "secondaryGceZone")) object.secondaryGceZone = message.secondaryGceZone; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); - if (message.outOfDiskReport != null && message.hasOwnProperty("outOfDiskReport")) { - object.outOfDiskReport = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.toObject(message.outOfDiskReport, options); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options, q + 1); + if (message.outOfDiskReport != null && Object.hasOwnProperty.call(message, "outOfDiskReport")) { + object.outOfDiskReport = $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.toObject(message.outOfDiskReport, options, q + 1); if (options.oneofs) object._outOfDiskReport = "outOfDiskReport"; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) object.databaseInstalledVersion = message.databaseInstalledVersion; if (message.availableMaintenanceVersions && message.availableMaintenanceVersions.length) { object.availableMaintenanceVersions = []; for (var j = 0; j < message.availableMaintenanceVersions.length; ++j) object.availableMaintenanceVersions[j] = message.availableMaintenanceVersions[j]; } - if (message.maintenanceVersion != null && message.hasOwnProperty("maintenanceVersion")) + if (message.maintenanceVersion != null && Object.hasOwnProperty.call(message, "maintenanceVersion")) object.maintenanceVersion = message.maintenanceVersion; if (message.upgradableDatabaseVersions && message.upgradableDatabaseVersions.length) { object.upgradableDatabaseVersions = []; for (var j = 0; j < message.upgradableDatabaseVersions.length; ++j) - object.upgradableDatabaseVersions[j] = $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.toObject(message.upgradableDatabaseVersions[j], options); + object.upgradableDatabaseVersions[j] = $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion.toObject(message.upgradableDatabaseVersions[j], options, q + 1); } - if (message.sqlNetworkArchitecture != null && message.hasOwnProperty("sqlNetworkArchitecture")) { + if (message.sqlNetworkArchitecture != null && Object.hasOwnProperty.call(message, "sqlNetworkArchitecture")) { object.sqlNetworkArchitecture = options.enums === String ? $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] === undefined ? message.sqlNetworkArchitecture : $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlNetworkArchitecture[message.sqlNetworkArchitecture] : message.sqlNetworkArchitecture; if (options.oneofs) object._sqlNetworkArchitecture = "sqlNetworkArchitecture"; } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { object.pscServiceAttachmentLink = message.pscServiceAttachmentLink; if (options.oneofs) object._pscServiceAttachmentLink = "pscServiceAttachmentLink"; } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { object.dnsName = message.dnsName; if (options.oneofs) object._dnsName = "dnsName"; } - if (message.primaryDnsName != null && message.hasOwnProperty("primaryDnsName")) { + if (message.primaryDnsName != null && Object.hasOwnProperty.call(message, "primaryDnsName")) { object.primaryDnsName = message.primaryDnsName; if (options.oneofs) object._primaryDnsName = "primaryDnsName"; } - if (message.writeEndpoint != null && message.hasOwnProperty("writeEndpoint")) { + if (message.writeEndpoint != null && Object.hasOwnProperty.call(message, "writeEndpoint")) { object.writeEndpoint = message.writeEndpoint; if (options.oneofs) object._writeEndpoint = "writeEndpoint"; } - if (message.replicationCluster != null && message.hasOwnProperty("replicationCluster")) { - object.replicationCluster = $root.google.cloud.sql.v1beta4.ReplicationCluster.toObject(message.replicationCluster, options); + if (message.replicationCluster != null && Object.hasOwnProperty.call(message, "replicationCluster")) { + object.replicationCluster = $root.google.cloud.sql.v1beta4.ReplicationCluster.toObject(message.replicationCluster, options, q + 1); if (options.oneofs) object._replicationCluster = "replicationCluster"; } - if (message.geminiConfig != null && message.hasOwnProperty("geminiConfig")) { - object.geminiConfig = $root.google.cloud.sql.v1beta4.GeminiInstanceConfig.toObject(message.geminiConfig, options); + if (message.geminiConfig != null && Object.hasOwnProperty.call(message, "geminiConfig")) { + object.geminiConfig = $root.google.cloud.sql.v1beta4.GeminiInstanceConfig.toObject(message.geminiConfig, options, q + 1); if (options.oneofs) object._geminiConfig = "geminiConfig"; } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options); - if (message.switchTransactionLogsToCloudStorageEnabled != null && message.hasOwnProperty("switchTransactionLogsToCloudStorageEnabled")) { - object.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.toObject(message.switchTransactionLogsToCloudStorageEnabled, options); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + object.satisfiesPzi = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzi, options, q + 1); + if (message.switchTransactionLogsToCloudStorageEnabled != null && Object.hasOwnProperty.call(message, "switchTransactionLogsToCloudStorageEnabled")) { + object.switchTransactionLogsToCloudStorageEnabled = $root.google.protobuf.BoolValue.toObject(message.switchTransactionLogsToCloudStorageEnabled, options, q + 1); if (options.oneofs) object._switchTransactionLogsToCloudStorageEnabled = "switchTransactionLogsToCloudStorageEnabled"; } - if (message.includeReplicasForMajorVersionUpgrade != null && message.hasOwnProperty("includeReplicasForMajorVersionUpgrade")) { - object.includeReplicasForMajorVersionUpgrade = $root.google.protobuf.BoolValue.toObject(message.includeReplicasForMajorVersionUpgrade, options); + if (message.includeReplicasForMajorVersionUpgrade != null && Object.hasOwnProperty.call(message, "includeReplicasForMajorVersionUpgrade")) { + object.includeReplicasForMajorVersionUpgrade = $root.google.protobuf.BoolValue.toObject(message.includeReplicasForMajorVersionUpgrade, options, q + 1); if (options.oneofs) object._includeReplicasForMajorVersionUpgrade = "includeReplicasForMajorVersionUpgrade"; } @@ -107933,7 +111105,7 @@ object.tags[keys2[j]] = message.tags[keys2[j]]; } } - 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"; @@ -107941,12 +111113,12 @@ if (message.nodes && message.nodes.length) { object.nodes = []; for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.toObject(message.nodes[j], options); + object.nodes[j] = $root.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.toObject(message.nodes[j], options, q + 1); } if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } return object; }; @@ -108067,13 +111239,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlFailoverReplica.encode = function encode(message, writer) { + SqlFailoverReplica.encode = function encode(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.available != null && Object.hasOwnProperty.call(message, "available")) - $root.google.protobuf.BoolValue.encode(message.available, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.available, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -108087,7 +111263,7 @@ * @returns {$protobuf.Writer} Writer */ SqlFailoverReplica.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -108161,10 +111337,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.available != null && message.hasOwnProperty("available")) { + if (message.available != null && Object.hasOwnProperty.call(message, "available")) { var error = $root.google.protobuf.BoolValue.verify(message.available, long + 1); if (error) return "available." + error; @@ -108183,6 +111359,8 @@ SqlFailoverReplica.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -108191,7 +111369,7 @@ if (object.name != null) message.name = String(object.name); if (object.available != null) { - if (typeof object.available !== "object") + if (!$util.isObject(object.available)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.SqlFailoverReplica.available: object expected"); message.available = $root.google.protobuf.BoolValue.fromObject(object.available, long + 1); } @@ -108207,18 +111385,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlFailoverReplica.toObject = function toObject(message, options) { + SqlFailoverReplica.toObject = function toObject(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.available = null; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.available != null && message.hasOwnProperty("available")) - object.available = $root.google.protobuf.BoolValue.toObject(message.available, options); + if (message.available != null && Object.hasOwnProperty.call(message, "available")) + object.available = $root.google.protobuf.BoolValue.toObject(message.available, options, q + 1); return object; }; @@ -108340,17 +111522,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlScheduledMaintenance.encode = function encode(message, writer) { + SqlScheduledMaintenance.encode = function encode(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.canDefer != null && Object.hasOwnProperty.call(message, "canDefer")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.canDefer); if (message.canReschedule != null && Object.hasOwnProperty.call(message, "canReschedule")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canReschedule); if (message.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleDeadlineTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.scheduleDeadlineTime, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -108364,7 +111550,7 @@ * @returns {$protobuf.Writer} Writer */ SqlScheduledMaintenance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -108447,18 +111633,18 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.canDefer != null && message.hasOwnProperty("canDefer")) + if (message.canDefer != null && Object.hasOwnProperty.call(message, "canDefer")) if (typeof message.canDefer !== "boolean") return "canDefer: boolean expected"; - if (message.canReschedule != null && message.hasOwnProperty("canReschedule")) + if (message.canReschedule != null && Object.hasOwnProperty.call(message, "canReschedule")) if (typeof message.canReschedule !== "boolean") return "canReschedule: boolean expected"; - if (message.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) { + if (message.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) { properties._scheduleDeadlineTime = 1; { var error = $root.google.protobuf.Timestamp.verify(message.scheduleDeadlineTime, long + 1); @@ -108480,13 +111666,15 @@ SqlScheduledMaintenance.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance(); if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime, long + 1); } @@ -108495,7 +111683,7 @@ if (object.canReschedule != null) message.canReschedule = Boolean(object.canReschedule); if (object.scheduleDeadlineTime != null) { - if (typeof object.scheduleDeadlineTime !== "object") + if (!$util.isObject(object.scheduleDeadlineTime)) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance.scheduleDeadlineTime: object expected"); message.scheduleDeadlineTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleDeadlineTime, long + 1); } @@ -108511,23 +111699,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlScheduledMaintenance.toObject = function toObject(message, options) { + SqlScheduledMaintenance.toObject = function toObject(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.startTime = null; object.canDefer = false; object.canReschedule = false; } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.canDefer != null && message.hasOwnProperty("canDefer")) + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options, q + 1); + if (message.canDefer != null && Object.hasOwnProperty.call(message, "canDefer")) object.canDefer = message.canDefer; - if (message.canReschedule != null && message.hasOwnProperty("canReschedule")) + if (message.canReschedule != null && Object.hasOwnProperty.call(message, "canReschedule")) object.canReschedule = message.canReschedule; - if (message.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) { - object.scheduleDeadlineTime = $root.google.protobuf.Timestamp.toObject(message.scheduleDeadlineTime, options); + if (message.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) { + object.scheduleDeadlineTime = $root.google.protobuf.Timestamp.toObject(message.scheduleDeadlineTime, options, q + 1); if (options.oneofs) object._scheduleDeadlineTime = "scheduleDeadlineTime"; } @@ -108640,9 +111832,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlOutOfDiskReport.encode = function encode(message, writer) { + SqlOutOfDiskReport.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.sqlOutOfDiskState != null && Object.hasOwnProperty.call(message, "sqlOutOfDiskState")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sqlOutOfDiskState); if (message.sqlMinRecommendedIncreaseSizeGb != null && Object.hasOwnProperty.call(message, "sqlMinRecommendedIncreaseSizeGb")) @@ -108660,7 +111856,7 @@ * @returns {$protobuf.Writer} Writer */ SqlOutOfDiskReport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -108735,7 +111931,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.sqlOutOfDiskState != null && message.hasOwnProperty("sqlOutOfDiskState")) { + if (message.sqlOutOfDiskState != null && Object.hasOwnProperty.call(message, "sqlOutOfDiskState")) { properties._sqlOutOfDiskState = 1; switch (message.sqlOutOfDiskState) { default: @@ -108746,7 +111942,7 @@ break; } } - if (message.sqlMinRecommendedIncreaseSizeGb != null && message.hasOwnProperty("sqlMinRecommendedIncreaseSizeGb")) { + if (message.sqlMinRecommendedIncreaseSizeGb != null && Object.hasOwnProperty.call(message, "sqlMinRecommendedIncreaseSizeGb")) { properties._sqlMinRecommendedIncreaseSizeGb = 1; if (!$util.isInteger(message.sqlMinRecommendedIncreaseSizeGb)) return "sqlMinRecommendedIncreaseSizeGb: integer expected"; @@ -108765,6 +111961,8 @@ SqlOutOfDiskReport.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -108804,16 +112002,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlOutOfDiskReport.toObject = function toObject(message, options) { + SqlOutOfDiskReport.toObject = function 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.sqlOutOfDiskState != null && message.hasOwnProperty("sqlOutOfDiskState")) { + if (message.sqlOutOfDiskState != null && Object.hasOwnProperty.call(message, "sqlOutOfDiskState")) { object.sqlOutOfDiskState = options.enums === String ? $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState[message.sqlOutOfDiskState] === undefined ? message.sqlOutOfDiskState : $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState[message.sqlOutOfDiskState] : message.sqlOutOfDiskState; if (options.oneofs) object._sqlOutOfDiskState = "sqlOutOfDiskState"; } - if (message.sqlMinRecommendedIncreaseSizeGb != null && message.hasOwnProperty("sqlMinRecommendedIncreaseSizeGb")) { + if (message.sqlMinRecommendedIncreaseSizeGb != null && Object.hasOwnProperty.call(message, "sqlMinRecommendedIncreaseSizeGb")) { object.sqlMinRecommendedIncreaseSizeGb = message.sqlMinRecommendedIncreaseSizeGb; if (options.oneofs) object._sqlMinRecommendedIncreaseSizeGb = "sqlMinRecommendedIncreaseSizeGb"; @@ -109034,28 +112236,32 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PoolNodeConfig.encode = function encode(message, writer) { + PoolNodeConfig.encode = function encode(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.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.gceZone); if (message.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.dnsName); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.pscServiceAttachmentLink); if (message.pscAutoConnections != null && message.pscAutoConnections.length) for (var i = 0; i < message.pscAutoConnections.length; ++i) - $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -109069,7 +112275,7 @@ * @returns {$protobuf.Writer} Writer */ PoolNodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -109174,17 +112380,17 @@ 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")) { properties._name = 1; if (!$util.isString(message.name)) return "name: string expected"; } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) { + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) { properties._gceZone = 1; if (!$util.isString(message.gceZone)) return "gceZone: string expected"; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -109193,12 +112399,12 @@ return "ipAddresses." + error; } } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { properties._dnsName = 1; if (!$util.isString(message.dnsName)) return "dnsName: string expected"; } - if (message.state != null && message.hasOwnProperty("state")) { + if (message.state != null && Object.hasOwnProperty.call(message, "state")) { properties._state = 1; switch (message.state) { default: @@ -109215,7 +112421,7 @@ break; } } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -109224,12 +112430,12 @@ return "dnsNames." + error; } } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { properties._pscServiceAttachmentLink = 1; if (!$util.isString(message.pscServiceAttachmentLink)) return "pscServiceAttachmentLink: string expected"; } - if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { + if (message.pscAutoConnections != null && Object.hasOwnProperty.call(message, "pscAutoConnections")) { if (!Array.isArray(message.pscAutoConnections)) return "pscAutoConnections: array expected"; for (var i = 0; i < message.pscAutoConnections.length; ++i) { @@ -109252,6 +112458,8 @@ PoolNodeConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -109266,7 +112474,7 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1beta4.IpMapping.fromObject(object.ipAddresses[i], long + 1); } @@ -109322,7 +112530,7 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1beta4.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -109334,7 +112542,7 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.pscAutoConnections: array expected"); message.pscAutoConnections = []; for (var i = 0; i < object.pscAutoConnections.length; ++i) { - if (typeof object.pscAutoConnections[i] !== "object") + if (!$util.isObject(object.pscAutoConnections[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabaseInstance.PoolNodeConfig.pscAutoConnections: object expected"); message.pscAutoConnections[i] = $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i], long + 1); } @@ -109351,21 +112559,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PoolNodeConfig.toObject = function toObject(message, options) { + PoolNodeConfig.toObject = function toObject(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.ipAddresses = []; object.dnsNames = []; object.pscAutoConnections = []; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { object.name = message.name; if (options.oneofs) object._name = "name"; } - if (message.gceZone != null && message.hasOwnProperty("gceZone")) { + if (message.gceZone != null && Object.hasOwnProperty.call(message, "gceZone")) { object.gceZone = message.gceZone; if (options.oneofs) object._gceZone = "gceZone"; @@ -109373,14 +112585,14 @@ if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { object.dnsName = message.dnsName; if (options.oneofs) object._dnsName = "dnsName"; } - if (message.state != null && message.hasOwnProperty("state")) { + if (message.state != null && Object.hasOwnProperty.call(message, "state")) { object.state = options.enums === String ? $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState[message.state] === undefined ? message.state : $root.google.cloud.sql.v1beta4.DatabaseInstance.SqlInstanceState[message.state] : message.state; if (options.oneofs) object._state = "state"; @@ -109388,9 +112600,9 @@ if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } - if (message.pscServiceAttachmentLink != null && message.hasOwnProperty("pscServiceAttachmentLink")) { + if (message.pscServiceAttachmentLink != null && Object.hasOwnProperty.call(message, "pscServiceAttachmentLink")) { object.pscServiceAttachmentLink = message.pscServiceAttachmentLink; if (options.oneofs) object._pscServiceAttachmentLink = "pscServiceAttachmentLink"; @@ -109398,7 +112610,7 @@ if (message.pscAutoConnections && message.pscAutoConnections.length) { object.pscAutoConnections = []; for (var j = 0; j < message.pscAutoConnections.length; ++j) - object.pscAutoConnections[j] = $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); + object.pscAutoConnections[j] = $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options, q + 1); } return object; }; @@ -109515,9 +112727,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DnsNameMapping.encode = function encode(message, writer) { + DnsNameMapping.encode = function encode(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.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) @@ -109539,7 +112755,7 @@ * @returns {$protobuf.Writer} Writer */ DnsNameMapping.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -109621,10 +112837,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.connectionType != null && message.hasOwnProperty("connectionType")) + if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) switch (message.connectionType) { default: return "connectionType: enum value expected"; @@ -109634,7 +112850,7 @@ case 3: break; } - if (message.dnsScope != null && message.hasOwnProperty("dnsScope")) + if (message.dnsScope != null && Object.hasOwnProperty.call(message, "dnsScope")) switch (message.dnsScope) { default: return "dnsScope: enum value expected"; @@ -109643,7 +112859,7 @@ case 2: break; } - if (message.recordManager != null && message.hasOwnProperty("recordManager")) + if (message.recordManager != null && Object.hasOwnProperty.call(message, "recordManager")) switch (message.recordManager) { default: return "recordManager: enum value expected"; @@ -109666,6 +112882,8 @@ DnsNameMapping.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DnsNameMapping) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DnsNameMapping: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -109749,9 +112967,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DnsNameMapping.toObject = function toObject(message, options) { + DnsNameMapping.toObject = function toObject(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 = ""; @@ -109759,13 +112981,13 @@ object.dnsScope = options.enums === String ? "DNS_SCOPE_UNSPECIFIED" : 0; object.recordManager = options.enums === String ? "RECORD_MANAGER_UNSPECIFIED" : 0; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.connectionType != null && message.hasOwnProperty("connectionType")) + if (message.connectionType != null && Object.hasOwnProperty.call(message, "connectionType")) object.connectionType = options.enums === String ? $root.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType[message.connectionType] === undefined ? message.connectionType : $root.google.cloud.sql.v1beta4.DnsNameMapping.ConnectionType[message.connectionType] : message.connectionType; - if (message.dnsScope != null && message.hasOwnProperty("dnsScope")) + if (message.dnsScope != null && Object.hasOwnProperty.call(message, "dnsScope")) object.dnsScope = options.enums === String ? $root.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope[message.dnsScope] === undefined ? message.dnsScope : $root.google.cloud.sql.v1beta4.DnsNameMapping.DnsScope[message.dnsScope] : message.dnsScope; - if (message.recordManager != null && message.hasOwnProperty("recordManager")) + if (message.recordManager != null && Object.hasOwnProperty.call(message, "recordManager")) object.recordManager = options.enums === String ? $root.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager[message.recordManager] === undefined ? message.recordManager : $root.google.cloud.sql.v1beta4.DnsNameMapping.RecordManager[message.recordManager] : message.recordManager; return object; }; @@ -109986,9 +113208,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GeminiInstanceConfig.encode = function encode(message, writer) { + GeminiInstanceConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.entitled); if (message.googleVacuumMgmtEnabled != null && Object.hasOwnProperty.call(message, "googleVacuumMgmtEnabled")) @@ -110014,7 +113240,7 @@ * @returns {$protobuf.Writer} Writer */ GeminiInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110105,32 +113331,32 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.entitled != null && message.hasOwnProperty("entitled")) { + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) { properties._entitled = 1; if (typeof message.entitled !== "boolean") return "entitled: boolean expected"; } - if (message.googleVacuumMgmtEnabled != null && message.hasOwnProperty("googleVacuumMgmtEnabled")) { + if (message.googleVacuumMgmtEnabled != null && Object.hasOwnProperty.call(message, "googleVacuumMgmtEnabled")) { properties._googleVacuumMgmtEnabled = 1; if (typeof message.googleVacuumMgmtEnabled !== "boolean") return "googleVacuumMgmtEnabled: boolean expected"; } - if (message.oomSessionCancelEnabled != null && message.hasOwnProperty("oomSessionCancelEnabled")) { + if (message.oomSessionCancelEnabled != null && Object.hasOwnProperty.call(message, "oomSessionCancelEnabled")) { properties._oomSessionCancelEnabled = 1; if (typeof message.oomSessionCancelEnabled !== "boolean") return "oomSessionCancelEnabled: boolean expected"; } - if (message.activeQueryEnabled != null && message.hasOwnProperty("activeQueryEnabled")) { + if (message.activeQueryEnabled != null && Object.hasOwnProperty.call(message, "activeQueryEnabled")) { properties._activeQueryEnabled = 1; if (typeof message.activeQueryEnabled !== "boolean") return "activeQueryEnabled: boolean expected"; } - if (message.indexAdvisorEnabled != null && message.hasOwnProperty("indexAdvisorEnabled")) { + if (message.indexAdvisorEnabled != null && Object.hasOwnProperty.call(message, "indexAdvisorEnabled")) { properties._indexAdvisorEnabled = 1; if (typeof message.indexAdvisorEnabled !== "boolean") return "indexAdvisorEnabled: boolean expected"; } - if (message.flagRecommenderEnabled != null && message.hasOwnProperty("flagRecommenderEnabled")) { + if (message.flagRecommenderEnabled != null && Object.hasOwnProperty.call(message, "flagRecommenderEnabled")) { properties._flagRecommenderEnabled = 1; if (typeof message.flagRecommenderEnabled !== "boolean") return "flagRecommenderEnabled: boolean expected"; @@ -110149,6 +113375,8 @@ GeminiInstanceConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.GeminiInstanceConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.GeminiInstanceConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -110178,36 +113406,40 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GeminiInstanceConfig.toObject = function toObject(message, options) { + GeminiInstanceConfig.toObject = function 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.entitled != null && message.hasOwnProperty("entitled")) { + if (message.entitled != null && Object.hasOwnProperty.call(message, "entitled")) { object.entitled = message.entitled; if (options.oneofs) object._entitled = "entitled"; } - if (message.googleVacuumMgmtEnabled != null && message.hasOwnProperty("googleVacuumMgmtEnabled")) { + if (message.googleVacuumMgmtEnabled != null && Object.hasOwnProperty.call(message, "googleVacuumMgmtEnabled")) { object.googleVacuumMgmtEnabled = message.googleVacuumMgmtEnabled; if (options.oneofs) object._googleVacuumMgmtEnabled = "googleVacuumMgmtEnabled"; } - if (message.oomSessionCancelEnabled != null && message.hasOwnProperty("oomSessionCancelEnabled")) { + if (message.oomSessionCancelEnabled != null && Object.hasOwnProperty.call(message, "oomSessionCancelEnabled")) { object.oomSessionCancelEnabled = message.oomSessionCancelEnabled; if (options.oneofs) object._oomSessionCancelEnabled = "oomSessionCancelEnabled"; } - if (message.activeQueryEnabled != null && message.hasOwnProperty("activeQueryEnabled")) { + if (message.activeQueryEnabled != null && Object.hasOwnProperty.call(message, "activeQueryEnabled")) { object.activeQueryEnabled = message.activeQueryEnabled; if (options.oneofs) object._activeQueryEnabled = "activeQueryEnabled"; } - if (message.indexAdvisorEnabled != null && message.hasOwnProperty("indexAdvisorEnabled")) { + if (message.indexAdvisorEnabled != null && Object.hasOwnProperty.call(message, "indexAdvisorEnabled")) { object.indexAdvisorEnabled = message.indexAdvisorEnabled; if (options.oneofs) object._indexAdvisorEnabled = "indexAdvisorEnabled"; } - if (message.flagRecommenderEnabled != null && message.hasOwnProperty("flagRecommenderEnabled")) { + if (message.flagRecommenderEnabled != null && Object.hasOwnProperty.call(message, "flagRecommenderEnabled")) { object.flagRecommenderEnabled = message.flagRecommenderEnabled; if (options.oneofs) object._flagRecommenderEnabled = "flagRecommenderEnabled"; @@ -110336,9 +113568,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicationCluster.encode = function encode(message, writer) { + ReplicationCluster.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.psaWriteEndpoint); if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) @@ -110358,7 +113594,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicationCluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110437,17 +113673,17 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) { + if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) { properties._psaWriteEndpoint = 1; if (!$util.isString(message.psaWriteEndpoint)) return "psaWriteEndpoint: string expected"; } - if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) { + if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) { properties._failoverDrReplicaName = 1; if (!$util.isString(message.failoverDrReplicaName)) return "failoverDrReplicaName: string expected"; } - if (message.drReplica != null && message.hasOwnProperty("drReplica")) { + if (message.drReplica != null && Object.hasOwnProperty.call(message, "drReplica")) { properties._drReplica = 1; if (typeof message.drReplica !== "boolean") return "drReplica: boolean expected"; @@ -110466,6 +113702,8 @@ ReplicationCluster.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ReplicationCluster) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ReplicationCluster: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -110489,21 +113727,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicationCluster.toObject = function toObject(message, options) { + ReplicationCluster.toObject = function 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.psaWriteEndpoint != null && message.hasOwnProperty("psaWriteEndpoint")) { + if (message.psaWriteEndpoint != null && Object.hasOwnProperty.call(message, "psaWriteEndpoint")) { object.psaWriteEndpoint = message.psaWriteEndpoint; if (options.oneofs) object._psaWriteEndpoint = "psaWriteEndpoint"; } - if (message.failoverDrReplicaName != null && message.hasOwnProperty("failoverDrReplicaName")) { + if (message.failoverDrReplicaName != null && Object.hasOwnProperty.call(message, "failoverDrReplicaName")) { object.failoverDrReplicaName = message.failoverDrReplicaName; if (options.oneofs) object._failoverDrReplicaName = "failoverDrReplicaName"; } - if (message.drReplica != null && message.hasOwnProperty("drReplica")) { + if (message.drReplica != null && Object.hasOwnProperty.call(message, "drReplica")) { object.drReplica = message.drReplica; if (options.oneofs) object._drReplica = "drReplica"; @@ -110632,9 +113874,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailableDatabaseVersion.encode = function encode(message, writer) { + AvailableDatabaseVersion.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.majorVersion); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -110654,7 +113900,7 @@ * @returns {$protobuf.Writer} Writer */ AvailableDatabaseVersion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110733,17 +113979,17 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.majorVersion != null && message.hasOwnProperty("majorVersion")) { + if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) { properties._majorVersion = 1; if (!$util.isString(message.majorVersion)) return "majorVersion: string expected"; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { properties._name = 1; 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")) { properties._displayName = 1; if (!$util.isString(message.displayName)) return "displayName: string expected"; @@ -110762,6 +114008,8 @@ AvailableDatabaseVersion.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.AvailableDatabaseVersion) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.AvailableDatabaseVersion: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -110785,21 +114033,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvailableDatabaseVersion.toObject = function toObject(message, options) { + AvailableDatabaseVersion.toObject = function 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.majorVersion != null && message.hasOwnProperty("majorVersion")) { + if (message.majorVersion != null && Object.hasOwnProperty.call(message, "majorVersion")) { object.majorVersion = message.majorVersion; if (options.oneofs) object._majorVersion = "majorVersion"; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { object.name = message.name; if (options.oneofs) object._name = "name"; } - 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"; @@ -110899,14 +114151,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DatabasesListResponse.encode = function encode(message, writer) { + DatabasesListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.Database.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Database.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -110920,7 +114176,7 @@ * @returns {$protobuf.Writer} Writer */ DatabasesListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -110996,10 +114252,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -111022,6 +114278,8 @@ DatabasesListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DatabasesListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DatabasesListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -111034,7 +114292,7 @@ throw TypeError(".google.cloud.sql.v1beta4.DatabasesListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.DatabasesListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.Database.fromObject(object.items[i], long + 1); } @@ -111051,20 +114309,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DatabasesListResponse.toObject = function toObject(message, options) { + DatabasesListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.Database.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.Database.toObject(message.items[j], options, q + 1); } return object; }; @@ -111160,13 +114422,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteMasterConfiguration.encode = function encode(message, writer) { + DemoteMasterConfiguration.encode = function encode(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.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) - $root.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -111180,7 +114446,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteMasterConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -111254,10 +114520,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.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) { + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) { var error = $root.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.verify(message.mysqlReplicaConfiguration, long + 1); if (error) return "mysqlReplicaConfiguration." + error; @@ -111276,6 +114542,8 @@ DemoteMasterConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DemoteMasterConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DemoteMasterConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -111284,7 +114552,7 @@ if (object.kind != null) message.kind = String(object.kind); if (object.mysqlReplicaConfiguration != null) { - if (typeof object.mysqlReplicaConfiguration !== "object") + if (!$util.isObject(object.mysqlReplicaConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.DemoteMasterConfiguration.mysqlReplicaConfiguration: object expected"); message.mysqlReplicaConfiguration = $root.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.fromObject(object.mysqlReplicaConfiguration, long + 1); } @@ -111300,18 +114568,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteMasterConfiguration.toObject = function toObject(message, options) { + DemoteMasterConfiguration.toObject = function toObject(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.mysqlReplicaConfiguration = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) - object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options); + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) + object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options, q + 1); return object; }; @@ -111433,17 +114705,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteMasterContext.encode = function encode(message, writer) { + DemoteMasterContext.encode = function encode(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.verifyGtidConsistency != null && Object.hasOwnProperty.call(message, "verifyGtidConsistency")) - $root.google.protobuf.BoolValue.encode(message.verifyGtidConsistency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.verifyGtidConsistency, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.masterInstanceName); if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) - $root.google.cloud.sql.v1beta4.DemoteMasterConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DemoteMasterConfiguration.encode(message.replicaConfiguration, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.skipReplicationSetup != null && Object.hasOwnProperty.call(message, "skipReplicationSetup")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipReplicationSetup); return writer; @@ -111459,7 +114735,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteMasterContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -111545,23 +114821,23 @@ 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.verifyGtidConsistency != null && message.hasOwnProperty("verifyGtidConsistency")) { + if (message.verifyGtidConsistency != null && Object.hasOwnProperty.call(message, "verifyGtidConsistency")) { var error = $root.google.protobuf.BoolValue.verify(message.verifyGtidConsistency, long + 1); if (error) return "verifyGtidConsistency." + error; } - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) if (!$util.isString(message.masterInstanceName)) return "masterInstanceName: string expected"; - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) { + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) { var error = $root.google.cloud.sql.v1beta4.DemoteMasterConfiguration.verify(message.replicaConfiguration, long + 1); if (error) return "replicaConfiguration." + error; } - if (message.skipReplicationSetup != null && message.hasOwnProperty("skipReplicationSetup")) + if (message.skipReplicationSetup != null && Object.hasOwnProperty.call(message, "skipReplicationSetup")) if (typeof message.skipReplicationSetup !== "boolean") return "skipReplicationSetup: boolean expected"; return null; @@ -111578,6 +114854,8 @@ DemoteMasterContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DemoteMasterContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DemoteMasterContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -111586,14 +114864,14 @@ if (object.kind != null) message.kind = String(object.kind); if (object.verifyGtidConsistency != null) { - if (typeof object.verifyGtidConsistency !== "object") + if (!$util.isObject(object.verifyGtidConsistency)) throw TypeError(".google.cloud.sql.v1beta4.DemoteMasterContext.verifyGtidConsistency: object expected"); message.verifyGtidConsistency = $root.google.protobuf.BoolValue.fromObject(object.verifyGtidConsistency, long + 1); } if (object.masterInstanceName != null) message.masterInstanceName = String(object.masterInstanceName); if (object.replicaConfiguration != null) { - if (typeof object.replicaConfiguration !== "object") + if (!$util.isObject(object.replicaConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.DemoteMasterContext.replicaConfiguration: object expected"); message.replicaConfiguration = $root.google.cloud.sql.v1beta4.DemoteMasterConfiguration.fromObject(object.replicaConfiguration, long + 1); } @@ -111611,9 +114889,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteMasterContext.toObject = function toObject(message, options) { + DemoteMasterContext.toObject = function toObject(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 = ""; @@ -111622,15 +114904,15 @@ object.replicaConfiguration = null; object.skipReplicationSetup = false; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.verifyGtidConsistency != null && message.hasOwnProperty("verifyGtidConsistency")) - object.verifyGtidConsistency = $root.google.protobuf.BoolValue.toObject(message.verifyGtidConsistency, options); - if (message.masterInstanceName != null && message.hasOwnProperty("masterInstanceName")) + if (message.verifyGtidConsistency != null && Object.hasOwnProperty.call(message, "verifyGtidConsistency")) + object.verifyGtidConsistency = $root.google.protobuf.BoolValue.toObject(message.verifyGtidConsistency, options, q + 1); + if (message.masterInstanceName != null && Object.hasOwnProperty.call(message, "masterInstanceName")) object.masterInstanceName = message.masterInstanceName; - if (message.replicaConfiguration != null && message.hasOwnProperty("replicaConfiguration")) - object.replicaConfiguration = $root.google.cloud.sql.v1beta4.DemoteMasterConfiguration.toObject(message.replicaConfiguration, options); - if (message.skipReplicationSetup != null && message.hasOwnProperty("skipReplicationSetup")) + if (message.replicaConfiguration != null && Object.hasOwnProperty.call(message, "replicaConfiguration")) + object.replicaConfiguration = $root.google.cloud.sql.v1beta4.DemoteMasterConfiguration.toObject(message.replicaConfiguration, options, q + 1); + if (message.skipReplicationSetup != null && Object.hasOwnProperty.call(message, "skipReplicationSetup")) object.skipReplicationSetup = message.skipReplicationSetup; return object; }; @@ -111762,9 +115044,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteMasterMySqlReplicaConfiguration.encode = function encode(message, writer) { + DemoteMasterMySqlReplicaConfiguration.encode = function encode(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.username != null && Object.hasOwnProperty.call(message, "username")) @@ -111790,7 +115076,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteMasterMySqlReplicaConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -111880,22 +115166,22 @@ 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.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) if (!$util.isString(message.username)) return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) if (!$util.isString(message.clientKey)) return "clientKey: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) if (!$util.isString(message.clientCertificate)) return "clientCertificate: string expected"; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) if (!$util.isString(message.caCertificate)) return "caCertificate: string expected"; return null; @@ -111912,6 +115198,8 @@ DemoteMasterMySqlReplicaConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DemoteMasterMySqlReplicaConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -111941,9 +115229,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteMasterMySqlReplicaConfiguration.toObject = function toObject(message, options) { + DemoteMasterMySqlReplicaConfiguration.toObject = function toObject(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 = ""; @@ -111953,17 +115245,17 @@ object.clientCertificate = ""; object.caCertificate = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) object.clientKey = message.clientKey; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) object.clientCertificate = message.clientCertificate; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) object.caCertificate = message.caCertificate; return object; }; @@ -112059,9 +115351,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DemoteContext.encode = function encode(message, writer) { + DemoteContext.encode = function encode(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.sourceRepresentativeInstanceName != null && Object.hasOwnProperty.call(message, "sourceRepresentativeInstanceName")) @@ -112079,7 +115375,7 @@ * @returns {$protobuf.Writer} Writer */ DemoteContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -112153,10 +115449,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.sourceRepresentativeInstanceName != null && message.hasOwnProperty("sourceRepresentativeInstanceName")) + if (message.sourceRepresentativeInstanceName != null && Object.hasOwnProperty.call(message, "sourceRepresentativeInstanceName")) if (!$util.isString(message.sourceRepresentativeInstanceName)) return "sourceRepresentativeInstanceName: string expected"; return null; @@ -112173,6 +115469,8 @@ DemoteContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DemoteContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DemoteContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -112194,17 +115492,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DemoteContext.toObject = function toObject(message, options) { + DemoteContext.toObject = function toObject(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.sourceRepresentativeInstanceName = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.sourceRepresentativeInstanceName != null && message.hasOwnProperty("sourceRepresentativeInstanceName")) + if (message.sourceRepresentativeInstanceName != null && Object.hasOwnProperty.call(message, "sourceRepresentativeInstanceName")) object.sourceRepresentativeInstanceName = message.sourceRepresentativeInstanceName; return object; }; @@ -112384,9 +115686,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportContext.encode = function encode(message, writer) { + ExportContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); if (message.databases != null && message.databases.length) @@ -112395,17 +115701,17 @@ if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.kind); if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) - $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.encode(message.sqlExportOptions, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) - $root.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.encode(message.csvExportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.fileType); if (message.offload != null && Object.hasOwnProperty.call(message, "offload")) - $root.google.protobuf.BoolValue.encode(message.offload, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.offload, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.bakExportOptions != null && Object.hasOwnProperty.call(message, "bakExportOptions")) - $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.encode(message.bakExportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.encode(message.bakExportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.tdeExportOptions != null && Object.hasOwnProperty.call(message, "tdeExportOptions")) - $root.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.encode(message.tdeExportOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.encode(message.tdeExportOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); return writer; }; @@ -112419,7 +115725,7 @@ * @returns {$protobuf.Writer} Writer */ ExportContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -112523,30 +115829,30 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) if (!$util.isString(message.uri)) return "uri: string expected"; - 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) if (!$util.isString(message.databases[i])) return "databases: string[] expected"; } - 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.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) { + if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.verify(message.sqlExportOptions, long + 1); if (error) return "sqlExportOptions." + error; } - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) { + if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.verify(message.csvExportOptions, long + 1); if (error) return "csvExportOptions." + error; } - if (message.fileType != null && message.hasOwnProperty("fileType")) + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) switch (message.fileType) { default: return "fileType: enum value expected"; @@ -112557,17 +115863,17 @@ case 8: break; } - if (message.offload != null && message.hasOwnProperty("offload")) { + if (message.offload != null && Object.hasOwnProperty.call(message, "offload")) { var error = $root.google.protobuf.BoolValue.verify(message.offload, long + 1); if (error) return "offload." + error; } - if (message.bakExportOptions != null && message.hasOwnProperty("bakExportOptions")) { + if (message.bakExportOptions != null && Object.hasOwnProperty.call(message, "bakExportOptions")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.verify(message.bakExportOptions, long + 1); if (error) return "bakExportOptions." + error; } - if (message.tdeExportOptions != null && message.hasOwnProperty("tdeExportOptions")) { + if (message.tdeExportOptions != null && Object.hasOwnProperty.call(message, "tdeExportOptions")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.verify(message.tdeExportOptions, long + 1); if (error) return "tdeExportOptions." + error; @@ -112586,6 +115892,8 @@ ExportContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExportContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExportContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -112603,12 +115911,12 @@ if (object.kind != null) message.kind = String(object.kind); if (object.sqlExportOptions != null) { - if (typeof object.sqlExportOptions !== "object") + if (!$util.isObject(object.sqlExportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.sqlExportOptions: object expected"); message.sqlExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.fromObject(object.sqlExportOptions, long + 1); } if (object.csvExportOptions != null) { - if (typeof object.csvExportOptions !== "object") + if (!$util.isObject(object.csvExportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.csvExportOptions: object expected"); message.csvExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.fromObject(object.csvExportOptions, long + 1); } @@ -112641,17 +115949,17 @@ break; } if (object.offload != null) { - if (typeof object.offload !== "object") + if (!$util.isObject(object.offload)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.offload: object expected"); message.offload = $root.google.protobuf.BoolValue.fromObject(object.offload, long + 1); } if (object.bakExportOptions != null) { - if (typeof object.bakExportOptions !== "object") + if (!$util.isObject(object.bakExportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.bakExportOptions: object expected"); message.bakExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.fromObject(object.bakExportOptions, long + 1); } if (object.tdeExportOptions != null) { - if (typeof object.tdeExportOptions !== "object") + if (!$util.isObject(object.tdeExportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.tdeExportOptions: object expected"); message.tdeExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.fromObject(object.tdeExportOptions, long + 1); } @@ -112667,9 +115975,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportContext.toObject = function toObject(message, options) { + ExportContext.toObject = function toObject(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 = []; @@ -112683,27 +115995,27 @@ object.bakExportOptions = null; object.tdeExportOptions = null; } - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) object.uri = message.uri; if (message.databases && message.databases.length) { object.databases = []; for (var j = 0; j < message.databases.length; ++j) object.databases[j] = message.databases[j]; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.sqlExportOptions != null && message.hasOwnProperty("sqlExportOptions")) - object.sqlExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.toObject(message.sqlExportOptions, options); - if (message.csvExportOptions != null && message.hasOwnProperty("csvExportOptions")) - object.csvExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.toObject(message.csvExportOptions, options); - if (message.fileType != null && message.hasOwnProperty("fileType")) + if (message.sqlExportOptions != null && Object.hasOwnProperty.call(message, "sqlExportOptions")) + object.sqlExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.toObject(message.sqlExportOptions, options, q + 1); + if (message.csvExportOptions != null && Object.hasOwnProperty.call(message, "csvExportOptions")) + object.csvExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions.toObject(message.csvExportOptions, options, q + 1); + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) object.fileType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlFileType[message.fileType] === undefined ? message.fileType : $root.google.cloud.sql.v1beta4.SqlFileType[message.fileType] : message.fileType; - if (message.offload != null && message.hasOwnProperty("offload")) - object.offload = $root.google.protobuf.BoolValue.toObject(message.offload, options); - if (message.bakExportOptions != null && message.hasOwnProperty("bakExportOptions")) - object.bakExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.toObject(message.bakExportOptions, options); - if (message.tdeExportOptions != null && message.hasOwnProperty("tdeExportOptions")) - object.tdeExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.toObject(message.tdeExportOptions, options); + if (message.offload != null && Object.hasOwnProperty.call(message, "offload")) + object.offload = $root.google.protobuf.BoolValue.toObject(message.offload, options, q + 1); + if (message.bakExportOptions != null && Object.hasOwnProperty.call(message, "bakExportOptions")) + object.bakExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.toObject(message.bakExportOptions, options, q + 1); + if (message.tdeExportOptions != null && Object.hasOwnProperty.call(message, "tdeExportOptions")) + object.tdeExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions.toObject(message.tdeExportOptions, options, q + 1); return object; }; @@ -112822,9 +116134,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlCsvExportOptions.encode = function encode(message, writer) { + SqlCsvExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectQuery); if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) @@ -112848,7 +116164,7 @@ * @returns {$protobuf.Writer} Writer */ SqlCsvExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -112934,19 +116250,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) if (!$util.isString(message.selectQuery)) return "selectQuery: string expected"; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) if (!$util.isString(message.escapeCharacter)) return "escapeCharacter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) if (!$util.isString(message.quoteCharacter)) return "quoteCharacter: string expected"; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) if (!$util.isString(message.fieldsTerminatedBy)) return "fieldsTerminatedBy: string expected"; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) if (!$util.isString(message.linesTerminatedBy)) return "linesTerminatedBy: string expected"; return null; @@ -112963,6 +116279,8 @@ SqlCsvExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlCsvExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -112990,9 +116308,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlCsvExportOptions.toObject = function toObject(message, options) { + SqlCsvExportOptions.toObject = function toObject(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.selectQuery = ""; @@ -113001,15 +116323,15 @@ object.fieldsTerminatedBy = ""; object.linesTerminatedBy = ""; } - if (message.selectQuery != null && message.hasOwnProperty("selectQuery")) + if (message.selectQuery != null && Object.hasOwnProperty.call(message, "selectQuery")) object.selectQuery = message.selectQuery; - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) object.escapeCharacter = message.escapeCharacter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) object.quoteCharacter = message.quoteCharacter; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) object.fieldsTerminatedBy = message.fieldsTerminatedBy; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) object.linesTerminatedBy = message.linesTerminatedBy; return object; }; @@ -113142,22 +116464,26 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlExportOptions.encode = function encode(message, writer) { + SqlExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tables != null && message.tables.length) for (var i = 0; i < message.tables.length; ++i) writer.uint32(/* id 1, wireType 2 =*/10).string(message.tables[i]); if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) - $root.google.protobuf.BoolValue.encode(message.schemaOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.schemaOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.mysqlExportOptions != null && Object.hasOwnProperty.call(message, "mysqlExportOptions")) - $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.encode(message.mysqlExportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.encode(message.mysqlExportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) - $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) - $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.postgresExportOptions != null && Object.hasOwnProperty.call(message, "postgresExportOptions")) - $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.encode(message.postgresExportOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.encode(message.postgresExportOptions, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); return writer; }; @@ -113171,7 +116497,7 @@ * @returns {$protobuf.Writer} Writer */ SqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -113263,34 +116589,34 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.tables != null && message.hasOwnProperty("tables")) { + if (message.tables != null && Object.hasOwnProperty.call(message, "tables")) { if (!Array.isArray(message.tables)) return "tables: array expected"; for (var i = 0; i < message.tables.length; ++i) if (!$util.isString(message.tables[i])) return "tables: string[] expected"; } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) { + if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) { var error = $root.google.protobuf.BoolValue.verify(message.schemaOnly, long + 1); if (error) return "schemaOnly." + error; } - if (message.mysqlExportOptions != null && message.hasOwnProperty("mysqlExportOptions")) { + if (message.mysqlExportOptions != null && Object.hasOwnProperty.call(message, "mysqlExportOptions")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.verify(message.mysqlExportOptions, long + 1); if (error) return "mysqlExportOptions." + error; } - if (message.threads != null && message.hasOwnProperty("threads")) { + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) { var error = $root.google.protobuf.Int32Value.verify(message.threads, long + 1); if (error) return "threads." + error; } - if (message.parallel != null && message.hasOwnProperty("parallel")) { + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) { var error = $root.google.protobuf.BoolValue.verify(message.parallel, long + 1); if (error) return "parallel." + error; } - if (message.postgresExportOptions != null && message.hasOwnProperty("postgresExportOptions")) { + if (message.postgresExportOptions != null && Object.hasOwnProperty.call(message, "postgresExportOptions")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.verify(message.postgresExportOptions, long + 1); if (error) return "postgresExportOptions." + error; @@ -113309,6 +116635,8 @@ SqlExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -113322,27 +116650,27 @@ message.tables[i] = String(object.tables[i]); } if (object.schemaOnly != null) { - if (typeof object.schemaOnly !== "object") + if (!$util.isObject(object.schemaOnly)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.schemaOnly: object expected"); message.schemaOnly = $root.google.protobuf.BoolValue.fromObject(object.schemaOnly, long + 1); } if (object.mysqlExportOptions != null) { - if (typeof object.mysqlExportOptions !== "object") + if (!$util.isObject(object.mysqlExportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.mysqlExportOptions: object expected"); message.mysqlExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.fromObject(object.mysqlExportOptions, long + 1); } if (object.threads != null) { - if (typeof object.threads !== "object") + if (!$util.isObject(object.threads)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.threads: object expected"); message.threads = $root.google.protobuf.Int32Value.fromObject(object.threads, long + 1); } if (object.parallel != null) { - if (typeof object.parallel !== "object") + if (!$util.isObject(object.parallel)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.parallel: object expected"); message.parallel = $root.google.protobuf.BoolValue.fromObject(object.parallel, long + 1); } if (object.postgresExportOptions != null) { - if (typeof object.postgresExportOptions !== "object") + if (!$util.isObject(object.postgresExportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.postgresExportOptions: object expected"); message.postgresExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.fromObject(object.postgresExportOptions, long + 1); } @@ -113358,9 +116686,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlExportOptions.toObject = function toObject(message, options) { + SqlExportOptions.toObject = function toObject(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.tables = []; @@ -113376,16 +116708,16 @@ for (var j = 0; j < message.tables.length; ++j) object.tables[j] = message.tables[j]; } - if (message.schemaOnly != null && message.hasOwnProperty("schemaOnly")) - object.schemaOnly = $root.google.protobuf.BoolValue.toObject(message.schemaOnly, options); - if (message.mysqlExportOptions != null && message.hasOwnProperty("mysqlExportOptions")) - object.mysqlExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.toObject(message.mysqlExportOptions, options); - if (message.threads != null && message.hasOwnProperty("threads")) - object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options); - if (message.parallel != null && message.hasOwnProperty("parallel")) - object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options); - if (message.postgresExportOptions != null && message.hasOwnProperty("postgresExportOptions")) - object.postgresExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.toObject(message.postgresExportOptions, options); + if (message.schemaOnly != null && Object.hasOwnProperty.call(message, "schemaOnly")) + object.schemaOnly = $root.google.protobuf.BoolValue.toObject(message.schemaOnly, options, q + 1); + if (message.mysqlExportOptions != null && Object.hasOwnProperty.call(message, "mysqlExportOptions")) + object.mysqlExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.toObject(message.mysqlExportOptions, options, q + 1); + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) + object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options, q + 1); + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) + object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options, q + 1); + if (message.postgresExportOptions != null && Object.hasOwnProperty.call(message, "postgresExportOptions")) + object.postgresExportOptions = $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.toObject(message.postgresExportOptions, options, q + 1); return object; }; @@ -113468,11 +116800,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MysqlExportOptions.encode = function encode(message, writer) { + MysqlExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.masterData != null && Object.hasOwnProperty.call(message, "masterData")) - $root.google.protobuf.Int32Value.encode(message.masterData, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.masterData, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -113486,7 +116822,7 @@ * @returns {$protobuf.Writer} Writer */ MysqlExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -113556,7 +116892,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.masterData != null && message.hasOwnProperty("masterData")) { + if (message.masterData != null && Object.hasOwnProperty.call(message, "masterData")) { var error = $root.google.protobuf.Int32Value.verify(message.masterData, long + 1); if (error) return "masterData." + error; @@ -113575,13 +116911,15 @@ MysqlExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions(); if (object.masterData != null) { - if (typeof object.masterData !== "object") + if (!$util.isObject(object.masterData)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.MysqlExportOptions.masterData: object expected"); message.masterData = $root.google.protobuf.Int32Value.fromObject(object.masterData, long + 1); } @@ -113597,14 +116935,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MysqlExportOptions.toObject = function toObject(message, options) { + MysqlExportOptions.toObject = function toObject(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.masterData = null; - if (message.masterData != null && message.hasOwnProperty("masterData")) - object.masterData = $root.google.protobuf.Int32Value.toObject(message.masterData, options); + if (message.masterData != null && Object.hasOwnProperty.call(message, "masterData")) + object.masterData = $root.google.protobuf.Int32Value.toObject(message.masterData, options, q + 1); return object; }; @@ -113699,13 +117041,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PostgresExportOptions.encode = function encode(message, writer) { + PostgresExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) - $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) - $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -113719,7 +117065,7 @@ * @returns {$protobuf.Writer} Writer */ PostgresExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -113793,12 +117139,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.clean != null && message.hasOwnProperty("clean")) { + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) { var error = $root.google.protobuf.BoolValue.verify(message.clean, long + 1); if (error) return "clean." + error; } - if (message.ifExists != null && message.hasOwnProperty("ifExists")) { + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) { var error = $root.google.protobuf.BoolValue.verify(message.ifExists, long + 1); if (error) return "ifExists." + error; @@ -113817,18 +117163,20 @@ PostgresExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions(); if (object.clean != null) { - if (typeof object.clean !== "object") + if (!$util.isObject(object.clean)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.clean: object expected"); message.clean = $root.google.protobuf.BoolValue.fromObject(object.clean, long + 1); } if (object.ifExists != null) { - if (typeof object.ifExists !== "object") + if (!$util.isObject(object.ifExists)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlExportOptions.PostgresExportOptions.ifExists: object expected"); message.ifExists = $root.google.protobuf.BoolValue.fromObject(object.ifExists, long + 1); } @@ -113844,18 +117192,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PostgresExportOptions.toObject = function toObject(message, options) { + PostgresExportOptions.toObject = function toObject(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.clean = null; object.ifExists = null; } - if (message.clean != null && message.hasOwnProperty("clean")) - object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options); - if (message.ifExists != null && message.hasOwnProperty("ifExists")) - object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options); + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) + object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options, q + 1); + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) + object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options, q + 1); return object; }; @@ -113998,23 +117350,27 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBakExportOptions.encode = function encode(message, writer) { + SqlBakExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) - $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.stripeCount != null && Object.hasOwnProperty.call(message, "stripeCount")) - $root.google.protobuf.Int32Value.encode(message.stripeCount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.stripeCount, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.bakType); if (message.copyOnly != null && Object.hasOwnProperty.call(message, "copyOnly")) - $root.google.protobuf.BoolValue.encode(message.copyOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.copyOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.differentialBase != null && Object.hasOwnProperty.call(message, "differentialBase")) - $root.google.protobuf.BoolValue.encode(message.differentialBase, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.differentialBase, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.exportLogStartTime != null && Object.hasOwnProperty.call(message, "exportLogStartTime")) - $root.google.protobuf.Timestamp.encode(message.exportLogStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.exportLogStartTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.exportLogEndTime != null && Object.hasOwnProperty.call(message, "exportLogEndTime")) - $root.google.protobuf.Timestamp.encode(message.exportLogEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.exportLogEndTime, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -114028,7 +117384,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBakExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -114122,17 +117478,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.striped != null && message.hasOwnProperty("striped")) { + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) { var error = $root.google.protobuf.BoolValue.verify(message.striped, long + 1); if (error) return "striped." + error; } - if (message.stripeCount != null && message.hasOwnProperty("stripeCount")) { + if (message.stripeCount != null && Object.hasOwnProperty.call(message, "stripeCount")) { var error = $root.google.protobuf.Int32Value.verify(message.stripeCount, long + 1); if (error) return "stripeCount." + error; } - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) switch (message.bakType) { default: return "bakType: enum value expected"; @@ -114142,22 +117498,22 @@ case 3: break; } - if (message.copyOnly != null && message.hasOwnProperty("copyOnly")) { + if (message.copyOnly != null && Object.hasOwnProperty.call(message, "copyOnly")) { var error = $root.google.protobuf.BoolValue.verify(message.copyOnly, long + 1); if (error) return "copyOnly." + error; } - if (message.differentialBase != null && message.hasOwnProperty("differentialBase")) { + if (message.differentialBase != null && Object.hasOwnProperty.call(message, "differentialBase")) { var error = $root.google.protobuf.BoolValue.verify(message.differentialBase, long + 1); if (error) return "differentialBase." + error; } - if (message.exportLogStartTime != null && message.hasOwnProperty("exportLogStartTime")) { + if (message.exportLogStartTime != null && Object.hasOwnProperty.call(message, "exportLogStartTime")) { var error = $root.google.protobuf.Timestamp.verify(message.exportLogStartTime, long + 1); if (error) return "exportLogStartTime." + error; } - if (message.exportLogEndTime != null && message.hasOwnProperty("exportLogEndTime")) { + if (message.exportLogEndTime != null && Object.hasOwnProperty.call(message, "exportLogEndTime")) { var error = $root.google.protobuf.Timestamp.verify(message.exportLogEndTime, long + 1); if (error) return "exportLogEndTime." + error; @@ -114176,18 +117532,20 @@ SqlBakExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions(); if (object.striped != null) { - if (typeof object.striped !== "object") + if (!$util.isObject(object.striped)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.striped: object expected"); message.striped = $root.google.protobuf.BoolValue.fromObject(object.striped, long + 1); } if (object.stripeCount != null) { - if (typeof object.stripeCount !== "object") + if (!$util.isObject(object.stripeCount)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.stripeCount: object expected"); message.stripeCount = $root.google.protobuf.Int32Value.fromObject(object.stripeCount, long + 1); } @@ -114216,22 +117574,22 @@ break; } if (object.copyOnly != null) { - if (typeof object.copyOnly !== "object") + if (!$util.isObject(object.copyOnly)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.copyOnly: object expected"); message.copyOnly = $root.google.protobuf.BoolValue.fromObject(object.copyOnly, long + 1); } if (object.differentialBase != null) { - if (typeof object.differentialBase !== "object") + if (!$util.isObject(object.differentialBase)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.differentialBase: object expected"); message.differentialBase = $root.google.protobuf.BoolValue.fromObject(object.differentialBase, long + 1); } if (object.exportLogStartTime != null) { - if (typeof object.exportLogStartTime !== "object") + if (!$util.isObject(object.exportLogStartTime)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.exportLogStartTime: object expected"); message.exportLogStartTime = $root.google.protobuf.Timestamp.fromObject(object.exportLogStartTime, long + 1); } if (object.exportLogEndTime != null) { - if (typeof object.exportLogEndTime !== "object") + if (!$util.isObject(object.exportLogEndTime)) throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlBakExportOptions.exportLogEndTime: object expected"); message.exportLogEndTime = $root.google.protobuf.Timestamp.fromObject(object.exportLogEndTime, long + 1); } @@ -114247,9 +117605,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBakExportOptions.toObject = function toObject(message, options) { + SqlBakExportOptions.toObject = function toObject(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.striped = null; @@ -114260,20 +117622,20 @@ object.exportLogStartTime = null; object.exportLogEndTime = null; } - if (message.striped != null && message.hasOwnProperty("striped")) - object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options); - if (message.stripeCount != null && message.hasOwnProperty("stripeCount")) - object.stripeCount = $root.google.protobuf.Int32Value.toObject(message.stripeCount, options); - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) + object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options, q + 1); + if (message.stripeCount != null && Object.hasOwnProperty.call(message, "stripeCount")) + object.stripeCount = $root.google.protobuf.Int32Value.toObject(message.stripeCount, options, q + 1); + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) object.bakType = options.enums === String ? $root.google.cloud.sql.v1beta4.BakType[message.bakType] === undefined ? message.bakType : $root.google.cloud.sql.v1beta4.BakType[message.bakType] : message.bakType; - if (message.copyOnly != null && message.hasOwnProperty("copyOnly")) - object.copyOnly = $root.google.protobuf.BoolValue.toObject(message.copyOnly, options); - if (message.differentialBase != null && message.hasOwnProperty("differentialBase")) - object.differentialBase = $root.google.protobuf.BoolValue.toObject(message.differentialBase, options); - if (message.exportLogStartTime != null && message.hasOwnProperty("exportLogStartTime")) - object.exportLogStartTime = $root.google.protobuf.Timestamp.toObject(message.exportLogStartTime, options); - if (message.exportLogEndTime != null && message.hasOwnProperty("exportLogEndTime")) - object.exportLogEndTime = $root.google.protobuf.Timestamp.toObject(message.exportLogEndTime, options); + if (message.copyOnly != null && Object.hasOwnProperty.call(message, "copyOnly")) + object.copyOnly = $root.google.protobuf.BoolValue.toObject(message.copyOnly, options, q + 1); + if (message.differentialBase != null && Object.hasOwnProperty.call(message, "differentialBase")) + object.differentialBase = $root.google.protobuf.BoolValue.toObject(message.differentialBase, options, q + 1); + if (message.exportLogStartTime != null && Object.hasOwnProperty.call(message, "exportLogStartTime")) + object.exportLogStartTime = $root.google.protobuf.Timestamp.toObject(message.exportLogStartTime, options, q + 1); + if (message.exportLogEndTime != null && Object.hasOwnProperty.call(message, "exportLogEndTime")) + object.exportLogEndTime = $root.google.protobuf.Timestamp.toObject(message.exportLogEndTime, options, q + 1); return object; }; @@ -114386,9 +117748,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlTdeExportOptions.encode = function encode(message, writer) { + SqlTdeExportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificatePath); if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) @@ -114410,7 +117776,7 @@ * @returns {$protobuf.Writer} Writer */ SqlTdeExportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -114492,16 +117858,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) if (!$util.isString(message.certificatePath)) return "certificatePath: string expected"; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) if (!$util.isString(message.privateKeyPath)) return "privateKeyPath: string expected"; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) if (!$util.isString(message.privateKeyPassword)) return "privateKeyPassword: string expected"; - 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; @@ -114518,6 +117884,8 @@ SqlTdeExportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ExportContext.SqlTdeExportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -114543,9 +117911,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlTdeExportOptions.toObject = function toObject(message, options) { + SqlTdeExportOptions.toObject = function toObject(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.certificatePath = ""; @@ -114553,13 +117925,13 @@ object.privateKeyPassword = ""; object.name = ""; } - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) object.certificatePath = message.certificatePath; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) object.privateKeyPath = message.privateKeyPath; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) object.privateKeyPassword = message.privateKeyPassword; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -114658,9 +118030,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FailoverContext.encode = function encode(message, writer) { + FailoverContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.settingsVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -114678,7 +118054,7 @@ * @returns {$protobuf.Writer} Writer */ FailoverContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -114752,10 +118128,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) if (!$util.isInteger(message.settingsVersion) && !(message.settingsVersion && $util.isInteger(message.settingsVersion.low) && $util.isInteger(message.settingsVersion.high))) return "settingsVersion: integer|Long expected"; - 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"; return null; @@ -114772,6 +118148,8 @@ FailoverContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.FailoverContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.FailoverContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -114779,7 +118157,7 @@ var message = new $root.google.cloud.sql.v1beta4.FailoverContext(); if (object.settingsVersion != null) if ($util.Long) - (message.settingsVersion = $util.Long.fromValue(object.settingsVersion)).unsigned = false; + message.settingsVersion = $util.Long.fromValue(object.settingsVersion, false); else if (typeof object.settingsVersion === "string") message.settingsVersion = parseInt(object.settingsVersion, 10); else if (typeof object.settingsVersion === "number") @@ -114800,24 +118178,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FailoverContext.toObject = function toObject(message, options) { + FailoverContext.toObject = function toObject(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.settingsVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.settingsVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.settingsVersion = options.longs === String ? "0" : 0; + object.settingsVersion = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; } - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) - if (typeof message.settingsVersion === "number") + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.settingsVersion = typeof message.settingsVersion === "number" ? BigInt(message.settingsVersion) : $util.Long.fromBits(message.settingsVersion.low >>> 0, message.settingsVersion.high >>> 0, false).toBigInt(); + else if (typeof message.settingsVersion === "number") object.settingsVersion = options.longs === String ? String(message.settingsVersion) : message.settingsVersion; else object.settingsVersion = options.longs === String ? $util.Long.prototype.toString.call(message.settingsVersion) : options.longs === Number ? new $util.LongBits(message.settingsVersion.low >>> 0, message.settingsVersion.high >>> 0).toNumber() : message.settingsVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -115029,9 +118413,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Flag.encode = function encode(message, writer) { + Flag.encode = function encode(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")) @@ -115046,15 +118434,15 @@ for (var i = 0; i < message.allowedStringValues.length; ++i) writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedStringValues[i]); if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) - $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.minValue, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) - $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.maxValue, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.requiresRestart != null && Object.hasOwnProperty.call(message, "requiresRestart")) - $root.google.protobuf.BoolValue.encode(message.requiresRestart, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.requiresRestart, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.kind); if (message.inBeta != null && Object.hasOwnProperty.call(message, "inBeta")) - $root.google.protobuf.BoolValue.encode(message.inBeta, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.inBeta, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.allowedIntValues != null && message.allowedIntValues.length) { writer.uint32(/* id 10, wireType 2 =*/82).fork(); for (var i = 0; i < message.allowedIntValues.length; ++i) @@ -115066,7 +118454,7 @@ if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) writer.uint32(/* id 16, wireType 2 =*/130).string(message.recommendedStringValue); if (message.recommendedIntValue != null && Object.hasOwnProperty.call(message, "recommendedIntValue")) - $root.google.protobuf.Int64Value.encode(message.recommendedIntValue, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.recommendedIntValue, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); return writer; }; @@ -115080,7 +118468,7 @@ * @returns {$protobuf.Writer} Writer */ Flag.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -115215,10 +118603,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.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) switch (message.type) { default: return "type: enum value expected"; @@ -115232,7 +118620,7 @@ case 7: break; } - if (message.appliesTo != null && message.hasOwnProperty("appliesTo")) { + if (message.appliesTo != null && Object.hasOwnProperty.call(message, "appliesTo")) { if (!Array.isArray(message.appliesTo)) return "appliesTo: array expected"; for (var i = 0; i < message.appliesTo.length; ++i) @@ -115298,44 +118686,44 @@ break; } } - if (message.allowedStringValues != null && message.hasOwnProperty("allowedStringValues")) { + if (message.allowedStringValues != null && Object.hasOwnProperty.call(message, "allowedStringValues")) { if (!Array.isArray(message.allowedStringValues)) return "allowedStringValues: array expected"; for (var i = 0; i < message.allowedStringValues.length; ++i) if (!$util.isString(message.allowedStringValues[i])) return "allowedStringValues: string[] expected"; } - if (message.minValue != null && message.hasOwnProperty("minValue")) { + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) { var error = $root.google.protobuf.Int64Value.verify(message.minValue, long + 1); if (error) return "minValue." + error; } - if (message.maxValue != null && message.hasOwnProperty("maxValue")) { + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) { var error = $root.google.protobuf.Int64Value.verify(message.maxValue, long + 1); if (error) return "maxValue." + error; } - if (message.requiresRestart != null && message.hasOwnProperty("requiresRestart")) { + if (message.requiresRestart != null && Object.hasOwnProperty.call(message, "requiresRestart")) { var error = $root.google.protobuf.BoolValue.verify(message.requiresRestart, long + 1); if (error) return "requiresRestart." + error; } - 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.inBeta != null && message.hasOwnProperty("inBeta")) { + if (message.inBeta != null && Object.hasOwnProperty.call(message, "inBeta")) { var error = $root.google.protobuf.BoolValue.verify(message.inBeta, long + 1); if (error) return "inBeta." + error; } - if (message.allowedIntValues != null && message.hasOwnProperty("allowedIntValues")) { + if (message.allowedIntValues != null && Object.hasOwnProperty.call(message, "allowedIntValues")) { if (!Array.isArray(message.allowedIntValues)) return "allowedIntValues: array expected"; for (var i = 0; i < message.allowedIntValues.length; ++i) if (!$util.isInteger(message.allowedIntValues[i]) && !(message.allowedIntValues[i] && $util.isInteger(message.allowedIntValues[i].low) && $util.isInteger(message.allowedIntValues[i].high))) return "allowedIntValues: integer|Long[] expected"; } - if (message.flagScope != null && message.hasOwnProperty("flagScope")) + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) switch (message.flagScope) { default: return "flagScope: enum value expected"; @@ -115344,12 +118732,12 @@ case 2: break; } - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) { properties.recommendedValue = 1; if (!$util.isString(message.recommendedStringValue)) return "recommendedStringValue: string expected"; } - if (message.recommendedIntValue != null && message.hasOwnProperty("recommendedIntValue")) { + if (message.recommendedIntValue != null && Object.hasOwnProperty.call(message, "recommendedIntValue")) { if (properties.recommendedValue === 1) return "recommendedValue: multiple values"; properties.recommendedValue = 1; @@ -115373,6 +118761,8 @@ Flag.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Flag) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Flag: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -115665,24 +119055,24 @@ message.allowedStringValues[i] = String(object.allowedStringValues[i]); } if (object.minValue != null) { - if (typeof object.minValue !== "object") + if (!$util.isObject(object.minValue)) throw TypeError(".google.cloud.sql.v1beta4.Flag.minValue: object expected"); message.minValue = $root.google.protobuf.Int64Value.fromObject(object.minValue, long + 1); } if (object.maxValue != null) { - if (typeof object.maxValue !== "object") + if (!$util.isObject(object.maxValue)) throw TypeError(".google.cloud.sql.v1beta4.Flag.maxValue: object expected"); message.maxValue = $root.google.protobuf.Int64Value.fromObject(object.maxValue, long + 1); } if (object.requiresRestart != null) { - if (typeof object.requiresRestart !== "object") + if (!$util.isObject(object.requiresRestart)) throw TypeError(".google.cloud.sql.v1beta4.Flag.requiresRestart: object expected"); message.requiresRestart = $root.google.protobuf.BoolValue.fromObject(object.requiresRestart, long + 1); } if (object.kind != null) message.kind = String(object.kind); if (object.inBeta != null) { - if (typeof object.inBeta !== "object") + if (!$util.isObject(object.inBeta)) throw TypeError(".google.cloud.sql.v1beta4.Flag.inBeta: object expected"); message.inBeta = $root.google.protobuf.BoolValue.fromObject(object.inBeta, long + 1); } @@ -115692,7 +119082,7 @@ message.allowedIntValues = []; for (var i = 0; i < object.allowedIntValues.length; ++i) if ($util.Long) - (message.allowedIntValues[i] = $util.Long.fromValue(object.allowedIntValues[i])).unsigned = false; + message.allowedIntValues[i] = $util.Long.fromValue(object.allowedIntValues[i], false); else if (typeof object.allowedIntValues[i] === "string") message.allowedIntValues[i] = parseInt(object.allowedIntValues[i], 10); else if (typeof object.allowedIntValues[i] === "number") @@ -115723,7 +119113,7 @@ if (object.recommendedStringValue != null) message.recommendedStringValue = String(object.recommendedStringValue); if (object.recommendedIntValue != null) { - if (typeof object.recommendedIntValue !== "object") + if (!$util.isObject(object.recommendedIntValue)) throw TypeError(".google.cloud.sql.v1beta4.Flag.recommendedIntValue: object expected"); message.recommendedIntValue = $root.google.protobuf.Int64Value.fromObject(object.recommendedIntValue, long + 1); } @@ -115739,9 +119129,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Flag.toObject = function toObject(message, options) { + Flag.toObject = function toObject(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.appliesTo = []; @@ -115758,9 +119152,9 @@ object.inBeta = null; object.flagScope = options.enums === String ? "SQL_FLAG_SCOPE_UNSPECIFIED" : 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 = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlFlagType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1beta4.SqlFlagType[message.type] : message.type; if (message.appliesTo && message.appliesTo.length) { object.appliesTo = []; @@ -115772,33 +119166,35 @@ for (var j = 0; j < message.allowedStringValues.length; ++j) object.allowedStringValues[j] = message.allowedStringValues[j]; } - if (message.minValue != null && message.hasOwnProperty("minValue")) - object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options); - if (message.maxValue != null && message.hasOwnProperty("maxValue")) - object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options); - if (message.requiresRestart != null && message.hasOwnProperty("requiresRestart")) - object.requiresRestart = $root.google.protobuf.BoolValue.toObject(message.requiresRestart, options); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.minValue != null && Object.hasOwnProperty.call(message, "minValue")) + object.minValue = $root.google.protobuf.Int64Value.toObject(message.minValue, options, q + 1); + if (message.maxValue != null && Object.hasOwnProperty.call(message, "maxValue")) + object.maxValue = $root.google.protobuf.Int64Value.toObject(message.maxValue, options, q + 1); + if (message.requiresRestart != null && Object.hasOwnProperty.call(message, "requiresRestart")) + object.requiresRestart = $root.google.protobuf.BoolValue.toObject(message.requiresRestart, options, q + 1); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.inBeta != null && message.hasOwnProperty("inBeta")) - object.inBeta = $root.google.protobuf.BoolValue.toObject(message.inBeta, options); + if (message.inBeta != null && Object.hasOwnProperty.call(message, "inBeta")) + object.inBeta = $root.google.protobuf.BoolValue.toObject(message.inBeta, options, q + 1); if (message.allowedIntValues && message.allowedIntValues.length) { object.allowedIntValues = []; for (var j = 0; j < message.allowedIntValues.length; ++j) - if (typeof message.allowedIntValues[j] === "number") + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.allowedIntValues[j] = typeof message.allowedIntValues[j] === "number" ? BigInt(message.allowedIntValues[j]) : $util.Long.fromBits(message.allowedIntValues[j].low >>> 0, message.allowedIntValues[j].high >>> 0, false).toBigInt(); + else if (typeof message.allowedIntValues[j] === "number") object.allowedIntValues[j] = options.longs === String ? String(message.allowedIntValues[j]) : message.allowedIntValues[j]; else object.allowedIntValues[j] = options.longs === String ? $util.Long.prototype.toString.call(message.allowedIntValues[j]) : options.longs === Number ? new $util.LongBits(message.allowedIntValues[j].low >>> 0, message.allowedIntValues[j].high >>> 0).toNumber() : message.allowedIntValues[j]; } - if (message.flagScope != null && message.hasOwnProperty("flagScope")) + if (message.flagScope != null && Object.hasOwnProperty.call(message, "flagScope")) object.flagScope = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlFlagScope[message.flagScope] === undefined ? message.flagScope : $root.google.cloud.sql.v1beta4.SqlFlagScope[message.flagScope] : message.flagScope; - if (message.recommendedStringValue != null && message.hasOwnProperty("recommendedStringValue")) { + if (message.recommendedStringValue != null && Object.hasOwnProperty.call(message, "recommendedStringValue")) { object.recommendedStringValue = message.recommendedStringValue; if (options.oneofs) object.recommendedValue = "recommendedStringValue"; } - if (message.recommendedIntValue != null && message.hasOwnProperty("recommendedIntValue")) { - object.recommendedIntValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntValue, options); + if (message.recommendedIntValue != null && Object.hasOwnProperty.call(message, "recommendedIntValue")) { + object.recommendedIntValue = $root.google.protobuf.Int64Value.toObject(message.recommendedIntValue, options, q + 1); if (options.oneofs) object.recommendedValue = "recommendedIntValue"; } @@ -115897,14 +119293,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FlagsListResponse.encode = function encode(message, writer) { + FlagsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.Flag.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Flag.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -115918,7 +119318,7 @@ * @returns {$protobuf.Writer} Writer */ FlagsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -115994,10 +119394,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -116020,6 +119420,8 @@ FlagsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.FlagsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.FlagsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -116032,7 +119434,7 @@ throw TypeError(".google.cloud.sql.v1beta4.FlagsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.FlagsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.Flag.fromObject(object.items[i], long + 1); } @@ -116049,20 +119451,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FlagsListResponse.toObject = function toObject(message, options) { + FlagsListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.Flag.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.Flag.toObject(message.items[j], options, q + 1); } return object; }; @@ -116221,9 +119627,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportContext.encode = function encode(message, writer) { + ImportContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); if (message.database != null && Object.hasOwnProperty.call(message, "database")) @@ -116233,15 +119643,15 @@ if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.fileType); if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) - $root.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.encode(message.csvImportOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.importUser != null && Object.hasOwnProperty.call(message, "importUser")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.importUser); if (message.bakImportOptions != null && Object.hasOwnProperty.call(message, "bakImportOptions")) - $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.encode(message.bakImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.encode(message.bakImportOptions, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) - $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.encode(message.sqlImportOptions, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.tdeImportOptions != null && Object.hasOwnProperty.call(message, "tdeImportOptions")) - $root.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.encode(message.tdeImportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.encode(message.tdeImportOptions, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); return writer; }; @@ -116255,7 +119665,7 @@ * @returns {$protobuf.Writer} Writer */ ImportContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -116357,16 +119767,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) if (!$util.isString(message.uri)) return "uri: 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.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.fileType != null && message.hasOwnProperty("fileType")) + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) switch (message.fileType) { default: return "fileType: enum value expected"; @@ -116377,25 +119787,25 @@ case 8: break; } - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) { + if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.verify(message.csvImportOptions, long + 1); if (error) return "csvImportOptions." + error; } - if (message.importUser != null && message.hasOwnProperty("importUser")) + if (message.importUser != null && Object.hasOwnProperty.call(message, "importUser")) if (!$util.isString(message.importUser)) return "importUser: string expected"; - if (message.bakImportOptions != null && message.hasOwnProperty("bakImportOptions")) { + if (message.bakImportOptions != null && Object.hasOwnProperty.call(message, "bakImportOptions")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.verify(message.bakImportOptions, long + 1); if (error) return "bakImportOptions." + error; } - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) { + if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.verify(message.sqlImportOptions, long + 1); if (error) return "sqlImportOptions." + error; } - if (message.tdeImportOptions != null && message.hasOwnProperty("tdeImportOptions")) { + if (message.tdeImportOptions != null && Object.hasOwnProperty.call(message, "tdeImportOptions")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.verify(message.tdeImportOptions, long + 1); if (error) return "tdeImportOptions." + error; @@ -116414,6 +119824,8 @@ ImportContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ImportContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ImportContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -116454,24 +119866,24 @@ break; } if (object.csvImportOptions != null) { - if (typeof object.csvImportOptions !== "object") + if (!$util.isObject(object.csvImportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.csvImportOptions: object expected"); message.csvImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.fromObject(object.csvImportOptions, long + 1); } if (object.importUser != null) message.importUser = String(object.importUser); if (object.bakImportOptions != null) { - if (typeof object.bakImportOptions !== "object") + if (!$util.isObject(object.bakImportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.bakImportOptions: object expected"); message.bakImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.fromObject(object.bakImportOptions, long + 1); } if (object.sqlImportOptions != null) { - if (typeof object.sqlImportOptions !== "object") + if (!$util.isObject(object.sqlImportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.sqlImportOptions: object expected"); message.sqlImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.fromObject(object.sqlImportOptions, long + 1); } if (object.tdeImportOptions != null) { - if (typeof object.tdeImportOptions !== "object") + if (!$util.isObject(object.tdeImportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.tdeImportOptions: object expected"); message.tdeImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.fromObject(object.tdeImportOptions, long + 1); } @@ -116487,9 +119899,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportContext.toObject = function toObject(message, options) { + ImportContext.toObject = function toObject(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.uri = ""; @@ -116502,24 +119918,24 @@ object.sqlImportOptions = null; object.tdeImportOptions = null; } - if (message.uri != null && message.hasOwnProperty("uri")) + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) object.uri = message.uri; - if (message.database != null && message.hasOwnProperty("database")) + if (message.database != null && Object.hasOwnProperty.call(message, "database")) object.database = message.database; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.fileType != null && message.hasOwnProperty("fileType")) + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) object.fileType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlFileType[message.fileType] === undefined ? message.fileType : $root.google.cloud.sql.v1beta4.SqlFileType[message.fileType] : message.fileType; - if (message.csvImportOptions != null && message.hasOwnProperty("csvImportOptions")) - object.csvImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.toObject(message.csvImportOptions, options); - if (message.importUser != null && message.hasOwnProperty("importUser")) + if (message.csvImportOptions != null && Object.hasOwnProperty.call(message, "csvImportOptions")) + object.csvImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions.toObject(message.csvImportOptions, options, q + 1); + if (message.importUser != null && Object.hasOwnProperty.call(message, "importUser")) object.importUser = message.importUser; - if (message.bakImportOptions != null && message.hasOwnProperty("bakImportOptions")) - object.bakImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.toObject(message.bakImportOptions, options); - if (message.sqlImportOptions != null && message.hasOwnProperty("sqlImportOptions")) - object.sqlImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.toObject(message.sqlImportOptions, options); - if (message.tdeImportOptions != null && message.hasOwnProperty("tdeImportOptions")) - object.tdeImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.toObject(message.tdeImportOptions, options); + if (message.bakImportOptions != null && Object.hasOwnProperty.call(message, "bakImportOptions")) + object.bakImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.toObject(message.bakImportOptions, options, q + 1); + if (message.sqlImportOptions != null && Object.hasOwnProperty.call(message, "sqlImportOptions")) + object.sqlImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.toObject(message.sqlImportOptions, options, q + 1); + if (message.tdeImportOptions != null && Object.hasOwnProperty.call(message, "tdeImportOptions")) + object.tdeImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions.toObject(message.tdeImportOptions, options, q + 1); return object; }; @@ -116620,15 +120036,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlImportOptions.encode = function encode(message, writer) { + SqlImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) - $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.threads, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) - $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.parallel, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.postgresImportOptions != null && Object.hasOwnProperty.call(message, "postgresImportOptions")) - $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.encode(message.postgresImportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.encode(message.postgresImportOptions, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -116642,7 +120062,7 @@ * @returns {$protobuf.Writer} Writer */ SqlImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -116720,17 +120140,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.threads != null && message.hasOwnProperty("threads")) { + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) { var error = $root.google.protobuf.Int32Value.verify(message.threads, long + 1); if (error) return "threads." + error; } - if (message.parallel != null && message.hasOwnProperty("parallel")) { + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) { var error = $root.google.protobuf.BoolValue.verify(message.parallel, long + 1); if (error) return "parallel." + error; } - if (message.postgresImportOptions != null && message.hasOwnProperty("postgresImportOptions")) { + if (message.postgresImportOptions != null && Object.hasOwnProperty.call(message, "postgresImportOptions")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.verify(message.postgresImportOptions, long + 1); if (error) return "postgresImportOptions." + error; @@ -116749,23 +120169,25 @@ SqlImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions(); if (object.threads != null) { - if (typeof object.threads !== "object") + if (!$util.isObject(object.threads)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.threads: object expected"); message.threads = $root.google.protobuf.Int32Value.fromObject(object.threads, long + 1); } if (object.parallel != null) { - if (typeof object.parallel !== "object") + if (!$util.isObject(object.parallel)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.parallel: object expected"); message.parallel = $root.google.protobuf.BoolValue.fromObject(object.parallel, long + 1); } if (object.postgresImportOptions != null) { - if (typeof object.postgresImportOptions !== "object") + if (!$util.isObject(object.postgresImportOptions)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.postgresImportOptions: object expected"); message.postgresImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.fromObject(object.postgresImportOptions, long + 1); } @@ -116781,21 +120203,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlImportOptions.toObject = function toObject(message, options) { + SqlImportOptions.toObject = function toObject(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.threads = null; object.parallel = null; object.postgresImportOptions = null; } - if (message.threads != null && message.hasOwnProperty("threads")) - object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options); - if (message.parallel != null && message.hasOwnProperty("parallel")) - object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options); - if (message.postgresImportOptions != null && message.hasOwnProperty("postgresImportOptions")) - object.postgresImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.toObject(message.postgresImportOptions, options); + if (message.threads != null && Object.hasOwnProperty.call(message, "threads")) + object.threads = $root.google.protobuf.Int32Value.toObject(message.threads, options, q + 1); + if (message.parallel != null && Object.hasOwnProperty.call(message, "parallel")) + object.parallel = $root.google.protobuf.BoolValue.toObject(message.parallel, options, q + 1); + if (message.postgresImportOptions != null && Object.hasOwnProperty.call(message, "postgresImportOptions")) + object.postgresImportOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.toObject(message.postgresImportOptions, options, q + 1); return object; }; @@ -116887,13 +120313,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PostgresImportOptions.encode = function encode(message, writer) { + PostgresImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) - $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.clean, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) - $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.ifExists, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -116907,7 +120337,7 @@ * @returns {$protobuf.Writer} Writer */ PostgresImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -116981,12 +120411,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.clean != null && message.hasOwnProperty("clean")) { + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) { var error = $root.google.protobuf.BoolValue.verify(message.clean, long + 1); if (error) return "clean." + error; } - if (message.ifExists != null && message.hasOwnProperty("ifExists")) { + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) { var error = $root.google.protobuf.BoolValue.verify(message.ifExists, long + 1); if (error) return "ifExists." + error; @@ -117005,18 +120435,20 @@ PostgresImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions(); if (object.clean != null) { - if (typeof object.clean !== "object") + if (!$util.isObject(object.clean)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.clean: object expected"); message.clean = $root.google.protobuf.BoolValue.fromObject(object.clean, long + 1); } if (object.ifExists != null) { - if (typeof object.ifExists !== "object") + if (!$util.isObject(object.ifExists)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlImportOptions.PostgresImportOptions.ifExists: object expected"); message.ifExists = $root.google.protobuf.BoolValue.fromObject(object.ifExists, long + 1); } @@ -117032,18 +120464,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PostgresImportOptions.toObject = function toObject(message, options) { + PostgresImportOptions.toObject = function toObject(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.clean = null; object.ifExists = null; } - if (message.clean != null && message.hasOwnProperty("clean")) - object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options); - if (message.ifExists != null && message.hasOwnProperty("ifExists")) - object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options); + if (message.clean != null && Object.hasOwnProperty.call(message, "clean")) + object.clean = $root.google.protobuf.BoolValue.toObject(message.clean, options, q + 1); + if (message.ifExists != null && Object.hasOwnProperty.call(message, "ifExists")) + object.ifExists = $root.google.protobuf.BoolValue.toObject(message.ifExists, options, q + 1); return object; }; @@ -117178,9 +120614,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlCsvImportOptions.encode = function encode(message, writer) { + SqlCsvImportOptions.encode = function encode(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) @@ -117207,7 +120647,7 @@ * @returns {$protobuf.Writer} Writer */ SqlCsvImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -117299,26 +120739,26 @@ 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.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) if (!$util.isString(message.escapeCharacter)) return "escapeCharacter: string expected"; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) if (!$util.isString(message.quoteCharacter)) return "quoteCharacter: string expected"; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) if (!$util.isString(message.fieldsTerminatedBy)) return "fieldsTerminatedBy: string expected"; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) if (!$util.isString(message.linesTerminatedBy)) return "linesTerminatedBy: string expected"; return null; @@ -117335,6 +120775,8 @@ SqlCsvImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlCsvImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -117369,9 +120811,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlCsvImportOptions.toObject = function toObject(message, options) { + SqlCsvImportOptions.toObject = function toObject(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 = []; @@ -117382,20 +120828,20 @@ object.fieldsTerminatedBy = ""; object.linesTerminatedBy = ""; } - 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 = []; for (var j = 0; j < message.columns.length; ++j) object.columns[j] = message.columns[j]; } - if (message.escapeCharacter != null && message.hasOwnProperty("escapeCharacter")) + if (message.escapeCharacter != null && Object.hasOwnProperty.call(message, "escapeCharacter")) object.escapeCharacter = message.escapeCharacter; - if (message.quoteCharacter != null && message.hasOwnProperty("quoteCharacter")) + if (message.quoteCharacter != null && Object.hasOwnProperty.call(message, "quoteCharacter")) object.quoteCharacter = message.quoteCharacter; - if (message.fieldsTerminatedBy != null && message.hasOwnProperty("fieldsTerminatedBy")) + if (message.fieldsTerminatedBy != null && Object.hasOwnProperty.call(message, "fieldsTerminatedBy")) object.fieldsTerminatedBy = message.fieldsTerminatedBy; - if (message.linesTerminatedBy != null && message.hasOwnProperty("linesTerminatedBy")) + if (message.linesTerminatedBy != null && Object.hasOwnProperty.call(message, "linesTerminatedBy")) object.linesTerminatedBy = message.linesTerminatedBy; return object; }; @@ -117536,21 +120982,25 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlBakImportOptions.encode = function encode(message, writer) { + SqlBakImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.encryptionOptions != null && Object.hasOwnProperty.call(message, "encryptionOptions")) - $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.encode(message.encryptionOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.encode(message.encryptionOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) - $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.striped, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.noRecovery != null && Object.hasOwnProperty.call(message, "noRecovery")) - $root.google.protobuf.BoolValue.encode(message.noRecovery, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.noRecovery, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.recoveryOnly != null && Object.hasOwnProperty.call(message, "recoveryOnly")) - $root.google.protobuf.BoolValue.encode(message.recoveryOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.recoveryOnly, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.bakType); if (message.stopAt != null && Object.hasOwnProperty.call(message, "stopAt")) - $root.google.protobuf.Timestamp.encode(message.stopAt, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.stopAt, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.stopAtMark != null && Object.hasOwnProperty.call(message, "stopAtMark")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.stopAtMark); return writer; @@ -117566,7 +121016,7 @@ * @returns {$protobuf.Writer} Writer */ SqlBakImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -117660,27 +121110,27 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.encryptionOptions != null && message.hasOwnProperty("encryptionOptions")) { + if (message.encryptionOptions != null && Object.hasOwnProperty.call(message, "encryptionOptions")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.verify(message.encryptionOptions, long + 1); if (error) return "encryptionOptions." + error; } - if (message.striped != null && message.hasOwnProperty("striped")) { + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) { var error = $root.google.protobuf.BoolValue.verify(message.striped, long + 1); if (error) return "striped." + error; } - if (message.noRecovery != null && message.hasOwnProperty("noRecovery")) { + if (message.noRecovery != null && Object.hasOwnProperty.call(message, "noRecovery")) { var error = $root.google.protobuf.BoolValue.verify(message.noRecovery, long + 1); if (error) return "noRecovery." + error; } - if (message.recoveryOnly != null && message.hasOwnProperty("recoveryOnly")) { + if (message.recoveryOnly != null && Object.hasOwnProperty.call(message, "recoveryOnly")) { var error = $root.google.protobuf.BoolValue.verify(message.recoveryOnly, long + 1); if (error) return "recoveryOnly." + error; } - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) switch (message.bakType) { default: return "bakType: enum value expected"; @@ -117690,12 +121140,12 @@ case 3: break; } - if (message.stopAt != null && message.hasOwnProperty("stopAt")) { + if (message.stopAt != null && Object.hasOwnProperty.call(message, "stopAt")) { var error = $root.google.protobuf.Timestamp.verify(message.stopAt, long + 1); if (error) return "stopAt." + error; } - if (message.stopAtMark != null && message.hasOwnProperty("stopAtMark")) + if (message.stopAtMark != null && Object.hasOwnProperty.call(message, "stopAtMark")) if (!$util.isString(message.stopAtMark)) return "stopAtMark: string expected"; return null; @@ -117712,28 +121162,30 @@ SqlBakImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions(); if (object.encryptionOptions != null) { - if (typeof object.encryptionOptions !== "object") + if (!$util.isObject(object.encryptionOptions)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.encryptionOptions: object expected"); message.encryptionOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.fromObject(object.encryptionOptions, long + 1); } if (object.striped != null) { - if (typeof object.striped !== "object") + if (!$util.isObject(object.striped)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.striped: object expected"); message.striped = $root.google.protobuf.BoolValue.fromObject(object.striped, long + 1); } if (object.noRecovery != null) { - if (typeof object.noRecovery !== "object") + if (!$util.isObject(object.noRecovery)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.noRecovery: object expected"); message.noRecovery = $root.google.protobuf.BoolValue.fromObject(object.noRecovery, long + 1); } if (object.recoveryOnly != null) { - if (typeof object.recoveryOnly !== "object") + if (!$util.isObject(object.recoveryOnly)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.recoveryOnly: object expected"); message.recoveryOnly = $root.google.protobuf.BoolValue.fromObject(object.recoveryOnly, long + 1); } @@ -117762,7 +121214,7 @@ break; } if (object.stopAt != null) { - if (typeof object.stopAt !== "object") + if (!$util.isObject(object.stopAt)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.stopAt: object expected"); message.stopAt = $root.google.protobuf.Timestamp.fromObject(object.stopAt, long + 1); } @@ -117780,9 +121232,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlBakImportOptions.toObject = function toObject(message, options) { + SqlBakImportOptions.toObject = function toObject(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.encryptionOptions = null; @@ -117793,19 +121249,19 @@ object.stopAt = null; object.stopAtMark = ""; } - if (message.encryptionOptions != null && message.hasOwnProperty("encryptionOptions")) - object.encryptionOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.toObject(message.encryptionOptions, options); - if (message.striped != null && message.hasOwnProperty("striped")) - object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options); - if (message.noRecovery != null && message.hasOwnProperty("noRecovery")) - object.noRecovery = $root.google.protobuf.BoolValue.toObject(message.noRecovery, options); - if (message.recoveryOnly != null && message.hasOwnProperty("recoveryOnly")) - object.recoveryOnly = $root.google.protobuf.BoolValue.toObject(message.recoveryOnly, options); - if (message.bakType != null && message.hasOwnProperty("bakType")) + if (message.encryptionOptions != null && Object.hasOwnProperty.call(message, "encryptionOptions")) + object.encryptionOptions = $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.toObject(message.encryptionOptions, options, q + 1); + if (message.striped != null && Object.hasOwnProperty.call(message, "striped")) + object.striped = $root.google.protobuf.BoolValue.toObject(message.striped, options, q + 1); + if (message.noRecovery != null && Object.hasOwnProperty.call(message, "noRecovery")) + object.noRecovery = $root.google.protobuf.BoolValue.toObject(message.noRecovery, options, q + 1); + if (message.recoveryOnly != null && Object.hasOwnProperty.call(message, "recoveryOnly")) + object.recoveryOnly = $root.google.protobuf.BoolValue.toObject(message.recoveryOnly, options, q + 1); + if (message.bakType != null && Object.hasOwnProperty.call(message, "bakType")) object.bakType = options.enums === String ? $root.google.cloud.sql.v1beta4.BakType[message.bakType] === undefined ? message.bakType : $root.google.cloud.sql.v1beta4.BakType[message.bakType] : message.bakType; - if (message.stopAt != null && message.hasOwnProperty("stopAt")) - object.stopAt = $root.google.protobuf.Timestamp.toObject(message.stopAt, options); - if (message.stopAtMark != null && message.hasOwnProperty("stopAtMark")) + if (message.stopAt != null && Object.hasOwnProperty.call(message, "stopAt")) + object.stopAt = $root.google.protobuf.Timestamp.toObject(message.stopAt, options, q + 1); + if (message.stopAtMark != null && Object.hasOwnProperty.call(message, "stopAtMark")) object.stopAtMark = message.stopAtMark; return object; }; @@ -117916,9 +121372,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EncryptionOptions.encode = function encode(message, writer) { + EncryptionOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certPath != null && Object.hasOwnProperty.call(message, "certPath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.certPath); if (message.pvkPath != null && Object.hasOwnProperty.call(message, "pvkPath")) @@ -117926,7 +121386,7 @@ if (message.pvkPassword != null && Object.hasOwnProperty.call(message, "pvkPassword")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pvkPassword); if (message.keepEncrypted != null && Object.hasOwnProperty.call(message, "keepEncrypted")) - $root.google.protobuf.BoolValue.encode(message.keepEncrypted, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.keepEncrypted, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -117940,7 +121400,7 @@ * @returns {$protobuf.Writer} Writer */ EncryptionOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -118022,16 +121482,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certPath != null && message.hasOwnProperty("certPath")) + if (message.certPath != null && Object.hasOwnProperty.call(message, "certPath")) if (!$util.isString(message.certPath)) return "certPath: string expected"; - if (message.pvkPath != null && message.hasOwnProperty("pvkPath")) + if (message.pvkPath != null && Object.hasOwnProperty.call(message, "pvkPath")) if (!$util.isString(message.pvkPath)) return "pvkPath: string expected"; - if (message.pvkPassword != null && message.hasOwnProperty("pvkPassword")) + if (message.pvkPassword != null && Object.hasOwnProperty.call(message, "pvkPassword")) if (!$util.isString(message.pvkPassword)) return "pvkPassword: string expected"; - if (message.keepEncrypted != null && message.hasOwnProperty("keepEncrypted")) { + if (message.keepEncrypted != null && Object.hasOwnProperty.call(message, "keepEncrypted")) { var error = $root.google.protobuf.BoolValue.verify(message.keepEncrypted, long + 1); if (error) return "keepEncrypted." + error; @@ -118050,6 +121510,8 @@ EncryptionOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -118062,7 +121524,7 @@ if (object.pvkPassword != null) message.pvkPassword = String(object.pvkPassword); if (object.keepEncrypted != null) { - if (typeof object.keepEncrypted !== "object") + if (!$util.isObject(object.keepEncrypted)) throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlBakImportOptions.EncryptionOptions.keepEncrypted: object expected"); message.keepEncrypted = $root.google.protobuf.BoolValue.fromObject(object.keepEncrypted, long + 1); } @@ -118078,9 +121540,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EncryptionOptions.toObject = function toObject(message, options) { + EncryptionOptions.toObject = function toObject(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.certPath = ""; @@ -118088,14 +121554,14 @@ object.pvkPassword = ""; object.keepEncrypted = null; } - if (message.certPath != null && message.hasOwnProperty("certPath")) + if (message.certPath != null && Object.hasOwnProperty.call(message, "certPath")) object.certPath = message.certPath; - if (message.pvkPath != null && message.hasOwnProperty("pvkPath")) + if (message.pvkPath != null && Object.hasOwnProperty.call(message, "pvkPath")) object.pvkPath = message.pvkPath; - if (message.pvkPassword != null && message.hasOwnProperty("pvkPassword")) + if (message.pvkPassword != null && Object.hasOwnProperty.call(message, "pvkPassword")) object.pvkPassword = message.pvkPassword; - if (message.keepEncrypted != null && message.hasOwnProperty("keepEncrypted")) - object.keepEncrypted = $root.google.protobuf.BoolValue.toObject(message.keepEncrypted, options); + if (message.keepEncrypted != null && Object.hasOwnProperty.call(message, "keepEncrypted")) + object.keepEncrypted = $root.google.protobuf.BoolValue.toObject(message.keepEncrypted, options, q + 1); return object; }; @@ -118211,9 +121677,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlTdeImportOptions.encode = function encode(message, writer) { + SqlTdeImportOptions.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.certificatePath); if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) @@ -118235,7 +121705,7 @@ * @returns {$protobuf.Writer} Writer */ SqlTdeImportOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -118317,16 +121787,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) if (!$util.isString(message.certificatePath)) return "certificatePath: string expected"; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) if (!$util.isString(message.privateKeyPath)) return "privateKeyPath: string expected"; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) if (!$util.isString(message.privateKeyPassword)) return "privateKeyPassword: string expected"; - 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; @@ -118343,6 +121813,8 @@ SqlTdeImportOptions.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ImportContext.SqlTdeImportOptions: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -118368,9 +121840,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlTdeImportOptions.toObject = function toObject(message, options) { + SqlTdeImportOptions.toObject = function toObject(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.certificatePath = ""; @@ -118378,13 +121854,13 @@ object.privateKeyPassword = ""; object.name = ""; } - if (message.certificatePath != null && message.hasOwnProperty("certificatePath")) + if (message.certificatePath != null && Object.hasOwnProperty.call(message, "certificatePath")) object.certificatePath = message.certificatePath; - if (message.privateKeyPath != null && message.hasOwnProperty("privateKeyPath")) + if (message.privateKeyPath != null && Object.hasOwnProperty.call(message, "privateKeyPath")) object.privateKeyPath = message.privateKeyPath; - if (message.privateKeyPassword != null && message.hasOwnProperty("privateKeyPassword")) + if (message.privateKeyPassword != null && Object.hasOwnProperty.call(message, "privateKeyPassword")) object.privateKeyPassword = message.privateKeyPassword; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; return object; }; @@ -118492,11 +121968,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesCloneRequest.encode = function encode(message, writer) { + InstancesCloneRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.cloneContext != null && Object.hasOwnProperty.call(message, "cloneContext")) - $root.google.cloud.sql.v1beta4.CloneContext.encode(message.cloneContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.CloneContext.encode(message.cloneContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -118510,7 +121990,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesCloneRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -118580,7 +122060,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.cloneContext != null && message.hasOwnProperty("cloneContext")) { + if (message.cloneContext != null && Object.hasOwnProperty.call(message, "cloneContext")) { var error = $root.google.cloud.sql.v1beta4.CloneContext.verify(message.cloneContext, long + 1); if (error) return "cloneContext." + error; @@ -118599,13 +122079,15 @@ InstancesCloneRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesCloneRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesCloneRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesCloneRequest(); if (object.cloneContext != null) { - if (typeof object.cloneContext !== "object") + if (!$util.isObject(object.cloneContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesCloneRequest.cloneContext: object expected"); message.cloneContext = $root.google.cloud.sql.v1beta4.CloneContext.fromObject(object.cloneContext, long + 1); } @@ -118621,14 +122103,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesCloneRequest.toObject = function toObject(message, options) { + InstancesCloneRequest.toObject = function toObject(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.cloneContext = null; - if (message.cloneContext != null && message.hasOwnProperty("cloneContext")) - object.cloneContext = $root.google.cloud.sql.v1beta4.CloneContext.toObject(message.cloneContext, options); + if (message.cloneContext != null && Object.hasOwnProperty.call(message, "cloneContext")) + object.cloneContext = $root.google.cloud.sql.v1beta4.CloneContext.toObject(message.cloneContext, options, q + 1); return object; }; @@ -118714,11 +122200,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesDemoteMasterRequest.encode = function encode(message, writer) { + InstancesDemoteMasterRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.demoteMasterContext != null && Object.hasOwnProperty.call(message, "demoteMasterContext")) - $root.google.cloud.sql.v1beta4.DemoteMasterContext.encode(message.demoteMasterContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DemoteMasterContext.encode(message.demoteMasterContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -118732,7 +122222,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesDemoteMasterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -118802,7 +122292,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.demoteMasterContext != null && message.hasOwnProperty("demoteMasterContext")) { + if (message.demoteMasterContext != null && Object.hasOwnProperty.call(message, "demoteMasterContext")) { var error = $root.google.cloud.sql.v1beta4.DemoteMasterContext.verify(message.demoteMasterContext, long + 1); if (error) return "demoteMasterContext." + error; @@ -118821,13 +122311,15 @@ InstancesDemoteMasterRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesDemoteMasterRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesDemoteMasterRequest(); if (object.demoteMasterContext != null) { - if (typeof object.demoteMasterContext !== "object") + if (!$util.isObject(object.demoteMasterContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesDemoteMasterRequest.demoteMasterContext: object expected"); message.demoteMasterContext = $root.google.cloud.sql.v1beta4.DemoteMasterContext.fromObject(object.demoteMasterContext, long + 1); } @@ -118843,14 +122335,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesDemoteMasterRequest.toObject = function toObject(message, options) { + InstancesDemoteMasterRequest.toObject = function toObject(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.demoteMasterContext = null; - if (message.demoteMasterContext != null && message.hasOwnProperty("demoteMasterContext")) - object.demoteMasterContext = $root.google.cloud.sql.v1beta4.DemoteMasterContext.toObject(message.demoteMasterContext, options); + if (message.demoteMasterContext != null && Object.hasOwnProperty.call(message, "demoteMasterContext")) + object.demoteMasterContext = $root.google.cloud.sql.v1beta4.DemoteMasterContext.toObject(message.demoteMasterContext, options, q + 1); return object; }; @@ -118936,11 +122432,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesDemoteRequest.encode = function encode(message, writer) { + InstancesDemoteRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.demoteContext != null && Object.hasOwnProperty.call(message, "demoteContext")) - $root.google.cloud.sql.v1beta4.DemoteContext.encode(message.demoteContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DemoteContext.encode(message.demoteContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -118954,7 +122454,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesDemoteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -119024,7 +122524,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.demoteContext != null && message.hasOwnProperty("demoteContext")) { + if (message.demoteContext != null && Object.hasOwnProperty.call(message, "demoteContext")) { var error = $root.google.cloud.sql.v1beta4.DemoteContext.verify(message.demoteContext, long + 1); if (error) return "demoteContext." + error; @@ -119043,13 +122543,15 @@ InstancesDemoteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesDemoteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesDemoteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesDemoteRequest(); if (object.demoteContext != null) { - if (typeof object.demoteContext !== "object") + if (!$util.isObject(object.demoteContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesDemoteRequest.demoteContext: object expected"); message.demoteContext = $root.google.cloud.sql.v1beta4.DemoteContext.fromObject(object.demoteContext, long + 1); } @@ -119065,14 +122567,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesDemoteRequest.toObject = function toObject(message, options) { + InstancesDemoteRequest.toObject = function toObject(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.demoteContext = null; - if (message.demoteContext != null && message.hasOwnProperty("demoteContext")) - object.demoteContext = $root.google.cloud.sql.v1beta4.DemoteContext.toObject(message.demoteContext, options); + if (message.demoteContext != null && Object.hasOwnProperty.call(message, "demoteContext")) + object.demoteContext = $root.google.cloud.sql.v1beta4.DemoteContext.toObject(message.demoteContext, options, q + 1); return object; }; @@ -119158,11 +122664,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesExportRequest.encode = function encode(message, writer) { + InstancesExportRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) - $root.google.cloud.sql.v1beta4.ExportContext.encode(message.exportContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.encode(message.exportContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -119176,7 +122686,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesExportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -119246,7 +122756,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.exportContext != null && message.hasOwnProperty("exportContext")) { + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.verify(message.exportContext, long + 1); if (error) return "exportContext." + error; @@ -119265,13 +122775,15 @@ InstancesExportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesExportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesExportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesExportRequest(); if (object.exportContext != null) { - if (typeof object.exportContext !== "object") + if (!$util.isObject(object.exportContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesExportRequest.exportContext: object expected"); message.exportContext = $root.google.cloud.sql.v1beta4.ExportContext.fromObject(object.exportContext, long + 1); } @@ -119287,14 +122799,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesExportRequest.toObject = function toObject(message, options) { + InstancesExportRequest.toObject = function toObject(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.exportContext = null; - if (message.exportContext != null && message.hasOwnProperty("exportContext")) - object.exportContext = $root.google.cloud.sql.v1beta4.ExportContext.toObject(message.exportContext, options); + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) + object.exportContext = $root.google.cloud.sql.v1beta4.ExportContext.toObject(message.exportContext, options, q + 1); return object; }; @@ -119380,11 +122896,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesFailoverRequest.encode = function encode(message, writer) { + InstancesFailoverRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.failoverContext != null && Object.hasOwnProperty.call(message, "failoverContext")) - $root.google.cloud.sql.v1beta4.FailoverContext.encode(message.failoverContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.FailoverContext.encode(message.failoverContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -119398,7 +122918,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesFailoverRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -119468,7 +122988,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.failoverContext != null && message.hasOwnProperty("failoverContext")) { + if (message.failoverContext != null && Object.hasOwnProperty.call(message, "failoverContext")) { var error = $root.google.cloud.sql.v1beta4.FailoverContext.verify(message.failoverContext, long + 1); if (error) return "failoverContext." + error; @@ -119487,13 +123007,15 @@ InstancesFailoverRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesFailoverRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesFailoverRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesFailoverRequest(); if (object.failoverContext != null) { - if (typeof object.failoverContext !== "object") + if (!$util.isObject(object.failoverContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesFailoverRequest.failoverContext: object expected"); message.failoverContext = $root.google.cloud.sql.v1beta4.FailoverContext.fromObject(object.failoverContext, long + 1); } @@ -119509,14 +123031,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesFailoverRequest.toObject = function toObject(message, options) { + InstancesFailoverRequest.toObject = function toObject(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.failoverContext = null; - if (message.failoverContext != null && message.hasOwnProperty("failoverContext")) - object.failoverContext = $root.google.cloud.sql.v1beta4.FailoverContext.toObject(message.failoverContext, options); + if (message.failoverContext != null && Object.hasOwnProperty.call(message, "failoverContext")) + object.failoverContext = $root.google.cloud.sql.v1beta4.FailoverContext.toObject(message.failoverContext, options, q + 1); return object; }; @@ -119602,11 +123128,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesImportRequest.encode = function encode(message, writer) { + InstancesImportRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) - $root.google.cloud.sql.v1beta4.ImportContext.encode(message.importContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.encode(message.importContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -119620,7 +123150,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesImportRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -119690,7 +123220,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.importContext != null && message.hasOwnProperty("importContext")) { + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.verify(message.importContext, long + 1); if (error) return "importContext." + error; @@ -119709,13 +123239,15 @@ InstancesImportRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesImportRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesImportRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesImportRequest(); if (object.importContext != null) { - if (typeof object.importContext !== "object") + if (!$util.isObject(object.importContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesImportRequest.importContext: object expected"); message.importContext = $root.google.cloud.sql.v1beta4.ImportContext.fromObject(object.importContext, long + 1); } @@ -119731,14 +123263,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesImportRequest.toObject = function toObject(message, options) { + InstancesImportRequest.toObject = function toObject(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.importContext = null; - if (message.importContext != null && message.hasOwnProperty("importContext")) - object.importContext = $root.google.cloud.sql.v1beta4.ImportContext.toObject(message.importContext, options); + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) + object.importContext = $root.google.cloud.sql.v1beta4.ImportContext.toObject(message.importContext, options, q + 1); return object; }; @@ -119824,11 +123360,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(message, writer) { + InstancesPreCheckMajorVersionUpgradeRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) - $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -119842,7 +123382,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesPreCheckMajorVersionUpgradeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -119912,7 +123452,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) { + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) { var error = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.verify(message.preCheckMajorVersionUpgradeContext, long + 1); if (error) return "preCheckMajorVersionUpgradeContext." + error; @@ -119931,13 +123471,15 @@ InstancesPreCheckMajorVersionUpgradeRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest(); if (object.preCheckMajorVersionUpgradeContext != null) { - if (typeof object.preCheckMajorVersionUpgradeContext !== "object") + if (!$util.isObject(object.preCheckMajorVersionUpgradeContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesPreCheckMajorVersionUpgradeRequest.preCheckMajorVersionUpgradeContext: object expected"); message.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.fromObject(object.preCheckMajorVersionUpgradeContext, long + 1); } @@ -119953,14 +123495,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(message, options) { + InstancesPreCheckMajorVersionUpgradeRequest.toObject = function toObject(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.preCheckMajorVersionUpgradeContext = null; - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) - object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options); + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) + object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options, q + 1); return object; }; @@ -120047,12 +123593,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MySqlSyncConfig.encode = function encode(message, writer) { + MySqlSyncConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.initialSyncFlags != null && message.initialSyncFlags.length) for (var i = 0; i < message.initialSyncFlags.length; ++i) - $root.google.cloud.sql.v1beta4.SyncFlags.encode(message.initialSyncFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SyncFlags.encode(message.initialSyncFlags[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -120066,7 +123616,7 @@ * @returns {$protobuf.Writer} Writer */ MySqlSyncConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -120138,7 +123688,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.initialSyncFlags != null && message.hasOwnProperty("initialSyncFlags")) { + if (message.initialSyncFlags != null && Object.hasOwnProperty.call(message, "initialSyncFlags")) { if (!Array.isArray(message.initialSyncFlags)) return "initialSyncFlags: array expected"; for (var i = 0; i < message.initialSyncFlags.length; ++i) { @@ -120161,6 +123711,8 @@ MySqlSyncConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.MySqlSyncConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.MySqlSyncConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -120171,7 +123723,7 @@ throw TypeError(".google.cloud.sql.v1beta4.MySqlSyncConfig.initialSyncFlags: array expected"); message.initialSyncFlags = []; for (var i = 0; i < object.initialSyncFlags.length; ++i) { - if (typeof object.initialSyncFlags[i] !== "object") + if (!$util.isObject(object.initialSyncFlags[i])) throw TypeError(".google.cloud.sql.v1beta4.MySqlSyncConfig.initialSyncFlags: object expected"); message.initialSyncFlags[i] = $root.google.cloud.sql.v1beta4.SyncFlags.fromObject(object.initialSyncFlags[i], long + 1); } @@ -120188,16 +123740,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MySqlSyncConfig.toObject = function toObject(message, options) { + MySqlSyncConfig.toObject = function toObject(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.initialSyncFlags = []; if (message.initialSyncFlags && message.initialSyncFlags.length) { object.initialSyncFlags = []; for (var j = 0; j < message.initialSyncFlags.length; ++j) - object.initialSyncFlags[j] = $root.google.cloud.sql.v1beta4.SyncFlags.toObject(message.initialSyncFlags[j], options); + object.initialSyncFlags[j] = $root.google.cloud.sql.v1beta4.SyncFlags.toObject(message.initialSyncFlags[j], options, q + 1); } return object; }; @@ -120313,17 +123869,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListResponse.encode = function encode(message, writer) { + InstancesListResponse.encode = function encode(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.warnings != null && message.warnings.length) for (var i = 0; i < message.warnings.length; ++i) - $root.google.cloud.sql.v1beta4.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ApiWarning.encode(message.warnings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.items[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.nextPageToken); return writer; @@ -120339,7 +123899,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -120425,10 +123985,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.warnings != null && message.hasOwnProperty("warnings")) { + if (message.warnings != null && Object.hasOwnProperty.call(message, "warnings")) { if (!Array.isArray(message.warnings)) return "warnings: array expected"; for (var i = 0; i < message.warnings.length; ++i) { @@ -120437,7 +123997,7 @@ return "warnings." + error; } } - if (message.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -120446,7 +124006,7 @@ return "items." + 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; @@ -120463,6 +124023,8 @@ InstancesListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -120475,7 +124037,7 @@ throw TypeError(".google.cloud.sql.v1beta4.InstancesListResponse.warnings: array expected"); message.warnings = []; for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") + if (!$util.isObject(object.warnings[i])) throw TypeError(".google.cloud.sql.v1beta4.InstancesListResponse.warnings: object expected"); message.warnings[i] = $root.google.cloud.sql.v1beta4.ApiWarning.fromObject(object.warnings[i], long + 1); } @@ -120485,7 +124047,7 @@ throw TypeError(".google.cloud.sql.v1beta4.InstancesListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.InstancesListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.DatabaseInstance.fromObject(object.items[i], long + 1); } @@ -120504,9 +124066,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListResponse.toObject = function toObject(message, options) { + InstancesListResponse.toObject = function toObject(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.warnings = []; @@ -120516,19 +124082,19 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.warnings && message.warnings.length) { object.warnings = []; for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.sql.v1beta4.ApiWarning.toObject(message.warnings[j], options); + object.warnings[j] = $root.google.cloud.sql.v1beta4.ApiWarning.toObject(message.warnings[j], options, q + 1); } if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.items[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; }; @@ -120634,12 +124200,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListServerCasResponse.encode = function encode(message, writer) { + InstancesListServerCasResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certs != null && message.certs.length) for (var i = 0; i < message.certs.length; ++i) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.activeVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -120657,7 +124227,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListServerCasResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -120737,7 +124307,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certs != null && message.hasOwnProperty("certs")) { + if (message.certs != null && Object.hasOwnProperty.call(message, "certs")) { if (!Array.isArray(message.certs)) return "certs: array expected"; for (var i = 0; i < message.certs.length; ++i) { @@ -120746,10 +124316,10 @@ return "certs." + error; } } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) if (!$util.isString(message.activeVersion)) return "activeVersion: string expected"; - 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"; return null; @@ -120766,6 +124336,8 @@ InstancesListServerCasResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesListServerCasResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCasResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -120776,7 +124348,7 @@ throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCasResponse.certs: array expected"); message.certs = []; for (var i = 0; i < object.certs.length; ++i) { - if (typeof object.certs[i] !== "object") + if (!$util.isObject(object.certs[i])) throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCasResponse.certs: object expected"); message.certs[i] = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.certs[i], long + 1); } @@ -120797,9 +124369,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListServerCasResponse.toObject = function toObject(message, options) { + InstancesListServerCasResponse.toObject = function toObject(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.certs = []; @@ -120810,11 +124386,11 @@ if (message.certs && message.certs.length) { object.certs = []; for (var j = 0; j < message.certs.length; ++j) - object.certs[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.certs[j], options); + object.certs[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.certs[j], options, q + 1); } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) object.activeVersion = message.activeVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -120930,15 +124506,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListServerCertificatesResponse.encode = function encode(message, writer) { + InstancesListServerCertificatesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.caCerts != null && message.caCerts.length) for (var i = 0; i < message.caCerts.length; ++i) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.caCerts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.serverCerts != null && message.serverCerts.length) for (var i = 0; i < message.serverCerts.length; ++i) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCerts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCerts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.activeVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -120956,7 +124536,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListServerCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -121042,7 +124622,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.caCerts != null && message.hasOwnProperty("caCerts")) { + if (message.caCerts != null && Object.hasOwnProperty.call(message, "caCerts")) { if (!Array.isArray(message.caCerts)) return "caCerts: array expected"; for (var i = 0; i < message.caCerts.length; ++i) { @@ -121051,7 +124631,7 @@ return "caCerts." + error; } } - if (message.serverCerts != null && message.hasOwnProperty("serverCerts")) { + if (message.serverCerts != null && Object.hasOwnProperty.call(message, "serverCerts")) { if (!Array.isArray(message.serverCerts)) return "serverCerts: array expected"; for (var i = 0; i < message.serverCerts.length; ++i) { @@ -121060,10 +124640,10 @@ return "serverCerts." + error; } } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) if (!$util.isString(message.activeVersion)) return "activeVersion: string expected"; - 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"; return null; @@ -121080,6 +124660,8 @@ InstancesListServerCertificatesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -121090,7 +124672,7 @@ throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.caCerts: array expected"); message.caCerts = []; for (var i = 0; i < object.caCerts.length; ++i) { - if (typeof object.caCerts[i] !== "object") + if (!$util.isObject(object.caCerts[i])) throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.caCerts: object expected"); message.caCerts[i] = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.caCerts[i], long + 1); } @@ -121100,7 +124682,7 @@ throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.serverCerts: array expected"); message.serverCerts = []; for (var i = 0; i < object.serverCerts.length; ++i) { - if (typeof object.serverCerts[i] !== "object") + if (!$util.isObject(object.serverCerts[i])) throw TypeError(".google.cloud.sql.v1beta4.InstancesListServerCertificatesResponse.serverCerts: object expected"); message.serverCerts[i] = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.serverCerts[i], long + 1); } @@ -121121,9 +124703,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListServerCertificatesResponse.toObject = function toObject(message, options) { + InstancesListServerCertificatesResponse.toObject = function toObject(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.caCerts = []; @@ -121136,16 +124722,16 @@ if (message.caCerts && message.caCerts.length) { object.caCerts = []; for (var j = 0; j < message.caCerts.length; ++j) - object.caCerts[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.caCerts[j], options); + object.caCerts[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.caCerts[j], options, q + 1); } if (message.serverCerts && message.serverCerts.length) { object.serverCerts = []; for (var j = 0; j < message.serverCerts.length; ++j) - object.serverCerts[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCerts[j], options); + object.serverCerts[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCerts[j], options, q + 1); } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) object.activeVersion = message.activeVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -121251,12 +124837,16 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesListEntraIdCertificatesResponse.encode = function encode(message, writer) { + InstancesListEntraIdCertificatesResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certs != null && message.certs.length) for (var i = 0; i < message.certs.length; ++i) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.certs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.activeVersion); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -121274,7 +124864,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesListEntraIdCertificatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -121354,7 +124944,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certs != null && message.hasOwnProperty("certs")) { + if (message.certs != null && Object.hasOwnProperty.call(message, "certs")) { if (!Array.isArray(message.certs)) return "certs: array expected"; for (var i = 0; i < message.certs.length; ++i) { @@ -121363,10 +124953,10 @@ return "certs." + error; } } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) if (!$util.isString(message.activeVersion)) return "activeVersion: string expected"; - 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"; return null; @@ -121383,6 +124973,8 @@ InstancesListEntraIdCertificatesResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -121393,7 +124985,7 @@ throw TypeError(".google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.certs: array expected"); message.certs = []; for (var i = 0; i < object.certs.length; ++i) { - if (typeof object.certs[i] !== "object") + if (!$util.isObject(object.certs[i])) throw TypeError(".google.cloud.sql.v1beta4.InstancesListEntraIdCertificatesResponse.certs: object expected"); message.certs[i] = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.certs[i], long + 1); } @@ -121414,9 +125006,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesListEntraIdCertificatesResponse.toObject = function toObject(message, options) { + InstancesListEntraIdCertificatesResponse.toObject = function toObject(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.certs = []; @@ -121427,11 +125023,11 @@ if (message.certs && message.certs.length) { object.certs = []; for (var j = 0; j < message.certs.length; ++j) - object.certs[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.certs[j], options); + object.certs[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.certs[j], options, q + 1); } - if (message.activeVersion != null && message.hasOwnProperty("activeVersion")) + if (message.activeVersion != null && Object.hasOwnProperty.call(message, "activeVersion")) object.activeVersion = message.activeVersion; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -121555,15 +125151,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRestoreBackupRequest.encode = function encode(message, writer) { + InstancesRestoreBackupRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.restoreBackupContext != null && Object.hasOwnProperty.call(message, "restoreBackupContext")) - $root.google.cloud.sql.v1beta4.RestoreBackupContext.encode(message.restoreBackupContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.RestoreBackupContext.encode(message.restoreBackupContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.backup); if (message.restoreInstanceSettings != null && Object.hasOwnProperty.call(message, "restoreInstanceSettings")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.restoreInstanceSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.restoreInstanceSettings, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.backupdrBackup != null && Object.hasOwnProperty.call(message, "backupdrBackup")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupdrBackup); if (message.restoreInstanceClearOverridesFieldNames != null && message.restoreInstanceClearOverridesFieldNames.length) @@ -121582,7 +125182,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -121670,23 +125270,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.restoreBackupContext != null && message.hasOwnProperty("restoreBackupContext")) { + if (message.restoreBackupContext != null && Object.hasOwnProperty.call(message, "restoreBackupContext")) { var error = $root.google.cloud.sql.v1beta4.RestoreBackupContext.verify(message.restoreBackupContext, long + 1); if (error) return "restoreBackupContext." + error; } - 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.backupdrBackup != null && message.hasOwnProperty("backupdrBackup")) + if (message.backupdrBackup != null && Object.hasOwnProperty.call(message, "backupdrBackup")) if (!$util.isString(message.backupdrBackup)) return "backupdrBackup: string expected"; - if (message.restoreInstanceSettings != null && message.hasOwnProperty("restoreInstanceSettings")) { + if (message.restoreInstanceSettings != null && Object.hasOwnProperty.call(message, "restoreInstanceSettings")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.verify(message.restoreInstanceSettings, long + 1); if (error) return "restoreInstanceSettings." + error; } - if (message.restoreInstanceClearOverridesFieldNames != null && message.hasOwnProperty("restoreInstanceClearOverridesFieldNames")) { + if (message.restoreInstanceClearOverridesFieldNames != null && Object.hasOwnProperty.call(message, "restoreInstanceClearOverridesFieldNames")) { if (!Array.isArray(message.restoreInstanceClearOverridesFieldNames)) return "restoreInstanceClearOverridesFieldNames: array expected"; for (var i = 0; i < message.restoreInstanceClearOverridesFieldNames.length; ++i) @@ -121707,13 +125307,15 @@ InstancesRestoreBackupRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesRestoreBackupRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesRestoreBackupRequest(); if (object.restoreBackupContext != null) { - if (typeof object.restoreBackupContext !== "object") + if (!$util.isObject(object.restoreBackupContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.restoreBackupContext: object expected"); message.restoreBackupContext = $root.google.cloud.sql.v1beta4.RestoreBackupContext.fromObject(object.restoreBackupContext, long + 1); } @@ -121722,7 +125324,7 @@ if (object.backupdrBackup != null) message.backupdrBackup = String(object.backupdrBackup); if (object.restoreInstanceSettings != null) { - if (typeof object.restoreInstanceSettings !== "object") + if (!$util.isObject(object.restoreInstanceSettings)) throw TypeError(".google.cloud.sql.v1beta4.InstancesRestoreBackupRequest.restoreInstanceSettings: object expected"); message.restoreInstanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.fromObject(object.restoreInstanceSettings, long + 1); } @@ -121745,9 +125347,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRestoreBackupRequest.toObject = function toObject(message, options) { + InstancesRestoreBackupRequest.toObject = function toObject(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.restoreInstanceClearOverridesFieldNames = []; @@ -121757,13 +125363,13 @@ object.restoreInstanceSettings = null; object.backupdrBackup = ""; } - if (message.restoreBackupContext != null && message.hasOwnProperty("restoreBackupContext")) - object.restoreBackupContext = $root.google.cloud.sql.v1beta4.RestoreBackupContext.toObject(message.restoreBackupContext, options); - if (message.backup != null && message.hasOwnProperty("backup")) + if (message.restoreBackupContext != null && Object.hasOwnProperty.call(message, "restoreBackupContext")) + object.restoreBackupContext = $root.google.cloud.sql.v1beta4.RestoreBackupContext.toObject(message.restoreBackupContext, options, q + 1); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) object.backup = message.backup; - if (message.restoreInstanceSettings != null && message.hasOwnProperty("restoreInstanceSettings")) - object.restoreInstanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.restoreInstanceSettings, options); - if (message.backupdrBackup != null && message.hasOwnProperty("backupdrBackup")) + if (message.restoreInstanceSettings != null && Object.hasOwnProperty.call(message, "restoreInstanceSettings")) + object.restoreInstanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.restoreInstanceSettings, options, q + 1); + if (message.backupdrBackup != null && Object.hasOwnProperty.call(message, "backupdrBackup")) object.backupdrBackup = message.backupdrBackup; if (message.restoreInstanceClearOverridesFieldNames && message.restoreInstanceClearOverridesFieldNames.length) { object.restoreInstanceClearOverridesFieldNames = []; @@ -121855,11 +125461,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRotateServerCaRequest.encode = function encode(message, writer) { + InstancesRotateServerCaRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rotateServerCaContext != null && Object.hasOwnProperty.call(message, "rotateServerCaContext")) - $root.google.cloud.sql.v1beta4.RotateServerCaContext.encode(message.rotateServerCaContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.RotateServerCaContext.encode(message.rotateServerCaContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -121873,7 +125483,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRotateServerCaRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -121943,7 +125553,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rotateServerCaContext != null && message.hasOwnProperty("rotateServerCaContext")) { + if (message.rotateServerCaContext != null && Object.hasOwnProperty.call(message, "rotateServerCaContext")) { var error = $root.google.cloud.sql.v1beta4.RotateServerCaContext.verify(message.rotateServerCaContext, long + 1); if (error) return "rotateServerCaContext." + error; @@ -121962,13 +125572,15 @@ InstancesRotateServerCaRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesRotateServerCaRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesRotateServerCaRequest(); if (object.rotateServerCaContext != null) { - if (typeof object.rotateServerCaContext !== "object") + if (!$util.isObject(object.rotateServerCaContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesRotateServerCaRequest.rotateServerCaContext: object expected"); message.rotateServerCaContext = $root.google.cloud.sql.v1beta4.RotateServerCaContext.fromObject(object.rotateServerCaContext, long + 1); } @@ -121984,14 +125596,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRotateServerCaRequest.toObject = function toObject(message, options) { + InstancesRotateServerCaRequest.toObject = function toObject(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.rotateServerCaContext = null; - if (message.rotateServerCaContext != null && message.hasOwnProperty("rotateServerCaContext")) - object.rotateServerCaContext = $root.google.cloud.sql.v1beta4.RotateServerCaContext.toObject(message.rotateServerCaContext, options); + if (message.rotateServerCaContext != null && Object.hasOwnProperty.call(message, "rotateServerCaContext")) + object.rotateServerCaContext = $root.google.cloud.sql.v1beta4.RotateServerCaContext.toObject(message.rotateServerCaContext, options, q + 1); return object; }; @@ -122077,11 +125693,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRotateServerCertificateRequest.encode = function encode(message, writer) { + InstancesRotateServerCertificateRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rotateServerCertificateContext != null && Object.hasOwnProperty.call(message, "rotateServerCertificateContext")) - $root.google.cloud.sql.v1beta4.RotateServerCertificateContext.encode(message.rotateServerCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.RotateServerCertificateContext.encode(message.rotateServerCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -122095,7 +125715,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRotateServerCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -122165,7 +125785,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rotateServerCertificateContext != null && message.hasOwnProperty("rotateServerCertificateContext")) { + if (message.rotateServerCertificateContext != null && Object.hasOwnProperty.call(message, "rotateServerCertificateContext")) { var error = $root.google.cloud.sql.v1beta4.RotateServerCertificateContext.verify(message.rotateServerCertificateContext, long + 1); if (error) return "rotateServerCertificateContext." + error; @@ -122184,13 +125804,15 @@ InstancesRotateServerCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest(); if (object.rotateServerCertificateContext != null) { - if (typeof object.rotateServerCertificateContext !== "object") + if (!$util.isObject(object.rotateServerCertificateContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesRotateServerCertificateRequest.rotateServerCertificateContext: object expected"); message.rotateServerCertificateContext = $root.google.cloud.sql.v1beta4.RotateServerCertificateContext.fromObject(object.rotateServerCertificateContext, long + 1); } @@ -122206,14 +125828,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRotateServerCertificateRequest.toObject = function toObject(message, options) { + InstancesRotateServerCertificateRequest.toObject = function toObject(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.rotateServerCertificateContext = null; - if (message.rotateServerCertificateContext != null && message.hasOwnProperty("rotateServerCertificateContext")) - object.rotateServerCertificateContext = $root.google.cloud.sql.v1beta4.RotateServerCertificateContext.toObject(message.rotateServerCertificateContext, options); + if (message.rotateServerCertificateContext != null && Object.hasOwnProperty.call(message, "rotateServerCertificateContext")) + object.rotateServerCertificateContext = $root.google.cloud.sql.v1beta4.RotateServerCertificateContext.toObject(message.rotateServerCertificateContext, options, q + 1); return object; }; @@ -122299,11 +125925,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesRotateEntraIdCertificateRequest.encode = function encode(message, writer) { + InstancesRotateEntraIdCertificateRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rotateEntraIdCertificateContext != null && Object.hasOwnProperty.call(message, "rotateEntraIdCertificateContext")) - $root.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.encode(message.rotateEntraIdCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.encode(message.rotateEntraIdCertificateContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -122317,7 +125947,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesRotateEntraIdCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -122387,7 +126017,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rotateEntraIdCertificateContext != null && message.hasOwnProperty("rotateEntraIdCertificateContext")) { + if (message.rotateEntraIdCertificateContext != null && Object.hasOwnProperty.call(message, "rotateEntraIdCertificateContext")) { var error = $root.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.verify(message.rotateEntraIdCertificateContext, long + 1); if (error) return "rotateEntraIdCertificateContext." + error; @@ -122406,13 +126036,15 @@ InstancesRotateEntraIdCertificateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest(); if (object.rotateEntraIdCertificateContext != null) { - if (typeof object.rotateEntraIdCertificateContext !== "object") + if (!$util.isObject(object.rotateEntraIdCertificateContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesRotateEntraIdCertificateRequest.rotateEntraIdCertificateContext: object expected"); message.rotateEntraIdCertificateContext = $root.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.fromObject(object.rotateEntraIdCertificateContext, long + 1); } @@ -122428,14 +126060,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesRotateEntraIdCertificateRequest.toObject = function toObject(message, options) { + InstancesRotateEntraIdCertificateRequest.toObject = function toObject(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.rotateEntraIdCertificateContext = null; - if (message.rotateEntraIdCertificateContext != null && message.hasOwnProperty("rotateEntraIdCertificateContext")) - object.rotateEntraIdCertificateContext = $root.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.toObject(message.rotateEntraIdCertificateContext, options); + if (message.rotateEntraIdCertificateContext != null && Object.hasOwnProperty.call(message, "rotateEntraIdCertificateContext")) + object.rotateEntraIdCertificateContext = $root.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext.toObject(message.rotateEntraIdCertificateContext, options, q + 1); return object; }; @@ -122521,11 +126157,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesTruncateLogRequest.encode = function encode(message, writer) { + InstancesTruncateLogRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.truncateLogContext != null && Object.hasOwnProperty.call(message, "truncateLogContext")) - $root.google.cloud.sql.v1beta4.TruncateLogContext.encode(message.truncateLogContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.TruncateLogContext.encode(message.truncateLogContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -122539,7 +126179,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesTruncateLogRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -122609,7 +126249,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.truncateLogContext != null && message.hasOwnProperty("truncateLogContext")) { + if (message.truncateLogContext != null && Object.hasOwnProperty.call(message, "truncateLogContext")) { var error = $root.google.cloud.sql.v1beta4.TruncateLogContext.verify(message.truncateLogContext, long + 1); if (error) return "truncateLogContext." + error; @@ -122628,13 +126268,15 @@ InstancesTruncateLogRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesTruncateLogRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesTruncateLogRequest(); if (object.truncateLogContext != null) { - if (typeof object.truncateLogContext !== "object") + if (!$util.isObject(object.truncateLogContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesTruncateLogRequest.truncateLogContext: object expected"); message.truncateLogContext = $root.google.cloud.sql.v1beta4.TruncateLogContext.fromObject(object.truncateLogContext, long + 1); } @@ -122650,14 +126292,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesTruncateLogRequest.toObject = function toObject(message, options) { + InstancesTruncateLogRequest.toObject = function toObject(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.truncateLogContext = null; - if (message.truncateLogContext != null && message.hasOwnProperty("truncateLogContext")) - object.truncateLogContext = $root.google.cloud.sql.v1beta4.TruncateLogContext.toObject(message.truncateLogContext, options); + if (message.truncateLogContext != null && Object.hasOwnProperty.call(message, "truncateLogContext")) + object.truncateLogContext = $root.google.cloud.sql.v1beta4.TruncateLogContext.toObject(message.truncateLogContext, options, q + 1); return object; }; @@ -122743,11 +126389,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InstancesAcquireSsrsLeaseRequest.encode = function encode(message, writer) { + InstancesAcquireSsrsLeaseRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) - $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -122761,7 +126411,7 @@ * @returns {$protobuf.Writer} Writer */ InstancesAcquireSsrsLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -122831,7 +126481,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) { + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) { var error = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.verify(message.acquireSsrsLeaseContext, long + 1); if (error) return "acquireSsrsLeaseContext." + error; @@ -122850,13 +126500,15 @@ InstancesAcquireSsrsLeaseRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest(); if (object.acquireSsrsLeaseContext != null) { - if (typeof object.acquireSsrsLeaseContext !== "object") + if (!$util.isObject(object.acquireSsrsLeaseContext)) throw TypeError(".google.cloud.sql.v1beta4.InstancesAcquireSsrsLeaseRequest.acquireSsrsLeaseContext: object expected"); message.acquireSsrsLeaseContext = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.fromObject(object.acquireSsrsLeaseContext, long + 1); } @@ -122872,14 +126524,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InstancesAcquireSsrsLeaseRequest.toObject = function toObject(message, options) { + InstancesAcquireSsrsLeaseRequest.toObject = function toObject(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.acquireSsrsLeaseContext = null; - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) - object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options); + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) + object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options, q + 1); return object; }; @@ -123092,13 +126748,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PointInTimeRestoreContext.encode = function encode(message, writer) { + PointInTimeRestoreContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.datasource != null && Object.hasOwnProperty.call(message, "datasource")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.datasource); if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) - $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.pointInTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetInstance); if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) @@ -123110,7 +126770,7 @@ if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.preferredSecondaryZone); if (message.targetInstanceSettings != null && Object.hasOwnProperty.call(message, "targetInstanceSettings")) - $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.targetInstanceSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseInstance.encode(message.targetInstanceSettings, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.targetInstanceClearSettingsFieldNames != null && message.targetInstanceClearSettingsFieldNames.length) for (var i = 0; i < message.targetInstanceClearSettingsFieldNames.length; ++i) writer.uint32(/* id 12, wireType 2 =*/98).string(message.targetInstanceClearSettingsFieldNames[i]); @@ -123129,7 +126789,7 @@ * @returns {$protobuf.Writer} Writer */ PointInTimeRestoreContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -123238,54 +126898,54 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.datasource != null && message.hasOwnProperty("datasource")) { + if (message.datasource != null && Object.hasOwnProperty.call(message, "datasource")) { properties._datasource = 1; if (!$util.isString(message.datasource)) return "datasource: string expected"; } - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) { + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) { var error = $root.google.protobuf.Timestamp.verify(message.pointInTime, long + 1); if (error) return "pointInTime." + error; } - if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) { + if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) { properties._targetInstance = 1; if (!$util.isString(message.targetInstance)) return "targetInstance: string expected"; } - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) { + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) { properties._privateNetwork = 1; if (!$util.isString(message.privateNetwork)) return "privateNetwork: string expected"; } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) { + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) { properties._allocatedIpRange = 1; if (!$util.isString(message.allocatedIpRange)) return "allocatedIpRange: string expected"; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { properties._preferredZone = 1; if (!$util.isString(message.preferredZone)) return "preferredZone: string expected"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { properties._preferredSecondaryZone = 1; if (!$util.isString(message.preferredSecondaryZone)) return "preferredSecondaryZone: string expected"; } - if (message.targetInstanceSettings != null && message.hasOwnProperty("targetInstanceSettings")) { + if (message.targetInstanceSettings != null && Object.hasOwnProperty.call(message, "targetInstanceSettings")) { var error = $root.google.cloud.sql.v1beta4.DatabaseInstance.verify(message.targetInstanceSettings, long + 1); if (error) return "targetInstanceSettings." + error; } - if (message.targetInstanceClearSettingsFieldNames != null && message.hasOwnProperty("targetInstanceClearSettingsFieldNames")) { + if (message.targetInstanceClearSettingsFieldNames != null && Object.hasOwnProperty.call(message, "targetInstanceClearSettingsFieldNames")) { if (!Array.isArray(message.targetInstanceClearSettingsFieldNames)) return "targetInstanceClearSettingsFieldNames: array expected"; for (var i = 0; i < message.targetInstanceClearSettingsFieldNames.length; ++i) if (!$util.isString(message.targetInstanceClearSettingsFieldNames[i])) return "targetInstanceClearSettingsFieldNames: string[] expected"; } - if (message.region != null && message.hasOwnProperty("region")) { + if (message.region != null && Object.hasOwnProperty.call(message, "region")) { properties._region = 1; if (!$util.isString(message.region)) return "region: string expected"; @@ -123304,6 +126964,8 @@ PointInTimeRestoreContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PointInTimeRestoreContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PointInTimeRestoreContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -123312,7 +126974,7 @@ if (object.datasource != null) message.datasource = String(object.datasource); if (object.pointInTime != null) { - if (typeof object.pointInTime !== "object") + if (!$util.isObject(object.pointInTime)) throw TypeError(".google.cloud.sql.v1beta4.PointInTimeRestoreContext.pointInTime: object expected"); message.pointInTime = $root.google.protobuf.Timestamp.fromObject(object.pointInTime, long + 1); } @@ -123327,7 +126989,7 @@ if (object.preferredSecondaryZone != null) message.preferredSecondaryZone = String(object.preferredSecondaryZone); if (object.targetInstanceSettings != null) { - if (typeof object.targetInstanceSettings !== "object") + if (!$util.isObject(object.targetInstanceSettings)) throw TypeError(".google.cloud.sql.v1beta4.PointInTimeRestoreContext.targetInstanceSettings: object expected"); message.targetInstanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.fromObject(object.targetInstanceSettings, long + 1); } @@ -123352,9 +127014,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PointInTimeRestoreContext.toObject = function toObject(message, options) { + PointInTimeRestoreContext.toObject = function toObject(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.targetInstanceClearSettingsFieldNames = []; @@ -123362,46 +127028,46 @@ object.pointInTime = null; object.targetInstanceSettings = null; } - if (message.datasource != null && message.hasOwnProperty("datasource")) { + if (message.datasource != null && Object.hasOwnProperty.call(message, "datasource")) { object.datasource = message.datasource; if (options.oneofs) object._datasource = "datasource"; } - if (message.pointInTime != null && message.hasOwnProperty("pointInTime")) - object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options); - if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) { + if (message.pointInTime != null && Object.hasOwnProperty.call(message, "pointInTime")) + object.pointInTime = $root.google.protobuf.Timestamp.toObject(message.pointInTime, options, q + 1); + if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) { object.targetInstance = message.targetInstance; if (options.oneofs) object._targetInstance = "targetInstance"; } - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) { + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) { object.privateNetwork = message.privateNetwork; if (options.oneofs) object._privateNetwork = "privateNetwork"; } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) { + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) { object.allocatedIpRange = message.allocatedIpRange; if (options.oneofs) object._allocatedIpRange = "allocatedIpRange"; } - if (message.preferredZone != null && message.hasOwnProperty("preferredZone")) { + if (message.preferredZone != null && Object.hasOwnProperty.call(message, "preferredZone")) { object.preferredZone = message.preferredZone; if (options.oneofs) object._preferredZone = "preferredZone"; } - if (message.preferredSecondaryZone != null && message.hasOwnProperty("preferredSecondaryZone")) { + if (message.preferredSecondaryZone != null && Object.hasOwnProperty.call(message, "preferredSecondaryZone")) { object.preferredSecondaryZone = message.preferredSecondaryZone; if (options.oneofs) object._preferredSecondaryZone = "preferredSecondaryZone"; } - if (message.targetInstanceSettings != null && message.hasOwnProperty("targetInstanceSettings")) - object.targetInstanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.targetInstanceSettings, options); + if (message.targetInstanceSettings != null && Object.hasOwnProperty.call(message, "targetInstanceSettings")) + object.targetInstanceSettings = $root.google.cloud.sql.v1beta4.DatabaseInstance.toObject(message.targetInstanceSettings, options, q + 1); if (message.targetInstanceClearSettingsFieldNames && message.targetInstanceClearSettingsFieldNames.length) { object.targetInstanceClearSettingsFieldNames = []; for (var j = 0; j < message.targetInstanceClearSettingsFieldNames.length; ++j) object.targetInstanceClearSettingsFieldNames[j] = message.targetInstanceClearSettingsFieldNames[j]; } - if (message.region != null && message.hasOwnProperty("region")) { + if (message.region != null && Object.hasOwnProperty.call(message, "region")) { object.region = message.region; if (options.oneofs) object._region = "region"; @@ -123491,9 +127157,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerformDiskShrinkContext.encode = function encode(message, writer) { + PerformDiskShrinkContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.targetSizeGb != null && Object.hasOwnProperty.call(message, "targetSizeGb")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.targetSizeGb); return writer; @@ -123509,7 +127179,7 @@ * @returns {$protobuf.Writer} Writer */ PerformDiskShrinkContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -123579,7 +127249,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.targetSizeGb != null && message.hasOwnProperty("targetSizeGb")) + if (message.targetSizeGb != null && Object.hasOwnProperty.call(message, "targetSizeGb")) if (!$util.isInteger(message.targetSizeGb) && !(message.targetSizeGb && $util.isInteger(message.targetSizeGb.low) && $util.isInteger(message.targetSizeGb.high))) return "targetSizeGb: integer|Long expected"; return null; @@ -123596,6 +127266,8 @@ PerformDiskShrinkContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PerformDiskShrinkContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -123603,7 +127275,7 @@ var message = new $root.google.cloud.sql.v1beta4.PerformDiskShrinkContext(); if (object.targetSizeGb != null) if ($util.Long) - (message.targetSizeGb = $util.Long.fromValue(object.targetSizeGb)).unsigned = false; + message.targetSizeGb = $util.Long.fromValue(object.targetSizeGb, false); else if (typeof object.targetSizeGb === "string") message.targetSizeGb = parseInt(object.targetSizeGb, 10); else if (typeof object.targetSizeGb === "number") @@ -123622,18 +127294,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PerformDiskShrinkContext.toObject = function toObject(message, options) { + PerformDiskShrinkContext.toObject = function toObject(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.targetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.targetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.targetSizeGb = options.longs === String ? "0" : 0; - if (message.targetSizeGb != null && message.hasOwnProperty("targetSizeGb")) - if (typeof message.targetSizeGb === "number") + object.targetSizeGb = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.targetSizeGb != null && Object.hasOwnProperty.call(message, "targetSizeGb")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.targetSizeGb = typeof message.targetSizeGb === "number" ? BigInt(message.targetSizeGb) : $util.Long.fromBits(message.targetSizeGb.low >>> 0, message.targetSizeGb.high >>> 0, false).toBigInt(); + else if (typeof message.targetSizeGb === "number") object.targetSizeGb = options.longs === String ? String(message.targetSizeGb) : message.targetSizeGb; else object.targetSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.targetSizeGb) : options.longs === Number ? new $util.LongBits(message.targetSizeGb.low >>> 0, message.targetSizeGb.high >>> 0).toNumber() : message.targetSizeGb; @@ -123756,9 +127434,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PreCheckResponse.encode = function encode(message, writer) { + PreCheckResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) @@ -123779,7 +127461,7 @@ * @returns {$protobuf.Writer} Writer */ PreCheckResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -123860,12 +127542,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { properties._message = 1; if (!$util.isString(message.message)) return "message: string expected"; } - if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { properties._messageType = 1; switch (message.messageType) { default: @@ -123877,7 +127559,7 @@ break; } } - if (message.actionsRequired != null && message.hasOwnProperty("actionsRequired")) { + if (message.actionsRequired != null && Object.hasOwnProperty.call(message, "actionsRequired")) { if (!Array.isArray(message.actionsRequired)) return "actionsRequired: array expected"; for (var i = 0; i < message.actionsRequired.length; ++i) @@ -123898,6 +127580,8 @@ PreCheckResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PreCheckResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PreCheckResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -123948,18 +127632,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PreCheckResponse.toObject = function toObject(message, options) { + PreCheckResponse.toObject = function toObject(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.actionsRequired = []; - if (message.message != null && message.hasOwnProperty("message")) { + if (message.message != null && Object.hasOwnProperty.call(message, "message")) { object.message = message.message; if (options.oneofs) object._message = "message"; } - if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) { object.messageType = options.enums === String ? $root.google.cloud.sql.v1beta4.PreCheckResponse.MessageType[message.messageType] === undefined ? message.messageType : $root.google.cloud.sql.v1beta4.PreCheckResponse.MessageType[message.messageType] : message.messageType; if (options.oneofs) object._messageType = "messageType"; @@ -124091,14 +127779,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PreCheckMajorVersionUpgradeContext.encode = function encode(message, writer) { + PreCheckMajorVersionUpgradeContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.targetDatabaseVersion != null && Object.hasOwnProperty.call(message, "targetDatabaseVersion")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.targetDatabaseVersion); if (message.preCheckResponse != null && message.preCheckResponse.length) for (var i = 0; i < message.preCheckResponse.length; ++i) - $root.google.cloud.sql.v1beta4.PreCheckResponse.encode(message.preCheckResponse[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PreCheckResponse.encode(message.preCheckResponse[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.kind); return writer; @@ -124114,7 +127806,7 @@ * @returns {$protobuf.Writer} Writer */ PreCheckMajorVersionUpgradeContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -124194,7 +127886,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.targetDatabaseVersion != null && message.hasOwnProperty("targetDatabaseVersion")) + if (message.targetDatabaseVersion != null && Object.hasOwnProperty.call(message, "targetDatabaseVersion")) switch (message.targetDatabaseVersion) { default: return "targetDatabaseVersion: enum value expected"; @@ -124256,7 +127948,7 @@ case 551: break; } - if (message.preCheckResponse != null && message.hasOwnProperty("preCheckResponse")) { + if (message.preCheckResponse != null && Object.hasOwnProperty.call(message, "preCheckResponse")) { if (!Array.isArray(message.preCheckResponse)) return "preCheckResponse: array expected"; for (var i = 0; i < message.preCheckResponse.length; ++i) { @@ -124265,7 +127957,7 @@ return "preCheckResponse." + error; } } - 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"; return null; @@ -124282,6 +127974,8 @@ PreCheckMajorVersionUpgradeContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -124524,7 +128218,7 @@ throw TypeError(".google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.preCheckResponse: array expected"); message.preCheckResponse = []; for (var i = 0; i < object.preCheckResponse.length; ++i) { - if (typeof object.preCheckResponse[i] !== "object") + if (!$util.isObject(object.preCheckResponse[i])) throw TypeError(".google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.preCheckResponse: object expected"); message.preCheckResponse[i] = $root.google.cloud.sql.v1beta4.PreCheckResponse.fromObject(object.preCheckResponse[i], long + 1); } @@ -124543,9 +128237,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PreCheckMajorVersionUpgradeContext.toObject = function toObject(message, options) { + PreCheckMajorVersionUpgradeContext.toObject = function toObject(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.preCheckResponse = []; @@ -124553,14 +128251,14 @@ object.targetDatabaseVersion = options.enums === String ? "SQL_DATABASE_VERSION_UNSPECIFIED" : 0; object.kind = ""; } - if (message.targetDatabaseVersion != null && message.hasOwnProperty("targetDatabaseVersion")) + if (message.targetDatabaseVersion != null && Object.hasOwnProperty.call(message, "targetDatabaseVersion")) object.targetDatabaseVersion = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.targetDatabaseVersion] === undefined ? message.targetDatabaseVersion : $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.targetDatabaseVersion] : message.targetDatabaseVersion; if (message.preCheckResponse && message.preCheckResponse.length) { object.preCheckResponse = []; for (var j = 0; j < message.preCheckResponse.length; ++j) - object.preCheckResponse[j] = $root.google.cloud.sql.v1beta4.PreCheckResponse.toObject(message.preCheckResponse[j], options); + object.preCheckResponse[j] = $root.google.cloud.sql.v1beta4.PreCheckResponse.toObject(message.preCheckResponse[j], options, q + 1); } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -124665,9 +128363,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesGetDiskShrinkConfigResponse.encode = function encode(message, writer) { + SqlInstancesGetDiskShrinkConfigResponse.encode = function encode(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.minimalTargetSizeGb != null && Object.hasOwnProperty.call(message, "minimalTargetSizeGb")) @@ -124687,7 +128389,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesGetDiskShrinkConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -124765,13 +128467,13 @@ 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.minimalTargetSizeGb != null && message.hasOwnProperty("minimalTargetSizeGb")) + if (message.minimalTargetSizeGb != null && Object.hasOwnProperty.call(message, "minimalTargetSizeGb")) if (!$util.isInteger(message.minimalTargetSizeGb) && !(message.minimalTargetSizeGb && $util.isInteger(message.minimalTargetSizeGb.low) && $util.isInteger(message.minimalTargetSizeGb.high))) return "minimalTargetSizeGb: integer|Long 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; @@ -124788,6 +128490,8 @@ SqlInstancesGetDiskShrinkConfigResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesGetDiskShrinkConfigResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -124797,7 +128501,7 @@ message.kind = String(object.kind); if (object.minimalTargetSizeGb != null) if ($util.Long) - (message.minimalTargetSizeGb = $util.Long.fromValue(object.minimalTargetSizeGb)).unsigned = false; + message.minimalTargetSizeGb = $util.Long.fromValue(object.minimalTargetSizeGb, false); else if (typeof object.minimalTargetSizeGb === "string") message.minimalTargetSizeGb = parseInt(object.minimalTargetSizeGb, 10); else if (typeof object.minimalTargetSizeGb === "number") @@ -124818,27 +128522,33 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesGetDiskShrinkConfigResponse.toObject = function toObject(message, options) { + SqlInstancesGetDiskShrinkConfigResponse.toObject = function toObject(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 = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.minimalTargetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.minimalTargetSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.minimalTargetSizeGb = options.longs === String ? "0" : 0; + object.minimalTargetSizeGb = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.message = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.minimalTargetSizeGb != null && message.hasOwnProperty("minimalTargetSizeGb")) - if (typeof message.minimalTargetSizeGb === "number") + if (message.minimalTargetSizeGb != null && Object.hasOwnProperty.call(message, "minimalTargetSizeGb")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.minimalTargetSizeGb = typeof message.minimalTargetSizeGb === "number" ? BigInt(message.minimalTargetSizeGb) : $util.Long.fromBits(message.minimalTargetSizeGb.low >>> 0, message.minimalTargetSizeGb.high >>> 0, false).toBigInt(); + else if (typeof message.minimalTargetSizeGb === "number") object.minimalTargetSizeGb = options.longs === String ? String(message.minimalTargetSizeGb) : message.minimalTargetSizeGb; else object.minimalTargetSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.minimalTargetSizeGb) : options.longs === Number ? new $util.LongBits(message.minimalTargetSizeGb.low >>> 0, message.minimalTargetSizeGb.high >>> 0).toNumber() : message.minimalTargetSizeGb; - if (message.message != null && message.hasOwnProperty("message")) + if (message.message != null && Object.hasOwnProperty.call(message, "message")) object.message = message.message; return object; }; @@ -124945,17 +128655,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesVerifyExternalSyncSettingsResponse.encode = function encode(message, writer) { + SqlInstancesVerifyExternalSyncSettingsResponse.encode = function encode(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.errors != null && message.errors.length) for (var i = 0; i < message.errors.length; ++i) - $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.warnings != null && message.warnings.length) for (var i = 0; i < message.warnings.length; ++i) - $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.encode(message.warnings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -124969,7 +128683,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesVerifyExternalSyncSettingsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -125051,10 +128765,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.errors != null && message.hasOwnProperty("errors")) { + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { if (!Array.isArray(message.errors)) return "errors: array expected"; for (var i = 0; i < message.errors.length; ++i) { @@ -125063,7 +128777,7 @@ return "errors." + error; } } - if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (message.warnings != null && Object.hasOwnProperty.call(message, "warnings")) { if (!Array.isArray(message.warnings)) return "warnings: array expected"; for (var i = 0; i < message.warnings.length; ++i) { @@ -125086,6 +128800,8 @@ SqlInstancesVerifyExternalSyncSettingsResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -125098,7 +128814,7 @@ throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.errors: array expected"); message.errors = []; for (var i = 0; i < object.errors.length; ++i) { - if (typeof object.errors[i] !== "object") + if (!$util.isObject(object.errors[i])) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.errors: object expected"); message.errors[i] = $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.fromObject(object.errors[i], long + 1); } @@ -125108,7 +128824,7 @@ throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.warnings: array expected"); message.warnings = []; for (var i = 0; i < object.warnings.length; ++i) { - if (typeof object.warnings[i] !== "object") + if (!$util.isObject(object.warnings[i])) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesVerifyExternalSyncSettingsResponse.warnings: object expected"); message.warnings[i] = $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.fromObject(object.warnings[i], long + 1); } @@ -125125,9 +128841,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesVerifyExternalSyncSettingsResponse.toObject = function toObject(message, options) { + SqlInstancesVerifyExternalSyncSettingsResponse.toObject = function toObject(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.errors = []; @@ -125135,17 +128855,17 @@ } if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.errors && message.errors.length) { object.errors = []; for (var j = 0; j < message.errors.length; ++j) - object.errors[j] = $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.toObject(message.errors[j], options); + object.errors[j] = $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.toObject(message.errors[j], options, q + 1); } if (message.warnings && message.warnings.length) { object.warnings = []; for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.toObject(message.warnings[j], options); + object.warnings[j] = $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.toObject(message.warnings[j], options, q + 1); } return object; }; @@ -125250,9 +128970,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlExternalSyncSettingError.encode = function encode(message, writer) { + SqlExternalSyncSettingError.encode = function encode(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.type != null && Object.hasOwnProperty.call(message, "type")) @@ -125272,7 +128996,7 @@ * @returns {$protobuf.Writer} Writer */ SqlExternalSyncSettingError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -125350,10 +129074,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.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) switch (message.type) { default: return "type: enum value expected"; @@ -125418,7 +129142,7 @@ case 58: break; } - 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; @@ -125435,6 +129159,8 @@ SqlExternalSyncSettingError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlExternalSyncSettingError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -125700,20 +129426,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlExternalSyncSettingError.toObject = function toObject(message, options) { + SqlExternalSyncSettingError.toObject = function toObject(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.type = options.enums === String ? "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" : 0; object.detail = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1beta4.SqlExternalSyncSettingError.SqlExternalSyncSettingErrorType[message.type] : message.type; - if (message.detail != null && message.hasOwnProperty("detail")) + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) object.detail = message.detail; return object; }; @@ -126056,26 +129786,30 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IpConfiguration.encode = function encode(message, writer) { + IpConfiguration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.ipv4Enabled != null && Object.hasOwnProperty.call(message, "ipv4Enabled")) - $root.google.protobuf.BoolValue.encode(message.ipv4Enabled, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.ipv4Enabled, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateNetwork); if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) - $root.google.protobuf.BoolValue.encode(message.requireSsl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.requireSsl, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.authorizedNetworks != null && message.authorizedNetworks.length) for (var i = 0; i < message.authorizedNetworks.length; ++i) - $root.google.cloud.sql.v1beta4.AclEntry.encode(message.authorizedNetworks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.AclEntry.encode(message.authorizedNetworks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.allocatedIpRange); if (message.enablePrivatePathForGoogleCloudServices != null && Object.hasOwnProperty.call(message, "enablePrivatePathForGoogleCloudServices")) - $root.google.protobuf.BoolValue.encode(message.enablePrivatePathForGoogleCloudServices, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enablePrivatePathForGoogleCloudServices, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.sslMode); if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) - $root.google.cloud.sql.v1beta4.PscConfig.encode(message.pscConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PscConfig.encode(message.pscConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.serverCaMode); if (message.customSubjectAlternativeNames != null && message.customSubjectAlternativeNames.length) @@ -126098,7 +129832,7 @@ * @returns {$protobuf.Writer} Writer */ IpConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -126217,20 +129951,20 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.ipv4Enabled != null && message.hasOwnProperty("ipv4Enabled")) { + if (message.ipv4Enabled != null && Object.hasOwnProperty.call(message, "ipv4Enabled")) { var error = $root.google.protobuf.BoolValue.verify(message.ipv4Enabled, long + 1); if (error) return "ipv4Enabled." + error; } - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) if (!$util.isString(message.privateNetwork)) return "privateNetwork: string expected"; - if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) { + if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) { var error = $root.google.protobuf.BoolValue.verify(message.requireSsl, long + 1); if (error) return "requireSsl." + error; } - if (message.authorizedNetworks != null && message.hasOwnProperty("authorizedNetworks")) { + if (message.authorizedNetworks != null && Object.hasOwnProperty.call(message, "authorizedNetworks")) { if (!Array.isArray(message.authorizedNetworks)) return "authorizedNetworks: array expected"; for (var i = 0; i < message.authorizedNetworks.length; ++i) { @@ -126239,15 +129973,15 @@ return "authorizedNetworks." + error; } } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) if (!$util.isString(message.allocatedIpRange)) return "allocatedIpRange: string expected"; - if (message.enablePrivatePathForGoogleCloudServices != null && message.hasOwnProperty("enablePrivatePathForGoogleCloudServices")) { + if (message.enablePrivatePathForGoogleCloudServices != null && Object.hasOwnProperty.call(message, "enablePrivatePathForGoogleCloudServices")) { var error = $root.google.protobuf.BoolValue.verify(message.enablePrivatePathForGoogleCloudServices, long + 1); if (error) return "enablePrivatePathForGoogleCloudServices." + error; } - if (message.sslMode != null && message.hasOwnProperty("sslMode")) + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) switch (message.sslMode) { default: return "sslMode: enum value expected"; @@ -126257,7 +129991,7 @@ case 3: break; } - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { + if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) { properties._pscConfig = 1; { var error = $root.google.cloud.sql.v1beta4.PscConfig.verify(message.pscConfig, long + 1); @@ -126265,7 +129999,7 @@ return "pscConfig." + error; } } - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) { + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) { properties._serverCaMode = 1; switch (message.serverCaMode) { default: @@ -126277,19 +130011,19 @@ break; } } - if (message.customSubjectAlternativeNames != null && message.hasOwnProperty("customSubjectAlternativeNames")) { + if (message.customSubjectAlternativeNames != null && Object.hasOwnProperty.call(message, "customSubjectAlternativeNames")) { if (!Array.isArray(message.customSubjectAlternativeNames)) return "customSubjectAlternativeNames: array expected"; for (var i = 0; i < message.customSubjectAlternativeNames.length; ++i) if (!$util.isString(message.customSubjectAlternativeNames[i])) return "customSubjectAlternativeNames: string[] expected"; } - if (message.serverCaPool != null && message.hasOwnProperty("serverCaPool")) { + if (message.serverCaPool != null && Object.hasOwnProperty.call(message, "serverCaPool")) { properties._serverCaPool = 1; if (!$util.isString(message.serverCaPool)) return "serverCaPool: string expected"; } - if (message.serverCertificateRotationMode != null && message.hasOwnProperty("serverCertificateRotationMode")) { + if (message.serverCertificateRotationMode != null && Object.hasOwnProperty.call(message, "serverCertificateRotationMode")) { properties._serverCertificateRotationMode = 1; switch (message.serverCertificateRotationMode) { default: @@ -126314,20 +130048,22 @@ IpConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.IpConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.IpConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.IpConfiguration(); if (object.ipv4Enabled != null) { - if (typeof object.ipv4Enabled !== "object") + if (!$util.isObject(object.ipv4Enabled)) throw TypeError(".google.cloud.sql.v1beta4.IpConfiguration.ipv4Enabled: object expected"); message.ipv4Enabled = $root.google.protobuf.BoolValue.fromObject(object.ipv4Enabled, long + 1); } if (object.privateNetwork != null) message.privateNetwork = String(object.privateNetwork); if (object.requireSsl != null) { - if (typeof object.requireSsl !== "object") + if (!$util.isObject(object.requireSsl)) throw TypeError(".google.cloud.sql.v1beta4.IpConfiguration.requireSsl: object expected"); message.requireSsl = $root.google.protobuf.BoolValue.fromObject(object.requireSsl, long + 1); } @@ -126336,7 +130072,7 @@ throw TypeError(".google.cloud.sql.v1beta4.IpConfiguration.authorizedNetworks: array expected"); message.authorizedNetworks = []; for (var i = 0; i < object.authorizedNetworks.length; ++i) { - if (typeof object.authorizedNetworks[i] !== "object") + if (!$util.isObject(object.authorizedNetworks[i])) throw TypeError(".google.cloud.sql.v1beta4.IpConfiguration.authorizedNetworks: object expected"); message.authorizedNetworks[i] = $root.google.cloud.sql.v1beta4.AclEntry.fromObject(object.authorizedNetworks[i], long + 1); } @@ -126344,7 +130080,7 @@ if (object.allocatedIpRange != null) message.allocatedIpRange = String(object.allocatedIpRange); if (object.enablePrivatePathForGoogleCloudServices != null) { - if (typeof object.enablePrivatePathForGoogleCloudServices !== "object") + if (!$util.isObject(object.enablePrivatePathForGoogleCloudServices)) throw TypeError(".google.cloud.sql.v1beta4.IpConfiguration.enablePrivatePathForGoogleCloudServices: object expected"); message.enablePrivatePathForGoogleCloudServices = $root.google.protobuf.BoolValue.fromObject(object.enablePrivatePathForGoogleCloudServices, long + 1); } @@ -126373,7 +130109,7 @@ break; } if (object.pscConfig != null) { - if (typeof object.pscConfig !== "object") + if (!$util.isObject(object.pscConfig)) throw TypeError(".google.cloud.sql.v1beta4.IpConfiguration.pscConfig: object expected"); message.pscConfig = $root.google.cloud.sql.v1beta4.PscConfig.fromObject(object.pscConfig, long + 1); } @@ -126442,9 +130178,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IpConfiguration.toObject = function toObject(message, options) { + IpConfiguration.toObject = function toObject(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.authorizedNetworks = []; @@ -126458,29 +130198,29 @@ object.enablePrivatePathForGoogleCloudServices = null; object.sslMode = options.enums === String ? "SSL_MODE_UNSPECIFIED" : 0; } - if (message.ipv4Enabled != null && message.hasOwnProperty("ipv4Enabled")) - object.ipv4Enabled = $root.google.protobuf.BoolValue.toObject(message.ipv4Enabled, options); - if (message.privateNetwork != null && message.hasOwnProperty("privateNetwork")) + if (message.ipv4Enabled != null && Object.hasOwnProperty.call(message, "ipv4Enabled")) + object.ipv4Enabled = $root.google.protobuf.BoolValue.toObject(message.ipv4Enabled, options, q + 1); + if (message.privateNetwork != null && Object.hasOwnProperty.call(message, "privateNetwork")) object.privateNetwork = message.privateNetwork; - if (message.requireSsl != null && message.hasOwnProperty("requireSsl")) - object.requireSsl = $root.google.protobuf.BoolValue.toObject(message.requireSsl, options); + if (message.requireSsl != null && Object.hasOwnProperty.call(message, "requireSsl")) + object.requireSsl = $root.google.protobuf.BoolValue.toObject(message.requireSsl, options, q + 1); if (message.authorizedNetworks && message.authorizedNetworks.length) { object.authorizedNetworks = []; for (var j = 0; j < message.authorizedNetworks.length; ++j) - object.authorizedNetworks[j] = $root.google.cloud.sql.v1beta4.AclEntry.toObject(message.authorizedNetworks[j], options); + object.authorizedNetworks[j] = $root.google.cloud.sql.v1beta4.AclEntry.toObject(message.authorizedNetworks[j], options, q + 1); } - if (message.allocatedIpRange != null && message.hasOwnProperty("allocatedIpRange")) + if (message.allocatedIpRange != null && Object.hasOwnProperty.call(message, "allocatedIpRange")) object.allocatedIpRange = message.allocatedIpRange; - if (message.enablePrivatePathForGoogleCloudServices != null && message.hasOwnProperty("enablePrivatePathForGoogleCloudServices")) - object.enablePrivatePathForGoogleCloudServices = $root.google.protobuf.BoolValue.toObject(message.enablePrivatePathForGoogleCloudServices, options); - if (message.sslMode != null && message.hasOwnProperty("sslMode")) + if (message.enablePrivatePathForGoogleCloudServices != null && Object.hasOwnProperty.call(message, "enablePrivatePathForGoogleCloudServices")) + object.enablePrivatePathForGoogleCloudServices = $root.google.protobuf.BoolValue.toObject(message.enablePrivatePathForGoogleCloudServices, options, q + 1); + if (message.sslMode != null && Object.hasOwnProperty.call(message, "sslMode")) object.sslMode = options.enums === String ? $root.google.cloud.sql.v1beta4.IpConfiguration.SslMode[message.sslMode] === undefined ? message.sslMode : $root.google.cloud.sql.v1beta4.IpConfiguration.SslMode[message.sslMode] : message.sslMode; - if (message.pscConfig != null && message.hasOwnProperty("pscConfig")) { - object.pscConfig = $root.google.cloud.sql.v1beta4.PscConfig.toObject(message.pscConfig, options); + if (message.pscConfig != null && Object.hasOwnProperty.call(message, "pscConfig")) { + object.pscConfig = $root.google.cloud.sql.v1beta4.PscConfig.toObject(message.pscConfig, options, q + 1); if (options.oneofs) object._pscConfig = "pscConfig"; } - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) { + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) { object.serverCaMode = options.enums === String ? $root.google.cloud.sql.v1beta4.IpConfiguration.CaMode[message.serverCaMode] === undefined ? message.serverCaMode : $root.google.cloud.sql.v1beta4.IpConfiguration.CaMode[message.serverCaMode] : message.serverCaMode; if (options.oneofs) object._serverCaMode = "serverCaMode"; @@ -126490,12 +130230,12 @@ for (var j = 0; j < message.customSubjectAlternativeNames.length; ++j) object.customSubjectAlternativeNames[j] = message.customSubjectAlternativeNames[j]; } - if (message.serverCaPool != null && message.hasOwnProperty("serverCaPool")) { + if (message.serverCaPool != null && Object.hasOwnProperty.call(message, "serverCaPool")) { object.serverCaPool = message.serverCaPool; if (options.oneofs) object._serverCaPool = "serverCaPool"; } - if (message.serverCertificateRotationMode != null && message.hasOwnProperty("serverCertificateRotationMode")) { + if (message.serverCertificateRotationMode != null && Object.hasOwnProperty.call(message, "serverCertificateRotationMode")) { object.serverCertificateRotationMode = options.enums === String ? $root.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode[message.serverCertificateRotationMode] === undefined ? message.serverCertificateRotationMode : $root.google.cloud.sql.v1beta4.IpConfiguration.ServerCertificateRotationMode[message.serverCertificateRotationMode] : message.serverCertificateRotationMode; if (options.oneofs) object._serverCertificateRotationMode = "serverCertificateRotationMode"; @@ -126720,9 +130460,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PscConfig.encode = function encode(message, writer) { + PscConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pscEnabled); if (message.allowedConsumerProjects != null && message.allowedConsumerProjects.length) @@ -126730,7 +130474,7 @@ writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedConsumerProjects[i]); if (message.pscAutoConnections != null && message.pscAutoConnections.length) for (var i = 0; i < message.pscAutoConnections.length; ++i) - $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.encode(message.pscAutoConnections[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.networkAttachmentUri != null && Object.hasOwnProperty.call(message, "networkAttachmentUri")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.networkAttachmentUri); if (message.pscAutoDnsEnabled != null && Object.hasOwnProperty.call(message, "pscAutoDnsEnabled")) @@ -126752,7 +130496,7 @@ * @returns {$protobuf.Writer} Writer */ PscConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -126851,19 +130595,19 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) { + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) { properties._pscEnabled = 1; if (typeof message.pscEnabled !== "boolean") return "pscEnabled: boolean expected"; } - if (message.allowedConsumerProjects != null && message.hasOwnProperty("allowedConsumerProjects")) { + if (message.allowedConsumerProjects != null && Object.hasOwnProperty.call(message, "allowedConsumerProjects")) { if (!Array.isArray(message.allowedConsumerProjects)) return "allowedConsumerProjects: array expected"; for (var i = 0; i < message.allowedConsumerProjects.length; ++i) if (!$util.isString(message.allowedConsumerProjects[i])) return "allowedConsumerProjects: string[] expected"; } - if (message.pscAutoConnections != null && message.hasOwnProperty("pscAutoConnections")) { + if (message.pscAutoConnections != null && Object.hasOwnProperty.call(message, "pscAutoConnections")) { if (!Array.isArray(message.pscAutoConnections)) return "pscAutoConnections: array expected"; for (var i = 0; i < message.pscAutoConnections.length; ++i) { @@ -126872,20 +130616,20 @@ return "pscAutoConnections." + error; } } - if (message.networkAttachmentUri != null && message.hasOwnProperty("networkAttachmentUri")) + if (message.networkAttachmentUri != null && Object.hasOwnProperty.call(message, "networkAttachmentUri")) if (!$util.isString(message.networkAttachmentUri)) return "networkAttachmentUri: string expected"; - if (message.pscAutoDnsEnabled != null && message.hasOwnProperty("pscAutoDnsEnabled")) { + if (message.pscAutoDnsEnabled != null && Object.hasOwnProperty.call(message, "pscAutoDnsEnabled")) { properties._pscAutoDnsEnabled = 1; if (typeof message.pscAutoDnsEnabled !== "boolean") return "pscAutoDnsEnabled: boolean expected"; } - if (message.pscWriteEndpointDnsEnabled != null && message.hasOwnProperty("pscWriteEndpointDnsEnabled")) { + if (message.pscWriteEndpointDnsEnabled != null && Object.hasOwnProperty.call(message, "pscWriteEndpointDnsEnabled")) { properties._pscWriteEndpointDnsEnabled = 1; if (typeof message.pscWriteEndpointDnsEnabled !== "boolean") return "pscWriteEndpointDnsEnabled: boolean expected"; } - if (message.pscAutoConnectionPolicyEnabled != null && message.hasOwnProperty("pscAutoConnectionPolicyEnabled")) { + if (message.pscAutoConnectionPolicyEnabled != null && Object.hasOwnProperty.call(message, "pscAutoConnectionPolicyEnabled")) { properties._pscAutoConnectionPolicyEnabled = 1; if (typeof message.pscAutoConnectionPolicyEnabled !== "boolean") return "pscAutoConnectionPolicyEnabled: boolean expected"; @@ -126904,6 +130648,8 @@ PscConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PscConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PscConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -126923,7 +130669,7 @@ throw TypeError(".google.cloud.sql.v1beta4.PscConfig.pscAutoConnections: array expected"); message.pscAutoConnections = []; for (var i = 0; i < object.pscAutoConnections.length; ++i) { - if (typeof object.pscAutoConnections[i] !== "object") + if (!$util.isObject(object.pscAutoConnections[i])) throw TypeError(".google.cloud.sql.v1beta4.PscConfig.pscAutoConnections: object expected"); message.pscAutoConnections[i] = $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.fromObject(object.pscAutoConnections[i], long + 1); } @@ -126948,9 +130694,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PscConfig.toObject = function toObject(message, options) { + PscConfig.toObject = function toObject(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.allowedConsumerProjects = []; @@ -126958,7 +130708,7 @@ } if (options.defaults) object.networkAttachmentUri = ""; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) { + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) { object.pscEnabled = message.pscEnabled; if (options.oneofs) object._pscEnabled = "pscEnabled"; @@ -126971,21 +130721,21 @@ if (message.pscAutoConnections && message.pscAutoConnections.length) { object.pscAutoConnections = []; for (var j = 0; j < message.pscAutoConnections.length; ++j) - object.pscAutoConnections[j] = $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options); + object.pscAutoConnections[j] = $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig.toObject(message.pscAutoConnections[j], options, q + 1); } - if (message.networkAttachmentUri != null && message.hasOwnProperty("networkAttachmentUri")) + if (message.networkAttachmentUri != null && Object.hasOwnProperty.call(message, "networkAttachmentUri")) object.networkAttachmentUri = message.networkAttachmentUri; - if (message.pscAutoDnsEnabled != null && message.hasOwnProperty("pscAutoDnsEnabled")) { + if (message.pscAutoDnsEnabled != null && Object.hasOwnProperty.call(message, "pscAutoDnsEnabled")) { object.pscAutoDnsEnabled = message.pscAutoDnsEnabled; if (options.oneofs) object._pscAutoDnsEnabled = "pscAutoDnsEnabled"; } - if (message.pscWriteEndpointDnsEnabled != null && message.hasOwnProperty("pscWriteEndpointDnsEnabled")) { + if (message.pscWriteEndpointDnsEnabled != null && Object.hasOwnProperty.call(message, "pscWriteEndpointDnsEnabled")) { object.pscWriteEndpointDnsEnabled = message.pscWriteEndpointDnsEnabled; if (options.oneofs) object._pscWriteEndpointDnsEnabled = "pscWriteEndpointDnsEnabled"; } - if (message.pscAutoConnectionPolicyEnabled != null && message.hasOwnProperty("pscAutoConnectionPolicyEnabled")) { + if (message.pscAutoConnectionPolicyEnabled != null && Object.hasOwnProperty.call(message, "pscAutoConnectionPolicyEnabled")) { object.pscAutoConnectionPolicyEnabled = message.pscAutoConnectionPolicyEnabled; if (options.oneofs) object._pscAutoConnectionPolicyEnabled = "pscAutoConnectionPolicyEnabled"; @@ -127210,9 +130960,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PscAutoConnectionConfig.encode = function encode(message, writer) { + PscAutoConnectionConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.consumerProject); if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) @@ -127244,7 +130998,7 @@ * @returns {$protobuf.Writer} Writer */ PscAutoConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -127347,38 +131101,38 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) if (!$util.isString(message.consumerProject)) return "consumerProject: string expected"; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) if (!$util.isString(message.consumerNetwork)) return "consumerNetwork: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) { properties._ipAddress = 1; if (!$util.isString(message.ipAddress)) return "ipAddress: string expected"; } - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { properties._status = 1; if (!$util.isString(message.status)) return "status: string expected"; } - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) { + if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) { properties._consumerNetworkStatus = 1; if (!$util.isString(message.consumerNetworkStatus)) return "consumerNetworkStatus: string expected"; } - if (message.serviceConnectionPolicy != null && message.hasOwnProperty("serviceConnectionPolicy")) { + if (message.serviceConnectionPolicy != null && Object.hasOwnProperty.call(message, "serviceConnectionPolicy")) { properties._serviceConnectionPolicy = 1; if (!$util.isString(message.serviceConnectionPolicy)) return "serviceConnectionPolicy: string expected"; } - if (message.serviceConnectionPolicyCreationResult != null && message.hasOwnProperty("serviceConnectionPolicyCreationResult")) { + if (message.serviceConnectionPolicyCreationResult != null && Object.hasOwnProperty.call(message, "serviceConnectionPolicyCreationResult")) { properties._serviceConnectionPolicyCreationResult = 1; if (!$util.isString(message.serviceConnectionPolicyCreationResult)) return "serviceConnectionPolicyCreationResult: string expected"; } - if (message.instanceAutoDnsStatus != null && message.hasOwnProperty("instanceAutoDnsStatus")) { + if (message.instanceAutoDnsStatus != null && Object.hasOwnProperty.call(message, "instanceAutoDnsStatus")) { properties._instanceAutoDnsStatus = 1; switch (message.instanceAutoDnsStatus) { default: @@ -127390,7 +131144,7 @@ break; } } - if (message.writeEndpointAutoDnsStatus != null && message.hasOwnProperty("writeEndpointAutoDnsStatus")) { + if (message.writeEndpointAutoDnsStatus != null && Object.hasOwnProperty.call(message, "writeEndpointAutoDnsStatus")) { properties._writeEndpointAutoDnsStatus = 1; switch (message.writeEndpointAutoDnsStatus) { default: @@ -127416,6 +131170,8 @@ PscAutoConnectionConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PscAutoConnectionConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PscAutoConnectionConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -127495,49 +131251,53 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PscAutoConnectionConfig.toObject = function toObject(message, options) { + PscAutoConnectionConfig.toObject = function toObject(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.consumerProject = ""; object.consumerNetwork = ""; } - if (message.consumerProject != null && message.hasOwnProperty("consumerProject")) + if (message.consumerProject != null && Object.hasOwnProperty.call(message, "consumerProject")) object.consumerProject = message.consumerProject; - if (message.consumerNetwork != null && message.hasOwnProperty("consumerNetwork")) + if (message.consumerNetwork != null && Object.hasOwnProperty.call(message, "consumerNetwork")) object.consumerNetwork = message.consumerNetwork; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) { object.ipAddress = message.ipAddress; if (options.oneofs) object._ipAddress = "ipAddress"; } - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { object.status = message.status; if (options.oneofs) object._status = "status"; } - if (message.consumerNetworkStatus != null && message.hasOwnProperty("consumerNetworkStatus")) { + if (message.consumerNetworkStatus != null && Object.hasOwnProperty.call(message, "consumerNetworkStatus")) { object.consumerNetworkStatus = message.consumerNetworkStatus; if (options.oneofs) object._consumerNetworkStatus = "consumerNetworkStatus"; } - if (message.serviceConnectionPolicy != null && message.hasOwnProperty("serviceConnectionPolicy")) { + if (message.serviceConnectionPolicy != null && Object.hasOwnProperty.call(message, "serviceConnectionPolicy")) { object.serviceConnectionPolicy = message.serviceConnectionPolicy; if (options.oneofs) object._serviceConnectionPolicy = "serviceConnectionPolicy"; } - if (message.serviceConnectionPolicyCreationResult != null && message.hasOwnProperty("serviceConnectionPolicyCreationResult")) { + if (message.serviceConnectionPolicyCreationResult != null && Object.hasOwnProperty.call(message, "serviceConnectionPolicyCreationResult")) { object.serviceConnectionPolicyCreationResult = message.serviceConnectionPolicyCreationResult; if (options.oneofs) object._serviceConnectionPolicyCreationResult = "serviceConnectionPolicyCreationResult"; } - if (message.instanceAutoDnsStatus != null && message.hasOwnProperty("instanceAutoDnsStatus")) { + if (message.instanceAutoDnsStatus != null && Object.hasOwnProperty.call(message, "instanceAutoDnsStatus")) { object.instanceAutoDnsStatus = options.enums === String ? $root.google.cloud.sql.v1beta4.AutoDnsStatus[message.instanceAutoDnsStatus] === undefined ? message.instanceAutoDnsStatus : $root.google.cloud.sql.v1beta4.AutoDnsStatus[message.instanceAutoDnsStatus] : message.instanceAutoDnsStatus; if (options.oneofs) object._instanceAutoDnsStatus = "instanceAutoDnsStatus"; } - if (message.writeEndpointAutoDnsStatus != null && message.hasOwnProperty("writeEndpointAutoDnsStatus")) { + if (message.writeEndpointAutoDnsStatus != null && Object.hasOwnProperty.call(message, "writeEndpointAutoDnsStatus")) { object.writeEndpointAutoDnsStatus = options.enums === String ? $root.google.cloud.sql.v1beta4.AutoDnsStatus[message.writeEndpointAutoDnsStatus] === undefined ? message.writeEndpointAutoDnsStatus : $root.google.cloud.sql.v1beta4.AutoDnsStatus[message.writeEndpointAutoDnsStatus] : message.writeEndpointAutoDnsStatus; if (options.oneofs) object._writeEndpointAutoDnsStatus = "writeEndpointAutoDnsStatus"; @@ -127645,15 +131405,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IpMapping.encode = function encode(message, writer) { + IpMapping.encode = function encode(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 0 =*/8).int32(message.type); if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAddress); if (message.timeToRetire != null && Object.hasOwnProperty.call(message, "timeToRetire")) - $root.google.protobuf.Timestamp.encode(message.timeToRetire, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.timeToRetire, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -127667,7 +131431,7 @@ * @returns {$protobuf.Writer} Writer */ IpMapping.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -127745,7 +131509,7 @@ 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")) switch (message.type) { default: return "type: enum value expected"; @@ -127756,10 +131520,10 @@ case 4: break; } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) if (!$util.isString(message.ipAddress)) return "ipAddress: string expected"; - if (message.timeToRetire != null && message.hasOwnProperty("timeToRetire")) { + if (message.timeToRetire != null && Object.hasOwnProperty.call(message, "timeToRetire")) { var error = $root.google.protobuf.Timestamp.verify(message.timeToRetire, long + 1); if (error) return "timeToRetire." + error; @@ -127778,6 +131542,8 @@ IpMapping.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.IpMapping) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.IpMapping: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -127814,7 +131580,7 @@ if (object.ipAddress != null) message.ipAddress = String(object.ipAddress); if (object.timeToRetire != null) { - if (typeof object.timeToRetire !== "object") + if (!$util.isObject(object.timeToRetire)) throw TypeError(".google.cloud.sql.v1beta4.IpMapping.timeToRetire: object expected"); message.timeToRetire = $root.google.protobuf.Timestamp.fromObject(object.timeToRetire, long + 1); } @@ -127830,21 +131596,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IpMapping.toObject = function toObject(message, options) { + IpMapping.toObject = function toObject(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 = options.enums === String ? "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" : 0; object.ipAddress = ""; object.timeToRetire = null; } - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlIpAddressType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1beta4.SqlIpAddressType[message.type] : message.type; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) object.ipAddress = message.ipAddress; - if (message.timeToRetire != null && message.hasOwnProperty("timeToRetire")) - object.timeToRetire = $root.google.protobuf.Timestamp.toObject(message.timeToRetire, options); + if (message.timeToRetire != null && Object.hasOwnProperty.call(message, "timeToRetire")) + object.timeToRetire = $root.google.protobuf.Timestamp.toObject(message.timeToRetire, options, q + 1); return object; }; @@ -127957,9 +131727,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocationPreference.encode = function encode(message, writer) { + LocationPreference.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.followGaeApplication != null && Object.hasOwnProperty.call(message, "followGaeApplication")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.followGaeApplication); if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) @@ -127981,7 +131755,7 @@ * @returns {$protobuf.Writer} Writer */ LocationPreference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -128063,16 +131837,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.followGaeApplication != null && message.hasOwnProperty("followGaeApplication")) + if (message.followGaeApplication != null && Object.hasOwnProperty.call(message, "followGaeApplication")) if (!$util.isString(message.followGaeApplication)) return "followGaeApplication: string expected"; - if (message.zone != null && message.hasOwnProperty("zone")) + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) if (!$util.isString(message.zone)) return "zone: string expected"; - if (message.secondaryZone != null && message.hasOwnProperty("secondaryZone")) + if (message.secondaryZone != null && Object.hasOwnProperty.call(message, "secondaryZone")) if (!$util.isString(message.secondaryZone)) return "secondaryZone: string expected"; - 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"; return null; @@ -128089,6 +131863,8 @@ LocationPreference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.LocationPreference) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.LocationPreference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -128114,9 +131890,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LocationPreference.toObject = function toObject(message, options) { + LocationPreference.toObject = function toObject(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.followGaeApplication = ""; @@ -128124,13 +131904,13 @@ object.kind = ""; object.secondaryZone = ""; } - if (message.followGaeApplication != null && message.hasOwnProperty("followGaeApplication")) + if (message.followGaeApplication != null && Object.hasOwnProperty.call(message, "followGaeApplication")) object.followGaeApplication = message.followGaeApplication; - if (message.zone != null && message.hasOwnProperty("zone")) + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) object.zone = message.zone; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.secondaryZone != null && message.hasOwnProperty("secondaryZone")) + if (message.secondaryZone != null && Object.hasOwnProperty.call(message, "secondaryZone")) object.secondaryZone = message.secondaryZone; return object; }; @@ -128244,13 +132024,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MaintenanceWindow.encode = function encode(message, writer) { + MaintenanceWindow.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) - $root.google.protobuf.Int32Value.encode(message.hour, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.hour, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.day != null && Object.hasOwnProperty.call(message, "day")) - $root.google.protobuf.Int32Value.encode(message.day, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.day, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.updateTrack != null && Object.hasOwnProperty.call(message, "updateTrack")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.updateTrack); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -128268,7 +132052,7 @@ * @returns {$protobuf.Writer} Writer */ MaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -128350,17 +132134,17 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.hour != null && message.hasOwnProperty("hour")) { + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) { var error = $root.google.protobuf.Int32Value.verify(message.hour, long + 1); if (error) return "hour." + error; } - if (message.day != null && message.hasOwnProperty("day")) { + if (message.day != null && Object.hasOwnProperty.call(message, "day")) { var error = $root.google.protobuf.Int32Value.verify(message.day, long + 1); if (error) return "day." + error; } - if (message.updateTrack != null && message.hasOwnProperty("updateTrack")) + if (message.updateTrack != null && Object.hasOwnProperty.call(message, "updateTrack")) switch (message.updateTrack) { default: return "updateTrack: enum value expected"; @@ -128370,7 +132154,7 @@ case 3: break; } - 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"; return null; @@ -128387,18 +132171,20 @@ MaintenanceWindow.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.MaintenanceWindow) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.MaintenanceWindow: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.MaintenanceWindow(); if (object.hour != null) { - if (typeof object.hour !== "object") + if (!$util.isObject(object.hour)) throw TypeError(".google.cloud.sql.v1beta4.MaintenanceWindow.hour: object expected"); message.hour = $root.google.protobuf.Int32Value.fromObject(object.hour, long + 1); } if (object.day != null) { - if (typeof object.day !== "object") + if (!$util.isObject(object.day)) throw TypeError(".google.cloud.sql.v1beta4.MaintenanceWindow.day: object expected"); message.day = $root.google.protobuf.Int32Value.fromObject(object.day, long + 1); } @@ -128440,9 +132226,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MaintenanceWindow.toObject = function toObject(message, options) { + MaintenanceWindow.toObject = function toObject(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.hour = null; @@ -128450,13 +132240,13 @@ object.updateTrack = options.enums === String ? "SQL_UPDATE_TRACK_UNSPECIFIED" : 0; object.kind = ""; } - if (message.hour != null && message.hasOwnProperty("hour")) - object.hour = $root.google.protobuf.Int32Value.toObject(message.hour, options); - if (message.day != null && message.hasOwnProperty("day")) - object.day = $root.google.protobuf.Int32Value.toObject(message.day, options); - if (message.updateTrack != null && message.hasOwnProperty("updateTrack")) + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) + object.hour = $root.google.protobuf.Int32Value.toObject(message.hour, options, q + 1); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + object.day = $root.google.protobuf.Int32Value.toObject(message.day, options, q + 1); + if (message.updateTrack != null && Object.hasOwnProperty.call(message, "updateTrack")) object.updateTrack = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlUpdateTrack[message.updateTrack] === undefined ? message.updateTrack : $root.google.cloud.sql.v1beta4.SqlUpdateTrack[message.updateTrack] : message.updateTrack; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -128561,9 +132351,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DenyMaintenancePeriod.encode = function encode(message, writer) { + DenyMaintenancePeriod.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.startDate); if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) @@ -128583,7 +132377,7 @@ * @returns {$protobuf.Writer} Writer */ DenyMaintenancePeriod.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -128661,13 +132455,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.startDate != null && message.hasOwnProperty("startDate")) + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) if (!$util.isString(message.startDate)) return "startDate: string expected"; - if (message.endDate != null && message.hasOwnProperty("endDate")) + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) if (!$util.isString(message.endDate)) return "endDate: string expected"; - if (message.time != null && message.hasOwnProperty("time")) + if (message.time != null && Object.hasOwnProperty.call(message, "time")) if (!$util.isString(message.time)) return "time: string expected"; return null; @@ -128684,6 +132478,8 @@ DenyMaintenancePeriod.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DenyMaintenancePeriod) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DenyMaintenancePeriod: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -128707,20 +132503,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DenyMaintenancePeriod.toObject = function toObject(message, options) { + DenyMaintenancePeriod.toObject = function toObject(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.startDate = ""; object.endDate = ""; object.time = ""; } - if (message.startDate != null && message.hasOwnProperty("startDate")) + if (message.startDate != null && Object.hasOwnProperty.call(message, "startDate")) object.startDate = message.startDate; - if (message.endDate != null && message.hasOwnProperty("endDate")) + if (message.endDate != null && Object.hasOwnProperty.call(message, "endDate")) object.endDate = message.endDate; - if (message.time != null && message.hasOwnProperty("time")) + if (message.time != null && Object.hasOwnProperty.call(message, "time")) object.time = message.time; return object; }; @@ -128852,9 +132652,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InsightsConfig.encode = function encode(message, writer) { + InsightsConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.queryInsightsEnabled != null && Object.hasOwnProperty.call(message, "queryInsightsEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.queryInsightsEnabled); if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) @@ -128862,11 +132666,11 @@ if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.recordApplicationTags); if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) - $root.google.protobuf.Int32Value.encode(message.queryStringLength, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.queryStringLength, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) - $root.google.protobuf.Int32Value.encode(message.queryPlansPerMinute, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.queryPlansPerMinute, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.enhancedQueryInsightsEnabled != null && Object.hasOwnProperty.call(message, "enhancedQueryInsightsEnabled")) - $root.google.protobuf.BoolValue.encode(message.enhancedQueryInsightsEnabled, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enhancedQueryInsightsEnabled, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); return writer; }; @@ -128880,7 +132684,7 @@ * @returns {$protobuf.Writer} Writer */ InsightsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -128970,26 +132774,26 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.queryInsightsEnabled != null && message.hasOwnProperty("queryInsightsEnabled")) + if (message.queryInsightsEnabled != null && Object.hasOwnProperty.call(message, "queryInsightsEnabled")) if (typeof message.queryInsightsEnabled !== "boolean") return "queryInsightsEnabled: boolean expected"; - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) if (typeof message.recordClientAddress !== "boolean") return "recordClientAddress: boolean expected"; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) if (typeof message.recordApplicationTags !== "boolean") return "recordApplicationTags: boolean expected"; - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) { + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) { var error = $root.google.protobuf.Int32Value.verify(message.queryStringLength, long + 1); if (error) return "queryStringLength." + error; } - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) { + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) { var error = $root.google.protobuf.Int32Value.verify(message.queryPlansPerMinute, long + 1); if (error) return "queryPlansPerMinute." + error; } - if (message.enhancedQueryInsightsEnabled != null && message.hasOwnProperty("enhancedQueryInsightsEnabled")) { + if (message.enhancedQueryInsightsEnabled != null && Object.hasOwnProperty.call(message, "enhancedQueryInsightsEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.enhancedQueryInsightsEnabled, long + 1); if (error) return "enhancedQueryInsightsEnabled." + error; @@ -129008,6 +132812,8 @@ InsightsConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.InsightsConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.InsightsConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -129020,17 +132826,17 @@ if (object.recordApplicationTags != null) message.recordApplicationTags = Boolean(object.recordApplicationTags); if (object.queryStringLength != null) { - if (typeof object.queryStringLength !== "object") + if (!$util.isObject(object.queryStringLength)) throw TypeError(".google.cloud.sql.v1beta4.InsightsConfig.queryStringLength: object expected"); message.queryStringLength = $root.google.protobuf.Int32Value.fromObject(object.queryStringLength, long + 1); } if (object.queryPlansPerMinute != null) { - if (typeof object.queryPlansPerMinute !== "object") + if (!$util.isObject(object.queryPlansPerMinute)) throw TypeError(".google.cloud.sql.v1beta4.InsightsConfig.queryPlansPerMinute: object expected"); message.queryPlansPerMinute = $root.google.protobuf.Int32Value.fromObject(object.queryPlansPerMinute, long + 1); } if (object.enhancedQueryInsightsEnabled != null) { - if (typeof object.enhancedQueryInsightsEnabled !== "object") + if (!$util.isObject(object.enhancedQueryInsightsEnabled)) throw TypeError(".google.cloud.sql.v1beta4.InsightsConfig.enhancedQueryInsightsEnabled: object expected"); message.enhancedQueryInsightsEnabled = $root.google.protobuf.BoolValue.fromObject(object.enhancedQueryInsightsEnabled, long + 1); } @@ -129046,9 +132852,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InsightsConfig.toObject = function toObject(message, options) { + InsightsConfig.toObject = function toObject(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.queryInsightsEnabled = false; @@ -129058,18 +132868,18 @@ object.queryPlansPerMinute = null; object.enhancedQueryInsightsEnabled = null; } - if (message.queryInsightsEnabled != null && message.hasOwnProperty("queryInsightsEnabled")) + if (message.queryInsightsEnabled != null && Object.hasOwnProperty.call(message, "queryInsightsEnabled")) object.queryInsightsEnabled = message.queryInsightsEnabled; - if (message.recordClientAddress != null && message.hasOwnProperty("recordClientAddress")) + if (message.recordClientAddress != null && Object.hasOwnProperty.call(message, "recordClientAddress")) object.recordClientAddress = message.recordClientAddress; - if (message.recordApplicationTags != null && message.hasOwnProperty("recordApplicationTags")) + if (message.recordApplicationTags != null && Object.hasOwnProperty.call(message, "recordApplicationTags")) object.recordApplicationTags = message.recordApplicationTags; - if (message.queryStringLength != null && message.hasOwnProperty("queryStringLength")) - object.queryStringLength = $root.google.protobuf.Int32Value.toObject(message.queryStringLength, options); - if (message.queryPlansPerMinute != null && message.hasOwnProperty("queryPlansPerMinute")) - object.queryPlansPerMinute = $root.google.protobuf.Int32Value.toObject(message.queryPlansPerMinute, options); - if (message.enhancedQueryInsightsEnabled != null && message.hasOwnProperty("enhancedQueryInsightsEnabled")) - object.enhancedQueryInsightsEnabled = $root.google.protobuf.BoolValue.toObject(message.enhancedQueryInsightsEnabled, options); + if (message.queryStringLength != null && Object.hasOwnProperty.call(message, "queryStringLength")) + object.queryStringLength = $root.google.protobuf.Int32Value.toObject(message.queryStringLength, options, q + 1); + if (message.queryPlansPerMinute != null && Object.hasOwnProperty.call(message, "queryPlansPerMinute")) + object.queryPlansPerMinute = $root.google.protobuf.Int32Value.toObject(message.queryPlansPerMinute, options, q + 1); + if (message.enhancedQueryInsightsEnabled != null && Object.hasOwnProperty.call(message, "enhancedQueryInsightsEnabled")) + object.enhancedQueryInsightsEnabled = $root.google.protobuf.BoolValue.toObject(message.enhancedQueryInsightsEnabled, options, q + 1); return object; }; @@ -129245,9 +133055,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MySqlReplicaConfiguration.encode = function encode(message, writer) { + MySqlReplicaConfiguration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dumpFilePath); if (message.username != null && Object.hasOwnProperty.call(message, "username")) @@ -129255,9 +133069,9 @@ if (message.password != null && Object.hasOwnProperty.call(message, "password")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.password); if (message.connectRetryInterval != null && Object.hasOwnProperty.call(message, "connectRetryInterval")) - $root.google.protobuf.Int32Value.encode(message.connectRetryInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.connectRetryInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.masterHeartbeatPeriod != null && Object.hasOwnProperty.call(message, "masterHeartbeatPeriod")) - $root.google.protobuf.Int64Value.encode(message.masterHeartbeatPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.masterHeartbeatPeriod, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.caCertificate); if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) @@ -129267,7 +133081,7 @@ if (message.sslCipher != null && Object.hasOwnProperty.call(message, "sslCipher")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.sslCipher); if (message.verifyServerCertificate != null && Object.hasOwnProperty.call(message, "verifyServerCertificate")) - $root.google.protobuf.BoolValue.encode(message.verifyServerCertificate, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.verifyServerCertificate, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.kind); return writer; @@ -129283,7 +133097,7 @@ * @returns {$protobuf.Writer} Writer */ MySqlReplicaConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -129393,43 +133207,43 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) if (!$util.isString(message.dumpFilePath)) return "dumpFilePath: string expected"; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) if (!$util.isString(message.username)) return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: string expected"; - if (message.connectRetryInterval != null && message.hasOwnProperty("connectRetryInterval")) { + if (message.connectRetryInterval != null && Object.hasOwnProperty.call(message, "connectRetryInterval")) { var error = $root.google.protobuf.Int32Value.verify(message.connectRetryInterval, long + 1); if (error) return "connectRetryInterval." + error; } - if (message.masterHeartbeatPeriod != null && message.hasOwnProperty("masterHeartbeatPeriod")) { + if (message.masterHeartbeatPeriod != null && Object.hasOwnProperty.call(message, "masterHeartbeatPeriod")) { var error = $root.google.protobuf.Int64Value.verify(message.masterHeartbeatPeriod, long + 1); if (error) return "masterHeartbeatPeriod." + error; } - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) if (!$util.isString(message.caCertificate)) return "caCertificate: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) if (!$util.isString(message.clientCertificate)) return "clientCertificate: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) if (!$util.isString(message.clientKey)) return "clientKey: string expected"; - if (message.sslCipher != null && message.hasOwnProperty("sslCipher")) + if (message.sslCipher != null && Object.hasOwnProperty.call(message, "sslCipher")) if (!$util.isString(message.sslCipher)) return "sslCipher: string expected"; - if (message.verifyServerCertificate != null && message.hasOwnProperty("verifyServerCertificate")) { + if (message.verifyServerCertificate != null && Object.hasOwnProperty.call(message, "verifyServerCertificate")) { var error = $root.google.protobuf.BoolValue.verify(message.verifyServerCertificate, long + 1); if (error) return "verifyServerCertificate." + error; } - 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"; return null; @@ -129446,6 +133260,8 @@ MySqlReplicaConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.MySqlReplicaConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.MySqlReplicaConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -129458,12 +133274,12 @@ if (object.password != null) message.password = String(object.password); if (object.connectRetryInterval != null) { - if (typeof object.connectRetryInterval !== "object") + if (!$util.isObject(object.connectRetryInterval)) throw TypeError(".google.cloud.sql.v1beta4.MySqlReplicaConfiguration.connectRetryInterval: object expected"); message.connectRetryInterval = $root.google.protobuf.Int32Value.fromObject(object.connectRetryInterval, long + 1); } if (object.masterHeartbeatPeriod != null) { - if (typeof object.masterHeartbeatPeriod !== "object") + if (!$util.isObject(object.masterHeartbeatPeriod)) throw TypeError(".google.cloud.sql.v1beta4.MySqlReplicaConfiguration.masterHeartbeatPeriod: object expected"); message.masterHeartbeatPeriod = $root.google.protobuf.Int64Value.fromObject(object.masterHeartbeatPeriod, long + 1); } @@ -129476,7 +133292,7 @@ if (object.sslCipher != null) message.sslCipher = String(object.sslCipher); if (object.verifyServerCertificate != null) { - if (typeof object.verifyServerCertificate !== "object") + if (!$util.isObject(object.verifyServerCertificate)) throw TypeError(".google.cloud.sql.v1beta4.MySqlReplicaConfiguration.verifyServerCertificate: object expected"); message.verifyServerCertificate = $root.google.protobuf.BoolValue.fromObject(object.verifyServerCertificate, long + 1); } @@ -129494,9 +133310,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MySqlReplicaConfiguration.toObject = function toObject(message, options) { + MySqlReplicaConfiguration.toObject = function toObject(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.dumpFilePath = ""; @@ -129511,27 +133331,27 @@ object.verifyServerCertificate = null; object.kind = ""; } - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) object.dumpFilePath = message.dumpFilePath; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.connectRetryInterval != null && message.hasOwnProperty("connectRetryInterval")) - object.connectRetryInterval = $root.google.protobuf.Int32Value.toObject(message.connectRetryInterval, options); - if (message.masterHeartbeatPeriod != null && message.hasOwnProperty("masterHeartbeatPeriod")) - object.masterHeartbeatPeriod = $root.google.protobuf.Int64Value.toObject(message.masterHeartbeatPeriod, options); - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.connectRetryInterval != null && Object.hasOwnProperty.call(message, "connectRetryInterval")) + object.connectRetryInterval = $root.google.protobuf.Int32Value.toObject(message.connectRetryInterval, options, q + 1); + if (message.masterHeartbeatPeriod != null && Object.hasOwnProperty.call(message, "masterHeartbeatPeriod")) + object.masterHeartbeatPeriod = $root.google.protobuf.Int64Value.toObject(message.masterHeartbeatPeriod, options, q + 1); + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) object.caCertificate = message.caCertificate; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) object.clientCertificate = message.clientCertificate; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) object.clientKey = message.clientKey; - if (message.sslCipher != null && message.hasOwnProperty("sslCipher")) + if (message.sslCipher != null && Object.hasOwnProperty.call(message, "sslCipher")) object.sslCipher = message.sslCipher; - if (message.verifyServerCertificate != null && message.hasOwnProperty("verifyServerCertificate")) - object.verifyServerCertificate = $root.google.protobuf.BoolValue.toObject(message.verifyServerCertificate, options); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.verifyServerCertificate != null && Object.hasOwnProperty.call(message, "verifyServerCertificate")) + object.verifyServerCertificate = $root.google.protobuf.BoolValue.toObject(message.verifyServerCertificate, options, q + 1); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -129618,9 +133438,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SelectedObjects.encode = function encode(message, writer) { + SelectedObjects.encode = function encode(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; @@ -129636,7 +133460,7 @@ * @returns {$protobuf.Writer} Writer */ SelectedObjects.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -129706,7 +133530,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; @@ -129723,6 +133547,8 @@ SelectedObjects.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SelectedObjects) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SelectedObjects: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -129742,13 +133568,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SelectedObjects.toObject = function toObject(message, options) { + SelectedObjects.toObject = function toObject(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; }; @@ -129926,9 +133756,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OnPremisesConfiguration.encode = function encode(message, writer) { + OnPremisesConfiguration.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostPort); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -129946,10 +133780,10 @@ if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.dumpFilePath); if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) - $root.google.cloud.sql.v1beta4.InstanceReference.encode(message.sourceInstance, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InstanceReference.encode(message.sourceInstance, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim(); if (message.selectedObjects != null && message.selectedObjects.length) for (var i = 0; i < message.selectedObjects.length; ++i) - $root.google.cloud.sql.v1beta4.SelectedObjects.encode(message.selectedObjects[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SelectedObjects.encode(message.selectedObjects[i], writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); if (message.sslOption != null && Object.hasOwnProperty.call(message, "sslOption")) writer.uint32(/* id 18, wireType 0 =*/144).int32(message.sslOption); return writer; @@ -129965,7 +133799,7 @@ * @returns {$protobuf.Writer} Writer */ OnPremisesConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -130077,36 +133911,36 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) if (!$util.isString(message.hostPort)) return "hostPort: string expected"; - 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.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) if (!$util.isString(message.username)) return "username: string expected"; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: string expected"; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) if (!$util.isString(message.caCertificate)) return "caCertificate: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) if (!$util.isString(message.clientCertificate)) return "clientCertificate: string expected"; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) if (!$util.isString(message.clientKey)) return "clientKey: string expected"; - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) if (!$util.isString(message.dumpFilePath)) return "dumpFilePath: string expected"; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) { var error = $root.google.cloud.sql.v1beta4.InstanceReference.verify(message.sourceInstance, long + 1); if (error) return "sourceInstance." + error; } - if (message.selectedObjects != null && message.hasOwnProperty("selectedObjects")) { + if (message.selectedObjects != null && Object.hasOwnProperty.call(message, "selectedObjects")) { if (!Array.isArray(message.selectedObjects)) return "selectedObjects: array expected"; for (var i = 0; i < message.selectedObjects.length; ++i) { @@ -130115,7 +133949,7 @@ return "selectedObjects." + error; } } - if (message.sslOption != null && message.hasOwnProperty("sslOption")) + if (message.sslOption != null && Object.hasOwnProperty.call(message, "sslOption")) switch (message.sslOption) { default: return "sslOption: enum value expected"; @@ -130139,6 +133973,8 @@ OnPremisesConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.OnPremisesConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.OnPremisesConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -130161,7 +133997,7 @@ if (object.dumpFilePath != null) message.dumpFilePath = String(object.dumpFilePath); if (object.sourceInstance != null) { - if (typeof object.sourceInstance !== "object") + if (!$util.isObject(object.sourceInstance)) throw TypeError(".google.cloud.sql.v1beta4.OnPremisesConfiguration.sourceInstance: object expected"); message.sourceInstance = $root.google.cloud.sql.v1beta4.InstanceReference.fromObject(object.sourceInstance, long + 1); } @@ -130170,7 +134006,7 @@ throw TypeError(".google.cloud.sql.v1beta4.OnPremisesConfiguration.selectedObjects: array expected"); message.selectedObjects = []; for (var i = 0; i < object.selectedObjects.length; ++i) { - if (typeof object.selectedObjects[i] !== "object") + if (!$util.isObject(object.selectedObjects[i])) throw TypeError(".google.cloud.sql.v1beta4.OnPremisesConfiguration.selectedObjects: object expected"); message.selectedObjects[i] = $root.google.cloud.sql.v1beta4.SelectedObjects.fromObject(object.selectedObjects[i], long + 1); } @@ -130211,9 +134047,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OnPremisesConfiguration.toObject = function toObject(message, options) { + OnPremisesConfiguration.toObject = function toObject(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.selectedObjects = []; @@ -130229,30 +134069,30 @@ object.sourceInstance = null; object.sslOption = options.enums === String ? "SSL_OPTION_UNSPECIFIED" : 0; } - if (message.hostPort != null && message.hasOwnProperty("hostPort")) + if (message.hostPort != null && Object.hasOwnProperty.call(message, "hostPort")) object.hostPort = message.hostPort; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.username != null && message.hasOwnProperty("username")) + if (message.username != null && Object.hasOwnProperty.call(message, "username")) object.username = message.username; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.caCertificate != null && message.hasOwnProperty("caCertificate")) + if (message.caCertificate != null && Object.hasOwnProperty.call(message, "caCertificate")) object.caCertificate = message.caCertificate; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) object.clientCertificate = message.clientCertificate; - if (message.clientKey != null && message.hasOwnProperty("clientKey")) + if (message.clientKey != null && Object.hasOwnProperty.call(message, "clientKey")) object.clientKey = message.clientKey; - if (message.dumpFilePath != null && message.hasOwnProperty("dumpFilePath")) + if (message.dumpFilePath != null && Object.hasOwnProperty.call(message, "dumpFilePath")) object.dumpFilePath = message.dumpFilePath; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) - object.sourceInstance = $root.google.cloud.sql.v1beta4.InstanceReference.toObject(message.sourceInstance, options); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + object.sourceInstance = $root.google.cloud.sql.v1beta4.InstanceReference.toObject(message.sourceInstance, options, q + 1); if (message.selectedObjects && message.selectedObjects.length) { object.selectedObjects = []; for (var j = 0; j < message.selectedObjects.length; ++j) - object.selectedObjects[j] = $root.google.cloud.sql.v1beta4.SelectedObjects.toObject(message.selectedObjects[j], options); + object.selectedObjects[j] = $root.google.cloud.sql.v1beta4.SelectedObjects.toObject(message.selectedObjects[j], options, q + 1); } - if (message.sslOption != null && message.hasOwnProperty("sslOption")) + if (message.sslOption != null && Object.hasOwnProperty.call(message, "sslOption")) object.sslOption = options.enums === String ? $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption[message.sslOption] === undefined ? message.sslOption : $root.google.cloud.sql.v1beta4.OnPremisesConfiguration.SslOption[message.sslOption] : message.sslOption; return object; }; @@ -130366,9 +134206,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiskEncryptionConfiguration.encode = function encode(message, writer) { + DiskEncryptionConfiguration.encode = function encode(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 1, wireType 2 =*/10).string(message.kmsKeyName); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -130386,7 +134230,7 @@ * @returns {$protobuf.Writer} Writer */ DiskEncryptionConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -130460,10 +134304,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.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) if (!$util.isString(message.kind)) return "kind: string expected"; return null; @@ -130480,6 +134324,8 @@ DiskEncryptionConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DiskEncryptionConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DiskEncryptionConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -130501,17 +134347,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DiskEncryptionConfiguration.toObject = function toObject(message, options) { + DiskEncryptionConfiguration.toObject = function toObject(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.kmsKeyName = ""; object.kind = ""; } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) object.kmsKeyName = message.kmsKeyName; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -130607,9 +134457,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiskEncryptionStatus.encode = function encode(message, writer) { + DiskEncryptionStatus.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyVersionName); if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) @@ -130627,7 +134481,7 @@ * @returns {$protobuf.Writer} Writer */ DiskEncryptionStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -130701,10 +134555,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) if (!$util.isString(message.kmsKeyVersionName)) return "kmsKeyVersionName: string expected"; - 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"; return null; @@ -130721,6 +134575,8 @@ DiskEncryptionStatus.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DiskEncryptionStatus) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DiskEncryptionStatus: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -130742,17 +134598,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DiskEncryptionStatus.toObject = function toObject(message, options) { + DiskEncryptionStatus.toObject = function toObject(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.kmsKeyVersionName = ""; object.kind = ""; } - if (message.kmsKeyVersionName != null && message.hasOwnProperty("kmsKeyVersionName")) + if (message.kmsKeyVersionName != null && Object.hasOwnProperty.call(message, "kmsKeyVersionName")) object.kmsKeyVersionName = message.kmsKeyVersionName; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; return object; }; @@ -130873,9 +134733,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlSubOperationType.encode = function encode(message, writer) { + SqlSubOperationType.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.maintenanceType != null && Object.hasOwnProperty.call(message, "maintenanceType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maintenanceType); return writer; @@ -130891,7 +134755,7 @@ * @returns {$protobuf.Writer} Writer */ SqlSubOperationType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -130962,7 +134826,7 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.maintenanceType != null && message.hasOwnProperty("maintenanceType")) { + if (message.maintenanceType != null && Object.hasOwnProperty.call(message, "maintenanceType")) { properties.subOperationDetails = 1; switch (message.maintenanceType) { default: @@ -130989,6 +134853,8 @@ SqlSubOperationType.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlSubOperationType) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlSubOperationType: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -131034,11 +134900,15 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlSubOperationType.toObject = function toObject(message, options) { + SqlSubOperationType.toObject = function 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.maintenanceType != null && message.hasOwnProperty("maintenanceType")) { + if (message.maintenanceType != null && Object.hasOwnProperty.call(message, "maintenanceType")) { object.maintenanceType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlMaintenanceType[message.maintenanceType] === undefined ? message.maintenanceType : $root.google.cloud.sql.v1beta4.SqlMaintenanceType[message.maintenanceType] : message.maintenanceType; if (options.oneofs) object.subOperationDetails = "maintenanceType"; @@ -131299,9 +135169,13 @@ * @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.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); if (message.targetLink != null && Object.hasOwnProperty.call(message, "targetLink")) @@ -131311,19 +135185,19 @@ if (message.user != null && Object.hasOwnProperty.call(message, "user")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.user); if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) - $root.google.protobuf.Timestamp.encode(message.insertTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.insertTime, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.cloud.sql.v1beta4.OperationErrors.encode(message.error, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.OperationErrors.encode(message.error, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.operationType); if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) - $root.google.cloud.sql.v1beta4.ImportContext.encode(message.importContext, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ImportContext.encode(message.importContext, writer.uint32(/* id 10, wireType 2 =*/82).fork(), q + 1).ldelim(); if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) - $root.google.cloud.sql.v1beta4.ExportContext.encode(message.exportContext, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ExportContext.encode(message.exportContext, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.name); if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) @@ -131333,15 +135207,15 @@ if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) writer.uint32(/* id 15, wireType 2 =*/122).string(message.targetProject); if (message.backupContext != null && Object.hasOwnProperty.call(message, "backupContext")) - $root.google.cloud.sql.v1beta4.BackupContext.encode(message.backupContext, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.BackupContext.encode(message.backupContext, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.apiWarning != null && Object.hasOwnProperty.call(message, "apiWarning")) - $root.google.cloud.sql.v1beta4.ApiWarning.encode(message.apiWarning, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ApiWarning.encode(message.apiWarning, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) - $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.encode(message.acquireSsrsLeaseContext, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); if (message.subOperationType != null && Object.hasOwnProperty.call(message, "subOperationType")) - $root.google.cloud.sql.v1beta4.SqlSubOperationType.encode(message.subOperationType, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlSubOperationType.encode(message.subOperationType, writer.uint32(/* id 48, wireType 2 =*/386).fork(), q + 1).ldelim(); if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) - $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.encode(message.preCheckMajorVersionUpgradeContext, writer.uint32(/* id 50, wireType 2 =*/402).fork(), q + 1).ldelim(); return writer; }; @@ -131355,7 +135229,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(); }; /** @@ -131501,13 +135375,13 @@ 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.targetLink != null && message.hasOwnProperty("targetLink")) + if (message.targetLink != null && Object.hasOwnProperty.call(message, "targetLink")) if (!$util.isString(message.targetLink)) return "targetLink: string expected"; - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) switch (message.status) { default: return "status: enum value expected"; @@ -131517,35 +135391,35 @@ case 3: break; } - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) if (!$util.isString(message.user)) return "user: string expected"; - if (message.insertTime != null && message.hasOwnProperty("insertTime")) { + if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) { var error = $root.google.protobuf.Timestamp.verify(message.insertTime, long + 1); if (error) return "insertTime." + 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.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.error != null && message.hasOwnProperty("error")) { + if (message.error != null && Object.hasOwnProperty.call(message, "error")) { var error = $root.google.cloud.sql.v1beta4.OperationErrors.verify(message.error, long + 1); if (error) return "error." + error; } - if (message.apiWarning != null && message.hasOwnProperty("apiWarning")) { + if (message.apiWarning != null && Object.hasOwnProperty.call(message, "apiWarning")) { var error = $root.google.cloud.sql.v1beta4.ApiWarning.verify(message.apiWarning, long + 1); if (error) return "apiWarning." + error; } - if (message.operationType != null && message.hasOwnProperty("operationType")) + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) switch (message.operationType) { default: return "operationType: enum value expected"; @@ -131606,44 +135480,44 @@ case 59: break; } - if (message.importContext != null && message.hasOwnProperty("importContext")) { + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) { var error = $root.google.cloud.sql.v1beta4.ImportContext.verify(message.importContext, long + 1); if (error) return "importContext." + error; } - if (message.exportContext != null && message.hasOwnProperty("exportContext")) { + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) { var error = $root.google.cloud.sql.v1beta4.ExportContext.verify(message.exportContext, long + 1); if (error) return "exportContext." + error; } - if (message.backupContext != null && message.hasOwnProperty("backupContext")) { + if (message.backupContext != null && Object.hasOwnProperty.call(message, "backupContext")) { var error = $root.google.cloud.sql.v1beta4.BackupContext.verify(message.backupContext, long + 1); if (error) return "backupContext." + error; } - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) { + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) { var error = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.verify(message.preCheckMajorVersionUpgradeContext, long + 1); if (error) return "preCheckMajorVersionUpgradeContext." + 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.targetId != null && message.hasOwnProperty("targetId")) + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) if (!$util.isString(message.targetId)) return "targetId: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; - if (message.targetProject != null && message.hasOwnProperty("targetProject")) + if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) if (!$util.isString(message.targetProject)) return "targetProject: string expected"; - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) { + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) { var error = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.verify(message.acquireSsrsLeaseContext, long + 1); if (error) return "acquireSsrsLeaseContext." + error; } - if (message.subOperationType != null && message.hasOwnProperty("subOperationType")) { + if (message.subOperationType != null && Object.hasOwnProperty.call(message, "subOperationType")) { var error = $root.google.cloud.sql.v1beta4.SqlSubOperationType.verify(message.subOperationType, long + 1); if (error) return "subOperationType." + error; @@ -131662,6 +135536,8 @@ Operation.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Operation) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Operation: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -131698,27 +135574,27 @@ if (object.user != null) message.user = String(object.user); if (object.insertTime != null) { - if (typeof object.insertTime !== "object") + if (!$util.isObject(object.insertTime)) throw TypeError(".google.cloud.sql.v1beta4.Operation.insertTime: object expected"); message.insertTime = $root.google.protobuf.Timestamp.fromObject(object.insertTime, long + 1); } if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.cloud.sql.v1beta4.Operation.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.cloud.sql.v1beta4.Operation.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } if (object.error != null) { - if (typeof object.error !== "object") + if (!$util.isObject(object.error)) throw TypeError(".google.cloud.sql.v1beta4.Operation.error: object expected"); message.error = $root.google.cloud.sql.v1beta4.OperationErrors.fromObject(object.error, long + 1); } if (object.apiWarning != null) { - if (typeof object.apiWarning !== "object") + if (!$util.isObject(object.apiWarning)) throw TypeError(".google.cloud.sql.v1beta4.Operation.apiWarning: object expected"); message.apiWarning = $root.google.cloud.sql.v1beta4.ApiWarning.fromObject(object.apiWarning, long + 1); } @@ -131951,22 +135827,22 @@ break; } if (object.importContext != null) { - if (typeof object.importContext !== "object") + if (!$util.isObject(object.importContext)) throw TypeError(".google.cloud.sql.v1beta4.Operation.importContext: object expected"); message.importContext = $root.google.cloud.sql.v1beta4.ImportContext.fromObject(object.importContext, long + 1); } if (object.exportContext != null) { - if (typeof object.exportContext !== "object") + if (!$util.isObject(object.exportContext)) throw TypeError(".google.cloud.sql.v1beta4.Operation.exportContext: object expected"); message.exportContext = $root.google.cloud.sql.v1beta4.ExportContext.fromObject(object.exportContext, long + 1); } if (object.backupContext != null) { - if (typeof object.backupContext !== "object") + if (!$util.isObject(object.backupContext)) throw TypeError(".google.cloud.sql.v1beta4.Operation.backupContext: object expected"); message.backupContext = $root.google.cloud.sql.v1beta4.BackupContext.fromObject(object.backupContext, long + 1); } if (object.preCheckMajorVersionUpgradeContext != null) { - if (typeof object.preCheckMajorVersionUpgradeContext !== "object") + if (!$util.isObject(object.preCheckMajorVersionUpgradeContext)) throw TypeError(".google.cloud.sql.v1beta4.Operation.preCheckMajorVersionUpgradeContext: object expected"); message.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.fromObject(object.preCheckMajorVersionUpgradeContext, long + 1); } @@ -131979,12 +135855,12 @@ if (object.targetProject != null) message.targetProject = String(object.targetProject); if (object.acquireSsrsLeaseContext != null) { - if (typeof object.acquireSsrsLeaseContext !== "object") + if (!$util.isObject(object.acquireSsrsLeaseContext)) throw TypeError(".google.cloud.sql.v1beta4.Operation.acquireSsrsLeaseContext: object expected"); message.acquireSsrsLeaseContext = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.fromObject(object.acquireSsrsLeaseContext, long + 1); } if (object.subOperationType != null) { - if (typeof object.subOperationType !== "object") + if (!$util.isObject(object.subOperationType)) throw TypeError(".google.cloud.sql.v1beta4.Operation.subOperationType: object expected"); message.subOperationType = $root.google.cloud.sql.v1beta4.SqlSubOperationType.fromObject(object.subOperationType, long + 1); } @@ -132000,9 +135876,13 @@ * @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.kind = ""; @@ -132026,46 +135906,46 @@ object.subOperationType = null; object.preCheckMajorVersionUpgradeContext = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.targetLink != null && message.hasOwnProperty("targetLink")) + if (message.targetLink != null && Object.hasOwnProperty.call(message, "targetLink")) object.targetLink = message.targetLink; - if (message.status != null && message.hasOwnProperty("status")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) object.status = options.enums === String ? $root.google.cloud.sql.v1beta4.Operation.SqlOperationStatus[message.status] === undefined ? message.status : $root.google.cloud.sql.v1beta4.Operation.SqlOperationStatus[message.status] : message.status; - if (message.user != null && message.hasOwnProperty("user")) + if (message.user != null && Object.hasOwnProperty.call(message, "user")) object.user = message.user; - if (message.insertTime != null && message.hasOwnProperty("insertTime")) - object.insertTime = $root.google.protobuf.Timestamp.toObject(message.insertTime, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.error != null && message.hasOwnProperty("error")) - object.error = $root.google.cloud.sql.v1beta4.OperationErrors.toObject(message.error, options); - if (message.operationType != null && message.hasOwnProperty("operationType")) + if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) + object.insertTime = $root.google.protobuf.Timestamp.toObject(message.insertTime, 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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options, q + 1); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + object.error = $root.google.cloud.sql.v1beta4.OperationErrors.toObject(message.error, options, q + 1); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) object.operationType = options.enums === String ? $root.google.cloud.sql.v1beta4.Operation.SqlOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.sql.v1beta4.Operation.SqlOperationType[message.operationType] : message.operationType; - if (message.importContext != null && message.hasOwnProperty("importContext")) - object.importContext = $root.google.cloud.sql.v1beta4.ImportContext.toObject(message.importContext, options); - if (message.exportContext != null && message.hasOwnProperty("exportContext")) - object.exportContext = $root.google.cloud.sql.v1beta4.ExportContext.toObject(message.exportContext, options); - if (message.name != null && message.hasOwnProperty("name")) + if (message.importContext != null && Object.hasOwnProperty.call(message, "importContext")) + object.importContext = $root.google.cloud.sql.v1beta4.ImportContext.toObject(message.importContext, options, q + 1); + if (message.exportContext != null && Object.hasOwnProperty.call(message, "exportContext")) + object.exportContext = $root.google.cloud.sql.v1beta4.ExportContext.toObject(message.exportContext, options, q + 1); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.targetId != null && message.hasOwnProperty("targetId")) + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) object.targetId = message.targetId; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; - if (message.targetProject != null && message.hasOwnProperty("targetProject")) + if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) object.targetProject = message.targetProject; - if (message.backupContext != null && message.hasOwnProperty("backupContext")) - object.backupContext = $root.google.cloud.sql.v1beta4.BackupContext.toObject(message.backupContext, options); - if (message.apiWarning != null && message.hasOwnProperty("apiWarning")) - object.apiWarning = $root.google.cloud.sql.v1beta4.ApiWarning.toObject(message.apiWarning, options); - if (message.acquireSsrsLeaseContext != null && message.hasOwnProperty("acquireSsrsLeaseContext")) - object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options); - if (message.subOperationType != null && message.hasOwnProperty("subOperationType")) - object.subOperationType = $root.google.cloud.sql.v1beta4.SqlSubOperationType.toObject(message.subOperationType, options); - if (message.preCheckMajorVersionUpgradeContext != null && message.hasOwnProperty("preCheckMajorVersionUpgradeContext")) - object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options); + if (message.backupContext != null && Object.hasOwnProperty.call(message, "backupContext")) + object.backupContext = $root.google.cloud.sql.v1beta4.BackupContext.toObject(message.backupContext, options, q + 1); + if (message.apiWarning != null && Object.hasOwnProperty.call(message, "apiWarning")) + object.apiWarning = $root.google.cloud.sql.v1beta4.ApiWarning.toObject(message.apiWarning, options, q + 1); + if (message.acquireSsrsLeaseContext != null && Object.hasOwnProperty.call(message, "acquireSsrsLeaseContext")) + object.acquireSsrsLeaseContext = $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.toObject(message.acquireSsrsLeaseContext, options, q + 1); + if (message.subOperationType != null && Object.hasOwnProperty.call(message, "subOperationType")) + object.subOperationType = $root.google.cloud.sql.v1beta4.SqlSubOperationType.toObject(message.subOperationType, options, q + 1); + if (message.preCheckMajorVersionUpgradeContext != null && Object.hasOwnProperty.call(message, "preCheckMajorVersionUpgradeContext")) + object.preCheckMajorVersionUpgradeContext = $root.google.cloud.sql.v1beta4.PreCheckMajorVersionUpgradeContext.toObject(message.preCheckMajorVersionUpgradeContext, options, q + 1); return object; }; @@ -132307,9 +136187,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationError.encode = function encode(message, writer) { + OperationError.encode = function encode(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.code != null && Object.hasOwnProperty.call(message, "code")) @@ -132329,7 +136213,7 @@ * @returns {$protobuf.Writer} Writer */ OperationError.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -132407,13 +136291,13 @@ 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.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) if (!$util.isString(message.code)) return "code: 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; @@ -132430,6 +136314,8 @@ OperationError.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.OperationError) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.OperationError: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -132453,20 +136339,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationError.toObject = function toObject(message, options) { + OperationError.toObject = function toObject(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.code = ""; object.message = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - 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; return object; }; @@ -132563,14 +136453,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationErrors.encode = function encode(message, writer) { + OperationErrors.encode = function encode(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.errors != null && message.errors.length) for (var i = 0; i < message.errors.length; ++i) - $root.google.cloud.sql.v1beta4.OperationError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.OperationError.encode(message.errors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -132584,7 +136478,7 @@ * @returns {$protobuf.Writer} Writer */ OperationErrors.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -132660,10 +136554,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.errors != null && message.hasOwnProperty("errors")) { + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) { if (!Array.isArray(message.errors)) return "errors: array expected"; for (var i = 0; i < message.errors.length; ++i) { @@ -132686,6 +136580,8 @@ OperationErrors.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.OperationErrors) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.OperationErrors: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -132698,7 +136594,7 @@ throw TypeError(".google.cloud.sql.v1beta4.OperationErrors.errors: array expected"); message.errors = []; for (var i = 0; i < object.errors.length; ++i) { - if (typeof object.errors[i] !== "object") + if (!$util.isObject(object.errors[i])) throw TypeError(".google.cloud.sql.v1beta4.OperationErrors.errors: object expected"); message.errors[i] = $root.google.cloud.sql.v1beta4.OperationError.fromObject(object.errors[i], long + 1); } @@ -132715,20 +136611,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationErrors.toObject = function toObject(message, options) { + OperationErrors.toObject = function toObject(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.errors = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.errors && message.errors.length) { object.errors = []; for (var j = 0; j < message.errors.length; ++j) - object.errors[j] = $root.google.cloud.sql.v1beta4.OperationError.toObject(message.errors[j], options); + object.errors[j] = $root.google.cloud.sql.v1beta4.OperationError.toObject(message.errors[j], options, q + 1); } return object; }; @@ -132869,23 +136769,27 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PasswordValidationPolicy.encode = function encode(message, writer) { + PasswordValidationPolicy.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.minLength != null && Object.hasOwnProperty.call(message, "minLength")) - $root.google.protobuf.Int32Value.encode(message.minLength, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.minLength, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.complexity != null && Object.hasOwnProperty.call(message, "complexity")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.complexity); if (message.reuseInterval != null && Object.hasOwnProperty.call(message, "reuseInterval")) - $root.google.protobuf.Int32Value.encode(message.reuseInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.reuseInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.disallowUsernameSubstring != null && Object.hasOwnProperty.call(message, "disallowUsernameSubstring")) - $root.google.protobuf.BoolValue.encode(message.disallowUsernameSubstring, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.disallowUsernameSubstring, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.passwordChangeInterval != null && Object.hasOwnProperty.call(message, "passwordChangeInterval")) - $root.google.protobuf.Duration.encode(message.passwordChangeInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.passwordChangeInterval, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.enablePasswordPolicy != null && Object.hasOwnProperty.call(message, "enablePasswordPolicy")) - $root.google.protobuf.BoolValue.encode(message.enablePasswordPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enablePasswordPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.disallowCompromisedCredentials != null && Object.hasOwnProperty.call(message, "disallowCompromisedCredentials")) - $root.google.protobuf.BoolValue.encode(message.disallowCompromisedCredentials, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.disallowCompromisedCredentials, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -132899,7 +136803,7 @@ * @returns {$protobuf.Writer} Writer */ PasswordValidationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -132993,12 +136897,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.minLength != null && message.hasOwnProperty("minLength")) { + if (message.minLength != null && Object.hasOwnProperty.call(message, "minLength")) { var error = $root.google.protobuf.Int32Value.verify(message.minLength, long + 1); if (error) return "minLength." + error; } - if (message.complexity != null && message.hasOwnProperty("complexity")) + if (message.complexity != null && Object.hasOwnProperty.call(message, "complexity")) switch (message.complexity) { default: return "complexity: enum value expected"; @@ -133006,27 +136910,27 @@ case 1: break; } - if (message.reuseInterval != null && message.hasOwnProperty("reuseInterval")) { + if (message.reuseInterval != null && Object.hasOwnProperty.call(message, "reuseInterval")) { var error = $root.google.protobuf.Int32Value.verify(message.reuseInterval, long + 1); if (error) return "reuseInterval." + error; } - if (message.disallowUsernameSubstring != null && message.hasOwnProperty("disallowUsernameSubstring")) { + if (message.disallowUsernameSubstring != null && Object.hasOwnProperty.call(message, "disallowUsernameSubstring")) { var error = $root.google.protobuf.BoolValue.verify(message.disallowUsernameSubstring, long + 1); if (error) return "disallowUsernameSubstring." + error; } - if (message.passwordChangeInterval != null && message.hasOwnProperty("passwordChangeInterval")) { + if (message.passwordChangeInterval != null && Object.hasOwnProperty.call(message, "passwordChangeInterval")) { var error = $root.google.protobuf.Duration.verify(message.passwordChangeInterval, long + 1); if (error) return "passwordChangeInterval." + error; } - if (message.enablePasswordPolicy != null && message.hasOwnProperty("enablePasswordPolicy")) { + if (message.enablePasswordPolicy != null && Object.hasOwnProperty.call(message, "enablePasswordPolicy")) { var error = $root.google.protobuf.BoolValue.verify(message.enablePasswordPolicy, long + 1); if (error) return "enablePasswordPolicy." + error; } - if (message.disallowCompromisedCredentials != null && message.hasOwnProperty("disallowCompromisedCredentials")) { + if (message.disallowCompromisedCredentials != null && Object.hasOwnProperty.call(message, "disallowCompromisedCredentials")) { var error = $root.google.protobuf.BoolValue.verify(message.disallowCompromisedCredentials, long + 1); if (error) return "disallowCompromisedCredentials." + error; @@ -133045,13 +136949,15 @@ PasswordValidationPolicy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PasswordValidationPolicy) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PasswordValidationPolicy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.PasswordValidationPolicy(); if (object.minLength != null) { - if (typeof object.minLength !== "object") + if (!$util.isObject(object.minLength)) throw TypeError(".google.cloud.sql.v1beta4.PasswordValidationPolicy.minLength: object expected"); message.minLength = $root.google.protobuf.Int32Value.fromObject(object.minLength, long + 1); } @@ -133072,27 +136978,27 @@ break; } if (object.reuseInterval != null) { - if (typeof object.reuseInterval !== "object") + if (!$util.isObject(object.reuseInterval)) throw TypeError(".google.cloud.sql.v1beta4.PasswordValidationPolicy.reuseInterval: object expected"); message.reuseInterval = $root.google.protobuf.Int32Value.fromObject(object.reuseInterval, long + 1); } if (object.disallowUsernameSubstring != null) { - if (typeof object.disallowUsernameSubstring !== "object") + if (!$util.isObject(object.disallowUsernameSubstring)) throw TypeError(".google.cloud.sql.v1beta4.PasswordValidationPolicy.disallowUsernameSubstring: object expected"); message.disallowUsernameSubstring = $root.google.protobuf.BoolValue.fromObject(object.disallowUsernameSubstring, long + 1); } if (object.passwordChangeInterval != null) { - if (typeof object.passwordChangeInterval !== "object") + if (!$util.isObject(object.passwordChangeInterval)) throw TypeError(".google.cloud.sql.v1beta4.PasswordValidationPolicy.passwordChangeInterval: object expected"); message.passwordChangeInterval = $root.google.protobuf.Duration.fromObject(object.passwordChangeInterval, long + 1); } if (object.enablePasswordPolicy != null) { - if (typeof object.enablePasswordPolicy !== "object") + if (!$util.isObject(object.enablePasswordPolicy)) throw TypeError(".google.cloud.sql.v1beta4.PasswordValidationPolicy.enablePasswordPolicy: object expected"); message.enablePasswordPolicy = $root.google.protobuf.BoolValue.fromObject(object.enablePasswordPolicy, long + 1); } if (object.disallowCompromisedCredentials != null) { - if (typeof object.disallowCompromisedCredentials !== "object") + if (!$util.isObject(object.disallowCompromisedCredentials)) throw TypeError(".google.cloud.sql.v1beta4.PasswordValidationPolicy.disallowCompromisedCredentials: object expected"); message.disallowCompromisedCredentials = $root.google.protobuf.BoolValue.fromObject(object.disallowCompromisedCredentials, long + 1); } @@ -133108,9 +137014,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PasswordValidationPolicy.toObject = function toObject(message, options) { + PasswordValidationPolicy.toObject = function toObject(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.minLength = null; @@ -133121,20 +137031,20 @@ object.enablePasswordPolicy = null; object.disallowCompromisedCredentials = null; } - if (message.minLength != null && message.hasOwnProperty("minLength")) - object.minLength = $root.google.protobuf.Int32Value.toObject(message.minLength, options); - if (message.complexity != null && message.hasOwnProperty("complexity")) + if (message.minLength != null && Object.hasOwnProperty.call(message, "minLength")) + object.minLength = $root.google.protobuf.Int32Value.toObject(message.minLength, options, q + 1); + if (message.complexity != null && Object.hasOwnProperty.call(message, "complexity")) object.complexity = options.enums === String ? $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity[message.complexity] === undefined ? message.complexity : $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.Complexity[message.complexity] : message.complexity; - if (message.reuseInterval != null && message.hasOwnProperty("reuseInterval")) - object.reuseInterval = $root.google.protobuf.Int32Value.toObject(message.reuseInterval, options); - if (message.disallowUsernameSubstring != null && message.hasOwnProperty("disallowUsernameSubstring")) - object.disallowUsernameSubstring = $root.google.protobuf.BoolValue.toObject(message.disallowUsernameSubstring, options); - if (message.passwordChangeInterval != null && message.hasOwnProperty("passwordChangeInterval")) - object.passwordChangeInterval = $root.google.protobuf.Duration.toObject(message.passwordChangeInterval, options); - if (message.enablePasswordPolicy != null && message.hasOwnProperty("enablePasswordPolicy")) - object.enablePasswordPolicy = $root.google.protobuf.BoolValue.toObject(message.enablePasswordPolicy, options); - if (message.disallowCompromisedCredentials != null && message.hasOwnProperty("disallowCompromisedCredentials")) - object.disallowCompromisedCredentials = $root.google.protobuf.BoolValue.toObject(message.disallowCompromisedCredentials, options); + if (message.reuseInterval != null && Object.hasOwnProperty.call(message, "reuseInterval")) + object.reuseInterval = $root.google.protobuf.Int32Value.toObject(message.reuseInterval, options, q + 1); + if (message.disallowUsernameSubstring != null && Object.hasOwnProperty.call(message, "disallowUsernameSubstring")) + object.disallowUsernameSubstring = $root.google.protobuf.BoolValue.toObject(message.disallowUsernameSubstring, options, q + 1); + if (message.passwordChangeInterval != null && Object.hasOwnProperty.call(message, "passwordChangeInterval")) + object.passwordChangeInterval = $root.google.protobuf.Duration.toObject(message.passwordChangeInterval, options, q + 1); + if (message.enablePasswordPolicy != null && Object.hasOwnProperty.call(message, "enablePasswordPolicy")) + object.enablePasswordPolicy = $root.google.protobuf.BoolValue.toObject(message.enablePasswordPolicy, options, q + 1); + if (message.disallowCompromisedCredentials != null && Object.hasOwnProperty.call(message, "disallowCompromisedCredentials")) + object.disallowCompromisedCredentials = $root.google.protobuf.BoolValue.toObject(message.disallowCompromisedCredentials, options, q + 1); return object; }; @@ -133253,14 +137163,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationsListResponse.encode = function encode(message, writer) { + OperationsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.Operation.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Operation.encode(message.items[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); return writer; @@ -133276,7 +137190,7 @@ * @returns {$protobuf.Writer} Writer */ OperationsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -133356,10 +137270,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -133368,7 +137282,7 @@ return "items." + 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; @@ -133385,6 +137299,8 @@ OperationsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.OperationsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.OperationsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -133397,7 +137313,7 @@ throw TypeError(".google.cloud.sql.v1beta4.OperationsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.OperationsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.Operation.fromObject(object.items[i], long + 1); } @@ -133416,9 +137332,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationsListResponse.toObject = function toObject(message, options) { + OperationsListResponse.toObject = function toObject(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.items = []; @@ -133426,14 +137346,14 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.Operation.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.Operation.toObject(message.items[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; }; @@ -133547,17 +137467,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReplicaConfiguration.encode = function encode(message, writer) { + ReplicaConfiguration.encode = function encode(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.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) - $root.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.encode(message.mysqlReplicaConfiguration, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.failoverTarget != null && Object.hasOwnProperty.call(message, "failoverTarget")) - $root.google.protobuf.BoolValue.encode(message.failoverTarget, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.failoverTarget, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.cascadableReplica != null && Object.hasOwnProperty.call(message, "cascadableReplica")) - $root.google.protobuf.BoolValue.encode(message.cascadableReplica, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.cascadableReplica, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -133571,7 +137495,7 @@ * @returns {$protobuf.Writer} Writer */ ReplicaConfiguration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -133653,20 +137577,20 @@ 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.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) { + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) { var error = $root.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.verify(message.mysqlReplicaConfiguration, long + 1); if (error) return "mysqlReplicaConfiguration." + error; } - if (message.failoverTarget != null && message.hasOwnProperty("failoverTarget")) { + if (message.failoverTarget != null && Object.hasOwnProperty.call(message, "failoverTarget")) { var error = $root.google.protobuf.BoolValue.verify(message.failoverTarget, long + 1); if (error) return "failoverTarget." + error; } - if (message.cascadableReplica != null && message.hasOwnProperty("cascadableReplica")) { + if (message.cascadableReplica != null && Object.hasOwnProperty.call(message, "cascadableReplica")) { var error = $root.google.protobuf.BoolValue.verify(message.cascadableReplica, long + 1); if (error) return "cascadableReplica." + error; @@ -133685,6 +137609,8 @@ ReplicaConfiguration.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ReplicaConfiguration) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ReplicaConfiguration: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -133693,17 +137619,17 @@ if (object.kind != null) message.kind = String(object.kind); if (object.mysqlReplicaConfiguration != null) { - if (typeof object.mysqlReplicaConfiguration !== "object") + if (!$util.isObject(object.mysqlReplicaConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.ReplicaConfiguration.mysqlReplicaConfiguration: object expected"); message.mysqlReplicaConfiguration = $root.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.fromObject(object.mysqlReplicaConfiguration, long + 1); } if (object.failoverTarget != null) { - if (typeof object.failoverTarget !== "object") + if (!$util.isObject(object.failoverTarget)) throw TypeError(".google.cloud.sql.v1beta4.ReplicaConfiguration.failoverTarget: object expected"); message.failoverTarget = $root.google.protobuf.BoolValue.fromObject(object.failoverTarget, long + 1); } if (object.cascadableReplica != null) { - if (typeof object.cascadableReplica !== "object") + if (!$util.isObject(object.cascadableReplica)) throw TypeError(".google.cloud.sql.v1beta4.ReplicaConfiguration.cascadableReplica: object expected"); message.cascadableReplica = $root.google.protobuf.BoolValue.fromObject(object.cascadableReplica, long + 1); } @@ -133719,9 +137645,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReplicaConfiguration.toObject = function toObject(message, options) { + ReplicaConfiguration.toObject = function toObject(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 = ""; @@ -133729,14 +137659,14 @@ object.failoverTarget = null; object.cascadableReplica = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.mysqlReplicaConfiguration != null && message.hasOwnProperty("mysqlReplicaConfiguration")) - object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options); - if (message.failoverTarget != null && message.hasOwnProperty("failoverTarget")) - object.failoverTarget = $root.google.protobuf.BoolValue.toObject(message.failoverTarget, options); - if (message.cascadableReplica != null && message.hasOwnProperty("cascadableReplica")) - object.cascadableReplica = $root.google.protobuf.BoolValue.toObject(message.cascadableReplica, options); + if (message.mysqlReplicaConfiguration != null && Object.hasOwnProperty.call(message, "mysqlReplicaConfiguration")) + object.mysqlReplicaConfiguration = $root.google.cloud.sql.v1beta4.MySqlReplicaConfiguration.toObject(message.mysqlReplicaConfiguration, options, q + 1); + if (message.failoverTarget != null && Object.hasOwnProperty.call(message, "failoverTarget")) + object.failoverTarget = $root.google.protobuf.BoolValue.toObject(message.failoverTarget, options, q + 1); + if (message.cascadableReplica != null && Object.hasOwnProperty.call(message, "cascadableReplica")) + object.cascadableReplica = $root.google.protobuf.BoolValue.toObject(message.cascadableReplica, options, q + 1); return object; }; @@ -133849,9 +137779,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreBackupContext.encode = function encode(message, writer) { + RestoreBackupContext.encode = function encode(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.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) @@ -133873,7 +137807,7 @@ * @returns {$protobuf.Writer} Writer */ RestoreBackupContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -133955,16 +137889,16 @@ 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.backupRunId != null && message.hasOwnProperty("backupRunId")) + if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) if (!$util.isInteger(message.backupRunId) && !(message.backupRunId && $util.isInteger(message.backupRunId.low) && $util.isInteger(message.backupRunId.high))) return "backupRunId: integer|Long 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -133981,6 +137915,8 @@ RestoreBackupContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.RestoreBackupContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.RestoreBackupContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -133990,7 +137926,7 @@ message.kind = String(object.kind); if (object.backupRunId != null) if ($util.Long) - (message.backupRunId = $util.Long.fromValue(object.backupRunId)).unsigned = false; + message.backupRunId = $util.Long.fromValue(object.backupRunId, false); else if (typeof object.backupRunId === "string") message.backupRunId = parseInt(object.backupRunId, 10); else if (typeof object.backupRunId === "number") @@ -134013,30 +137949,36 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreBackupContext.toObject = function toObject(message, options) { + RestoreBackupContext.toObject = function toObject(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 = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.backupRunId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.backupRunId = options.longs === String ? "0" : 0; + object.backupRunId = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.instanceId = ""; object.project = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.backupRunId != null && message.hasOwnProperty("backupRunId")) - if (typeof message.backupRunId === "number") + if (message.backupRunId != null && Object.hasOwnProperty.call(message, "backupRunId")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.backupRunId = typeof message.backupRunId === "number" ? BigInt(message.backupRunId) : $util.Long.fromBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0, false).toBigInt(); + else if (typeof message.backupRunId === "number") object.backupRunId = options.longs === String ? String(message.backupRunId) : message.backupRunId; else object.backupRunId = options.longs === String ? $util.Long.prototype.toString.call(message.backupRunId) : options.longs === Number ? new $util.LongBits(message.backupRunId.low >>> 0, message.backupRunId.high >>> 0).toNumber() : message.backupRunId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -134132,9 +138074,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RotateServerCaContext.encode = function encode(message, writer) { + RotateServerCaContext.encode = function encode(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.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) @@ -134152,7 +138098,7 @@ * @returns {$protobuf.Writer} Writer */ RotateServerCaContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -134226,10 +138172,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.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) if (!$util.isString(message.nextVersion)) return "nextVersion: string expected"; return null; @@ -134246,6 +138192,8 @@ RotateServerCaContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.RotateServerCaContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.RotateServerCaContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -134267,17 +138215,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RotateServerCaContext.toObject = function toObject(message, options) { + RotateServerCaContext.toObject = function toObject(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.nextVersion = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) object.nextVersion = message.nextVersion; return object; }; @@ -134373,9 +138325,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RotateServerCertificateContext.encode = function encode(message, writer) { + RotateServerCertificateContext.encode = function encode(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.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) @@ -134393,7 +138349,7 @@ * @returns {$protobuf.Writer} Writer */ RotateServerCertificateContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -134467,10 +138423,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.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) if (!$util.isString(message.nextVersion)) return "nextVersion: string expected"; return null; @@ -134487,6 +138443,8 @@ RotateServerCertificateContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.RotateServerCertificateContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.RotateServerCertificateContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -134508,17 +138466,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RotateServerCertificateContext.toObject = function toObject(message, options) { + RotateServerCertificateContext.toObject = function toObject(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.nextVersion = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) object.nextVersion = message.nextVersion; return object; }; @@ -134614,9 +138576,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RotateEntraIdCertificateContext.encode = function encode(message, writer) { + RotateEntraIdCertificateContext.encode = function encode(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.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) @@ -134634,7 +138600,7 @@ * @returns {$protobuf.Writer} Writer */ RotateEntraIdCertificateContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -134708,10 +138674,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.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) if (!$util.isString(message.nextVersion)) return "nextVersion: string expected"; return null; @@ -134728,6 +138694,8 @@ RotateEntraIdCertificateContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.RotateEntraIdCertificateContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.RotateEntraIdCertificateContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -134749,17 +138717,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RotateEntraIdCertificateContext.toObject = function toObject(message, options) { + RotateEntraIdCertificateContext.toObject = function toObject(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.nextVersion = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.nextVersion != null && message.hasOwnProperty("nextVersion")) + if (message.nextVersion != null && Object.hasOwnProperty.call(message, "nextVersion")) object.nextVersion = message.nextVersion; return object; }; @@ -134846,9 +138818,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataCacheConfig.encode = function encode(message, writer) { + DataCacheConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.dataCacheEnabled != null && Object.hasOwnProperty.call(message, "dataCacheEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.dataCacheEnabled); return writer; @@ -134864,7 +138840,7 @@ * @returns {$protobuf.Writer} Writer */ DataCacheConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -134934,7 +138910,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.dataCacheEnabled != null && message.hasOwnProperty("dataCacheEnabled")) + if (message.dataCacheEnabled != null && Object.hasOwnProperty.call(message, "dataCacheEnabled")) if (typeof message.dataCacheEnabled !== "boolean") return "dataCacheEnabled: boolean expected"; return null; @@ -134951,6 +138927,8 @@ DataCacheConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DataCacheConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DataCacheConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -134970,13 +138948,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataCacheConfig.toObject = function toObject(message, options) { + DataCacheConfig.toObject = function toObject(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.dataCacheEnabled = false; - if (message.dataCacheEnabled != null && message.hasOwnProperty("dataCacheEnabled")) + if (message.dataCacheEnabled != null && Object.hasOwnProperty.call(message, "dataCacheEnabled")) object.dataCacheEnabled = message.dataCacheEnabled; return object; }; @@ -135087,9 +139069,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FinalBackupConfig.encode = function encode(message, writer) { + FinalBackupConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) @@ -135107,7 +139093,7 @@ * @returns {$protobuf.Writer} Writer */ FinalBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -135182,12 +139168,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { properties._enabled = 1; if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; } - if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) { + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) { properties._retentionDays = 1; if (!$util.isInteger(message.retentionDays)) return "retentionDays: integer expected"; @@ -135206,6 +139192,8 @@ FinalBackupConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.FinalBackupConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.FinalBackupConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -135227,16 +139215,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FinalBackupConfig.toObject = function toObject(message, options) { + FinalBackupConfig.toObject = function 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.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { object.enabled = message.enabled; if (options.oneofs) object._enabled = "enabled"; } - if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) { + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) { object.retentionDays = message.retentionDays; if (options.oneofs) object._retentionDays = "retentionDays"; @@ -135780,11 +139772,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Settings.encode = function encode(message, writer) { + Settings.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) - $root.google.protobuf.Int64Value.encode(message.settingsVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.settingsVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.authorizedGaeApplications != null && message.authorizedGaeApplications.length) for (var i = 0; i < message.authorizedGaeApplications.length; ++i) writer.uint32(/* id 2, wireType 2 =*/18).string(message.authorizedGaeApplications[i]); @@ -135802,83 +139798,83 @@ if (message.replicationType != null && Object.hasOwnProperty.call(message, "replicationType")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.replicationType); if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) - $root.google.protobuf.Int64Value.encode(message.storageAutoResizeLimit, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.storageAutoResizeLimit, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) writer.uint32(/* id 10, wireType 0 =*/80).int32(message.activationPolicy); if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) - $root.google.cloud.sql.v1beta4.IpConfiguration.encode(message.ipConfiguration, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.IpConfiguration.encode(message.ipConfiguration, writer.uint32(/* id 11, wireType 2 =*/90).fork(), q + 1).ldelim(); if (message.storageAutoResize != null && Object.hasOwnProperty.call(message, "storageAutoResize")) - $root.google.protobuf.BoolValue.encode(message.storageAutoResize, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.storageAutoResize, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.locationPreference != null && Object.hasOwnProperty.call(message, "locationPreference")) - $root.google.cloud.sql.v1beta4.LocationPreference.encode(message.locationPreference, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.LocationPreference.encode(message.locationPreference, writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim(); if (message.databaseFlags != null && message.databaseFlags.length) for (var i = 0; i < message.databaseFlags.length; ++i) - $root.google.cloud.sql.v1beta4.DatabaseFlags.encode(message.databaseFlags[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DatabaseFlags.encode(message.databaseFlags[i], writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim(); if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) writer.uint32(/* id 15, wireType 0 =*/120).int32(message.dataDiskType); if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) - $root.google.cloud.sql.v1beta4.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.MaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim(); if (message.backupConfiguration != null && Object.hasOwnProperty.call(message, "backupConfiguration")) - $root.google.cloud.sql.v1beta4.BackupConfiguration.encode(message.backupConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.BackupConfiguration.encode(message.backupConfiguration, writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim(); if (message.databaseReplicationEnabled != null && Object.hasOwnProperty.call(message, "databaseReplicationEnabled")) - $root.google.protobuf.BoolValue.encode(message.databaseReplicationEnabled, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.databaseReplicationEnabled, writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim(); if (message.crashSafeReplicationEnabled != null && Object.hasOwnProperty.call(message, "crashSafeReplicationEnabled")) - $root.google.protobuf.BoolValue.encode(message.crashSafeReplicationEnabled, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.crashSafeReplicationEnabled, writer.uint32(/* id 19, wireType 2 =*/154).fork(), q + 1).ldelim(); if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) - $root.google.protobuf.Int64Value.encode(message.dataDiskSizeGb, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + $root.google.protobuf.Int64Value.encode(message.dataDiskSizeGb, writer.uint32(/* id 20, wireType 2 =*/162).fork(), q + 1).ldelim(); if (message.activeDirectoryConfig != null && Object.hasOwnProperty.call(message, "activeDirectoryConfig")) - $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.encode(message.activeDirectoryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.encode(message.activeDirectoryConfig, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim(); if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) writer.uint32(/* id 23, wireType 2 =*/186).string(message.collation); if (message.denyMaintenancePeriods != null && message.denyMaintenancePeriods.length) for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) - $root.google.cloud.sql.v1beta4.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DenyMaintenancePeriod.encode(message.denyMaintenancePeriods[i], writer.uint32(/* id 24, wireType 2 =*/194).fork(), q + 1).ldelim(); if (message.insightsConfig != null && Object.hasOwnProperty.call(message, "insightsConfig")) - $root.google.cloud.sql.v1beta4.InsightsConfig.encode(message.insightsConfig, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.InsightsConfig.encode(message.insightsConfig, writer.uint32(/* id 25, wireType 2 =*/202).fork(), q + 1).ldelim(); if (message.passwordValidationPolicy != null && Object.hasOwnProperty.call(message, "passwordValidationPolicy")) - $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.encode(message.passwordValidationPolicy, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.encode(message.passwordValidationPolicy, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim(); if (message.sqlServerAuditConfig != null && Object.hasOwnProperty.call(message, "sqlServerAuditConfig")) - $root.google.cloud.sql.v1beta4.SqlServerAuditConfig.encode(message.sqlServerAuditConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlServerAuditConfig.encode(message.sqlServerAuditConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim(); if (message.connectorEnforcement != null && Object.hasOwnProperty.call(message, "connectorEnforcement")) writer.uint32(/* id 32, wireType 0 =*/256).int32(message.connectorEnforcement); if (message.deletionProtectionEnabled != null && Object.hasOwnProperty.call(message, "deletionProtectionEnabled")) - $root.google.protobuf.BoolValue.encode(message.deletionProtectionEnabled, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.deletionProtectionEnabled, writer.uint32(/* id 33, wireType 2 =*/266).fork(), q + 1).ldelim(); if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) writer.uint32(/* id 34, wireType 2 =*/274).string(message.timeZone); if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) - $root.google.cloud.sql.v1beta4.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 35, wireType 2 =*/282).fork(), q + 1).ldelim(); if (message.dataCacheConfig != null && Object.hasOwnProperty.call(message, "dataCacheConfig")) - $root.google.cloud.sql.v1beta4.DataCacheConfig.encode(message.dataCacheConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DataCacheConfig.encode(message.dataCacheConfig, writer.uint32(/* id 37, wireType 2 =*/298).fork(), q + 1).ldelim(); if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) writer.uint32(/* id 38, wireType 0 =*/304).int32(message.edition); if (message.replicationLagMaxSeconds != null && Object.hasOwnProperty.call(message, "replicationLagMaxSeconds")) - $root.google.protobuf.Int32Value.encode(message.replicationLagMaxSeconds, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + $root.google.protobuf.Int32Value.encode(message.replicationLagMaxSeconds, writer.uint32(/* id 39, wireType 2 =*/314).fork(), q + 1).ldelim(); if (message.enableGoogleMlIntegration != null && Object.hasOwnProperty.call(message, "enableGoogleMlIntegration")) - $root.google.protobuf.BoolValue.encode(message.enableGoogleMlIntegration, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enableGoogleMlIntegration, writer.uint32(/* id 40, wireType 2 =*/322).fork(), q + 1).ldelim(); if (message.enableDataplexIntegration != null && Object.hasOwnProperty.call(message, "enableDataplexIntegration")) - $root.google.protobuf.BoolValue.encode(message.enableDataplexIntegration, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.enableDataplexIntegration, writer.uint32(/* id 41, wireType 2 =*/330).fork(), q + 1).ldelim(); if (message.retainBackupsOnDelete != null && Object.hasOwnProperty.call(message, "retainBackupsOnDelete")) - $root.google.protobuf.BoolValue.encode(message.retainBackupsOnDelete, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.retainBackupsOnDelete, writer.uint32(/* id 42, wireType 2 =*/338).fork(), q + 1).ldelim(); if (message.dataDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedIops")) writer.uint32(/* id 43, wireType 0 =*/344).int64(message.dataDiskProvisionedIops); if (message.dataDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedThroughput")) writer.uint32(/* id 44, wireType 0 =*/352).int64(message.dataDiskProvisionedThroughput); if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) - $root.google.cloud.sql.v1beta4.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ConnectionPoolConfig.encode(message.connectionPoolConfig, writer.uint32(/* id 45, wireType 2 =*/362).fork(), q + 1).ldelim(); if (message.finalBackupConfig != null && Object.hasOwnProperty.call(message, "finalBackupConfig")) - $root.google.cloud.sql.v1beta4.FinalBackupConfig.encode(message.finalBackupConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.FinalBackupConfig.encode(message.finalBackupConfig, writer.uint32(/* id 47, wireType 2 =*/378).fork(), q + 1).ldelim(); if (message.readPoolAutoScaleConfig != null && Object.hasOwnProperty.call(message, "readPoolAutoScaleConfig")) - $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.encode(message.readPoolAutoScaleConfig, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.encode(message.readPoolAutoScaleConfig, writer.uint32(/* id 48, wireType 2 =*/386).fork(), q + 1).ldelim(); if (message.acceleratedReplicaMode != null && Object.hasOwnProperty.call(message, "acceleratedReplicaMode")) - $root.google.protobuf.BoolValue.encode(message.acceleratedReplicaMode, writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); + $root.google.protobuf.BoolValue.encode(message.acceleratedReplicaMode, writer.uint32(/* id 49, wireType 2 =*/394).fork(), q + 1).ldelim(); if (message.autoUpgradeEnabled != null && Object.hasOwnProperty.call(message, "autoUpgradeEnabled")) writer.uint32(/* id 50, wireType 0 =*/400).bool(message.autoUpgradeEnabled); if (message.entraidConfig != null && Object.hasOwnProperty.call(message, "entraidConfig")) - $root.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.encode(message.entraidConfig, writer.uint32(/* id 52, wireType 2 =*/418).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.encode(message.entraidConfig, writer.uint32(/* id 52, wireType 2 =*/418).fork(), q + 1).ldelim(); if (message.dataApiAccess != null && Object.hasOwnProperty.call(message, "dataApiAccess")) writer.uint32(/* id 53, wireType 0 =*/424).int32(message.dataApiAccess); if (message.performanceCaptureConfig != null && Object.hasOwnProperty.call(message, "performanceCaptureConfig")) - $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.encode(message.performanceCaptureConfig, writer.uint32(/* id 54, wireType 2 =*/434).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.encode(message.performanceCaptureConfig, writer.uint32(/* id 54, wireType 2 =*/434).fork(), q + 1).ldelim(); return writer; }; @@ -135892,7 +139888,7 @@ * @returns {$protobuf.Writer} Writer */ Settings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -136170,25 +140166,25 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) { + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) { var error = $root.google.protobuf.Int64Value.verify(message.settingsVersion, long + 1); if (error) return "settingsVersion." + error; } - if (message.authorizedGaeApplications != null && message.hasOwnProperty("authorizedGaeApplications")) { + if (message.authorizedGaeApplications != null && Object.hasOwnProperty.call(message, "authorizedGaeApplications")) { if (!Array.isArray(message.authorizedGaeApplications)) return "authorizedGaeApplications: array expected"; for (var i = 0; i < message.authorizedGaeApplications.length; ++i) if (!$util.isString(message.authorizedGaeApplications[i])) return "authorizedGaeApplications: string[] expected"; } - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) if (!$util.isString(message.tier)) return "tier: string expected"; - 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.userLabels != null && message.hasOwnProperty("userLabels")) { + if (message.userLabels != null && Object.hasOwnProperty.call(message, "userLabels")) { if (!$util.isObject(message.userLabels)) return "userLabels: object expected"; var key = Object.keys(message.userLabels); @@ -136196,7 +140192,7 @@ if (!$util.isString(message.userLabels[key[i]])) return "userLabels: string{k:string} expected"; } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) switch (message.availabilityType) { default: return "availabilityType: enum value expected"; @@ -136205,7 +140201,7 @@ case 2: break; } - if (message.pricingPlan != null && message.hasOwnProperty("pricingPlan")) + if (message.pricingPlan != null && Object.hasOwnProperty.call(message, "pricingPlan")) switch (message.pricingPlan) { default: return "pricingPlan: enum value expected"; @@ -136214,7 +140210,7 @@ case 2: break; } - if (message.replicationType != null && message.hasOwnProperty("replicationType")) + if (message.replicationType != null && Object.hasOwnProperty.call(message, "replicationType")) switch (message.replicationType) { default: return "replicationType: enum value expected"; @@ -136223,12 +140219,12 @@ case 2: break; } - if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) { + if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) { var error = $root.google.protobuf.Int64Value.verify(message.storageAutoResizeLimit, long + 1); if (error) return "storageAutoResizeLimit." + error; } - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) switch (message.activationPolicy) { default: return "activationPolicy: enum value expected"; @@ -136238,22 +140234,22 @@ case 3: break; } - if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) { + if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) { var error = $root.google.cloud.sql.v1beta4.IpConfiguration.verify(message.ipConfiguration, long + 1); if (error) return "ipConfiguration." + error; } - if (message.storageAutoResize != null && message.hasOwnProperty("storageAutoResize")) { + if (message.storageAutoResize != null && Object.hasOwnProperty.call(message, "storageAutoResize")) { var error = $root.google.protobuf.BoolValue.verify(message.storageAutoResize, long + 1); if (error) return "storageAutoResize." + error; } - if (message.locationPreference != null && message.hasOwnProperty("locationPreference")) { + if (message.locationPreference != null && Object.hasOwnProperty.call(message, "locationPreference")) { var error = $root.google.cloud.sql.v1beta4.LocationPreference.verify(message.locationPreference, long + 1); if (error) return "locationPreference." + error; } - if (message.databaseFlags != null && message.hasOwnProperty("databaseFlags")) { + if (message.databaseFlags != null && Object.hasOwnProperty.call(message, "databaseFlags")) { if (!Array.isArray(message.databaseFlags)) return "databaseFlags: array expected"; for (var i = 0; i < message.databaseFlags.length; ++i) { @@ -136262,7 +140258,7 @@ return "databaseFlags." + error; } } - if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) switch (message.dataDiskType) { default: return "dataDiskType: enum value expected"; @@ -136273,40 +140269,40 @@ case 4: break; } - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) { var error = $root.google.cloud.sql.v1beta4.MaintenanceWindow.verify(message.maintenanceWindow, long + 1); if (error) return "maintenanceWindow." + error; } - if (message.backupConfiguration != null && message.hasOwnProperty("backupConfiguration")) { + if (message.backupConfiguration != null && Object.hasOwnProperty.call(message, "backupConfiguration")) { var error = $root.google.cloud.sql.v1beta4.BackupConfiguration.verify(message.backupConfiguration, long + 1); if (error) return "backupConfiguration." + error; } - if (message.databaseReplicationEnabled != null && message.hasOwnProperty("databaseReplicationEnabled")) { + if (message.databaseReplicationEnabled != null && Object.hasOwnProperty.call(message, "databaseReplicationEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.databaseReplicationEnabled, long + 1); if (error) return "databaseReplicationEnabled." + error; } - if (message.crashSafeReplicationEnabled != null && message.hasOwnProperty("crashSafeReplicationEnabled")) { + if (message.crashSafeReplicationEnabled != null && Object.hasOwnProperty.call(message, "crashSafeReplicationEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.crashSafeReplicationEnabled, long + 1); if (error) return "crashSafeReplicationEnabled." + error; } - if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) { + if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) { var error = $root.google.protobuf.Int64Value.verify(message.dataDiskSizeGb, long + 1); if (error) return "dataDiskSizeGb." + error; } - if (message.activeDirectoryConfig != null && message.hasOwnProperty("activeDirectoryConfig")) { + if (message.activeDirectoryConfig != null && Object.hasOwnProperty.call(message, "activeDirectoryConfig")) { var error = $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.verify(message.activeDirectoryConfig, long + 1); if (error) return "activeDirectoryConfig." + error; } - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) if (!$util.isString(message.collation)) return "collation: string expected"; - if (message.denyMaintenancePeriods != null && message.hasOwnProperty("denyMaintenancePeriods")) { + if (message.denyMaintenancePeriods != null && Object.hasOwnProperty.call(message, "denyMaintenancePeriods")) { if (!Array.isArray(message.denyMaintenancePeriods)) return "denyMaintenancePeriods: array expected"; for (var i = 0; i < message.denyMaintenancePeriods.length; ++i) { @@ -136315,22 +140311,22 @@ return "denyMaintenancePeriods." + error; } } - if (message.insightsConfig != null && message.hasOwnProperty("insightsConfig")) { + if (message.insightsConfig != null && Object.hasOwnProperty.call(message, "insightsConfig")) { var error = $root.google.cloud.sql.v1beta4.InsightsConfig.verify(message.insightsConfig, long + 1); if (error) return "insightsConfig." + error; } - if (message.passwordValidationPolicy != null && message.hasOwnProperty("passwordValidationPolicy")) { + if (message.passwordValidationPolicy != null && Object.hasOwnProperty.call(message, "passwordValidationPolicy")) { var error = $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.verify(message.passwordValidationPolicy, long + 1); if (error) return "passwordValidationPolicy." + error; } - if (message.sqlServerAuditConfig != null && message.hasOwnProperty("sqlServerAuditConfig")) { + if (message.sqlServerAuditConfig != null && Object.hasOwnProperty.call(message, "sqlServerAuditConfig")) { var error = $root.google.cloud.sql.v1beta4.SqlServerAuditConfig.verify(message.sqlServerAuditConfig, long + 1); if (error) return "sqlServerAuditConfig." + 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"; @@ -136340,7 +140336,7 @@ case 5: break; } - if (message.connectorEnforcement != null && message.hasOwnProperty("connectorEnforcement")) + if (message.connectorEnforcement != null && Object.hasOwnProperty.call(message, "connectorEnforcement")) switch (message.connectorEnforcement) { default: return "connectorEnforcement: enum value expected"; @@ -136349,55 +140345,55 @@ case 2: break; } - if (message.deletionProtectionEnabled != null && message.hasOwnProperty("deletionProtectionEnabled")) { + if (message.deletionProtectionEnabled != null && Object.hasOwnProperty.call(message, "deletionProtectionEnabled")) { var error = $root.google.protobuf.BoolValue.verify(message.deletionProtectionEnabled, long + 1); if (error) return "deletionProtectionEnabled." + error; } - 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.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) { var error = $root.google.cloud.sql.v1beta4.AdvancedMachineFeatures.verify(message.advancedMachineFeatures, long + 1); if (error) return "advancedMachineFeatures." + error; } - if (message.dataCacheConfig != null && message.hasOwnProperty("dataCacheConfig")) { + if (message.dataCacheConfig != null && Object.hasOwnProperty.call(message, "dataCacheConfig")) { var error = $root.google.cloud.sql.v1beta4.DataCacheConfig.verify(message.dataCacheConfig, long + 1); if (error) return "dataCacheConfig." + error; } - if (message.replicationLagMaxSeconds != null && message.hasOwnProperty("replicationLagMaxSeconds")) { + if (message.replicationLagMaxSeconds != null && Object.hasOwnProperty.call(message, "replicationLagMaxSeconds")) { var error = $root.google.protobuf.Int32Value.verify(message.replicationLagMaxSeconds, long + 1); if (error) return "replicationLagMaxSeconds." + error; } - if (message.enableGoogleMlIntegration != null && message.hasOwnProperty("enableGoogleMlIntegration")) { + if (message.enableGoogleMlIntegration != null && Object.hasOwnProperty.call(message, "enableGoogleMlIntegration")) { var error = $root.google.protobuf.BoolValue.verify(message.enableGoogleMlIntegration, long + 1); if (error) return "enableGoogleMlIntegration." + error; } - if (message.enableDataplexIntegration != null && message.hasOwnProperty("enableDataplexIntegration")) { + if (message.enableDataplexIntegration != null && Object.hasOwnProperty.call(message, "enableDataplexIntegration")) { var error = $root.google.protobuf.BoolValue.verify(message.enableDataplexIntegration, long + 1); if (error) return "enableDataplexIntegration." + error; } - if (message.retainBackupsOnDelete != null && message.hasOwnProperty("retainBackupsOnDelete")) { + if (message.retainBackupsOnDelete != null && Object.hasOwnProperty.call(message, "retainBackupsOnDelete")) { var error = $root.google.protobuf.BoolValue.verify(message.retainBackupsOnDelete, long + 1); if (error) return "retainBackupsOnDelete." + error; } - if (message.dataDiskProvisionedIops != null && message.hasOwnProperty("dataDiskProvisionedIops")) { + if (message.dataDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedIops")) { properties._dataDiskProvisionedIops = 1; if (!$util.isInteger(message.dataDiskProvisionedIops) && !(message.dataDiskProvisionedIops && $util.isInteger(message.dataDiskProvisionedIops.low) && $util.isInteger(message.dataDiskProvisionedIops.high))) return "dataDiskProvisionedIops: integer|Long expected"; } - if (message.dataDiskProvisionedThroughput != null && message.hasOwnProperty("dataDiskProvisionedThroughput")) { + if (message.dataDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedThroughput")) { properties._dataDiskProvisionedThroughput = 1; if (!$util.isInteger(message.dataDiskProvisionedThroughput) && !(message.dataDiskProvisionedThroughput && $util.isInteger(message.dataDiskProvisionedThroughput.low) && $util.isInteger(message.dataDiskProvisionedThroughput.high))) return "dataDiskProvisionedThroughput: integer|Long expected"; } - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { + if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) { properties._connectionPoolConfig = 1; { var error = $root.google.cloud.sql.v1beta4.ConnectionPoolConfig.verify(message.connectionPoolConfig, long + 1); @@ -136405,7 +140401,7 @@ return "connectionPoolConfig." + error; } } - if (message.finalBackupConfig != null && message.hasOwnProperty("finalBackupConfig")) { + if (message.finalBackupConfig != null && Object.hasOwnProperty.call(message, "finalBackupConfig")) { properties._finalBackupConfig = 1; { var error = $root.google.cloud.sql.v1beta4.FinalBackupConfig.verify(message.finalBackupConfig, long + 1); @@ -136413,7 +140409,7 @@ return "finalBackupConfig." + error; } } - if (message.readPoolAutoScaleConfig != null && message.hasOwnProperty("readPoolAutoScaleConfig")) { + if (message.readPoolAutoScaleConfig != null && Object.hasOwnProperty.call(message, "readPoolAutoScaleConfig")) { properties._readPoolAutoScaleConfig = 1; { var error = $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.verify(message.readPoolAutoScaleConfig, long + 1); @@ -136421,22 +140417,22 @@ return "readPoolAutoScaleConfig." + error; } } - if (message.acceleratedReplicaMode != null && message.hasOwnProperty("acceleratedReplicaMode")) { + if (message.acceleratedReplicaMode != null && Object.hasOwnProperty.call(message, "acceleratedReplicaMode")) { var error = $root.google.protobuf.BoolValue.verify(message.acceleratedReplicaMode, long + 1); if (error) return "acceleratedReplicaMode." + error; } - if (message.autoUpgradeEnabled != null && message.hasOwnProperty("autoUpgradeEnabled")) { + if (message.autoUpgradeEnabled != null && Object.hasOwnProperty.call(message, "autoUpgradeEnabled")) { properties._autoUpgradeEnabled = 1; if (typeof message.autoUpgradeEnabled !== "boolean") return "autoUpgradeEnabled: boolean expected"; } - if (message.entraidConfig != null && message.hasOwnProperty("entraidConfig")) { + if (message.entraidConfig != null && Object.hasOwnProperty.call(message, "entraidConfig")) { var error = $root.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.verify(message.entraidConfig, long + 1); if (error) return "entraidConfig." + error; } - if (message.dataApiAccess != null && message.hasOwnProperty("dataApiAccess")) { + if (message.dataApiAccess != null && Object.hasOwnProperty.call(message, "dataApiAccess")) { properties._dataApiAccess = 1; switch (message.dataApiAccess) { default: @@ -136447,7 +140443,7 @@ break; } } - if (message.performanceCaptureConfig != null && message.hasOwnProperty("performanceCaptureConfig")) { + if (message.performanceCaptureConfig != null && Object.hasOwnProperty.call(message, "performanceCaptureConfig")) { var error = $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.verify(message.performanceCaptureConfig, long + 1); if (error) return "performanceCaptureConfig." + error; @@ -136466,13 +140462,15 @@ Settings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Settings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Settings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.Settings(); if (object.settingsVersion != null) { - if (typeof object.settingsVersion !== "object") + if (!$util.isObject(object.settingsVersion)) throw TypeError(".google.cloud.sql.v1beta4.Settings.settingsVersion: object expected"); message.settingsVersion = $root.google.protobuf.Int64Value.fromObject(object.settingsVersion, long + 1); } @@ -136488,7 +140486,7 @@ if (object.kind != null) message.kind = String(object.kind); if (object.userLabels) { - if (typeof object.userLabels !== "object") + if (!$util.isObject(object.userLabels)) throw TypeError(".google.cloud.sql.v1beta4.Settings.userLabels: object expected"); message.userLabels = {}; for (var keys = Object.keys(object.userLabels), i = 0; i < keys.length; ++i) { @@ -136558,7 +140556,7 @@ break; } if (object.storageAutoResizeLimit != null) { - if (typeof object.storageAutoResizeLimit !== "object") + if (!$util.isObject(object.storageAutoResizeLimit)) throw TypeError(".google.cloud.sql.v1beta4.Settings.storageAutoResizeLimit: object expected"); message.storageAutoResizeLimit = $root.google.protobuf.Int64Value.fromObject(object.storageAutoResizeLimit, long + 1); } @@ -136587,17 +140585,17 @@ break; } if (object.ipConfiguration != null) { - if (typeof object.ipConfiguration !== "object") + if (!$util.isObject(object.ipConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.Settings.ipConfiguration: object expected"); message.ipConfiguration = $root.google.cloud.sql.v1beta4.IpConfiguration.fromObject(object.ipConfiguration, long + 1); } if (object.storageAutoResize != null) { - if (typeof object.storageAutoResize !== "object") + if (!$util.isObject(object.storageAutoResize)) throw TypeError(".google.cloud.sql.v1beta4.Settings.storageAutoResize: object expected"); message.storageAutoResize = $root.google.protobuf.BoolValue.fromObject(object.storageAutoResize, long + 1); } if (object.locationPreference != null) { - if (typeof object.locationPreference !== "object") + if (!$util.isObject(object.locationPreference)) throw TypeError(".google.cloud.sql.v1beta4.Settings.locationPreference: object expected"); message.locationPreference = $root.google.cloud.sql.v1beta4.LocationPreference.fromObject(object.locationPreference, long + 1); } @@ -136606,7 +140604,7 @@ throw TypeError(".google.cloud.sql.v1beta4.Settings.databaseFlags: array expected"); message.databaseFlags = []; for (var i = 0; i < object.databaseFlags.length; ++i) { - if (typeof object.databaseFlags[i] !== "object") + if (!$util.isObject(object.databaseFlags[i])) throw TypeError(".google.cloud.sql.v1beta4.Settings.databaseFlags: object expected"); message.databaseFlags[i] = $root.google.cloud.sql.v1beta4.DatabaseFlags.fromObject(object.databaseFlags[i], long + 1); } @@ -136640,32 +140638,32 @@ break; } if (object.maintenanceWindow != null) { - if (typeof object.maintenanceWindow !== "object") + if (!$util.isObject(object.maintenanceWindow)) throw TypeError(".google.cloud.sql.v1beta4.Settings.maintenanceWindow: object expected"); message.maintenanceWindow = $root.google.cloud.sql.v1beta4.MaintenanceWindow.fromObject(object.maintenanceWindow, long + 1); } if (object.backupConfiguration != null) { - if (typeof object.backupConfiguration !== "object") + if (!$util.isObject(object.backupConfiguration)) throw TypeError(".google.cloud.sql.v1beta4.Settings.backupConfiguration: object expected"); message.backupConfiguration = $root.google.cloud.sql.v1beta4.BackupConfiguration.fromObject(object.backupConfiguration, long + 1); } if (object.databaseReplicationEnabled != null) { - if (typeof object.databaseReplicationEnabled !== "object") + if (!$util.isObject(object.databaseReplicationEnabled)) throw TypeError(".google.cloud.sql.v1beta4.Settings.databaseReplicationEnabled: object expected"); message.databaseReplicationEnabled = $root.google.protobuf.BoolValue.fromObject(object.databaseReplicationEnabled, long + 1); } if (object.crashSafeReplicationEnabled != null) { - if (typeof object.crashSafeReplicationEnabled !== "object") + if (!$util.isObject(object.crashSafeReplicationEnabled)) throw TypeError(".google.cloud.sql.v1beta4.Settings.crashSafeReplicationEnabled: object expected"); message.crashSafeReplicationEnabled = $root.google.protobuf.BoolValue.fromObject(object.crashSafeReplicationEnabled, long + 1); } if (object.dataDiskSizeGb != null) { - if (typeof object.dataDiskSizeGb !== "object") + if (!$util.isObject(object.dataDiskSizeGb)) throw TypeError(".google.cloud.sql.v1beta4.Settings.dataDiskSizeGb: object expected"); message.dataDiskSizeGb = $root.google.protobuf.Int64Value.fromObject(object.dataDiskSizeGb, long + 1); } if (object.activeDirectoryConfig != null) { - if (typeof object.activeDirectoryConfig !== "object") + if (!$util.isObject(object.activeDirectoryConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.activeDirectoryConfig: object expected"); message.activeDirectoryConfig = $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.fromObject(object.activeDirectoryConfig, long + 1); } @@ -136676,23 +140674,23 @@ throw TypeError(".google.cloud.sql.v1beta4.Settings.denyMaintenancePeriods: array expected"); message.denyMaintenancePeriods = []; for (var i = 0; i < object.denyMaintenancePeriods.length; ++i) { - if (typeof object.denyMaintenancePeriods[i] !== "object") + if (!$util.isObject(object.denyMaintenancePeriods[i])) throw TypeError(".google.cloud.sql.v1beta4.Settings.denyMaintenancePeriods: object expected"); message.denyMaintenancePeriods[i] = $root.google.cloud.sql.v1beta4.DenyMaintenancePeriod.fromObject(object.denyMaintenancePeriods[i], long + 1); } } if (object.insightsConfig != null) { - if (typeof object.insightsConfig !== "object") + if (!$util.isObject(object.insightsConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.insightsConfig: object expected"); message.insightsConfig = $root.google.cloud.sql.v1beta4.InsightsConfig.fromObject(object.insightsConfig, long + 1); } if (object.passwordValidationPolicy != null) { - if (typeof object.passwordValidationPolicy !== "object") + if (!$util.isObject(object.passwordValidationPolicy)) throw TypeError(".google.cloud.sql.v1beta4.Settings.passwordValidationPolicy: object expected"); message.passwordValidationPolicy = $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.fromObject(object.passwordValidationPolicy, long + 1); } if (object.sqlServerAuditConfig != null) { - if (typeof object.sqlServerAuditConfig !== "object") + if (!$util.isObject(object.sqlServerAuditConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.sqlServerAuditConfig: object expected"); message.sqlServerAuditConfig = $root.google.cloud.sql.v1beta4.SqlServerAuditConfig.fromObject(object.sqlServerAuditConfig, long + 1); } @@ -136741,45 +140739,45 @@ break; } if (object.deletionProtectionEnabled != null) { - if (typeof object.deletionProtectionEnabled !== "object") + if (!$util.isObject(object.deletionProtectionEnabled)) throw TypeError(".google.cloud.sql.v1beta4.Settings.deletionProtectionEnabled: object expected"); message.deletionProtectionEnabled = $root.google.protobuf.BoolValue.fromObject(object.deletionProtectionEnabled, long + 1); } if (object.timeZone != null) message.timeZone = String(object.timeZone); if (object.advancedMachineFeatures != null) { - if (typeof object.advancedMachineFeatures !== "object") + if (!$util.isObject(object.advancedMachineFeatures)) throw TypeError(".google.cloud.sql.v1beta4.Settings.advancedMachineFeatures: object expected"); message.advancedMachineFeatures = $root.google.cloud.sql.v1beta4.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures, long + 1); } if (object.dataCacheConfig != null) { - if (typeof object.dataCacheConfig !== "object") + if (!$util.isObject(object.dataCacheConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.dataCacheConfig: object expected"); message.dataCacheConfig = $root.google.cloud.sql.v1beta4.DataCacheConfig.fromObject(object.dataCacheConfig, long + 1); } if (object.replicationLagMaxSeconds != null) { - if (typeof object.replicationLagMaxSeconds !== "object") + if (!$util.isObject(object.replicationLagMaxSeconds)) throw TypeError(".google.cloud.sql.v1beta4.Settings.replicationLagMaxSeconds: object expected"); message.replicationLagMaxSeconds = $root.google.protobuf.Int32Value.fromObject(object.replicationLagMaxSeconds, long + 1); } if (object.enableGoogleMlIntegration != null) { - if (typeof object.enableGoogleMlIntegration !== "object") + if (!$util.isObject(object.enableGoogleMlIntegration)) throw TypeError(".google.cloud.sql.v1beta4.Settings.enableGoogleMlIntegration: object expected"); message.enableGoogleMlIntegration = $root.google.protobuf.BoolValue.fromObject(object.enableGoogleMlIntegration, long + 1); } if (object.enableDataplexIntegration != null) { - if (typeof object.enableDataplexIntegration !== "object") + if (!$util.isObject(object.enableDataplexIntegration)) throw TypeError(".google.cloud.sql.v1beta4.Settings.enableDataplexIntegration: object expected"); message.enableDataplexIntegration = $root.google.protobuf.BoolValue.fromObject(object.enableDataplexIntegration, long + 1); } if (object.retainBackupsOnDelete != null) { - if (typeof object.retainBackupsOnDelete !== "object") + if (!$util.isObject(object.retainBackupsOnDelete)) throw TypeError(".google.cloud.sql.v1beta4.Settings.retainBackupsOnDelete: object expected"); message.retainBackupsOnDelete = $root.google.protobuf.BoolValue.fromObject(object.retainBackupsOnDelete, long + 1); } if (object.dataDiskProvisionedIops != null) if ($util.Long) - (message.dataDiskProvisionedIops = $util.Long.fromValue(object.dataDiskProvisionedIops)).unsigned = false; + message.dataDiskProvisionedIops = $util.Long.fromValue(object.dataDiskProvisionedIops, false); else if (typeof object.dataDiskProvisionedIops === "string") message.dataDiskProvisionedIops = parseInt(object.dataDiskProvisionedIops, 10); else if (typeof object.dataDiskProvisionedIops === "number") @@ -136788,7 +140786,7 @@ message.dataDiskProvisionedIops = new $util.LongBits(object.dataDiskProvisionedIops.low >>> 0, object.dataDiskProvisionedIops.high >>> 0).toNumber(); if (object.dataDiskProvisionedThroughput != null) if ($util.Long) - (message.dataDiskProvisionedThroughput = $util.Long.fromValue(object.dataDiskProvisionedThroughput)).unsigned = false; + message.dataDiskProvisionedThroughput = $util.Long.fromValue(object.dataDiskProvisionedThroughput, false); else if (typeof object.dataDiskProvisionedThroughput === "string") message.dataDiskProvisionedThroughput = parseInt(object.dataDiskProvisionedThroughput, 10); else if (typeof object.dataDiskProvisionedThroughput === "number") @@ -136796,29 +140794,29 @@ else if (typeof object.dataDiskProvisionedThroughput === "object") message.dataDiskProvisionedThroughput = new $util.LongBits(object.dataDiskProvisionedThroughput.low >>> 0, object.dataDiskProvisionedThroughput.high >>> 0).toNumber(); if (object.connectionPoolConfig != null) { - if (typeof object.connectionPoolConfig !== "object") + if (!$util.isObject(object.connectionPoolConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.connectionPoolConfig: object expected"); message.connectionPoolConfig = $root.google.cloud.sql.v1beta4.ConnectionPoolConfig.fromObject(object.connectionPoolConfig, long + 1); } if (object.finalBackupConfig != null) { - if (typeof object.finalBackupConfig !== "object") + if (!$util.isObject(object.finalBackupConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.finalBackupConfig: object expected"); message.finalBackupConfig = $root.google.cloud.sql.v1beta4.FinalBackupConfig.fromObject(object.finalBackupConfig, long + 1); } if (object.readPoolAutoScaleConfig != null) { - if (typeof object.readPoolAutoScaleConfig !== "object") + if (!$util.isObject(object.readPoolAutoScaleConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.readPoolAutoScaleConfig: object expected"); message.readPoolAutoScaleConfig = $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.fromObject(object.readPoolAutoScaleConfig, long + 1); } if (object.acceleratedReplicaMode != null) { - if (typeof object.acceleratedReplicaMode !== "object") + if (!$util.isObject(object.acceleratedReplicaMode)) throw TypeError(".google.cloud.sql.v1beta4.Settings.acceleratedReplicaMode: object expected"); message.acceleratedReplicaMode = $root.google.protobuf.BoolValue.fromObject(object.acceleratedReplicaMode, long + 1); } if (object.autoUpgradeEnabled != null) message.autoUpgradeEnabled = Boolean(object.autoUpgradeEnabled); if (object.entraidConfig != null) { - if (typeof object.entraidConfig !== "object") + if (!$util.isObject(object.entraidConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.entraidConfig: object expected"); message.entraidConfig = $root.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.fromObject(object.entraidConfig, long + 1); } @@ -136843,7 +140841,7 @@ break; } if (object.performanceCaptureConfig != null) { - if (typeof object.performanceCaptureConfig !== "object") + if (!$util.isObject(object.performanceCaptureConfig)) throw TypeError(".google.cloud.sql.v1beta4.Settings.performanceCaptureConfig: object expected"); message.performanceCaptureConfig = $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.fromObject(object.performanceCaptureConfig, long + 1); } @@ -136859,9 +140857,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Settings.toObject = function toObject(message, options) { + Settings.toObject = function toObject(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.authorizedGaeApplications = []; @@ -136907,16 +140909,16 @@ object.entraidConfig = null; object.performanceCaptureConfig = null; } - if (message.settingsVersion != null && message.hasOwnProperty("settingsVersion")) - object.settingsVersion = $root.google.protobuf.Int64Value.toObject(message.settingsVersion, options); + if (message.settingsVersion != null && Object.hasOwnProperty.call(message, "settingsVersion")) + object.settingsVersion = $root.google.protobuf.Int64Value.toObject(message.settingsVersion, options, q + 1); if (message.authorizedGaeApplications && message.authorizedGaeApplications.length) { object.authorizedGaeApplications = []; for (var j = 0; j < message.authorizedGaeApplications.length; ++j) object.authorizedGaeApplications[j] = message.authorizedGaeApplications[j]; } - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) object.tier = message.tier; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; var keys2; if (message.userLabels && (keys2 = Object.keys(message.userLabels)).length) { @@ -136927,121 +140929,125 @@ object.userLabels[keys2[j]] = message.userLabels[keys2[j]]; } } - if (message.availabilityType != null && message.hasOwnProperty("availabilityType")) + if (message.availabilityType != null && Object.hasOwnProperty.call(message, "availabilityType")) object.availabilityType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlAvailabilityType[message.availabilityType] === undefined ? message.availabilityType : $root.google.cloud.sql.v1beta4.SqlAvailabilityType[message.availabilityType] : message.availabilityType; - if (message.pricingPlan != null && message.hasOwnProperty("pricingPlan")) + if (message.pricingPlan != null && Object.hasOwnProperty.call(message, "pricingPlan")) object.pricingPlan = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlPricingPlan[message.pricingPlan] === undefined ? message.pricingPlan : $root.google.cloud.sql.v1beta4.SqlPricingPlan[message.pricingPlan] : message.pricingPlan; - if (message.replicationType != null && message.hasOwnProperty("replicationType")) + if (message.replicationType != null && Object.hasOwnProperty.call(message, "replicationType")) object.replicationType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlReplicationType[message.replicationType] === undefined ? message.replicationType : $root.google.cloud.sql.v1beta4.SqlReplicationType[message.replicationType] : message.replicationType; - if (message.storageAutoResizeLimit != null && message.hasOwnProperty("storageAutoResizeLimit")) - object.storageAutoResizeLimit = $root.google.protobuf.Int64Value.toObject(message.storageAutoResizeLimit, options); - if (message.activationPolicy != null && message.hasOwnProperty("activationPolicy")) + if (message.storageAutoResizeLimit != null && Object.hasOwnProperty.call(message, "storageAutoResizeLimit")) + object.storageAutoResizeLimit = $root.google.protobuf.Int64Value.toObject(message.storageAutoResizeLimit, options, q + 1); + if (message.activationPolicy != null && Object.hasOwnProperty.call(message, "activationPolicy")) object.activationPolicy = options.enums === String ? $root.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy[message.activationPolicy] === undefined ? message.activationPolicy : $root.google.cloud.sql.v1beta4.Settings.SqlActivationPolicy[message.activationPolicy] : message.activationPolicy; - if (message.ipConfiguration != null && message.hasOwnProperty("ipConfiguration")) - object.ipConfiguration = $root.google.cloud.sql.v1beta4.IpConfiguration.toObject(message.ipConfiguration, options); - if (message.storageAutoResize != null && message.hasOwnProperty("storageAutoResize")) - object.storageAutoResize = $root.google.protobuf.BoolValue.toObject(message.storageAutoResize, options); - if (message.locationPreference != null && message.hasOwnProperty("locationPreference")) - object.locationPreference = $root.google.cloud.sql.v1beta4.LocationPreference.toObject(message.locationPreference, options); + if (message.ipConfiguration != null && Object.hasOwnProperty.call(message, "ipConfiguration")) + object.ipConfiguration = $root.google.cloud.sql.v1beta4.IpConfiguration.toObject(message.ipConfiguration, options, q + 1); + if (message.storageAutoResize != null && Object.hasOwnProperty.call(message, "storageAutoResize")) + object.storageAutoResize = $root.google.protobuf.BoolValue.toObject(message.storageAutoResize, options, q + 1); + if (message.locationPreference != null && Object.hasOwnProperty.call(message, "locationPreference")) + object.locationPreference = $root.google.cloud.sql.v1beta4.LocationPreference.toObject(message.locationPreference, options, q + 1); if (message.databaseFlags && message.databaseFlags.length) { object.databaseFlags = []; for (var j = 0; j < message.databaseFlags.length; ++j) - object.databaseFlags[j] = $root.google.cloud.sql.v1beta4.DatabaseFlags.toObject(message.databaseFlags[j], options); + object.databaseFlags[j] = $root.google.cloud.sql.v1beta4.DatabaseFlags.toObject(message.databaseFlags[j], options, q + 1); } - if (message.dataDiskType != null && message.hasOwnProperty("dataDiskType")) + if (message.dataDiskType != null && Object.hasOwnProperty.call(message, "dataDiskType")) object.dataDiskType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlDataDiskType[message.dataDiskType] === undefined ? message.dataDiskType : $root.google.cloud.sql.v1beta4.SqlDataDiskType[message.dataDiskType] : message.dataDiskType; - if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) - object.maintenanceWindow = $root.google.cloud.sql.v1beta4.MaintenanceWindow.toObject(message.maintenanceWindow, options); - if (message.backupConfiguration != null && message.hasOwnProperty("backupConfiguration")) - object.backupConfiguration = $root.google.cloud.sql.v1beta4.BackupConfiguration.toObject(message.backupConfiguration, options); - if (message.databaseReplicationEnabled != null && message.hasOwnProperty("databaseReplicationEnabled")) - object.databaseReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.databaseReplicationEnabled, options); - if (message.crashSafeReplicationEnabled != null && message.hasOwnProperty("crashSafeReplicationEnabled")) - object.crashSafeReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.crashSafeReplicationEnabled, options); - if (message.dataDiskSizeGb != null && message.hasOwnProperty("dataDiskSizeGb")) - object.dataDiskSizeGb = $root.google.protobuf.Int64Value.toObject(message.dataDiskSizeGb, options); - if (message.activeDirectoryConfig != null && message.hasOwnProperty("activeDirectoryConfig")) - object.activeDirectoryConfig = $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.toObject(message.activeDirectoryConfig, options); - if (message.collation != null && message.hasOwnProperty("collation")) + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) + object.maintenanceWindow = $root.google.cloud.sql.v1beta4.MaintenanceWindow.toObject(message.maintenanceWindow, options, q + 1); + if (message.backupConfiguration != null && Object.hasOwnProperty.call(message, "backupConfiguration")) + object.backupConfiguration = $root.google.cloud.sql.v1beta4.BackupConfiguration.toObject(message.backupConfiguration, options, q + 1); + if (message.databaseReplicationEnabled != null && Object.hasOwnProperty.call(message, "databaseReplicationEnabled")) + object.databaseReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.databaseReplicationEnabled, options, q + 1); + if (message.crashSafeReplicationEnabled != null && Object.hasOwnProperty.call(message, "crashSafeReplicationEnabled")) + object.crashSafeReplicationEnabled = $root.google.protobuf.BoolValue.toObject(message.crashSafeReplicationEnabled, options, q + 1); + if (message.dataDiskSizeGb != null && Object.hasOwnProperty.call(message, "dataDiskSizeGb")) + object.dataDiskSizeGb = $root.google.protobuf.Int64Value.toObject(message.dataDiskSizeGb, options, q + 1); + if (message.activeDirectoryConfig != null && Object.hasOwnProperty.call(message, "activeDirectoryConfig")) + object.activeDirectoryConfig = $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.toObject(message.activeDirectoryConfig, options, q + 1); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) object.collation = message.collation; if (message.denyMaintenancePeriods && message.denyMaintenancePeriods.length) { object.denyMaintenancePeriods = []; for (var j = 0; j < message.denyMaintenancePeriods.length; ++j) - object.denyMaintenancePeriods[j] = $root.google.cloud.sql.v1beta4.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options); - } - if (message.insightsConfig != null && message.hasOwnProperty("insightsConfig")) - object.insightsConfig = $root.google.cloud.sql.v1beta4.InsightsConfig.toObject(message.insightsConfig, options); - if (message.passwordValidationPolicy != null && message.hasOwnProperty("passwordValidationPolicy")) - object.passwordValidationPolicy = $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.toObject(message.passwordValidationPolicy, options); - if (message.sqlServerAuditConfig != null && message.hasOwnProperty("sqlServerAuditConfig")) - object.sqlServerAuditConfig = $root.google.cloud.sql.v1beta4.SqlServerAuditConfig.toObject(message.sqlServerAuditConfig, options); - if (message.connectorEnforcement != null && message.hasOwnProperty("connectorEnforcement")) + object.denyMaintenancePeriods[j] = $root.google.cloud.sql.v1beta4.DenyMaintenancePeriod.toObject(message.denyMaintenancePeriods[j], options, q + 1); + } + if (message.insightsConfig != null && Object.hasOwnProperty.call(message, "insightsConfig")) + object.insightsConfig = $root.google.cloud.sql.v1beta4.InsightsConfig.toObject(message.insightsConfig, options, q + 1); + if (message.passwordValidationPolicy != null && Object.hasOwnProperty.call(message, "passwordValidationPolicy")) + object.passwordValidationPolicy = $root.google.cloud.sql.v1beta4.PasswordValidationPolicy.toObject(message.passwordValidationPolicy, options, q + 1); + if (message.sqlServerAuditConfig != null && Object.hasOwnProperty.call(message, "sqlServerAuditConfig")) + object.sqlServerAuditConfig = $root.google.cloud.sql.v1beta4.SqlServerAuditConfig.toObject(message.sqlServerAuditConfig, options, q + 1); + if (message.connectorEnforcement != null && Object.hasOwnProperty.call(message, "connectorEnforcement")) object.connectorEnforcement = options.enums === String ? $root.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement[message.connectorEnforcement] === undefined ? message.connectorEnforcement : $root.google.cloud.sql.v1beta4.Settings.ConnectorEnforcement[message.connectorEnforcement] : message.connectorEnforcement; - if (message.deletionProtectionEnabled != null && message.hasOwnProperty("deletionProtectionEnabled")) - object.deletionProtectionEnabled = $root.google.protobuf.BoolValue.toObject(message.deletionProtectionEnabled, options); - if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (message.deletionProtectionEnabled != null && Object.hasOwnProperty.call(message, "deletionProtectionEnabled")) + object.deletionProtectionEnabled = $root.google.protobuf.BoolValue.toObject(message.deletionProtectionEnabled, options, q + 1); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) object.timeZone = message.timeZone; - if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) - object.advancedMachineFeatures = $root.google.cloud.sql.v1beta4.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); - if (message.dataCacheConfig != null && message.hasOwnProperty("dataCacheConfig")) - object.dataCacheConfig = $root.google.cloud.sql.v1beta4.DataCacheConfig.toObject(message.dataCacheConfig, options); - if (message.edition != null && message.hasOwnProperty("edition")) + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) + object.advancedMachineFeatures = $root.google.cloud.sql.v1beta4.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options, q + 1); + if (message.dataCacheConfig != null && Object.hasOwnProperty.call(message, "dataCacheConfig")) + object.dataCacheConfig = $root.google.cloud.sql.v1beta4.DataCacheConfig.toObject(message.dataCacheConfig, options, q + 1); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) object.edition = options.enums === String ? $root.google.cloud.sql.v1beta4.Settings.Edition[message.edition] === undefined ? message.edition : $root.google.cloud.sql.v1beta4.Settings.Edition[message.edition] : message.edition; - if (message.replicationLagMaxSeconds != null && message.hasOwnProperty("replicationLagMaxSeconds")) - object.replicationLagMaxSeconds = $root.google.protobuf.Int32Value.toObject(message.replicationLagMaxSeconds, options); - if (message.enableGoogleMlIntegration != null && message.hasOwnProperty("enableGoogleMlIntegration")) - object.enableGoogleMlIntegration = $root.google.protobuf.BoolValue.toObject(message.enableGoogleMlIntegration, options); - if (message.enableDataplexIntegration != null && message.hasOwnProperty("enableDataplexIntegration")) - object.enableDataplexIntegration = $root.google.protobuf.BoolValue.toObject(message.enableDataplexIntegration, options); - if (message.retainBackupsOnDelete != null && message.hasOwnProperty("retainBackupsOnDelete")) - object.retainBackupsOnDelete = $root.google.protobuf.BoolValue.toObject(message.retainBackupsOnDelete, options); - if (message.dataDiskProvisionedIops != null && message.hasOwnProperty("dataDiskProvisionedIops")) { - if (typeof message.dataDiskProvisionedIops === "number") + if (message.replicationLagMaxSeconds != null && Object.hasOwnProperty.call(message, "replicationLagMaxSeconds")) + object.replicationLagMaxSeconds = $root.google.protobuf.Int32Value.toObject(message.replicationLagMaxSeconds, options, q + 1); + if (message.enableGoogleMlIntegration != null && Object.hasOwnProperty.call(message, "enableGoogleMlIntegration")) + object.enableGoogleMlIntegration = $root.google.protobuf.BoolValue.toObject(message.enableGoogleMlIntegration, options, q + 1); + if (message.enableDataplexIntegration != null && Object.hasOwnProperty.call(message, "enableDataplexIntegration")) + object.enableDataplexIntegration = $root.google.protobuf.BoolValue.toObject(message.enableDataplexIntegration, options, q + 1); + if (message.retainBackupsOnDelete != null && Object.hasOwnProperty.call(message, "retainBackupsOnDelete")) + object.retainBackupsOnDelete = $root.google.protobuf.BoolValue.toObject(message.retainBackupsOnDelete, options, q + 1); + if (message.dataDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedIops")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.dataDiskProvisionedIops = typeof message.dataDiskProvisionedIops === "number" ? BigInt(message.dataDiskProvisionedIops) : $util.Long.fromBits(message.dataDiskProvisionedIops.low >>> 0, message.dataDiskProvisionedIops.high >>> 0, false).toBigInt(); + else if (typeof message.dataDiskProvisionedIops === "number") object.dataDiskProvisionedIops = options.longs === String ? String(message.dataDiskProvisionedIops) : message.dataDiskProvisionedIops; else object.dataDiskProvisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.dataDiskProvisionedIops) : options.longs === Number ? new $util.LongBits(message.dataDiskProvisionedIops.low >>> 0, message.dataDiskProvisionedIops.high >>> 0).toNumber() : message.dataDiskProvisionedIops; if (options.oneofs) object._dataDiskProvisionedIops = "dataDiskProvisionedIops"; } - if (message.dataDiskProvisionedThroughput != null && message.hasOwnProperty("dataDiskProvisionedThroughput")) { - if (typeof message.dataDiskProvisionedThroughput === "number") + if (message.dataDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "dataDiskProvisionedThroughput")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.dataDiskProvisionedThroughput = typeof message.dataDiskProvisionedThroughput === "number" ? BigInt(message.dataDiskProvisionedThroughput) : $util.Long.fromBits(message.dataDiskProvisionedThroughput.low >>> 0, message.dataDiskProvisionedThroughput.high >>> 0, false).toBigInt(); + else if (typeof message.dataDiskProvisionedThroughput === "number") object.dataDiskProvisionedThroughput = options.longs === String ? String(message.dataDiskProvisionedThroughput) : message.dataDiskProvisionedThroughput; else object.dataDiskProvisionedThroughput = options.longs === String ? $util.Long.prototype.toString.call(message.dataDiskProvisionedThroughput) : options.longs === Number ? new $util.LongBits(message.dataDiskProvisionedThroughput.low >>> 0, message.dataDiskProvisionedThroughput.high >>> 0).toNumber() : message.dataDiskProvisionedThroughput; if (options.oneofs) object._dataDiskProvisionedThroughput = "dataDiskProvisionedThroughput"; } - if (message.connectionPoolConfig != null && message.hasOwnProperty("connectionPoolConfig")) { - object.connectionPoolConfig = $root.google.cloud.sql.v1beta4.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options); + if (message.connectionPoolConfig != null && Object.hasOwnProperty.call(message, "connectionPoolConfig")) { + object.connectionPoolConfig = $root.google.cloud.sql.v1beta4.ConnectionPoolConfig.toObject(message.connectionPoolConfig, options, q + 1); if (options.oneofs) object._connectionPoolConfig = "connectionPoolConfig"; } - if (message.finalBackupConfig != null && message.hasOwnProperty("finalBackupConfig")) { - object.finalBackupConfig = $root.google.cloud.sql.v1beta4.FinalBackupConfig.toObject(message.finalBackupConfig, options); + if (message.finalBackupConfig != null && Object.hasOwnProperty.call(message, "finalBackupConfig")) { + object.finalBackupConfig = $root.google.cloud.sql.v1beta4.FinalBackupConfig.toObject(message.finalBackupConfig, options, q + 1); if (options.oneofs) object._finalBackupConfig = "finalBackupConfig"; } - if (message.readPoolAutoScaleConfig != null && message.hasOwnProperty("readPoolAutoScaleConfig")) { - object.readPoolAutoScaleConfig = $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.toObject(message.readPoolAutoScaleConfig, options); + if (message.readPoolAutoScaleConfig != null && Object.hasOwnProperty.call(message, "readPoolAutoScaleConfig")) { + object.readPoolAutoScaleConfig = $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.toObject(message.readPoolAutoScaleConfig, options, q + 1); if (options.oneofs) object._readPoolAutoScaleConfig = "readPoolAutoScaleConfig"; } - if (message.acceleratedReplicaMode != null && message.hasOwnProperty("acceleratedReplicaMode")) - object.acceleratedReplicaMode = $root.google.protobuf.BoolValue.toObject(message.acceleratedReplicaMode, options); - if (message.autoUpgradeEnabled != null && message.hasOwnProperty("autoUpgradeEnabled")) { + if (message.acceleratedReplicaMode != null && Object.hasOwnProperty.call(message, "acceleratedReplicaMode")) + object.acceleratedReplicaMode = $root.google.protobuf.BoolValue.toObject(message.acceleratedReplicaMode, options, q + 1); + if (message.autoUpgradeEnabled != null && Object.hasOwnProperty.call(message, "autoUpgradeEnabled")) { object.autoUpgradeEnabled = message.autoUpgradeEnabled; if (options.oneofs) object._autoUpgradeEnabled = "autoUpgradeEnabled"; } - if (message.entraidConfig != null && message.hasOwnProperty("entraidConfig")) - object.entraidConfig = $root.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.toObject(message.entraidConfig, options); - if (message.dataApiAccess != null && message.hasOwnProperty("dataApiAccess")) { + if (message.entraidConfig != null && Object.hasOwnProperty.call(message, "entraidConfig")) + object.entraidConfig = $root.google.cloud.sql.v1beta4.SqlServerEntraIdConfig.toObject(message.entraidConfig, options, q + 1); + if (message.dataApiAccess != null && Object.hasOwnProperty.call(message, "dataApiAccess")) { object.dataApiAccess = options.enums === String ? $root.google.cloud.sql.v1beta4.Settings.DataApiAccess[message.dataApiAccess] === undefined ? message.dataApiAccess : $root.google.cloud.sql.v1beta4.Settings.DataApiAccess[message.dataApiAccess] : message.dataApiAccess; if (options.oneofs) object._dataApiAccess = "dataApiAccess"; } - if (message.performanceCaptureConfig != null && message.hasOwnProperty("performanceCaptureConfig")) - object.performanceCaptureConfig = $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.toObject(message.performanceCaptureConfig, options); + if (message.performanceCaptureConfig != null && Object.hasOwnProperty.call(message, "performanceCaptureConfig")) + object.performanceCaptureConfig = $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.toObject(message.performanceCaptureConfig, options, q + 1); return object; }; @@ -137394,9 +141400,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerformanceCaptureConfig.encode = function encode(message, writer) { + PerformanceCaptureConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); if (message.probingIntervalSeconds != null && Object.hasOwnProperty.call(message, "probingIntervalSeconds")) @@ -137439,7 +141449,7 @@ * @returns {$protobuf.Writer} Writer */ PerformanceCaptureConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -137564,74 +141574,74 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { properties._enabled = 1; if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; } - if (message.probingIntervalSeconds != null && message.hasOwnProperty("probingIntervalSeconds")) { + if (message.probingIntervalSeconds != null && Object.hasOwnProperty.call(message, "probingIntervalSeconds")) { properties._probingIntervalSeconds = 1; if (!$util.isInteger(message.probingIntervalSeconds)) return "probingIntervalSeconds: integer expected"; } - if (message.probeThreshold != null && message.hasOwnProperty("probeThreshold")) { + if (message.probeThreshold != null && Object.hasOwnProperty.call(message, "probeThreshold")) { properties._probeThreshold = 1; if (!$util.isInteger(message.probeThreshold)) return "probeThreshold: integer expected"; } - if (message.runningThreadsThreshold != null && message.hasOwnProperty("runningThreadsThreshold")) { + if (message.runningThreadsThreshold != null && Object.hasOwnProperty.call(message, "runningThreadsThreshold")) { properties._runningThreadsThreshold = 1; if (!$util.isInteger(message.runningThreadsThreshold)) return "runningThreadsThreshold: integer expected"; } - if (message.secondsBehindSourceThreshold != null && message.hasOwnProperty("secondsBehindSourceThreshold")) { + if (message.secondsBehindSourceThreshold != null && Object.hasOwnProperty.call(message, "secondsBehindSourceThreshold")) { properties._secondsBehindSourceThreshold = 1; if (!$util.isInteger(message.secondsBehindSourceThreshold)) return "secondsBehindSourceThreshold: integer expected"; } - if (message.transactionDurationThreshold != null && message.hasOwnProperty("transactionDurationThreshold")) { + if (message.transactionDurationThreshold != null && Object.hasOwnProperty.call(message, "transactionDurationThreshold")) { properties._transactionDurationThreshold = 1; if (!$util.isInteger(message.transactionDurationThreshold)) return "transactionDurationThreshold: integer expected"; } - if (message.cpuUtilizationThresholdPercent != null && message.hasOwnProperty("cpuUtilizationThresholdPercent")) { + if (message.cpuUtilizationThresholdPercent != null && Object.hasOwnProperty.call(message, "cpuUtilizationThresholdPercent")) { properties._cpuUtilizationThresholdPercent = 1; if (!$util.isInteger(message.cpuUtilizationThresholdPercent)) return "cpuUtilizationThresholdPercent: integer expected"; } - if (message.memoryUsageThresholdPercent != null && message.hasOwnProperty("memoryUsageThresholdPercent")) { + if (message.memoryUsageThresholdPercent != null && Object.hasOwnProperty.call(message, "memoryUsageThresholdPercent")) { properties._memoryUsageThresholdPercent = 1; if (!$util.isInteger(message.memoryUsageThresholdPercent)) return "memoryUsageThresholdPercent: integer expected"; } - if (message.transactionLockWaitThresholdCount != null && message.hasOwnProperty("transactionLockWaitThresholdCount")) { + if (message.transactionLockWaitThresholdCount != null && Object.hasOwnProperty.call(message, "transactionLockWaitThresholdCount")) { properties._transactionLockWaitThresholdCount = 1; if (!$util.isInteger(message.transactionLockWaitThresholdCount)) return "transactionLockWaitThresholdCount: integer expected"; } - if (message.semaphoreWaitThresholdCount != null && message.hasOwnProperty("semaphoreWaitThresholdCount")) { + if (message.semaphoreWaitThresholdCount != null && Object.hasOwnProperty.call(message, "semaphoreWaitThresholdCount")) { properties._semaphoreWaitThresholdCount = 1; if (!$util.isInteger(message.semaphoreWaitThresholdCount)) return "semaphoreWaitThresholdCount: integer expected"; } - if (message.historyListLengthThresholdCount != null && message.hasOwnProperty("historyListLengthThresholdCount")) { + if (message.historyListLengthThresholdCount != null && Object.hasOwnProperty.call(message, "historyListLengthThresholdCount")) { properties._historyListLengthThresholdCount = 1; if (!$util.isInteger(message.historyListLengthThresholdCount)) return "historyListLengthThresholdCount: integer expected"; } - if (message.transactionKillThresholdSeconds != null && message.hasOwnProperty("transactionKillThresholdSeconds")) { + if (message.transactionKillThresholdSeconds != null && Object.hasOwnProperty.call(message, "transactionKillThresholdSeconds")) { properties._transactionKillThresholdSeconds = 1; if (!$util.isInteger(message.transactionKillThresholdSeconds)) return "transactionKillThresholdSeconds: integer expected"; } - if (message.transactionKillExcludedUserHosts != null && message.hasOwnProperty("transactionKillExcludedUserHosts")) { + if (message.transactionKillExcludedUserHosts != null && Object.hasOwnProperty.call(message, "transactionKillExcludedUserHosts")) { if (!Array.isArray(message.transactionKillExcludedUserHosts)) return "transactionKillExcludedUserHosts: array expected"; for (var i = 0; i < message.transactionKillExcludedUserHosts.length; ++i) if (!$util.isString(message.transactionKillExcludedUserHosts[i])) return "transactionKillExcludedUserHosts: string[] expected"; } - if (message.transactionKillType != null && message.hasOwnProperty("transactionKillType")) { + if (message.transactionKillType != null && Object.hasOwnProperty.call(message, "transactionKillType")) { properties._transactionKillType = 1; switch (message.transactionKillType) { default: @@ -137656,6 +141666,8 @@ PerformanceCaptureConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PerformanceCaptureConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -137724,68 +141736,72 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PerformanceCaptureConfig.toObject = function toObject(message, options) { + PerformanceCaptureConfig.toObject = function toObject(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.transactionKillExcludedUserHosts = []; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { object.enabled = message.enabled; if (options.oneofs) object._enabled = "enabled"; } - if (message.probingIntervalSeconds != null && message.hasOwnProperty("probingIntervalSeconds")) { + if (message.probingIntervalSeconds != null && Object.hasOwnProperty.call(message, "probingIntervalSeconds")) { object.probingIntervalSeconds = message.probingIntervalSeconds; if (options.oneofs) object._probingIntervalSeconds = "probingIntervalSeconds"; } - if (message.probeThreshold != null && message.hasOwnProperty("probeThreshold")) { + if (message.probeThreshold != null && Object.hasOwnProperty.call(message, "probeThreshold")) { object.probeThreshold = message.probeThreshold; if (options.oneofs) object._probeThreshold = "probeThreshold"; } - if (message.runningThreadsThreshold != null && message.hasOwnProperty("runningThreadsThreshold")) { + if (message.runningThreadsThreshold != null && Object.hasOwnProperty.call(message, "runningThreadsThreshold")) { object.runningThreadsThreshold = message.runningThreadsThreshold; if (options.oneofs) object._runningThreadsThreshold = "runningThreadsThreshold"; } - if (message.secondsBehindSourceThreshold != null && message.hasOwnProperty("secondsBehindSourceThreshold")) { + if (message.secondsBehindSourceThreshold != null && Object.hasOwnProperty.call(message, "secondsBehindSourceThreshold")) { object.secondsBehindSourceThreshold = message.secondsBehindSourceThreshold; if (options.oneofs) object._secondsBehindSourceThreshold = "secondsBehindSourceThreshold"; } - if (message.transactionDurationThreshold != null && message.hasOwnProperty("transactionDurationThreshold")) { + if (message.transactionDurationThreshold != null && Object.hasOwnProperty.call(message, "transactionDurationThreshold")) { object.transactionDurationThreshold = message.transactionDurationThreshold; if (options.oneofs) object._transactionDurationThreshold = "transactionDurationThreshold"; } - if (message.cpuUtilizationThresholdPercent != null && message.hasOwnProperty("cpuUtilizationThresholdPercent")) { + if (message.cpuUtilizationThresholdPercent != null && Object.hasOwnProperty.call(message, "cpuUtilizationThresholdPercent")) { object.cpuUtilizationThresholdPercent = message.cpuUtilizationThresholdPercent; if (options.oneofs) object._cpuUtilizationThresholdPercent = "cpuUtilizationThresholdPercent"; } - if (message.memoryUsageThresholdPercent != null && message.hasOwnProperty("memoryUsageThresholdPercent")) { + if (message.memoryUsageThresholdPercent != null && Object.hasOwnProperty.call(message, "memoryUsageThresholdPercent")) { object.memoryUsageThresholdPercent = message.memoryUsageThresholdPercent; if (options.oneofs) object._memoryUsageThresholdPercent = "memoryUsageThresholdPercent"; } - if (message.transactionLockWaitThresholdCount != null && message.hasOwnProperty("transactionLockWaitThresholdCount")) { + if (message.transactionLockWaitThresholdCount != null && Object.hasOwnProperty.call(message, "transactionLockWaitThresholdCount")) { object.transactionLockWaitThresholdCount = message.transactionLockWaitThresholdCount; if (options.oneofs) object._transactionLockWaitThresholdCount = "transactionLockWaitThresholdCount"; } - if (message.semaphoreWaitThresholdCount != null && message.hasOwnProperty("semaphoreWaitThresholdCount")) { + if (message.semaphoreWaitThresholdCount != null && Object.hasOwnProperty.call(message, "semaphoreWaitThresholdCount")) { object.semaphoreWaitThresholdCount = message.semaphoreWaitThresholdCount; if (options.oneofs) object._semaphoreWaitThresholdCount = "semaphoreWaitThresholdCount"; } - if (message.historyListLengthThresholdCount != null && message.hasOwnProperty("historyListLengthThresholdCount")) { + if (message.historyListLengthThresholdCount != null && Object.hasOwnProperty.call(message, "historyListLengthThresholdCount")) { object.historyListLengthThresholdCount = message.historyListLengthThresholdCount; if (options.oneofs) object._historyListLengthThresholdCount = "historyListLengthThresholdCount"; } - if (message.transactionKillThresholdSeconds != null && message.hasOwnProperty("transactionKillThresholdSeconds")) { + if (message.transactionKillThresholdSeconds != null && Object.hasOwnProperty.call(message, "transactionKillThresholdSeconds")) { object.transactionKillThresholdSeconds = message.transactionKillThresholdSeconds; if (options.oneofs) object._transactionKillThresholdSeconds = "transactionKillThresholdSeconds"; @@ -137795,7 +141811,7 @@ for (var j = 0; j < message.transactionKillExcludedUserHosts.length; ++j) object.transactionKillExcludedUserHosts[j] = message.transactionKillExcludedUserHosts[j]; } - if (message.transactionKillType != null && message.hasOwnProperty("transactionKillType")) { + if (message.transactionKillType != null && Object.hasOwnProperty.call(message, "transactionKillType")) { object.transactionKillType = options.enums === String ? $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType[message.transactionKillType] === undefined ? message.transactionKillType : $root.google.cloud.sql.v1beta4.PerformanceCaptureConfig.TransactionKillType[message.transactionKillType] : message.transactionKillType; if (options.oneofs) object._transactionKillType = "transactionKillType"; @@ -137901,9 +141917,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdvancedMachineFeatures.encode = function encode(message, writer) { + AdvancedMachineFeatures.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.threadsPerCore); return writer; @@ -137919,7 +141939,7 @@ * @returns {$protobuf.Writer} Writer */ AdvancedMachineFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -137989,7 +142009,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) if (!$util.isInteger(message.threadsPerCore)) return "threadsPerCore: integer expected"; return null; @@ -138006,6 +142026,8 @@ AdvancedMachineFeatures.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.AdvancedMachineFeatures) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.AdvancedMachineFeatures: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -138025,13 +142047,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdvancedMachineFeatures.toObject = function toObject(message, options) { + AdvancedMachineFeatures.toObject = function toObject(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.threadsPerCore = 0; - if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) object.threadsPerCore = message.threadsPerCore; return object; }; @@ -138190,9 +142216,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCert.encode = function encode(message, writer) { + SslCert.encode = function encode(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.certSerialNumber != null && Object.hasOwnProperty.call(message, "certSerialNumber")) @@ -138200,11 +142230,11 @@ if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.cert); 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.commonName != null && Object.hasOwnProperty.call(message, "commonName")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.commonName); if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) - $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.sha1Fingerprint); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -138224,7 +142254,7 @@ * @returns {$protobuf.Writer} Writer */ SslCert.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -138326,35 +142356,35 @@ 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.certSerialNumber != null && message.hasOwnProperty("certSerialNumber")) + if (message.certSerialNumber != null && Object.hasOwnProperty.call(message, "certSerialNumber")) if (!$util.isString(message.certSerialNumber)) return "certSerialNumber: string expected"; - if (message.cert != null && message.hasOwnProperty("cert")) + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) if (!$util.isString(message.cert)) return "cert: 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.commonName != null && message.hasOwnProperty("commonName")) + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) if (!$util.isString(message.commonName)) return "commonName: string expected"; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) { + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) { var error = $root.google.protobuf.Timestamp.verify(message.expirationTime, long + 1); if (error) return "expirationTime." + error; } - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) if (!$util.isString(message.sha1Fingerprint)) return "sha1Fingerprint: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) if (!$util.isString(message.selfLink)) return "selfLink: string expected"; return null; @@ -138371,6 +142401,8 @@ SslCert.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SslCert) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SslCert: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -138383,14 +142415,14 @@ if (object.cert != null) message.cert = String(object.cert); if (object.createTime != null) { - if (typeof object.createTime !== "object") + if (!$util.isObject(object.createTime)) throw TypeError(".google.cloud.sql.v1beta4.SslCert.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); } if (object.commonName != null) message.commonName = String(object.commonName); if (object.expirationTime != null) { - if (typeof object.expirationTime !== "object") + if (!$util.isObject(object.expirationTime)) throw TypeError(".google.cloud.sql.v1beta4.SslCert.expirationTime: object expected"); message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime, long + 1); } @@ -138412,9 +142444,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCert.toObject = function toObject(message, options) { + SslCert.toObject = function toObject(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 = ""; @@ -138427,23 +142463,23 @@ object.instance = ""; object.selfLink = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.certSerialNumber != null && message.hasOwnProperty("certSerialNumber")) + if (message.certSerialNumber != null && Object.hasOwnProperty.call(message, "certSerialNumber")) object.certSerialNumber = message.certSerialNumber; - if (message.cert != null && message.hasOwnProperty("cert")) + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) object.cert = message.cert; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.commonName != null && message.hasOwnProperty("commonName")) + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options, q + 1); + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) object.commonName = message.commonName; - if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) - object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options); - if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options, q + 1); + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) object.sha1Fingerprint = message.sha1Fingerprint; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.selfLink != null && message.hasOwnProperty("selfLink")) + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) object.selfLink = message.selfLink; return object; }; @@ -138539,11 +142575,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertDetail.encode = function encode(message, writer) { + SslCertDetail.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.certInfo != null && Object.hasOwnProperty.call(message, "certInfo")) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.certInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.certInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); if (message.certPrivateKey != null && Object.hasOwnProperty.call(message, "certPrivateKey")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.certPrivateKey); return writer; @@ -138559,7 +142599,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertDetail.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -138633,12 +142673,12 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.certInfo != null && message.hasOwnProperty("certInfo")) { + if (message.certInfo != null && Object.hasOwnProperty.call(message, "certInfo")) { var error = $root.google.cloud.sql.v1beta4.SslCert.verify(message.certInfo, long + 1); if (error) return "certInfo." + error; } - if (message.certPrivateKey != null && message.hasOwnProperty("certPrivateKey")) + if (message.certPrivateKey != null && Object.hasOwnProperty.call(message, "certPrivateKey")) if (!$util.isString(message.certPrivateKey)) return "certPrivateKey: string expected"; return null; @@ -138655,13 +142695,15 @@ SslCertDetail.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SslCertDetail) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SslCertDetail: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.SslCertDetail(); if (object.certInfo != null) { - if (typeof object.certInfo !== "object") + if (!$util.isObject(object.certInfo)) throw TypeError(".google.cloud.sql.v1beta4.SslCertDetail.certInfo: object expected"); message.certInfo = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.certInfo, long + 1); } @@ -138679,17 +142721,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertDetail.toObject = function toObject(message, options) { + SslCertDetail.toObject = function toObject(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.certInfo = null; object.certPrivateKey = ""; } - if (message.certInfo != null && message.hasOwnProperty("certInfo")) - object.certInfo = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.certInfo, options); - if (message.certPrivateKey != null && message.hasOwnProperty("certPrivateKey")) + if (message.certInfo != null && Object.hasOwnProperty.call(message, "certInfo")) + object.certInfo = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.certInfo, options, q + 1); + if (message.certPrivateKey != null && Object.hasOwnProperty.call(message, "certPrivateKey")) object.certPrivateKey = message.certPrivateKey; return object; }; @@ -138785,9 +142831,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsCreateEphemeralRequest.encode = function encode(message, writer) { + SslCertsCreateEphemeralRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.publicKey); if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) @@ -138805,7 +142855,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsCreateEphemeralRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -138879,10 +142929,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) if (!$util.isString(message.publicKey)) return "publicKey: string expected"; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) if (!$util.isString(message.accessToken)) return "accessToken: string expected"; return null; @@ -138899,6 +142949,8 @@ SslCertsCreateEphemeralRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SslCertsCreateEphemeralRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -138920,17 +142972,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsCreateEphemeralRequest.toObject = function toObject(message, options) { + SslCertsCreateEphemeralRequest.toObject = function toObject(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.publicKey = ""; object.accessToken = ""; } - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) object.publicKey = message.publicKey; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) object.accessToken = message.accessToken; return object; }; @@ -139017,9 +143073,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsInsertRequest.encode = function encode(message, writer) { + SslCertsInsertRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.commonName); return writer; @@ -139035,7 +143095,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -139105,7 +143165,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.commonName != null && message.hasOwnProperty("commonName")) + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) if (!$util.isString(message.commonName)) return "commonName: string expected"; return null; @@ -139122,6 +143182,8 @@ SslCertsInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SslCertsInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SslCertsInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -139141,13 +143203,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsInsertRequest.toObject = function toObject(message, options) { + SslCertsInsertRequest.toObject = function toObject(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.commonName = ""; - if (message.commonName != null && message.hasOwnProperty("commonName")) + if (message.commonName != null && Object.hasOwnProperty.call(message, "commonName")) object.commonName = message.commonName; return object; }; @@ -139234,11 +143300,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlInstancesRescheduleMaintenanceRequestBody.encode = function encode(message, writer) { + SqlInstancesRescheduleMaintenanceRequestBody.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.reschedule != null && Object.hasOwnProperty.call(message, "reschedule")) - $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.encode(message.reschedule, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.encode(message.reschedule, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); return writer; }; @@ -139252,7 +143322,7 @@ * @returns {$protobuf.Writer} Writer */ SqlInstancesRescheduleMaintenanceRequestBody.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -139322,7 +143392,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.reschedule != null && message.hasOwnProperty("reschedule")) { + if (message.reschedule != null && Object.hasOwnProperty.call(message, "reschedule")) { var error = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.verify(message.reschedule, long + 1); if (error) return "reschedule." + error; @@ -139341,13 +143411,15 @@ SqlInstancesRescheduleMaintenanceRequestBody.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody(); if (object.reschedule != null) { - if (typeof object.reschedule !== "object") + if (!$util.isObject(object.reschedule)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.reschedule: object expected"); message.reschedule = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.fromObject(object.reschedule, long + 1); } @@ -139363,14 +143435,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlInstancesRescheduleMaintenanceRequestBody.toObject = function toObject(message, options) { + SqlInstancesRescheduleMaintenanceRequestBody.toObject = function toObject(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.reschedule = null; - if (message.reschedule != null && message.hasOwnProperty("reschedule")) - object.reschedule = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.toObject(message.reschedule, options); + if (message.reschedule != null && Object.hasOwnProperty.call(message, "reschedule")) + object.reschedule = $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.toObject(message.reschedule, options, q + 1); return object; }; @@ -139480,13 +143556,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Reschedule.encode = function encode(message, writer) { + Reschedule.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.rescheduleType != null && Object.hasOwnProperty.call(message, "rescheduleType")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rescheduleType); if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -139500,7 +143580,7 @@ * @returns {$protobuf.Writer} Writer */ Reschedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -139574,7 +143654,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + if (message.rescheduleType != null && Object.hasOwnProperty.call(message, "rescheduleType")) switch (message.rescheduleType) { default: return "rescheduleType: enum value expected"; @@ -139584,7 +143664,7 @@ case 3: break; } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) { var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime, long + 1); if (error) return "scheduleTime." + error; @@ -139603,6 +143683,8 @@ Reschedule.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -139633,7 +143715,7 @@ break; } if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") + if (!$util.isObject(object.scheduleTime)) throw TypeError(".google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.Reschedule.scheduleTime: object expected"); message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime, long + 1); } @@ -139649,18 +143731,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Reschedule.toObject = function toObject(message, options) { + Reschedule.toObject = function toObject(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.rescheduleType = options.enums === String ? "RESCHEDULE_TYPE_UNSPECIFIED" : 0; object.scheduleTime = null; } - if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + if (message.rescheduleType != null && Object.hasOwnProperty.call(message, "rescheduleType")) object.rescheduleType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType[message.rescheduleType] === undefined ? message.rescheduleType : $root.google.cloud.sql.v1beta4.SqlInstancesRescheduleMaintenanceRequestBody.RescheduleType[message.rescheduleType] : message.rescheduleType; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); + if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options, q + 1); return object; }; @@ -139776,17 +143862,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsInsertResponse.encode = function encode(message, writer) { + SslCertsInsertResponse.encode = function encode(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.operation != null && Object.hasOwnProperty.call(message, "operation")) - $root.google.cloud.sql.v1beta4.Operation.encode(message.operation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Operation.encode(message.operation, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCaCert, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCaCert, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.clientCert != null && Object.hasOwnProperty.call(message, "clientCert")) - $root.google.cloud.sql.v1beta4.SslCertDetail.encode(message.clientCert, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCertDetail.encode(message.clientCert, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -139800,7 +143890,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsInsertResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -139882,20 +143972,20 @@ 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.operation != null && message.hasOwnProperty("operation")) { + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) { var error = $root.google.cloud.sql.v1beta4.Operation.verify(message.operation, long + 1); if (error) return "operation." + error; } - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) { + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) { var error = $root.google.cloud.sql.v1beta4.SslCert.verify(message.serverCaCert, long + 1); if (error) return "serverCaCert." + error; } - if (message.clientCert != null && message.hasOwnProperty("clientCert")) { + if (message.clientCert != null && Object.hasOwnProperty.call(message, "clientCert")) { var error = $root.google.cloud.sql.v1beta4.SslCertDetail.verify(message.clientCert, long + 1); if (error) return "clientCert." + error; @@ -139914,6 +144004,8 @@ SslCertsInsertResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SslCertsInsertResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SslCertsInsertResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -139922,17 +144014,17 @@ if (object.kind != null) message.kind = String(object.kind); if (object.operation != null) { - if (typeof object.operation !== "object") + if (!$util.isObject(object.operation)) throw TypeError(".google.cloud.sql.v1beta4.SslCertsInsertResponse.operation: object expected"); message.operation = $root.google.cloud.sql.v1beta4.Operation.fromObject(object.operation, long + 1); } if (object.serverCaCert != null) { - if (typeof object.serverCaCert !== "object") + if (!$util.isObject(object.serverCaCert)) throw TypeError(".google.cloud.sql.v1beta4.SslCertsInsertResponse.serverCaCert: object expected"); message.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.serverCaCert, long + 1); } if (object.clientCert != null) { - if (typeof object.clientCert !== "object") + if (!$util.isObject(object.clientCert)) throw TypeError(".google.cloud.sql.v1beta4.SslCertsInsertResponse.clientCert: object expected"); message.clientCert = $root.google.cloud.sql.v1beta4.SslCertDetail.fromObject(object.clientCert, long + 1); } @@ -139948,9 +144040,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsInsertResponse.toObject = function toObject(message, options) { + SslCertsInsertResponse.toObject = function toObject(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 = ""; @@ -139958,14 +144054,14 @@ object.serverCaCert = null; object.clientCert = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = $root.google.cloud.sql.v1beta4.Operation.toObject(message.operation, options); - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) - object.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCaCert, options); - if (message.clientCert != null && message.hasOwnProperty("clientCert")) - object.clientCert = $root.google.cloud.sql.v1beta4.SslCertDetail.toObject(message.clientCert, options); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + object.operation = $root.google.cloud.sql.v1beta4.Operation.toObject(message.operation, options, q + 1); + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) + object.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCaCert, options, q + 1); + if (message.clientCert != null && Object.hasOwnProperty.call(message, "clientCert")) + object.clientCert = $root.google.cloud.sql.v1beta4.SslCertDetail.toObject(message.clientCert, options, q + 1); return object; }; @@ -140061,14 +144157,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SslCertsListResponse.encode = function encode(message, writer) { + SslCertsListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -140082,7 +144182,7 @@ * @returns {$protobuf.Writer} Writer */ SslCertsListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -140158,10 +144258,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -140184,6 +144284,8 @@ SslCertsListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SslCertsListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SslCertsListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -140196,7 +144298,7 @@ throw TypeError(".google.cloud.sql.v1beta4.SslCertsListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.SslCertsListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.items[i], long + 1); } @@ -140213,20 +144315,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SslCertsListResponse.toObject = function toObject(message, options) { + SslCertsListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.items[j], options, q + 1); } return object; }; @@ -140322,9 +144428,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TruncateLogContext.encode = function encode(message, writer) { + TruncateLogContext.encode = function encode(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.logType != null && Object.hasOwnProperty.call(message, "logType")) @@ -140342,7 +144452,7 @@ * @returns {$protobuf.Writer} Writer */ TruncateLogContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -140416,10 +144526,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.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; @@ -140436,6 +144546,8 @@ TruncateLogContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.TruncateLogContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.TruncateLogContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -140457,17 +144569,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TruncateLogContext.toObject = function toObject(message, options) { + TruncateLogContext.toObject = function toObject(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.logType = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.logType != null && message.hasOwnProperty("logType")) + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) object.logType = message.logType; return object; }; @@ -140600,9 +144716,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlActiveDirectoryConfig.encode = function encode(message, writer) { + SqlActiveDirectoryConfig.encode = function encode(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.domain != null && Object.hasOwnProperty.call(message, "domain")) @@ -140629,7 +144749,7 @@ * @returns {$protobuf.Writer} Writer */ SqlActiveDirectoryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -140721,13 +144841,13 @@ 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.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.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) switch (message.mode) { default: return "mode: enum value expected"; @@ -140737,17 +144857,17 @@ case 3: break; } - if (message.dnsServers != null && message.hasOwnProperty("dnsServers")) { + if (message.dnsServers != null && Object.hasOwnProperty.call(message, "dnsServers")) { if (!Array.isArray(message.dnsServers)) return "dnsServers: array expected"; for (var i = 0; i < message.dnsServers.length; ++i) if (!$util.isString(message.dnsServers[i])) return "dnsServers: string[] expected"; } - if (message.adminCredentialSecretName != null && message.hasOwnProperty("adminCredentialSecretName")) + if (message.adminCredentialSecretName != null && Object.hasOwnProperty.call(message, "adminCredentialSecretName")) if (!$util.isString(message.adminCredentialSecretName)) return "adminCredentialSecretName: string expected"; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) if (!$util.isString(message.organizationalUnit)) return "organizationalUnit: string expected"; return null; @@ -140764,6 +144884,8 @@ SqlActiveDirectoryConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlActiveDirectoryConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -140820,9 +144942,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlActiveDirectoryConfig.toObject = function toObject(message, options) { + SqlActiveDirectoryConfig.toObject = function toObject(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.dnsServers = []; @@ -140833,20 +144959,20 @@ object.adminCredentialSecretName = ""; object.organizationalUnit = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.domain != null && message.hasOwnProperty("domain")) + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) object.domain = message.domain; - if (message.mode != null && message.hasOwnProperty("mode")) + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) object.mode = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode[message.mode] === undefined ? message.mode : $root.google.cloud.sql.v1beta4.SqlActiveDirectoryConfig.ActiveDirectoryMode[message.mode] : message.mode; if (message.dnsServers && message.dnsServers.length) { object.dnsServers = []; for (var j = 0; j < message.dnsServers.length; ++j) object.dnsServers[j] = message.dnsServers[j]; } - if (message.adminCredentialSecretName != null && message.hasOwnProperty("adminCredentialSecretName")) + if (message.adminCredentialSecretName != null && Object.hasOwnProperty.call(message, "adminCredentialSecretName")) object.adminCredentialSecretName = message.adminCredentialSecretName; - if (message.organizationalUnit != null && message.hasOwnProperty("organizationalUnit")) + if (message.organizationalUnit != null && Object.hasOwnProperty.call(message, "organizationalUnit")) object.organizationalUnit = message.organizationalUnit; return object; }; @@ -140978,17 +145104,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerAuditConfig.encode = function encode(message, writer) { + SqlServerAuditConfig.encode = function encode(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.bucket != null && Object.hasOwnProperty.call(message, "bucket")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.bucket); if (message.retentionInterval != null && Object.hasOwnProperty.call(message, "retentionInterval")) - $root.google.protobuf.Duration.encode(message.retentionInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.retentionInterval, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.uploadInterval != null && Object.hasOwnProperty.call(message, "uploadInterval")) - $root.google.protobuf.Duration.encode(message.uploadInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.uploadInterval, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -141002,7 +145132,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerAuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -141084,18 +145214,18 @@ 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.bucket != null && message.hasOwnProperty("bucket")) + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) if (!$util.isString(message.bucket)) return "bucket: string expected"; - if (message.retentionInterval != null && message.hasOwnProperty("retentionInterval")) { + if (message.retentionInterval != null && Object.hasOwnProperty.call(message, "retentionInterval")) { var error = $root.google.protobuf.Duration.verify(message.retentionInterval, long + 1); if (error) return "retentionInterval." + error; } - if (message.uploadInterval != null && message.hasOwnProperty("uploadInterval")) { + if (message.uploadInterval != null && Object.hasOwnProperty.call(message, "uploadInterval")) { var error = $root.google.protobuf.Duration.verify(message.uploadInterval, long + 1); if (error) return "uploadInterval." + error; @@ -141114,6 +145244,8 @@ SqlServerAuditConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlServerAuditConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlServerAuditConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -141124,12 +145256,12 @@ if (object.bucket != null) message.bucket = String(object.bucket); if (object.retentionInterval != null) { - if (typeof object.retentionInterval !== "object") + if (!$util.isObject(object.retentionInterval)) throw TypeError(".google.cloud.sql.v1beta4.SqlServerAuditConfig.retentionInterval: object expected"); message.retentionInterval = $root.google.protobuf.Duration.fromObject(object.retentionInterval, long + 1); } if (object.uploadInterval != null) { - if (typeof object.uploadInterval !== "object") + if (!$util.isObject(object.uploadInterval)) throw TypeError(".google.cloud.sql.v1beta4.SqlServerAuditConfig.uploadInterval: object expected"); message.uploadInterval = $root.google.protobuf.Duration.fromObject(object.uploadInterval, long + 1); } @@ -141145,9 +145277,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerAuditConfig.toObject = function toObject(message, options) { + SqlServerAuditConfig.toObject = function toObject(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 = ""; @@ -141155,14 +145291,14 @@ object.retentionInterval = null; object.uploadInterval = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.bucket != null && message.hasOwnProperty("bucket")) + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) object.bucket = message.bucket; - if (message.retentionInterval != null && message.hasOwnProperty("retentionInterval")) - object.retentionInterval = $root.google.protobuf.Duration.toObject(message.retentionInterval, options); - if (message.uploadInterval != null && message.hasOwnProperty("uploadInterval")) - object.uploadInterval = $root.google.protobuf.Duration.toObject(message.uploadInterval, options); + if (message.retentionInterval != null && Object.hasOwnProperty.call(message, "retentionInterval")) + object.retentionInterval = $root.google.protobuf.Duration.toObject(message.retentionInterval, options, q + 1); + if (message.uploadInterval != null && Object.hasOwnProperty.call(message, "uploadInterval")) + object.uploadInterval = $root.google.protobuf.Duration.toObject(message.uploadInterval, options, q + 1); return object; }; @@ -141266,9 +145402,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerEntraIdConfig.encode = function encode(message, writer) { + SqlServerEntraIdConfig.encode = function encode(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.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) @@ -141288,7 +145428,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerEntraIdConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -141366,13 +145506,13 @@ 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.tenantId != null && message.hasOwnProperty("tenantId")) + if (message.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) if (!$util.isString(message.tenantId)) return "tenantId: string expected"; - if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) if (!$util.isString(message.applicationId)) return "applicationId: string expected"; return null; @@ -141389,6 +145529,8 @@ SqlServerEntraIdConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlServerEntraIdConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlServerEntraIdConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -141412,20 +145554,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerEntraIdConfig.toObject = function toObject(message, options) { + SqlServerEntraIdConfig.toObject = function toObject(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.tenantId = ""; object.applicationId = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.tenantId != null && message.hasOwnProperty("tenantId")) + if (message.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) object.tenantId = message.tenantId; - if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) object.applicationId = message.applicationId; return object; }; @@ -141641,9 +145787,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectionPoolFlags.encode = function encode(message, writer) { + ConnectionPoolFlags.encode = function encode(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 && Object.hasOwnProperty.call(message, "value")) @@ -141661,7 +145811,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectionPoolFlags.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -141735,10 +145885,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 (!$util.isString(message.value)) return "value: string expected"; return null; @@ -141755,6 +145905,8 @@ ConnectionPoolFlags.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ConnectionPoolFlags) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ConnectionPoolFlags: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -141776,17 +145928,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectionPoolFlags.toObject = function toObject(message, options) { + ConnectionPoolFlags.toObject = function toObject(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.value = ""; } - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -141967,9 +146123,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadPoolAutoScaleConfig.encode = function encode(message, writer) { + ReadPoolAutoScaleConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) @@ -141978,7 +146138,7 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodeCount); if (message.targetMetrics != null && message.targetMetrics.length) for (var i = 0; i < message.targetMetrics.length; ++i) - $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.encode(message.targetMetrics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.encode(message.targetMetrics[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.disableScaleIn != null && Object.hasOwnProperty.call(message, "disableScaleIn")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disableScaleIn); if (message.scaleInCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleInCooldownSeconds")) @@ -141998,7 +146158,7 @@ * @returns {$protobuf.Writer} Writer */ ReadPoolAutoScaleConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -142095,22 +146255,22 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { properties._enabled = 1; if (typeof message.enabled !== "boolean") return "enabled: boolean expected"; } - if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) { + if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) { properties._minNodeCount = 1; if (!$util.isInteger(message.minNodeCount)) return "minNodeCount: integer expected"; } - if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) { + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) { properties._maxNodeCount = 1; if (!$util.isInteger(message.maxNodeCount)) return "maxNodeCount: integer expected"; } - if (message.targetMetrics != null && message.hasOwnProperty("targetMetrics")) { + if (message.targetMetrics != null && Object.hasOwnProperty.call(message, "targetMetrics")) { if (!Array.isArray(message.targetMetrics)) return "targetMetrics: array expected"; for (var i = 0; i < message.targetMetrics.length; ++i) { @@ -142119,17 +146279,17 @@ return "targetMetrics." + error; } } - if (message.disableScaleIn != null && message.hasOwnProperty("disableScaleIn")) { + if (message.disableScaleIn != null && Object.hasOwnProperty.call(message, "disableScaleIn")) { properties._disableScaleIn = 1; if (typeof message.disableScaleIn !== "boolean") return "disableScaleIn: boolean expected"; } - if (message.scaleInCooldownSeconds != null && message.hasOwnProperty("scaleInCooldownSeconds")) { + if (message.scaleInCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleInCooldownSeconds")) { properties._scaleInCooldownSeconds = 1; if (!$util.isInteger(message.scaleInCooldownSeconds)) return "scaleInCooldownSeconds: integer expected"; } - if (message.scaleOutCooldownSeconds != null && message.hasOwnProperty("scaleOutCooldownSeconds")) { + if (message.scaleOutCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleOutCooldownSeconds")) { properties._scaleOutCooldownSeconds = 1; if (!$util.isInteger(message.scaleOutCooldownSeconds)) return "scaleOutCooldownSeconds: integer expected"; @@ -142148,6 +146308,8 @@ ReadPoolAutoScaleConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -142164,7 +146326,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.targetMetrics: array expected"); message.targetMetrics = []; for (var i = 0; i < object.targetMetrics.length; ++i) { - if (typeof object.targetMetrics[i] !== "object") + if (!$util.isObject(object.targetMetrics[i])) throw TypeError(".google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.targetMetrics: object expected"); message.targetMetrics[i] = $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.fromObject(object.targetMetrics[i], long + 1); } @@ -142187,23 +146349,27 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadPoolAutoScaleConfig.toObject = function toObject(message, options) { + ReadPoolAutoScaleConfig.toObject = function toObject(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.targetMetrics = []; - if (message.enabled != null && message.hasOwnProperty("enabled")) { + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) { object.enabled = message.enabled; if (options.oneofs) object._enabled = "enabled"; } - if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) { + if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) { object.minNodeCount = message.minNodeCount; if (options.oneofs) object._minNodeCount = "minNodeCount"; } - if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) { + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) { object.maxNodeCount = message.maxNodeCount; if (options.oneofs) object._maxNodeCount = "maxNodeCount"; @@ -142211,19 +146377,19 @@ if (message.targetMetrics && message.targetMetrics.length) { object.targetMetrics = []; for (var j = 0; j < message.targetMetrics.length; ++j) - object.targetMetrics[j] = $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.toObject(message.targetMetrics[j], options); + object.targetMetrics[j] = $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric.toObject(message.targetMetrics[j], options, q + 1); } - if (message.disableScaleIn != null && message.hasOwnProperty("disableScaleIn")) { + if (message.disableScaleIn != null && Object.hasOwnProperty.call(message, "disableScaleIn")) { object.disableScaleIn = message.disableScaleIn; if (options.oneofs) object._disableScaleIn = "disableScaleIn"; } - if (message.scaleInCooldownSeconds != null && message.hasOwnProperty("scaleInCooldownSeconds")) { + if (message.scaleInCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleInCooldownSeconds")) { object.scaleInCooldownSeconds = message.scaleInCooldownSeconds; if (options.oneofs) object._scaleInCooldownSeconds = "scaleInCooldownSeconds"; } - if (message.scaleOutCooldownSeconds != null && message.hasOwnProperty("scaleOutCooldownSeconds")) { + if (message.scaleOutCooldownSeconds != null && Object.hasOwnProperty.call(message, "scaleOutCooldownSeconds")) { object.scaleOutCooldownSeconds = message.scaleOutCooldownSeconds; if (options.oneofs) object._scaleOutCooldownSeconds = "scaleOutCooldownSeconds"; @@ -142334,9 +146500,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TargetMetric.encode = function encode(message, writer) { + TargetMetric.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.metric); if (message.targetValue != null && Object.hasOwnProperty.call(message, "targetValue")) @@ -142354,7 +146524,7 @@ * @returns {$protobuf.Writer} Writer */ TargetMetric.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -142429,12 +146599,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.metric != null && message.hasOwnProperty("metric")) { + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) { properties._metric = 1; if (!$util.isString(message.metric)) return "metric: string expected"; } - if (message.targetValue != null && message.hasOwnProperty("targetValue")) { + if (message.targetValue != null && Object.hasOwnProperty.call(message, "targetValue")) { properties._targetValue = 1; if (typeof message.targetValue !== "number") return "targetValue: number expected"; @@ -142453,6 +146623,8 @@ TargetMetric.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ReadPoolAutoScaleConfig.TargetMetric: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -142474,16 +146646,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TargetMetric.toObject = function toObject(message, options) { + TargetMetric.toObject = function 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.metric != null && message.hasOwnProperty("metric")) { + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) { object.metric = message.metric; if (options.oneofs) object._metric = "metric"; } - if (message.targetValue != null && message.hasOwnProperty("targetValue")) { + if (message.targetValue != null && Object.hasOwnProperty.call(message, "targetValue")) { object.targetValue = options.json && !isFinite(message.targetValue) ? String(message.targetValue) : message.targetValue; if (options.oneofs) object._targetValue = "targetValue"; @@ -142610,14 +146786,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectionPoolConfig.encode = function encode(message, writer) { + ConnectionPoolConfig.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.connectionPoolingEnabled != null && Object.hasOwnProperty.call(message, "connectionPoolingEnabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.connectionPoolingEnabled); if (message.flags != null && message.flags.length) for (var i = 0; i < message.flags.length; ++i) - $root.google.cloud.sql.v1beta4.ConnectionPoolFlags.encode(message.flags[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ConnectionPoolFlags.encode(message.flags[i], writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.poolerCount); return writer; @@ -142633,7 +146813,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectionPoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -142714,12 +146894,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.connectionPoolingEnabled != null && message.hasOwnProperty("connectionPoolingEnabled")) { + if (message.connectionPoolingEnabled != null && Object.hasOwnProperty.call(message, "connectionPoolingEnabled")) { properties._connectionPoolingEnabled = 1; if (typeof message.connectionPoolingEnabled !== "boolean") return "connectionPoolingEnabled: boolean expected"; } - if (message.flags != null && message.hasOwnProperty("flags")) { + if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) { if (!Array.isArray(message.flags)) return "flags: array expected"; for (var i = 0; i < message.flags.length; ++i) { @@ -142728,7 +146908,7 @@ return "flags." + error; } } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) { + if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) { properties._poolerCount = 1; if (!$util.isInteger(message.poolerCount)) return "poolerCount: integer expected"; @@ -142747,6 +146927,8 @@ ConnectionPoolConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ConnectionPoolConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ConnectionPoolConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -142759,7 +146941,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ConnectionPoolConfig.flags: array expected"); message.flags = []; for (var i = 0; i < object.flags.length; ++i) { - if (typeof object.flags[i] !== "object") + if (!$util.isObject(object.flags[i])) throw TypeError(".google.cloud.sql.v1beta4.ConnectionPoolConfig.flags: object expected"); message.flags[i] = $root.google.cloud.sql.v1beta4.ConnectionPoolFlags.fromObject(object.flags[i], long + 1); } @@ -142778,13 +146960,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectionPoolConfig.toObject = function toObject(message, options) { + ConnectionPoolConfig.toObject = function toObject(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.flags = []; - if (message.connectionPoolingEnabled != null && message.hasOwnProperty("connectionPoolingEnabled")) { + if (message.connectionPoolingEnabled != null && Object.hasOwnProperty.call(message, "connectionPoolingEnabled")) { object.connectionPoolingEnabled = message.connectionPoolingEnabled; if (options.oneofs) object._connectionPoolingEnabled = "connectionPoolingEnabled"; @@ -142792,9 +146978,9 @@ if (message.flags && message.flags.length) { object.flags = []; for (var j = 0; j < message.flags.length; ++j) - object.flags[j] = $root.google.cloud.sql.v1beta4.ConnectionPoolFlags.toObject(message.flags[j], options); + object.flags[j] = $root.google.cloud.sql.v1beta4.ConnectionPoolFlags.toObject(message.flags[j], options, q + 1); } - if (message.poolerCount != null && message.hasOwnProperty("poolerCount")) { + if (message.poolerCount != null && Object.hasOwnProperty.call(message, "poolerCount")) { object.poolerCount = message.poolerCount; if (options.oneofs) object._poolerCount = "poolerCount"; @@ -143168,9 +147354,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AcquireSsrsLeaseContext.encode = function encode(message, writer) { + AcquireSsrsLeaseContext.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.setupLogin != null && Object.hasOwnProperty.call(message, "setupLogin")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.setupLogin); if (message.serviceLogin != null && Object.hasOwnProperty.call(message, "serviceLogin")) @@ -143178,7 +147368,7 @@ if (message.reportDatabase != null && Object.hasOwnProperty.call(message, "reportDatabase")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.reportDatabase); if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -143192,7 +147382,7 @@ * @returns {$protobuf.Writer} Writer */ AcquireSsrsLeaseContext.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -143275,22 +147465,22 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.setupLogin != null && message.hasOwnProperty("setupLogin")) { + if (message.setupLogin != null && Object.hasOwnProperty.call(message, "setupLogin")) { properties._setupLogin = 1; if (!$util.isString(message.setupLogin)) return "setupLogin: string expected"; } - if (message.serviceLogin != null && message.hasOwnProperty("serviceLogin")) { + if (message.serviceLogin != null && Object.hasOwnProperty.call(message, "serviceLogin")) { properties._serviceLogin = 1; if (!$util.isString(message.serviceLogin)) return "serviceLogin: string expected"; } - if (message.reportDatabase != null && message.hasOwnProperty("reportDatabase")) { + if (message.reportDatabase != null && Object.hasOwnProperty.call(message, "reportDatabase")) { properties._reportDatabase = 1; if (!$util.isString(message.reportDatabase)) return "reportDatabase: string expected"; } - if (message.duration != null && message.hasOwnProperty("duration")) { + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) { properties._duration = 1; { var error = $root.google.protobuf.Duration.verify(message.duration, long + 1); @@ -143312,6 +147502,8 @@ AcquireSsrsLeaseContext.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.AcquireSsrsLeaseContext) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.AcquireSsrsLeaseContext: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -143324,7 +147516,7 @@ if (object.reportDatabase != null) message.reportDatabase = String(object.reportDatabase); if (object.duration != null) { - if (typeof object.duration !== "object") + if (!$util.isObject(object.duration)) throw TypeError(".google.cloud.sql.v1beta4.AcquireSsrsLeaseContext.duration: object expected"); message.duration = $root.google.protobuf.Duration.fromObject(object.duration, long + 1); } @@ -143340,27 +147532,31 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AcquireSsrsLeaseContext.toObject = function toObject(message, options) { + AcquireSsrsLeaseContext.toObject = function 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.setupLogin != null && message.hasOwnProperty("setupLogin")) { + if (message.setupLogin != null && Object.hasOwnProperty.call(message, "setupLogin")) { object.setupLogin = message.setupLogin; if (options.oneofs) object._setupLogin = "setupLogin"; } - if (message.serviceLogin != null && message.hasOwnProperty("serviceLogin")) { + if (message.serviceLogin != null && Object.hasOwnProperty.call(message, "serviceLogin")) { object.serviceLogin = message.serviceLogin; if (options.oneofs) object._serviceLogin = "serviceLogin"; } - if (message.reportDatabase != null && message.hasOwnProperty("reportDatabase")) { + if (message.reportDatabase != null && Object.hasOwnProperty.call(message, "reportDatabase")) { object.reportDatabase = message.reportDatabase; if (options.oneofs) object._reportDatabase = "reportDatabase"; } - if (message.duration != null && message.hasOwnProperty("duration")) { - object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) { + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options, q + 1); if (options.oneofs) object._duration = "duration"; } @@ -143490,7 +147686,7 @@ * @variation 1 */ Object.defineProperty(SqlConnectService.prototype.getConnectSettings = function getConnectSettings(request, callback) { - return this.rpcCall(getConnectSettings, $root.google.cloud.sql.v1beta4.GetConnectSettingsRequest, $root.google.cloud.sql.v1beta4.ConnectSettings, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, getConnectSettings, $root.google.cloud.sql.v1beta4.GetConnectSettingsRequest, $root.google.cloud.sql.v1beta4.ConnectSettings, request, callback); }, "name", { value: "GetConnectSettings" }); /** @@ -143523,7 +147719,7 @@ * @variation 1 */ Object.defineProperty(SqlConnectService.prototype.resolveConnectSettings = function resolveConnectSettings(request, callback) { - return this.rpcCall(resolveConnectSettings, $root.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest, $root.google.cloud.sql.v1beta4.ConnectSettings, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, resolveConnectSettings, $root.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest, $root.google.cloud.sql.v1beta4.ConnectSettings, request, callback); }, "name", { value: "ResolveConnectSettings" }); /** @@ -143556,7 +147752,7 @@ * @variation 1 */ Object.defineProperty(SqlConnectService.prototype.generateEphemeralCert = function generateEphemeralCert(request, callback) { - return this.rpcCall(generateEphemeralCert, $root.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest, $root.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, generateEphemeralCert, $root.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest, $root.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse, request, callback); }, "name", { value: "GenerateEphemeralCert" }); /** @@ -143643,15 +147839,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConnectSettingsRequest.encode = function encode(message, writer) { + GetConnectSettingsRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); return writer; }; @@ -143665,7 +147865,7 @@ * @returns {$protobuf.Writer} Writer */ GetConnectSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -143743,13 +147943,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime, long + 1); if (error) return "readTime." + error; @@ -143768,6 +147968,8 @@ GetConnectSettingsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.GetConnectSettingsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.GetConnectSettingsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -143778,7 +147980,7 @@ if (object.project != null) message.project = String(object.project); if (object.readTime != null) { - if (typeof object.readTime !== "object") + if (!$util.isObject(object.readTime)) throw TypeError(".google.cloud.sql.v1beta4.GetConnectSettingsRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime, long + 1); } @@ -143794,21 +147996,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetConnectSettingsRequest.toObject = function toObject(message, options) { + GetConnectSettingsRequest.toObject = function toObject(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 = ""; object.project = ""; object.readTime = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options, q + 1); return object; }; @@ -143903,9 +148109,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResolveConnectSettingsRequest.encode = function encode(message, writer) { + ResolveConnectSettingsRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.dnsName); if (message.location != null && Object.hasOwnProperty.call(message, "location")) @@ -143923,7 +148133,7 @@ * @returns {$protobuf.Writer} Writer */ ResolveConnectSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -143997,10 +148207,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.dnsName != null && message.hasOwnProperty("dnsName")) + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) if (!$util.isString(message.dnsName)) return "dnsName: 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; @@ -144017,6 +148227,8 @@ ResolveConnectSettingsRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ResolveConnectSettingsRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ResolveConnectSettingsRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -144038,17 +148250,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResolveConnectSettingsRequest.toObject = function toObject(message, options) { + ResolveConnectSettingsRequest.toObject = function toObject(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.dnsName = ""; object.location = ""; } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) object.dnsName = message.dnsName; - if (message.location != null && message.hasOwnProperty("location")) + if (message.location != null && Object.hasOwnProperty.call(message, "location")) object.location = message.location; return object; }; @@ -144275,16 +148491,20 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectSettings.encode = function encode(message, writer) { + ConnectSettings.encode = function encode(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.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCaCert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.serverCaCert, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.region != null && Object.hasOwnProperty.call(message, "region")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.region); if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) @@ -144302,7 +148522,7 @@ writer.uint32(/* id 37, wireType 2 =*/298).string(message.customSubjectAlternativeNames[i]); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 38, wireType 2 =*/306).fork(), q + 1).ldelim(); if (message.mdxProtocolSupport != null && message.mdxProtocolSupport.length) { writer.uint32(/* id 39, wireType 2 =*/314).fork(); for (var i = 0; i < message.mdxProtocolSupport.length; ++i) @@ -144315,7 +148535,7 @@ writer.uint32(/* id 63, wireType 0 =*/504).int32(message.nodeCount); if (message.nodes != null && message.nodes.length) for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.encode(message.nodes[i], writer.uint32(/* id 64, wireType 2 =*/514).fork(), q + 1).ldelim(); return writer; }; @@ -144329,7 +148549,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -144471,15 +148691,15 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.serverCaCert != null && message.hasOwnProperty("serverCaCert")) { + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) { var error = $root.google.cloud.sql.v1beta4.SslCert.verify(message.serverCaCert, long + 1); if (error) return "serverCaCert." + error; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -144488,10 +148708,10 @@ return "ipAddresses." + error; } } - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) if (!$util.isString(message.region)) return "region: string expected"; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) switch (message.databaseVersion) { default: return "databaseVersion: enum value expected"; @@ -144553,7 +148773,7 @@ case 551: break; } - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) switch (message.backendType) { default: return "backendType: enum value expected"; @@ -144563,13 +148783,13 @@ case 3: break; } - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) if (typeof message.pscEnabled !== "boolean") return "pscEnabled: boolean expected"; - if (message.dnsName != null && message.hasOwnProperty("dnsName")) + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) if (!$util.isString(message.dnsName)) return "dnsName: string expected"; - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) switch (message.serverCaMode) { default: return "serverCaMode: enum value expected"; @@ -144579,14 +148799,14 @@ case 3: break; } - if (message.customSubjectAlternativeNames != null && message.hasOwnProperty("customSubjectAlternativeNames")) { + if (message.customSubjectAlternativeNames != null && Object.hasOwnProperty.call(message, "customSubjectAlternativeNames")) { if (!Array.isArray(message.customSubjectAlternativeNames)) return "customSubjectAlternativeNames: array expected"; for (var i = 0; i < message.customSubjectAlternativeNames.length; ++i) if (!$util.isString(message.customSubjectAlternativeNames[i])) return "customSubjectAlternativeNames: string[] expected"; } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -144595,12 +148815,12 @@ return "dnsNames." + error; } } - 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.nodes != null && message.hasOwnProperty("nodes")) { + if (message.nodes != null && Object.hasOwnProperty.call(message, "nodes")) { if (!Array.isArray(message.nodes)) return "nodes: array expected"; for (var i = 0; i < message.nodes.length; ++i) { @@ -144609,7 +148829,7 @@ return "nodes." + error; } } - if (message.mdxProtocolSupport != null && message.hasOwnProperty("mdxProtocolSupport")) { + if (message.mdxProtocolSupport != null && Object.hasOwnProperty.call(message, "mdxProtocolSupport")) { if (!Array.isArray(message.mdxProtocolSupport)) return "mdxProtocolSupport: array expected"; for (var i = 0; i < message.mdxProtocolSupport.length; ++i) @@ -144621,7 +148841,7 @@ break; } } - if (message.connectionName != null && message.hasOwnProperty("connectionName")) + if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName")) if (!$util.isString(message.connectionName)) return "connectionName: string expected"; return null; @@ -144638,6 +148858,8 @@ ConnectSettings.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ConnectSettings) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -144646,7 +148868,7 @@ if (object.kind != null) message.kind = String(object.kind); if (object.serverCaCert != null) { - if (typeof object.serverCaCert !== "object") + if (!$util.isObject(object.serverCaCert)) throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.serverCaCert: object expected"); message.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.serverCaCert, long + 1); } @@ -144655,7 +148877,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1beta4.IpMapping.fromObject(object.ipAddresses[i], long + 1); } @@ -144958,7 +149180,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1beta4.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -144970,7 +149192,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.nodes: array expected"); message.nodes = []; for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") + if (!$util.isObject(object.nodes[i])) throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.nodes: object expected"); message.nodes[i] = $root.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.fromObject(object.nodes[i], long + 1); } @@ -145010,9 +149232,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectSettings.toObject = function toObject(message, options) { + ConnectSettings.toObject = function toObject(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.ipAddresses = []; @@ -145032,26 +149258,26 @@ object.serverCaMode = options.enums === String ? "CA_MODE_UNSPECIFIED" : 0; object.connectionName = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.serverCaCert != null && message.hasOwnProperty("serverCaCert")) - object.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCaCert, options); + if (message.serverCaCert != null && Object.hasOwnProperty.call(message, "serverCaCert")) + object.serverCaCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.serverCaCert, options, q + 1); if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.region != null && message.hasOwnProperty("region")) + if (message.region != null && Object.hasOwnProperty.call(message, "region")) object.region = message.region; - if (message.databaseVersion != null && message.hasOwnProperty("databaseVersion")) + if (message.databaseVersion != null && Object.hasOwnProperty.call(message, "databaseVersion")) object.databaseVersion = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] === undefined ? message.databaseVersion : $root.google.cloud.sql.v1beta4.SqlDatabaseVersion[message.databaseVersion] : message.databaseVersion; - if (message.backendType != null && message.hasOwnProperty("backendType")) + if (message.backendType != null && Object.hasOwnProperty.call(message, "backendType")) object.backendType = options.enums === String ? $root.google.cloud.sql.v1beta4.SqlBackendType[message.backendType] === undefined ? message.backendType : $root.google.cloud.sql.v1beta4.SqlBackendType[message.backendType] : message.backendType; - if (message.pscEnabled != null && message.hasOwnProperty("pscEnabled")) + if (message.pscEnabled != null && Object.hasOwnProperty.call(message, "pscEnabled")) object.pscEnabled = message.pscEnabled; - if (message.dnsName != null && message.hasOwnProperty("dnsName")) + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) object.dnsName = message.dnsName; - if (message.serverCaMode != null && message.hasOwnProperty("serverCaMode")) + if (message.serverCaMode != null && Object.hasOwnProperty.call(message, "serverCaMode")) object.serverCaMode = options.enums === String ? $root.google.cloud.sql.v1beta4.ConnectSettings.CaMode[message.serverCaMode] === undefined ? message.serverCaMode : $root.google.cloud.sql.v1beta4.ConnectSettings.CaMode[message.serverCaMode] : message.serverCaMode; if (message.customSubjectAlternativeNames && message.customSubjectAlternativeNames.length) { object.customSubjectAlternativeNames = []; @@ -145061,16 +149287,16 @@ if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } if (message.mdxProtocolSupport && message.mdxProtocolSupport.length) { object.mdxProtocolSupport = []; for (var j = 0; j < message.mdxProtocolSupport.length; ++j) object.mdxProtocolSupport[j] = options.enums === String ? $root.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport[message.mdxProtocolSupport[j]] === undefined ? message.mdxProtocolSupport[j] : $root.google.cloud.sql.v1beta4.ConnectSettings.MdxProtocolSupport[message.mdxProtocolSupport[j]] : message.mdxProtocolSupport[j]; } - if (message.connectionName != null && message.hasOwnProperty("connectionName")) + if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName")) object.connectionName = message.connectionName; - 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"; @@ -145078,7 +149304,7 @@ if (message.nodes && message.nodes.length) { object.nodes = []; for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.toObject(message.nodes[j], options); + object.nodes[j] = $root.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.toObject(message.nodes[j], options, q + 1); } return object; }; @@ -145224,19 +149450,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConnectPoolNodeConfig.encode = function encode(message, writer) { + ConnectPoolNodeConfig.encode = function encode(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.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) - $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.IpMapping.encode(message.ipAddresses[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.dnsName); if (message.dnsNames != null && message.dnsNames.length) for (var i = 0; i < message.dnsNames.length; ++i) - $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DnsNameMapping.encode(message.dnsNames[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); return writer; }; @@ -145250,7 +149480,7 @@ * @returns {$protobuf.Writer} Writer */ ConnectPoolNodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -145337,12 +149567,12 @@ 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")) { properties._name = 1; if (!$util.isString(message.name)) return "name: string expected"; } - if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (message.ipAddresses != null && Object.hasOwnProperty.call(message, "ipAddresses")) { if (!Array.isArray(message.ipAddresses)) return "ipAddresses: array expected"; for (var i = 0; i < message.ipAddresses.length; ++i) { @@ -145351,12 +149581,12 @@ return "ipAddresses." + error; } } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { properties._dnsName = 1; if (!$util.isString(message.dnsName)) return "dnsName: string expected"; } - if (message.dnsNames != null && message.hasOwnProperty("dnsNames")) { + if (message.dnsNames != null && Object.hasOwnProperty.call(message, "dnsNames")) { if (!Array.isArray(message.dnsNames)) return "dnsNames: array expected"; for (var i = 0; i < message.dnsNames.length; ++i) { @@ -145379,6 +149609,8 @@ ConnectPoolNodeConfig.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -145391,7 +149623,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.ipAddresses: array expected"); message.ipAddresses = []; for (var i = 0; i < object.ipAddresses.length; ++i) { - if (typeof object.ipAddresses[i] !== "object") + if (!$util.isObject(object.ipAddresses[i])) throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.ipAddresses: object expected"); message.ipAddresses[i] = $root.google.cloud.sql.v1beta4.IpMapping.fromObject(object.ipAddresses[i], long + 1); } @@ -145403,7 +149635,7 @@ throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.dnsNames: array expected"); message.dnsNames = []; for (var i = 0; i < object.dnsNames.length; ++i) { - if (typeof object.dnsNames[i] !== "object") + if (!$util.isObject(object.dnsNames[i])) throw TypeError(".google.cloud.sql.v1beta4.ConnectSettings.ConnectPoolNodeConfig.dnsNames: object expected"); message.dnsNames[i] = $root.google.cloud.sql.v1beta4.DnsNameMapping.fromObject(object.dnsNames[i], long + 1); } @@ -145420,15 +149652,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConnectPoolNodeConfig.toObject = function toObject(message, options) { + ConnectPoolNodeConfig.toObject = function toObject(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.ipAddresses = []; object.dnsNames = []; } - if (message.name != null && message.hasOwnProperty("name")) { + if (message.name != null && Object.hasOwnProperty.call(message, "name")) { object.name = message.name; if (options.oneofs) object._name = "name"; @@ -145436,9 +149672,9 @@ if (message.ipAddresses && message.ipAddresses.length) { object.ipAddresses = []; for (var j = 0; j < message.ipAddresses.length; ++j) - object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options); + object.ipAddresses[j] = $root.google.cloud.sql.v1beta4.IpMapping.toObject(message.ipAddresses[j], options, q + 1); } - if (message.dnsName != null && message.hasOwnProperty("dnsName")) { + if (message.dnsName != null && Object.hasOwnProperty.call(message, "dnsName")) { object.dnsName = message.dnsName; if (options.oneofs) object._dnsName = "dnsName"; @@ -145446,7 +149682,7 @@ if (message.dnsNames && message.dnsNames.length) { object.dnsNames = []; for (var j = 0; j < message.dnsNames.length; ++j) - object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options); + object.dnsNames[j] = $root.google.cloud.sql.v1beta4.DnsNameMapping.toObject(message.dnsNames[j], options, q + 1); } return object; }; @@ -145595,9 +149831,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateEphemeralCertRequest.encode = function encode(message, writer) { + GenerateEphemeralCertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -145607,9 +149847,9 @@ if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.accessToken); if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.validDuration != null && Object.hasOwnProperty.call(message, "validDuration")) - $root.google.protobuf.Duration.encode(message.validDuration, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.validDuration, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); return writer; }; @@ -145623,7 +149863,7 @@ * @returns {$protobuf.Writer} Writer */ GenerateEphemeralCertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -145713,24 +149953,24 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) if (!$util.isString(message.publicKey)) return "publicKey: string expected"; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) if (!$util.isString(message.accessToken)) return "accessToken: string expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) { var error = $root.google.protobuf.Timestamp.verify(message.readTime, long + 1); if (error) return "readTime." + error; } - if (message.validDuration != null && message.hasOwnProperty("validDuration")) { + if (message.validDuration != null && Object.hasOwnProperty.call(message, "validDuration")) { var error = $root.google.protobuf.Duration.verify(message.validDuration, long + 1); if (error) return "validDuration." + error; @@ -145749,6 +149989,8 @@ GenerateEphemeralCertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.GenerateEphemeralCertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.GenerateEphemeralCertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -145763,12 +150005,12 @@ if (object.accessToken != null) message.accessToken = String(object.accessToken); if (object.readTime != null) { - if (typeof object.readTime !== "object") + if (!$util.isObject(object.readTime)) throw TypeError(".google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.readTime: object expected"); message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime, long + 1); } if (object.validDuration != null) { - if (typeof object.validDuration !== "object") + if (!$util.isObject(object.validDuration)) throw TypeError(".google.cloud.sql.v1beta4.GenerateEphemeralCertRequest.validDuration: object expected"); message.validDuration = $root.google.protobuf.Duration.fromObject(object.validDuration, long + 1); } @@ -145784,9 +150026,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateEphemeralCertRequest.toObject = function toObject(message, options) { + GenerateEphemeralCertRequest.toObject = function toObject(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 = ""; @@ -145796,18 +150042,18 @@ object.readTime = null; object.validDuration = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) object.publicKey = message.publicKey; - if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) object.accessToken = message.accessToken; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (message.validDuration != null && message.hasOwnProperty("validDuration")) - object.validDuration = $root.google.protobuf.Duration.toObject(message.validDuration, options); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options, q + 1); + if (message.validDuration != null && Object.hasOwnProperty.call(message, "validDuration")) + object.validDuration = $root.google.protobuf.Duration.toObject(message.validDuration, options, q + 1); return object; }; @@ -145893,11 +150139,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GenerateEphemeralCertResponse.encode = function encode(message, writer) { + GenerateEphemeralCertResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.ephemeralCert != null && Object.hasOwnProperty.call(message, "ephemeralCert")) - $root.google.cloud.sql.v1beta4.SslCert.encode(message.ephemeralCert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SslCert.encode(message.ephemeralCert, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim(); return writer; }; @@ -145911,7 +150161,7 @@ * @returns {$protobuf.Writer} Writer */ GenerateEphemeralCertResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -145981,7 +150231,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.ephemeralCert != null && message.hasOwnProperty("ephemeralCert")) { + if (message.ephemeralCert != null && Object.hasOwnProperty.call(message, "ephemeralCert")) { var error = $root.google.cloud.sql.v1beta4.SslCert.verify(message.ephemeralCert, long + 1); if (error) return "ephemeralCert." + error; @@ -146000,13 +150250,15 @@ GenerateEphemeralCertResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.GenerateEphemeralCertResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.GenerateEphemeralCertResponse(); if (object.ephemeralCert != null) { - if (typeof object.ephemeralCert !== "object") + if (!$util.isObject(object.ephemeralCert)) throw TypeError(".google.cloud.sql.v1beta4.GenerateEphemeralCertResponse.ephemeralCert: object expected"); message.ephemeralCert = $root.google.cloud.sql.v1beta4.SslCert.fromObject(object.ephemeralCert, long + 1); } @@ -146022,14 +150274,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GenerateEphemeralCertResponse.toObject = function toObject(message, options) { + GenerateEphemeralCertResponse.toObject = function toObject(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.ephemeralCert = null; - if (message.ephemeralCert != null && message.hasOwnProperty("ephemeralCert")) - object.ephemeralCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.ephemeralCert, options); + if (message.ephemeralCert != null && Object.hasOwnProperty.call(message, "ephemeralCert")) + object.ephemeralCert = $root.google.cloud.sql.v1beta4.SslCert.toObject(message.ephemeralCert, options, q + 1); return object; }; @@ -146114,7 +150370,7 @@ * @variation 1 */ Object.defineProperty(SqlDataService.prototype.streamSqlData = function streamSqlData(request, callback) { - return this.rpcCall(streamSqlData, $root.google.cloud.sql.v1beta4.StreamSqlDataRequest, $root.google.cloud.sql.v1beta4.StreamSqlDataResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, streamSqlData, $root.google.cloud.sql.v1beta4.StreamSqlDataRequest, $root.google.cloud.sql.v1beta4.StreamSqlDataResponse, request, callback); }, "name", { value: "StreamSqlData" }); /** @@ -146242,19 +150498,23 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamSqlDataRequest.encode = function encode(message, writer) { + StreamSqlDataRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) - $root.google.cloud.sql.v1beta4.Ack.encode(message.ack, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Ack.encode(message.ack, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.startSession != null && Object.hasOwnProperty.call(message, "startSession")) - $root.google.cloud.sql.v1beta4.StartSession.encode(message.startSession, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.StartSession.encode(message.startSession, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); if (message.continueSession != null && Object.hasOwnProperty.call(message, "continueSession")) - $root.google.cloud.sql.v1beta4.ContinueSession.encode(message.continueSession, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.ContinueSession.encode(message.continueSession, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim(); if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.google.cloud.sql.v1beta4.DataPacket.encode(message.data, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DataPacket.encode(message.data, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim(); if (message.terminateSession != null && Object.hasOwnProperty.call(message, "terminateSession")) - $root.google.cloud.sql.v1beta4.TerminateSession.encode(message.terminateSession, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.TerminateSession.encode(message.terminateSession, writer.uint32(/* id 8, wireType 2 =*/66).fork(), q + 1).ldelim(); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.instanceId); return writer; @@ -146270,7 +150530,7 @@ * @returns {$protobuf.Writer} Writer */ StreamSqlDataRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -146361,12 +150621,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.ack != null && message.hasOwnProperty("ack")) { + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) { var error = $root.google.cloud.sql.v1beta4.Ack.verify(message.ack, long + 1); if (error) return "ack." + error; } - if (message.startSession != null && message.hasOwnProperty("startSession")) { + if (message.startSession != null && Object.hasOwnProperty.call(message, "startSession")) { properties.message = 1; { var error = $root.google.cloud.sql.v1beta4.StartSession.verify(message.startSession, long + 1); @@ -146374,7 +150634,7 @@ return "startSession." + error; } } - if (message.continueSession != null && message.hasOwnProperty("continueSession")) { + if (message.continueSession != null && Object.hasOwnProperty.call(message, "continueSession")) { if (properties.message === 1) return "message: multiple values"; properties.message = 1; @@ -146384,7 +150644,7 @@ return "continueSession." + error; } } - if (message.data != null && message.hasOwnProperty("data")) { + if (message.data != null && Object.hasOwnProperty.call(message, "data")) { if (properties.message === 1) return "message: multiple values"; properties.message = 1; @@ -146394,7 +150654,7 @@ return "data." + error; } } - if (message.terminateSession != null && message.hasOwnProperty("terminateSession")) { + if (message.terminateSession != null && Object.hasOwnProperty.call(message, "terminateSession")) { if (properties.message === 1) return "message: multiple values"; properties.message = 1; @@ -146404,7 +150664,7 @@ return "terminateSession." + error; } } - 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; @@ -146421,33 +150681,35 @@ StreamSqlDataRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.StreamSqlDataRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.StreamSqlDataRequest(); if (object.ack != null) { - if (typeof object.ack !== "object") + if (!$util.isObject(object.ack)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataRequest.ack: object expected"); message.ack = $root.google.cloud.sql.v1beta4.Ack.fromObject(object.ack, long + 1); } if (object.startSession != null) { - if (typeof object.startSession !== "object") + if (!$util.isObject(object.startSession)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataRequest.startSession: object expected"); message.startSession = $root.google.cloud.sql.v1beta4.StartSession.fromObject(object.startSession, long + 1); } if (object.continueSession != null) { - if (typeof object.continueSession !== "object") + if (!$util.isObject(object.continueSession)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataRequest.continueSession: object expected"); message.continueSession = $root.google.cloud.sql.v1beta4.ContinueSession.fromObject(object.continueSession, long + 1); } if (object.data != null) { - if (typeof object.data !== "object") + if (!$util.isObject(object.data)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataRequest.data: object expected"); message.data = $root.google.cloud.sql.v1beta4.DataPacket.fromObject(object.data, long + 1); } if (object.terminateSession != null) { - if (typeof object.terminateSession !== "object") + if (!$util.isObject(object.terminateSession)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataRequest.terminateSession: object expected"); message.terminateSession = $root.google.cloud.sql.v1beta4.TerminateSession.fromObject(object.terminateSession, long + 1); } @@ -146465,37 +150727,41 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamSqlDataRequest.toObject = function toObject(message, options) { + StreamSqlDataRequest.toObject = function toObject(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.ack = null; object.instanceId = ""; } - if (message.ack != null && message.hasOwnProperty("ack")) - object.ack = $root.google.cloud.sql.v1beta4.Ack.toObject(message.ack, options); - if (message.startSession != null && message.hasOwnProperty("startSession")) { - object.startSession = $root.google.cloud.sql.v1beta4.StartSession.toObject(message.startSession, options); + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) + object.ack = $root.google.cloud.sql.v1beta4.Ack.toObject(message.ack, options, q + 1); + if (message.startSession != null && Object.hasOwnProperty.call(message, "startSession")) { + object.startSession = $root.google.cloud.sql.v1beta4.StartSession.toObject(message.startSession, options, q + 1); if (options.oneofs) object.message = "startSession"; } - if (message.continueSession != null && message.hasOwnProperty("continueSession")) { - object.continueSession = $root.google.cloud.sql.v1beta4.ContinueSession.toObject(message.continueSession, options); + if (message.continueSession != null && Object.hasOwnProperty.call(message, "continueSession")) { + object.continueSession = $root.google.cloud.sql.v1beta4.ContinueSession.toObject(message.continueSession, options, q + 1); if (options.oneofs) object.message = "continueSession"; } - if (message.data != null && message.hasOwnProperty("data")) { - object.data = $root.google.cloud.sql.v1beta4.DataPacket.toObject(message.data, options); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) { + object.data = $root.google.cloud.sql.v1beta4.DataPacket.toObject(message.data, options, q + 1); if (options.oneofs) object.message = "data"; } - if (message.terminateSession != null && message.hasOwnProperty("terminateSession")) { - object.terminateSession = $root.google.cloud.sql.v1beta4.TerminateSession.toObject(message.terminateSession, options); + if (message.terminateSession != null && Object.hasOwnProperty.call(message, "terminateSession")) { + object.terminateSession = $root.google.cloud.sql.v1beta4.TerminateSession.toObject(message.terminateSession, options, q + 1); if (options.oneofs) object.message = "terminateSession"; } - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; return object; }; @@ -146600,9 +150866,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StartSession.encode = function encode(message, writer) { + StartSession.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -146622,7 +150892,7 @@ * @returns {$protobuf.Writer} Writer */ StartSession.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -146700,13 +150970,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.locationId != null && message.hasOwnProperty("locationId")) + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) if (!$util.isString(message.locationId)) return "locationId: 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.sessionId != null && message.hasOwnProperty("sessionId")) + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) if (!$util.isString(message.sessionId)) return "sessionId: string expected"; return null; @@ -146723,6 +150993,8 @@ StartSession.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.StartSession) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.StartSession: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -146746,20 +151018,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StartSession.toObject = function toObject(message, options) { + StartSession.toObject = function toObject(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.locationId = ""; object.instanceId = ""; object.sessionId = ""; } - if (message.locationId != null && message.hasOwnProperty("locationId")) + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) object.locationId = message.locationId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) object.sessionId = message.sessionId; return object; }; @@ -146864,9 +151140,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContinueSession.encode = function encode(message, writer) { + ContinueSession.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.locationId); if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) @@ -146886,7 +151166,7 @@ * @returns {$protobuf.Writer} Writer */ ContinueSession.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -146964,13 +151244,13 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.locationId != null && message.hasOwnProperty("locationId")) + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) if (!$util.isString(message.locationId)) return "locationId: 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.sessionId != null && message.hasOwnProperty("sessionId")) + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) if (!$util.isString(message.sessionId)) return "sessionId: string expected"; return null; @@ -146987,6 +151267,8 @@ ContinueSession.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.ContinueSession) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.ContinueSession: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -147010,20 +151292,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContinueSession.toObject = function toObject(message, options) { + ContinueSession.toObject = function toObject(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.locationId = ""; object.instanceId = ""; object.sessionId = ""; } - if (message.locationId != null && message.hasOwnProperty("locationId")) + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) object.locationId = message.locationId; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) object.instanceId = message.instanceId; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) object.sessionId = message.sessionId; return object; }; @@ -147151,17 +151437,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamSqlDataResponse.encode = function encode(message, writer) { + StreamSqlDataResponse.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) - $root.google.cloud.sql.v1beta4.Ack.encode(message.ack, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Ack.encode(message.ack, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.sessionMetadata != null && Object.hasOwnProperty.call(message, "sessionMetadata")) - $root.google.cloud.sql.v1beta4.SessionMetadata.encode(message.sessionMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SessionMetadata.encode(message.sessionMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim(); if (message.data != null && Object.hasOwnProperty.call(message, "data")) - $root.google.cloud.sql.v1beta4.DataPacket.encode(message.data, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.DataPacket.encode(message.data, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.terminateSession != null && Object.hasOwnProperty.call(message, "terminateSession")) - $root.google.cloud.sql.v1beta4.TerminateSession.encode(message.terminateSession, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.TerminateSession.encode(message.terminateSession, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim(); return writer; }; @@ -147175,7 +151465,7 @@ * @returns {$protobuf.Writer} Writer */ StreamSqlDataResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -147258,12 +151548,12 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.ack != null && message.hasOwnProperty("ack")) { + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) { var error = $root.google.cloud.sql.v1beta4.Ack.verify(message.ack, long + 1); if (error) return "ack." + error; } - if (message.sessionMetadata != null && message.hasOwnProperty("sessionMetadata")) { + if (message.sessionMetadata != null && Object.hasOwnProperty.call(message, "sessionMetadata")) { properties.message = 1; { var error = $root.google.cloud.sql.v1beta4.SessionMetadata.verify(message.sessionMetadata, long + 1); @@ -147271,7 +151561,7 @@ return "sessionMetadata." + error; } } - if (message.data != null && message.hasOwnProperty("data")) { + if (message.data != null && Object.hasOwnProperty.call(message, "data")) { if (properties.message === 1) return "message: multiple values"; properties.message = 1; @@ -147281,7 +151571,7 @@ return "data." + error; } } - if (message.terminateSession != null && message.hasOwnProperty("terminateSession")) { + if (message.terminateSession != null && Object.hasOwnProperty.call(message, "terminateSession")) { if (properties.message === 1) return "message: multiple values"; properties.message = 1; @@ -147305,28 +151595,30 @@ StreamSqlDataResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.StreamSqlDataResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.StreamSqlDataResponse(); if (object.ack != null) { - if (typeof object.ack !== "object") + if (!$util.isObject(object.ack)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataResponse.ack: object expected"); message.ack = $root.google.cloud.sql.v1beta4.Ack.fromObject(object.ack, long + 1); } if (object.sessionMetadata != null) { - if (typeof object.sessionMetadata !== "object") + if (!$util.isObject(object.sessionMetadata)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataResponse.sessionMetadata: object expected"); message.sessionMetadata = $root.google.cloud.sql.v1beta4.SessionMetadata.fromObject(object.sessionMetadata, long + 1); } if (object.data != null) { - if (typeof object.data !== "object") + if (!$util.isObject(object.data)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataResponse.data: object expected"); message.data = $root.google.cloud.sql.v1beta4.DataPacket.fromObject(object.data, long + 1); } if (object.terminateSession != null) { - if (typeof object.terminateSession !== "object") + if (!$util.isObject(object.terminateSession)) throw TypeError(".google.cloud.sql.v1beta4.StreamSqlDataResponse.terminateSession: object expected"); message.terminateSession = $root.google.cloud.sql.v1beta4.TerminateSession.fromObject(object.terminateSession, long + 1); } @@ -147342,26 +151634,30 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamSqlDataResponse.toObject = function toObject(message, options) { + StreamSqlDataResponse.toObject = function toObject(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.ack = null; - if (message.ack != null && message.hasOwnProperty("ack")) - object.ack = $root.google.cloud.sql.v1beta4.Ack.toObject(message.ack, options); - if (message.sessionMetadata != null && message.hasOwnProperty("sessionMetadata")) { - object.sessionMetadata = $root.google.cloud.sql.v1beta4.SessionMetadata.toObject(message.sessionMetadata, options); + if (message.ack != null && Object.hasOwnProperty.call(message, "ack")) + object.ack = $root.google.cloud.sql.v1beta4.Ack.toObject(message.ack, options, q + 1); + if (message.sessionMetadata != null && Object.hasOwnProperty.call(message, "sessionMetadata")) { + object.sessionMetadata = $root.google.cloud.sql.v1beta4.SessionMetadata.toObject(message.sessionMetadata, options, q + 1); if (options.oneofs) object.message = "sessionMetadata"; } - if (message.data != null && message.hasOwnProperty("data")) { - object.data = $root.google.cloud.sql.v1beta4.DataPacket.toObject(message.data, options); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) { + object.data = $root.google.cloud.sql.v1beta4.DataPacket.toObject(message.data, options, q + 1); if (options.oneofs) object.message = "data"; } - if (message.terminateSession != null && message.hasOwnProperty("terminateSession")) { - object.terminateSession = $root.google.cloud.sql.v1beta4.TerminateSession.toObject(message.terminateSession, options); + if (message.terminateSession != null && Object.hasOwnProperty.call(message, "terminateSession")) { + object.terminateSession = $root.google.cloud.sql.v1beta4.TerminateSession.toObject(message.terminateSession, options, q + 1); if (options.oneofs) object.message = "terminateSession"; } @@ -147451,9 +151747,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SessionMetadata.encode = function encode(message, writer) { + SessionMetadata.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.supportedFeatures != null && message.supportedFeatures.length) { writer.uint32(/* id 1, wireType 2 =*/10).fork(); for (var i = 0; i < message.supportedFeatures.length; ++i) @@ -147473,7 +151773,7 @@ * @returns {$protobuf.Writer} Writer */ SessionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -147550,7 +151850,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.supportedFeatures != null && message.hasOwnProperty("supportedFeatures")) { + if (message.supportedFeatures != null && Object.hasOwnProperty.call(message, "supportedFeatures")) { if (!Array.isArray(message.supportedFeatures)) return "supportedFeatures: array expected"; for (var i = 0; i < message.supportedFeatures.length; ++i) @@ -147576,6 +151876,8 @@ SessionMetadata.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SessionMetadata) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SessionMetadata: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -147614,9 +151916,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SessionMetadata.toObject = function toObject(message, options) { + SessionMetadata.toObject = function toObject(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.supportedFeatures = []; @@ -147719,9 +152025,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DataPacket.encode = function encode(message, writer) { + DataPacket.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.firstByteOffset != null && Object.hasOwnProperty.call(message, "firstByteOffset")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.firstByteOffset); if (message.data != null && Object.hasOwnProperty.call(message, "data")) @@ -147739,7 +152049,7 @@ * @returns {$protobuf.Writer} Writer */ DataPacket.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -147813,10 +152123,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.firstByteOffset != null && message.hasOwnProperty("firstByteOffset")) + if (message.firstByteOffset != null && Object.hasOwnProperty.call(message, "firstByteOffset")) if (!$util.isInteger(message.firstByteOffset) && !(message.firstByteOffset && $util.isInteger(message.firstByteOffset.low) && $util.isInteger(message.firstByteOffset.high))) return "firstByteOffset: integer|Long expected"; - if (message.data != null && message.hasOwnProperty("data")) + if (message.data != null && Object.hasOwnProperty.call(message, "data")) if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) return "data: buffer expected"; return null; @@ -147833,6 +152143,8 @@ DataPacket.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.DataPacket) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.DataPacket: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -147840,7 +152152,7 @@ var message = new $root.google.cloud.sql.v1beta4.DataPacket(); if (object.firstByteOffset != null) if ($util.Long) - (message.firstByteOffset = $util.Long.fromValue(object.firstByteOffset)).unsigned = false; + message.firstByteOffset = $util.Long.fromValue(object.firstByteOffset, false); else if (typeof object.firstByteOffset === "string") message.firstByteOffset = parseInt(object.firstByteOffset, 10); else if (typeof object.firstByteOffset === "number") @@ -147864,16 +152176,20 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DataPacket.toObject = function toObject(message, options) { + DataPacket.toObject = function toObject(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.firstByteOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.firstByteOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.firstByteOffset = options.longs === String ? "0" : 0; + object.firstByteOffset = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; if (options.bytes === String) object.data = ""; else { @@ -147882,12 +152198,14 @@ object.data = $util.newBuffer(object.data); } } - if (message.firstByteOffset != null && message.hasOwnProperty("firstByteOffset")) - if (typeof message.firstByteOffset === "number") + if (message.firstByteOffset != null && Object.hasOwnProperty.call(message, "firstByteOffset")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.firstByteOffset = typeof message.firstByteOffset === "number" ? BigInt(message.firstByteOffset) : $util.Long.fromBits(message.firstByteOffset.low >>> 0, message.firstByteOffset.high >>> 0, false).toBigInt(); + else if (typeof message.firstByteOffset === "number") object.firstByteOffset = options.longs === String ? String(message.firstByteOffset) : message.firstByteOffset; else object.firstByteOffset = options.longs === String ? $util.Long.prototype.toString.call(message.firstByteOffset) : options.longs === Number ? new $util.LongBits(message.firstByteOffset.low >>> 0, message.firstByteOffset.high >>> 0).toNumber() : message.firstByteOffset; - if (message.data != null && message.hasOwnProperty("data")) + if (message.data != null && Object.hasOwnProperty.call(message, "data")) object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; return object; }; @@ -147974,9 +152292,13 @@ * @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.receivedOffset != null && Object.hasOwnProperty.call(message, "receivedOffset")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.receivedOffset); return writer; @@ -147992,7 +152314,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(); }; /** @@ -148062,7 +152384,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.receivedOffset != null && message.hasOwnProperty("receivedOffset")) + if (message.receivedOffset != null && Object.hasOwnProperty.call(message, "receivedOffset")) if (!$util.isInteger(message.receivedOffset) && !(message.receivedOffset && $util.isInteger(message.receivedOffset.low) && $util.isInteger(message.receivedOffset.high))) return "receivedOffset: integer|Long expected"; return null; @@ -148079,6 +152401,8 @@ Ack.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Ack) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Ack: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -148086,7 +152410,7 @@ var message = new $root.google.cloud.sql.v1beta4.Ack(); if (object.receivedOffset != null) if ($util.Long) - (message.receivedOffset = $util.Long.fromValue(object.receivedOffset)).unsigned = false; + message.receivedOffset = $util.Long.fromValue(object.receivedOffset, false); else if (typeof object.receivedOffset === "string") message.receivedOffset = parseInt(object.receivedOffset, 10); else if (typeof object.receivedOffset === "number") @@ -148105,18 +152429,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) if ($util.Long) { var long = new $util.Long(0, 0, false); - object.receivedOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.receivedOffset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.receivedOffset = options.longs === String ? "0" : 0; - if (message.receivedOffset != null && message.hasOwnProperty("receivedOffset")) - if (typeof message.receivedOffset === "number") + object.receivedOffset = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.receivedOffset != null && Object.hasOwnProperty.call(message, "receivedOffset")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.receivedOffset = typeof message.receivedOffset === "number" ? BigInt(message.receivedOffset) : $util.Long.fromBits(message.receivedOffset.low >>> 0, message.receivedOffset.high >>> 0, false).toBigInt(); + else if (typeof message.receivedOffset === "number") object.receivedOffset = options.longs === String ? String(message.receivedOffset) : message.receivedOffset; else object.receivedOffset = options.longs === String ? $util.Long.prototype.toString.call(message.receivedOffset) : options.longs === Number ? new $util.LongBits(message.receivedOffset.low >>> 0, message.receivedOffset.high >>> 0).toNumber() : message.receivedOffset; @@ -148205,11 +152535,15 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TerminateSession.encode = function encode(message, writer) { + TerminateSession.encode = function encode(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(); return writer; }; @@ -148223,7 +152557,7 @@ * @returns {$protobuf.Writer} Writer */ TerminateSession.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -148293,7 +152627,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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; @@ -148312,13 +152646,15 @@ TerminateSession.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.TerminateSession) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.TerminateSession: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.cloud.sql.v1beta4.TerminateSession(); if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.cloud.sql.v1beta4.TerminateSession.status: object expected"); message.status = $root.google.rpc.Status.fromObject(object.status, long + 1); } @@ -148334,14 +152670,18 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TerminateSession.toObject = function toObject(message, options) { + TerminateSession.toObject = function toObject(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.status = null; - 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; }; @@ -148475,7 +152815,7 @@ * @variation 1 */ Object.defineProperty(SqlTiersService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlTiersListRequest, $root.google.cloud.sql.v1beta4.TiersListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlTiersListRequest, $root.google.cloud.sql.v1beta4.TiersListResponse, request, callback); }, "name", { value: "List" }); /** @@ -148544,9 +152884,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlTiersListRequest.encode = function encode(message, writer) { + SqlTiersListRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); return writer; @@ -148562,7 +152906,7 @@ * @returns {$protobuf.Writer} Writer */ SqlTiersListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -148632,7 +152976,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -148649,6 +152993,8 @@ SqlTiersListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlTiersListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlTiersListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -148668,13 +153014,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlTiersListRequest.toObject = function toObject(message, options) { + SqlTiersListRequest.toObject = function toObject(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.project = ""; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -148771,14 +153121,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TiersListResponse.encode = function encode(message, writer) { + TiersListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.Tier.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.Tier.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -148792,7 +153146,7 @@ * @returns {$protobuf.Writer} Writer */ TiersListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -148868,10 +153222,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -148894,6 +153248,8 @@ TiersListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.TiersListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.TiersListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -148906,7 +153262,7 @@ throw TypeError(".google.cloud.sql.v1beta4.TiersListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.TiersListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.Tier.fromObject(object.items[i], long + 1); } @@ -148923,20 +153279,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TiersListResponse.toObject = function toObject(message, options) { + TiersListResponse.toObject = function toObject(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.items = []; if (options.defaults) object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.Tier.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.Tier.toObject(message.items[j], options, q + 1); } return object; }; @@ -149060,9 +153420,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tier.encode = function encode(message, writer) { + Tier.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.tier); if (message.RAM != null && Object.hasOwnProperty.call(message, "RAM")) @@ -149087,7 +153451,7 @@ * @returns {$protobuf.Writer} Writer */ Tier.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -149175,19 +153539,19 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) if (!$util.isString(message.tier)) return "tier: string expected"; - if (message.RAM != null && message.hasOwnProperty("RAM")) + if (message.RAM != null && Object.hasOwnProperty.call(message, "RAM")) if (!$util.isInteger(message.RAM) && !(message.RAM && $util.isInteger(message.RAM.low) && $util.isInteger(message.RAM.high))) return "RAM: integer|Long expected"; - 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.Disk_Quota != null && message.hasOwnProperty("Disk_Quota")) + if (message.Disk_Quota != null && Object.hasOwnProperty.call(message, "Disk_Quota")) if (!$util.isInteger(message.Disk_Quota) && !(message.Disk_Quota && $util.isInteger(message.Disk_Quota.low) && $util.isInteger(message.Disk_Quota.high))) return "Disk_Quota: integer|Long expected"; - if (message.region != null && message.hasOwnProperty("region")) { + if (message.region != null && Object.hasOwnProperty.call(message, "region")) { if (!Array.isArray(message.region)) return "region: array expected"; for (var i = 0; i < message.region.length; ++i) @@ -149208,6 +153572,8 @@ Tier.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.Tier) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.Tier: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -149217,7 +153583,7 @@ message.tier = String(object.tier); if (object.RAM != null) if ($util.Long) - (message.RAM = $util.Long.fromValue(object.RAM)).unsigned = false; + message.RAM = $util.Long.fromValue(object.RAM, false); else if (typeof object.RAM === "string") message.RAM = parseInt(object.RAM, 10); else if (typeof object.RAM === "number") @@ -149228,7 +153594,7 @@ message.kind = String(object.kind); if (object.Disk_Quota != null) if ($util.Long) - (message.Disk_Quota = $util.Long.fromValue(object.Disk_Quota)).unsigned = false; + message.Disk_Quota = $util.Long.fromValue(object.Disk_Quota, false); else if (typeof object.Disk_Quota === "string") message.Disk_Quota = parseInt(object.Disk_Quota, 10); else if (typeof object.Disk_Quota === "number") @@ -149254,9 +153620,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Tier.toObject = function toObject(message, options) { + Tier.toObject = function toObject(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.region = []; @@ -149264,27 +153634,31 @@ object.tier = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.RAM = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.RAM = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.RAM = options.longs === String ? "0" : 0; + object.RAM = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; object.kind = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.Disk_Quota = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.Disk_Quota = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.Disk_Quota = options.longs === String ? "0" : 0; + object.Disk_Quota = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; } - if (message.tier != null && message.hasOwnProperty("tier")) + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) object.tier = message.tier; - if (message.RAM != null && message.hasOwnProperty("RAM")) - if (typeof message.RAM === "number") + if (message.RAM != null && Object.hasOwnProperty.call(message, "RAM")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.RAM = typeof message.RAM === "number" ? BigInt(message.RAM) : $util.Long.fromBits(message.RAM.low >>> 0, message.RAM.high >>> 0, false).toBigInt(); + else if (typeof message.RAM === "number") object.RAM = options.longs === String ? String(message.RAM) : message.RAM; else object.RAM = options.longs === String ? $util.Long.prototype.toString.call(message.RAM) : options.longs === Number ? new $util.LongBits(message.RAM.low >>> 0, message.RAM.high >>> 0).toNumber() : message.RAM; - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.Disk_Quota != null && message.hasOwnProperty("Disk_Quota")) - if (typeof message.Disk_Quota === "number") + if (message.Disk_Quota != null && Object.hasOwnProperty.call(message, "Disk_Quota")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.Disk_Quota = typeof message.Disk_Quota === "number" ? BigInt(message.Disk_Quota) : $util.Long.fromBits(message.Disk_Quota.low >>> 0, message.Disk_Quota.high >>> 0, false).toBigInt(); + else if (typeof message.Disk_Quota === "number") object.Disk_Quota = options.longs === String ? String(message.Disk_Quota) : message.Disk_Quota; else object.Disk_Quota = options.longs === String ? $util.Long.prototype.toString.call(message.Disk_Quota) : options.longs === Number ? new $util.LongBits(message.Disk_Quota.low >>> 0, message.Disk_Quota.high >>> 0).toNumber() : message.Disk_Quota; @@ -149377,7 +153751,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype["delete"] = function delete_(request, callback) { - return this.rpcCall(delete_, $root.google.cloud.sql.v1beta4.SqlUsersDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, delete_, $root.google.cloud.sql.v1beta4.SqlUsersDeleteRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Delete" }); /** @@ -149410,7 +153784,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.get = function get(request, callback) { - return this.rpcCall(get, $root.google.cloud.sql.v1beta4.SqlUsersGetRequest, $root.google.cloud.sql.v1beta4.User, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, get, $root.google.cloud.sql.v1beta4.SqlUsersGetRequest, $root.google.cloud.sql.v1beta4.User, request, callback); }, "name", { value: "Get" }); /** @@ -149443,7 +153817,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.insert = function insert(request, callback) { - return this.rpcCall(insert, $root.google.cloud.sql.v1beta4.SqlUsersInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, insert, $root.google.cloud.sql.v1beta4.SqlUsersInsertRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Insert" }); /** @@ -149476,7 +153850,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.list = function list(request, callback) { - return this.rpcCall(list, $root.google.cloud.sql.v1beta4.SqlUsersListRequest, $root.google.cloud.sql.v1beta4.UsersListResponse, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, list, $root.google.cloud.sql.v1beta4.SqlUsersListRequest, $root.google.cloud.sql.v1beta4.UsersListResponse, request, callback); }, "name", { value: "List" }); /** @@ -149509,7 +153883,7 @@ * @variation 1 */ Object.defineProperty(SqlUsersService.prototype.update = function update(request, callback) { - return this.rpcCall(update, $root.google.cloud.sql.v1beta4.SqlUsersUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); + return $protobuf.rpc.Service.prototype.rpcCall.call(this, update, $root.google.cloud.sql.v1beta4.SqlUsersUpdateRequest, $root.google.cloud.sql.v1beta4.Operation, request, callback); }, "name", { value: "Update" }); /** @@ -149605,9 +153979,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersDeleteRequest.encode = function encode(message, writer) { + SqlUsersDeleteRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.host != null && Object.hasOwnProperty.call(message, "host")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -149629,7 +154007,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersDeleteRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -149711,16 +154089,16 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -149737,6 +154115,8 @@ SqlUsersDeleteRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlUsersDeleteRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlUsersDeleteRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -149762,9 +154142,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersDeleteRequest.toObject = function toObject(message, options) { + SqlUsersDeleteRequest.toObject = function toObject(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.host = ""; @@ -149772,13 +154156,13 @@ object.name = ""; object.project = ""; } - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -149892,9 +154276,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersGetRequest.encode = function encode(message, writer) { + SqlUsersGetRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -149916,7 +154304,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersGetRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -149998,16 +154386,16 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; return null; @@ -150024,6 +154412,8 @@ SqlUsersGetRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlUsersGetRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlUsersGetRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -150049,9 +154439,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersGetRequest.toObject = function toObject(message, options) { + SqlUsersGetRequest.toObject = function toObject(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 = ""; @@ -150059,13 +154453,13 @@ object.project = ""; object.host = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; return object; }; @@ -150170,15 +154564,19 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersInsertRequest.encode = function encode(message, writer) { + SqlUsersInsertRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -150192,7 +154590,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersInsertRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -150270,13 +154668,13 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.User.verify(message.body, long + 1); if (error) return "body." + error; @@ -150295,6 +154693,8 @@ SqlUsersInsertRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlUsersInsertRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlUsersInsertRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -150305,7 +154705,7 @@ if (object.project != null) message.project = String(object.project); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlUsersInsertRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.User.fromObject(object.body, long + 1); } @@ -150321,21 +154721,25 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersInsertRequest.toObject = function toObject(message, options) { + SqlUsersInsertRequest.toObject = function toObject(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 = ""; object.project = ""; object.body = null; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.User.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.User.toObject(message.body, options, q + 1); return object; }; @@ -150430,9 +154834,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersListRequest.encode = function encode(message, writer) { + SqlUsersListRequest.encode = function encode(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")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); if (message.project != null && Object.hasOwnProperty.call(message, "project")) @@ -150450,7 +154858,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersListRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -150524,10 +154932,10 @@ 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")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; return null; @@ -150544,6 +154952,8 @@ SqlUsersListRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlUsersListRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlUsersListRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -150565,17 +154975,21 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersListRequest.toObject = function toObject(message, options) { + SqlUsersListRequest.toObject = function toObject(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 = ""; object.project = ""; } - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; return object; }; @@ -150726,9 +155140,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlUsersUpdateRequest.encode = function encode(message, writer) { + SqlUsersUpdateRequest.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.host != null && Object.hasOwnProperty.call(message, "host")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.host); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) @@ -150743,7 +155161,7 @@ if (message.revokeExistingRoles != null && Object.hasOwnProperty.call(message, "revokeExistingRoles")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.revokeExistingRoles); if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.cloud.sql.v1beta4.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.User.encode(message.body, writer.uint32(/* id 100, wireType 2 =*/802).fork(), q + 1).ldelim(); return writer; }; @@ -150757,7 +155175,7 @@ * @returns {$protobuf.Writer} Writer */ SqlUsersUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -150854,31 +155272,31 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - 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.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: string expected"; - 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) if (!$util.isString(message.databaseRoles[i])) return "databaseRoles: string[] expected"; } - if (message.revokeExistingRoles != null && message.hasOwnProperty("revokeExistingRoles")) { + if (message.revokeExistingRoles != null && Object.hasOwnProperty.call(message, "revokeExistingRoles")) { properties._revokeExistingRoles = 1; if (typeof message.revokeExistingRoles !== "boolean") return "revokeExistingRoles: boolean expected"; } - if (message.body != null && message.hasOwnProperty("body")) { + if (message.body != null && Object.hasOwnProperty.call(message, "body")) { var error = $root.google.cloud.sql.v1beta4.User.verify(message.body, long + 1); if (error) return "body." + error; @@ -150897,6 +155315,8 @@ SqlUsersUpdateRequest.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlUsersUpdateRequest) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlUsersUpdateRequest: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -150920,7 +155340,7 @@ if (object.revokeExistingRoles != null) message.revokeExistingRoles = Boolean(object.revokeExistingRoles); if (object.body != null) { - if (typeof object.body !== "object") + if (!$util.isObject(object.body)) throw TypeError(".google.cloud.sql.v1beta4.SqlUsersUpdateRequest.body: object expected"); message.body = $root.google.cloud.sql.v1beta4.User.fromObject(object.body, long + 1); } @@ -150936,9 +155356,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlUsersUpdateRequest.toObject = function toObject(message, options) { + SqlUsersUpdateRequest.toObject = function toObject(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 = []; @@ -150949,26 +155373,26 @@ object.project = ""; object.body = null; } - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; if (message.databaseRoles && message.databaseRoles.length) { object.databaseRoles = []; for (var j = 0; j < message.databaseRoles.length; ++j) object.databaseRoles[j] = message.databaseRoles[j]; } - if (message.revokeExistingRoles != null && message.hasOwnProperty("revokeExistingRoles")) { + if (message.revokeExistingRoles != null && Object.hasOwnProperty.call(message, "revokeExistingRoles")) { object.revokeExistingRoles = message.revokeExistingRoles; if (options.oneofs) object._revokeExistingRoles = "revokeExistingRoles"; } - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.cloud.sql.v1beta4.User.toObject(message.body, options); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + object.body = $root.google.cloud.sql.v1beta4.User.toObject(message.body, options, q + 1); return object; }; @@ -151090,17 +155514,21 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserPasswordValidationPolicy.encode = function encode(message, writer) { + UserPasswordValidationPolicy.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.allowedFailedAttempts != null && Object.hasOwnProperty.call(message, "allowedFailedAttempts")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.allowedFailedAttempts); if (message.passwordExpirationDuration != null && Object.hasOwnProperty.call(message, "passwordExpirationDuration")) - $root.google.protobuf.Duration.encode(message.passwordExpirationDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Duration.encode(message.passwordExpirationDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); if (message.enableFailedAttemptsCheck != null && Object.hasOwnProperty.call(message, "enableFailedAttemptsCheck")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableFailedAttemptsCheck); if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.sql.v1beta4.PasswordStatus.encode(message.status, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.PasswordStatus.encode(message.status, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim(); if (message.enablePasswordVerification != null && Object.hasOwnProperty.call(message, "enablePasswordVerification")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enablePasswordVerification); return writer; @@ -151116,7 +155544,7 @@ * @returns {$protobuf.Writer} Writer */ UserPasswordValidationPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -151202,23 +155630,23 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.allowedFailedAttempts != null && message.hasOwnProperty("allowedFailedAttempts")) + if (message.allowedFailedAttempts != null && Object.hasOwnProperty.call(message, "allowedFailedAttempts")) if (!$util.isInteger(message.allowedFailedAttempts)) return "allowedFailedAttempts: integer expected"; - if (message.passwordExpirationDuration != null && message.hasOwnProperty("passwordExpirationDuration")) { + if (message.passwordExpirationDuration != null && Object.hasOwnProperty.call(message, "passwordExpirationDuration")) { var error = $root.google.protobuf.Duration.verify(message.passwordExpirationDuration, long + 1); if (error) return "passwordExpirationDuration." + error; } - if (message.enableFailedAttemptsCheck != null && message.hasOwnProperty("enableFailedAttemptsCheck")) + if (message.enableFailedAttemptsCheck != null && Object.hasOwnProperty.call(message, "enableFailedAttemptsCheck")) if (typeof message.enableFailedAttemptsCheck !== "boolean") return "enableFailedAttemptsCheck: boolean expected"; - if (message.status != null && message.hasOwnProperty("status")) { + if (message.status != null && Object.hasOwnProperty.call(message, "status")) { var error = $root.google.cloud.sql.v1beta4.PasswordStatus.verify(message.status, long + 1); if (error) return "status." + error; } - if (message.enablePasswordVerification != null && message.hasOwnProperty("enablePasswordVerification")) + if (message.enablePasswordVerification != null && Object.hasOwnProperty.call(message, "enablePasswordVerification")) if (typeof message.enablePasswordVerification !== "boolean") return "enablePasswordVerification: boolean expected"; return null; @@ -151235,6 +155663,8 @@ UserPasswordValidationPolicy.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.UserPasswordValidationPolicy) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.UserPasswordValidationPolicy: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -151243,14 +155673,14 @@ if (object.allowedFailedAttempts != null) message.allowedFailedAttempts = object.allowedFailedAttempts | 0; if (object.passwordExpirationDuration != null) { - if (typeof object.passwordExpirationDuration !== "object") + if (!$util.isObject(object.passwordExpirationDuration)) throw TypeError(".google.cloud.sql.v1beta4.UserPasswordValidationPolicy.passwordExpirationDuration: object expected"); message.passwordExpirationDuration = $root.google.protobuf.Duration.fromObject(object.passwordExpirationDuration, long + 1); } if (object.enableFailedAttemptsCheck != null) message.enableFailedAttemptsCheck = Boolean(object.enableFailedAttemptsCheck); if (object.status != null) { - if (typeof object.status !== "object") + if (!$util.isObject(object.status)) throw TypeError(".google.cloud.sql.v1beta4.UserPasswordValidationPolicy.status: object expected"); message.status = $root.google.cloud.sql.v1beta4.PasswordStatus.fromObject(object.status, long + 1); } @@ -151268,9 +155698,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserPasswordValidationPolicy.toObject = function toObject(message, options) { + UserPasswordValidationPolicy.toObject = function toObject(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.allowedFailedAttempts = 0; @@ -151279,15 +155713,15 @@ object.status = null; object.enablePasswordVerification = false; } - if (message.allowedFailedAttempts != null && message.hasOwnProperty("allowedFailedAttempts")) + if (message.allowedFailedAttempts != null && Object.hasOwnProperty.call(message, "allowedFailedAttempts")) object.allowedFailedAttempts = message.allowedFailedAttempts; - if (message.passwordExpirationDuration != null && message.hasOwnProperty("passwordExpirationDuration")) - object.passwordExpirationDuration = $root.google.protobuf.Duration.toObject(message.passwordExpirationDuration, options); - if (message.enableFailedAttemptsCheck != null && message.hasOwnProperty("enableFailedAttemptsCheck")) + if (message.passwordExpirationDuration != null && Object.hasOwnProperty.call(message, "passwordExpirationDuration")) + object.passwordExpirationDuration = $root.google.protobuf.Duration.toObject(message.passwordExpirationDuration, options, q + 1); + if (message.enableFailedAttemptsCheck != null && Object.hasOwnProperty.call(message, "enableFailedAttemptsCheck")) object.enableFailedAttemptsCheck = message.enableFailedAttemptsCheck; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.sql.v1beta4.PasswordStatus.toObject(message.status, options); - if (message.enablePasswordVerification != null && message.hasOwnProperty("enablePasswordVerification")) + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + object.status = $root.google.cloud.sql.v1beta4.PasswordStatus.toObject(message.status, options, q + 1); + if (message.enablePasswordVerification != null && Object.hasOwnProperty.call(message, "enablePasswordVerification")) object.enablePasswordVerification = message.enablePasswordVerification; return object; }; @@ -151383,13 +155817,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PasswordStatus.encode = function encode(message, writer) { + PasswordStatus.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.locked); if (message.passwordExpirationTime != null && Object.hasOwnProperty.call(message, "passwordExpirationTime")) - $root.google.protobuf.Timestamp.encode(message.passwordExpirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.passwordExpirationTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -151403,7 +155841,7 @@ * @returns {$protobuf.Writer} Writer */ PasswordStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -151477,10 +155915,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.locked != null && message.hasOwnProperty("locked")) + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) if (typeof message.locked !== "boolean") return "locked: boolean expected"; - if (message.passwordExpirationTime != null && message.hasOwnProperty("passwordExpirationTime")) { + if (message.passwordExpirationTime != null && Object.hasOwnProperty.call(message, "passwordExpirationTime")) { var error = $root.google.protobuf.Timestamp.verify(message.passwordExpirationTime, long + 1); if (error) return "passwordExpirationTime." + error; @@ -151499,6 +155937,8 @@ PasswordStatus.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.PasswordStatus) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.PasswordStatus: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -151507,7 +155947,7 @@ if (object.locked != null) message.locked = Boolean(object.locked); if (object.passwordExpirationTime != null) { - if (typeof object.passwordExpirationTime !== "object") + if (!$util.isObject(object.passwordExpirationTime)) throw TypeError(".google.cloud.sql.v1beta4.PasswordStatus.passwordExpirationTime: object expected"); message.passwordExpirationTime = $root.google.protobuf.Timestamp.fromObject(object.passwordExpirationTime, long + 1); } @@ -151523,18 +155963,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PasswordStatus.toObject = function toObject(message, options) { + PasswordStatus.toObject = function toObject(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.locked = false; object.passwordExpirationTime = null; } - if (message.locked != null && message.hasOwnProperty("locked")) + if (message.locked != null && Object.hasOwnProperty.call(message, "locked")) object.locked = message.locked; - if (message.passwordExpirationTime != null && message.hasOwnProperty("passwordExpirationTime")) - object.passwordExpirationTime = $root.google.protobuf.Timestamp.toObject(message.passwordExpirationTime, options); + if (message.passwordExpirationTime != null && Object.hasOwnProperty.call(message, "passwordExpirationTime")) + object.passwordExpirationTime = $root.google.protobuf.Timestamp.toObject(message.passwordExpirationTime, options, q + 1); return object; }; @@ -151764,9 +156208,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - User.encode = function encode(message, writer) { + User.encode = function encode(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.password != null && Object.hasOwnProperty.call(message, "password")) @@ -151784,11 +156232,11 @@ if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); if (message.sqlserverUserDetails != null && Object.hasOwnProperty.call(message, "sqlserverUserDetails")) - $root.google.cloud.sql.v1beta4.SqlServerUserDetails.encode(message.sqlserverUserDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.SqlServerUserDetails.encode(message.sqlserverUserDetails, writer.uint32(/* id 9, wireType 2 =*/74).fork(), q + 1).ldelim(); if (message.iamEmail != null && Object.hasOwnProperty.call(message, "iamEmail")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.iamEmail); if (message.passwordPolicy != null && Object.hasOwnProperty.call(message, "passwordPolicy")) - $root.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.encode(message.passwordPolicy, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.encode(message.passwordPolicy, writer.uint32(/* id 12, wireType 2 =*/98).fork(), q + 1).ldelim(); if (message.dualPasswordType != null && Object.hasOwnProperty.call(message, "dualPasswordType")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.dualPasswordType); if (message.iamStatus != null && Object.hasOwnProperty.call(message, "iamStatus")) @@ -151809,7 +156257,7 @@ * @returns {$protobuf.Writer} Writer */ User.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -151934,28 +156382,28 @@ if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; var properties = {}; - 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.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) if (!$util.isString(message.password)) return "password: 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.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.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) if (!$util.isString(message.host)) return "host: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) if (!$util.isString(message.instance)) return "instance: string expected"; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) if (!$util.isString(message.project)) return "project: 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"; @@ -151969,7 +156417,7 @@ case 7: break; } - if (message.sqlserverUserDetails != null && message.hasOwnProperty("sqlserverUserDetails")) { + if (message.sqlserverUserDetails != null && Object.hasOwnProperty.call(message, "sqlserverUserDetails")) { properties.userDetails = 1; { var error = $root.google.cloud.sql.v1beta4.SqlServerUserDetails.verify(message.sqlserverUserDetails, long + 1); @@ -151977,15 +156425,15 @@ return "sqlserverUserDetails." + error; } } - if (message.iamEmail != null && message.hasOwnProperty("iamEmail")) + if (message.iamEmail != null && Object.hasOwnProperty.call(message, "iamEmail")) if (!$util.isString(message.iamEmail)) return "iamEmail: string expected"; - if (message.passwordPolicy != null && message.hasOwnProperty("passwordPolicy")) { + if (message.passwordPolicy != null && Object.hasOwnProperty.call(message, "passwordPolicy")) { var error = $root.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.verify(message.passwordPolicy, long + 1); if (error) return "passwordPolicy." + error; } - if (message.dualPasswordType != null && message.hasOwnProperty("dualPasswordType")) { + if (message.dualPasswordType != null && Object.hasOwnProperty.call(message, "dualPasswordType")) { properties._dualPasswordType = 1; switch (message.dualPasswordType) { default: @@ -151997,7 +156445,7 @@ break; } } - if (message.iamStatus != null && message.hasOwnProperty("iamStatus")) { + if (message.iamStatus != null && Object.hasOwnProperty.call(message, "iamStatus")) { properties._iamStatus = 1; switch (message.iamStatus) { default: @@ -152008,7 +156456,7 @@ break; } } - 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) @@ -152029,6 +156477,8 @@ User.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.User) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.User: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -152089,14 +156539,14 @@ break; } if (object.sqlserverUserDetails != null) { - if (typeof object.sqlserverUserDetails !== "object") + if (!$util.isObject(object.sqlserverUserDetails)) throw TypeError(".google.cloud.sql.v1beta4.User.sqlserverUserDetails: object expected"); message.sqlserverUserDetails = $root.google.cloud.sql.v1beta4.SqlServerUserDetails.fromObject(object.sqlserverUserDetails, long + 1); } if (object.iamEmail != null) message.iamEmail = String(object.iamEmail); if (object.passwordPolicy != null) { - if (typeof object.passwordPolicy !== "object") + if (!$util.isObject(object.passwordPolicy)) throw TypeError(".google.cloud.sql.v1beta4.User.passwordPolicy: object expected"); message.passwordPolicy = $root.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.fromObject(object.passwordPolicy, long + 1); } @@ -152163,9 +156613,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - User.toObject = function toObject(message, options) { + User.toObject = function toObject(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 = []; @@ -152181,37 +156635,37 @@ object.iamEmail = ""; object.passwordPolicy = null; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; - if (message.password != null && message.hasOwnProperty("password")) + if (message.password != null && Object.hasOwnProperty.call(message, "password")) object.password = message.password; - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) object.etag = message.etag; - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) object.name = message.name; - if (message.host != null && message.hasOwnProperty("host")) + if (message.host != null && Object.hasOwnProperty.call(message, "host")) object.host = message.host; - if (message.instance != null && message.hasOwnProperty("instance")) + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) object.instance = message.instance; - if (message.project != null && message.hasOwnProperty("project")) + if (message.project != null && Object.hasOwnProperty.call(message, "project")) object.project = message.project; - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) object.type = options.enums === String ? $root.google.cloud.sql.v1beta4.User.SqlUserType[message.type] === undefined ? message.type : $root.google.cloud.sql.v1beta4.User.SqlUserType[message.type] : message.type; - if (message.sqlserverUserDetails != null && message.hasOwnProperty("sqlserverUserDetails")) { - object.sqlserverUserDetails = $root.google.cloud.sql.v1beta4.SqlServerUserDetails.toObject(message.sqlserverUserDetails, options); + if (message.sqlserverUserDetails != null && Object.hasOwnProperty.call(message, "sqlserverUserDetails")) { + object.sqlserverUserDetails = $root.google.cloud.sql.v1beta4.SqlServerUserDetails.toObject(message.sqlserverUserDetails, options, q + 1); if (options.oneofs) object.userDetails = "sqlserverUserDetails"; } - if (message.iamEmail != null && message.hasOwnProperty("iamEmail")) + if (message.iamEmail != null && Object.hasOwnProperty.call(message, "iamEmail")) object.iamEmail = message.iamEmail; - if (message.passwordPolicy != null && message.hasOwnProperty("passwordPolicy")) - object.passwordPolicy = $root.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.toObject(message.passwordPolicy, options); - if (message.dualPasswordType != null && message.hasOwnProperty("dualPasswordType")) { + if (message.passwordPolicy != null && Object.hasOwnProperty.call(message, "passwordPolicy")) + object.passwordPolicy = $root.google.cloud.sql.v1beta4.UserPasswordValidationPolicy.toObject(message.passwordPolicy, options, q + 1); + if (message.dualPasswordType != null && Object.hasOwnProperty.call(message, "dualPasswordType")) { object.dualPasswordType = options.enums === String ? $root.google.cloud.sql.v1beta4.User.DualPasswordType[message.dualPasswordType] === undefined ? message.dualPasswordType : $root.google.cloud.sql.v1beta4.User.DualPasswordType[message.dualPasswordType] : message.dualPasswordType; if (options.oneofs) object._dualPasswordType = "dualPasswordType"; } - if (message.iamStatus != null && message.hasOwnProperty("iamStatus")) { + if (message.iamStatus != null && Object.hasOwnProperty.call(message, "iamStatus")) { object.iamStatus = options.enums === String ? $root.google.cloud.sql.v1beta4.User.IamStatus[message.iamStatus] === undefined ? message.iamStatus : $root.google.cloud.sql.v1beta4.User.IamStatus[message.iamStatus] : message.iamStatus; if (options.oneofs) object._iamStatus = "iamStatus"; @@ -152376,9 +156830,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SqlServerUserDetails.encode = function encode(message, writer) { + SqlServerUserDetails.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.disabled); if (message.serverRoles != null && message.serverRoles.length) @@ -152397,7 +156855,7 @@ * @returns {$protobuf.Writer} Writer */ SqlServerUserDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -152473,10 +156931,10 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.disabled != null && message.hasOwnProperty("disabled")) + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) if (typeof message.disabled !== "boolean") return "disabled: boolean expected"; - if (message.serverRoles != null && message.hasOwnProperty("serverRoles")) { + if (message.serverRoles != null && Object.hasOwnProperty.call(message, "serverRoles")) { if (!Array.isArray(message.serverRoles)) return "serverRoles: array expected"; for (var i = 0; i < message.serverRoles.length; ++i) @@ -152497,6 +156955,8 @@ SqlServerUserDetails.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.SqlServerUserDetails) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.SqlServerUserDetails: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -152523,15 +156983,19 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SqlServerUserDetails.toObject = function toObject(message, options) { + SqlServerUserDetails.toObject = function toObject(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.serverRoles = []; if (options.defaults) object.disabled = false; - if (message.disabled != null && message.hasOwnProperty("disabled")) + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) object.disabled = message.disabled; if (message.serverRoles && message.serverRoles.length) { object.serverRoles = []; @@ -152642,14 +157106,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UsersListResponse.encode = function encode(message, writer) { + UsersListResponse.encode = function encode(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.items != null && message.items.length) for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.sql.v1beta4.User.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.cloud.sql.v1beta4.User.encode(message.items[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); return writer; @@ -152665,7 +157133,7 @@ * @returns {$protobuf.Writer} Writer */ UsersListResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -152745,10 +157213,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.items != null && message.hasOwnProperty("items")) { + if (message.items != null && Object.hasOwnProperty.call(message, "items")) { if (!Array.isArray(message.items)) return "items: array expected"; for (var i = 0; i < message.items.length; ++i) { @@ -152757,7 +157225,7 @@ return "items." + 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; @@ -152774,6 +157242,8 @@ UsersListResponse.fromObject = function fromObject(object, long) { if (object instanceof $root.google.cloud.sql.v1beta4.UsersListResponse) return object; + if (!$util.isObject(object)) + throw TypeError(".google.cloud.sql.v1beta4.UsersListResponse: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -152786,7 +157256,7 @@ throw TypeError(".google.cloud.sql.v1beta4.UsersListResponse.items: array expected"); message.items = []; for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") + if (!$util.isObject(object.items[i])) throw TypeError(".google.cloud.sql.v1beta4.UsersListResponse.items: object expected"); message.items[i] = $root.google.cloud.sql.v1beta4.User.fromObject(object.items[i], long + 1); } @@ -152805,9 +157275,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UsersListResponse.toObject = function toObject(message, options) { + UsersListResponse.toObject = function toObject(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.items = []; @@ -152815,14 +157289,14 @@ object.kind = ""; object.nextPageToken = ""; } - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) object.kind = message.kind; if (message.items && message.items.length) { object.items = []; for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.sql.v1beta4.User.toObject(message.items[j], options); + object.items[j] = $root.google.cloud.sql.v1beta4.User.toObject(message.items[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; }; @@ -152937,12 +157411,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; @@ -152958,7 +157436,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(); }; /** @@ -153034,7 +157512,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) { @@ -153043,7 +157521,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; @@ -153060,6 +157538,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) @@ -153070,7 +157550,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); } @@ -153089,9 +157569,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 = []; @@ -153100,9 +157584,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; }; @@ -153285,9 +157769,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")) @@ -153303,10 +157791,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; @@ -153322,7 +157810,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(); }; /** @@ -153431,43 +157919,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; @@ -153477,13 +157965,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) { @@ -153506,6 +157994,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) @@ -153524,7 +158014,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); } @@ -153537,7 +158027,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); } @@ -153554,9 +158044,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 = []; @@ -153565,46 +158059,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; }; @@ -153700,9 +158194,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")) @@ -153720,7 +158218,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(); }; /** @@ -153794,10 +158292,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; @@ -153814,6 +158312,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) @@ -153835,17 +158335,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; }; @@ -153951,9 +158455,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) { @@ -153963,7 +158471,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; }; @@ -153977,7 +158485,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(); }; /** @@ -154062,10 +158570,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) @@ -154078,7 +158586,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; @@ -154097,6 +158605,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) @@ -154130,7 +158640,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); } @@ -154146,9 +158656,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 = []; @@ -154156,15 +158670,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; }; @@ -154340,9 +158854,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")) @@ -154350,21 +158868,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; }; @@ -154378,7 +158896,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(); }; /** @@ -154488,10 +159006,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"; @@ -154505,45 +159023,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; @@ -154562,6 +159080,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) @@ -154612,42 +159132,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); } @@ -154663,9 +159183,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 = ""; @@ -154680,28 +159204,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; }; @@ -154880,12 +159404,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")) @@ -154903,7 +159431,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")) @@ -154921,7 +159449,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(); }; /** @@ -155037,7 +159565,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) { @@ -155046,29 +159574,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"; @@ -155082,7 +159610,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) { @@ -155091,10 +159619,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; @@ -155111,6 +159639,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) @@ -155121,7 +159651,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); } @@ -155188,7 +159718,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); } @@ -155209,9 +159739,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 = []; @@ -155231,33 +159765,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; }; @@ -155363,16 +159897,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; }; @@ -155386,7 +159924,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(); }; /** @@ -155485,10 +160023,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); @@ -155496,7 +160034,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; @@ -155515,6 +160053,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) @@ -155523,7 +160063,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) { @@ -155533,7 +160073,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); } @@ -155549,9 +160089,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 = {}; @@ -155559,7 +160103,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) { @@ -155570,8 +160114,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; }; @@ -155657,11 +160201,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; }; @@ -155675,7 +160223,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(); }; /** @@ -155745,7 +160293,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; @@ -155764,13 +160312,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); } @@ -155786,14 +160336,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; }; @@ -155879,11 +160433,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; }; @@ -155897,7 +160455,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(); }; /** @@ -155967,7 +160525,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; @@ -155986,13 +160544,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); } @@ -156008,14 +160568,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; }; @@ -156110,13 +160674,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; }; @@ -156130,7 +160698,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(); }; /** @@ -156204,12 +160772,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; @@ -156228,18 +160796,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); } @@ -156255,18 +160825,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; }; @@ -156367,9 +160941,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")) @@ -156389,7 +160967,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(); }; /** @@ -156467,13 +161045,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; @@ -156490,6 +161068,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) @@ -156513,20 +161093,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; }; @@ -156616,11 +161200,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; }; @@ -156634,7 +161222,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(); }; /** @@ -156704,7 +161292,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; @@ -156723,13 +161311,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); } @@ -156745,14 +161335,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; }; @@ -156888,11 +161482,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(); @@ -156921,7 +161519,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(); }; /** @@ -157059,12 +161657,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); @@ -157072,7 +161670,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); @@ -157080,21 +161678,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) @@ -157115,18 +161713,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) { @@ -157136,7 +161736,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) { @@ -157178,9 +161778,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 = []; @@ -157193,8 +161797,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 = {}; @@ -157312,11 +161916,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; }; @@ -157330,7 +161938,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(); }; /** @@ -157400,7 +162008,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; @@ -157419,13 +162027,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); } @@ -157441,14 +162051,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; }; @@ -157544,11 +162158,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(); @@ -157565,7 +162183,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(); }; /** @@ -157660,12 +162278,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); @@ -157687,18 +162305,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) { @@ -157719,16 +162339,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 = {}; @@ -157842,13 +162466,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]); @@ -157865,7 +162493,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(); }; /** @@ -157945,15 +162573,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) @@ -157974,6 +162602,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) @@ -157982,7 +162612,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); } @@ -158005,9 +162635,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 = []; @@ -158015,10 +162649,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) @@ -158133,17 +162767,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; }; @@ -158157,7 +162795,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(); }; /** @@ -158239,20 +162877,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; @@ -158271,25 +162909,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); } @@ -158305,9 +162945,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; @@ -158315,14 +162959,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; }; @@ -158463,9 +163107,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]); @@ -158484,7 +163132,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(); }; /** @@ -158560,14 +163208,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; @@ -158584,6 +163232,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) @@ -158610,9 +163260,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 = []; @@ -158623,7 +163277,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; }; @@ -158820,9 +163474,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) @@ -158855,7 +163513,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(); }; /** @@ -158958,20 +163616,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"; @@ -158980,13 +163638,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) @@ -159012,6 +163670,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) @@ -159085,9 +163745,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 = []; @@ -159100,20 +163764,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 = []; @@ -159244,9 +163908,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")) @@ -159264,7 +163932,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(); }; /** @@ -159338,10 +164006,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; @@ -159358,6 +164026,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) @@ -159379,17 +164049,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; }; @@ -159486,14 +164160,18 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FieldInfo.encode = function encode(message, writer) { + FieldInfo.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.format != null && Object.hasOwnProperty.call(message, "format")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); if (message.referencedTypes != null && message.referencedTypes.length) for (var i = 0; i < message.referencedTypes.length; ++i) - $root.google.api.TypeReference.encode(message.referencedTypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.api.TypeReference.encode(message.referencedTypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -159507,7 +164185,7 @@ * @returns {$protobuf.Writer} Writer */ FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -159583,7 +164261,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - if (message.format != null && message.hasOwnProperty("format")) + if (message.format != null && Object.hasOwnProperty.call(message, "format")) switch (message.format) { default: return "format: enum value expected"; @@ -159594,7 +164272,7 @@ case 4: break; } - if (message.referencedTypes != null && message.hasOwnProperty("referencedTypes")) { + if (message.referencedTypes != null && Object.hasOwnProperty.call(message, "referencedTypes")) { if (!Array.isArray(message.referencedTypes)) return "referencedTypes: array expected"; for (var i = 0; i < message.referencedTypes.length; ++i) { @@ -159617,6 +164295,8 @@ FieldInfo.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.FieldInfo) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.FieldInfo: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -159655,7 +164335,7 @@ throw TypeError(".google.api.FieldInfo.referencedTypes: array expected"); message.referencedTypes = []; for (var i = 0; i < object.referencedTypes.length; ++i) { - if (typeof object.referencedTypes[i] !== "object") + if (!$util.isObject(object.referencedTypes[i])) throw TypeError(".google.api.FieldInfo.referencedTypes: object expected"); message.referencedTypes[i] = $root.google.api.TypeReference.fromObject(object.referencedTypes[i], long + 1); } @@ -159672,20 +164352,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldInfo.toObject = function toObject(message, options) { + FieldInfo.toObject = function toObject(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.referencedTypes = []; if (options.defaults) object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) + if (message.format != null && Object.hasOwnProperty.call(message, "format")) object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; if (message.referencedTypes && message.referencedTypes.length) { object.referencedTypes = []; for (var j = 0; j < message.referencedTypes.length; ++j) - object.referencedTypes[j] = $root.google.api.TypeReference.toObject(message.referencedTypes[j], options); + object.referencedTypes[j] = $root.google.api.TypeReference.toObject(message.referencedTypes[j], options, q + 1); } return object; }; @@ -159792,9 +164476,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TypeReference.encode = function encode(message, writer) { + TypeReference.encode = function encode(message, writer, q) { if (!writer) writer = $Writer.create(); + if (q === undefined) + q = 0; + if (q > $util.recursionLimit) + throw Error("max depth exceeded"); if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeName); return writer; @@ -159810,7 +164498,7 @@ * @returns {$protobuf.Writer} Writer */ TypeReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -159880,7 +164568,7 @@ long = 0; if (long > $util.recursionLimit) return "maximum nesting depth exceeded"; - 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"; return null; @@ -159897,6 +164585,8 @@ TypeReference.fromObject = function fromObject(object, long) { if (object instanceof $root.google.api.TypeReference) return object; + if (!$util.isObject(object)) + throw TypeError(".google.api.TypeReference: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -159916,13 +164606,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TypeReference.toObject = function toObject(message, options) { + TypeReference.toObject = function toObject(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.typeName = ""; - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) object.typeName = message.typeName; return object; }; @@ -160022,12 +164716,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; }; @@ -160041,7 +164739,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(); }; /** @@ -160113,7 +164811,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) { @@ -160136,6 +164834,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) @@ -160146,7 +164846,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); } @@ -160163,16 +164863,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; }; @@ -160418,9 +165122,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")) @@ -160430,20 +165138,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]); @@ -160470,7 +165178,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(); }; /** @@ -160618,41 +165326,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) { @@ -160661,7 +165369,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) { @@ -160670,7 +165378,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) { @@ -160679,7 +165387,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) { @@ -160688,20 +165396,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"; @@ -160733,6 +165441,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) @@ -160775,7 +165485,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); } @@ -160785,7 +165495,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); } @@ -160795,7 +165505,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); } @@ -160805,18 +165515,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); } @@ -160890,9 +165600,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 = []; @@ -160912,9 +165626,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 = []; @@ -160924,27 +165638,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) @@ -160955,9 +165669,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 = []; @@ -161147,34 +165861,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]); @@ -161193,7 +165911,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(); }; /** @@ -161319,10 +166037,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) { @@ -161331,7 +166049,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) { @@ -161340,7 +166058,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) { @@ -161349,7 +166067,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) { @@ -161358,7 +166076,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) { @@ -161367,7 +166085,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) { @@ -161376,12 +166094,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) { @@ -161390,14 +166108,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"; @@ -161420,6 +166138,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) @@ -161432,7 +166152,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); } @@ -161442,7 +166162,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); } @@ -161452,7 +166172,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); } @@ -161462,7 +166182,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); } @@ -161472,7 +166192,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); } @@ -161482,13 +166202,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); } @@ -161497,7 +166217,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); } @@ -161541,9 +166261,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 = []; @@ -161560,51 +166284,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; }; @@ -161706,15 +166430,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; }; @@ -161728,7 +166456,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(); }; /** @@ -161806,13 +166534,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; @@ -161831,6 +166559,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) @@ -161841,7 +166571,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); } @@ -161857,21 +166587,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; }; @@ -161966,9 +166700,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")) @@ -161986,7 +166724,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(); }; /** @@ -162060,10 +166798,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; @@ -162080,6 +166818,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) @@ -162101,17 +166841,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; }; @@ -162230,19 +166974,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; }; @@ -162256,7 +167004,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(); }; /** @@ -162342,7 +167090,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) { @@ -162351,7 +167099,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) { @@ -162360,12 +167108,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"; @@ -162387,6 +167135,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) @@ -162397,7 +167147,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); } @@ -162407,13 +167157,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); } @@ -162445,9 +167195,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 = []; @@ -162460,16 +167214,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; }; @@ -162589,9 +167343,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")) @@ -162615,7 +167373,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(); }; /** @@ -162701,19 +167459,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; @@ -162730,6 +167488,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) @@ -162757,9 +167517,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; @@ -162768,15 +167532,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; }; @@ -162970,9 +167734,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")) @@ -162988,7 +167756,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")) @@ -163008,7 +167776,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(); }; /** @@ -163118,13 +167886,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"; @@ -163133,7 +167901,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"; @@ -163157,27 +167925,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; @@ -163194,6 +167962,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) @@ -163314,7 +168084,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); } @@ -163332,9 +168102,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 = ""; @@ -163349,27 +168123,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; }; @@ -163527,13 +168301,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; }; @@ -163547,7 +168325,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(); }; /** @@ -163621,10 +168399,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; @@ -163643,6 +168421,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) @@ -163651,7 +168431,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); } @@ -163667,18 +168447,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; }; @@ -163812,19 +168596,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]); @@ -163843,7 +168631,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(); }; /** @@ -163939,10 +168727,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) { @@ -163951,12 +168739,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) { @@ -163965,14 +168753,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"; @@ -163995,6 +168783,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) @@ -164007,13 +168797,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); } @@ -164022,7 +168812,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); } @@ -164066,9 +168856,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 = []; @@ -164080,26 +168874,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; }; @@ -164192,9 +168986,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")) @@ -164212,7 +169010,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(); }; /** @@ -164286,10 +169084,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; @@ -164306,6 +169104,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) @@ -164327,17 +169127,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; }; @@ -164445,15 +169249,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; }; @@ -164467,7 +169275,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(); }; /** @@ -164545,13 +169353,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; @@ -164570,6 +169378,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) @@ -164580,7 +169390,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); } @@ -164596,21 +169406,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; }; @@ -164715,16 +169529,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; }; @@ -164738,7 +169556,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(); }; /** @@ -164818,10 +169636,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) { @@ -164830,7 +169648,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; @@ -164849,6 +169667,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) @@ -164861,13 +169681,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); } @@ -164883,9 +169703,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 = []; @@ -164893,15 +169717,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; }; @@ -165032,9 +169856,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")) @@ -165042,7 +169870,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")) @@ -165060,7 +169888,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(); }; /** @@ -165150,24 +169978,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; @@ -165184,6 +170012,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) @@ -165196,7 +170026,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); } @@ -165216,9 +170046,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 = ""; @@ -165228,17 +170062,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; }; @@ -165516,9 +170350,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")) @@ -165558,13 +170396,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; }; @@ -165578,7 +170416,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(); }; /** @@ -165736,22 +170574,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"; @@ -165760,51 +170598,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) { @@ -165813,7 +170651,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) { @@ -165836,6 +170674,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) @@ -165898,7 +170738,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); } @@ -165907,7 +170747,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); } @@ -165917,7 +170757,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); } @@ -165934,9 +170774,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 = []; @@ -165964,55 +170808,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; }; @@ -166179,9 +171023,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")) @@ -166193,12 +171041,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; }; @@ -166212,7 +171060,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(); }; /** @@ -166312,27 +171160,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) { @@ -166341,7 +171189,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; @@ -166360,6 +171208,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) @@ -166376,7 +171226,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); } @@ -166385,13 +171235,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); } @@ -166407,9 +171257,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 = []; @@ -166422,25 +171276,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; }; @@ -166674,9 +171528,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")) @@ -166700,21 +171558,21 @@ 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(); if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork(), q + 1).ldelim(); return writer; }; @@ -166728,7 +171586,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(); }; /** @@ -166880,7 +171738,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"; @@ -166889,10 +171747,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"; @@ -166901,22 +171759,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"; @@ -166925,7 +171783,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) @@ -166945,7 +171803,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) { @@ -166954,17 +171812,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) { @@ -166973,7 +171831,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) @@ -166992,12 +171850,12 @@ 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; } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) { var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"], long + 1); if (error) return ".google.api.fieldInfo." + error; @@ -167016,6 +171874,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) @@ -167151,18 +172011,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); } @@ -167171,7 +172031,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); } @@ -167226,12 +172086,12 @@ } } 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); } if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") + if (!$util.isObject(object[".google.api.fieldInfo"])) throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"], long + 1); } @@ -167247,9 +172107,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 = []; @@ -167272,23 +172136,23 @@ object[".google.api.resourceReference"] = null; object[".google.api.fieldInfo"] = 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 = []; @@ -167298,26 +172162,26 @@ 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.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], 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); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options, q + 1); return object; }; @@ -167487,9 +172351,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")) @@ -167507,7 +172375,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(); }; /** @@ -167581,7 +172449,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"; @@ -167599,7 +172467,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; @@ -167616,6 +172484,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) @@ -167691,17 +172561,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; }; @@ -167815,9 +172689,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")) @@ -167839,7 +172717,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(); }; /** @@ -167921,7 +172799,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"; @@ -167939,7 +172817,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"; @@ -167957,10 +172835,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"; @@ -167992,6 +172870,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) @@ -168179,9 +173059,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; @@ -168189,13 +173073,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; }; @@ -168295,14 +173179,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; }; @@ -168316,7 +173204,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(); }; /** @@ -168392,12 +173280,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) { @@ -168420,13 +173308,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); } @@ -168435,7 +173325,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); } @@ -168452,20 +173342,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; }; @@ -168589,9 +173483,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")) @@ -168599,10 +173497,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; }; @@ -168616,7 +173514,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(); }; /** @@ -168704,21 +173602,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) { @@ -168741,6 +173639,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) @@ -168753,7 +173653,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); } @@ -168762,7 +173662,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); } @@ -168779,9 +173679,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 = []; @@ -168791,18 +173695,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; }; @@ -168926,20 +173830,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; }; @@ -168953,7 +173861,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(); }; /** @@ -169041,23 +173949,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) { @@ -169080,6 +173988,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) @@ -169088,14 +173998,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); } @@ -169104,7 +174014,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); } @@ -169121,9 +174031,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 = []; @@ -169133,18 +174047,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; }; @@ -169277,16 +174191,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")) @@ -169306,7 +174224,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(); }; /** @@ -169398,15 +174316,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) { @@ -169415,13 +174333,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; @@ -169438,13 +174356,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); } @@ -169455,7 +174375,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); } @@ -169478,9 +174398,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 = []; @@ -169491,20 +174415,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; }; @@ -169638,23 +174562,27 @@ * @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.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; }; @@ -169668,7 +174596,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(); }; /** @@ -169762,10 +174690,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"; @@ -169774,12 +174702,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) { @@ -169788,12 +174716,12 @@ 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) @@ -169814,6 +174742,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) @@ -169842,7 +174772,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); } @@ -169851,13 +174781,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); } @@ -169880,9 +174810,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 = []; @@ -169894,24 +174828,24 @@ object.features = 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.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; }; @@ -170068,12 +175002,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")) @@ -170099,7 +175037,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(); }; /** @@ -170195,7 +175133,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) { @@ -170204,22 +175142,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; @@ -170236,6 +175174,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) @@ -170246,7 +175186,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); } @@ -170255,7 +175195,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") @@ -170264,7 +175204,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") @@ -170292,9 +175232,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 = []; @@ -170302,14 +175246,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 = ""; @@ -170323,25 +175267,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; }; @@ -170434,9 +175382,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; @@ -170452,7 +175404,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(); }; /** @@ -170492,9 +175444,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; }; @@ -170548,6 +175500,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) @@ -170569,17 +175523,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; }; @@ -170732,9 +175690,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")) @@ -170764,7 +175726,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(); }; /** @@ -170862,7 +175824,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"; @@ -170872,7 +175834,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"; @@ -170881,7 +175843,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"; @@ -170890,7 +175852,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"; @@ -170899,7 +175861,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"; @@ -170908,7 +175870,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"; @@ -170917,7 +175879,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"; @@ -170926,7 +175888,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"; @@ -170951,6 +175913,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) @@ -171140,9 +176104,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; @@ -171154,21 +176122,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; }; @@ -171357,9 +176325,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; }; @@ -171373,7 +176345,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(); }; /** @@ -171453,10 +176425,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(); }; @@ -171597,12 +176565,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")) @@ -171620,7 +176592,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(); }; /** @@ -171700,7 +176672,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) { @@ -171709,7 +176681,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"; @@ -171727,7 +176699,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"; @@ -171759,6 +176731,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) @@ -171769,7 +176743,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); } @@ -171898,9 +176872,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 = []; @@ -171911,11 +176889,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; }; @@ -172017,15 +176995,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; }; @@ -172039,7 +177021,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(); }; /** @@ -172117,7 +177099,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"; @@ -172135,12 +177117,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; @@ -172159,6 +177141,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) @@ -172221,12 +177205,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); } @@ -172242,21 +177226,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; }; @@ -172346,12 +177334,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; }; @@ -172365,7 +177357,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(); }; /** @@ -172437,7 +177429,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) { @@ -172460,6 +177452,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) @@ -172470,7 +177464,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); } @@ -172487,16 +177481,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; }; @@ -172619,9 +177617,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) @@ -172654,7 +177656,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(); }; /** @@ -172756,27 +177758,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) @@ -172797,6 +177799,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) @@ -172839,9 +177843,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 = []; @@ -172862,9 +177870,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 = []; @@ -172960,12 +177968,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; }; @@ -172979,7 +177991,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(); }; /** @@ -173051,7 +178063,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) { @@ -173074,6 +178086,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) @@ -173084,7 +178098,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); } @@ -173101,16 +178115,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; }; @@ -173231,9 +178249,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) @@ -173261,7 +178283,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(); }; /** @@ -173354,23 +178376,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"; @@ -173393,6 +178415,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) @@ -173443,9 +178467,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 = []; @@ -173460,13 +178488,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; }; @@ -173597,9 +178625,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")) @@ -173617,7 +178649,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(); }; /** @@ -173691,10 +178723,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; @@ -173711,6 +178743,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) @@ -173718,7 +178752,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") @@ -173739,24 +178773,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; }; @@ -173852,9 +178892,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")) @@ -173872,7 +178916,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(); }; /** @@ -173946,10 +178990,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; @@ -173966,6 +179010,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) @@ -173973,7 +179019,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") @@ -173994,24 +179040,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; }; @@ -174098,9 +179150,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DoubleValue.encode = function encode(message, writer) { + DoubleValue.encode = function encode(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 1, wireType 1 =*/9).double(message.value); return writer; @@ -174116,7 +179172,7 @@ * @returns {$protobuf.Writer} Writer */ DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -174186,7 +179242,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 (typeof message.value !== "number") return "value: number expected"; return null; @@ -174203,6 +179259,8 @@ DoubleValue.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.DoubleValue) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.DoubleValue: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -174222,13 +179280,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DoubleValue.toObject = function toObject(message, options) { + DoubleValue.toObject = function toObject(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 = 0; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; return object; }; @@ -174315,9 +179377,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FloatValue.encode = function encode(message, writer) { + FloatValue.encode = function encode(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 1, wireType 5 =*/13).float(message.value); return writer; @@ -174333,7 +179399,7 @@ * @returns {$protobuf.Writer} Writer */ FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -174403,7 +179469,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 (typeof message.value !== "number") return "value: number expected"; return null; @@ -174420,6 +179486,8 @@ FloatValue.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.FloatValue) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.FloatValue: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -174439,13 +179507,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FloatValue.toObject = function toObject(message, options) { + FloatValue.toObject = function toObject(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 = 0; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; return object; }; @@ -174532,9 +179604,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int64Value.encode = function encode(message, writer) { + Int64Value.encode = function encode(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 1, wireType 0 =*/8).int64(message.value); return writer; @@ -174550,7 +179626,7 @@ * @returns {$protobuf.Writer} Writer */ Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -174620,7 +179696,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 (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) return "value: integer|Long expected"; return null; @@ -174637,6 +179713,8 @@ Int64Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Int64Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Int64Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -174644,7 +179722,7 @@ var message = new $root.google.protobuf.Int64Value(); if (object.value != null) if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; + message.value = $util.Long.fromValue(object.value, false); else if (typeof object.value === "string") message.value = parseInt(object.value, 10); else if (typeof object.value === "number") @@ -174663,18 +179741,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Int64Value.toObject = function toObject(message, options) { + Int64Value.toObject = function toObject(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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") + object.value = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.value = typeof message.value === "number" ? BigInt(message.value) : $util.Long.fromBits(message.value.low >>> 0, message.value.high >>> 0, false).toBigInt(); + else if (typeof message.value === "number") object.value = options.longs === String ? String(message.value) : message.value; else object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; @@ -174763,9 +179847,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt64Value.encode = function encode(message, writer) { + UInt64Value.encode = function encode(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 1, wireType 0 =*/8).uint64(message.value); return writer; @@ -174781,7 +179869,7 @@ * @returns {$protobuf.Writer} Writer */ UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -174851,7 +179939,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 (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) return "value: integer|Long expected"; return null; @@ -174868,6 +179956,8 @@ UInt64Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.UInt64Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UInt64Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -174875,7 +179965,7 @@ var message = new $root.google.protobuf.UInt64Value(); if (object.value != null) if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; + message.value = $util.Long.fromValue(object.value, true); else if (typeof object.value === "string") message.value = parseInt(object.value, 10); else if (typeof object.value === "number") @@ -174894,18 +179984,24 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UInt64Value.toObject = function toObject(message, options) { + UInt64Value.toObject = function toObject(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.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") + object.value = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.value = typeof message.value === "number" ? BigInt(message.value) : $util.Long.fromBits(message.value.low >>> 0, message.value.high >>> 0, true).toBigInt(); + else if (typeof message.value === "number") object.value = options.longs === String ? String(message.value) : message.value; else object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; @@ -174994,9 +180090,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int32Value.encode = function encode(message, writer) { + Int32Value.encode = function encode(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 1, wireType 0 =*/8).int32(message.value); return writer; @@ -175012,7 +180112,7 @@ * @returns {$protobuf.Writer} Writer */ Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -175082,7 +180182,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 (!$util.isInteger(message.value)) return "value: integer expected"; return null; @@ -175099,6 +180199,8 @@ Int32Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.Int32Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.Int32Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -175118,13 +180220,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Int32Value.toObject = function toObject(message, options) { + Int32Value.toObject = function toObject(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 = 0; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -175211,9 +180317,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt32Value.encode = function encode(message, writer) { + UInt32Value.encode = function encode(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 1, wireType 0 =*/8).uint32(message.value); return writer; @@ -175229,7 +180339,7 @@ * @returns {$protobuf.Writer} Writer */ UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -175299,7 +180409,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 (!$util.isInteger(message.value)) return "value: integer expected"; return null; @@ -175316,6 +180426,8 @@ UInt32Value.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.UInt32Value) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.UInt32Value: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -175335,13 +180447,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UInt32Value.toObject = function toObject(message, options) { + UInt32Value.toObject = function toObject(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 = 0; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -175428,9 +180544,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoolValue.encode = function encode(message, writer) { + BoolValue.encode = function encode(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 1, wireType 0 =*/8).bool(message.value); return writer; @@ -175446,7 +180566,7 @@ * @returns {$protobuf.Writer} Writer */ BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -175516,7 +180636,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 (typeof message.value !== "boolean") return "value: boolean expected"; return null; @@ -175533,6 +180653,8 @@ BoolValue.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.BoolValue) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.BoolValue: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -175552,13 +180674,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BoolValue.toObject = function toObject(message, options) { + BoolValue.toObject = function toObject(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 = false; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -175645,9 +180771,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StringValue.encode = function encode(message, writer) { + StringValue.encode = function encode(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 1, wireType 2 =*/10).string(message.value); return writer; @@ -175663,7 +180793,7 @@ * @returns {$protobuf.Writer} Writer */ StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -175733,7 +180863,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 (!$util.isString(message.value)) return "value: string expected"; return null; @@ -175750,6 +180880,8 @@ StringValue.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.StringValue) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.StringValue: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -175769,13 +180901,17 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StringValue.toObject = function toObject(message, options) { + StringValue.toObject = function toObject(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 = ""; - if (message.value != null && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) object.value = message.value; return object; }; @@ -175862,9 +180998,13 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BytesValue.encode = function encode(message, writer) { + BytesValue.encode = function encode(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 1, wireType 2 =*/10).bytes(message.value); return writer; @@ -175880,7 +181020,7 @@ * @returns {$protobuf.Writer} Writer */ BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -175950,7 +181090,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 (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) return "value: buffer expected"; return null; @@ -175967,6 +181107,8 @@ BytesValue.fromObject = function fromObject(object, long) { if (object instanceof $root.google.protobuf.BytesValue) return object; + if (!$util.isObject(object)) + throw TypeError(".google.protobuf.BytesValue: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) @@ -175989,9 +181131,13 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BytesValue.toObject = function toObject(message, options) { + BytesValue.toObject = function toObject(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) @@ -176001,7 +181147,7 @@ if (options.bytes !== Array) object.value = $util.newBuffer(object.value); } - 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; }; @@ -176097,9 +181243,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")) @@ -176117,7 +181267,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(); }; /** @@ -176191,10 +181341,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; @@ -176211,6 +181361,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) @@ -176235,9 +181387,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 = ""; @@ -176249,9 +181405,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; }; @@ -176339,9 +181495,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]); @@ -176358,7 +181518,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(); }; /** @@ -176430,7 +181590,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) @@ -176451,6 +181611,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) @@ -176475,9 +181637,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 = []; @@ -176562,9 +181728,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; }; @@ -176578,7 +181748,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(); }; /** @@ -176658,10 +181828,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(); }; @@ -176791,16 +181957,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; }; @@ -176814,7 +181984,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(); }; /** @@ -176894,13 +182064,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) { @@ -176923,6 +182093,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) @@ -176937,7 +182109,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); } @@ -176954,9 +182126,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 = []; @@ -176964,14 +182140,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; }; @@ -177079,13 +182255,17 @@ * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Interval.encode = function encode(message, writer) { + Interval.encode = function encode(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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim(); return writer; }; @@ -177099,7 +182279,7 @@ * @returns {$protobuf.Writer} Writer */ Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim(); }; /** @@ -177173,12 +182353,12 @@ 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.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; @@ -177197,18 +182377,20 @@ Interval.fromObject = function fromObject(object, long) { if (object instanceof $root.google.type.Interval) return object; + if (!$util.isObject(object)) + throw TypeError(".google.type.Interval: object expected"); if (long === undefined) long = 0; if (long > $util.recursionLimit) throw Error("maximum nesting depth exceeded"); var message = new $root.google.type.Interval(); if (object.startTime != null) { - if (typeof object.startTime !== "object") + if (!$util.isObject(object.startTime)) throw TypeError(".google.type.Interval.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.type.Interval.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime, long + 1); } @@ -177224,18 +182406,22 @@ * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Interval.toObject = function toObject(message, options) { + Interval.toObject = function toObject(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.startTime = null; object.endTime = null; } - 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; }; diff --git a/packages/google-cloud-sql/samples/generated/v1/sql_connect_service.resolve_connect_settings.js b/packages/google-cloud-sql/samples/generated/v1/sql_connect_service.resolve_connect_settings.js deleted file mode 100644 index d648627f78ff..000000000000 --- a/packages/google-cloud-sql/samples/generated/v1/sql_connect_service.resolve_connect_settings.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(dnsName, location) { - // [START sqladmin_v1_generated_SqlConnectService_ResolveConnectSettings_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Cloud SQL instance ID. This does not include the project ID. - */ - // const dnsName = 'abc123' - /** - * Required. The region of the instance. - */ - // const location = 'abc123' - - // Imports the Sql library - const {SqlConnectServiceClient} = require('@google-cloud/sql').v1; - - // Instantiates a client - const sqlClient = new SqlConnectServiceClient(); - - async function callResolveConnectSettings() { - // Construct request - const request = { - dnsName, - location, - }; - - // Run request - const response = await sqlClient.resolveConnectSettings(request); - console.log(response); - } - - callResolveConnectSettings(); - // [END sqladmin_v1_generated_SqlConnectService_ResolveConnectSettings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-sql/src/index.ts b/packages/google-cloud-sql/src/index.ts index fc007be56842..919fbdd59928 100644 --- a/packages/google-cloud-sql/src/index.ts +++ b/packages/google-cloud-sql/src/index.ts @@ -19,18 +19,32 @@ import * as v1 from './v1'; import * as v1beta4 from './v1beta4'; + + const SqlBackupRunsServiceClient = v1.SqlBackupRunsServiceClient; type SqlBackupRunsServiceClient = v1.SqlBackupRunsServiceClient; + + const SqlConnectServiceClient = v1.SqlConnectServiceClient; type SqlConnectServiceClient = v1.SqlConnectServiceClient; const SqlDatabasesServiceClient = v1.SqlDatabasesServiceClient; type SqlDatabasesServiceClient = v1.SqlDatabasesServiceClient; + + + + const SqlFlagsServiceClient = v1.SqlFlagsServiceClient; type SqlFlagsServiceClient = v1.SqlFlagsServiceClient; + + + + const SqlInstancesServiceClient = v1.SqlInstancesServiceClient; type SqlInstancesServiceClient = v1.SqlInstancesServiceClient; const SqlOperationsServiceClient = v1.SqlOperationsServiceClient; type SqlOperationsServiceClient = v1.SqlOperationsServiceClient; + + const SqlSslCertsServiceClient = v1.SqlSslCertsServiceClient; type SqlSslCertsServiceClient = v1.SqlSslCertsServiceClient; const SqlTiersServiceClient = v1.SqlTiersServiceClient; diff --git a/packages/google-cloud-sql/system-test/fixtures/sample/src/index.js b/packages/google-cloud-sql/system-test/fixtures/sample/src/index.js index 261a7ea98698..ae70c39ecfc9 100644 --- a/packages/google-cloud-sql/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-sql/system-test/fixtures/sample/src/index.js @@ -16,19 +16,24 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** + /* eslint-disable node/no-missing-require, no-unused-vars */ const sql = require('@google-cloud/sql'); function main() { + const sqlBackupRunsServiceClient = new sql.SqlBackupRunsServiceClient(); + const sqlConnectServiceClient = new sql.SqlConnectServiceClient(); const sqlDatabasesServiceClient = new sql.SqlDatabasesServiceClient(); - + + const sqlFlagsServiceClient = new sql.SqlFlagsServiceClient(); - + + const sqlInstancesServiceClient = new sql.SqlInstancesServiceClient(); const sqlOperationsServiceClient = new sql.SqlOperationsServiceClient(); - + const sqlSslCertsServiceClient = new sql.SqlSslCertsServiceClient(); const sqlTiersServiceClient = new sql.SqlTiersServiceClient(); const sqlUsersServiceClient = new sql.SqlUsersServiceClient(); diff --git a/packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts index e5e6f4a2689a..39e509726490 100644 --- a/packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-sql/system-test/fixtures/sample/src/index.ts @@ -17,12 +17,19 @@ // ** All changes to this file may be overwritten. ** import { + SqlBackupRunsServiceClient, + SqlConnectServiceClient, SqlDatabasesServiceClient, + + SqlFlagsServiceClient, + + SqlInstancesServiceClient, SqlOperationsServiceClient, + SqlSslCertsServiceClient, SqlTiersServiceClient, SqlUsersServiceClient, @@ -31,30 +38,33 @@ import { // check that the client class type name can be used function doStuffWithSqlBackupRunsServiceClient( - client: SqlBackupRunsServiceClient + client: SqlBackupRunsServiceClient, ) { client.close(); } + function doStuffWithSqlConnectServiceClient(client: SqlConnectServiceClient) { client.close(); } function doStuffWithSqlDatabasesServiceClient( - client: SqlDatabasesServiceClient + client: SqlDatabasesServiceClient, ) { client.close(); } + function doStuffWithSqlFlagsServiceClient(client: SqlFlagsServiceClient) { client.close(); } + function doStuffWithSqlInstancesServiceClient( - client: SqlInstancesServiceClient + client: SqlInstancesServiceClient, ) { client.close(); } function doStuffWithSqlOperationsServiceClient( - client: SqlOperationsServiceClient + client: SqlOperationsServiceClient, ) { client.close(); } @@ -70,33 +80,31 @@ function doStuffWithSqlUsersServiceClient(client: SqlUsersServiceClient) { } function main() { - // check that the client instance can be created + // check that the client instance can be created const sqlBackupRunsServiceClient = new SqlBackupRunsServiceClient(); doStuffWithSqlBackupRunsServiceClient(sqlBackupRunsServiceClient); + // check that the client instance can be created const sqlConnectServiceClient = new SqlConnectServiceClient(); doStuffWithSqlConnectServiceClient(sqlConnectServiceClient); // check that the client instance can be created const sqlDatabasesServiceClient = new SqlDatabasesServiceClient(); doStuffWithSqlDatabasesServiceClient(sqlDatabasesServiceClient); - // check that the client instance can be created - + + // check that the client instance can be created const sqlFlagsServiceClient = new SqlFlagsServiceClient(); doStuffWithSqlFlagsServiceClient(sqlFlagsServiceClient); - // check that the client instance can be created - - // check that the client instance can be created - + + // check that the client instance can be created const sqlInstancesServiceClient = new SqlInstancesServiceClient(); doStuffWithSqlInstancesServiceClient(sqlInstancesServiceClient); // check that the client instance can be created const sqlOperationsServiceClient = new SqlOperationsServiceClient(); doStuffWithSqlOperationsServiceClient(sqlOperationsServiceClient); - // check that the client instance can be created - + // check that the client instance can be created const sqlSslCertsServiceClient = new SqlSslCertsServiceClient(); doStuffWithSqlSslCertsServiceClient(sqlSslCertsServiceClient); diff --git a/packages/google-cloud-sql/test/gapic_sql_backups_service_v1.ts b/packages/google-cloud-sql/test/gapic_sql_backups_service_v1.ts index e0e3601d826c..42a04ddd8371 100644 --- a/packages/google-cloud-sql/test/gapic_sql_backups_service_v1.ts +++ b/packages/google-cloud-sql/test/gapic_sql_backups_service_v1.ts @@ -1006,9 +1006,9 @@ describe('v1.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); @@ -1054,9 +1054,9 @@ describe('v1.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); @@ -1097,9 +1097,9 @@ describe('v1.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); @@ -1139,9 +1139,9 @@ describe('v1.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); }); diff --git a/packages/google-cloud-sql/test/gapic_sql_backups_service_v1beta4.ts b/packages/google-cloud-sql/test/gapic_sql_backups_service_v1beta4.ts index b2fece3336d8..80358e559afc 100644 --- a/packages/google-cloud-sql/test/gapic_sql_backups_service_v1beta4.ts +++ b/packages/google-cloud-sql/test/gapic_sql_backups_service_v1beta4.ts @@ -1041,9 +1041,9 @@ describe('v1beta4.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); @@ -1093,9 +1093,9 @@ describe('v1beta4.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.createStream as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); @@ -1137,9 +1137,9 @@ describe('v1beta4.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); @@ -1180,9 +1180,9 @@ describe('v1beta4.SqlBackupsServiceClient', () => { assert( (client.descriptors.page.listBackups.asyncIterate as SinonStub) .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams, + ), ); }); });