11from typing import Any
22
33from .message import Message
4+ from .descriptor_pb2 import (
5+ EnumOptions ,
6+ EnumValueOptions ,
7+ FieldOptions ,
8+ FileOptions ,
9+ MessageOptions ,
10+ MethodOptions ,
11+ OneofOptions ,
12+ ServiceOptions ,
13+ )
414
515class Error (Exception ): ...
616class TypeTransformationError (Error ): ...
@@ -42,6 +52,7 @@ class Descriptor(_NestedDescriptorBase):
4252 def __init__ (self , name , full_name , filename , containing_type , fields , nested_types , enum_types , extensions , options = ..., is_extendable = ..., extension_ranges = ..., oneofs = ..., file = ..., serialized_start = ..., serialized_end = ..., syntax = ...) -> None : ...
4353 def EnumValueName (self , enum , value ): ...
4454 def CopyToProto (self , proto ): ...
55+ def GetOptions (self ) -> MessageOptions : ...
4556
4657class FieldDescriptor (DescriptorBase ):
4758 TYPE_DOUBLE = ... # type: Any
@@ -100,6 +111,7 @@ class FieldDescriptor(DescriptorBase):
100111 def __init__ (self , name , full_name , index , number , type , cpp_type , label , default_value , message_type , enum_type , containing_type , is_extension , extension_scope , options = ..., file = ..., has_default_value = ..., containing_oneof = ...) -> None : ...
101112 @staticmethod
102113 def ProtoTypeToCppProtoType (proto_type ): ...
114+ def GetOptions (self ) -> FieldOptions : ...
103115
104116class EnumDescriptor (_NestedDescriptorBase ):
105117 def __new__ (cls , name , full_name , filename , values , containing_type = ..., options = ..., file = ..., serialized_start = ..., serialized_end = ...): ...
@@ -108,6 +120,7 @@ class EnumDescriptor(_NestedDescriptorBase):
108120 values_by_number = ... # type: Any
109121 def __init__ (self , name , full_name , filename , values , containing_type = ..., options = ..., file = ..., serialized_start = ..., serialized_end = ...) -> None : ...
110122 def CopyToProto (self , proto ): ...
123+ def GetOptions (self ) -> EnumOptions : ...
111124
112125class EnumValueDescriptor (DescriptorBase ):
113126 def __new__ (cls , name , index , number , type = ..., options = ...): ...
@@ -116,6 +129,7 @@ class EnumValueDescriptor(DescriptorBase):
116129 number = ... # type: Any
117130 type = ... # type: Any
118131 def __init__ (self , name , index , number , type = ..., options = ...) -> None : ...
132+ def GetOptions (self ) -> EnumValueOptions : ...
119133
120134class OneofDescriptor :
121135 def __new__ (cls , name , full_name , index , containing_type , fields ): ...
@@ -125,6 +139,7 @@ class OneofDescriptor:
125139 containing_type = ... # type: Any
126140 fields = ... # type: Any
127141 def __init__ (self , name , full_name , index , containing_type , fields ) -> None : ...
142+ def GetOptions (self ) -> OneofOptions : ...
128143
129144class ServiceDescriptor (_NestedDescriptorBase ):
130145 index = ... # type: Any
@@ -133,6 +148,7 @@ class ServiceDescriptor(_NestedDescriptorBase):
133148 def __init__ (self , name , full_name , index , methods , options = ..., file = ..., serialized_start = ..., serialized_end = ...) -> None : ...
134149 def FindMethodByName (self , name ): ...
135150 def CopyToProto (self , proto ): ...
151+ def GetOptions (self ) -> ServiceOptions : ...
136152
137153class MethodDescriptor (DescriptorBase ):
138154 name = ... # type: Any
@@ -142,6 +158,7 @@ class MethodDescriptor(DescriptorBase):
142158 input_type = ... # type: Any
143159 output_type = ... # type: Any
144160 def __init__ (self , name , full_name , index , containing_service , input_type , output_type , options = ...) -> None : ...
161+ def GetOptions (self ) -> MethodOptions : ...
145162
146163class FileDescriptor (DescriptorBase ):
147164 def __new__ (cls , name , package , options = ..., serialized_pb = ..., dependencies = ..., public_dependencies = ..., syntax = ..., pool = ...): ...
@@ -159,6 +176,7 @@ class FileDescriptor(DescriptorBase):
159176 public_dependencies = ... # type: Any
160177 def __init__ (self , name , package , options = ..., serialized_pb = ..., dependencies = ..., public_dependencies = ..., syntax = ..., pool = ...) -> None : ...
161178 def CopyToProto (self , proto ): ...
179+ def GetOptions (self ) -> FileOptions : ...
162180
163181def MakeDescriptor (desc_proto , package = ..., build_file_if_cpp = ..., syntax = ...): ...
164182def _ParseOptions (message : Message , string : bytes ) -> Message : ...
0 commit comments