Public Member Functions | Public Attributes | Static Private Attributes | List of all members
google.protobuf.descriptor.EnumDescriptor Class Reference
Inheritance diagram for google.protobuf.descriptor.EnumDescriptor:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, name, full_name, filename, values, containing_type=None, options=None, serialized_options=None, file=None, serialized_start=None, serialized_end=None)
 
def __init__ (self, name, full_name, filename, values, containing_type=None, options=None, serialized_options=None, file=None, serialized_start=None, serialized_end=None, create_key=None)
 
def __new__ (cls, name, full_name, filename, values, containing_type=None, options=None, serialized_options=None, file=None, serialized_start=None, serialized_end=None)
 
def __new__ (cls, name, full_name, filename, values, containing_type=None, options=None, serialized_options=None, file=None, serialized_start=None, serialized_end=None, create_key=None)
 
def CopyToProto (self, proto)
 
def CopyToProto (self, proto)
 
- Public Member Functions inherited from google.protobuf.descriptor._NestedDescriptorBase
def __init__ (self, options, options_class_name, name, full_name, file, containing_type, serialized_start=None, serialized_end=None, serialized_options=None)
 
def __init__ (self, options, options_class_name, name, full_name, file, containing_type, serialized_start=None, serialized_end=None, serialized_options=None)
 
- Public Member Functions inherited from google.protobuf.descriptor.DescriptorBase
def __init__ (self, options, serialized_options, options_class_name)
 
def __init__ (self, options, serialized_options, options_class_name)
 
def GetOptions (self)
 
def GetOptions (self)
 
- Public Member Functions inherited from google.protobuf.descriptor.DescriptorMetaclass
def __instancecheck__ (cls, obj)
 
def __instancecheck__ (cls, obj)
 

Public Attributes

 values
 
 values_by_name
 
 values_by_number
 
- Public Attributes inherited from google.protobuf.descriptor._NestedDescriptorBase
 containing_type
 
 file
 
 full_name
 
 name
 
- Public Attributes inherited from google.protobuf.descriptor.DescriptorBase
 has_options
 

Static Private Attributes

 _C_DESCRIPTOR_CLASS = _message.EnumDescriptor
 

Detailed Description

Descriptor for an enum defined in a .proto file.

An EnumDescriptor instance has the following attributes:

  name: (str) Name of the enum type.
  full_name: (str) Full name of the type, including package name
    and any enclosing type(s).

  values: (list of EnumValueDescriptors) List of the values
    in this enum.
  values_by_name: (dict str -> EnumValueDescriptor) Same as |values|,
    but indexed by the "name" field of each EnumValueDescriptor.
  values_by_number: (dict int -> EnumValueDescriptor) Same as |values|,
    but indexed by the "number" field of each EnumValueDescriptor.
  containing_type: (Descriptor) Descriptor of the immediate containing
    type of this enum, or None if this is an enum defined at the
    top level in a .proto file.  Set by Descriptor's constructor
    if we're passed into one.
  file: (FileDescriptor) Reference to file descriptor.
  options: (descriptor_pb2.EnumOptions) Enum options message or
    None to use default enum options.
Descriptor for an enum defined in a .proto file.

Attributes:
  name (str): Name of the enum type.
  full_name (str): Full name of the type, including package name
    and any enclosing type(s).

  values (list[EnumValueDescriptors]): List of the values
    in this enum.
  values_by_name (dict(str, EnumValueDescriptor)): Same as :attr:`values`,
    but indexed by the "name" field of each EnumValueDescriptor.
  values_by_number (dict(int, EnumValueDescriptor)): Same as :attr:`values`,
    but indexed by the "number" field of each EnumValueDescriptor.
  containing_type (Descriptor): Descriptor of the immediate containing
    type of this enum, or None if this is an enum defined at the
    top level in a .proto file.  Set by Descriptor's constructor
    if we're passed into one.
  file (FileDescriptor): Reference to file descriptor.
  options (descriptor_pb2.EnumOptions): Enum options message or
    None to use default enum options.

Definition at line 607 of file bloaty/third_party/protobuf/python/google/protobuf/descriptor.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def google.protobuf.descriptor.EnumDescriptor.__init__ (   self,
  name,
  full_name,
  filename,
  values,
  containing_type = None,
  options = None,
  serialized_options = None,
  file = None,
  serialized_start = None,
  serialized_end = None 
)
Arguments are as described in the attribute description above.

Note that filename is an obsolete argument, that is not used anymore.
Please use file.name to access this as an attribute.

Definition at line 642 of file bloaty/third_party/protobuf/python/google/protobuf/descriptor.py.

◆ __init__() [2/2]

def google.protobuf.descriptor.EnumDescriptor.__init__ (   self,
  name,
  full_name,
  filename,
  values,
  containing_type = None,
  options = None,
  serialized_options = None,
  file = None,
  serialized_start = None,
  serialized_end = None,
  create_key = None 
)
Arguments are as described in the attribute description above.

Note that filename is an obsolete argument, that is not used anymore.
Please use file.name to access this as an attribute.

Definition at line 675 of file protobuf/python/google/protobuf/descriptor.py.

Member Function Documentation

◆ __new__() [1/2]

def google.protobuf.descriptor.EnumDescriptor.__new__ (   cls,
  name,
  full_name,
  filename,
  values,
  containing_type = None,
  options = None,
  serialized_options = None,
  file = None,
  serialized_start = None,
  serialized_end = None 
)

◆ __new__() [2/2]

def google.protobuf.descriptor.EnumDescriptor.__new__ (   cls,
  name,
  full_name,
  filename,
  values,
  containing_type = None,
  options = None,
  serialized_options = None,
  file = None,
  serialized_start = None,
  serialized_end = None,
  create_key = None 
)

◆ CopyToProto() [1/2]

def google.protobuf.descriptor.EnumDescriptor.CopyToProto (   self,
  proto 
)
Copies this to a descriptor_pb2.EnumDescriptorProto.

Args:
  proto: An empty descriptor_pb2.EnumDescriptorProto.

Reimplemented from google.protobuf.descriptor._NestedDescriptorBase.

Definition at line 663 of file bloaty/third_party/protobuf/python/google/protobuf/descriptor.py.

◆ CopyToProto() [2/2]

def google.protobuf.descriptor.EnumDescriptor.CopyToProto (   self,
  proto 
)
Copies this to a descriptor_pb2.EnumDescriptorProto.

Args:
  proto (descriptor_pb2.EnumDescriptorProto): An empty descriptor proto.

Reimplemented from google.protobuf.descriptor._NestedDescriptorBase.

Definition at line 699 of file protobuf/python/google/protobuf/descriptor.py.

Member Data Documentation

◆ _C_DESCRIPTOR_CLASS

google.protobuf.descriptor.EnumDescriptor._C_DESCRIPTOR_CLASS = _message.EnumDescriptor
staticprivate

◆ values

google.protobuf.descriptor.EnumDescriptor.values

◆ values_by_name

google.protobuf.descriptor.EnumDescriptor.values_by_name

◆ values_by_number

google.protobuf.descriptor.EnumDescriptor.values_by_number

The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:23