From f13e84576339b07f4e9176aabefb8f39975dcb4b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:22:16 +0000 Subject: [PATCH] fix: regenerated protos JS and TS definitions (#376) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../protos/protos.d.ts | 2 +- .../google-cloud-documentai/protos/protos.js | 348 +++++++++++++++--- 2 files changed, 305 insertions(+), 45 deletions(-) diff --git a/packages/google-cloud-documentai/protos/protos.d.ts b/packages/google-cloud-documentai/protos/protos.d.ts index 403351b11c7..383050386aa 100644 --- a/packages/google-cloud-documentai/protos/protos.d.ts +++ b/packages/google-cloud-documentai/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-documentai/protos/protos.js b/packages/google-cloud-documentai/protos/protos.js index 0bf01ebda64..e1286d21a73 100644 --- a/packages/google-cloud-documentai/protos/protos.js +++ b/packages/google-cloud-documentai/protos/protos.js @@ -3658,6 +3658,12 @@ message.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.fromObject(object.boundingPoly); } switch (object.orientation) { + default: + if (typeof object.orientation === "number") { + message.orientation = object.orientation; + break; + } + break; case "ORIENTATION_UNSPECIFIED": case 0: message.orientation = 0; @@ -3708,7 +3714,7 @@ if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) object.boundingPoly = $root.google.cloud.documentai.v1.BoundingPoly.toObject(message.boundingPoly, options); if (message.orientation != null && message.hasOwnProperty("orientation")) - object.orientation = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Layout.Orientation[message.orientation] : message.orientation; + object.orientation = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1.Document.Page.Layout.Orientation[message.orientation] : message.orientation; return object; }; @@ -5071,6 +5077,12 @@ return object; var message = new $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak(); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -5107,7 +5119,7 @@ if (options.defaults) object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; return object; }; @@ -9585,6 +9597,12 @@ else if (typeof object.page === "object") message.page = new $util.LongBits(object.page.low >>> 0, object.page.high >>> 0).toNumber(); switch (object.layoutType) { + default: + if (typeof object.layoutType === "number") { + message.layoutType = object.layoutType; + break; + } + break; case "LAYOUT_TYPE_UNSPECIFIED": case 0: message.layoutType = 0; @@ -9660,7 +9678,7 @@ else object.page = options.longs === String ? $util.Long.prototype.toString.call(message.page) : options.longs === Number ? new $util.LongBits(message.page.low >>> 0, message.page.high >>> 0).toNumber() : message.page; if (message.layoutType != null && message.hasOwnProperty("layoutType")) - object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; + object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType[message.layoutType] === undefined ? message.layoutType : $root.google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; if (message.layoutId != null && message.hasOwnProperty("layoutId")) object.layoutId = message.layoutId; if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) @@ -9966,6 +9984,12 @@ } } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "OPERATION_TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -10028,7 +10052,7 @@ object.parents[j] = $root.google.cloud.documentai.v1.Document.Provenance.Parent.toObject(message.parents[j], options); } if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Provenance.OperationType[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.documentai.v1.Document.Provenance.OperationType[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1.Document.Provenance.OperationType[message.type] : message.type; return object; }; @@ -14694,6 +14718,12 @@ return object; var message = new $root.google.cloud.documentai.v1.HumanReviewStatus(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -14741,7 +14771,7 @@ object.humanReviewOperation = ""; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.HumanReviewStatus.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1.HumanReviewStatus.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.HumanReviewStatus.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) @@ -15739,6 +15769,12 @@ return object; var message = new $root.google.cloud.documentai.v1.BatchProcessMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -15815,7 +15851,7 @@ object.updateTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.BatchProcessMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1.BatchProcessMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.BatchProcessMetadata.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -22759,6 +22795,12 @@ if (object.enableSchemaValidation != null) message.enableSchemaValidation = Boolean(object.enableSchemaValidation); switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; case "DEFAULT": case 0: message.priority = 0; @@ -22805,7 +22847,7 @@ object.source = "inlineDocument"; } if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentRequest.Priority[message.priority] : message.priority; + object.priority = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentRequest.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.documentai.v1.ReviewDocumentRequest.Priority[message.priority] : message.priority; if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) object.documentSchema = $root.google.cloud.documentai.v1.DocumentSchema.toObject(message.documentSchema, options); return object; @@ -23048,6 +23090,12 @@ if (object.gcsDestination != null) message.gcsDestination = String(object.gcsDestination); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -23087,7 +23135,7 @@ if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) object.gcsDestination = message.gcsDestination; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentResponse.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1.ReviewDocumentResponse.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.ReviewDocumentResponse.State[message.state] : message.state; if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) object.rejectionReason = message.rejectionReason; return object; @@ -24441,6 +24489,12 @@ if (object.valueType != null) message.valueType = String(object.valueType); switch (object.occurrenceType) { + default: + if (typeof object.occurrenceType === "number") { + message.occurrenceType = object.occurrenceType; + break; + } + break; case "OCCURRENCE_TYPE_UNSPECIFIED": case 0: message.occurrenceType = 0; @@ -24488,7 +24542,7 @@ if (message.valueType != null && message.hasOwnProperty("valueType")) object.valueType = message.valueType; if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) - object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; + object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] === undefined ? message.occurrenceType : $root.google.cloud.documentai.v1.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; return object; }; @@ -25055,6 +25109,12 @@ return object; var message = new $root.google.cloud.documentai.v1.CommonOperationMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -25118,7 +25178,7 @@ object.resource = ""; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.CommonOperationMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1.CommonOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.CommonOperationMetadata.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -25476,6 +25536,12 @@ if (object.displayName != null) message.displayName = String(object.displayName); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -25556,7 +25622,7 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1.ProcessorVersion.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.ProcessorVersion.State[message.state] : message.state; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) @@ -26152,6 +26218,12 @@ if (object.displayName != null) message.displayName = String(object.displayName); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -26229,7 +26301,7 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1.Processor.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1.Processor.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1.Processor.State[message.state] : message.state; if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) object.processEndpoint = message.processEndpoint; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -26575,6 +26647,12 @@ if (object.allowCreation != null) message.allowCreation = Boolean(object.allowCreation); switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; case "LAUNCH_STAGE_UNSPECIFIED": case 0: message.launchStage = 0; @@ -26647,7 +26725,7 @@ if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) object.allowCreation = message.allowCreation; if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; return object; }; @@ -29397,6 +29475,12 @@ message.boundingPoly = $root.google.cloud.documentai.v1beta1.BoundingPoly.fromObject(object.boundingPoly); } switch (object.orientation) { + default: + if (typeof object.orientation === "number") { + message.orientation = object.orientation; + break; + } + break; case "ORIENTATION_UNSPECIFIED": case 0: message.orientation = 0; @@ -29447,7 +29531,7 @@ if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) object.boundingPoly = $root.google.cloud.documentai.v1beta1.BoundingPoly.toObject(message.boundingPoly, options); if (message.orientation != null && message.hasOwnProperty("orientation")) - object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation[message.orientation] : message.orientation; + object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1beta1.Document.Page.Layout.Orientation[message.orientation] : message.orientation; return object; }; @@ -30695,6 +30779,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak(); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -30731,7 +30821,7 @@ if (options.defaults) object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta1.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; return object; }; @@ -37998,6 +38088,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta1.OperationMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -38062,7 +38158,7 @@ object.updateTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta1.OperationMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta1.OperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta1.OperationMetadata.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -40970,6 +41066,12 @@ message.boundingPoly = $root.google.cloud.documentai.v1beta2.BoundingPoly.fromObject(object.boundingPoly); } switch (object.orientation) { + default: + if (typeof object.orientation === "number") { + message.orientation = object.orientation; + break; + } + break; case "ORIENTATION_UNSPECIFIED": case 0: message.orientation = 0; @@ -41023,7 +41125,7 @@ if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) object.boundingPoly = $root.google.cloud.documentai.v1beta2.BoundingPoly.toObject(message.boundingPoly, options); if (message.orientation != null && message.hasOwnProperty("orientation")) - object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta2.Document.Page.Layout.Orientation[message.orientation] : message.orientation; + object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta2.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1beta2.Document.Page.Layout.Orientation[message.orientation] : message.orientation; if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; return object; @@ -42273,6 +42375,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta2.Document.Page.Token.DetectedBreak(); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -42309,7 +42417,7 @@ if (options.defaults) object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1beta2.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.documentai.v1beta2.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta2.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; return object; }; @@ -45664,6 +45772,12 @@ else if (typeof object.page === "object") message.page = new $util.LongBits(object.page.low >>> 0, object.page.high >>> 0).toNumber(); switch (object.layoutType) { + default: + if (typeof object.layoutType === "number") { + message.layoutType = object.layoutType; + break; + } + break; case "LAYOUT_TYPE_UNSPECIFIED": case 0: message.layoutType = 0; @@ -45730,7 +45844,7 @@ else object.page = options.longs === String ? $util.Long.prototype.toString.call(message.page) : options.longs === Number ? new $util.LongBits(message.page.low >>> 0, message.page.high >>> 0).toNumber() : message.page; if (message.layoutType != null && message.hasOwnProperty("layoutType")) - object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1beta2.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; + object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1beta2.Document.PageAnchor.PageRef.LayoutType[message.layoutType] === undefined ? message.layoutType : $root.google.cloud.documentai.v1beta2.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; if (message.layoutId != null && message.hasOwnProperty("layoutId")) object.layoutId = message.layoutId; return object; @@ -50619,6 +50733,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta2.OperationMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -50683,7 +50803,7 @@ object.updateTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta2.OperationMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta2.OperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta2.OperationMetadata.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -54350,6 +54470,12 @@ message.boundingPoly = $root.google.cloud.documentai.v1beta3.BoundingPoly.fromObject(object.boundingPoly); } switch (object.orientation) { + default: + if (typeof object.orientation === "number") { + message.orientation = object.orientation; + break; + } + break; case "ORIENTATION_UNSPECIFIED": case 0: message.orientation = 0; @@ -54400,7 +54526,7 @@ if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) object.boundingPoly = $root.google.cloud.documentai.v1beta3.BoundingPoly.toObject(message.boundingPoly, options); if (message.orientation != null && message.hasOwnProperty("orientation")) - object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation[message.orientation] : message.orientation; + object.orientation = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation[message.orientation] === undefined ? message.orientation : $root.google.cloud.documentai.v1beta3.Document.Page.Layout.Orientation[message.orientation] : message.orientation; return object; }; @@ -55763,6 +55889,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak(); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -55799,7 +55931,7 @@ if (options.defaults) object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta3.Document.Page.Token.DetectedBreak.Type[message.type] : message.type; return object; }; @@ -60277,6 +60409,12 @@ else if (typeof object.page === "object") message.page = new $util.LongBits(object.page.low >>> 0, object.page.high >>> 0).toNumber(); switch (object.layoutType) { + default: + if (typeof object.layoutType === "number") { + message.layoutType = object.layoutType; + break; + } + break; case "LAYOUT_TYPE_UNSPECIFIED": case 0: message.layoutType = 0; @@ -60352,7 +60490,7 @@ else object.page = options.longs === String ? $util.Long.prototype.toString.call(message.page) : options.longs === Number ? new $util.LongBits(message.page.low >>> 0, message.page.high >>> 0).toNumber() : message.page; if (message.layoutType != null && message.hasOwnProperty("layoutType")) - object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; + object.layoutType = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType[message.layoutType] === undefined ? message.layoutType : $root.google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.LayoutType[message.layoutType] : message.layoutType; if (message.layoutId != null && message.hasOwnProperty("layoutId")) object.layoutId = message.layoutId; if (message.boundingPoly != null && message.hasOwnProperty("boundingPoly")) @@ -60658,6 +60796,12 @@ } } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "OPERATION_TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -60720,7 +60864,7 @@ object.parents[j] = $root.google.cloud.documentai.v1beta3.Document.Provenance.Parent.toObject(message.parents[j], options); } if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Provenance.OperationType[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.documentai.v1beta3.Document.Provenance.OperationType[message.type] === undefined ? message.type : $root.google.cloud.documentai.v1beta3.Document.Provenance.OperationType[message.type] : message.type; return object; }; @@ -65414,6 +65558,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta3.HumanReviewStatus(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -65461,7 +65611,7 @@ object.humanReviewOperation = ""; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.HumanReviewStatus.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.HumanReviewStatus.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.HumanReviewStatus.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.humanReviewOperation != null && message.hasOwnProperty("humanReviewOperation")) @@ -66985,6 +67135,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta3.BatchProcessMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -67061,7 +67217,7 @@ object.updateTime = null; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.BatchProcessMetadata.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -74053,6 +74209,12 @@ if (object.enableSchemaValidation != null) message.enableSchemaValidation = Boolean(object.enableSchemaValidation); switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; case "DEFAULT": case 0: message.priority = 0; @@ -74102,7 +74264,7 @@ object.source = "inlineDocument"; } if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority[message.priority] : message.priority; + object.priority = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority[message.priority] === undefined ? message.priority : $root.google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority[message.priority] : message.priority; if (message.documentSchema != null && message.hasOwnProperty("documentSchema")) object.documentSchema = $root.google.cloud.documentai.v1beta3.DocumentSchema.toObject(message.documentSchema, options); return object; @@ -74345,6 +74507,12 @@ if (object.gcsDestination != null) message.gcsDestination = String(object.gcsDestination); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -74384,7 +74552,7 @@ if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) object.gcsDestination = message.gcsDestination; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ReviewDocumentResponse.State[message.state] : message.state; if (message.rejectionReason != null && message.hasOwnProperty("rejectionReason")) object.rejectionReason = message.rejectionReason; return object; @@ -74690,6 +74858,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -74759,7 +74933,7 @@ object.questionId = ""; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -75895,6 +76069,12 @@ if (object.valueType != null) message.valueType = String(object.valueType); switch (object.occurrenceType) { + default: + if (typeof object.occurrenceType === "number") { + message.occurrenceType = object.occurrenceType; + break; + } + break; case "OCCURRENCE_TYPE_UNSPECIFIED": case 0: message.occurrenceType = 0; @@ -75942,7 +76122,7 @@ if (message.valueType != null && message.hasOwnProperty("valueType")) object.valueType = message.valueType; if (message.occurrenceType != null && message.hasOwnProperty("occurrenceType")) - object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; + object.occurrenceType = options.enums === String ? $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] === undefined ? message.occurrenceType : $root.google.cloud.documentai.v1beta3.DocumentSchema.EntityType.Property.OccurrenceType[message.occurrenceType] : message.occurrenceType; return object; }; @@ -76509,6 +76689,12 @@ return object; var message = new $root.google.cloud.documentai.v1beta3.CommonOperationMetadata(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -76572,7 +76758,7 @@ object.resource = ""; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.CommonOperationMetadata.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -76930,6 +77116,12 @@ if (object.displayName != null) message.displayName = String(object.displayName); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -77010,7 +77202,7 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.ProcessorVersion.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.ProcessorVersion.State[message.state] : message.state; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) @@ -77606,6 +77798,12 @@ if (object.displayName != null) message.displayName = String(object.displayName); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -77683,7 +77881,7 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.Processor.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.documentai.v1beta3.Processor.State[message.state] === undefined ? message.state : $root.google.cloud.documentai.v1beta3.Processor.State[message.state] : message.state; if (message.processEndpoint != null && message.hasOwnProperty("processEndpoint")) object.processEndpoint = message.processEndpoint; if (message.createTime != null && message.hasOwnProperty("createTime")) @@ -78029,6 +78227,12 @@ if (object.allowCreation != null) message.allowCreation = Boolean(object.allowCreation); switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; case "LAUNCH_STAGE_UNSPECIFIED": case 0: message.launchStage = 0; @@ -78101,7 +78305,7 @@ if (message.allowCreation != null && message.hasOwnProperty("allowCreation")) object.allowCreation = message.allowCreation; if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; return object; }; @@ -79648,6 +79852,12 @@ if (object.nameField != null) message.nameField = String(object.nameField); switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; case "HISTORY_UNSPECIFIED": case 0: message.history = 0; @@ -79672,6 +79882,10 @@ for (var i = 0; i < object.style.length; ++i) switch (object.style[i]) { default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } case "STYLE_UNSPECIFIED": case 0: message.style[i] = 0; @@ -79719,7 +79933,7 @@ if (message.nameField != null && message.hasOwnProperty("nameField")) object.nameField = message.nameField; if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : 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")) object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) @@ -79727,7 +79941,7 @@ if (message.style && message.style.length) { object.style = []; for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; } return object; }; @@ -82564,6 +82778,12 @@ if (object.number != null) message.number = object.number | 0; switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; case "LABEL_OPTIONAL": case 1: message.label = 1; @@ -82578,6 +82798,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -82704,9 +82930,9 @@ if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : 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")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : 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")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) @@ -85053,6 +85279,12 @@ if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; case "SPEED": case 1: message.optimizeFor = 1; @@ -85161,7 +85393,7 @@ if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : 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")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) @@ -85963,6 +86195,12 @@ return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; case "STRING": case 0: message.ctype = 0; @@ -85979,6 +86217,12 @@ if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; case "JS_NORMAL": case 0: message.jstype = 0; @@ -86017,6 +86261,10 @@ for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; @@ -86087,7 +86335,7 @@ object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : 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")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -86095,7 +86343,7 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : 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")) object.weak = message.weak; if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) @@ -86108,7 +86356,7 @@ 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]] : message[".google.api.fieldBehavior"][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); @@ -87485,6 +87733,12 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; @@ -87554,7 +87808,7 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : 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.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -89309,6 +89563,12 @@ if (object.end != null) message.end = object.end | 0; switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; case "NONE": case 0: message.semantic = 0; @@ -89358,7 +89618,7 @@ if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : 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; };