1
1
from typing import Any
2
2
3
3
from .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
+ )
4
14
5
15
class Error (Exception ): ...
6
16
class TypeTransformationError (Error ): ...
@@ -42,6 +52,7 @@ class Descriptor(_NestedDescriptorBase):
42
52
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 : ...
43
53
def EnumValueName (self , enum , value ): ...
44
54
def CopyToProto (self , proto ): ...
55
+ def GetOptions (self ) -> MessageOptions : ...
45
56
46
57
class FieldDescriptor (DescriptorBase ):
47
58
TYPE_DOUBLE = ... # type: Any
@@ -100,6 +111,7 @@ class FieldDescriptor(DescriptorBase):
100
111
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 : ...
101
112
@staticmethod
102
113
def ProtoTypeToCppProtoType (proto_type ): ...
114
+ def GetOptions (self ) -> FieldOptions : ...
103
115
104
116
class EnumDescriptor (_NestedDescriptorBase ):
105
117
def __new__ (cls , name , full_name , filename , values , containing_type = ..., options = ..., file = ..., serialized_start = ..., serialized_end = ...): ...
@@ -108,6 +120,7 @@ class EnumDescriptor(_NestedDescriptorBase):
108
120
values_by_number = ... # type: Any
109
121
def __init__ (self , name , full_name , filename , values , containing_type = ..., options = ..., file = ..., serialized_start = ..., serialized_end = ...) -> None : ...
110
122
def CopyToProto (self , proto ): ...
123
+ def GetOptions (self ) -> EnumOptions : ...
111
124
112
125
class EnumValueDescriptor (DescriptorBase ):
113
126
def __new__ (cls , name , index , number , type = ..., options = ...): ...
@@ -116,6 +129,7 @@ class EnumValueDescriptor(DescriptorBase):
116
129
number = ... # type: Any
117
130
type = ... # type: Any
118
131
def __init__ (self , name , index , number , type = ..., options = ...) -> None : ...
132
+ def GetOptions (self ) -> EnumValueOptions : ...
119
133
120
134
class OneofDescriptor :
121
135
def __new__ (cls , name , full_name , index , containing_type , fields ): ...
@@ -125,6 +139,7 @@ class OneofDescriptor:
125
139
containing_type = ... # type: Any
126
140
fields = ... # type: Any
127
141
def __init__ (self , name , full_name , index , containing_type , fields ) -> None : ...
142
+ def GetOptions (self ) -> OneofOptions : ...
128
143
129
144
class ServiceDescriptor (_NestedDescriptorBase ):
130
145
index = ... # type: Any
@@ -133,6 +148,7 @@ class ServiceDescriptor(_NestedDescriptorBase):
133
148
def __init__ (self , name , full_name , index , methods , options = ..., file = ..., serialized_start = ..., serialized_end = ...) -> None : ...
134
149
def FindMethodByName (self , name ): ...
135
150
def CopyToProto (self , proto ): ...
151
+ def GetOptions (self ) -> ServiceOptions : ...
136
152
137
153
class MethodDescriptor (DescriptorBase ):
138
154
name = ... # type: Any
@@ -142,6 +158,7 @@ class MethodDescriptor(DescriptorBase):
142
158
input_type = ... # type: Any
143
159
output_type = ... # type: Any
144
160
def __init__ (self , name , full_name , index , containing_service , input_type , output_type , options = ...) -> None : ...
161
+ def GetOptions (self ) -> MethodOptions : ...
145
162
146
163
class FileDescriptor (DescriptorBase ):
147
164
def __new__ (cls , name , package , options = ..., serialized_pb = ..., dependencies = ..., public_dependencies = ..., syntax = ..., pool = ...): ...
@@ -159,6 +176,7 @@ class FileDescriptor(DescriptorBase):
159
176
public_dependencies = ... # type: Any
160
177
def __init__ (self , name , package , options = ..., serialized_pb = ..., dependencies = ..., public_dependencies = ..., syntax = ..., pool = ...) -> None : ...
161
178
def CopyToProto (self , proto ): ...
179
+ def GetOptions (self ) -> FileOptions : ...
162
180
163
181
def MakeDescriptor (desc_proto , package = ..., build_file_if_cpp = ..., syntax = ...): ...
164
182
def _ParseOptions (message : Message , string : bytes ) -> Message : ...
0 commit comments