Skip to main content

Class: EnumOptions

google.protobuf.EnumOptions

Represents an EnumOptions.

Properties

.grpc.gateway.protoc_gen_openapiv2.options.openapiv2Enum

Optional .grpc.gateway.protoc_gen_openapiv2.options.openapiv2Enum: null | $Properties

EnumOptions .grpc.gateway.protoc_gen_openapiv2.options.openapiv2Enum


allowAlias

allowAlias: boolean

Set this option to true to allow mapping different tag names to the same value.


deprecated

deprecated: boolean

Is this enum deprecated? Depending on the target platform, this can emit Deprecated annotations for the enum, or it will be completely ignored; in the very least, this is a formalization for deprecating enums.


deprecatedLegacyJsonFieldConflicts

deprecatedLegacyJsonFieldConflicts: boolean

Enable the legacy handling of JSON field name conflicts. This lowercases and strips underscored from the fields before comparison in proto3 only. The new behavior takes json_name into account and applies to proto2 as well. TODO Remove this legacy behavior once downstream teams have had time to migrate.


features

Optional features: null | $Properties

Any features defined in the specific edition.


uninterpretedOption

uninterpretedOption: $Properties[]

The parser stores options it doesn't recognize here. See above.

Methods

toJSON

toJSON(): Object

Converts this EnumOptions to JSON.

Returns

Object

JSON object


create

create(properties?): EnumOptions & $Shape

Creates a new EnumOptions instance using the specified properties.

Parameters

NameTypeDescription
properties?$ShapeProperties to set

Returns

EnumOptions & $Shape

EnumOptions instance

create(properties?): EnumOptions

Parameters

NameType
properties?$Properties

Returns

EnumOptions


decode

decode(reader, length?): EnumOptions & $Shape

Decodes an EnumOptions message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

EnumOptions & $Shape

EnumOptions

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): EnumOptions & $Shape

Decodes an EnumOptions message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

EnumOptions & $Shape

EnumOptions

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified EnumOptions message. Does not implicitly google.protobuf.EnumOptions.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesEnumOptions message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified EnumOptions message, length delimited. Does not implicitly google.protobuf.EnumOptions.verify|verify messages.

Parameters

NameTypeDescription
message$PropertiesEnumOptions message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): EnumOptions

Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

EnumOptions

EnumOptions


toObject

toObject(message, options?): Object

Creates a plain object from an EnumOptions message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageEnumOptionsEnumOptions
options?IConversionOptionsConversion options

Returns

Object

Plain object