diff --git a/packages/google-cloud-kms/protos/protos.d.ts b/packages/google-cloud-kms/protos/protos.d.ts index 45ff1556729..6b1a2b361e7 100644 --- a/packages/google-cloud-kms/protos/protos.d.ts +++ b/packages/google-cloud-kms/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-kms/protos/protos.js b/packages/google-cloud-kms/protos/protos.js index 9d28d98254e..0bf83f9066c 100644 --- a/packages/google-cloud-kms/protos/protos.js +++ b/packages/google-cloud-kms/protos/protos.js @@ -3148,6 +3148,12 @@ message.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.fromObject(object.primary); } switch (object.purpose) { + default: + if (typeof object.purpose === "number") { + message.purpose = object.purpose; + break; + } + break; case "CRYPTO_KEY_PURPOSE_UNSPECIFIED": case 0: message.purpose = 0; @@ -3239,7 +3245,7 @@ if (message.primary != null && message.hasOwnProperty("primary")) object.primary = $root.google.cloud.kms.v1.CryptoKeyVersion.toObject(message.primary, options); if (message.purpose != null && message.hasOwnProperty("purpose")) - object.purpose = options.enums === String ? $root.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose[message.purpose] : message.purpose; + object.purpose = options.enums === String ? $root.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose[message.purpose] === undefined ? message.purpose : $root.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose[message.purpose] : message.purpose; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.nextRotationTime != null && message.hasOwnProperty("nextRotationTime")) @@ -3519,6 +3525,12 @@ return object; var message = new $root.google.cloud.kms.v1.CryptoKeyVersionTemplate(); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -3541,6 +3553,12 @@ break; } switch (object.algorithm) { + default: + if (typeof object.algorithm === "number") { + message.algorithm = object.algorithm; + break; + } + break; case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": case 0: message.algorithm = 0; @@ -3663,9 +3681,9 @@ object.algorithm = options.enums === String ? "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED" : 0; } if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; return object; }; @@ -3892,6 +3910,12 @@ return object; var message = new $root.google.cloud.kms.v1.KeyOperationAttestation(); switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; case "ATTESTATION_FORMAT_UNSPECIFIED": case 0: message.format = 0; @@ -3943,7 +3967,7 @@ object.certChains = null; } if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat[message.format] : message.format; + object.format = options.enums === String ? $root.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat[message.format] === undefined ? message.format : $root.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat[message.format] : message.format; if (message.content != null && message.hasOwnProperty("content")) object.content = options.bytes === String ? $util.base64.encode(message.content, 0, message.content.length) : options.bytes === Array ? Array.prototype.slice.call(message.content) : message.content; if (message.certChains != null && message.hasOwnProperty("certChains")) @@ -4741,6 +4765,12 @@ if (object.name != null) message.name = String(object.name); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED": case 0: message.state = 0; @@ -4775,6 +4805,12 @@ break; } switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -4797,6 +4833,12 @@ break; } switch (object.algorithm) { + default: + if (typeof object.algorithm === "number") { + message.algorithm = object.algorithm; + break; + } + break; case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": case 0: message.algorithm = 0; @@ -4974,7 +5016,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState[message.state] === undefined ? message.state : $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState[message.state] : message.state; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.destroyTime != null && message.hasOwnProperty("destroyTime")) @@ -4982,11 +5024,11 @@ if (message.destroyEventTime != null && message.hasOwnProperty("destroyEventTime")) object.destroyEventTime = $root.google.protobuf.Timestamp.toObject(message.destroyEventTime, options); if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; if (message.attestation != null && message.hasOwnProperty("attestation")) object.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.toObject(message.attestation, options); if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; if (message.generateTime != null && message.hasOwnProperty("generateTime")) object.generateTime = $root.google.protobuf.Timestamp.toObject(message.generateTime, options); if (message.importJob != null && message.hasOwnProperty("importJob")) @@ -5393,6 +5435,12 @@ if (object.pem != null) message.pem = String(object.pem); switch (object.algorithm) { + default: + if (typeof object.algorithm === "number") { + message.algorithm = object.algorithm; + break; + } + break; case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": case 0: message.algorithm = 0; @@ -5502,6 +5550,12 @@ if (object.name != null) message.name = String(object.name); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -5549,13 +5603,13 @@ if (message.pem != null && message.hasOwnProperty("pem")) object.pem = message.pem; if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; if (message.pemCrc32c != null && message.hasOwnProperty("pemCrc32c")) object.pemCrc32c = $root.google.protobuf.Int64Value.toObject(message.pemCrc32c, options); if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -5935,6 +5989,12 @@ if (object.name != null) message.name = String(object.name); switch (object.importMethod) { + default: + if (typeof object.importMethod === "number") { + message.importMethod = object.importMethod; + break; + } + break; case "IMPORT_METHOD_UNSPECIFIED": case 0: message.importMethod = 0; @@ -5949,6 +6009,12 @@ break; } switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -5991,6 +6057,12 @@ message.expireEventTime = $root.google.protobuf.Timestamp.fromObject(object.expireEventTime); } switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "IMPORT_JOB_STATE_UNSPECIFIED": case 0: message.state = 0; @@ -6049,7 +6121,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.importMethod != null && message.hasOwnProperty("importMethod")) - object.importMethod = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportMethod[message.importMethod] : message.importMethod; + object.importMethod = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportMethod[message.importMethod] === undefined ? message.importMethod : $root.google.cloud.kms.v1.ImportJob.ImportMethod[message.importMethod] : message.importMethod; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.generateTime != null && message.hasOwnProperty("generateTime")) @@ -6057,13 +6129,13 @@ if (message.expireTime != null && message.hasOwnProperty("expireTime")) object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportJobState[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.kms.v1.ImportJob.ImportJobState[message.state] === undefined ? message.state : $root.google.cloud.kms.v1.ImportJob.ImportJobState[message.state] : message.state; if (message.publicKey != null && message.hasOwnProperty("publicKey")) object.publicKey = $root.google.cloud.kms.v1.ImportJob.WrappingPublicKey.toObject(message.publicKey, options); if (message.attestation != null && message.hasOwnProperty("attestation")) object.attestation = $root.google.cloud.kms.v1.KeyOperationAttestation.toObject(message.attestation, options); if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; if (message.expireEventTime != null && message.hasOwnProperty("expireEventTime")) object.expireEventTime = $root.google.protobuf.Timestamp.toObject(message.expireEventTime, options); return object; @@ -8022,6 +8094,12 @@ if (object.pageToken != null) message.pageToken = String(object.pageToken); switch (object.versionView) { + default: + if (typeof object.versionView === "number") { + message.versionView = object.versionView; + break; + } + break; case "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": case 0: message.versionView = 0; @@ -8066,7 +8144,7 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.versionView != null && message.hasOwnProperty("versionView")) - object.versionView = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.versionView] : message.versionView; + object.versionView = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.versionView] === undefined ? message.versionView : $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.versionView] : message.versionView; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.orderBy != null && message.hasOwnProperty("orderBy")) @@ -8354,6 +8432,12 @@ if (object.pageToken != null) message.pageToken = String(object.pageToken); switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; case "CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED": case 0: message.view = 0; @@ -8398,7 +8482,7 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.view] === undefined ? message.view : $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView[message.view] : message.view; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.orderBy != null && message.hasOwnProperty("orderBy")) @@ -11870,6 +11954,12 @@ if (object.cryptoKeyVersion != null) message.cryptoKeyVersion = String(object.cryptoKeyVersion); switch (object.algorithm) { + default: + if (typeof object.algorithm === "number") { + message.algorithm = object.algorithm; + break; + } + break; case "CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED": case 0: message.algorithm = 0; @@ -12003,7 +12093,7 @@ if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; if (message.algorithm != null && message.hasOwnProperty("algorithm")) - object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; + object.algorithm = options.enums === String ? $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] === undefined ? message.algorithm : $root.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm[message.algorithm] : message.algorithm; if (message.importJob != null && message.hasOwnProperty("importJob")) object.importJob = message.importJob; if (message.rsaAesWrappedKey != null && message.hasOwnProperty("rsaAesWrappedKey")) { @@ -15425,6 +15515,12 @@ if (object.lengthBytes != null) message.lengthBytes = object.lengthBytes | 0; switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -15472,7 +15568,7 @@ if (message.lengthBytes != null && message.hasOwnProperty("lengthBytes")) object.lengthBytes = message.lengthBytes; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -15771,6 +15867,12 @@ if (object.verifiedAdditionalAuthenticatedDataCrc32c != null) message.verifiedAdditionalAuthenticatedDataCrc32c = Boolean(object.verifiedAdditionalAuthenticatedDataCrc32c); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -15833,7 +15935,7 @@ if (message.verifiedAdditionalAuthenticatedDataCrc32c != null && message.hasOwnProperty("verifiedAdditionalAuthenticatedDataCrc32c")) object.verifiedAdditionalAuthenticatedDataCrc32c = message.verifiedAdditionalAuthenticatedDataCrc32c; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -16092,6 +16194,12 @@ if (object.usedPrimary != null) message.usedPrimary = Boolean(object.usedPrimary); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -16148,7 +16256,7 @@ if (message.usedPrimary != null && message.hasOwnProperty("usedPrimary")) object.usedPrimary = message.usedPrimary; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -16447,6 +16555,12 @@ if (object.verifiedDataCrc32c != null) message.verifiedDataCrc32c = Boolean(object.verifiedDataCrc32c); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -16509,7 +16623,7 @@ if (message.verifiedDataCrc32c != null && message.hasOwnProperty("verifiedDataCrc32c")) object.verifiedDataCrc32c = message.verifiedDataCrc32c; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -16768,6 +16882,12 @@ if (object.verifiedCiphertextCrc32c != null) message.verifiedCiphertextCrc32c = Boolean(object.verifiedCiphertextCrc32c); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -16824,7 +16944,7 @@ if (message.verifiedCiphertextCrc32c != null && message.hasOwnProperty("verifiedCiphertextCrc32c")) object.verifiedCiphertextCrc32c = message.verifiedCiphertextCrc32c; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -17103,6 +17223,12 @@ if (object.verifiedDataCrc32c != null) message.verifiedDataCrc32c = Boolean(object.verifiedDataCrc32c); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -17162,7 +17288,7 @@ if (message.verifiedDataCrc32c != null && message.hasOwnProperty("verifiedDataCrc32c")) object.verifiedDataCrc32c = message.verifiedDataCrc32c; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -17453,6 +17579,12 @@ if (object.verifiedSuccessIntegrity != null) message.verifiedSuccessIntegrity = Boolean(object.verifiedSuccessIntegrity); switch (object.protectionLevel) { + default: + if (typeof object.protectionLevel === "number") { + message.protectionLevel = object.protectionLevel; + break; + } + break; case "PROTECTION_LEVEL_UNSPECIFIED": case 0: message.protectionLevel = 0; @@ -17509,7 +17641,7 @@ if (message.verifiedSuccessIntegrity != null && message.hasOwnProperty("verifiedSuccessIntegrity")) object.verifiedSuccessIntegrity = message.verifiedSuccessIntegrity; if (message.protectionLevel != null && message.hasOwnProperty("protectionLevel")) - object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; + object.protectionLevel = options.enums === String ? $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] === undefined ? message.protectionLevel : $root.google.cloud.kms.v1.ProtectionLevel[message.protectionLevel] : message.protectionLevel; return object; }; @@ -19609,6 +19741,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; @@ -19633,6 +19771,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; @@ -19680,7 +19822,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")) @@ -19688,7 +19830,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; }; @@ -22499,6 +22641,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; @@ -22513,6 +22661,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; @@ -22639,9 +22793,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")) @@ -24988,6 +25142,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; @@ -25096,7 +25256,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")) @@ -25898,6 +26058,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; @@ -25914,6 +26080,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; @@ -25952,6 +26124,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; @@ -26022,7 +26198,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")) @@ -26030,7 +26206,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")) @@ -26043,7 +26219,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); @@ -27400,6 +27576,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; @@ -27463,7 +27645,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) @@ -29216,6 +29398,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; @@ -29265,7 +29453,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; };