"use strict"; // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.7.0 // protoc v6.30.2 // source: google/protobuf/descriptor.proto Object.defineProperty(exports, "__esModule", { value: true }); exports.GeneratedCodeInfo = exports.SourceCodeInfo_Location = exports.SourceCodeInfo = exports.FeatureSetDefaults_FeatureSetEditionDefault = exports.FeatureSetDefaults = exports.FeatureSet = exports.UninterpretedOption_NamePart = exports.UninterpretedOption = exports.MethodOptions = exports.ServiceOptions = exports.EnumValueOptions = exports.EnumOptions = exports.OneofOptions = exports.FieldOptions_FeatureSupport = exports.FieldOptions_EditionDefault = exports.FieldOptions = exports.MessageOptions = exports.FileOptions = exports.MethodDescriptorProto = exports.ServiceDescriptorProto = exports.EnumValueDescriptorProto = exports.EnumDescriptorProto_EnumReservedRange = exports.EnumDescriptorProto = exports.OneofDescriptorProto = exports.FieldDescriptorProto = exports.ExtensionRangeOptions_Declaration = exports.ExtensionRangeOptions = exports.DescriptorProto_ReservedRange = exports.DescriptorProto_ExtensionRange = exports.DescriptorProto = exports.FileDescriptorProto = exports.FileDescriptorSet = exports.GeneratedCodeInfo_Annotation_Semantic = exports.FeatureSet_EnforceNamingStyle = exports.FeatureSet_JsonFormat = exports.FeatureSet_MessageEncoding = exports.FeatureSet_Utf8Validation = exports.FeatureSet_RepeatedFieldEncoding = exports.FeatureSet_EnumType = exports.FeatureSet_FieldPresence = exports.MethodOptions_IdempotencyLevel = exports.FieldOptions_OptionTargetType = exports.FieldOptions_OptionRetention = exports.FieldOptions_JSType = exports.FieldOptions_CType = exports.FileOptions_OptimizeMode = exports.FieldDescriptorProto_Label = exports.FieldDescriptorProto_Type = exports.ExtensionRangeOptions_VerificationState = exports.Edition = void 0; exports.GeneratedCodeInfo_Annotation = void 0; exports.editionFromJSON = editionFromJSON; exports.editionToJSON = editionToJSON; exports.extensionRangeOptions_VerificationStateFromJSON = extensionRangeOptions_VerificationStateFromJSON; exports.extensionRangeOptions_VerificationStateToJSON = extensionRangeOptions_VerificationStateToJSON; exports.fieldDescriptorProto_TypeFromJSON = fieldDescriptorProto_TypeFromJSON; exports.fieldDescriptorProto_TypeToJSON = fieldDescriptorProto_TypeToJSON; exports.fieldDescriptorProto_LabelFromJSON = fieldDescriptorProto_LabelFromJSON; exports.fieldDescriptorProto_LabelToJSON = fieldDescriptorProto_LabelToJSON; exports.fileOptions_OptimizeModeFromJSON = fileOptions_OptimizeModeFromJSON; exports.fileOptions_OptimizeModeToJSON = fileOptions_OptimizeModeToJSON; exports.fieldOptions_CTypeFromJSON = fieldOptions_CTypeFromJSON; exports.fieldOptions_CTypeToJSON = fieldOptions_CTypeToJSON; exports.fieldOptions_JSTypeFromJSON = fieldOptions_JSTypeFromJSON; exports.fieldOptions_JSTypeToJSON = fieldOptions_JSTypeToJSON; exports.fieldOptions_OptionRetentionFromJSON = fieldOptions_OptionRetentionFromJSON; exports.fieldOptions_OptionRetentionToJSON = fieldOptions_OptionRetentionToJSON; exports.fieldOptions_OptionTargetTypeFromJSON = fieldOptions_OptionTargetTypeFromJSON; exports.fieldOptions_OptionTargetTypeToJSON = fieldOptions_OptionTargetTypeToJSON; exports.methodOptions_IdempotencyLevelFromJSON = methodOptions_IdempotencyLevelFromJSON; exports.methodOptions_IdempotencyLevelToJSON = methodOptions_IdempotencyLevelToJSON; exports.featureSet_FieldPresenceFromJSON = featureSet_FieldPresenceFromJSON; exports.featureSet_FieldPresenceToJSON = featureSet_FieldPresenceToJSON; exports.featureSet_EnumTypeFromJSON = featureSet_EnumTypeFromJSON; exports.featureSet_EnumTypeToJSON = featureSet_EnumTypeToJSON; exports.featureSet_RepeatedFieldEncodingFromJSON = featureSet_RepeatedFieldEncodingFromJSON; exports.featureSet_RepeatedFieldEncodingToJSON = featureSet_RepeatedFieldEncodingToJSON; exports.featureSet_Utf8ValidationFromJSON = featureSet_Utf8ValidationFromJSON; exports.featureSet_Utf8ValidationToJSON = featureSet_Utf8ValidationToJSON; exports.featureSet_MessageEncodingFromJSON = featureSet_MessageEncodingFromJSON; exports.featureSet_MessageEncodingToJSON = featureSet_MessageEncodingToJSON; exports.featureSet_JsonFormatFromJSON = featureSet_JsonFormatFromJSON; exports.featureSet_JsonFormatToJSON = featureSet_JsonFormatToJSON; exports.featureSet_EnforceNamingStyleFromJSON = featureSet_EnforceNamingStyleFromJSON; exports.featureSet_EnforceNamingStyleToJSON = featureSet_EnforceNamingStyleToJSON; exports.generatedCodeInfo_Annotation_SemanticFromJSON = generatedCodeInfo_Annotation_SemanticFromJSON; exports.generatedCodeInfo_Annotation_SemanticToJSON = generatedCodeInfo_Annotation_SemanticToJSON; /* eslint-disable */ /** The full set of known editions. */ var Edition; (function (Edition) { /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ Edition[Edition["EDITION_UNKNOWN"] = 0] = "EDITION_UNKNOWN"; /** * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature * was first introduced. This is effectively an "infinite past". */ Edition[Edition["EDITION_LEGACY"] = 900] = "EDITION_LEGACY"; /** * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like * distinct editions. These can't be used to specify the edition of proto * files, but feature definitions must supply proto2/proto3 defaults for * backwards compatibility. */ Edition[Edition["EDITION_PROTO2"] = 998] = "EDITION_PROTO2"; Edition[Edition["EDITION_PROTO3"] = 999] = "EDITION_PROTO3"; /** * EDITION_2023 - Editions that have been released. The specific values are arbitrary and * should not be depended on, but they will always be time-ordered for easy * comparison. */ Edition[Edition["EDITION_2023"] = 1000] = "EDITION_2023"; Edition[Edition["EDITION_2024"] = 1001] = "EDITION_2024"; /** * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be * used or relied on outside of tests. */ Edition[Edition["EDITION_1_TEST_ONLY"] = 1] = "EDITION_1_TEST_ONLY"; Edition[Edition["EDITION_2_TEST_ONLY"] = 2] = "EDITION_2_TEST_ONLY"; Edition[Edition["EDITION_99997_TEST_ONLY"] = 99997] = "EDITION_99997_TEST_ONLY"; Edition[Edition["EDITION_99998_TEST_ONLY"] = 99998] = "EDITION_99998_TEST_ONLY"; Edition[Edition["EDITION_99999_TEST_ONLY"] = 99999] = "EDITION_99999_TEST_ONLY"; /** * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only * ever be used by plugins that can expect to never require any changes to * support a new edition. */ Edition[Edition["EDITION_MAX"] = 2147483647] = "EDITION_MAX"; })(Edition || (exports.Edition = Edition = {})); function editionFromJSON(object) { switch (object) { case 0: case "EDITION_UNKNOWN": return Edition.EDITION_UNKNOWN; case 900: case "EDITION_LEGACY": return Edition.EDITION_LEGACY; case 998: case "EDITION_PROTO2": return Edition.EDITION_PROTO2; case 999: case "EDITION_PROTO3": return Edition.EDITION_PROTO3; case 1000: case "EDITION_2023": return Edition.EDITION_2023; case 1001: case "EDITION_2024": return Edition.EDITION_2024; case 1: case "EDITION_1_TEST_ONLY": return Edition.EDITION_1_TEST_ONLY; case 2: case "EDITION_2_TEST_ONLY": return Edition.EDITION_2_TEST_ONLY; case 99997: case "EDITION_99997_TEST_ONLY": return Edition.EDITION_99997_TEST_ONLY; case 99998: case "EDITION_99998_TEST_ONLY": return Edition.EDITION_99998_TEST_ONLY; case 99999: case "EDITION_99999_TEST_ONLY": return Edition.EDITION_99999_TEST_ONLY; case 2147483647: case "EDITION_MAX": return Edition.EDITION_MAX; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Edition"); } } function editionToJSON(object) { switch (object) { case Edition.EDITION_UNKNOWN: return "EDITION_UNKNOWN"; case Edition.EDITION_LEGACY: return "EDITION_LEGACY"; case Edition.EDITION_PROTO2: return "EDITION_PROTO2"; case Edition.EDITION_PROTO3: return "EDITION_PROTO3"; case Edition.EDITION_2023: return "EDITION_2023"; case Edition.EDITION_2024: return "EDITION_2024"; case Edition.EDITION_1_TEST_ONLY: return "EDITION_1_TEST_ONLY"; case Edition.EDITION_2_TEST_ONLY: return "EDITION_2_TEST_ONLY"; case Edition.EDITION_99997_TEST_ONLY: return "EDITION_99997_TEST_ONLY"; case Edition.EDITION_99998_TEST_ONLY: return "EDITION_99998_TEST_ONLY"; case Edition.EDITION_99999_TEST_ONLY: return "EDITION_99999_TEST_ONLY"; case Edition.EDITION_MAX: return "EDITION_MAX"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum Edition"); } } /** The verification state of the extension range. */ var ExtensionRangeOptions_VerificationState; (function (ExtensionRangeOptions_VerificationState) { /** DECLARATION - All the extensions of the range must be declared. */ ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["DECLARATION"] = 0] = "DECLARATION"; ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["UNVERIFIED"] = 1] = "UNVERIFIED"; })(ExtensionRangeOptions_VerificationState || (exports.ExtensionRangeOptions_VerificationState = ExtensionRangeOptions_VerificationState = {})); function extensionRangeOptions_VerificationStateFromJSON(object) { switch (object) { case 0: case "DECLARATION": return ExtensionRangeOptions_VerificationState.DECLARATION; case 1: case "UNVERIFIED": return ExtensionRangeOptions_VerificationState.UNVERIFIED; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum ExtensionRangeOptions_VerificationState"); } } function extensionRangeOptions_VerificationStateToJSON(object) { switch (object) { case ExtensionRangeOptions_VerificationState.DECLARATION: return "DECLARATION"; case ExtensionRangeOptions_VerificationState.UNVERIFIED: return "UNVERIFIED"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum ExtensionRangeOptions_VerificationState"); } } var FieldDescriptorProto_Type; (function (FieldDescriptorProto_Type) { /** * TYPE_DOUBLE - 0 is reserved for errors. * Order is weird for historical reasons. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_DOUBLE"] = 1] = "TYPE_DOUBLE"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_FLOAT"] = 2] = "TYPE_FLOAT"; /** * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if * negative values are likely. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_INT64"] = 3] = "TYPE_INT64"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_UINT64"] = 4] = "TYPE_UINT64"; /** * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if * negative values are likely. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_INT32"] = 5] = "TYPE_INT32"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_FIXED64"] = 6] = "TYPE_FIXED64"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_FIXED32"] = 7] = "TYPE_FIXED32"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_BOOL"] = 8] = "TYPE_BOOL"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_STRING"] = 9] = "TYPE_STRING"; /** * TYPE_GROUP - Tag-delimited aggregate. * Group type is deprecated and not supported after google.protobuf. However, Proto3 * implementations should still be able to parse the group wire format and * treat group fields as unknown fields. In Editions, the group wire format * can be enabled via the `message_encoding` feature. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_GROUP"] = 10] = "TYPE_GROUP"; /** TYPE_MESSAGE - Length-delimited aggregate. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_MESSAGE"] = 11] = "TYPE_MESSAGE"; /** TYPE_BYTES - New in version 2. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_BYTES"] = 12] = "TYPE_BYTES"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_UINT32"] = 13] = "TYPE_UINT32"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_ENUM"] = 14] = "TYPE_ENUM"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_SFIXED32"] = 15] = "TYPE_SFIXED32"; FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_SFIXED64"] = 16] = "TYPE_SFIXED64"; /** TYPE_SINT32 - Uses ZigZag encoding. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_SINT32"] = 17] = "TYPE_SINT32"; /** TYPE_SINT64 - Uses ZigZag encoding. */ FieldDescriptorProto_Type[FieldDescriptorProto_Type["TYPE_SINT64"] = 18] = "TYPE_SINT64"; })(FieldDescriptorProto_Type || (exports.FieldDescriptorProto_Type = FieldDescriptorProto_Type = {})); function fieldDescriptorProto_TypeFromJSON(object) { switch (object) { case 1: case "TYPE_DOUBLE": return FieldDescriptorProto_Type.TYPE_DOUBLE; case 2: case "TYPE_FLOAT": return FieldDescriptorProto_Type.TYPE_FLOAT; case 3: case "TYPE_INT64": return FieldDescriptorProto_Type.TYPE_INT64; case 4: case "TYPE_UINT64": return FieldDescriptorProto_Type.TYPE_UINT64; case 5: case "TYPE_INT32": return FieldDescriptorProto_Type.TYPE_INT32; case 6: case "TYPE_FIXED64": return FieldDescriptorProto_Type.TYPE_FIXED64; case 7: case "TYPE_FIXED32": return FieldDescriptorProto_Type.TYPE_FIXED32; case 8: case "TYPE_BOOL": return FieldDescriptorProto_Type.TYPE_BOOL; case 9: case "TYPE_STRING": return FieldDescriptorProto_Type.TYPE_STRING; case 10: case "TYPE_GROUP": return FieldDescriptorProto_Type.TYPE_GROUP; case 11: case "TYPE_MESSAGE": return FieldDescriptorProto_Type.TYPE_MESSAGE; case 12: case "TYPE_BYTES": return FieldDescriptorProto_Type.TYPE_BYTES; case 13: case "TYPE_UINT32": return FieldDescriptorProto_Type.TYPE_UINT32; case 14: case "TYPE_ENUM": return FieldDescriptorProto_Type.TYPE_ENUM; case 15: case "TYPE_SFIXED32": return FieldDescriptorProto_Type.TYPE_SFIXED32; case 16: case "TYPE_SFIXED64": return FieldDescriptorProto_Type.TYPE_SFIXED64; case 17: case "TYPE_SINT32": return FieldDescriptorProto_Type.TYPE_SINT32; case 18: case "TYPE_SINT64": return FieldDescriptorProto_Type.TYPE_SINT64; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldDescriptorProto_Type"); } } function fieldDescriptorProto_TypeToJSON(object) { switch (object) { case FieldDescriptorProto_Type.TYPE_DOUBLE: return "TYPE_DOUBLE"; case FieldDescriptorProto_Type.TYPE_FLOAT: return "TYPE_FLOAT"; case FieldDescriptorProto_Type.TYPE_INT64: return "TYPE_INT64"; case FieldDescriptorProto_Type.TYPE_UINT64: return "TYPE_UINT64"; case FieldDescriptorProto_Type.TYPE_INT32: return "TYPE_INT32"; case FieldDescriptorProto_Type.TYPE_FIXED64: return "TYPE_FIXED64"; case FieldDescriptorProto_Type.TYPE_FIXED32: return "TYPE_FIXED32"; case FieldDescriptorProto_Type.TYPE_BOOL: return "TYPE_BOOL"; case FieldDescriptorProto_Type.TYPE_STRING: return "TYPE_STRING"; case FieldDescriptorProto_Type.TYPE_GROUP: return "TYPE_GROUP"; case FieldDescriptorProto_Type.TYPE_MESSAGE: return "TYPE_MESSAGE"; case FieldDescriptorProto_Type.TYPE_BYTES: return "TYPE_BYTES"; case FieldDescriptorProto_Type.TYPE_UINT32: return "TYPE_UINT32"; case FieldDescriptorProto_Type.TYPE_ENUM: return "TYPE_ENUM"; case FieldDescriptorProto_Type.TYPE_SFIXED32: return "TYPE_SFIXED32"; case FieldDescriptorProto_Type.TYPE_SFIXED64: return "TYPE_SFIXED64"; case FieldDescriptorProto_Type.TYPE_SINT32: return "TYPE_SINT32"; case FieldDescriptorProto_Type.TYPE_SINT64: return "TYPE_SINT64"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldDescriptorProto_Type"); } } var FieldDescriptorProto_Label; (function (FieldDescriptorProto_Label) { /** LABEL_OPTIONAL - 0 is reserved for errors */ FieldDescriptorProto_Label[FieldDescriptorProto_Label["LABEL_OPTIONAL"] = 1] = "LABEL_OPTIONAL"; FieldDescriptorProto_Label[FieldDescriptorProto_Label["LABEL_REPEATED"] = 3] = "LABEL_REPEATED"; /** * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions * it's explicitly prohibited. In Editions, the `field_presence` feature * can be used to get this behavior. */ FieldDescriptorProto_Label[FieldDescriptorProto_Label["LABEL_REQUIRED"] = 2] = "LABEL_REQUIRED"; })(FieldDescriptorProto_Label || (exports.FieldDescriptorProto_Label = FieldDescriptorProto_Label = {})); function fieldDescriptorProto_LabelFromJSON(object) { switch (object) { case 1: case "LABEL_OPTIONAL": return FieldDescriptorProto_Label.LABEL_OPTIONAL; case 3: case "LABEL_REPEATED": return FieldDescriptorProto_Label.LABEL_REPEATED; case 2: case "LABEL_REQUIRED": return FieldDescriptorProto_Label.LABEL_REQUIRED; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldDescriptorProto_Label"); } } function fieldDescriptorProto_LabelToJSON(object) { switch (object) { case FieldDescriptorProto_Label.LABEL_OPTIONAL: return "LABEL_OPTIONAL"; case FieldDescriptorProto_Label.LABEL_REPEATED: return "LABEL_REPEATED"; case FieldDescriptorProto_Label.LABEL_REQUIRED: return "LABEL_REQUIRED"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldDescriptorProto_Label"); } } /** Generated classes can be optimized for speed or code size. */ var FileOptions_OptimizeMode; (function (FileOptions_OptimizeMode) { /** SPEED - Generate complete code for parsing, serialization, */ FileOptions_OptimizeMode[FileOptions_OptimizeMode["SPEED"] = 1] = "SPEED"; /** CODE_SIZE - etc. */ FileOptions_OptimizeMode[FileOptions_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE"; /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ FileOptions_OptimizeMode[FileOptions_OptimizeMode["LITE_RUNTIME"] = 3] = "LITE_RUNTIME"; })(FileOptions_OptimizeMode || (exports.FileOptions_OptimizeMode = FileOptions_OptimizeMode = {})); function fileOptions_OptimizeModeFromJSON(object) { switch (object) { case 1: case "SPEED": return FileOptions_OptimizeMode.SPEED; case 2: case "CODE_SIZE": return FileOptions_OptimizeMode.CODE_SIZE; case 3: case "LITE_RUNTIME": return FileOptions_OptimizeMode.LITE_RUNTIME; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FileOptions_OptimizeMode"); } } function fileOptions_OptimizeModeToJSON(object) { switch (object) { case FileOptions_OptimizeMode.SPEED: return "SPEED"; case FileOptions_OptimizeMode.CODE_SIZE: return "CODE_SIZE"; case FileOptions_OptimizeMode.LITE_RUNTIME: return "LITE_RUNTIME"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FileOptions_OptimizeMode"); } } var FieldOptions_CType; (function (FieldOptions_CType) { /** STRING - Default mode. */ FieldOptions_CType[FieldOptions_CType["STRING"] = 0] = "STRING"; /** * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type * "bytes". It indicates that in C++, the data should be stored in a Cord * instead of a string. For very large strings, this may reduce memory * fragmentation. It may also allow better performance when parsing from a * Cord, or when parsing with aliasing enabled, as the parsed Cord may then * alias the original buffer. */ FieldOptions_CType[FieldOptions_CType["CORD"] = 1] = "CORD"; FieldOptions_CType[FieldOptions_CType["STRING_PIECE"] = 2] = "STRING_PIECE"; })(FieldOptions_CType || (exports.FieldOptions_CType = FieldOptions_CType = {})); function fieldOptions_CTypeFromJSON(object) { switch (object) { case 0: case "STRING": return FieldOptions_CType.STRING; case 1: case "CORD": return FieldOptions_CType.CORD; case 2: case "STRING_PIECE": return FieldOptions_CType.STRING_PIECE; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_CType"); } } function fieldOptions_CTypeToJSON(object) { switch (object) { case FieldOptions_CType.STRING: return "STRING"; case FieldOptions_CType.CORD: return "CORD"; case FieldOptions_CType.STRING_PIECE: return "STRING_PIECE"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_CType"); } } var FieldOptions_JSType; (function (FieldOptions_JSType) { /** JS_NORMAL - Use the default type. */ FieldOptions_JSType[FieldOptions_JSType["JS_NORMAL"] = 0] = "JS_NORMAL"; /** JS_STRING - Use JavaScript strings. */ FieldOptions_JSType[FieldOptions_JSType["JS_STRING"] = 1] = "JS_STRING"; /** JS_NUMBER - Use JavaScript numbers. */ FieldOptions_JSType[FieldOptions_JSType["JS_NUMBER"] = 2] = "JS_NUMBER"; })(FieldOptions_JSType || (exports.FieldOptions_JSType = FieldOptions_JSType = {})); function fieldOptions_JSTypeFromJSON(object) { switch (object) { case 0: case "JS_NORMAL": return FieldOptions_JSType.JS_NORMAL; case 1: case "JS_STRING": return FieldOptions_JSType.JS_STRING; case 2: case "JS_NUMBER": return FieldOptions_JSType.JS_NUMBER; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_JSType"); } } function fieldOptions_JSTypeToJSON(object) { switch (object) { case FieldOptions_JSType.JS_NORMAL: return "JS_NORMAL"; case FieldOptions_JSType.JS_STRING: return "JS_STRING"; case FieldOptions_JSType.JS_NUMBER: return "JS_NUMBER"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_JSType"); } } /** If set to RETENTION_SOURCE, the option will be omitted from the binary. */ var FieldOptions_OptionRetention; (function (FieldOptions_OptionRetention) { FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_UNKNOWN"] = 0] = "RETENTION_UNKNOWN"; FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_RUNTIME"] = 1] = "RETENTION_RUNTIME"; FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE"; })(FieldOptions_OptionRetention || (exports.FieldOptions_OptionRetention = FieldOptions_OptionRetention = {})); function fieldOptions_OptionRetentionFromJSON(object) { switch (object) { case 0: case "RETENTION_UNKNOWN": return FieldOptions_OptionRetention.RETENTION_UNKNOWN; case 1: case "RETENTION_RUNTIME": return FieldOptions_OptionRetention.RETENTION_RUNTIME; case 2: case "RETENTION_SOURCE": return FieldOptions_OptionRetention.RETENTION_SOURCE; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_OptionRetention"); } } function fieldOptions_OptionRetentionToJSON(object) { switch (object) { case FieldOptions_OptionRetention.RETENTION_UNKNOWN: return "RETENTION_UNKNOWN"; case FieldOptions_OptionRetention.RETENTION_RUNTIME: return "RETENTION_RUNTIME"; case FieldOptions_OptionRetention.RETENTION_SOURCE: return "RETENTION_SOURCE"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_OptionRetention"); } } /** * This indicates the types of entities that the field may apply to when used * as an option. If it is unset, then the field may be freely used as an * option on any kind of entity. */ var FieldOptions_OptionTargetType; (function (FieldOptions_OptionTargetType) { FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_UNKNOWN"] = 0] = "TARGET_TYPE_UNKNOWN"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FILE"] = 1] = "TARGET_TYPE_FILE"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_EXTENSION_RANGE"] = 2] = "TARGET_TYPE_EXTENSION_RANGE"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_MESSAGE"] = 3] = "TARGET_TYPE_MESSAGE"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FIELD"] = 4] = "TARGET_TYPE_FIELD"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ONEOF"] = 5] = "TARGET_TYPE_ONEOF"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM"] = 6] = "TARGET_TYPE_ENUM"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM_ENTRY"] = 7] = "TARGET_TYPE_ENUM_ENTRY"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_SERVICE"] = 8] = "TARGET_TYPE_SERVICE"; FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD"; })(FieldOptions_OptionTargetType || (exports.FieldOptions_OptionTargetType = FieldOptions_OptionTargetType = {})); function fieldOptions_OptionTargetTypeFromJSON(object) { switch (object) { case 0: case "TARGET_TYPE_UNKNOWN": return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; case 1: case "TARGET_TYPE_FILE": return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; case 2: case "TARGET_TYPE_EXTENSION_RANGE": return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; case 3: case "TARGET_TYPE_MESSAGE": return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; case 4: case "TARGET_TYPE_FIELD": return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; case 5: case "TARGET_TYPE_ONEOF": return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; case 6: case "TARGET_TYPE_ENUM": return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; case 7: case "TARGET_TYPE_ENUM_ENTRY": return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; case 8: case "TARGET_TYPE_SERVICE": return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; case 9: case "TARGET_TYPE_METHOD": return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_OptionTargetType"); } } function fieldOptions_OptionTargetTypeToJSON(object) { switch (object) { case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: return "TARGET_TYPE_UNKNOWN"; case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: return "TARGET_TYPE_FILE"; case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: return "TARGET_TYPE_EXTENSION_RANGE"; case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: return "TARGET_TYPE_MESSAGE"; case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: return "TARGET_TYPE_FIELD"; case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: return "TARGET_TYPE_ONEOF"; case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: return "TARGET_TYPE_ENUM"; case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: return "TARGET_TYPE_ENUM_ENTRY"; case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: return "TARGET_TYPE_SERVICE"; case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: return "TARGET_TYPE_METHOD"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FieldOptions_OptionTargetType"); } } /** * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, * or neither? HTTP based RPC implementation may choose GET verb for safe * methods, and PUT verb for idempotent methods instead of the default POST. */ var MethodOptions_IdempotencyLevel; (function (MethodOptions_IdempotencyLevel) { MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENCY_UNKNOWN"] = 0] = "IDEMPOTENCY_UNKNOWN"; /** NO_SIDE_EFFECTS - implies idempotent */ MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["NO_SIDE_EFFECTS"] = 1] = "NO_SIDE_EFFECTS"; /** IDEMPOTENT - idempotent, but may have side effects */ MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENT"] = 2] = "IDEMPOTENT"; })(MethodOptions_IdempotencyLevel || (exports.MethodOptions_IdempotencyLevel = MethodOptions_IdempotencyLevel = {})); function methodOptions_IdempotencyLevelFromJSON(object) { switch (object) { case 0: case "IDEMPOTENCY_UNKNOWN": return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; case 1: case "NO_SIDE_EFFECTS": return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; case 2: case "IDEMPOTENT": return MethodOptions_IdempotencyLevel.IDEMPOTENT; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum MethodOptions_IdempotencyLevel"); } } function methodOptions_IdempotencyLevelToJSON(object) { switch (object) { case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: return "IDEMPOTENCY_UNKNOWN"; case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: return "NO_SIDE_EFFECTS"; case MethodOptions_IdempotencyLevel.IDEMPOTENT: return "IDEMPOTENT"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum MethodOptions_IdempotencyLevel"); } } var FeatureSet_FieldPresence; (function (FeatureSet_FieldPresence) { FeatureSet_FieldPresence[FeatureSet_FieldPresence["FIELD_PRESENCE_UNKNOWN"] = 0] = "FIELD_PRESENCE_UNKNOWN"; FeatureSet_FieldPresence[FeatureSet_FieldPresence["EXPLICIT"] = 1] = "EXPLICIT"; FeatureSet_FieldPresence[FeatureSet_FieldPresence["IMPLICIT"] = 2] = "IMPLICIT"; FeatureSet_FieldPresence[FeatureSet_FieldPresence["LEGACY_REQUIRED"] = 3] = "LEGACY_REQUIRED"; })(FeatureSet_FieldPresence || (exports.FeatureSet_FieldPresence = FeatureSet_FieldPresence = {})); function featureSet_FieldPresenceFromJSON(object) { switch (object) { case 0: case "FIELD_PRESENCE_UNKNOWN": return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN; case 1: case "EXPLICIT": return FeatureSet_FieldPresence.EXPLICIT; case 2: case "IMPLICIT": return FeatureSet_FieldPresence.IMPLICIT; case 3: case "LEGACY_REQUIRED": return FeatureSet_FieldPresence.LEGACY_REQUIRED; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_FieldPresence"); } } function featureSet_FieldPresenceToJSON(object) { switch (object) { case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN: return "FIELD_PRESENCE_UNKNOWN"; case FeatureSet_FieldPresence.EXPLICIT: return "EXPLICIT"; case FeatureSet_FieldPresence.IMPLICIT: return "IMPLICIT"; case FeatureSet_FieldPresence.LEGACY_REQUIRED: return "LEGACY_REQUIRED"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_FieldPresence"); } } var FeatureSet_EnumType; (function (FeatureSet_EnumType) { FeatureSet_EnumType[FeatureSet_EnumType["ENUM_TYPE_UNKNOWN"] = 0] = "ENUM_TYPE_UNKNOWN"; FeatureSet_EnumType[FeatureSet_EnumType["OPEN"] = 1] = "OPEN"; FeatureSet_EnumType[FeatureSet_EnumType["CLOSED"] = 2] = "CLOSED"; })(FeatureSet_EnumType || (exports.FeatureSet_EnumType = FeatureSet_EnumType = {})); function featureSet_EnumTypeFromJSON(object) { switch (object) { case 0: case "ENUM_TYPE_UNKNOWN": return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN; case 1: case "OPEN": return FeatureSet_EnumType.OPEN; case 2: case "CLOSED": return FeatureSet_EnumType.CLOSED; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_EnumType"); } } function featureSet_EnumTypeToJSON(object) { switch (object) { case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN: return "ENUM_TYPE_UNKNOWN"; case FeatureSet_EnumType.OPEN: return "OPEN"; case FeatureSet_EnumType.CLOSED: return "CLOSED"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_EnumType"); } } var FeatureSet_RepeatedFieldEncoding; (function (FeatureSet_RepeatedFieldEncoding) { FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["REPEATED_FIELD_ENCODING_UNKNOWN"] = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN"; FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["PACKED"] = 1] = "PACKED"; FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["EXPANDED"] = 2] = "EXPANDED"; })(FeatureSet_RepeatedFieldEncoding || (exports.FeatureSet_RepeatedFieldEncoding = FeatureSet_RepeatedFieldEncoding = {})); function featureSet_RepeatedFieldEncodingFromJSON(object) { switch (object) { case 0: case "REPEATED_FIELD_ENCODING_UNKNOWN": return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN; case 1: case "PACKED": return FeatureSet_RepeatedFieldEncoding.PACKED; case 2: case "EXPANDED": return FeatureSet_RepeatedFieldEncoding.EXPANDED; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_RepeatedFieldEncoding"); } } function featureSet_RepeatedFieldEncodingToJSON(object) { switch (object) { case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN: return "REPEATED_FIELD_ENCODING_UNKNOWN"; case FeatureSet_RepeatedFieldEncoding.PACKED: return "PACKED"; case FeatureSet_RepeatedFieldEncoding.EXPANDED: return "EXPANDED"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_RepeatedFieldEncoding"); } } var FeatureSet_Utf8Validation; (function (FeatureSet_Utf8Validation) { FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN"; FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["VERIFY"] = 2] = "VERIFY"; FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["NONE"] = 3] = "NONE"; })(FeatureSet_Utf8Validation || (exports.FeatureSet_Utf8Validation = FeatureSet_Utf8Validation = {})); function featureSet_Utf8ValidationFromJSON(object) { switch (object) { case 0: case "UTF8_VALIDATION_UNKNOWN": return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN; case 2: case "VERIFY": return FeatureSet_Utf8Validation.VERIFY; case 3: case "NONE": return FeatureSet_Utf8Validation.NONE; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_Utf8Validation"); } } function featureSet_Utf8ValidationToJSON(object) { switch (object) { case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN: return "UTF8_VALIDATION_UNKNOWN"; case FeatureSet_Utf8Validation.VERIFY: return "VERIFY"; case FeatureSet_Utf8Validation.NONE: return "NONE"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_Utf8Validation"); } } var FeatureSet_MessageEncoding; (function (FeatureSet_MessageEncoding) { FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["MESSAGE_ENCODING_UNKNOWN"] = 0] = "MESSAGE_ENCODING_UNKNOWN"; FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["LENGTH_PREFIXED"] = 1] = "LENGTH_PREFIXED"; FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["DELIMITED"] = 2] = "DELIMITED"; })(FeatureSet_MessageEncoding || (exports.FeatureSet_MessageEncoding = FeatureSet_MessageEncoding = {})); function featureSet_MessageEncodingFromJSON(object) { switch (object) { case 0: case "MESSAGE_ENCODING_UNKNOWN": return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN; case 1: case "LENGTH_PREFIXED": return FeatureSet_MessageEncoding.LENGTH_PREFIXED; case 2: case "DELIMITED": return FeatureSet_MessageEncoding.DELIMITED; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_MessageEncoding"); } } function featureSet_MessageEncodingToJSON(object) { switch (object) { case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN: return "MESSAGE_ENCODING_UNKNOWN"; case FeatureSet_MessageEncoding.LENGTH_PREFIXED: return "LENGTH_PREFIXED"; case FeatureSet_MessageEncoding.DELIMITED: return "DELIMITED"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_MessageEncoding"); } } var FeatureSet_JsonFormat; (function (FeatureSet_JsonFormat) { FeatureSet_JsonFormat[FeatureSet_JsonFormat["JSON_FORMAT_UNKNOWN"] = 0] = "JSON_FORMAT_UNKNOWN"; FeatureSet_JsonFormat[FeatureSet_JsonFormat["ALLOW"] = 1] = "ALLOW"; FeatureSet_JsonFormat[FeatureSet_JsonFormat["LEGACY_BEST_EFFORT"] = 2] = "LEGACY_BEST_EFFORT"; })(FeatureSet_JsonFormat || (exports.FeatureSet_JsonFormat = FeatureSet_JsonFormat = {})); function featureSet_JsonFormatFromJSON(object) { switch (object) { case 0: case "JSON_FORMAT_UNKNOWN": return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN; case 1: case "ALLOW": return FeatureSet_JsonFormat.ALLOW; case 2: case "LEGACY_BEST_EFFORT": return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_JsonFormat"); } } function featureSet_JsonFormatToJSON(object) { switch (object) { case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN: return "JSON_FORMAT_UNKNOWN"; case FeatureSet_JsonFormat.ALLOW: return "ALLOW"; case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT: return "LEGACY_BEST_EFFORT"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_JsonFormat"); } } var FeatureSet_EnforceNamingStyle; (function (FeatureSet_EnforceNamingStyle) { FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["ENFORCE_NAMING_STYLE_UNKNOWN"] = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN"; FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE2024"] = 1] = "STYLE2024"; FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE_LEGACY"] = 2] = "STYLE_LEGACY"; })(FeatureSet_EnforceNamingStyle || (exports.FeatureSet_EnforceNamingStyle = FeatureSet_EnforceNamingStyle = {})); function featureSet_EnforceNamingStyleFromJSON(object) { switch (object) { case 0: case "ENFORCE_NAMING_STYLE_UNKNOWN": return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN; case 1: case "STYLE2024": return FeatureSet_EnforceNamingStyle.STYLE2024; case 2: case "STYLE_LEGACY": return FeatureSet_EnforceNamingStyle.STYLE_LEGACY; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_EnforceNamingStyle"); } } function featureSet_EnforceNamingStyleToJSON(object) { switch (object) { case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN: return "ENFORCE_NAMING_STYLE_UNKNOWN"; case FeatureSet_EnforceNamingStyle.STYLE2024: return "STYLE2024"; case FeatureSet_EnforceNamingStyle.STYLE_LEGACY: return "STYLE_LEGACY"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum FeatureSet_EnforceNamingStyle"); } } /** * Represents the identified object's effect on the element in the original * .proto file. */ var GeneratedCodeInfo_Annotation_Semantic; (function (GeneratedCodeInfo_Annotation_Semantic) { /** NONE - There is no effect or the effect is indescribable. */ GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["NONE"] = 0] = "NONE"; /** SET - The element is set or otherwise mutated. */ GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["SET"] = 1] = "SET"; /** ALIAS - An alias to the element is returned. */ GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["ALIAS"] = 2] = "ALIAS"; })(GeneratedCodeInfo_Annotation_Semantic || (exports.GeneratedCodeInfo_Annotation_Semantic = GeneratedCodeInfo_Annotation_Semantic = {})); function generatedCodeInfo_Annotation_SemanticFromJSON(object) { switch (object) { case 0: case "NONE": return GeneratedCodeInfo_Annotation_Semantic.NONE; case 1: case "SET": return GeneratedCodeInfo_Annotation_Semantic.SET; case 2: case "ALIAS": return GeneratedCodeInfo_Annotation_Semantic.ALIAS; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum GeneratedCodeInfo_Annotation_Semantic"); } } function generatedCodeInfo_Annotation_SemanticToJSON(object) { switch (object) { case GeneratedCodeInfo_Annotation_Semantic.NONE: return "NONE"; case GeneratedCodeInfo_Annotation_Semantic.SET: return "SET"; case GeneratedCodeInfo_Annotation_Semantic.ALIAS: return "ALIAS"; default: throw new globalThis.Error("Unrecognized enum value " + object + " for enum GeneratedCodeInfo_Annotation_Semantic"); } } exports.FileDescriptorSet = { fromJSON(object) { return { file: globalThis.Array.isArray(object?.file) ? object.file.map((e) => exports.FileDescriptorProto.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.file?.length) { obj.file = message.file.map((e) => exports.FileDescriptorProto.toJSON(e)); } return obj; }, }; exports.FileDescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", package: isSet(object.package) ? globalThis.String(object.package) : "", dependency: globalThis.Array.isArray(object?.dependency) ? object.dependency.map((e) => globalThis.String(e)) : [], publicDependency: globalThis.Array.isArray(object?.publicDependency) ? object.publicDependency.map((e) => globalThis.Number(e)) : [], weakDependency: globalThis.Array.isArray(object?.weakDependency) ? object.weakDependency.map((e) => globalThis.Number(e)) : [], messageType: globalThis.Array.isArray(object?.messageType) ? object.messageType.map((e) => exports.DescriptorProto.fromJSON(e)) : [], enumType: globalThis.Array.isArray(object?.enumType) ? object.enumType.map((e) => exports.EnumDescriptorProto.fromJSON(e)) : [], service: globalThis.Array.isArray(object?.service) ? object.service.map((e) => exports.ServiceDescriptorProto.fromJSON(e)) : [], extension: globalThis.Array.isArray(object?.extension) ? object.extension.map((e) => exports.FieldDescriptorProto.fromJSON(e)) : [], options: isSet(object.options) ? exports.FileOptions.fromJSON(object.options) : undefined, sourceCodeInfo: isSet(object.sourceCodeInfo) ? exports.SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined, syntax: isSet(object.syntax) ? globalThis.String(object.syntax) : "", edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.package !== undefined && message.package !== "") { obj.package = message.package; } if (message.dependency?.length) { obj.dependency = message.dependency; } if (message.publicDependency?.length) { obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); } if (message.weakDependency?.length) { obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); } if (message.messageType?.length) { obj.messageType = message.messageType.map((e) => exports.DescriptorProto.toJSON(e)); } if (message.enumType?.length) { obj.enumType = message.enumType.map((e) => exports.EnumDescriptorProto.toJSON(e)); } if (message.service?.length) { obj.service = message.service.map((e) => exports.ServiceDescriptorProto.toJSON(e)); } if (message.extension?.length) { obj.extension = message.extension.map((e) => exports.FieldDescriptorProto.toJSON(e)); } if (message.options !== undefined) { obj.options = exports.FileOptions.toJSON(message.options); } if (message.sourceCodeInfo !== undefined) { obj.sourceCodeInfo = exports.SourceCodeInfo.toJSON(message.sourceCodeInfo); } if (message.syntax !== undefined && message.syntax !== "") { obj.syntax = message.syntax; } if (message.edition !== undefined && message.edition !== 0) { obj.edition = editionToJSON(message.edition); } return obj; }, }; exports.DescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", field: globalThis.Array.isArray(object?.field) ? object.field.map((e) => exports.FieldDescriptorProto.fromJSON(e)) : [], extension: globalThis.Array.isArray(object?.extension) ? object.extension.map((e) => exports.FieldDescriptorProto.fromJSON(e)) : [], nestedType: globalThis.Array.isArray(object?.nestedType) ? object.nestedType.map((e) => exports.DescriptorProto.fromJSON(e)) : [], enumType: globalThis.Array.isArray(object?.enumType) ? object.enumType.map((e) => exports.EnumDescriptorProto.fromJSON(e)) : [], extensionRange: globalThis.Array.isArray(object?.extensionRange) ? object.extensionRange.map((e) => exports.DescriptorProto_ExtensionRange.fromJSON(e)) : [], oneofDecl: globalThis.Array.isArray(object?.oneofDecl) ? object.oneofDecl.map((e) => exports.OneofDescriptorProto.fromJSON(e)) : [], options: isSet(object.options) ? exports.MessageOptions.fromJSON(object.options) : undefined, reservedRange: globalThis.Array.isArray(object?.reservedRange) ? object.reservedRange.map((e) => exports.DescriptorProto_ReservedRange.fromJSON(e)) : [], reservedName: globalThis.Array.isArray(object?.reservedName) ? object.reservedName.map((e) => globalThis.String(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.field?.length) { obj.field = message.field.map((e) => exports.FieldDescriptorProto.toJSON(e)); } if (message.extension?.length) { obj.extension = message.extension.map((e) => exports.FieldDescriptorProto.toJSON(e)); } if (message.nestedType?.length) { obj.nestedType = message.nestedType.map((e) => exports.DescriptorProto.toJSON(e)); } if (message.enumType?.length) { obj.enumType = message.enumType.map((e) => exports.EnumDescriptorProto.toJSON(e)); } if (message.extensionRange?.length) { obj.extensionRange = message.extensionRange.map((e) => exports.DescriptorProto_ExtensionRange.toJSON(e)); } if (message.oneofDecl?.length) { obj.oneofDecl = message.oneofDecl.map((e) => exports.OneofDescriptorProto.toJSON(e)); } if (message.options !== undefined) { obj.options = exports.MessageOptions.toJSON(message.options); } if (message.reservedRange?.length) { obj.reservedRange = message.reservedRange.map((e) => exports.DescriptorProto_ReservedRange.toJSON(e)); } if (message.reservedName?.length) { obj.reservedName = message.reservedName; } return obj; }, }; exports.DescriptorProto_ExtensionRange = { fromJSON(object) { return { start: isSet(object.start) ? globalThis.Number(object.start) : 0, end: isSet(object.end) ? globalThis.Number(object.end) : 0, options: isSet(object.options) ? exports.ExtensionRangeOptions.fromJSON(object.options) : undefined, }; }, toJSON(message) { const obj = {}; if (message.start !== undefined && message.start !== 0) { obj.start = Math.round(message.start); } if (message.end !== undefined && message.end !== 0) { obj.end = Math.round(message.end); } if (message.options !== undefined) { obj.options = exports.ExtensionRangeOptions.toJSON(message.options); } return obj; }, }; exports.DescriptorProto_ReservedRange = { fromJSON(object) { return { start: isSet(object.start) ? globalThis.Number(object.start) : 0, end: isSet(object.end) ? globalThis.Number(object.end) : 0, }; }, toJSON(message) { const obj = {}; if (message.start !== undefined && message.start !== 0) { obj.start = Math.round(message.start); } if (message.end !== undefined && message.end !== 0) { obj.end = Math.round(message.end); } return obj; }, }; exports.ExtensionRangeOptions = { fromJSON(object) { return { uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], declaration: globalThis.Array.isArray(object?.declaration) ? object.declaration.map((e) => exports.ExtensionRangeOptions_Declaration.fromJSON(e)) : [], features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, verification: isSet(object.verification) ? extensionRangeOptions_VerificationStateFromJSON(object.verification) : 1, }; }, toJSON(message) { const obj = {}; if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } if (message.declaration?.length) { obj.declaration = message.declaration.map((e) => exports.ExtensionRangeOptions_Declaration.toJSON(e)); } if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.verification !== undefined && message.verification !== 1) { obj.verification = extensionRangeOptions_VerificationStateToJSON(message.verification); } return obj; }, }; exports.ExtensionRangeOptions_Declaration = { fromJSON(object) { return { number: isSet(object.number) ? globalThis.Number(object.number) : 0, fullName: isSet(object.fullName) ? globalThis.String(object.fullName) : "", type: isSet(object.type) ? globalThis.String(object.type) : "", reserved: isSet(object.reserved) ? globalThis.Boolean(object.reserved) : false, repeated: isSet(object.repeated) ? globalThis.Boolean(object.repeated) : false, }; }, toJSON(message) { const obj = {}; if (message.number !== undefined && message.number !== 0) { obj.number = Math.round(message.number); } if (message.fullName !== undefined && message.fullName !== "") { obj.fullName = message.fullName; } if (message.type !== undefined && message.type !== "") { obj.type = message.type; } if (message.reserved !== undefined && message.reserved !== false) { obj.reserved = message.reserved; } if (message.repeated !== undefined && message.repeated !== false) { obj.repeated = message.repeated; } return obj; }, }; exports.FieldDescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", number: isSet(object.number) ? globalThis.Number(object.number) : 0, label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 1, type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 1, typeName: isSet(object.typeName) ? globalThis.String(object.typeName) : "", extendee: isSet(object.extendee) ? globalThis.String(object.extendee) : "", defaultValue: isSet(object.defaultValue) ? globalThis.String(object.defaultValue) : "", oneofIndex: isSet(object.oneofIndex) ? globalThis.Number(object.oneofIndex) : 0, jsonName: isSet(object.jsonName) ? globalThis.String(object.jsonName) : "", options: isSet(object.options) ? exports.FieldOptions.fromJSON(object.options) : undefined, proto3Optional: isSet(object.proto3Optional) ? globalThis.Boolean(object.proto3Optional) : false, }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.number !== undefined && message.number !== 0) { obj.number = Math.round(message.number); } if (message.label !== undefined && message.label !== 1) { obj.label = fieldDescriptorProto_LabelToJSON(message.label); } if (message.type !== undefined && message.type !== 1) { obj.type = fieldDescriptorProto_TypeToJSON(message.type); } if (message.typeName !== undefined && message.typeName !== "") { obj.typeName = message.typeName; } if (message.extendee !== undefined && message.extendee !== "") { obj.extendee = message.extendee; } if (message.defaultValue !== undefined && message.defaultValue !== "") { obj.defaultValue = message.defaultValue; } if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { obj.oneofIndex = Math.round(message.oneofIndex); } if (message.jsonName !== undefined && message.jsonName !== "") { obj.jsonName = message.jsonName; } if (message.options !== undefined) { obj.options = exports.FieldOptions.toJSON(message.options); } if (message.proto3Optional !== undefined && message.proto3Optional !== false) { obj.proto3Optional = message.proto3Optional; } return obj; }, }; exports.OneofDescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", options: isSet(object.options) ? exports.OneofOptions.fromJSON(object.options) : undefined, }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.options !== undefined) { obj.options = exports.OneofOptions.toJSON(message.options); } return obj; }, }; exports.EnumDescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", value: globalThis.Array.isArray(object?.value) ? object.value.map((e) => exports.EnumValueDescriptorProto.fromJSON(e)) : [], options: isSet(object.options) ? exports.EnumOptions.fromJSON(object.options) : undefined, reservedRange: globalThis.Array.isArray(object?.reservedRange) ? object.reservedRange.map((e) => exports.EnumDescriptorProto_EnumReservedRange.fromJSON(e)) : [], reservedName: globalThis.Array.isArray(object?.reservedName) ? object.reservedName.map((e) => globalThis.String(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.value?.length) { obj.value = message.value.map((e) => exports.EnumValueDescriptorProto.toJSON(e)); } if (message.options !== undefined) { obj.options = exports.EnumOptions.toJSON(message.options); } if (message.reservedRange?.length) { obj.reservedRange = message.reservedRange.map((e) => exports.EnumDescriptorProto_EnumReservedRange.toJSON(e)); } if (message.reservedName?.length) { obj.reservedName = message.reservedName; } return obj; }, }; exports.EnumDescriptorProto_EnumReservedRange = { fromJSON(object) { return { start: isSet(object.start) ? globalThis.Number(object.start) : 0, end: isSet(object.end) ? globalThis.Number(object.end) : 0, }; }, toJSON(message) { const obj = {}; if (message.start !== undefined && message.start !== 0) { obj.start = Math.round(message.start); } if (message.end !== undefined && message.end !== 0) { obj.end = Math.round(message.end); } return obj; }, }; exports.EnumValueDescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", number: isSet(object.number) ? globalThis.Number(object.number) : 0, options: isSet(object.options) ? exports.EnumValueOptions.fromJSON(object.options) : undefined, }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.number !== undefined && message.number !== 0) { obj.number = Math.round(message.number); } if (message.options !== undefined) { obj.options = exports.EnumValueOptions.toJSON(message.options); } return obj; }, }; exports.ServiceDescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", method: globalThis.Array.isArray(object?.method) ? object.method.map((e) => exports.MethodDescriptorProto.fromJSON(e)) : [], options: isSet(object.options) ? exports.ServiceOptions.fromJSON(object.options) : undefined, }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.method?.length) { obj.method = message.method.map((e) => exports.MethodDescriptorProto.toJSON(e)); } if (message.options !== undefined) { obj.options = exports.ServiceOptions.toJSON(message.options); } return obj; }, }; exports.MethodDescriptorProto = { fromJSON(object) { return { name: isSet(object.name) ? globalThis.String(object.name) : "", inputType: isSet(object.inputType) ? globalThis.String(object.inputType) : "", outputType: isSet(object.outputType) ? globalThis.String(object.outputType) : "", options: isSet(object.options) ? exports.MethodOptions.fromJSON(object.options) : undefined, clientStreaming: isSet(object.clientStreaming) ? globalThis.Boolean(object.clientStreaming) : false, serverStreaming: isSet(object.serverStreaming) ? globalThis.Boolean(object.serverStreaming) : false, }; }, toJSON(message) { const obj = {}; if (message.name !== undefined && message.name !== "") { obj.name = message.name; } if (message.inputType !== undefined && message.inputType !== "") { obj.inputType = message.inputType; } if (message.outputType !== undefined && message.outputType !== "") { obj.outputType = message.outputType; } if (message.options !== undefined) { obj.options = exports.MethodOptions.toJSON(message.options); } if (message.clientStreaming !== undefined && message.clientStreaming !== false) { obj.clientStreaming = message.clientStreaming; } if (message.serverStreaming !== undefined && message.serverStreaming !== false) { obj.serverStreaming = message.serverStreaming; } return obj; }, }; exports.FileOptions = { fromJSON(object) { return { javaPackage: isSet(object.javaPackage) ? globalThis.String(object.javaPackage) : "", javaOuterClassname: isSet(object.javaOuterClassname) ? globalThis.String(object.javaOuterClassname) : "", javaMultipleFiles: isSet(object.javaMultipleFiles) ? globalThis.Boolean(object.javaMultipleFiles) : false, javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) ? globalThis.Boolean(object.javaGenerateEqualsAndHash) : false, javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? globalThis.Boolean(object.javaStringCheckUtf8) : false, optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 1, goPackage: isSet(object.goPackage) ? globalThis.String(object.goPackage) : "", ccGenericServices: isSet(object.ccGenericServices) ? globalThis.Boolean(object.ccGenericServices) : false, javaGenericServices: isSet(object.javaGenericServices) ? globalThis.Boolean(object.javaGenericServices) : false, pyGenericServices: isSet(object.pyGenericServices) ? globalThis.Boolean(object.pyGenericServices) : false, deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, ccEnableArenas: isSet(object.ccEnableArenas) ? globalThis.Boolean(object.ccEnableArenas) : true, objcClassPrefix: isSet(object.objcClassPrefix) ? globalThis.String(object.objcClassPrefix) : "", csharpNamespace: isSet(object.csharpNamespace) ? globalThis.String(object.csharpNamespace) : "", swiftPrefix: isSet(object.swiftPrefix) ? globalThis.String(object.swiftPrefix) : "", phpClassPrefix: isSet(object.phpClassPrefix) ? globalThis.String(object.phpClassPrefix) : "", phpNamespace: isSet(object.phpNamespace) ? globalThis.String(object.phpNamespace) : "", phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? globalThis.String(object.phpMetadataNamespace) : "", rubyPackage: isSet(object.rubyPackage) ? globalThis.String(object.rubyPackage) : "", features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.javaPackage !== undefined && message.javaPackage !== "") { obj.javaPackage = message.javaPackage; } if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") { obj.javaOuterClassname = message.javaOuterClassname; } if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) { obj.javaMultipleFiles = message.javaMultipleFiles; } if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) { obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; } if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) { obj.javaStringCheckUtf8 = message.javaStringCheckUtf8; } if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor); } if (message.goPackage !== undefined && message.goPackage !== "") { obj.goPackage = message.goPackage; } if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) { obj.ccGenericServices = message.ccGenericServices; } if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) { obj.javaGenericServices = message.javaGenericServices; } if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) { obj.pyGenericServices = message.pyGenericServices; } if (message.deprecated !== undefined && message.deprecated !== false) { obj.deprecated = message.deprecated; } if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== true) { obj.ccEnableArenas = message.ccEnableArenas; } if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") { obj.objcClassPrefix = message.objcClassPrefix; } if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") { obj.csharpNamespace = message.csharpNamespace; } if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { obj.swiftPrefix = message.swiftPrefix; } if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { obj.phpClassPrefix = message.phpClassPrefix; } if (message.phpNamespace !== undefined && message.phpNamespace !== "") { obj.phpNamespace = message.phpNamespace; } if (message.phpMetadataNamespace !== undefined && message.phpMetadataNamespace !== "") { obj.phpMetadataNamespace = message.phpMetadataNamespace; } if (message.rubyPackage !== undefined && message.rubyPackage !== "") { obj.rubyPackage = message.rubyPackage; } if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.MessageOptions = { fromJSON(object) { return { messageSetWireFormat: isSet(object.messageSetWireFormat) ? globalThis.Boolean(object.messageSetWireFormat) : false, noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) ? globalThis.Boolean(object.noStandardDescriptorAccessor) : false, deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, mapEntry: isSet(object.mapEntry) ? globalThis.Boolean(object.mapEntry) : false, deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) : false, features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) { obj.messageSetWireFormat = message.messageSetWireFormat; } if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) { obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; } if (message.deprecated !== undefined && message.deprecated !== false) { obj.deprecated = message.deprecated; } if (message.mapEntry !== undefined && message.mapEntry !== false) { obj.mapEntry = message.mapEntry; } if (message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false) { obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; } if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.FieldOptions = { fromJSON(object) { return { ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, packed: isSet(object.packed) ? globalThis.Boolean(object.packed) : false, jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, lazy: isSet(object.lazy) ? globalThis.Boolean(object.lazy) : false, unverifiedLazy: isSet(object.unverifiedLazy) ? globalThis.Boolean(object.unverifiedLazy) : false, deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false, debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0, targets: globalThis.Array.isArray(object?.targets) ? object.targets.map((e) => fieldOptions_OptionTargetTypeFromJSON(e)) : [], editionDefaults: globalThis.Array.isArray(object?.editionDefaults) ? object.editionDefaults.map((e) => exports.FieldOptions_EditionDefault.fromJSON(e)) : [], features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, featureSupport: isSet(object.featureSupport) ? exports.FieldOptions_FeatureSupport.fromJSON(object.featureSupport) : undefined, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.ctype !== undefined && message.ctype !== 0) { obj.ctype = fieldOptions_CTypeToJSON(message.ctype); } if (message.packed !== undefined && message.packed !== false) { obj.packed = message.packed; } if (message.jstype !== undefined && message.jstype !== 0) { obj.jstype = fieldOptions_JSTypeToJSON(message.jstype); } if (message.lazy !== undefined && message.lazy !== false) { obj.lazy = message.lazy; } if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) { obj.unverifiedLazy = message.unverifiedLazy; } if (message.deprecated !== undefined && message.deprecated !== false) { obj.deprecated = message.deprecated; } if (message.weak !== undefined && message.weak !== false) { obj.weak = message.weak; } if (message.debugRedact !== undefined && message.debugRedact !== false) { obj.debugRedact = message.debugRedact; } if (message.retention !== undefined && message.retention !== 0) { obj.retention = fieldOptions_OptionRetentionToJSON(message.retention); } if (message.targets?.length) { obj.targets = message.targets.map((e) => fieldOptions_OptionTargetTypeToJSON(e)); } if (message.editionDefaults?.length) { obj.editionDefaults = message.editionDefaults.map((e) => exports.FieldOptions_EditionDefault.toJSON(e)); } if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.featureSupport !== undefined) { obj.featureSupport = exports.FieldOptions_FeatureSupport.toJSON(message.featureSupport); } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.FieldOptions_EditionDefault = { fromJSON(object) { return { edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, value: isSet(object.value) ? globalThis.String(object.value) : "", }; }, toJSON(message) { const obj = {}; if (message.edition !== undefined && message.edition !== 0) { obj.edition = editionToJSON(message.edition); } if (message.value !== undefined && message.value !== "") { obj.value = message.value; } return obj; }, }; exports.FieldOptions_FeatureSupport = { fromJSON(object) { return { editionIntroduced: isSet(object.editionIntroduced) ? editionFromJSON(object.editionIntroduced) : 0, editionDeprecated: isSet(object.editionDeprecated) ? editionFromJSON(object.editionDeprecated) : 0, deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "", editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : 0, }; }, toJSON(message) { const obj = {}; if (message.editionIntroduced !== undefined && message.editionIntroduced !== 0) { obj.editionIntroduced = editionToJSON(message.editionIntroduced); } if (message.editionDeprecated !== undefined && message.editionDeprecated !== 0) { obj.editionDeprecated = editionToJSON(message.editionDeprecated); } if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") { obj.deprecationWarning = message.deprecationWarning; } if (message.editionRemoved !== undefined && message.editionRemoved !== 0) { obj.editionRemoved = editionToJSON(message.editionRemoved); } return obj; }, }; exports.OneofOptions = { fromJSON(object) { return { features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.EnumOptions = { fromJSON(object) { return { allowAlias: isSet(object.allowAlias) ? globalThis.Boolean(object.allowAlias) : false, deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) : false, features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.allowAlias !== undefined && message.allowAlias !== false) { obj.allowAlias = message.allowAlias; } if (message.deprecated !== undefined && message.deprecated !== false) { obj.deprecated = message.deprecated; } if (message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false) { obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; } if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.EnumValueOptions = { fromJSON(object) { return { deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, featureSupport: isSet(object.featureSupport) ? exports.FieldOptions_FeatureSupport.fromJSON(object.featureSupport) : undefined, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.deprecated !== undefined && message.deprecated !== false) { obj.deprecated = message.deprecated; } if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.debugRedact !== undefined && message.debugRedact !== false) { obj.debugRedact = message.debugRedact; } if (message.featureSupport !== undefined) { obj.featureSupport = exports.FieldOptions_FeatureSupport.toJSON(message.featureSupport); } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.ServiceOptions = { fromJSON(object) { return { features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.deprecated !== undefined && message.deprecated !== false) { obj.deprecated = message.deprecated; } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.MethodOptions = { fromJSON(object) { return { deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, idempotencyLevel: isSet(object.idempotencyLevel) ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) : 0, features: isSet(object.features) ? exports.FeatureSet.fromJSON(object.features) : undefined, uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) ? object.uninterpretedOption.map((e) => exports.UninterpretedOption.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.deprecated !== undefined && message.deprecated !== false) { obj.deprecated = message.deprecated; } if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== 0) { obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel); } if (message.features !== undefined) { obj.features = exports.FeatureSet.toJSON(message.features); } if (message.uninterpretedOption?.length) { obj.uninterpretedOption = message.uninterpretedOption.map((e) => exports.UninterpretedOption.toJSON(e)); } return obj; }, }; exports.UninterpretedOption = { fromJSON(object) { return { name: globalThis.Array.isArray(object?.name) ? object.name.map((e) => exports.UninterpretedOption_NamePart.fromJSON(e)) : [], identifierValue: isSet(object.identifierValue) ? globalThis.String(object.identifierValue) : "", positiveIntValue: isSet(object.positiveIntValue) ? globalThis.String(object.positiveIntValue) : "0", negativeIntValue: isSet(object.negativeIntValue) ? globalThis.String(object.negativeIntValue) : "0", doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : 0, stringValue: isSet(object.stringValue) ? Buffer.from(bytesFromBase64(object.stringValue)) : Buffer.alloc(0), aggregateValue: isSet(object.aggregateValue) ? globalThis.String(object.aggregateValue) : "", }; }, toJSON(message) { const obj = {}; if (message.name?.length) { obj.name = message.name.map((e) => exports.UninterpretedOption_NamePart.toJSON(e)); } if (message.identifierValue !== undefined && message.identifierValue !== "") { obj.identifierValue = message.identifierValue; } if (message.positiveIntValue !== undefined && message.positiveIntValue !== "0") { obj.positiveIntValue = message.positiveIntValue; } if (message.negativeIntValue !== undefined && message.negativeIntValue !== "0") { obj.negativeIntValue = message.negativeIntValue; } if (message.doubleValue !== undefined && message.doubleValue !== 0) { obj.doubleValue = message.doubleValue; } if (message.stringValue !== undefined && message.stringValue.length !== 0) { obj.stringValue = base64FromBytes(message.stringValue); } if (message.aggregateValue !== undefined && message.aggregateValue !== "") { obj.aggregateValue = message.aggregateValue; } return obj; }, }; exports.UninterpretedOption_NamePart = { fromJSON(object) { return { namePart: isSet(object.namePart) ? globalThis.String(object.namePart) : "", isExtension: isSet(object.isExtension) ? globalThis.Boolean(object.isExtension) : false, }; }, toJSON(message) { const obj = {}; if (message.namePart !== "") { obj.namePart = message.namePart; } if (message.isExtension !== false) { obj.isExtension = message.isExtension; } return obj; }, }; exports.FeatureSet = { fromJSON(object) { return { fieldPresence: isSet(object.fieldPresence) ? featureSet_FieldPresenceFromJSON(object.fieldPresence) : 0, enumType: isSet(object.enumType) ? featureSet_EnumTypeFromJSON(object.enumType) : 0, repeatedFieldEncoding: isSet(object.repeatedFieldEncoding) ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding) : 0, utf8Validation: isSet(object.utf8Validation) ? featureSet_Utf8ValidationFromJSON(object.utf8Validation) : 0, messageEncoding: isSet(object.messageEncoding) ? featureSet_MessageEncodingFromJSON(object.messageEncoding) : 0, jsonFormat: isSet(object.jsonFormat) ? featureSet_JsonFormatFromJSON(object.jsonFormat) : 0, enforceNamingStyle: isSet(object.enforceNamingStyle) ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle) : 0, }; }, toJSON(message) { const obj = {}; if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { obj.fieldPresence = featureSet_FieldPresenceToJSON(message.fieldPresence); } if (message.enumType !== undefined && message.enumType !== 0) { obj.enumType = featureSet_EnumTypeToJSON(message.enumType); } if (message.repeatedFieldEncoding !== undefined && message.repeatedFieldEncoding !== 0) { obj.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingToJSON(message.repeatedFieldEncoding); } if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { obj.utf8Validation = featureSet_Utf8ValidationToJSON(message.utf8Validation); } if (message.messageEncoding !== undefined && message.messageEncoding !== 0) { obj.messageEncoding = featureSet_MessageEncodingToJSON(message.messageEncoding); } if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat); } if (message.enforceNamingStyle !== undefined && message.enforceNamingStyle !== 0) { obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle); } return obj; }, }; exports.FeatureSetDefaults = { fromJSON(object) { return { defaults: globalThis.Array.isArray(object?.defaults) ? object.defaults.map((e) => exports.FeatureSetDefaults_FeatureSetEditionDefault.fromJSON(e)) : [], minimumEdition: isSet(object.minimumEdition) ? editionFromJSON(object.minimumEdition) : 0, maximumEdition: isSet(object.maximumEdition) ? editionFromJSON(object.maximumEdition) : 0, }; }, toJSON(message) { const obj = {}; if (message.defaults?.length) { obj.defaults = message.defaults.map((e) => exports.FeatureSetDefaults_FeatureSetEditionDefault.toJSON(e)); } if (message.minimumEdition !== undefined && message.minimumEdition !== 0) { obj.minimumEdition = editionToJSON(message.minimumEdition); } if (message.maximumEdition !== undefined && message.maximumEdition !== 0) { obj.maximumEdition = editionToJSON(message.maximumEdition); } return obj; }, }; exports.FeatureSetDefaults_FeatureSetEditionDefault = { fromJSON(object) { return { edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, overridableFeatures: isSet(object.overridableFeatures) ? exports.FeatureSet.fromJSON(object.overridableFeatures) : undefined, fixedFeatures: isSet(object.fixedFeatures) ? exports.FeatureSet.fromJSON(object.fixedFeatures) : undefined, }; }, toJSON(message) { const obj = {}; if (message.edition !== undefined && message.edition !== 0) { obj.edition = editionToJSON(message.edition); } if (message.overridableFeatures !== undefined) { obj.overridableFeatures = exports.FeatureSet.toJSON(message.overridableFeatures); } if (message.fixedFeatures !== undefined) { obj.fixedFeatures = exports.FeatureSet.toJSON(message.fixedFeatures); } return obj; }, }; exports.SourceCodeInfo = { fromJSON(object) { return { location: globalThis.Array.isArray(object?.location) ? object.location.map((e) => exports.SourceCodeInfo_Location.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.location?.length) { obj.location = message.location.map((e) => exports.SourceCodeInfo_Location.toJSON(e)); } return obj; }, }; exports.SourceCodeInfo_Location = { fromJSON(object) { return { path: globalThis.Array.isArray(object?.path) ? object.path.map((e) => globalThis.Number(e)) : [], span: globalThis.Array.isArray(object?.span) ? object.span.map((e) => globalThis.Number(e)) : [], leadingComments: isSet(object.leadingComments) ? globalThis.String(object.leadingComments) : "", trailingComments: isSet(object.trailingComments) ? globalThis.String(object.trailingComments) : "", leadingDetachedComments: globalThis.Array.isArray(object?.leadingDetachedComments) ? object.leadingDetachedComments.map((e) => globalThis.String(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.path?.length) { obj.path = message.path.map((e) => Math.round(e)); } if (message.span?.length) { obj.span = message.span.map((e) => Math.round(e)); } if (message.leadingComments !== undefined && message.leadingComments !== "") { obj.leadingComments = message.leadingComments; } if (message.trailingComments !== undefined && message.trailingComments !== "") { obj.trailingComments = message.trailingComments; } if (message.leadingDetachedComments?.length) { obj.leadingDetachedComments = message.leadingDetachedComments; } return obj; }, }; exports.GeneratedCodeInfo = { fromJSON(object) { return { annotation: globalThis.Array.isArray(object?.annotation) ? object.annotation.map((e) => exports.GeneratedCodeInfo_Annotation.fromJSON(e)) : [], }; }, toJSON(message) { const obj = {}; if (message.annotation?.length) { obj.annotation = message.annotation.map((e) => exports.GeneratedCodeInfo_Annotation.toJSON(e)); } return obj; }, }; exports.GeneratedCodeInfo_Annotation = { fromJSON(object) { return { path: globalThis.Array.isArray(object?.path) ? object.path.map((e) => globalThis.Number(e)) : [], sourceFile: isSet(object.sourceFile) ? globalThis.String(object.sourceFile) : "", begin: isSet(object.begin) ? globalThis.Number(object.begin) : 0, end: isSet(object.end) ? globalThis.Number(object.end) : 0, semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0, }; }, toJSON(message) { const obj = {}; if (message.path?.length) { obj.path = message.path.map((e) => Math.round(e)); } if (message.sourceFile !== undefined && message.sourceFile !== "") { obj.sourceFile = message.sourceFile; } if (message.begin !== undefined && message.begin !== 0) { obj.begin = Math.round(message.begin); } if (message.end !== undefined && message.end !== 0) { obj.end = Math.round(message.end); } if (message.semantic !== undefined && message.semantic !== 0) { obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic); } return obj; }, }; function bytesFromBase64(b64) { return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); } function base64FromBytes(arr) { return globalThis.Buffer.from(arr).toString("base64"); } function isSet(value) { return value !== null && value !== undefined; }