From 36bdec5e1bbf106f6d257bf3f48ef8c096033d6b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 16:52:11 -0800 Subject: [PATCH] samples: pull in latest typeless bot, clean up some comments (#224) samples: pull in latest typeless bot, clean up some comments Source-Link: https://github.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> --- .../google-cloud-retail/protos/protos.d.ts | 2 +- packages/google-cloud-retail/protos/protos.js | 602 +++++++++++++++--- 2 files changed, 525 insertions(+), 79 deletions(-) diff --git a/packages/google-cloud-retail/protos/protos.d.ts b/packages/google-cloud-retail/protos/protos.d.ts index f6b467a7e74..1d348e9aa9b 100644 --- a/packages/google-cloud-retail/protos/protos.d.ts +++ b/packages/google-cloud-retail/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-retail/protos/protos.js b/packages/google-cloud-retail/protos/protos.js index cff7afe8843..b8840714673 100644 --- a/packages/google-cloud-retail/protos/protos.js +++ b/packages/google-cloud-retail/protos/protos.js @@ -561,6 +561,12 @@ if (object.inUse != null) message.inUse = Boolean(object.inUse); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "UNKNOWN": case 0: message.type = 0; @@ -575,6 +581,12 @@ break; } switch (object.indexableOption) { + default: + if (typeof object.indexableOption === "number") { + message.indexableOption = object.indexableOption; + break; + } + break; case "INDEXABLE_OPTION_UNSPECIFIED": case 0: message.indexableOption = 0; @@ -589,6 +601,12 @@ break; } switch (object.dynamicFacetableOption) { + default: + if (typeof object.dynamicFacetableOption === "number") { + message.dynamicFacetableOption = object.dynamicFacetableOption; + break; + } + break; case "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": case 0: message.dynamicFacetableOption = 0; @@ -603,6 +621,12 @@ break; } switch (object.searchableOption) { + default: + if (typeof object.searchableOption === "number") { + message.searchableOption = object.searchableOption; + break; + } + break; case "SEARCHABLE_OPTION_UNSPECIFIED": case 0: message.searchableOption = 0; @@ -643,15 +667,15 @@ if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) - object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; + object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.IndexableOption[message.indexableOption] === undefined ? message.indexableOption : $root.google.cloud.retail.v2.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) - object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; + object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] === undefined ? message.dynamicFacetableOption : $root.google.cloud.retail.v2.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) - object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; + object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.SearchableOption[message.searchableOption] === undefined ? message.searchableOption : $root.google.cloud.retail.v2.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; if (message.inUse != null && message.hasOwnProperty("inUse")) object.inUse = message.inUse; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.AttributeType[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.retail.v2.CatalogAttribute.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.retail.v2.CatalogAttribute.AttributeType[message.type] : message.type; return object; }; @@ -982,6 +1006,12 @@ } } switch (object.attributeConfigLevel) { + default: + if (typeof object.attributeConfigLevel === "number") { + message.attributeConfigLevel = object.attributeConfigLevel; + break; + } + break; case "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED": case 0: message.attributeConfigLevel = 0; @@ -1026,7 +1056,7 @@ object.catalogAttributes[keys2[j]] = $root.google.cloud.retail.v2.CatalogAttribute.toObject(message.catalogAttributes[keys2[j]], options); } if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) - object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; + object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2.AttributeConfigLevel[message.attributeConfigLevel] === undefined ? message.attributeConfigLevel : $root.google.cloud.retail.v2.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; return object; }; @@ -9679,6 +9709,12 @@ message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } switch (object.reconciliationMode) { + default: + if (typeof object.reconciliationMode === "number") { + message.reconciliationMode = object.reconciliationMode; + break; + } + break; case "RECONCILIATION_MODE_UNSPECIFIED": case 0: message.reconciliationMode = 0; @@ -9728,7 +9764,7 @@ if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.retail.v2.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) @@ -13448,6 +13484,12 @@ if (object.id != null) message.id = String(object.id); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -13529,6 +13571,12 @@ message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); } switch (object.availability) { + default: + if (typeof object.availability === "number") { + message.availability = object.availability; + break; + } + break; case "AVAILABILITY_UNSPECIFIED": case 0: message.availability = 0; @@ -13713,7 +13761,7 @@ if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2.Product.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.retail.v2.Product.Type[message.type] === undefined ? message.type : $root.google.cloud.retail.v2.Product.Type[message.type] : message.type; if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) object.primaryProductId = message.primaryProductId; if (message.collectionMemberIds && message.collectionMemberIds.length) { @@ -13767,7 +13815,7 @@ if (message.availableTime != null && message.hasOwnProperty("availableTime")) object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); if (message.availability != null && message.hasOwnProperty("availability")) - object.availability = options.enums === String ? $root.google.cloud.retail.v2.Product.Availability[message.availability] : message.availability; + object.availability = options.enums === String ? $root.google.cloud.retail.v2.Product.Availability[message.availability] === undefined ? message.availability : $root.google.cloud.retail.v2.Product.Availability[message.availability] : message.availability; if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); if (message.fulfillmentInfo && message.fulfillmentInfo.length) { @@ -20662,6 +20710,10 @@ for (var i = 0; i < object.solutionTypes.length; ++i) switch (object.solutionTypes[i]) { default: + if (typeof object.solutionTypes[i] === "number") { + message.solutionTypes[i] = object.solutionTypes[i]; + break; + } case "SOLUTION_TYPE_UNSPECIFIED": case 0: message.solutionTypes[i] = 0; @@ -20683,6 +20735,10 @@ for (var i = 0; i < object.searchSolutionUseCase.length; ++i) switch (object.searchSolutionUseCase[i]) { default: + if (typeof object.searchSolutionUseCase[i] === "number") { + message.searchSolutionUseCase[i] = object.searchSolutionUseCase[i]; + break; + } case "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED": case 0: message.searchSolutionUseCase[i] = 0; @@ -20739,12 +20795,12 @@ if (message.solutionTypes && message.solutionTypes.length) { object.solutionTypes = []; for (var j = 0; j < message.solutionTypes.length; ++j) - object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } if (message.searchSolutionUseCase && message.searchSolutionUseCase.length) { object.searchSolutionUseCase = []; for (var j = 0; j < message.searchSolutionUseCase.length; ++j) - object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; + object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2.SearchSolutionUseCase[message.searchSolutionUseCase[j]] === undefined ? message.searchSolutionUseCase[j] : $root.google.cloud.retail.v2.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; } return object; }; @@ -30031,6 +30087,12 @@ message.pageCategories[i] = String(object.pageCategories[i]); } switch (object.searchMode) { + default: + if (typeof object.searchMode === "number") { + message.searchMode = object.searchMode; + break; + } + break; case "SEARCH_MODE_UNSPECIFIED": case 0: message.searchMode = 0; @@ -30146,7 +30208,7 @@ if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) object.canonicalFilter = message.canonicalFilter; if (message.searchMode != null && message.hasOwnProperty("searchMode")) - object.searchMode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.SearchMode[message.searchMode] : message.searchMode; + object.searchMode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.cloud.retail.v2.SearchRequest.SearchMode[message.searchMode] : message.searchMode; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); var keys2; @@ -31099,6 +31161,12 @@ return object; var message = new $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -31131,7 +31199,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; return object; }; @@ -31847,6 +31915,12 @@ return object; var message = new $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec(); switch (object.condition) { + default: + if (typeof object.condition === "number") { + message.condition = object.condition; + break; + } + break; case "CONDITION_UNSPECIFIED": case 0: message.condition = 0; @@ -31883,7 +31957,7 @@ object.pinUnexpandedResults = false; } if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + object.condition = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition[message.condition] === undefined ? message.condition : $root.google.cloud.retail.v2.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) object.pinUnexpandedResults = message.pinUnexpandedResults; return object; @@ -32090,6 +32164,12 @@ return object; var message = new $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -32122,7 +32202,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; return object; }; @@ -32327,6 +32407,12 @@ return object; var message = new $root.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -32359,7 +32445,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; return object; }; @@ -34849,6 +34935,10 @@ for (var i = 0; i < object.solutionTypes.length; ++i) switch (object.solutionTypes[i]) { default: + if (typeof object.solutionTypes[i] === "number") { + message.solutionTypes[i] = object.solutionTypes[i]; + break; + } case "SOLUTION_TYPE_UNSPECIFIED": case 0: message.solutionTypes[i] = 0; @@ -34963,7 +35053,7 @@ if (message.solutionTypes && message.solutionTypes.length) { object.solutionTypes = []; for (var j = 0; j < message.solutionTypes.length; ++j) - object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); @@ -38010,6 +38100,12 @@ if (object.parent != null) message.parent = String(object.parent); switch (object.userEventRejoinScope) { + default: + if (typeof object.userEventRejoinScope === "number") { + message.userEventRejoinScope = object.userEventRejoinScope; + break; + } + break; case "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED": case 0: message.userEventRejoinScope = 0; @@ -38046,7 +38142,7 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) - object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; + object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] === undefined ? message.userEventRejoinScope : $root.google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; return object; }; @@ -39018,6 +39114,12 @@ if (object.inUse != null) message.inUse = Boolean(object.inUse); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "UNKNOWN": case 0: message.type = 0; @@ -39032,6 +39134,12 @@ break; } switch (object.indexableOption) { + default: + if (typeof object.indexableOption === "number") { + message.indexableOption = object.indexableOption; + break; + } + break; case "INDEXABLE_OPTION_UNSPECIFIED": case 0: message.indexableOption = 0; @@ -39046,6 +39154,12 @@ break; } switch (object.dynamicFacetableOption) { + default: + if (typeof object.dynamicFacetableOption === "number") { + message.dynamicFacetableOption = object.dynamicFacetableOption; + break; + } + break; case "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": case 0: message.dynamicFacetableOption = 0; @@ -39060,6 +39174,12 @@ break; } switch (object.searchableOption) { + default: + if (typeof object.searchableOption === "number") { + message.searchableOption = object.searchableOption; + break; + } + break; case "SEARCHABLE_OPTION_UNSPECIFIED": case 0: message.searchableOption = 0; @@ -39074,6 +39194,12 @@ break; } switch (object.recommendationsFilteringOption) { + default: + if (typeof object.recommendationsFilteringOption === "number") { + message.recommendationsFilteringOption = object.recommendationsFilteringOption; + break; + } + break; case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": case 0: message.recommendationsFilteringOption = 0; @@ -39115,17 +39241,17 @@ if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) - object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; + object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption[message.indexableOption] === undefined ? message.indexableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) - object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; + object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] === undefined ? message.dynamicFacetableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) - object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; + object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption[message.searchableOption] === undefined ? message.searchableOption : $root.google.cloud.retail.v2alpha.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; if (message.recommendationsFilteringOption != null && message.hasOwnProperty("recommendationsFilteringOption")) - object.recommendationsFilteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.recommendationsFilteringOption] : message.recommendationsFilteringOption; + object.recommendationsFilteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.recommendationsFilteringOption] === undefined ? message.recommendationsFilteringOption : $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.recommendationsFilteringOption] : message.recommendationsFilteringOption; if (message.inUse != null && message.hasOwnProperty("inUse")) object.inUse = message.inUse; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.retail.v2alpha.CatalogAttribute.AttributeType[message.type] : message.type; return object; }; @@ -39456,6 +39582,12 @@ } } switch (object.attributeConfigLevel) { + default: + if (typeof object.attributeConfigLevel === "number") { + message.attributeConfigLevel = object.attributeConfigLevel; + break; + } + break; case "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED": case 0: message.attributeConfigLevel = 0; @@ -39500,7 +39632,7 @@ object.catalogAttributes[keys2[j]] = $root.google.cloud.retail.v2alpha.CatalogAttribute.toObject(message.catalogAttributes[keys2[j]], options); } if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) - object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2alpha.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; + object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2alpha.AttributeConfigLevel[message.attributeConfigLevel] === undefined ? message.attributeConfigLevel : $root.google.cloud.retail.v2alpha.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; return object; }; @@ -48766,6 +48898,12 @@ message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } switch (object.reconciliationMode) { + default: + if (typeof object.reconciliationMode === "number") { + message.reconciliationMode = object.reconciliationMode; + break; + } + break; case "RECONCILIATION_MODE_UNSPECIFIED": case 0: message.reconciliationMode = 0; @@ -48818,7 +48956,7 @@ if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.retail.v2alpha.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) @@ -52512,6 +52650,12 @@ if (object.id != null) message.id = String(object.id); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -52593,6 +52737,12 @@ message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); } switch (object.availability) { + default: + if (typeof object.availability === "number") { + message.availability = object.availability; + break; + } + break; case "AVAILABILITY_UNSPECIFIED": case 0: message.availability = 0; @@ -52766,7 +52916,7 @@ if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Type[message.type] === undefined ? message.type : $root.google.cloud.retail.v2alpha.Product.Type[message.type] : message.type; if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) object.primaryProductId = message.primaryProductId; if (message.collectionMemberIds && message.collectionMemberIds.length) { @@ -52820,7 +52970,7 @@ if (message.availableTime != null && message.hasOwnProperty("availableTime")) object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); if (message.availability != null && message.hasOwnProperty("availability")) - object.availability = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] : message.availability; + object.availability = options.enums === String ? $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] === undefined ? message.availability : $root.google.cloud.retail.v2alpha.Product.Availability[message.availability] : message.availability; if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); if (message.fulfillmentInfo && message.fulfillmentInfo.length) { @@ -59740,6 +59890,10 @@ for (var i = 0; i < object.solutionTypes.length; ++i) switch (object.solutionTypes[i]) { default: + if (typeof object.solutionTypes[i] === "number") { + message.solutionTypes[i] = object.solutionTypes[i]; + break; + } case "SOLUTION_TYPE_UNSPECIFIED": case 0: message.solutionTypes[i] = 0; @@ -59761,6 +59915,10 @@ for (var i = 0; i < object.searchSolutionUseCase.length; ++i) switch (object.searchSolutionUseCase[i]) { default: + if (typeof object.searchSolutionUseCase[i] === "number") { + message.searchSolutionUseCase[i] = object.searchSolutionUseCase[i]; + break; + } case "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED": case 0: message.searchSolutionUseCase[i] = 0; @@ -59822,12 +59980,12 @@ if (message.solutionTypes && message.solutionTypes.length) { object.solutionTypes = []; for (var j = 0; j < message.solutionTypes.length; ++j) - object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } if (message.searchSolutionUseCase && message.searchSolutionUseCase.length) { object.searchSolutionUseCase = []; for (var j = 0; j < message.searchSolutionUseCase.length; ++j) - object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; + object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchSolutionUseCase[message.searchSolutionUseCase[j]] === undefined ? message.searchSolutionUseCase[j] : $root.google.cloud.retail.v2alpha.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; } return object; }; @@ -60603,6 +60761,12 @@ message.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.fromObject(object.queryExpansionSpec); } switch (object.relevanceThreshold) { + default: + if (typeof object.relevanceThreshold === "number") { + message.relevanceThreshold = object.relevanceThreshold; + break; + } + break; case "RELEVANCE_THRESHOLD_UNSPECIFIED": case 0: message.relevanceThreshold = 0; @@ -60639,6 +60803,12 @@ message.pageCategories[i] = String(object.pageCategories[i]); } switch (object.searchMode) { + default: + if (typeof object.searchMode === "number") { + message.searchMode = object.searchMode; + break; + } + break; case "SEARCH_MODE_UNSPECIFIED": case 0: message.searchMode = 0; @@ -60741,7 +60911,7 @@ if (message.queryExpansionSpec != null && message.hasOwnProperty("queryExpansionSpec")) object.queryExpansionSpec = $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.toObject(message.queryExpansionSpec, options); if (message.relevanceThreshold != null && message.hasOwnProperty("relevanceThreshold")) - object.relevanceThreshold = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] : message.relevanceThreshold; + object.relevanceThreshold = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] === undefined ? message.relevanceThreshold : $root.google.cloud.retail.v2alpha.SearchRequest.RelevanceThreshold[message.relevanceThreshold] : message.relevanceThreshold; if (message.variantRollupKeys && message.variantRollupKeys.length) { object.variantRollupKeys = []; for (var j = 0; j < message.variantRollupKeys.length; ++j) @@ -60757,7 +60927,7 @@ if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) object.canonicalFilter = message.canonicalFilter; if (message.searchMode != null && message.hasOwnProperty("searchMode")) - object.searchMode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] : message.searchMode; + object.searchMode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.cloud.retail.v2alpha.SearchRequest.SearchMode[message.searchMode] : message.searchMode; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); var keys2; @@ -61710,6 +61880,12 @@ return object; var message = new $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -61742,7 +61918,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; return object; }; @@ -62458,6 +62634,12 @@ return object; var message = new $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec(); switch (object.condition) { + default: + if (typeof object.condition === "number") { + message.condition = object.condition; + break; + } + break; case "CONDITION_UNSPECIFIED": case 0: message.condition = 0; @@ -62494,7 +62676,7 @@ object.pinUnexpandedResults = false; } if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + object.condition = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] === undefined ? message.condition : $root.google.cloud.retail.v2alpha.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) object.pinUnexpandedResults = message.pinUnexpandedResults; return object; @@ -62701,6 +62883,12 @@ return object; var message = new $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -62733,7 +62921,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; return object; }; @@ -62938,6 +63126,12 @@ return object; var message = new $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -62970,7 +63164,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2alpha.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; return object; }; @@ -68366,6 +68560,12 @@ if (object.displayName != null) message.displayName = String(object.displayName); switch (object.trainingState) { + default: + if (typeof object.trainingState === "number") { + message.trainingState = object.trainingState; + break; + } + break; case "TRAINING_STATE_UNSPECIFIED": case 0: message.trainingState = 0; @@ -68380,6 +68580,12 @@ break; } switch (object.servingState) { + default: + if (typeof object.servingState === "number") { + message.servingState = object.servingState; + break; + } + break; case "SERVING_STATE_UNSPECIFIED": case 0: message.servingState = 0; @@ -68412,6 +68618,12 @@ if (object.optimizationObjective != null) message.optimizationObjective = String(object.optimizationObjective); switch (object.periodicTuningState) { + default: + if (typeof object.periodicTuningState === "number") { + message.periodicTuningState = object.periodicTuningState; + break; + } + break; case "PERIODIC_TUNING_STATE_UNSPECIFIED": case 0: message.periodicTuningState = 0; @@ -68437,6 +68649,12 @@ if (object.tuningOperation != null) message.tuningOperation = String(object.tuningOperation); switch (object.dataState) { + default: + if (typeof object.dataState === "number") { + message.dataState = object.dataState; + break; + } + break; case "DATA_STATE_UNSPECIFIED": case 0: message.dataState = 0; @@ -68451,6 +68669,12 @@ break; } switch (object.filteringOption) { + default: + if (typeof object.filteringOption === "number") { + message.filteringOption = object.filteringOption; + break; + } + break; case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": case 0: message.filteringOption = 0; @@ -68512,9 +68736,9 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.trainingState != null && message.hasOwnProperty("trainingState")) - object.trainingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.TrainingState[message.trainingState] : message.trainingState; + object.trainingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.TrainingState[message.trainingState] === undefined ? message.trainingState : $root.google.cloud.retail.v2alpha.Model.TrainingState[message.trainingState] : message.trainingState; if (message.servingState != null && message.hasOwnProperty("servingState")) - object.servingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.ServingState[message.servingState] : message.servingState; + object.servingState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.ServingState[message.servingState] === undefined ? message.servingState : $root.google.cloud.retail.v2alpha.Model.ServingState[message.servingState] : message.servingState; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) @@ -68524,20 +68748,20 @@ if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) object.optimizationObjective = message.optimizationObjective; if (message.periodicTuningState != null && message.hasOwnProperty("periodicTuningState")) - object.periodicTuningState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PeriodicTuningState[message.periodicTuningState] : message.periodicTuningState; + object.periodicTuningState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PeriodicTuningState[message.periodicTuningState] === undefined ? message.periodicTuningState : $root.google.cloud.retail.v2alpha.Model.PeriodicTuningState[message.periodicTuningState] : message.periodicTuningState; if (message.lastTuneTime != null && message.hasOwnProperty("lastTuneTime")) object.lastTuneTime = $root.google.protobuf.Timestamp.toObject(message.lastTuneTime, options); if (message.tuningOperation != null && message.hasOwnProperty("tuningOperation")) object.tuningOperation = message.tuningOperation; if (message.dataState != null && message.hasOwnProperty("dataState")) - object.dataState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.DataState[message.dataState] : message.dataState; + object.dataState = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.DataState[message.dataState] === undefined ? message.dataState : $root.google.cloud.retail.v2alpha.Model.DataState[message.dataState] : message.dataState; if (message.pageOptimizationConfig != null && message.hasOwnProperty("pageOptimizationConfig")) { object.pageOptimizationConfig = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.toObject(message.pageOptimizationConfig, options); if (options.oneofs) object.trainingConfig = "pageOptimizationConfig"; } if (message.filteringOption != null && message.hasOwnProperty("filteringOption")) - object.filteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.filteringOption] : message.filteringOption; + object.filteringOption = options.enums === String ? $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.filteringOption] === undefined ? message.filteringOption : $root.google.cloud.retail.v2alpha.RecommendationsFilteringOption[message.filteringOption] : message.filteringOption; if (message.servingConfigLists && message.servingConfigLists.length) { object.servingConfigLists = []; for (var j = 0; j < message.servingConfigLists.length; ++j) @@ -68788,6 +69012,12 @@ } } switch (object.restriction) { + default: + if (typeof object.restriction === "number") { + message.restriction = object.restriction; + break; + } + break; case "RESTRICTION_UNSPECIFIED": case 0: message.restriction = 0; @@ -68839,7 +69069,7 @@ object.panels[j] = $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Panel.toObject(message.panels[j], options); } if (message.restriction != null && message.hasOwnProperty("restriction")) - object.restriction = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction[message.restriction] : message.restriction; + object.restriction = options.enums === String ? $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction[message.restriction] === undefined ? message.restriction : $root.google.cloud.retail.v2alpha.Model.PageOptimizationConfig.Restriction[message.restriction] : message.restriction; return object; }; @@ -80751,6 +80981,10 @@ for (var i = 0; i < object.solutionTypes.length; ++i) switch (object.solutionTypes[i]) { default: + if (typeof object.solutionTypes[i] === "number") { + message.solutionTypes[i] = object.solutionTypes[i]; + break; + } case "SOLUTION_TYPE_UNSPECIFIED": case 0: message.solutionTypes[i] = 0; @@ -80864,7 +81098,7 @@ if (message.solutionTypes && message.solutionTypes.length) { object.solutionTypes = []; for (var j = 0; j < message.solutionTypes.length; ++j) - object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2alpha.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } return object; }; @@ -83909,6 +84143,12 @@ if (object.parent != null) message.parent = String(object.parent); switch (object.userEventRejoinScope) { + default: + if (typeof object.userEventRejoinScope === "number") { + message.userEventRejoinScope = object.userEventRejoinScope; + break; + } + break; case "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED": case 0: message.userEventRejoinScope = 0; @@ -83945,7 +84185,7 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) - object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; + object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] === undefined ? message.userEventRejoinScope : $root.google.cloud.retail.v2alpha.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; return object; }; @@ -84941,6 +85181,12 @@ if (object.inUse != null) message.inUse = Boolean(object.inUse); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "UNKNOWN": case 0: message.type = 0; @@ -84955,6 +85201,12 @@ break; } switch (object.indexableOption) { + default: + if (typeof object.indexableOption === "number") { + message.indexableOption = object.indexableOption; + break; + } + break; case "INDEXABLE_OPTION_UNSPECIFIED": case 0: message.indexableOption = 0; @@ -84969,6 +85221,12 @@ break; } switch (object.dynamicFacetableOption) { + default: + if (typeof object.dynamicFacetableOption === "number") { + message.dynamicFacetableOption = object.dynamicFacetableOption; + break; + } + break; case "DYNAMIC_FACETABLE_OPTION_UNSPECIFIED": case 0: message.dynamicFacetableOption = 0; @@ -84983,6 +85241,12 @@ break; } switch (object.searchableOption) { + default: + if (typeof object.searchableOption === "number") { + message.searchableOption = object.searchableOption; + break; + } + break; case "SEARCHABLE_OPTION_UNSPECIFIED": case 0: message.searchableOption = 0; @@ -84997,6 +85261,12 @@ break; } switch (object.recommendationsFilteringOption) { + default: + if (typeof object.recommendationsFilteringOption === "number") { + message.recommendationsFilteringOption = object.recommendationsFilteringOption; + break; + } + break; case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": case 0: message.recommendationsFilteringOption = 0; @@ -85011,6 +85281,12 @@ break; } switch (object.exactSearchableOption) { + default: + if (typeof object.exactSearchableOption === "number") { + message.exactSearchableOption = object.exactSearchableOption; + break; + } + break; case "EXACT_SEARCHABLE_OPTION_UNSPECIFIED": case 0: message.exactSearchableOption = 0; @@ -85053,19 +85329,19 @@ if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; if (message.indexableOption != null && message.hasOwnProperty("indexableOption")) - object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; + object.indexableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption[message.indexableOption] === undefined ? message.indexableOption : $root.google.cloud.retail.v2beta.CatalogAttribute.IndexableOption[message.indexableOption] : message.indexableOption; if (message.dynamicFacetableOption != null && message.hasOwnProperty("dynamicFacetableOption")) - object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; + object.dynamicFacetableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] === undefined ? message.dynamicFacetableOption : $root.google.cloud.retail.v2beta.CatalogAttribute.DynamicFacetableOption[message.dynamicFacetableOption] : message.dynamicFacetableOption; if (message.searchableOption != null && message.hasOwnProperty("searchableOption")) - object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; + object.searchableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption[message.searchableOption] === undefined ? message.searchableOption : $root.google.cloud.retail.v2beta.CatalogAttribute.SearchableOption[message.searchableOption] : message.searchableOption; if (message.recommendationsFilteringOption != null && message.hasOwnProperty("recommendationsFilteringOption")) - object.recommendationsFilteringOption = options.enums === String ? $root.google.cloud.retail.v2beta.RecommendationsFilteringOption[message.recommendationsFilteringOption] : message.recommendationsFilteringOption; + object.recommendationsFilteringOption = options.enums === String ? $root.google.cloud.retail.v2beta.RecommendationsFilteringOption[message.recommendationsFilteringOption] === undefined ? message.recommendationsFilteringOption : $root.google.cloud.retail.v2beta.RecommendationsFilteringOption[message.recommendationsFilteringOption] : message.recommendationsFilteringOption; if (message.inUse != null && message.hasOwnProperty("inUse")) object.inUse = message.inUse; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.AttributeType[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.AttributeType[message.type] === undefined ? message.type : $root.google.cloud.retail.v2beta.CatalogAttribute.AttributeType[message.type] : message.type; if (message.exactSearchableOption != null && message.hasOwnProperty("exactSearchableOption")) - object.exactSearchableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] : message.exactSearchableOption; + object.exactSearchableOption = options.enums === String ? $root.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] === undefined ? message.exactSearchableOption : $root.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption[message.exactSearchableOption] : message.exactSearchableOption; return object; }; @@ -85412,6 +85688,12 @@ } } switch (object.attributeConfigLevel) { + default: + if (typeof object.attributeConfigLevel === "number") { + message.attributeConfigLevel = object.attributeConfigLevel; + break; + } + break; case "ATTRIBUTE_CONFIG_LEVEL_UNSPECIFIED": case 0: message.attributeConfigLevel = 0; @@ -85456,7 +85738,7 @@ object.catalogAttributes[keys2[j]] = $root.google.cloud.retail.v2beta.CatalogAttribute.toObject(message.catalogAttributes[keys2[j]], options); } if (message.attributeConfigLevel != null && message.hasOwnProperty("attributeConfigLevel")) - object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2beta.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; + object.attributeConfigLevel = options.enums === String ? $root.google.cloud.retail.v2beta.AttributeConfigLevel[message.attributeConfigLevel] === undefined ? message.attributeConfigLevel : $root.google.cloud.retail.v2beta.AttributeConfigLevel[message.attributeConfigLevel] : message.attributeConfigLevel; return object; }; @@ -94704,6 +94986,12 @@ message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } switch (object.reconciliationMode) { + default: + if (typeof object.reconciliationMode === "number") { + message.reconciliationMode = object.reconciliationMode; + break; + } + break; case "RECONCILIATION_MODE_UNSPECIFIED": case 0: message.reconciliationMode = 0; @@ -94753,7 +95041,7 @@ if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); if (message.reconciliationMode != null && message.hasOwnProperty("reconciliationMode")) - object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; + object.reconciliationMode = options.enums === String ? $root.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] === undefined ? message.reconciliationMode : $root.google.cloud.retail.v2beta.ImportProductsRequest.ReconciliationMode[message.reconciliationMode] : message.reconciliationMode; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; if (message.notificationPubsubTopic != null && message.hasOwnProperty("notificationPubsubTopic")) @@ -98473,6 +98761,12 @@ if (object.id != null) message.id = String(object.id); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -98554,6 +98848,12 @@ message.availableTime = $root.google.protobuf.Timestamp.fromObject(object.availableTime); } switch (object.availability) { + default: + if (typeof object.availability === "number") { + message.availability = object.availability; + break; + } + break; case "AVAILABILITY_UNSPECIFIED": case 0: message.availability = 0; @@ -98738,7 +99038,7 @@ if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Type[message.type] === undefined ? message.type : $root.google.cloud.retail.v2beta.Product.Type[message.type] : message.type; if (message.primaryProductId != null && message.hasOwnProperty("primaryProductId")) object.primaryProductId = message.primaryProductId; if (message.collectionMemberIds && message.collectionMemberIds.length) { @@ -98792,7 +99092,7 @@ if (message.availableTime != null && message.hasOwnProperty("availableTime")) object.availableTime = $root.google.protobuf.Timestamp.toObject(message.availableTime, options); if (message.availability != null && message.hasOwnProperty("availability")) - object.availability = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Availability[message.availability] : message.availability; + object.availability = options.enums === String ? $root.google.cloud.retail.v2beta.Product.Availability[message.availability] === undefined ? message.availability : $root.google.cloud.retail.v2beta.Product.Availability[message.availability] : message.availability; if (message.availableQuantity != null && message.hasOwnProperty("availableQuantity")) object.availableQuantity = $root.google.protobuf.Int32Value.toObject(message.availableQuantity, options); if (message.fulfillmentInfo && message.fulfillmentInfo.length) { @@ -106252,6 +106552,10 @@ for (var i = 0; i < object.solutionTypes.length; ++i) switch (object.solutionTypes[i]) { default: + if (typeof object.solutionTypes[i] === "number") { + message.solutionTypes[i] = object.solutionTypes[i]; + break; + } case "SOLUTION_TYPE_UNSPECIFIED": case 0: message.solutionTypes[i] = 0; @@ -106273,6 +106577,10 @@ for (var i = 0; i < object.searchSolutionUseCase.length; ++i) switch (object.searchSolutionUseCase[i]) { default: + if (typeof object.searchSolutionUseCase[i] === "number") { + message.searchSolutionUseCase[i] = object.searchSolutionUseCase[i]; + break; + } case "SEARCH_SOLUTION_USE_CASE_UNSPECIFIED": case 0: message.searchSolutionUseCase[i] = 0; @@ -106334,12 +106642,12 @@ if (message.solutionTypes && message.solutionTypes.length) { object.solutionTypes = []; for (var j = 0; j < message.solutionTypes.length; ++j) - object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } if (message.searchSolutionUseCase && message.searchSolutionUseCase.length) { object.searchSolutionUseCase = []; for (var j = 0; j < message.searchSolutionUseCase.length; ++j) - object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; + object.searchSolutionUseCase[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SearchSolutionUseCase[message.searchSolutionUseCase[j]] === undefined ? message.searchSolutionUseCase[j] : $root.google.cloud.retail.v2beta.SearchSolutionUseCase[message.searchSolutionUseCase[j]] : message.searchSolutionUseCase[j]; } return object; }; @@ -107103,6 +107411,12 @@ message.pageCategories[i] = String(object.pageCategories[i]); } switch (object.searchMode) { + default: + if (typeof object.searchMode === "number") { + message.searchMode = object.searchMode; + break; + } + break; case "SEARCH_MODE_UNSPECIFIED": case 0: message.searchMode = 0; @@ -107218,7 +107532,7 @@ if (message.canonicalFilter != null && message.hasOwnProperty("canonicalFilter")) object.canonicalFilter = message.canonicalFilter; if (message.searchMode != null && message.hasOwnProperty("searchMode")) - object.searchMode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.SearchMode[message.searchMode] : message.searchMode; + object.searchMode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.SearchMode[message.searchMode] === undefined ? message.searchMode : $root.google.cloud.retail.v2beta.SearchRequest.SearchMode[message.searchMode] : message.searchMode; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); var keys2; @@ -108171,6 +108485,12 @@ return object; var message = new $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -108203,7 +108523,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2beta.SearchRequest.DynamicFacetSpec.Mode[message.mode] : message.mode; return object; }; @@ -108919,6 +109239,12 @@ return object; var message = new $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec(); switch (object.condition) { + default: + if (typeof object.condition === "number") { + message.condition = object.condition; + break; + } + break; case "CONDITION_UNSPECIFIED": case 0: message.condition = 0; @@ -108955,7 +109281,7 @@ object.pinUnexpandedResults = false; } if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; + object.condition = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition[message.condition] === undefined ? message.condition : $root.google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition[message.condition] : message.condition; if (message.pinUnexpandedResults != null && message.hasOwnProperty("pinUnexpandedResults")) object.pinUnexpandedResults = message.pinUnexpandedResults; return object; @@ -109162,6 +109488,12 @@ return object; var message = new $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -109194,7 +109526,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode[message.mode] : message.mode; return object; }; @@ -109399,6 +109731,12 @@ return object; var message = new $root.google.cloud.retail.v2beta.SearchRequest.SpellCorrectionSpec(); switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; case "MODE_UNSPECIFIED": case 0: message.mode = 0; @@ -109431,7 +109769,7 @@ if (options.defaults) object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.cloud.retail.v2beta.SearchRequest.SpellCorrectionSpec.Mode[message.mode] === undefined ? message.mode : $root.google.cloud.retail.v2beta.SearchRequest.SpellCorrectionSpec.Mode[message.mode] : message.mode; return object; }; @@ -114804,6 +115142,12 @@ if (object.displayName != null) message.displayName = String(object.displayName); switch (object.trainingState) { + default: + if (typeof object.trainingState === "number") { + message.trainingState = object.trainingState; + break; + } + break; case "TRAINING_STATE_UNSPECIFIED": case 0: message.trainingState = 0; @@ -114818,6 +115162,12 @@ break; } switch (object.servingState) { + default: + if (typeof object.servingState === "number") { + message.servingState = object.servingState; + break; + } + break; case "SERVING_STATE_UNSPECIFIED": case 0: message.servingState = 0; @@ -114850,6 +115200,12 @@ if (object.optimizationObjective != null) message.optimizationObjective = String(object.optimizationObjective); switch (object.periodicTuningState) { + default: + if (typeof object.periodicTuningState === "number") { + message.periodicTuningState = object.periodicTuningState; + break; + } + break; case "PERIODIC_TUNING_STATE_UNSPECIFIED": case 0: message.periodicTuningState = 0; @@ -114875,6 +115231,12 @@ if (object.tuningOperation != null) message.tuningOperation = String(object.tuningOperation); switch (object.dataState) { + default: + if (typeof object.dataState === "number") { + message.dataState = object.dataState; + break; + } + break; case "DATA_STATE_UNSPECIFIED": case 0: message.dataState = 0; @@ -114889,6 +115251,12 @@ break; } switch (object.filteringOption) { + default: + if (typeof object.filteringOption === "number") { + message.filteringOption = object.filteringOption; + break; + } + break; case "RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED": case 0: message.filteringOption = 0; @@ -114950,9 +115318,9 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; if (message.trainingState != null && message.hasOwnProperty("trainingState")) - object.trainingState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.TrainingState[message.trainingState] : message.trainingState; + object.trainingState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.TrainingState[message.trainingState] === undefined ? message.trainingState : $root.google.cloud.retail.v2beta.Model.TrainingState[message.trainingState] : message.trainingState; if (message.servingState != null && message.hasOwnProperty("servingState")) - object.servingState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.ServingState[message.servingState] : message.servingState; + object.servingState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.ServingState[message.servingState] === undefined ? message.servingState : $root.google.cloud.retail.v2beta.Model.ServingState[message.servingState] : message.servingState; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) @@ -114962,15 +115330,15 @@ if (message.optimizationObjective != null && message.hasOwnProperty("optimizationObjective")) object.optimizationObjective = message.optimizationObjective; if (message.periodicTuningState != null && message.hasOwnProperty("periodicTuningState")) - object.periodicTuningState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.PeriodicTuningState[message.periodicTuningState] : message.periodicTuningState; + object.periodicTuningState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.PeriodicTuningState[message.periodicTuningState] === undefined ? message.periodicTuningState : $root.google.cloud.retail.v2beta.Model.PeriodicTuningState[message.periodicTuningState] : message.periodicTuningState; if (message.lastTuneTime != null && message.hasOwnProperty("lastTuneTime")) object.lastTuneTime = $root.google.protobuf.Timestamp.toObject(message.lastTuneTime, options); if (message.tuningOperation != null && message.hasOwnProperty("tuningOperation")) object.tuningOperation = message.tuningOperation; if (message.dataState != null && message.hasOwnProperty("dataState")) - object.dataState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.DataState[message.dataState] : message.dataState; + object.dataState = options.enums === String ? $root.google.cloud.retail.v2beta.Model.DataState[message.dataState] === undefined ? message.dataState : $root.google.cloud.retail.v2beta.Model.DataState[message.dataState] : message.dataState; if (message.filteringOption != null && message.hasOwnProperty("filteringOption")) - object.filteringOption = options.enums === String ? $root.google.cloud.retail.v2beta.RecommendationsFilteringOption[message.filteringOption] : message.filteringOption; + object.filteringOption = options.enums === String ? $root.google.cloud.retail.v2beta.RecommendationsFilteringOption[message.filteringOption] === undefined ? message.filteringOption : $root.google.cloud.retail.v2beta.RecommendationsFilteringOption[message.filteringOption] : message.filteringOption; if (message.servingConfigLists && message.servingConfigLists.length) { object.servingConfigLists = []; for (var j = 0; j < message.servingConfigLists.length; ++j) @@ -125504,6 +125872,12 @@ if (object.diversityLevel != null) message.diversityLevel = String(object.diversityLevel); switch (object.diversityType) { + default: + if (typeof object.diversityType === "number") { + message.diversityType = object.diversityType; + break; + } + break; case "DIVERSITY_TYPE_UNSPECIFIED": case 0: message.diversityType = 0; @@ -125531,6 +125905,10 @@ for (var i = 0; i < object.solutionTypes.length; ++i) switch (object.solutionTypes[i]) { default: + if (typeof object.solutionTypes[i] === "number") { + message.solutionTypes[i] = object.solutionTypes[i]; + break; + } case "SOLUTION_TYPE_UNSPECIFIED": case 0: message.solutionTypes[i] = 0; @@ -125646,10 +126024,10 @@ if (message.solutionTypes && message.solutionTypes.length) { object.solutionTypes = []; for (var j = 0; j < message.solutionTypes.length; ++j) - object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; + object.solutionTypes[j] = options.enums === String ? $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] === undefined ? message.solutionTypes[j] : $root.google.cloud.retail.v2beta.SolutionType[message.solutionTypes[j]] : message.solutionTypes[j]; } if (message.diversityType != null && message.hasOwnProperty("diversityType")) - object.diversityType = options.enums === String ? $root.google.cloud.retail.v2beta.ServingConfig.DiversityType[message.diversityType] : message.diversityType; + object.diversityType = options.enums === String ? $root.google.cloud.retail.v2beta.ServingConfig.DiversityType[message.diversityType] === undefined ? message.diversityType : $root.google.cloud.retail.v2beta.ServingConfig.DiversityType[message.diversityType] : message.diversityType; if (message.personalizationSpec != null && message.hasOwnProperty("personalizationSpec")) object.personalizationSpec = $root.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.toObject(message.personalizationSpec, options); return object; @@ -128711,6 +129089,12 @@ if (object.parent != null) message.parent = String(object.parent); switch (object.userEventRejoinScope) { + default: + if (typeof object.userEventRejoinScope === "number") { + message.userEventRejoinScope = object.userEventRejoinScope; + break; + } + break; case "USER_EVENT_REJOIN_SCOPE_UNSPECIFIED": case 0: message.userEventRejoinScope = 0; @@ -128747,7 +129131,7 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.userEventRejoinScope != null && message.hasOwnProperty("userEventRejoinScope")) - object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; + object.userEventRejoinScope = options.enums === String ? $root.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] === undefined ? message.userEventRejoinScope : $root.google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope[message.userEventRejoinScope] : message.userEventRejoinScope; return object; }; @@ -129536,6 +129920,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; @@ -129560,6 +129950,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; @@ -129607,7 +130001,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")) @@ -129615,7 +130009,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; }; @@ -133670,6 +134064,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; @@ -133684,6 +134084,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; @@ -133810,9 +134216,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")) @@ -136159,6 +136565,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; @@ -136267,7 +136679,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")) @@ -137069,6 +137481,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; @@ -137085,6 +137503,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; @@ -137123,6 +137547,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; @@ -137193,7 +137621,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")) @@ -137201,7 +137629,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")) @@ -137214,7 +137642,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); @@ -138591,6 +139019,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; @@ -138660,7 +139094,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) @@ -140415,6 +140849,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; @@ -140464,7 +140904,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; }; @@ -144024,6 +144464,12 @@ return object; var message = new $root.google.protobuf.Value(); switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; case "NULL_VALUE": case 0: message.nullValue = 0; @@ -144062,7 +144508,7 @@ options = {}; var object = {}; if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; if (options.oneofs) object.kind = "nullValue"; }