protobuf: Fix inadvertently deleted annotations. (#3364)

* protobuf: Fix inadvertantly deleted annotations.

* Run black on protobuf.
This commit is contained in:
Benjamin Peterson
2019-10-14 13:41:58 -07:00
committed by Jelle Zijlstra
parent 7e99848b2c
commit add16d2715
35 changed files with 2082 additions and 4037 deletions

View File

@@ -1,20 +1,9 @@
from google.protobuf.message import (
Message,
)
from google.protobuf.message import Message
from google.protobuf.internal import well_known_types
from typing import (
Optional,
Text,
)
from typing import Optional, Text
class Any(Message, well_known_types.Any_):
type_url: Text
value: bytes
def __init__(self,
type_url: Optional[Text] = ...,
value: Optional[bytes] = ...,
) -> None: ...
def __init__(self, type_url: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ...

View File

@@ -1,30 +1,14 @@
from google.protobuf.any_pb2 import (
Any,
)
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
)
from google.protobuf.message import (
Message,
)
from typing import (
Iterable,
Optional,
)
from google.protobuf.any_pb2 import Any
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from typing import Iterable, Optional
class TestAny(Message):
int32_value: int
@property
def any_value(self) -> Any: ...
@property
def repeated_any_value(self) -> RepeatedCompositeFieldContainer[Any]: ...
def __init__(self,
int32_value: Optional[int] = ...,
any_value: Optional[Any] = ...,
repeated_any_value: Optional[Iterable[Any]] = ...,
) -> None: ...
def __init__(
self, int32_value: Optional[int] = ..., any_value: Optional[Any] = ..., repeated_any_value: Optional[Iterable[Any]] = ...
) -> None: ...

View File

@@ -1,51 +1,31 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.source_context_pb2 import (
SourceContext,
)
from google.protobuf.type_pb2 import (
Option,
Syntax,
)
from typing import (
Iterable,
Optional,
Text,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from google.protobuf.source_context_pb2 import SourceContext
from google.protobuf.type_pb2 import Option, Syntax
from typing import Iterable, Optional, Text
class Api(Message):
name: Text
version: Text
syntax: Syntax
@property
def methods(self) -> RepeatedCompositeFieldContainer[Method]: ...
@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
@property
def source_context(self) -> SourceContext: ...
@property
def mixins(self) -> RepeatedCompositeFieldContainer[Mixin]: ...
def __init__(self,
name: Optional[Text] = ...,
methods: Optional[Iterable[Method]] = ...,
options: Optional[Iterable[Option]] = ...,
version: Optional[Text] = ...,
source_context: Optional[SourceContext] = ...,
mixins: Optional[Iterable[Mixin]] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
methods: Optional[Iterable[Method]] = ...,
options: Optional[Iterable[Option]] = ...,
version: Optional[Text] = ...,
source_context: Optional[SourceContext] = ...,
mixins: Optional[Iterable[Mixin]] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
class Method(Message):
name: Text
@@ -54,26 +34,20 @@ class Method(Message):
response_type_url: Text
response_streaming: bool
syntax: Syntax
@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
def __init__(self,
name: Optional[Text] = ...,
request_type_url: Optional[Text] = ...,
request_streaming: Optional[bool] = ...,
response_type_url: Optional[Text] = ...,
response_streaming: Optional[bool] = ...,
options: Optional[Iterable[Option]] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
request_type_url: Optional[Text] = ...,
request_streaming: Optional[bool] = ...,
response_type_url: Optional[Text] = ...,
response_streaming: Optional[bool] = ...,
options: Optional[Iterable[Option]] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
class Mixin(Message):
name: Text
root: Text
def __init__(self,
name: Optional[Text] = ...,
root: Optional[Text] = ...,
) -> None: ...
def __init__(self, name: Optional[Text] = ..., root: Optional[Text] = ...) -> None: ...

View File

@@ -1,70 +1,41 @@
from google.protobuf.descriptor_pb2 import (
FileDescriptorProto,
)
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from typing import (
Iterable,
Optional,
Text,
)
from google.protobuf.descriptor_pb2 import FileDescriptorProto
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from typing import Iterable, Optional, Text
class Version(Message):
major: int
minor: int
patch: int
suffix: Text
def __init__(self,
major: Optional[int] = ...,
minor: Optional[int] = ...,
patch: Optional[int] = ...,
suffix: Optional[Text] = ...,
) -> None: ...
def __init__(
self, major: Optional[int] = ..., minor: Optional[int] = ..., patch: Optional[int] = ..., suffix: Optional[Text] = ...
) -> None: ...
class CodeGeneratorRequest(Message):
file_to_generate: RepeatedScalarFieldContainer[Text]
parameter: Text
@property
def proto_file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ...
@property
def compiler_version(self) -> Version: ...
def __init__(self,
file_to_generate: Optional[Iterable[Text]] = ...,
parameter: Optional[Text] = ...,
proto_file: Optional[Iterable[FileDescriptorProto]] = ...,
compiler_version: Optional[Version] = ...,
) -> None: ...
def __init__(
self,
file_to_generate: Optional[Iterable[Text]] = ...,
parameter: Optional[Text] = ...,
proto_file: Optional[Iterable[FileDescriptorProto]] = ...,
compiler_version: Optional[Version] = ...,
) -> None: ...
class CodeGeneratorResponse(Message):
class File(Message):
name: Text
insertion_point: Text
content: Text
def __init__(self,
name: Optional[Text] = ...,
insertion_point: Optional[Text] = ...,
content: Optional[Text] = ...,
) -> None: ...
def __init__(
self, name: Optional[Text] = ..., insertion_point: Optional[Text] = ..., content: Optional[Text] = ...
) -> None: ...
error: Text
@property
def file(self) -> RepeatedCompositeFieldContainer[CodeGeneratorResponse.File]: ...
def __init__(self,
error: Optional[Text] = ...,
file: Optional[Iterable[CodeGeneratorResponse.File]] = ...,
) -> None: ...
def __init__(self, error: Optional[Text] = ..., file: Optional[Iterable[CodeGeneratorResponse.File]] = ...) -> None: ...

View File

@@ -28,12 +28,32 @@ class _NestedDescriptorBase(DescriptorBase):
full_name: Any
file: Any
containing_type: Any
def __init__(self, options, options_class_name, name, full_name, file, containing_type, serialized_start=..., serialized_end=...) -> None: ...
def __init__(
self, options, options_class_name, name, full_name, file, containing_type, serialized_start=..., serialized_end=...
) -> None: ...
def GetTopLevelContainingType(self): ...
def CopyToProto(self, proto): ...
class Descriptor(_NestedDescriptorBase):
def __new__(cls, name, full_name, filename, containing_type, fields, nested_types, enum_types, extensions, options=..., is_extendable=..., extension_ranges=..., oneofs=..., file=..., serialized_start=..., serialized_end=..., syntax=...): ...
def __new__(
cls,
name,
full_name,
filename,
containing_type,
fields,
nested_types,
enum_types,
extensions,
options=...,
is_extendable=...,
extension_ranges=...,
oneofs=...,
file=...,
serialized_start=...,
serialized_end=...,
syntax=...,
): ...
fields: Any
fields_by_number: Any
fields_by_name: Any
@@ -49,7 +69,25 @@ class Descriptor(_NestedDescriptorBase):
oneofs: Any
oneofs_by_name: Any
syntax: Any
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: ...
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: ...
def EnumValueName(self, enum, value): ...
def CopyToProto(self, proto): ...
def GetOptions(self) -> MessageOptions: ...
@@ -92,7 +130,26 @@ class FieldDescriptor(DescriptorBase):
MAX_FIELD_NUMBER: Any
FIRST_RESERVED_FIELD_NUMBER: Any
LAST_RESERVED_FIELD_NUMBER: Any
def __new__(cls, 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=...): ...
def __new__(
cls,
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=...,
): ...
name: Any
full_name: Any
index: Any
@@ -108,17 +165,58 @@ class FieldDescriptor(DescriptorBase):
is_extension: Any
extension_scope: Any
containing_oneof: Any
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: ...
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: ...
@staticmethod
def ProtoTypeToCppProtoType(proto_type): ...
def GetOptions(self) -> FieldOptions: ...
class EnumDescriptor(_NestedDescriptorBase):
def __new__(cls, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...): ...
def __new__(
cls,
name,
full_name,
filename,
values,
containing_type=...,
options=...,
file=...,
serialized_start=...,
serialized_end=...,
): ...
values: Any
values_by_name: Any
values_by_number: Any
def __init__(self, name, full_name, filename, values, containing_type=..., options=..., file=..., serialized_start=..., serialized_end=...) -> None: ...
def __init__(
self,
name,
full_name,
filename,
values,
containing_type=...,
options=...,
file=...,
serialized_start=...,
serialized_end=...,
) -> None: ...
def CopyToProto(self, proto): ...
def GetOptions(self) -> EnumOptions: ...
@@ -145,7 +243,9 @@ class ServiceDescriptor(_NestedDescriptorBase):
index: Any
methods: Any
methods_by_name: Any
def __init__(self, name, full_name, index, methods, options=..., file=..., serialized_start=..., serialized_end=...) -> None: ...
def __init__(
self, name, full_name, index, methods, options=..., file=..., serialized_start=..., serialized_end=...
) -> None: ...
def FindMethodByName(self, name): ...
def CopyToProto(self, proto): ...
def GetOptions(self) -> ServiceOptions: ...
@@ -161,7 +261,9 @@ class MethodDescriptor(DescriptorBase):
def GetOptions(self) -> MethodOptions: ...
class FileDescriptor(DescriptorBase):
def __new__(cls, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...): ...
def __new__(
cls, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...
): ...
_options: Any
pool: Any
message_types_by_name: Any
@@ -174,7 +276,9 @@ class FileDescriptor(DescriptorBase):
services_by_name: Any
dependencies: Any
public_dependencies: Any
def __init__(self, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...) -> None: ...
def __init__(
self, name, package, options=..., serialized_pb=..., dependencies=..., public_dependencies=..., syntax=..., pool=...
) -> None: ...
def CopyToProto(self, proto): ...
def GetOptions(self) -> FileOptions: ...

View File

@@ -1,30 +1,11 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from typing import (
Iterable,
List,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from typing import Iterable, List, Optional, Text, Tuple, cast
class FileDescriptorSet(Message):
@property
def file(self) -> RepeatedCompositeFieldContainer[FileDescriptorProto]: ...
def __init__(self,
file: Optional[Iterable[FileDescriptorProto]] = ...,
) -> None: ...
def __init__(self, file: Optional[Iterable[FileDescriptorProto]] = ...) -> None: ...
class FileDescriptorProto(Message):
name: Text
@@ -33,141 +14,94 @@ class FileDescriptorProto(Message):
public_dependency: RepeatedScalarFieldContainer[int]
weak_dependency: RepeatedScalarFieldContainer[int]
syntax: Text
@property
def message_type(
self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ...
def message_type(self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ...
@property
def enum_type(
self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ...
def enum_type(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ...
@property
def service(
self) -> RepeatedCompositeFieldContainer[ServiceDescriptorProto]: ...
def service(self) -> RepeatedCompositeFieldContainer[ServiceDescriptorProto]: ...
@property
def extension(
self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ...
def extension(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ...
@property
def options(self) -> FileOptions: ...
@property
def source_code_info(self) -> SourceCodeInfo: ...
def __init__(self,
name: Optional[Text] = ...,
package: Optional[Text] = ...,
dependency: Optional[Iterable[Text]] = ...,
public_dependency: Optional[Iterable[int]] = ...,
weak_dependency: Optional[Iterable[int]] = ...,
message_type: Optional[Iterable[DescriptorProto]] = ...,
enum_type: Optional[Iterable[EnumDescriptorProto]] = ...,
service: Optional[Iterable[ServiceDescriptorProto]] = ...,
extension: Optional[Iterable[FieldDescriptorProto]] = ...,
options: Optional[FileOptions] = ...,
source_code_info: Optional[SourceCodeInfo] = ...,
syntax: Optional[Text] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
package: Optional[Text] = ...,
dependency: Optional[Iterable[Text]] = ...,
public_dependency: Optional[Iterable[int]] = ...,
weak_dependency: Optional[Iterable[int]] = ...,
message_type: Optional[Iterable[DescriptorProto]] = ...,
enum_type: Optional[Iterable[EnumDescriptorProto]] = ...,
service: Optional[Iterable[ServiceDescriptorProto]] = ...,
extension: Optional[Iterable[FieldDescriptorProto]] = ...,
options: Optional[FileOptions] = ...,
source_code_info: Optional[SourceCodeInfo] = ...,
syntax: Optional[Text] = ...,
) -> None: ...
class DescriptorProto(Message):
class ExtensionRange(Message):
start: int
end: int
@property
def options(self) -> ExtensionRangeOptions: ...
def __init__(self,
start: Optional[int] = ...,
end: Optional[int] = ...,
options: Optional[ExtensionRangeOptions] = ...,
) -> None: ...
def __init__(
self, start: Optional[int] = ..., end: Optional[int] = ..., options: Optional[ExtensionRangeOptions] = ...
) -> None: ...
class ReservedRange(Message):
start: int
end: int
def __init__(self,
start: Optional[int] = ...,
end: Optional[int] = ...,
) -> None: ...
def __init__(self, start: Optional[int] = ..., end: Optional[int] = ...) -> None: ...
name: Text
reserved_name: RepeatedScalarFieldContainer[Text]
@property
def field(
self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ...
def field(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ...
@property
def extension(
self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ...
def extension(self) -> RepeatedCompositeFieldContainer[FieldDescriptorProto]: ...
@property
def nested_type(
self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ...
def nested_type(self) -> RepeatedCompositeFieldContainer[DescriptorProto]: ...
@property
def enum_type(
self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ...
def enum_type(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto]: ...
@property
def extension_range(
self) -> RepeatedCompositeFieldContainer[DescriptorProto.ExtensionRange]: ...
def extension_range(self) -> RepeatedCompositeFieldContainer[DescriptorProto.ExtensionRange]: ...
@property
def oneof_decl(
self) -> RepeatedCompositeFieldContainer[OneofDescriptorProto]: ...
def oneof_decl(self) -> RepeatedCompositeFieldContainer[OneofDescriptorProto]: ...
@property
def options(self) -> MessageOptions: ...
@property
def reserved_range(
self) -> RepeatedCompositeFieldContainer[DescriptorProto.ReservedRange]: ...
def __init__(self,
name: Optional[Text] = ...,
field: Optional[Iterable[FieldDescriptorProto]] = ...,
extension: Optional[Iterable[FieldDescriptorProto]] = ...,
nested_type: Optional[Iterable[DescriptorProto]] = ...,
enum_type: Optional[Iterable[EnumDescriptorProto]] = ...,
extension_range: Optional[Iterable[DescriptorProto.ExtensionRange]] = ...,
oneof_decl: Optional[Iterable[OneofDescriptorProto]] = ...,
options: Optional[MessageOptions] = ...,
reserved_range: Optional[Iterable[DescriptorProto.ReservedRange]] = ...,
reserved_name: Optional[Iterable[Text]] = ...,
) -> None: ...
def reserved_range(self) -> RepeatedCompositeFieldContainer[DescriptorProto.ReservedRange]: ...
def __init__(
self,
name: Optional[Text] = ...,
field: Optional[Iterable[FieldDescriptorProto]] = ...,
extension: Optional[Iterable[FieldDescriptorProto]] = ...,
nested_type: Optional[Iterable[DescriptorProto]] = ...,
enum_type: Optional[Iterable[EnumDescriptorProto]] = ...,
extension_range: Optional[Iterable[DescriptorProto.ExtensionRange]] = ...,
oneof_decl: Optional[Iterable[OneofDescriptorProto]] = ...,
options: Optional[MessageOptions] = ...,
reserved_range: Optional[Iterable[DescriptorProto.ReservedRange]] = ...,
reserved_name: Optional[Iterable[Text]] = ...,
) -> None: ...
class ExtensionRangeOptions(Message):
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self, uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...) -> None: ...
class FieldDescriptorProto(Message):
class Type(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> FieldDescriptorProto.Type: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[FieldDescriptorProto.Type]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Type]]: ...
TYPE_DOUBLE: FieldDescriptorProto.Type
@@ -188,21 +122,15 @@ class FieldDescriptorProto(Message):
TYPE_SFIXED64: FieldDescriptorProto.Type
TYPE_SINT32: FieldDescriptorProto.Type
TYPE_SINT64: FieldDescriptorProto.Type
class Label(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> FieldDescriptorProto.Label: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[FieldDescriptorProto.Label]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, FieldDescriptorProto.Label]]: ...
LABEL_OPTIONAL: FieldDescriptorProto.Label
@@ -217,97 +145,71 @@ class FieldDescriptorProto(Message):
default_value: Text
oneof_index: int
json_name: Text
@property
def options(self) -> FieldOptions: ...
def __init__(self,
name: Optional[Text] = ...,
number: Optional[int] = ...,
label: Optional[FieldDescriptorProto.Label] = ...,
type: Optional[FieldDescriptorProto.Type] = ...,
type_name: Optional[Text] = ...,
extendee: Optional[Text] = ...,
default_value: Optional[Text] = ...,
oneof_index: Optional[int] = ...,
json_name: Optional[Text] = ...,
options: Optional[FieldOptions] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
number: Optional[int] = ...,
label: Optional[FieldDescriptorProto.Label] = ...,
type: Optional[FieldDescriptorProto.Type] = ...,
type_name: Optional[Text] = ...,
extendee: Optional[Text] = ...,
default_value: Optional[Text] = ...,
oneof_index: Optional[int] = ...,
json_name: Optional[Text] = ...,
options: Optional[FieldOptions] = ...,
) -> None: ...
class OneofDescriptorProto(Message):
name: Text
@property
def options(self) -> OneofOptions: ...
def __init__(self,
name: Optional[Text] = ...,
options: Optional[OneofOptions] = ...,
) -> None: ...
def __init__(self, name: Optional[Text] = ..., options: Optional[OneofOptions] = ...) -> None: ...
class EnumDescriptorProto(Message):
class EnumReservedRange(Message):
start: int
end: int
def __init__(self,
start: Optional[int] = ...,
end: Optional[int] = ...,
) -> None: ...
def __init__(self, start: Optional[int] = ..., end: Optional[int] = ...) -> None: ...
name: Text
reserved_name: RepeatedScalarFieldContainer[Text]
@property
def value(
self) -> RepeatedCompositeFieldContainer[EnumValueDescriptorProto]: ...
def value(self) -> RepeatedCompositeFieldContainer[EnumValueDescriptorProto]: ...
@property
def options(self) -> EnumOptions: ...
@property
def reserved_range(
self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto.EnumReservedRange]: ...
def __init__(self,
name: Optional[Text] = ...,
value: Optional[Iterable[EnumValueDescriptorProto]] = ...,
options: Optional[EnumOptions] = ...,
reserved_range: Optional[Iterable[EnumDescriptorProto.EnumReservedRange]] = ...,
reserved_name: Optional[Iterable[Text]] = ...,
) -> None: ...
def reserved_range(self) -> RepeatedCompositeFieldContainer[EnumDescriptorProto.EnumReservedRange]: ...
def __init__(
self,
name: Optional[Text] = ...,
value: Optional[Iterable[EnumValueDescriptorProto]] = ...,
options: Optional[EnumOptions] = ...,
reserved_range: Optional[Iterable[EnumDescriptorProto.EnumReservedRange]] = ...,
reserved_name: Optional[Iterable[Text]] = ...,
) -> None: ...
class EnumValueDescriptorProto(Message):
name: Text
number: int
@property
def options(self) -> EnumValueOptions: ...
def __init__(self,
name: Optional[Text] = ...,
number: Optional[int] = ...,
options: Optional[EnumValueOptions] = ...,
) -> None: ...
def __init__(
self, name: Optional[Text] = ..., number: Optional[int] = ..., options: Optional[EnumValueOptions] = ...
) -> None: ...
class ServiceDescriptorProto(Message):
name: Text
@property
def method(
self) -> RepeatedCompositeFieldContainer[MethodDescriptorProto]: ...
def method(self) -> RepeatedCompositeFieldContainer[MethodDescriptorProto]: ...
@property
def options(self) -> ServiceOptions: ...
def __init__(self,
name: Optional[Text] = ...,
method: Optional[Iterable[MethodDescriptorProto]] = ...,
options: Optional[ServiceOptions] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
method: Optional[Iterable[MethodDescriptorProto]] = ...,
options: Optional[ServiceOptions] = ...,
) -> None: ...
class MethodDescriptorProto(Message):
name: Text
@@ -315,36 +217,28 @@ class MethodDescriptorProto(Message):
output_type: Text
client_streaming: bool
server_streaming: bool
@property
def options(self) -> MethodOptions: ...
def __init__(self,
name: Optional[Text] = ...,
input_type: Optional[Text] = ...,
output_type: Optional[Text] = ...,
options: Optional[MethodOptions] = ...,
client_streaming: Optional[bool] = ...,
server_streaming: Optional[bool] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
input_type: Optional[Text] = ...,
output_type: Optional[Text] = ...,
options: Optional[MethodOptions] = ...,
client_streaming: Optional[bool] = ...,
server_streaming: Optional[bool] = ...,
) -> None: ...
class FileOptions(Message):
class OptimizeMode(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> FileOptions.OptimizeMode: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[FileOptions.OptimizeMode]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, FileOptions.OptimizeMode]]: ...
SPEED: FileOptions.OptimizeMode
@@ -368,89 +262,71 @@ class FileOptions(Message):
swift_prefix: Text
php_class_prefix: Text
php_namespace: Text
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
java_package: Optional[Text] = ...,
java_outer_classname: Optional[Text] = ...,
java_multiple_files: Optional[bool] = ...,
java_generate_equals_and_hash: Optional[bool] = ...,
java_string_check_utf8: Optional[bool] = ...,
optimize_for: Optional[FileOptions.OptimizeMode] = ...,
go_package: Optional[Text] = ...,
cc_generic_services: Optional[bool] = ...,
java_generic_services: Optional[bool] = ...,
py_generic_services: Optional[bool] = ...,
php_generic_services: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
cc_enable_arenas: Optional[bool] = ...,
objc_class_prefix: Optional[Text] = ...,
csharp_namespace: Optional[Text] = ...,
swift_prefix: Optional[Text] = ...,
php_class_prefix: Optional[Text] = ...,
php_namespace: Optional[Text] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(
self,
java_package: Optional[Text] = ...,
java_outer_classname: Optional[Text] = ...,
java_multiple_files: Optional[bool] = ...,
java_generate_equals_and_hash: Optional[bool] = ...,
java_string_check_utf8: Optional[bool] = ...,
optimize_for: Optional[FileOptions.OptimizeMode] = ...,
go_package: Optional[Text] = ...,
cc_generic_services: Optional[bool] = ...,
java_generic_services: Optional[bool] = ...,
py_generic_services: Optional[bool] = ...,
php_generic_services: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
cc_enable_arenas: Optional[bool] = ...,
objc_class_prefix: Optional[Text] = ...,
csharp_namespace: Optional[Text] = ...,
swift_prefix: Optional[Text] = ...,
php_class_prefix: Optional[Text] = ...,
php_namespace: Optional[Text] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
class MessageOptions(Message):
message_set_wire_format: bool
no_standard_descriptor_accessor: bool
deprecated: bool
map_entry: bool
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
message_set_wire_format: Optional[bool] = ...,
no_standard_descriptor_accessor: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
map_entry: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(
self,
message_set_wire_format: Optional[bool] = ...,
no_standard_descriptor_accessor: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
map_entry: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
class FieldOptions(Message):
class CType(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> FieldOptions.CType: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[FieldOptions.CType]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, FieldOptions.CType]]: ...
STRING: FieldOptions.CType
CORD: FieldOptions.CType
STRING_PIECE: FieldOptions.CType
class JSType(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> FieldOptions.JSType: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[FieldOptions.JSType]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, FieldOptions.JSType]]: ...
JS_NORMAL: FieldOptions.JSType
@@ -462,90 +338,62 @@ class FieldOptions(Message):
lazy: bool
deprecated: bool
weak: bool
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
ctype: Optional[FieldOptions.CType] = ...,
packed: Optional[bool] = ...,
jstype: Optional[FieldOptions.JSType] = ...,
lazy: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
weak: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(
self,
ctype: Optional[FieldOptions.CType] = ...,
packed: Optional[bool] = ...,
jstype: Optional[FieldOptions.JSType] = ...,
lazy: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
weak: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
class OneofOptions(Message):
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self, uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...) -> None: ...
class EnumOptions(Message):
allow_alias: bool
deprecated: bool
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
allow_alias: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(
self,
allow_alias: Optional[bool] = ...,
deprecated: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
class EnumValueOptions(Message):
deprecated: bool
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
deprecated: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(
self, deprecated: Optional[bool] = ..., uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...
) -> None: ...
class ServiceOptions(Message):
deprecated: bool
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
deprecated: Optional[bool] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(
self, deprecated: Optional[bool] = ..., uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...
) -> None: ...
class MethodOptions(Message):
class IdempotencyLevel(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> MethodOptions.IdempotencyLevel: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[MethodOptions.IdempotencyLevel]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, MethodOptions.IdempotencyLevel]]: ...
IDEMPOTENCY_UNKNOWN: MethodOptions.IdempotencyLevel
@@ -553,89 +401,71 @@ class MethodOptions(Message):
IDEMPOTENT: MethodOptions.IdempotencyLevel
deprecated: bool
idempotency_level: MethodOptions.IdempotencyLevel
@property
def uninterpreted_option(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(self,
deprecated: Optional[bool] = ...,
idempotency_level: Optional[MethodOptions.IdempotencyLevel] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
def uninterpreted_option(self) -> RepeatedCompositeFieldContainer[UninterpretedOption]: ...
def __init__(
self,
deprecated: Optional[bool] = ...,
idempotency_level: Optional[MethodOptions.IdempotencyLevel] = ...,
uninterpreted_option: Optional[Iterable[UninterpretedOption]] = ...,
) -> None: ...
class UninterpretedOption(Message):
class NamePart(Message):
name_part: Text
is_extension: bool
def __init__(self,
name_part: Text,
is_extension: bool,
) -> None: ...
def __init__(self, name_part: Text, is_extension: bool) -> None: ...
identifier_value: Text
positive_int_value: int
negative_int_value: int
double_value: float
string_value: bytes
aggregate_value: Text
@property
def name(
self) -> RepeatedCompositeFieldContainer[UninterpretedOption.NamePart]: ...
def __init__(self,
name: Optional[Iterable[UninterpretedOption.NamePart]] = ...,
identifier_value: Optional[Text] = ...,
positive_int_value: Optional[int] = ...,
negative_int_value: Optional[int] = ...,
double_value: Optional[float] = ...,
string_value: Optional[bytes] = ...,
aggregate_value: Optional[Text] = ...,
) -> None: ...
def name(self) -> RepeatedCompositeFieldContainer[UninterpretedOption.NamePart]: ...
def __init__(
self,
name: Optional[Iterable[UninterpretedOption.NamePart]] = ...,
identifier_value: Optional[Text] = ...,
positive_int_value: Optional[int] = ...,
negative_int_value: Optional[int] = ...,
double_value: Optional[float] = ...,
string_value: Optional[bytes] = ...,
aggregate_value: Optional[Text] = ...,
) -> None: ...
class SourceCodeInfo(Message):
class Location(Message):
path: RepeatedScalarFieldContainer[int]
span: RepeatedScalarFieldContainer[int]
leading_comments: Text
trailing_comments: Text
leading_detached_comments: RepeatedScalarFieldContainer[Text]
def __init__(self,
path: Optional[Iterable[int]] = ...,
span: Optional[Iterable[int]] = ...,
leading_comments: Optional[Text] = ...,
trailing_comments: Optional[Text] = ...,
leading_detached_comments: Optional[Iterable[Text]] = ...,
) -> None: ...
def __init__(
self,
path: Optional[Iterable[int]] = ...,
span: Optional[Iterable[int]] = ...,
leading_comments: Optional[Text] = ...,
trailing_comments: Optional[Text] = ...,
leading_detached_comments: Optional[Iterable[Text]] = ...,
) -> None: ...
@property
def location(
self) -> RepeatedCompositeFieldContainer[SourceCodeInfo.Location]: ...
def __init__(self,
location: Optional[Iterable[SourceCodeInfo.Location]] = ...,
) -> None: ...
def location(self) -> RepeatedCompositeFieldContainer[SourceCodeInfo.Location]: ...
def __init__(self, location: Optional[Iterable[SourceCodeInfo.Location]] = ...) -> None: ...
class GeneratedCodeInfo(Message):
class Annotation(Message):
path: RepeatedScalarFieldContainer[int]
source_file: Text
begin: int
end: int
def __init__(self,
path: Optional[Iterable[int]] = ...,
source_file: Optional[Text] = ...,
begin: Optional[int] = ...,
end: Optional[int] = ...,
) -> None: ...
def __init__(
self,
path: Optional[Iterable[int]] = ...,
source_file: Optional[Text] = ...,
begin: Optional[int] = ...,
end: Optional[int] = ...,
) -> None: ...
@property
def annotation(
self) -> RepeatedCompositeFieldContainer[GeneratedCodeInfo.Annotation]: ...
def __init__(self,
annotation: Optional[Iterable[GeneratedCodeInfo.Annotation]] = ...,
) -> None: ...
def annotation(self) -> RepeatedCompositeFieldContainer[GeneratedCodeInfo.Annotation]: ...
def __init__(self, annotation: Optional[Iterable[GeneratedCodeInfo.Annotation]] = ...) -> None: ...

View File

@@ -1,19 +1,9 @@
from google.protobuf.message import (
Message,
)
from google.protobuf.message import Message
from google.protobuf.internal import well_known_types
from typing import (
Optional,
)
from typing import Optional
class Duration(Message, well_known_types.Duration):
seconds: int
nanos: int
def __init__(self,
seconds: Optional[int] = ...,
nanos: Optional[int] = ...,
) -> None: ...
def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ...

View File

@@ -1,10 +1,4 @@
from google.protobuf.message import (
Message,
)
from google.protobuf.message import Message
class Empty(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...

View File

@@ -1,22 +1,9 @@
from google.protobuf.internal.containers import (
RepeatedScalarFieldContainer,
)
from google.protobuf.internal.containers import RepeatedScalarFieldContainer
from google.protobuf.internal import well_known_types
from google.protobuf.message import (
Message,
)
from typing import (
Iterable,
Optional,
Text,
)
from google.protobuf.message import Message
from typing import Iterable, Optional, Text
class FieldMask(Message, well_known_types.FieldMask):
paths: RepeatedScalarFieldContainer[Text]
def __init__(self,
paths: Optional[Iterable[Text]] = ...,
) -> None: ...
def __init__(self, paths: Optional[Iterable[Text]] = ...) -> None: ...

View File

@@ -1,12 +1,10 @@
from google.protobuf.descriptor import Descriptor
from google.protobuf.internal.message_listener import MessageListener
from google.protobuf.message import Message
from typing import (
Sequence, TypeVar, Generic, Any, Iterator, Iterable,
Union, Optional, Callable, overload, List
)
from typing import Sequence, TypeVar, Generic, Any, Iterator, Iterable, Union, Optional, Callable, overload, List
_T = TypeVar("_T")
_T = TypeVar('_T')
class BaseContainer(Sequence[_T]):
def __init__(self, message_listener: MessageListener) -> None: ...
def __len__(self) -> int: ...

View File

@@ -6,6 +6,5 @@ class EnumTypeWrapper(object):
def Value(self, name: bytes) -> int: ...
def keys(self) -> List[bytes]: ...
def values(self) -> List[int]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, int]]: ...

View File

@@ -55,7 +55,9 @@ class FieldMask:
def CanonicalFormFromMask(self, mask: Any) -> None: ...
def Union(self, mask1: Any, mask2: Any) -> None: ...
def Intersect(self, mask1: Any, mask2: Any) -> None: ...
def MergeMessage(self, source: Any, destination: Any, replace_message_field: bool = ..., replace_repeated_field: bool = ...) -> None: ...
def MergeMessage(
self, source: Any, destination: Any, replace_message_field: bool = ..., replace_repeated_field: bool = ...
) -> None: ...
class _FieldMaskTree:
def __init__(self, field_mask: Optional[Any] = ...) -> None: ...

View File

@@ -2,12 +2,10 @@ import sys
from typing import Any, Dict, Text, TypeVar, Union
from google.protobuf.message import Message
_MessageVar = TypeVar('_MessageVar', bound=Message)
_MessageVar = TypeVar("_MessageVar", bound=Message)
class Error(Exception): ...
class ParseError(Error): ...
class SerializeToJsonError(Error): ...
def MessageToJson(
@@ -16,16 +14,13 @@ def MessageToJson(
preserving_proto_field_name: bool = ...,
indent: int = ...,
sort_keys: bool = ...,
use_integers_for_enums: bool = ...
use_integers_for_enums: bool = ...,
) -> str: ...
def MessageToDict(
message: Message,
including_default_value_fields: bool = ...,
preserving_proto_field_name: bool = ...,
use_integers_for_enums: bool = ...
use_integers_for_enums: bool = ...,
) -> Dict[Text, Any]: ...
def Parse(text: Union[bytes, Text], message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ...
def ParseDict(js_dict: Any, message: _MessageVar, ignore_unknown_fields: bool = ...) -> _MessageVar: ...

View File

@@ -1,357 +1,198 @@
from google.protobuf.message import (
Message,
)
from google.protobuf.unittest_import_pb2 import (
ImportEnumForMap,
)
from typing import (
List,
Mapping,
MutableMapping,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.message import Message
from google.protobuf.unittest_import_pb2 import ImportEnumForMap
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast
class Proto2MapEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> Proto2MapEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[Proto2MapEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, Proto2MapEnum]]: ...
PROTO2_MAP_ENUM_FOO: Proto2MapEnum
PROTO2_MAP_ENUM_BAR: Proto2MapEnum
PROTO2_MAP_ENUM_BAZ: Proto2MapEnum
class Proto2MapEnumPlusExtra(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> Proto2MapEnumPlusExtra: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[Proto2MapEnumPlusExtra]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, Proto2MapEnumPlusExtra]]: ...
E_PROTO2_MAP_ENUM_FOO: Proto2MapEnumPlusExtra
E_PROTO2_MAP_ENUM_BAR: Proto2MapEnumPlusExtra
E_PROTO2_MAP_ENUM_BAZ: Proto2MapEnumPlusExtra
E_PROTO2_MAP_ENUM_EXTRA: Proto2MapEnumPlusExtra
class TestEnumMap(Message):
class KnownMapFieldEntry(Message):
key: int
value: Proto2MapEnum
def __init__(self,
key: Optional[int] = ...,
value: Optional[Proto2MapEnum] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnum] = ...) -> None: ...
class UnknownMapFieldEntry(Message):
key: int
value: Proto2MapEnum
def __init__(self,
key: Optional[int] = ...,
value: Optional[Proto2MapEnum] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnum] = ...) -> None: ...
@property
def known_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ...
@property
def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnum]: ...
def __init__(self,
known_map_field: Optional[Mapping[int, Proto2MapEnum]] = ...,
unknown_map_field: Optional[Mapping[int, Proto2MapEnum]] = ...,
) -> None: ...
def __init__(
self,
known_map_field: Optional[Mapping[int, Proto2MapEnum]] = ...,
unknown_map_field: Optional[Mapping[int, Proto2MapEnum]] = ...,
) -> None: ...
class TestEnumMapPlusExtra(Message):
class KnownMapFieldEntry(Message):
key: int
value: Proto2MapEnumPlusExtra
def __init__(self,
key: Optional[int] = ...,
value: Optional[Proto2MapEnumPlusExtra] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnumPlusExtra] = ...) -> None: ...
class UnknownMapFieldEntry(Message):
key: int
value: Proto2MapEnumPlusExtra
def __init__(self,
key: Optional[int] = ...,
value: Optional[Proto2MapEnumPlusExtra] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[Proto2MapEnumPlusExtra] = ...) -> None: ...
@property
def known_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ...
@property
def unknown_map_field(self) -> MutableMapping[int, Proto2MapEnumPlusExtra]: ...
def __init__(self,
known_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ...,
unknown_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ...,
) -> None: ...
def __init__(
self,
known_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ...,
unknown_map_field: Optional[Mapping[int, Proto2MapEnumPlusExtra]] = ...,
) -> None: ...
class TestImportEnumMap(Message):
class ImportEnumAmpEntry(Message):
key: int
value: ImportEnumForMap
def __init__(self,
key: Optional[int] = ...,
value: Optional[ImportEnumForMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[ImportEnumForMap] = ...) -> None: ...
@property
def import_enum_amp(self) -> MutableMapping[int, ImportEnumForMap]: ...
def __init__(self,
import_enum_amp: Optional[Mapping[int, ImportEnumForMap]] = ...,
) -> None: ...
def __init__(self, import_enum_amp: Optional[Mapping[int, ImportEnumForMap]] = ...) -> None: ...
class TestIntIntMap(Message):
class MEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
@property
def m(self) -> MutableMapping[int, int]: ...
def __init__(self,
m: Optional[Mapping[int, int]] = ...,
) -> None: ...
def __init__(self, m: Optional[Mapping[int, int]] = ...) -> None: ...
class TestMaps(Message):
class MInt32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MInt64Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MUint32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MUint64Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MSint32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MSint64Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MFixed32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MFixed64Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MSfixed32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MSfixed64Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MBoolEntry(Message):
key: bool
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[bool] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
class MStringEntry(Message):
key: Text
@property
def value(self) -> TestIntIntMap: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[TestIntIntMap] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[TestIntIntMap] = ...) -> None: ...
@property
def m_int32(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_int64(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_uint32(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_uint64(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_sint32(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_sint64(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_fixed32(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_fixed64(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_sfixed32(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_sfixed64(self) -> MutableMapping[int, TestIntIntMap]: ...
@property
def m_bool(self) -> MutableMapping[bool, TestIntIntMap]: ...
@property
def m_string(self) -> MutableMapping[Text, TestIntIntMap]: ...
def __init__(self,
m_int32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_int64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_uint32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_uint64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sint32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sint64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_fixed32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_fixed64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sfixed32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sfixed64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_bool: Optional[Mapping[bool, TestIntIntMap]] = ...,
m_string: Optional[Mapping[Text, TestIntIntMap]] = ...,
) -> None: ...
def __init__(
self,
m_int32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_int64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_uint32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_uint64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sint32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sint64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_fixed32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_fixed64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sfixed32: Optional[Mapping[int, TestIntIntMap]] = ...,
m_sfixed64: Optional[Mapping[int, TestIntIntMap]] = ...,
m_bool: Optional[Mapping[bool, TestIntIntMap]] = ...,
m_string: Optional[Mapping[Text, TestIntIntMap]] = ...,
) -> None: ...
class TestSubmessageMaps(Message):
@property
def m(self) -> TestMaps: ...
def __init__(self,
m: Optional[TestMaps] = ...,
) -> None: ...
def __init__(self, m: Optional[TestMaps] = ...) -> None: ...

View File

@@ -1,716 +1,375 @@
from google.protobuf.message import (
Message,
)
from google.protobuf.unittest_no_arena_pb2 import (
ForeignMessage,
)
from google.protobuf.unittest_pb2 import (
ForeignMessage as ForeignMessage1,
TestAllTypes,
TestRequired,
)
from typing import (
List,
Mapping,
MutableMapping,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.message import Message
from google.protobuf.unittest_no_arena_pb2 import ForeignMessage
from google.protobuf.unittest_pb2 import ForeignMessage as ForeignMessage1, TestAllTypes, TestRequired
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple, cast
class MapEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> MapEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[MapEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, MapEnum]]: ...
MAP_ENUM_FOO: MapEnum
MAP_ENUM_BAR: MapEnum
MAP_ENUM_BAZ: MapEnum
class TestMap(Message):
class MapInt32Int32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt64Int64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint32Uint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint64Uint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint32Sint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint64Sint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed32Fixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed64Fixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed32Sfixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed64Sfixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt32FloatEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapInt32DoubleEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapBoolBoolEntry(Message):
key: bool
value: bool
def __init__(self,
key: Optional[bool] = ...,
value: Optional[bool] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ...
class MapStringStringEntry(Message):
key: Text
value: Text
def __init__(self,
key: Optional[Text] = ...,
value: Optional[Text] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ...
class MapInt32BytesEntry(Message):
key: int
value: bytes
def __init__(self,
key: Optional[int] = ...,
value: Optional[bytes] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[bytes] = ...) -> None: ...
class MapInt32EnumEntry(Message):
key: int
value: MapEnum
def __init__(self,
key: Optional[int] = ...,
value: Optional[MapEnum] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[MapEnum] = ...) -> None: ...
class MapInt32ForeignMessageEntry(Message):
key: int
@property
def value(self) -> ForeignMessage1: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[ForeignMessage1] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage1] = ...) -> None: ...
class MapStringForeignMessageEntry(Message):
key: Text
@property
def value(self) -> ForeignMessage1: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[ForeignMessage1] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessage1] = ...) -> None: ...
class MapInt32AllTypesEntry(Message):
key: int
@property
def value(self) -> TestAllTypes: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestAllTypes] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestAllTypes] = ...) -> None: ...
@property
def map_int32_int32(self) -> MutableMapping[int, int]: ...
@property
def map_int64_int64(self) -> MutableMapping[int, int]: ...
@property
def map_uint32_uint32(self) -> MutableMapping[int, int]: ...
@property
def map_uint64_uint64(self) -> MutableMapping[int, int]: ...
@property
def map_sint32_sint32(self) -> MutableMapping[int, int]: ...
@property
def map_sint64_sint64(self) -> MutableMapping[int, int]: ...
@property
def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ...
@property
def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ...
@property
def map_int32_float(self) -> MutableMapping[int, float]: ...
@property
def map_int32_double(self) -> MutableMapping[int, float]: ...
@property
def map_bool_bool(self) -> MutableMapping[bool, bool]: ...
@property
def map_string_string(self) -> MutableMapping[Text, Text]: ...
@property
def map_int32_bytes(self) -> MutableMapping[int, bytes]: ...
@property
def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ...
@property
def map_int32_foreign_message(
self) -> MutableMapping[int, ForeignMessage1]: ...
def map_int32_foreign_message(self) -> MutableMapping[int, ForeignMessage1]: ...
@property
def map_string_foreign_message(
self) -> MutableMapping[Text, ForeignMessage1]: ...
def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage1]: ...
@property
def map_int32_all_types(self) -> MutableMapping[int, TestAllTypes]: ...
def __init__(self,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_int32_bytes: Optional[Mapping[int, bytes]] = ...,
map_int32_enum: Optional[Mapping[int, MapEnum]] = ...,
map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ...,
map_string_foreign_message: Optional[Mapping[Text, ForeignMessage1]] = ...,
map_int32_all_types: Optional[Mapping[int, TestAllTypes]] = ...,
) -> None: ...
def __init__(
self,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_int32_bytes: Optional[Mapping[int, bytes]] = ...,
map_int32_enum: Optional[Mapping[int, MapEnum]] = ...,
map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ...,
map_string_foreign_message: Optional[Mapping[Text, ForeignMessage1]] = ...,
map_int32_all_types: Optional[Mapping[int, TestAllTypes]] = ...,
) -> None: ...
class TestMapSubmessage(Message):
@property
def test_map(self) -> TestMap: ...
def __init__(self,
test_map: Optional[TestMap] = ...,
) -> None: ...
def __init__(self, test_map: Optional[TestMap] = ...) -> None: ...
class TestMessageMap(Message):
class MapInt32MessageEntry(Message):
key: int
@property
def value(self) -> TestAllTypes: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestAllTypes] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestAllTypes] = ...) -> None: ...
@property
def map_int32_message(self) -> MutableMapping[int, TestAllTypes]: ...
def __init__(self,
map_int32_message: Optional[Mapping[int, TestAllTypes]] = ...,
) -> None: ...
def __init__(self, map_int32_message: Optional[Mapping[int, TestAllTypes]] = ...) -> None: ...
class TestSameTypeMap(Message):
class Map1Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class Map2Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
@property
def map1(self) -> MutableMapping[int, int]: ...
@property
def map2(self) -> MutableMapping[int, int]: ...
def __init__(self,
map1: Optional[Mapping[int, int]] = ...,
map2: Optional[Mapping[int, int]] = ...,
) -> None: ...
def __init__(self, map1: Optional[Mapping[int, int]] = ..., map2: Optional[Mapping[int, int]] = ...) -> None: ...
class TestRequiredMessageMap(Message):
class MapFieldEntry(Message):
key: int
@property
def value(self) -> TestRequired: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[TestRequired] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[TestRequired] = ...) -> None: ...
@property
def map_field(self) -> MutableMapping[int, TestRequired]: ...
def __init__(self,
map_field: Optional[Mapping[int, TestRequired]] = ...,
) -> None: ...
def __init__(self, map_field: Optional[Mapping[int, TestRequired]] = ...) -> None: ...
class TestArenaMap(Message):
class MapInt32Int32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt64Int64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint32Uint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint64Uint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint32Sint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint64Sint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed32Fixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed64Fixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed32Sfixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed64Sfixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt32FloatEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapInt32DoubleEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapBoolBoolEntry(Message):
key: bool
value: bool
def __init__(self,
key: Optional[bool] = ...,
value: Optional[bool] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ...
class MapStringStringEntry(Message):
key: Text
value: Text
def __init__(self,
key: Optional[Text] = ...,
value: Optional[Text] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ...
class MapInt32BytesEntry(Message):
key: int
value: bytes
def __init__(self,
key: Optional[int] = ...,
value: Optional[bytes] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[bytes] = ...) -> None: ...
class MapInt32EnumEntry(Message):
key: int
value: MapEnum
def __init__(self,
key: Optional[int] = ...,
value: Optional[MapEnum] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[MapEnum] = ...) -> None: ...
class MapInt32ForeignMessageEntry(Message):
key: int
@property
def value(self) -> ForeignMessage1: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[ForeignMessage1] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage1] = ...) -> None: ...
class MapInt32ForeignMessageNoArenaEntry(Message):
key: int
@property
def value(self) -> ForeignMessage: ...
def __init__(self,
key: Optional[int] = ...,
value: Optional[ForeignMessage] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[ForeignMessage] = ...) -> None: ...
@property
def map_int32_int32(self) -> MutableMapping[int, int]: ...
@property
def map_int64_int64(self) -> MutableMapping[int, int]: ...
@property
def map_uint32_uint32(self) -> MutableMapping[int, int]: ...
@property
def map_uint64_uint64(self) -> MutableMapping[int, int]: ...
@property
def map_sint32_sint32(self) -> MutableMapping[int, int]: ...
@property
def map_sint64_sint64(self) -> MutableMapping[int, int]: ...
@property
def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ...
@property
def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ...
@property
def map_int32_float(self) -> MutableMapping[int, float]: ...
@property
def map_int32_double(self) -> MutableMapping[int, float]: ...
@property
def map_bool_bool(self) -> MutableMapping[bool, bool]: ...
@property
def map_string_string(self) -> MutableMapping[Text, Text]: ...
@property
def map_int32_bytes(self) -> MutableMapping[int, bytes]: ...
@property
def map_int32_enum(self) -> MutableMapping[int, MapEnum]: ...
@property
def map_int32_foreign_message(
self) -> MutableMapping[int, ForeignMessage1]: ...
def map_int32_foreign_message(self) -> MutableMapping[int, ForeignMessage1]: ...
@property
def map_int32_foreign_message_no_arena(
self) -> MutableMapping[int, ForeignMessage]: ...
def __init__(self,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_int32_bytes: Optional[Mapping[int, bytes]] = ...,
map_int32_enum: Optional[Mapping[int, MapEnum]] = ...,
map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ...,
map_int32_foreign_message_no_arena: Optional[Mapping[int, ForeignMessage]] = ...,
) -> None: ...
def map_int32_foreign_message_no_arena(self) -> MutableMapping[int, ForeignMessage]: ...
def __init__(
self,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_int32_bytes: Optional[Mapping[int, bytes]] = ...,
map_int32_enum: Optional[Mapping[int, MapEnum]] = ...,
map_int32_foreign_message: Optional[Mapping[int, ForeignMessage1]] = ...,
map_int32_foreign_message_no_arena: Optional[Mapping[int, ForeignMessage]] = ...,
) -> None: ...
class MessageContainingEnumCalledType(Message):
class Type(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> MessageContainingEnumCalledType.Type: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[MessageContainingEnumCalledType.Type]: ...
@classmethod
def items(cls) -> List[Tuple[bytes,
MessageContainingEnumCalledType.Type]]: ...
def items(cls) -> List[Tuple[bytes, MessageContainingEnumCalledType.Type]]: ...
TYPE_FOO: MessageContainingEnumCalledType.Type
class TypeEntry(Message):
key: Text
@property
def value(self) -> MessageContainingEnumCalledType: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[MessageContainingEnumCalledType] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[MessageContainingEnumCalledType] = ...) -> None: ...
@property
def type(self) -> MutableMapping[Text,
MessageContainingEnumCalledType]: ...
def __init__(self,
type: Optional[Mapping[Text, MessageContainingEnumCalledType]] = ...,
) -> None: ...
def type(self) -> MutableMapping[Text, MessageContainingEnumCalledType]: ...
def __init__(self, type: Optional[Mapping[Text, MessageContainingEnumCalledType]] = ...) -> None: ...
class MessageContainingMapCalledEntry(Message):
class EntryEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
@property
def entry(self) -> MutableMapping[int, int]: ...
def __init__(self,
entry: Optional[Mapping[int, int]] = ...,
) -> None: ...
def __init__(self, entry: Optional[Mapping[int, int]] = ...) -> None: ...
class TestRecursiveMapMessage(Message):
class AEntry(Message):
key: Text
@property
def value(self) -> TestRecursiveMapMessage: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[TestRecursiveMapMessage] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[TestRecursiveMapMessage] = ...) -> None: ...
@property
def a(self) -> MutableMapping[Text, TestRecursiveMapMessage]: ...
def __init__(self,
a: Optional[Mapping[Text, TestRecursiveMapMessage]] = ...,
) -> None: ...
def __init__(self, a: Optional[Mapping[Text, TestRecursiveMapMessage]] = ...) -> None: ...

View File

@@ -2,10 +2,7 @@ import sys
from typing import Any, Sequence, Optional, Tuple, Type, TypeVar, Union
from .descriptor import (
DescriptorBase,
FieldDescriptor,
)
from .descriptor import DescriptorBase, FieldDescriptor
class Error(Exception): ...
class DecodeError(Error): ...
@@ -44,7 +41,6 @@ class Message:
def FromString(cls: Type[_T], s: _Serialized) -> _T: ...
@property
def Extensions(self) -> _ExtensionDict: ...
# Intentionally left out typing on these three methods, because they are
# stringly typed and it is not useful to call them on a Message directly.
# We prefer more specific typing on individual subclasses of Message
@@ -52,6 +48,5 @@ class Message:
def HasField(self, field_name: Any) -> bool: ...
def ClearField(self, field_name: Any) -> None: ...
def WhichOneof(self, oneof_group: Any) -> Any: ...
# TODO: check kwargs
def __init__(self, **kwargs) -> None: ...

View File

@@ -1,16 +1,6 @@
from google.protobuf.message import (
Message,
)
from typing import (
Optional,
Text,
)
from google.protobuf.message import Message
from typing import Optional, Text
class SourceContext(Message):
file_name: Text
def __init__(self,
file_name: Optional[Text] = ...,
) -> None: ...
def __init__(self, file_name: Optional[Text] = ...) -> None: ...

View File

@@ -1,94 +1,55 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.internal import well_known_types
from google.protobuf.message import (
Message,
)
from typing import (
Iterable,
List,
Mapping,
MutableMapping,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.message import Message
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
class NullValue(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> NullValue: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[NullValue]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, NullValue]]: ...
NULL_VALUE: NullValue
class Struct(Message, well_known_types.Struct):
class FieldsEntry(Message):
key: Text
@property
def value(self) -> Value: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[Value] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[Value] = ...) -> None: ...
@property
def fields(self) -> MutableMapping[Text, Value]: ...
def __init__(self,
fields: Optional[Mapping[Text, Value]] = ...,
) -> None: ...
def __init__(self, fields: Optional[Mapping[Text, Value]] = ...) -> None: ...
class _Value(Message):
null_value: NullValue
number_value: float
string_value: Text
bool_value: bool
@property
def struct_value(self) -> Struct: ...
@property
def list_value(self) -> ListValue: ...
def __init__(self,
null_value: Optional[NullValue] = ...,
number_value: Optional[float] = ...,
string_value: Optional[Text] = ...,
bool_value: Optional[bool] = ...,
struct_value: Optional[Struct] = ...,
list_value: Optional[ListValue] = ...,
) -> None: ...
def __init__(
self,
null_value: Optional[NullValue] = ...,
number_value: Optional[float] = ...,
string_value: Optional[Text] = ...,
bool_value: Optional[bool] = ...,
struct_value: Optional[Struct] = ...,
list_value: Optional[ListValue] = ...,
) -> None: ...
Value = _Value
class ListValue(Message, well_known_types.ListValue):
@property
def values(self) -> RepeatedCompositeFieldContainer[Value]: ...
def __init__(self,
values: Optional[Iterable[Value]] = ...,
) -> None: ...
def __init__(self, values: Optional[Iterable[Value]] = ...) -> None: ...

View File

@@ -1,465 +1,345 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
import builtins
from typing import (
Iterable,
List,
Mapping,
MutableMapping,
Optional,
Text,
Tuple,
cast,
)
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
class ForeignEnumProto2(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> ForeignEnumProto2: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[ForeignEnumProto2]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, ForeignEnumProto2]]: ...
FOREIGN_FOO: ForeignEnumProto2
FOREIGN_BAR: ForeignEnumProto2
FOREIGN_BAZ: ForeignEnumProto2
class TestAllTypesProto2(Message):
class NestedEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> TestAllTypesProto2.NestedEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[TestAllTypesProto2.NestedEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, TestAllTypesProto2.NestedEnum]]: ...
FOO: TestAllTypesProto2.NestedEnum
BAR: TestAllTypesProto2.NestedEnum
BAZ: TestAllTypesProto2.NestedEnum
NEG: TestAllTypesProto2.NestedEnum
class NestedMessage(Message):
a: int
@property
def corecursive(self) -> TestAllTypesProto2: ...
def __init__(self,
a: Optional[int] = ...,
corecursive: Optional[TestAllTypesProto2] = ...,
) -> None: ...
def __init__(self, a: Optional[int] = ..., corecursive: Optional[TestAllTypesProto2] = ...) -> None: ...
class MapInt32Int32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt64Int64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint32Uint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint64Uint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint32Sint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint64Sint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed32Fixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed64Fixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed32Sfixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed64Sfixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt32FloatEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapInt32DoubleEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapBoolBoolEntry(Message):
key: bool
value: bool
def __init__(self,
key: Optional[bool] = ...,
value: Optional[bool] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ...
class MapStringStringEntry(Message):
key: Text
value: Text
def __init__(self,
key: Optional[Text] = ...,
value: Optional[Text] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ...
class MapStringBytesEntry(Message):
key: Text
value: bytes
def __init__(self,
key: Optional[Text] = ...,
value: Optional[bytes] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ...
class MapStringNestedMessageEntry(Message):
key: Text
@property
def value(self) -> TestAllTypesProto2.NestedMessage: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[TestAllTypesProto2.NestedMessage] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto2.NestedMessage] = ...) -> None: ...
class MapStringForeignMessageEntry(Message):
key: Text
@property
def value(self) -> ForeignMessageProto2: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[ForeignMessageProto2] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessageProto2] = ...) -> None: ...
class MapStringNestedEnumEntry(Message):
key: Text
value: TestAllTypesProto2.NestedEnum
def __init__(self,
key: Optional[Text] = ...,
value: Optional[TestAllTypesProto2.NestedEnum] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto2.NestedEnum] = ...) -> None: ...
class MapStringForeignEnumEntry(Message):
key: Text
value: ForeignEnumProto2
def __init__(self,
key: Optional[Text] = ...,
value: Optional[ForeignEnumProto2] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignEnumProto2] = ...) -> None: ...
class Data(Message):
group_int32: int
group_uint32: int
def __init__(self,
group_int32: Optional[int] = ...,
group_uint32: Optional[int] = ...,
) -> None: ...
def __init__(self, group_int32: Optional[int] = ..., group_uint32: Optional[int] = ...) -> None: ...
class MessageSetCorrect(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class MessageSetCorrectExtension1(Message):
bytes: Text
def __init__(self,
bytes: Optional[Text] = ...,
) -> None: ...
def __init__(self, bytes: Optional[Text] = ...) -> None: ...
class MessageSetCorrectExtension2(Message):
i: int
def __init__(self,
i: Optional[int] = ...,
) -> None: ...
def __init__(self, i: Optional[int] = ...) -> None: ...
optional_int32: int
optional_int64: int
optional_uint32: int
optional_uint64: int
optional_sint32: int
optional_sint64: int
optional_fixed32: int
optional_fixed64: int
optional_sfixed32: int
optional_sfixed64: int
optional_float: float
optional_double: float
optional_bool: bool
optional_string: Text
optional_bytes: bytes
optional_nested_enum: TestAllTypesProto2.NestedEnum
optional_foreign_enum: ForeignEnumProto2
optional_string_piece: Text
optional_cord: Text
repeated_int32: RepeatedScalarFieldContainer[int]
repeated_int64: RepeatedScalarFieldContainer[int]
repeated_uint32: RepeatedScalarFieldContainer[int]
repeated_uint64: RepeatedScalarFieldContainer[int]
repeated_sint32: RepeatedScalarFieldContainer[int]
repeated_sint64: RepeatedScalarFieldContainer[int]
repeated_fixed32: RepeatedScalarFieldContainer[int]
repeated_fixed64: RepeatedScalarFieldContainer[int]
repeated_sfixed32: RepeatedScalarFieldContainer[int]
repeated_sfixed64: RepeatedScalarFieldContainer[int]
repeated_float: RepeatedScalarFieldContainer[float]
repeated_double: RepeatedScalarFieldContainer[float]
repeated_bool: RepeatedScalarFieldContainer[bool]
repeated_string: RepeatedScalarFieldContainer[Text]
repeated_bytes: RepeatedScalarFieldContainer[bytes]
repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto2.NestedEnum]
repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnumProto2]
repeated_string_piece: RepeatedScalarFieldContainer[Text]
repeated_cord: RepeatedScalarFieldContainer[Text]
oneof_uint32: int
oneof_string: Text
oneof_bytes: bytes
oneof_bool: bool
oneof_uint64: int
oneof_float: float
oneof_double: float
oneof_enum: TestAllTypesProto2.NestedEnum
fieldname1: int
field_name2: int
_field_name3: int
field__name4_: int
field0name5: int
field_0_name6: int
fieldName7: int
FieldName8: int
field_Name9: int
Field_Name10: int
FIELD_NAME11: int
FIELD_name12: int
__field_name13: int
__Field_name14: int
field__name15: int
field__Name16: int
field_name17__: int
Field_name18__: int
@property
def optional_nested_message(self) -> TestAllTypesProto2.NestedMessage: ...
@property
def optional_foreign_message(self) -> ForeignMessageProto2: ...
@property
def recursive_message(self) -> TestAllTypesProto2: ...
@property
def repeated_nested_message(
self) -> RepeatedCompositeFieldContainer[TestAllTypesProto2.NestedMessage]: ...
def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto2.NestedMessage]: ...
@property
def repeated_foreign_message(
self) -> RepeatedCompositeFieldContainer[ForeignMessageProto2]: ...
def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessageProto2]: ...
@property
def map_int32_int32(self) -> MutableMapping[int, int]: ...
@property
def map_int64_int64(self) -> MutableMapping[int, int]: ...
@property
def map_uint32_uint32(self) -> MutableMapping[int, int]: ...
@property
def map_uint64_uint64(self) -> MutableMapping[int, int]: ...
@property
def map_sint32_sint32(self) -> MutableMapping[int, int]: ...
@property
def map_sint64_sint64(self) -> MutableMapping[int, int]: ...
@property
def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ...
@property
def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ...
@property
def map_int32_float(self) -> MutableMapping[int, float]: ...
@property
def map_int32_double(self) -> MutableMapping[int, float]: ...
@property
def map_bool_bool(self) -> MutableMapping[bool, bool]: ...
@property
def map_string_string(self) -> MutableMapping[Text, Text]: ...
@property
def map_string_bytes(self) -> MutableMapping[Text, bytes]: ...
@property
def map_string_nested_message(
self) -> MutableMapping[Text, TestAllTypesProto2.NestedMessage]: ...
def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto2.NestedMessage]: ...
@property
def map_string_foreign_message(
self) -> MutableMapping[Text, ForeignMessageProto2]: ...
def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessageProto2]: ...
@property
def map_string_nested_enum(
self) -> MutableMapping[Text, TestAllTypesProto2.NestedEnum]: ...
def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto2.NestedEnum]: ...
@property
def map_string_foreign_enum(
self) -> MutableMapping[Text, ForeignEnumProto2]: ...
def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnumProto2]: ...
@property
def oneof_nested_message(self) -> TestAllTypesProto2.NestedMessage: ...
@property
def data(self) -> TestAllTypesProto2.Data: ...
def __init__(self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optional_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessageProto2] = ...,
optional_nested_enum: Optional[TestAllTypesProto2.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnumProto2] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
recursive_message: Optional[TestAllTypesProto2] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypesProto2.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessageProto2]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypesProto2.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnumProto2]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_string_bytes: Optional[Mapping[Text, bytes]] = ...,
map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto2.NestedMessage]] = ...,
map_string_foreign_message: Optional[Mapping[Text, ForeignMessageProto2]] = ...,
map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto2.NestedEnum]] = ...,
map_string_foreign_enum: Optional[Mapping[Text, ForeignEnumProto2]] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
oneof_bool: Optional[bool] = ...,
oneof_uint64: Optional[int] = ...,
oneof_float: Optional[float] = ...,
oneof_double: Optional[float] = ...,
oneof_enum: Optional[TestAllTypesProto2.NestedEnum] = ...,
data: Optional[TestAllTypesProto2.Data] = ...,
fieldname1: Optional[int] = ...,
field_name2: Optional[int] = ...,
_field_name3: Optional[int] = ...,
field__name4_: Optional[int] = ...,
field0name5: Optional[int] = ...,
field_0_name6: Optional[int] = ...,
fieldName7: Optional[int] = ...,
FieldName8: Optional[int] = ...,
field_Name9: Optional[int] = ...,
Field_Name10: Optional[int] = ...,
FIELD_NAME11: Optional[int] = ...,
FIELD_name12: Optional[int] = ...,
__field_name13: Optional[int] = ...,
__Field_name14: Optional[int] = ...,
field__name15: Optional[int] = ...,
field__Name16: Optional[int] = ...,
field_name17__: Optional[int] = ...,
Field_name18__: Optional[int] = ...,
) -> None: ...
def __init__(
self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optional_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessageProto2] = ...,
optional_nested_enum: Optional[TestAllTypesProto2.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnumProto2] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
recursive_message: Optional[TestAllTypesProto2] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypesProto2.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessageProto2]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypesProto2.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnumProto2]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_string_bytes: Optional[Mapping[Text, bytes]] = ...,
map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto2.NestedMessage]] = ...,
map_string_foreign_message: Optional[Mapping[Text, ForeignMessageProto2]] = ...,
map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto2.NestedEnum]] = ...,
map_string_foreign_enum: Optional[Mapping[Text, ForeignEnumProto2]] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypesProto2.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
oneof_bool: Optional[bool] = ...,
oneof_uint64: Optional[int] = ...,
oneof_float: Optional[float] = ...,
oneof_double: Optional[float] = ...,
oneof_enum: Optional[TestAllTypesProto2.NestedEnum] = ...,
data: Optional[TestAllTypesProto2.Data] = ...,
fieldname1: Optional[int] = ...,
field_name2: Optional[int] = ...,
_field_name3: Optional[int] = ...,
field__name4_: Optional[int] = ...,
field0name5: Optional[int] = ...,
field_0_name6: Optional[int] = ...,
fieldName7: Optional[int] = ...,
FieldName8: Optional[int] = ...,
field_Name9: Optional[int] = ...,
Field_Name10: Optional[int] = ...,
FIELD_NAME11: Optional[int] = ...,
FIELD_name12: Optional[int] = ...,
__field_name13: Optional[int] = ...,
__Field_name14: Optional[int] = ...,
field__name15: Optional[int] = ...,
field__Name16: Optional[int] = ...,
field_name17__: Optional[int] = ...,
Field_name18__: Optional[int] = ...,
) -> None: ...
class ForeignMessageProto2(Message):
c: int
def __init__(self,
c: Optional[int] = ...,
) -> None: ...
def __init__(self, c: Optional[int] = ...) -> None: ...

View File

@@ -1,27 +1,10 @@
from google.protobuf.any_pb2 import (
Any,
)
from google.protobuf.duration_pb2 import (
Duration,
)
from google.protobuf.field_mask_pb2 import (
FieldMask,
)
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.struct_pb2 import (
Struct,
Value,
)
from google.protobuf.timestamp_pb2 import (
Timestamp,
)
from google.protobuf.any_pb2 import Any
from google.protobuf.duration_pb2 import Duration
from google.protobuf.field_mask_pb2 import FieldMask
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from google.protobuf.struct_pb2 import Struct, Value
from google.protobuf.timestamp_pb2 import Timestamp
from google.protobuf.wrappers_pb2 import (
BoolValue,
BytesValue,
@@ -33,539 +16,420 @@ from google.protobuf.wrappers_pb2 import (
UInt32Value,
UInt64Value,
)
from typing import (
Iterable,
List,
Mapping,
MutableMapping,
Optional,
Text,
Tuple,
cast,
)
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
class ForeignEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> ForeignEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[ForeignEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ...
FOREIGN_FOO: ForeignEnum
FOREIGN_BAR: ForeignEnum
FOREIGN_BAZ: ForeignEnum
class TestAllTypesProto3(Message):
class NestedEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> TestAllTypesProto3.NestedEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[TestAllTypesProto3.NestedEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, TestAllTypesProto3.NestedEnum]]: ...
FOO: TestAllTypesProto3.NestedEnum
BAR: TestAllTypesProto3.NestedEnum
BAZ: TestAllTypesProto3.NestedEnum
NEG: TestAllTypesProto3.NestedEnum
class NestedMessage(Message):
a: int
@property
def corecursive(self) -> TestAllTypesProto3: ...
def __init__(self,
a: Optional[int] = ...,
corecursive: Optional[TestAllTypesProto3] = ...,
) -> None: ...
def __init__(self, a: Optional[int] = ..., corecursive: Optional[TestAllTypesProto3] = ...) -> None: ...
class MapInt32Int32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt64Int64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint32Uint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapUint64Uint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint32Sint32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSint64Sint64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed32Fixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapFixed64Fixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed32Sfixed32Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapSfixed64Sfixed64Entry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class MapInt32FloatEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapInt32DoubleEntry(Message):
key: int
value: float
def __init__(self,
key: Optional[int] = ...,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[float] = ...) -> None: ...
class MapBoolBoolEntry(Message):
key: bool
value: bool
def __init__(self,
key: Optional[bool] = ...,
value: Optional[bool] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[bool] = ...) -> None: ...
class MapStringStringEntry(Message):
key: Text
value: Text
def __init__(self,
key: Optional[Text] = ...,
value: Optional[Text] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[Text] = ...) -> None: ...
class MapStringBytesEntry(Message):
key: Text
value: bytes
def __init__(self,
key: Optional[Text] = ...,
value: Optional[bytes] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ...
class MapStringNestedMessageEntry(Message):
key: Text
@property
def value(self) -> TestAllTypesProto3.NestedMessage: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[TestAllTypesProto3.NestedMessage] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto3.NestedMessage] = ...) -> None: ...
class MapStringForeignMessageEntry(Message):
key: Text
@property
def value(self) -> ForeignMessage: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[ForeignMessage] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignMessage] = ...) -> None: ...
class MapStringNestedEnumEntry(Message):
key: Text
value: TestAllTypesProto3.NestedEnum
def __init__(self,
key: Optional[Text] = ...,
value: Optional[TestAllTypesProto3.NestedEnum] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[TestAllTypesProto3.NestedEnum] = ...) -> None: ...
class MapStringForeignEnumEntry(Message):
key: Text
value: ForeignEnum
def __init__(self,
key: Optional[Text] = ...,
value: Optional[ForeignEnum] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[ForeignEnum] = ...) -> None: ...
optional_int32: int
optional_int64: int
optional_uint32: int
optional_uint64: int
optional_sint32: int
optional_sint64: int
optional_fixed32: int
optional_fixed64: int
optional_sfixed32: int
optional_sfixed64: int
optional_float: float
optional_double: float
optional_bool: bool
optional_string: Text
optional_bytes: bytes
optional_nested_enum: TestAllTypesProto3.NestedEnum
optional_foreign_enum: ForeignEnum
optional_string_piece: Text
optional_cord: Text
repeated_int32: RepeatedScalarFieldContainer[int]
repeated_int64: RepeatedScalarFieldContainer[int]
repeated_uint32: RepeatedScalarFieldContainer[int]
repeated_uint64: RepeatedScalarFieldContainer[int]
repeated_sint32: RepeatedScalarFieldContainer[int]
repeated_sint64: RepeatedScalarFieldContainer[int]
repeated_fixed32: RepeatedScalarFieldContainer[int]
repeated_fixed64: RepeatedScalarFieldContainer[int]
repeated_sfixed32: RepeatedScalarFieldContainer[int]
repeated_sfixed64: RepeatedScalarFieldContainer[int]
repeated_float: RepeatedScalarFieldContainer[float]
repeated_double: RepeatedScalarFieldContainer[float]
repeated_bool: RepeatedScalarFieldContainer[bool]
repeated_string: RepeatedScalarFieldContainer[Text]
repeated_bytes: RepeatedScalarFieldContainer[bytes]
repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypesProto3.NestedEnum]
repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum]
repeated_string_piece: RepeatedScalarFieldContainer[Text]
repeated_cord: RepeatedScalarFieldContainer[Text]
oneof_uint32: int
oneof_string: Text
oneof_bytes: bytes
oneof_bool: bool
oneof_uint64: int
oneof_float: float
oneof_double: float
oneof_enum: TestAllTypesProto3.NestedEnum
fieldname1: int
field_name2: int
_field_name3: int
field__name4_: int
field0name5: int
field_0_name6: int
fieldName7: int
FieldName8: int
field_Name9: int
Field_Name10: int
FIELD_NAME11: int
FIELD_name12: int
__field_name13: int
__Field_name14: int
field__name15: int
field__Name16: int
field_name17__: int
Field_name18__: int
@property
def optional_nested_message(self) -> TestAllTypesProto3.NestedMessage: ...
@property
def optional_foreign_message(self) -> ForeignMessage: ...
@property
def recursive_message(self) -> TestAllTypesProto3: ...
@property
def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypesProto3.NestedMessage]: ...
@property
def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ...
@property
def map_int32_int32(self) -> MutableMapping[int, int]: ...
@property
def map_int64_int64(self) -> MutableMapping[int, int]: ...
@property
def map_uint32_uint32(self) -> MutableMapping[int, int]: ...
@property
def map_uint64_uint64(self) -> MutableMapping[int, int]: ...
@property
def map_sint32_sint32(self) -> MutableMapping[int, int]: ...
@property
def map_sint64_sint64(self) -> MutableMapping[int, int]: ...
@property
def map_fixed32_fixed32(self) -> MutableMapping[int, int]: ...
@property
def map_fixed64_fixed64(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed32_sfixed32(self) -> MutableMapping[int, int]: ...
@property
def map_sfixed64_sfixed64(self) -> MutableMapping[int, int]: ...
@property
def map_int32_float(self) -> MutableMapping[int, float]: ...
@property
def map_int32_double(self) -> MutableMapping[int, float]: ...
@property
def map_bool_bool(self) -> MutableMapping[bool, bool]: ...
@property
def map_string_string(self) -> MutableMapping[Text, Text]: ...
@property
def map_string_bytes(self) -> MutableMapping[Text, bytes]: ...
@property
def map_string_nested_message(self) -> MutableMapping[Text, TestAllTypesProto3.NestedMessage]: ...
@property
def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessage]: ...
@property
def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto3.NestedEnum]: ...
@property
def map_string_foreign_enum(self) -> MutableMapping[Text, ForeignEnum]: ...
@property
def oneof_nested_message(self) -> TestAllTypesProto3.NestedMessage: ...
@property
def optional_bool_wrapper(self) -> BoolValue: ...
@property
def optional_int32_wrapper(self) -> Int32Value: ...
@property
def optional_int64_wrapper(self) -> Int64Value: ...
@property
def optional_uint32_wrapper(self) -> UInt32Value: ...
@property
def optional_uint64_wrapper(self) -> UInt64Value: ...
@property
def optional_float_wrapper(self) -> FloatValue: ...
@property
def optional_double_wrapper(self) -> DoubleValue: ...
@property
def optional_string_wrapper(self) -> StringValue: ...
@property
def optional_bytes_wrapper(self) -> BytesValue: ...
@property
def repeated_bool_wrapper(self) -> RepeatedCompositeFieldContainer[BoolValue]: ...
@property
def repeated_int32_wrapper(self) -> RepeatedCompositeFieldContainer[Int32Value]: ...
@property
def repeated_int64_wrapper(self) -> RepeatedCompositeFieldContainer[Int64Value]: ...
@property
def repeated_uint32_wrapper(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ...
@property
def repeated_uint64_wrapper(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ...
@property
def repeated_float_wrapper(self) -> RepeatedCompositeFieldContainer[FloatValue]: ...
@property
def repeated_double_wrapper(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ...
@property
def repeated_string_wrapper(self) -> RepeatedCompositeFieldContainer[StringValue]: ...
@property
def repeated_bytes_wrapper(self) -> RepeatedCompositeFieldContainer[BytesValue]: ...
@property
def optional_duration(self) -> Duration: ...
@property
def optional_timestamp(self) -> Timestamp: ...
@property
def optional_field_mask(self) -> FieldMask: ...
@property
def optional_struct(self) -> Struct: ...
@property
def optional_any(self) -> Any: ...
@property
def optional_value(self) -> Value: ...
@property
def repeated_duration(self) -> RepeatedCompositeFieldContainer[Duration]: ...
@property
def repeated_timestamp(self) -> RepeatedCompositeFieldContainer[Timestamp]: ...
@property
def repeated_fieldmask(self) -> RepeatedCompositeFieldContainer[FieldMask]: ...
@property
def repeated_struct(self) -> RepeatedCompositeFieldContainer[Struct]: ...
@property
def repeated_any(self) -> RepeatedCompositeFieldContainer[Any]: ...
@property
def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ...
def __init__(self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optional_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessage] = ...,
optional_nested_enum: Optional[TestAllTypesProto3.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnum] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
recursive_message: Optional[TestAllTypesProto3] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypesProto3.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypesProto3.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_string_bytes: Optional[Mapping[Text, bytes]] = ...,
map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto3.NestedMessage]] = ...,
map_string_foreign_message: Optional[Mapping[Text, ForeignMessage]] = ...,
map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto3.NestedEnum]] = ...,
map_string_foreign_enum: Optional[Mapping[Text, ForeignEnum]] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
oneof_bool: Optional[bool] = ...,
oneof_uint64: Optional[int] = ...,
oneof_float: Optional[float] = ...,
oneof_double: Optional[float] = ...,
oneof_enum: Optional[TestAllTypesProto3.NestedEnum] = ...,
optional_bool_wrapper: Optional[BoolValue] = ...,
optional_int32_wrapper: Optional[Int32Value] = ...,
optional_int64_wrapper: Optional[Int64Value] = ...,
optional_uint32_wrapper: Optional[UInt32Value] = ...,
optional_uint64_wrapper: Optional[UInt64Value] = ...,
optional_float_wrapper: Optional[FloatValue] = ...,
optional_double_wrapper: Optional[DoubleValue] = ...,
optional_string_wrapper: Optional[StringValue] = ...,
optional_bytes_wrapper: Optional[BytesValue] = ...,
repeated_bool_wrapper: Optional[Iterable[BoolValue]] = ...,
repeated_int32_wrapper: Optional[Iterable[Int32Value]] = ...,
repeated_int64_wrapper: Optional[Iterable[Int64Value]] = ...,
repeated_uint32_wrapper: Optional[Iterable[UInt32Value]] = ...,
repeated_uint64_wrapper: Optional[Iterable[UInt64Value]] = ...,
repeated_float_wrapper: Optional[Iterable[FloatValue]] = ...,
repeated_double_wrapper: Optional[Iterable[DoubleValue]] = ...,
repeated_string_wrapper: Optional[Iterable[StringValue]] = ...,
repeated_bytes_wrapper: Optional[Iterable[BytesValue]] = ...,
optional_duration: Optional[Duration] = ...,
optional_timestamp: Optional[Timestamp] = ...,
optional_field_mask: Optional[FieldMask] = ...,
optional_struct: Optional[Struct] = ...,
optional_any: Optional[Any] = ...,
optional_value: Optional[Value] = ...,
repeated_duration: Optional[Iterable[Duration]] = ...,
repeated_timestamp: Optional[Iterable[Timestamp]] = ...,
repeated_fieldmask: Optional[Iterable[FieldMask]] = ...,
repeated_struct: Optional[Iterable[Struct]] = ...,
repeated_any: Optional[Iterable[Any]] = ...,
repeated_value: Optional[Iterable[Value]] = ...,
fieldname1: Optional[int] = ...,
field_name2: Optional[int] = ...,
_field_name3: Optional[int] = ...,
field__name4_: Optional[int] = ...,
field0name5: Optional[int] = ...,
field_0_name6: Optional[int] = ...,
fieldName7: Optional[int] = ...,
FieldName8: Optional[int] = ...,
field_Name9: Optional[int] = ...,
Field_Name10: Optional[int] = ...,
FIELD_NAME11: Optional[int] = ...,
FIELD_name12: Optional[int] = ...,
__field_name13: Optional[int] = ...,
__Field_name14: Optional[int] = ...,
field__name15: Optional[int] = ...,
field__Name16: Optional[int] = ...,
field_name17__: Optional[int] = ...,
Field_name18__: Optional[int] = ...,
) -> None: ...
def __init__(
self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optional_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessage] = ...,
optional_nested_enum: Optional[TestAllTypesProto3.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnum] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
recursive_message: Optional[TestAllTypesProto3] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypesProto3.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypesProto3.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
map_int32_int32: Optional[Mapping[int, int]] = ...,
map_int64_int64: Optional[Mapping[int, int]] = ...,
map_uint32_uint32: Optional[Mapping[int, int]] = ...,
map_uint64_uint64: Optional[Mapping[int, int]] = ...,
map_sint32_sint32: Optional[Mapping[int, int]] = ...,
map_sint64_sint64: Optional[Mapping[int, int]] = ...,
map_fixed32_fixed32: Optional[Mapping[int, int]] = ...,
map_fixed64_fixed64: Optional[Mapping[int, int]] = ...,
map_sfixed32_sfixed32: Optional[Mapping[int, int]] = ...,
map_sfixed64_sfixed64: Optional[Mapping[int, int]] = ...,
map_int32_float: Optional[Mapping[int, float]] = ...,
map_int32_double: Optional[Mapping[int, float]] = ...,
map_bool_bool: Optional[Mapping[bool, bool]] = ...,
map_string_string: Optional[Mapping[Text, Text]] = ...,
map_string_bytes: Optional[Mapping[Text, bytes]] = ...,
map_string_nested_message: Optional[Mapping[Text, TestAllTypesProto3.NestedMessage]] = ...,
map_string_foreign_message: Optional[Mapping[Text, ForeignMessage]] = ...,
map_string_nested_enum: Optional[Mapping[Text, TestAllTypesProto3.NestedEnum]] = ...,
map_string_foreign_enum: Optional[Mapping[Text, ForeignEnum]] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypesProto3.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
oneof_bool: Optional[bool] = ...,
oneof_uint64: Optional[int] = ...,
oneof_float: Optional[float] = ...,
oneof_double: Optional[float] = ...,
oneof_enum: Optional[TestAllTypesProto3.NestedEnum] = ...,
optional_bool_wrapper: Optional[BoolValue] = ...,
optional_int32_wrapper: Optional[Int32Value] = ...,
optional_int64_wrapper: Optional[Int64Value] = ...,
optional_uint32_wrapper: Optional[UInt32Value] = ...,
optional_uint64_wrapper: Optional[UInt64Value] = ...,
optional_float_wrapper: Optional[FloatValue] = ...,
optional_double_wrapper: Optional[DoubleValue] = ...,
optional_string_wrapper: Optional[StringValue] = ...,
optional_bytes_wrapper: Optional[BytesValue] = ...,
repeated_bool_wrapper: Optional[Iterable[BoolValue]] = ...,
repeated_int32_wrapper: Optional[Iterable[Int32Value]] = ...,
repeated_int64_wrapper: Optional[Iterable[Int64Value]] = ...,
repeated_uint32_wrapper: Optional[Iterable[UInt32Value]] = ...,
repeated_uint64_wrapper: Optional[Iterable[UInt64Value]] = ...,
repeated_float_wrapper: Optional[Iterable[FloatValue]] = ...,
repeated_double_wrapper: Optional[Iterable[DoubleValue]] = ...,
repeated_string_wrapper: Optional[Iterable[StringValue]] = ...,
repeated_bytes_wrapper: Optional[Iterable[BytesValue]] = ...,
optional_duration: Optional[Duration] = ...,
optional_timestamp: Optional[Timestamp] = ...,
optional_field_mask: Optional[FieldMask] = ...,
optional_struct: Optional[Struct] = ...,
optional_any: Optional[Any] = ...,
optional_value: Optional[Value] = ...,
repeated_duration: Optional[Iterable[Duration]] = ...,
repeated_timestamp: Optional[Iterable[Timestamp]] = ...,
repeated_fieldmask: Optional[Iterable[FieldMask]] = ...,
repeated_struct: Optional[Iterable[Struct]] = ...,
repeated_any: Optional[Iterable[Any]] = ...,
repeated_value: Optional[Iterable[Value]] = ...,
fieldname1: Optional[int] = ...,
field_name2: Optional[int] = ...,
_field_name3: Optional[int] = ...,
field__name4_: Optional[int] = ...,
field0name5: Optional[int] = ...,
field_0_name6: Optional[int] = ...,
fieldName7: Optional[int] = ...,
FieldName8: Optional[int] = ...,
field_Name9: Optional[int] = ...,
Field_Name10: Optional[int] = ...,
FIELD_NAME11: Optional[int] = ...,
FIELD_name12: Optional[int] = ...,
__field_name13: Optional[int] = ...,
__Field_name14: Optional[int] = ...,
field__name15: Optional[int] = ...,
field__Name16: Optional[int] = ...,
field_name17__: Optional[int] = ...,
Field_name18__: Optional[int] = ...,
) -> None: ...
class ForeignMessage(Message):
c: int
def __init__(self,
c: Optional[int] = ...,
) -> None: ...
def __init__(self, c: Optional[int] = ...) -> None: ...

View File

@@ -1,19 +1,9 @@
from google.protobuf.message import (
Message,
)
from google.protobuf.message import Message
from google.protobuf.internal import well_known_types
from typing import (
Optional,
)
from typing import Optional
class Timestamp(Message, well_known_types.Timestamp):
seconds: int
nanos: int
def __init__(self,
seconds: Optional[int] = ...,
nanos: Optional[int] = ...,
) -> None: ...
def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ...

View File

@@ -1,89 +1,54 @@
from google.protobuf.any_pb2 import (
Any,
)
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.source_context_pb2 import (
SourceContext,
)
from typing import (
Iterable,
List,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.any_pb2 import Any
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from google.protobuf.source_context_pb2 import SourceContext
from typing import Iterable, List, Optional, Text, Tuple, cast
class Syntax(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> Syntax: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[Syntax]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, Syntax]]: ...
SYNTAX_PROTO2: Syntax
SYNTAX_PROTO3: Syntax
class Type(Message):
name: Text
oneofs: RepeatedScalarFieldContainer[Text]
syntax: Syntax
@property
def fields(self) -> RepeatedCompositeFieldContainer[Field]: ...
@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
@property
def source_context(self) -> SourceContext: ...
def __init__(self,
name: Optional[Text] = ...,
fields: Optional[Iterable[Field]] = ...,
oneofs: Optional[Iterable[Text]] = ...,
options: Optional[Iterable[Option]] = ...,
source_context: Optional[SourceContext] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
fields: Optional[Iterable[Field]] = ...,
oneofs: Optional[Iterable[Text]] = ...,
options: Optional[Iterable[Option]] = ...,
source_context: Optional[SourceContext] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
class Field(Message):
class Kind(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> Field.Kind: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[Field.Kind]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, Field.Kind]]: ...
TYPE_UNKNOWN: Field.Kind
@@ -105,21 +70,15 @@ class Field(Message):
TYPE_SFIXED64: Field.Kind
TYPE_SINT32: Field.Kind
TYPE_SINT64: Field.Kind
class Cardinality(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> Field.Cardinality: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[Field.Cardinality]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, Field.Cardinality]]: ...
CARDINALITY_UNKNOWN: Field.Cardinality
@@ -135,67 +94,51 @@ class Field(Message):
packed: bool
json_name: Text
default_value: Text
@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
def __init__(self,
kind: Optional[Field.Kind] = ...,
cardinality: Optional[Field.Cardinality] = ...,
number: Optional[int] = ...,
name: Optional[Text] = ...,
type_url: Optional[Text] = ...,
oneof_index: Optional[int] = ...,
packed: Optional[bool] = ...,
options: Optional[Iterable[Option]] = ...,
json_name: Optional[Text] = ...,
default_value: Optional[Text] = ...,
) -> None: ...
def __init__(
self,
kind: Optional[Field.Kind] = ...,
cardinality: Optional[Field.Cardinality] = ...,
number: Optional[int] = ...,
name: Optional[Text] = ...,
type_url: Optional[Text] = ...,
oneof_index: Optional[int] = ...,
packed: Optional[bool] = ...,
options: Optional[Iterable[Option]] = ...,
json_name: Optional[Text] = ...,
default_value: Optional[Text] = ...,
) -> None: ...
class Enum(Message):
name: Text
syntax: Syntax
@property
def enumvalue(self) -> RepeatedCompositeFieldContainer[EnumValue]: ...
@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
@property
def source_context(self) -> SourceContext: ...
def __init__(self,
name: Optional[Text] = ...,
enumvalue: Optional[Iterable[EnumValue]] = ...,
options: Optional[Iterable[Option]] = ...,
source_context: Optional[SourceContext] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
def __init__(
self,
name: Optional[Text] = ...,
enumvalue: Optional[Iterable[EnumValue]] = ...,
options: Optional[Iterable[Option]] = ...,
source_context: Optional[SourceContext] = ...,
syntax: Optional[Syntax] = ...,
) -> None: ...
class EnumValue(Message):
name: Text
number: int
@property
def options(self) -> RepeatedCompositeFieldContainer[Option]: ...
def __init__(self,
name: Optional[Text] = ...,
number: Optional[int] = ...,
options: Optional[Iterable[Option]] = ...,
) -> None: ...
def __init__(
self, name: Optional[Text] = ..., number: Optional[int] = ..., options: Optional[Iterable[Option]] = ...
) -> None: ...
class Option(Message):
name: Text
@property
def value(self) -> Any: ...
def __init__(self,
name: Optional[Text] = ...,
value: Optional[Any] = ...,
) -> None: ...
def __init__(self, name: Optional[Text] = ..., value: Optional[Any] = ...) -> None: ...

View File

@@ -1,38 +1,19 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.unittest_no_arena_import_pb2 import (
ImportNoArenaNestedMessage,
)
from typing import (
Iterable,
Optional,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from google.protobuf.unittest_no_arena_import_pb2 import ImportNoArenaNestedMessage
from typing import Iterable, Optional
class NestedMessage(Message):
d: int
def __init__(self,
d: Optional[int] = ...,
) -> None: ...
def __init__(self, d: Optional[int] = ...) -> None: ...
class ArenaMessage(Message):
@property
def repeated_nested_message(
self) -> RepeatedCompositeFieldContainer[NestedMessage]: ...
def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[NestedMessage]: ...
@property
def repeated_import_no_arena_message(
self) -> RepeatedCompositeFieldContainer[ImportNoArenaNestedMessage]: ...
def __init__(self,
repeated_nested_message: Optional[Iterable[NestedMessage]] = ...,
repeated_import_no_arena_message: Optional[Iterable[ImportNoArenaNestedMessage]] = ...,
) -> None: ...
def repeated_import_no_arena_message(self) -> RepeatedCompositeFieldContainer[ImportNoArenaNestedMessage]: ...
def __init__(
self,
repeated_nested_message: Optional[Iterable[NestedMessage]] = ...,
repeated_import_no_arena_message: Optional[Iterable[ImportNoArenaNestedMessage]] = ...,
) -> None: ...

View File

@@ -1,385 +1,226 @@
from google.protobuf.descriptor_pb2 import (
FileOptions,
)
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from typing import (
Iterable,
List,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.descriptor_pb2 import FileOptions
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from typing import Iterable, List, Optional, Text, Tuple, cast
class MethodOpt1(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> MethodOpt1: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[MethodOpt1]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, MethodOpt1]]: ...
METHODOPT1_VAL1: MethodOpt1
METHODOPT1_VAL2: MethodOpt1
class AggregateEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> AggregateEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[AggregateEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, AggregateEnum]]: ...
VALUE: AggregateEnum
class TestMessageWithCustomOptions(Message):
class AnEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> TestMessageWithCustomOptions.AnEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[TestMessageWithCustomOptions.AnEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes,
TestMessageWithCustomOptions.AnEnum]]: ...
def items(cls) -> List[Tuple[bytes, TestMessageWithCustomOptions.AnEnum]]: ...
ANENUM_VAL1: TestMessageWithCustomOptions.AnEnum
ANENUM_VAL2: TestMessageWithCustomOptions.AnEnum
field1: Text
oneof_field: int
def __init__(self,
field1: Optional[Text] = ...,
oneof_field: Optional[int] = ...,
) -> None: ...
def __init__(self, field1: Optional[Text] = ..., oneof_field: Optional[int] = ...) -> None: ...
class CustomOptionFooRequest(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class CustomOptionFooResponse(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class CustomOptionFooClientMessage(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class CustomOptionFooServerMessage(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class DummyMessageContainingEnum(Message):
class TestEnumType(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> DummyMessageContainingEnum.TestEnumType: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[DummyMessageContainingEnum.TestEnumType]: ...
@classmethod
def items(cls) -> List[Tuple[bytes,
DummyMessageContainingEnum.TestEnumType]]: ...
def items(cls) -> List[Tuple[bytes, DummyMessageContainingEnum.TestEnumType]]: ...
TEST_OPTION_ENUM_TYPE1: DummyMessageContainingEnum.TestEnumType
TEST_OPTION_ENUM_TYPE2: DummyMessageContainingEnum.TestEnumType
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class DummyMessageInvalidAsOptionType(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class CustomOptionMinIntegerValues(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class CustomOptionMaxIntegerValues(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class CustomOptionOtherValues(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class SettingRealsFromPositiveInts(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class SettingRealsFromNegativeInts(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class ComplexOptionType1(Message):
foo: int
foo2: int
foo3: int
foo4: RepeatedScalarFieldContainer[int]
def __init__(self,
foo: Optional[int] = ...,
foo2: Optional[int] = ...,
foo3: Optional[int] = ...,
foo4: Optional[Iterable[int]] = ...,
) -> None: ...
def __init__(
self, foo: Optional[int] = ..., foo2: Optional[int] = ..., foo3: Optional[int] = ..., foo4: Optional[Iterable[int]] = ...
) -> None: ...
class ComplexOptionType2(Message):
class ComplexOptionType4(Message):
waldo: int
def __init__(self,
waldo: Optional[int] = ...,
) -> None: ...
def __init__(self, waldo: Optional[int] = ...) -> None: ...
baz: int
@property
def bar(self) -> ComplexOptionType1: ...
@property
def fred(self) -> ComplexOptionType2.ComplexOptionType4: ...
@property
def barney(
self) -> RepeatedCompositeFieldContainer[ComplexOptionType2.ComplexOptionType4]: ...
def __init__(self,
bar: Optional[ComplexOptionType1] = ...,
baz: Optional[int] = ...,
fred: Optional[ComplexOptionType2.ComplexOptionType4] = ...,
barney: Optional[Iterable[ComplexOptionType2.ComplexOptionType4]] = ...,
) -> None: ...
def barney(self) -> RepeatedCompositeFieldContainer[ComplexOptionType2.ComplexOptionType4]: ...
def __init__(
self,
bar: Optional[ComplexOptionType1] = ...,
baz: Optional[int] = ...,
fred: Optional[ComplexOptionType2.ComplexOptionType4] = ...,
barney: Optional[Iterable[ComplexOptionType2.ComplexOptionType4]] = ...,
) -> None: ...
class ComplexOptionType3(Message):
class ComplexOptionType5(Message):
plugh: int
def __init__(self,
plugh: Optional[int] = ...,
) -> None: ...
def __init__(self, plugh: Optional[int] = ...) -> None: ...
qux: int
@property
def complexoptiontype5(self) -> ComplexOptionType3.ComplexOptionType5: ...
def __init__(self,
qux: Optional[int] = ...,
complexoptiontype5: Optional[ComplexOptionType3.ComplexOptionType5] = ...,
) -> None: ...
def __init__(
self, qux: Optional[int] = ..., complexoptiontype5: Optional[ComplexOptionType3.ComplexOptionType5] = ...
) -> None: ...
class ComplexOpt6(Message):
xyzzy: int
def __init__(self,
xyzzy: Optional[int] = ...,
) -> None: ...
def __init__(self, xyzzy: Optional[int] = ...) -> None: ...
class VariousComplexOptions(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class AggregateMessageSet(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class AggregateMessageSetElement(Message):
s: Text
def __init__(self,
s: Optional[Text] = ...,
) -> None: ...
def __init__(self, s: Optional[Text] = ...) -> None: ...
class Aggregate(Message):
i: int
s: Text
@property
def sub(self) -> Aggregate: ...
@property
def file(self) -> FileOptions: ...
@property
def mset(self) -> AggregateMessageSet: ...
def __init__(self,
i: Optional[int] = ...,
s: Optional[Text] = ...,
sub: Optional[Aggregate] = ...,
file: Optional[FileOptions] = ...,
mset: Optional[AggregateMessageSet] = ...,
) -> None: ...
def __init__(
self,
i: Optional[int] = ...,
s: Optional[Text] = ...,
sub: Optional[Aggregate] = ...,
file: Optional[FileOptions] = ...,
mset: Optional[AggregateMessageSet] = ...,
) -> None: ...
class AggregateMessage(Message):
fieldname: int
def __init__(self,
fieldname: Optional[int] = ...,
) -> None: ...
def __init__(self, fieldname: Optional[int] = ...) -> None: ...
class NestedOptionType(Message):
class NestedEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> NestedOptionType.NestedEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[NestedOptionType.NestedEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, NestedOptionType.NestedEnum]]: ...
NESTED_ENUM_VALUE: NestedOptionType.NestedEnum
class NestedMessage(Message):
nested_field: int
def __init__(self,
nested_field: Optional[int] = ...,
) -> None: ...
def __init__(self,
) -> None: ...
def __init__(self, nested_field: Optional[int] = ...) -> None: ...
def __init__(self,) -> None: ...
class OldOptionType(Message):
class TestEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> OldOptionType.TestEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[OldOptionType.TestEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, OldOptionType.TestEnum]]: ...
OLD_VALUE: OldOptionType.TestEnum
value: OldOptionType.TestEnum
def __init__(self,
value: OldOptionType.TestEnum,
) -> None: ...
def __init__(self, value: OldOptionType.TestEnum) -> None: ...
class NewOptionType(Message):
class TestEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> NewOptionType.TestEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[NewOptionType.TestEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, NewOptionType.TestEnum]]: ...
OLD_VALUE: NewOptionType.TestEnum
NEW_VALUE: NewOptionType.TestEnum
value: NewOptionType.TestEnum
def __init__(self,
value: NewOptionType.TestEnum,
) -> None: ...
def __init__(self, value: NewOptionType.TestEnum) -> None: ...
class TestMessageWithRequiredEnumOption(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...

View File

@@ -1,64 +1,38 @@
from google.protobuf.message import (
Message,
)
from typing import (
List,
Optional,
Tuple,
cast,
)
from google.protobuf.message import Message
from typing import List, Optional, Tuple, cast
class ImportEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> ImportEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[ImportEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, ImportEnum]]: ...
IMPORT_FOO: ImportEnum
IMPORT_BAR: ImportEnum
IMPORT_BAZ: ImportEnum
class ImportEnumForMap(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> ImportEnumForMap: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[ImportEnumForMap]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, ImportEnumForMap]]: ...
UNKNOWN: ImportEnumForMap
FOO: ImportEnumForMap
BAR: ImportEnumForMap
class ImportMessage(Message):
d: int
def __init__(self,
d: Optional[int] = ...,
) -> None: ...
def __init__(self, d: Optional[int] = ...) -> None: ...

View File

@@ -1,15 +1,6 @@
from google.protobuf.message import (
Message,
)
from typing import (
Optional,
)
from google.protobuf.message import Message
from typing import Optional
class PublicImportMessage(Message):
e: int
def __init__(self,
e: Optional[int] = ...,
) -> None: ...
def __init__(self, e: Optional[int] = ...) -> None: ...

View File

@@ -1,61 +1,27 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.unittest_mset_wire_format_pb2 import (
TestMessageSet,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from google.protobuf.unittest_mset_wire_format_pb2 import TestMessageSet
import builtins
from typing import (
Iterable,
Optional,
Text,
)
from typing import Iterable, Optional, Text
class TestMessageSetContainer(Message):
@property
def message_set(self) -> TestMessageSet: ...
def __init__(self,
message_set: Optional[TestMessageSet] = ...,
) -> None: ...
def __init__(self, message_set: Optional[TestMessageSet] = ...) -> None: ...
class TestMessageSetExtension1(Message):
i: int
def __init__(self,
i: Optional[int] = ...,
) -> None: ...
def __init__(self, i: Optional[int] = ...) -> None: ...
class TestMessageSetExtension2(Message):
str: Text
def __init__(self,
bytes: Optional[Text] = ...,
) -> None: ...
def __init__(self, bytes: Optional[Text] = ...) -> None: ...
class RawMessageSet(Message):
class Item(Message):
type_id: int
message: bytes
def __init__(self,
type_id: int,
message: bytes,
) -> None: ...
def __init__(self, type_id: int, message: bytes) -> None: ...
@property
def item(self) -> RepeatedCompositeFieldContainer[RawMessageSet.Item]: ...
def __init__(self,
item: Optional[Iterable[RawMessageSet.Item]] = ...,
) -> None: ...
def __init__(self, item: Optional[Iterable[RawMessageSet.Item]] = ...) -> None: ...

View File

@@ -1,23 +1,10 @@
from google.protobuf.message import (
Message,
)
from typing import (
Optional,
)
from google.protobuf.message import Message
from typing import Optional
class TestMessageSet(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...
class TestMessageSetWireFormatContainer(Message):
@property
def message_set(self) -> TestMessageSet: ...
def __init__(self,
message_set: Optional[TestMessageSet] = ...,
) -> None: ...
def __init__(self, message_set: Optional[TestMessageSet] = ...) -> None: ...

View File

@@ -1,15 +1,6 @@
from google.protobuf.message import (
Message,
)
from typing import (
Optional,
)
from google.protobuf.message import Message
from typing import Optional
class ImportNoArenaNestedMessage(Message):
d: int
def __init__(self,
d: Optional[int] = ...,
) -> None: ...
def __init__(self, d: Optional[int] = ...) -> None: ...

View File

@@ -1,235 +1,225 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.unittest_arena_pb2 import (
ArenaMessage,
)
from google.protobuf.unittest_import_pb2 import (
ImportEnum,
ImportMessage,
)
from google.protobuf.unittest_import_public_pb2 import (
PublicImportMessage,
)
from typing import (
Iterable,
List,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from google.protobuf.unittest_arena_pb2 import ArenaMessage
from google.protobuf.unittest_import_pb2 import ImportEnum, ImportMessage
from google.protobuf.unittest_import_public_pb2 import PublicImportMessage
from typing import Iterable, List, Optional, Text, Tuple, cast
class ForeignEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> ForeignEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[ForeignEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ...
FOREIGN_FOO: ForeignEnum
FOREIGN_BAR: ForeignEnum
FOREIGN_BAZ: ForeignEnum
class TestAllTypes(Message):
class NestedEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[TestAllTypes.NestedEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ...
FOO: TestAllTypes.NestedEnum
BAR: TestAllTypes.NestedEnum
BAZ: TestAllTypes.NestedEnum
NEG: TestAllTypes.NestedEnum
class NestedMessage(Message):
bb: int
def __init__(self,
bb: Optional[int] = ...,
) -> None: ...
def __init__(self, bb: Optional[int] = ...) -> None: ...
class OptionalGroup(Message):
a: int
def __init__(self,
a: Optional[int] = ...,
) -> None: ...
def __init__(self, a: Optional[int] = ...) -> None: ...
class RepeatedGroup(Message):
a: int
def __init__(self,
a: Optional[int] = ...,
) -> None: ...
def __init__(self, a: Optional[int] = ...) -> None: ...
optional_int32: int
optional_int64: int
optional_uint32: int
optional_uint64: int
optional_sint32: int
optional_sint64: int
optional_fixed32: int
optional_fixed64: int
optional_sfixed32: int
optional_sfixed64: int
optional_float: float
optional_double: float
optional_bool: bool
optional_string: Text
optional_bytes: bytes
optional_nested_enum: TestAllTypes.NestedEnum
optional_foreign_enum: ForeignEnum
optional_import_enum: ImportEnum
optional_string_piece: Text
optional_cord: Text
repeated_int32: RepeatedScalarFieldContainer[int]
repeated_int64: RepeatedScalarFieldContainer[int]
repeated_uint32: RepeatedScalarFieldContainer[int]
repeated_uint64: RepeatedScalarFieldContainer[int]
repeated_sint32: RepeatedScalarFieldContainer[int]
repeated_sint64: RepeatedScalarFieldContainer[int]
repeated_fixed32: RepeatedScalarFieldContainer[int]
repeated_fixed64: RepeatedScalarFieldContainer[int]
repeated_sfixed32: RepeatedScalarFieldContainer[int]
repeated_sfixed64: RepeatedScalarFieldContainer[int]
repeated_float: RepeatedScalarFieldContainer[float]
repeated_double: RepeatedScalarFieldContainer[float]
repeated_bool: RepeatedScalarFieldContainer[bool]
repeated_string: RepeatedScalarFieldContainer[Text]
repeated_bytes: RepeatedScalarFieldContainer[bytes]
repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum]
repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum]
repeated_import_enum: RepeatedScalarFieldContainer[ImportEnum]
repeated_string_piece: RepeatedScalarFieldContainer[Text]
repeated_cord: RepeatedScalarFieldContainer[Text]
default_int32: int
default_int64: int
default_uint32: int
default_uint64: int
default_sint32: int
default_sint64: int
default_fixed32: int
default_fixed64: int
default_sfixed32: int
default_sfixed64: int
default_float: float
default_double: float
default_bool: bool
default_string: Text
default_bytes: bytes
default_nested_enum: TestAllTypes.NestedEnum
default_foreign_enum: ForeignEnum
default_import_enum: ImportEnum
default_string_piece: Text
default_cord: Text
oneof_uint32: int
oneof_string: Text
oneof_bytes: bytes
@property
def optionalgroup(self) -> TestAllTypes.OptionalGroup: ...
@property
def optional_nested_message(self) -> TestAllTypes.NestedMessage: ...
@property
def optional_foreign_message(self) -> ForeignMessage: ...
@property
def optional_import_message(self) -> ImportMessage: ...
@property
def optional_public_import_message(self) -> PublicImportMessage: ...
@property
def optional_message(self) -> TestAllTypes.NestedMessage: ...
@property
def repeatedgroup(
self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ...
def repeatedgroup(self) -> RepeatedCompositeFieldContainer[TestAllTypes.RepeatedGroup]: ...
@property
def repeated_nested_message(
self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
@property
def repeated_foreign_message(
self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ...
def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ...
@property
def repeated_import_message(
self) -> RepeatedCompositeFieldContainer[ImportMessage]: ...
def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ...
@property
def repeated_lazy_message(
self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
@property
def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ...
@property
def lazy_oneof_nested_message(self) -> TestAllTypes.NestedMessage: ...
def __init__(self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optionalgroup: Optional[TestAllTypes.OptionalGroup] = ...,
optional_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessage] = ...,
optional_import_message: Optional[ImportMessage] = ...,
optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnum] = ...,
optional_import_enum: Optional[ImportEnum] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
optional_public_import_message: Optional[PublicImportMessage] = ...,
optional_message: Optional[TestAllTypes.NestedMessage] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ...,
repeated_import_message: Optional[Iterable[ImportMessage]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ...,
repeated_import_enum: Optional[Iterable[ImportEnum]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
default_int32: Optional[int] = ...,
default_int64: Optional[int] = ...,
default_uint32: Optional[int] = ...,
default_uint64: Optional[int] = ...,
default_sint32: Optional[int] = ...,
default_sint64: Optional[int] = ...,
default_fixed32: Optional[int] = ...,
default_fixed64: Optional[int] = ...,
default_sfixed32: Optional[int] = ...,
default_sfixed64: Optional[int] = ...,
default_float: Optional[float] = ...,
default_double: Optional[float] = ...,
default_bool: Optional[bool] = ...,
default_string: Optional[Text] = ...,
default_bytes: Optional[bytes] = ...,
default_nested_enum: Optional[TestAllTypes.NestedEnum] = ...,
default_foreign_enum: Optional[ForeignEnum] = ...,
default_import_enum: Optional[ImportEnum] = ...,
default_string_piece: Optional[Text] = ...,
default_cord: Optional[Text] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
lazy_oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
) -> None: ...
def __init__(
self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optionalgroup: Optional[TestAllTypes.OptionalGroup] = ...,
optional_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessage] = ...,
optional_import_message: Optional[ImportMessage] = ...,
optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnum] = ...,
optional_import_enum: Optional[ImportEnum] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
optional_public_import_message: Optional[PublicImportMessage] = ...,
optional_message: Optional[TestAllTypes.NestedMessage] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeatedgroup: Optional[Iterable[TestAllTypes.RepeatedGroup]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ...,
repeated_import_message: Optional[Iterable[ImportMessage]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ...,
repeated_import_enum: Optional[Iterable[ImportEnum]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
default_int32: Optional[int] = ...,
default_int64: Optional[int] = ...,
default_uint32: Optional[int] = ...,
default_uint64: Optional[int] = ...,
default_sint32: Optional[int] = ...,
default_sint64: Optional[int] = ...,
default_fixed32: Optional[int] = ...,
default_fixed64: Optional[int] = ...,
default_sfixed32: Optional[int] = ...,
default_sfixed64: Optional[int] = ...,
default_float: Optional[float] = ...,
default_double: Optional[float] = ...,
default_bool: Optional[bool] = ...,
default_string: Optional[Text] = ...,
default_bytes: Optional[bytes] = ...,
default_nested_enum: Optional[TestAllTypes.NestedEnum] = ...,
default_foreign_enum: Optional[ForeignEnum] = ...,
default_import_enum: Optional[ImportEnum] = ...,
default_string_piece: Optional[Text] = ...,
default_cord: Optional[Text] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
lazy_oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
) -> None: ...
class ForeignMessage(Message):
c: int
def __init__(self,
c: Optional[int] = ...,
) -> None: ...
def __init__(self, c: Optional[int] = ...) -> None: ...
class TestNoArenaMessage(Message):
@property
def arena_message(self) -> ArenaMessage: ...
def __init__(self,
arena_message: Optional[ArenaMessage] = ...,
) -> None: ...
def __init__(self, arena_message: Optional[ArenaMessage] = ...) -> None: ...

View File

@@ -1,38 +1,20 @@
from google.protobuf.message import (
Message,
)
from typing import (
List,
Optional,
Tuple,
cast,
)
from google.protobuf.message import Message
from typing import List, Optional, Tuple, cast
class TestEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> TestEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[TestEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, TestEnum]]: ...
FOO: TestEnum
class TestMessage(Message):
a: int
def __init__(self,
a: Optional[int] = ...,
) -> None: ...
def __init__(self, a: Optional[int] = ...) -> None: ...

File diff suppressed because it is too large Load Diff

View File

@@ -1,67 +1,36 @@
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.unittest_import_pb2 import (
ImportMessage,
)
from google.protobuf.unittest_import_public_pb2 import (
PublicImportMessage,
)
from typing import (
Iterable,
List,
Optional,
Text,
Tuple,
cast,
)
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from google.protobuf.unittest_import_pb2 import ImportMessage
from google.protobuf.unittest_import_public_pb2 import PublicImportMessage
from typing import Iterable, List, Optional, Text, Tuple, cast
class ForeignEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> ForeignEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[ForeignEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, ForeignEnum]]: ...
FOREIGN_ZERO: ForeignEnum
FOREIGN_FOO: ForeignEnum
FOREIGN_BAR: ForeignEnum
FOREIGN_BAZ: ForeignEnum
class TestAllTypes(Message):
class NestedEnum(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> TestAllTypes.NestedEnum: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[TestAllTypes.NestedEnum]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, TestAllTypes.NestedEnum]]: ...
ZERO: TestAllTypes.NestedEnum
@@ -69,106 +38,127 @@ class TestAllTypes(Message):
BAR: TestAllTypes.NestedEnum
BAZ: TestAllTypes.NestedEnum
NEG: TestAllTypes.NestedEnum
class NestedMessage(Message):
bb: int
def __init__(self,
bb: Optional[int] = ...,
) -> None: ...
def __init__(self, bb: Optional[int] = ...) -> None: ...
optional_int32: int
optional_int64: int
optional_uint32: int
optional_uint64: int
optional_sint32: int
optional_sint64: int
optional_fixed32: int
optional_fixed64: int
optional_sfixed32: int
optional_sfixed64: int
optional_float: float
optional_double: float
optional_bool: bool
optional_string: Text
optional_bytes: bytes
optional_nested_enum: TestAllTypes.NestedEnum
optional_foreign_enum: ForeignEnum
optional_string_piece: Text
optional_cord: Text
repeated_int32: RepeatedScalarFieldContainer[int]
repeated_int64: RepeatedScalarFieldContainer[int]
repeated_uint32: RepeatedScalarFieldContainer[int]
repeated_uint64: RepeatedScalarFieldContainer[int]
repeated_sint32: RepeatedScalarFieldContainer[int]
repeated_sint64: RepeatedScalarFieldContainer[int]
repeated_fixed32: RepeatedScalarFieldContainer[int]
repeated_fixed64: RepeatedScalarFieldContainer[int]
repeated_sfixed32: RepeatedScalarFieldContainer[int]
repeated_sfixed64: RepeatedScalarFieldContainer[int]
repeated_float: RepeatedScalarFieldContainer[float]
repeated_double: RepeatedScalarFieldContainer[float]
repeated_bool: RepeatedScalarFieldContainer[bool]
repeated_string: RepeatedScalarFieldContainer[Text]
repeated_bytes: RepeatedScalarFieldContainer[bytes]
repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum]
repeated_foreign_enum: RepeatedScalarFieldContainer[ForeignEnum]
repeated_string_piece: RepeatedScalarFieldContainer[Text]
repeated_cord: RepeatedScalarFieldContainer[Text]
oneof_uint32: int
oneof_string: Text
oneof_bytes: bytes
@property
def optional_nested_message(self) -> TestAllTypes.NestedMessage: ...
@property
def optional_foreign_message(self) -> ForeignMessage: ...
@property
def optional_import_message(self) -> ImportMessage: ...
@property
def optional_public_import_message(self) -> PublicImportMessage: ...
@property
def optional_lazy_message(self) -> TestAllTypes.NestedMessage: ...
@property
def optional_lazy_import_message(self) -> ImportMessage: ...
@property
def repeated_nested_message(
self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
@property
def repeated_foreign_message(
self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ...
def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ...
@property
def repeated_import_message(
self) -> RepeatedCompositeFieldContainer[ImportMessage]: ...
def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ...
@property
def repeated_lazy_message(
self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
def repeated_lazy_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
@property
def oneof_nested_message(self) -> TestAllTypes.NestedMessage: ...
def __init__(self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optional_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessage] = ...,
optional_import_message: Optional[ImportMessage] = ...,
optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnum] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
optional_public_import_message: Optional[PublicImportMessage] = ...,
optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ...,
optional_lazy_import_message: Optional[ImportMessage] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ...,
repeated_import_message: Optional[Iterable[ImportMessage]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
) -> None: ...
def __init__(
self,
optional_int32: Optional[int] = ...,
optional_int64: Optional[int] = ...,
optional_uint32: Optional[int] = ...,
optional_uint64: Optional[int] = ...,
optional_sint32: Optional[int] = ...,
optional_sint64: Optional[int] = ...,
optional_fixed32: Optional[int] = ...,
optional_fixed64: Optional[int] = ...,
optional_sfixed32: Optional[int] = ...,
optional_sfixed64: Optional[int] = ...,
optional_float: Optional[float] = ...,
optional_double: Optional[float] = ...,
optional_bool: Optional[bool] = ...,
optional_string: Optional[Text] = ...,
optional_bytes: Optional[bytes] = ...,
optional_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
optional_foreign_message: Optional[ForeignMessage] = ...,
optional_import_message: Optional[ImportMessage] = ...,
optional_nested_enum: Optional[TestAllTypes.NestedEnum] = ...,
optional_foreign_enum: Optional[ForeignEnum] = ...,
optional_string_piece: Optional[Text] = ...,
optional_cord: Optional[Text] = ...,
optional_public_import_message: Optional[PublicImportMessage] = ...,
optional_lazy_message: Optional[TestAllTypes.NestedMessage] = ...,
optional_lazy_import_message: Optional[ImportMessage] = ...,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_string: Optional[Iterable[Text]] = ...,
repeated_bytes: Optional[Iterable[bytes]] = ...,
repeated_nested_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
repeated_foreign_message: Optional[Iterable[ForeignMessage]] = ...,
repeated_import_message: Optional[Iterable[ImportMessage]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ...,
repeated_foreign_enum: Optional[Iterable[ForeignEnum]] = ...,
repeated_string_piece: Optional[Iterable[Text]] = ...,
repeated_cord: Optional[Iterable[Text]] = ...,
repeated_lazy_message: Optional[Iterable[TestAllTypes.NestedMessage]] = ...,
oneof_uint32: Optional[int] = ...,
oneof_nested_message: Optional[TestAllTypes.NestedMessage] = ...,
oneof_string: Optional[Text] = ...,
oneof_bytes: Optional[bytes] = ...,
) -> None: ...
class TestPackedTypes(Message):
packed_int32: RepeatedScalarFieldContainer[int]
@@ -185,24 +175,23 @@ class TestPackedTypes(Message):
packed_double: RepeatedScalarFieldContainer[float]
packed_bool: RepeatedScalarFieldContainer[bool]
packed_enum: RepeatedScalarFieldContainer[ForeignEnum]
def __init__(self,
packed_int32: Optional[Iterable[int]] = ...,
packed_int64: Optional[Iterable[int]] = ...,
packed_uint32: Optional[Iterable[int]] = ...,
packed_uint64: Optional[Iterable[int]] = ...,
packed_sint32: Optional[Iterable[int]] = ...,
packed_sint64: Optional[Iterable[int]] = ...,
packed_fixed32: Optional[Iterable[int]] = ...,
packed_fixed64: Optional[Iterable[int]] = ...,
packed_sfixed32: Optional[Iterable[int]] = ...,
packed_sfixed64: Optional[Iterable[int]] = ...,
packed_float: Optional[Iterable[float]] = ...,
packed_double: Optional[Iterable[float]] = ...,
packed_bool: Optional[Iterable[bool]] = ...,
packed_enum: Optional[Iterable[ForeignEnum]] = ...,
) -> None: ...
def __init__(
self,
packed_int32: Optional[Iterable[int]] = ...,
packed_int64: Optional[Iterable[int]] = ...,
packed_uint32: Optional[Iterable[int]] = ...,
packed_uint64: Optional[Iterable[int]] = ...,
packed_sint32: Optional[Iterable[int]] = ...,
packed_sint64: Optional[Iterable[int]] = ...,
packed_fixed32: Optional[Iterable[int]] = ...,
packed_fixed64: Optional[Iterable[int]] = ...,
packed_sfixed32: Optional[Iterable[int]] = ...,
packed_sfixed64: Optional[Iterable[int]] = ...,
packed_float: Optional[Iterable[float]] = ...,
packed_double: Optional[Iterable[float]] = ...,
packed_bool: Optional[Iterable[bool]] = ...,
packed_enum: Optional[Iterable[ForeignEnum]] = ...,
) -> None: ...
class TestUnpackedTypes(Message):
repeated_int32: RepeatedScalarFieldContainer[int]
@@ -219,53 +208,41 @@ class TestUnpackedTypes(Message):
repeated_double: RepeatedScalarFieldContainer[float]
repeated_bool: RepeatedScalarFieldContainer[bool]
repeated_nested_enum: RepeatedScalarFieldContainer[TestAllTypes.NestedEnum]
def __init__(self,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ...,
) -> None: ...
def __init__(
self,
repeated_int32: Optional[Iterable[int]] = ...,
repeated_int64: Optional[Iterable[int]] = ...,
repeated_uint32: Optional[Iterable[int]] = ...,
repeated_uint64: Optional[Iterable[int]] = ...,
repeated_sint32: Optional[Iterable[int]] = ...,
repeated_sint64: Optional[Iterable[int]] = ...,
repeated_fixed32: Optional[Iterable[int]] = ...,
repeated_fixed64: Optional[Iterable[int]] = ...,
repeated_sfixed32: Optional[Iterable[int]] = ...,
repeated_sfixed64: Optional[Iterable[int]] = ...,
repeated_float: Optional[Iterable[float]] = ...,
repeated_double: Optional[Iterable[float]] = ...,
repeated_bool: Optional[Iterable[bool]] = ...,
repeated_nested_enum: Optional[Iterable[TestAllTypes.NestedEnum]] = ...,
) -> None: ...
class NestedTestAllTypes(Message):
@property
def child(self) -> NestedTestAllTypes: ...
@property
def payload(self) -> TestAllTypes: ...
@property
def repeated_child(
self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ...
def __init__(self,
child: Optional[NestedTestAllTypes] = ...,
payload: Optional[TestAllTypes] = ...,
repeated_child: Optional[Iterable[NestedTestAllTypes]] = ...,
) -> None: ...
def repeated_child(self) -> RepeatedCompositeFieldContainer[NestedTestAllTypes]: ...
def __init__(
self,
child: Optional[NestedTestAllTypes] = ...,
payload: Optional[TestAllTypes] = ...,
repeated_child: Optional[Iterable[NestedTestAllTypes]] = ...,
) -> None: ...
class ForeignMessage(Message):
c: int
def __init__(self,
c: Optional[int] = ...,
) -> None: ...
def __init__(self, c: Optional[int] = ...) -> None: ...
class TestEmptyMessage(Message):
def __init__(self,
) -> None: ...
def __init__(self,) -> None: ...

View File

@@ -1,31 +1,11 @@
from google.protobuf.any_pb2 import (
Any,
)
from google.protobuf.duration_pb2 import (
Duration,
)
from google.protobuf.field_mask_pb2 import (
FieldMask,
)
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer,
)
from google.protobuf.message import (
Message,
)
from google.protobuf.struct_pb2 import (
ListValue,
Struct,
Value,
)
from google.protobuf.timestamp_pb2 import (
Timestamp,
)
from google.protobuf.unittest_pb2 import (
TestAllExtensions,
)
from google.protobuf.any_pb2 import Any
from google.protobuf.duration_pb2 import Duration
from google.protobuf.field_mask_pb2 import FieldMask
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
from google.protobuf.struct_pb2 import ListValue, Struct, Value
from google.protobuf.timestamp_pb2 import Timestamp
from google.protobuf.unittest_pb2 import TestAllExtensions
from google.protobuf.wrappers_pb2 import (
BoolValue,
BytesValue,
@@ -37,47 +17,26 @@ from google.protobuf.wrappers_pb2 import (
UInt32Value,
UInt64Value,
)
from typing import (
Iterable,
List,
Mapping,
MutableMapping,
Optional,
Text,
Tuple,
cast,
)
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, cast
class EnumType(int):
@classmethod
def Name(cls, number: int) -> bytes: ...
@classmethod
def Value(cls, name: bytes) -> EnumType: ...
@classmethod
def keys(cls) -> List[bytes]: ...
@classmethod
def values(cls) -> List[EnumType]: ...
@classmethod
def items(cls) -> List[Tuple[bytes, EnumType]]: ...
FOO: EnumType
BAR: EnumType
class MessageType(Message):
value: int
def __init__(self,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, value: Optional[int] = ...) -> None: ...
class TestMessage(Message):
bool_value: bool
@@ -100,467 +59,283 @@ class TestMessage(Message):
repeated_string_value: RepeatedScalarFieldContainer[Text]
repeated_bytes_value: RepeatedScalarFieldContainer[bytes]
repeated_enum_value: RepeatedScalarFieldContainer[EnumType]
@property
def message_value(self) -> MessageType: ...
@property
def repeated_message_value(
self) -> RepeatedCompositeFieldContainer[MessageType]: ...
def __init__(self,
bool_value: Optional[bool] = ...,
int32_value: Optional[int] = ...,
int64_value: Optional[int] = ...,
uint32_value: Optional[int] = ...,
uint64_value: Optional[int] = ...,
float_value: Optional[float] = ...,
double_value: Optional[float] = ...,
string_value: Optional[Text] = ...,
bytes_value: Optional[bytes] = ...,
enum_value: Optional[EnumType] = ...,
message_value: Optional[MessageType] = ...,
repeated_bool_value: Optional[Iterable[bool]] = ...,
repeated_int32_value: Optional[Iterable[int]] = ...,
repeated_int64_value: Optional[Iterable[int]] = ...,
repeated_uint32_value: Optional[Iterable[int]] = ...,
repeated_uint64_value: Optional[Iterable[int]] = ...,
repeated_float_value: Optional[Iterable[float]] = ...,
repeated_double_value: Optional[Iterable[float]] = ...,
repeated_string_value: Optional[Iterable[Text]] = ...,
repeated_bytes_value: Optional[Iterable[bytes]] = ...,
repeated_enum_value: Optional[Iterable[EnumType]] = ...,
repeated_message_value: Optional[Iterable[MessageType]] = ...,
) -> None: ...
def repeated_message_value(self) -> RepeatedCompositeFieldContainer[MessageType]: ...
def __init__(
self,
bool_value: Optional[bool] = ...,
int32_value: Optional[int] = ...,
int64_value: Optional[int] = ...,
uint32_value: Optional[int] = ...,
uint64_value: Optional[int] = ...,
float_value: Optional[float] = ...,
double_value: Optional[float] = ...,
string_value: Optional[Text] = ...,
bytes_value: Optional[bytes] = ...,
enum_value: Optional[EnumType] = ...,
message_value: Optional[MessageType] = ...,
repeated_bool_value: Optional[Iterable[bool]] = ...,
repeated_int32_value: Optional[Iterable[int]] = ...,
repeated_int64_value: Optional[Iterable[int]] = ...,
repeated_uint32_value: Optional[Iterable[int]] = ...,
repeated_uint64_value: Optional[Iterable[int]] = ...,
repeated_float_value: Optional[Iterable[float]] = ...,
repeated_double_value: Optional[Iterable[float]] = ...,
repeated_string_value: Optional[Iterable[Text]] = ...,
repeated_bytes_value: Optional[Iterable[bytes]] = ...,
repeated_enum_value: Optional[Iterable[EnumType]] = ...,
repeated_message_value: Optional[Iterable[MessageType]] = ...,
) -> None: ...
class TestOneof(Message):
oneof_int32_value: int
oneof_string_value: Text
oneof_bytes_value: bytes
oneof_enum_value: EnumType
@property
def oneof_message_value(self) -> MessageType: ...
def __init__(self,
oneof_int32_value: Optional[int] = ...,
oneof_string_value: Optional[Text] = ...,
oneof_bytes_value: Optional[bytes] = ...,
oneof_enum_value: Optional[EnumType] = ...,
oneof_message_value: Optional[MessageType] = ...,
) -> None: ...
def __init__(
self,
oneof_int32_value: Optional[int] = ...,
oneof_string_value: Optional[Text] = ...,
oneof_bytes_value: Optional[bytes] = ...,
oneof_enum_value: Optional[EnumType] = ...,
oneof_message_value: Optional[MessageType] = ...,
) -> None: ...
class TestMap(Message):
class BoolMapEntry(Message):
key: bool
value: int
def __init__(self,
key: Optional[bool] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ...
class Int32MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class Int64MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class Uint32MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class Uint64MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class StringMapEntry(Message):
key: Text
value: int
def __init__(self,
key: Optional[Text] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[int] = ...) -> None: ...
@property
def bool_map(self) -> MutableMapping[bool, int]: ...
@property
def int32_map(self) -> MutableMapping[int, int]: ...
@property
def int64_map(self) -> MutableMapping[int, int]: ...
@property
def uint32_map(self) -> MutableMapping[int, int]: ...
@property
def uint64_map(self) -> MutableMapping[int, int]: ...
@property
def string_map(self) -> MutableMapping[Text, int]: ...
def __init__(self,
bool_map: Optional[Mapping[bool, int]] = ...,
int32_map: Optional[Mapping[int, int]] = ...,
int64_map: Optional[Mapping[int, int]] = ...,
uint32_map: Optional[Mapping[int, int]] = ...,
uint64_map: Optional[Mapping[int, int]] = ...,
string_map: Optional[Mapping[Text, int]] = ...,
) -> None: ...
def __init__(
self,
bool_map: Optional[Mapping[bool, int]] = ...,
int32_map: Optional[Mapping[int, int]] = ...,
int64_map: Optional[Mapping[int, int]] = ...,
uint32_map: Optional[Mapping[int, int]] = ...,
uint64_map: Optional[Mapping[int, int]] = ...,
string_map: Optional[Mapping[Text, int]] = ...,
) -> None: ...
class TestNestedMap(Message):
class BoolMapEntry(Message):
key: bool
value: int
def __init__(self,
key: Optional[bool] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ...
class Int32MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class Int64MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class Uint32MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class Uint64MapEntry(Message):
key: int
value: int
def __init__(self,
key: Optional[int] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[int] = ..., value: Optional[int] = ...) -> None: ...
class StringMapEntry(Message):
key: Text
value: int
def __init__(self,
key: Optional[Text] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[int] = ...) -> None: ...
class MapMapEntry(Message):
key: Text
@property
def value(self) -> TestNestedMap: ...
def __init__(self,
key: Optional[Text] = ...,
value: Optional[TestNestedMap] = ...,
) -> None: ...
def __init__(self, key: Optional[Text] = ..., value: Optional[TestNestedMap] = ...) -> None: ...
@property
def bool_map(self) -> MutableMapping[bool, int]: ...
@property
def int32_map(self) -> MutableMapping[int, int]: ...
@property
def int64_map(self) -> MutableMapping[int, int]: ...
@property
def uint32_map(self) -> MutableMapping[int, int]: ...
@property
def uint64_map(self) -> MutableMapping[int, int]: ...
@property
def string_map(self) -> MutableMapping[Text, int]: ...
@property
def map_map(self) -> MutableMapping[Text, TestNestedMap]: ...
def __init__(self,
bool_map: Optional[Mapping[bool, int]] = ...,
int32_map: Optional[Mapping[int, int]] = ...,
int64_map: Optional[Mapping[int, int]] = ...,
uint32_map: Optional[Mapping[int, int]] = ...,
uint64_map: Optional[Mapping[int, int]] = ...,
string_map: Optional[Mapping[Text, int]] = ...,
map_map: Optional[Mapping[Text, TestNestedMap]] = ...,
) -> None: ...
def __init__(
self,
bool_map: Optional[Mapping[bool, int]] = ...,
int32_map: Optional[Mapping[int, int]] = ...,
int64_map: Optional[Mapping[int, int]] = ...,
uint32_map: Optional[Mapping[int, int]] = ...,
uint64_map: Optional[Mapping[int, int]] = ...,
string_map: Optional[Mapping[Text, int]] = ...,
map_map: Optional[Mapping[Text, TestNestedMap]] = ...,
) -> None: ...
class TestWrapper(Message):
@property
def bool_value(self) -> BoolValue: ...
@property
def int32_value(self) -> Int32Value: ...
@property
def int64_value(self) -> Int64Value: ...
@property
def uint32_value(self) -> UInt32Value: ...
@property
def uint64_value(self) -> UInt64Value: ...
@property
def float_value(self) -> FloatValue: ...
@property
def double_value(self) -> DoubleValue: ...
@property
def string_value(self) -> StringValue: ...
@property
def bytes_value(self) -> BytesValue: ...
@property
def repeated_bool_value(
self) -> RepeatedCompositeFieldContainer[BoolValue]: ...
def repeated_bool_value(self) -> RepeatedCompositeFieldContainer[BoolValue]: ...
@property
def repeated_int32_value(
self) -> RepeatedCompositeFieldContainer[Int32Value]: ...
def repeated_int32_value(self) -> RepeatedCompositeFieldContainer[Int32Value]: ...
@property
def repeated_int64_value(
self) -> RepeatedCompositeFieldContainer[Int64Value]: ...
def repeated_int64_value(self) -> RepeatedCompositeFieldContainer[Int64Value]: ...
@property
def repeated_uint32_value(
self) -> RepeatedCompositeFieldContainer[UInt32Value]: ...
def repeated_uint32_value(self) -> RepeatedCompositeFieldContainer[UInt32Value]: ...
@property
def repeated_uint64_value(
self) -> RepeatedCompositeFieldContainer[UInt64Value]: ...
def repeated_uint64_value(self) -> RepeatedCompositeFieldContainer[UInt64Value]: ...
@property
def repeated_float_value(
self) -> RepeatedCompositeFieldContainer[FloatValue]: ...
def repeated_float_value(self) -> RepeatedCompositeFieldContainer[FloatValue]: ...
@property
def repeated_double_value(
self) -> RepeatedCompositeFieldContainer[DoubleValue]: ...
def repeated_double_value(self) -> RepeatedCompositeFieldContainer[DoubleValue]: ...
@property
def repeated_string_value(
self) -> RepeatedCompositeFieldContainer[StringValue]: ...
def repeated_string_value(self) -> RepeatedCompositeFieldContainer[StringValue]: ...
@property
def repeated_bytes_value(
self) -> RepeatedCompositeFieldContainer[BytesValue]: ...
def __init__(self,
bool_value: Optional[BoolValue] = ...,
int32_value: Optional[Int32Value] = ...,
int64_value: Optional[Int64Value] = ...,
uint32_value: Optional[UInt32Value] = ...,
uint64_value: Optional[UInt64Value] = ...,
float_value: Optional[FloatValue] = ...,
double_value: Optional[DoubleValue] = ...,
string_value: Optional[StringValue] = ...,
bytes_value: Optional[BytesValue] = ...,
repeated_bool_value: Optional[Iterable[BoolValue]] = ...,
repeated_int32_value: Optional[Iterable[Int32Value]] = ...,
repeated_int64_value: Optional[Iterable[Int64Value]] = ...,
repeated_uint32_value: Optional[Iterable[UInt32Value]] = ...,
repeated_uint64_value: Optional[Iterable[UInt64Value]] = ...,
repeated_float_value: Optional[Iterable[FloatValue]] = ...,
repeated_double_value: Optional[Iterable[DoubleValue]] = ...,
repeated_string_value: Optional[Iterable[StringValue]] = ...,
repeated_bytes_value: Optional[Iterable[BytesValue]] = ...,
) -> None: ...
def repeated_bytes_value(self) -> RepeatedCompositeFieldContainer[BytesValue]: ...
def __init__(
self,
bool_value: Optional[BoolValue] = ...,
int32_value: Optional[Int32Value] = ...,
int64_value: Optional[Int64Value] = ...,
uint32_value: Optional[UInt32Value] = ...,
uint64_value: Optional[UInt64Value] = ...,
float_value: Optional[FloatValue] = ...,
double_value: Optional[DoubleValue] = ...,
string_value: Optional[StringValue] = ...,
bytes_value: Optional[BytesValue] = ...,
repeated_bool_value: Optional[Iterable[BoolValue]] = ...,
repeated_int32_value: Optional[Iterable[Int32Value]] = ...,
repeated_int64_value: Optional[Iterable[Int64Value]] = ...,
repeated_uint32_value: Optional[Iterable[UInt32Value]] = ...,
repeated_uint64_value: Optional[Iterable[UInt64Value]] = ...,
repeated_float_value: Optional[Iterable[FloatValue]] = ...,
repeated_double_value: Optional[Iterable[DoubleValue]] = ...,
repeated_string_value: Optional[Iterable[StringValue]] = ...,
repeated_bytes_value: Optional[Iterable[BytesValue]] = ...,
) -> None: ...
class TestTimestamp(Message):
@property
def value(self) -> Timestamp: ...
@property
def repeated_value(self) -> RepeatedCompositeFieldContainer[Timestamp]: ...
def __init__(self,
value: Optional[Timestamp] = ...,
repeated_value: Optional[Iterable[Timestamp]] = ...,
) -> None: ...
def __init__(self, value: Optional[Timestamp] = ..., repeated_value: Optional[Iterable[Timestamp]] = ...) -> None: ...
class TestDuration(Message):
@property
def value(self) -> Duration: ...
@property
def repeated_value(self) -> RepeatedCompositeFieldContainer[Duration]: ...
def __init__(self,
value: Optional[Duration] = ...,
repeated_value: Optional[Iterable[Duration]] = ...,
) -> None: ...
def __init__(self, value: Optional[Duration] = ..., repeated_value: Optional[Iterable[Duration]] = ...) -> None: ...
class TestFieldMask(Message):
@property
def value(self) -> FieldMask: ...
def __init__(self,
value: Optional[FieldMask] = ...,
) -> None: ...
def __init__(self, value: Optional[FieldMask] = ...) -> None: ...
class TestStruct(Message):
@property
def value(self) -> Struct: ...
@property
def repeated_value(self) -> RepeatedCompositeFieldContainer[Struct]: ...
def __init__(self,
value: Optional[Struct] = ...,
repeated_value: Optional[Iterable[Struct]] = ...,
) -> None: ...
def __init__(self, value: Optional[Struct] = ..., repeated_value: Optional[Iterable[Struct]] = ...) -> None: ...
class TestAny(Message):
@property
def value(self) -> Any: ...
@property
def repeated_value(self) -> RepeatedCompositeFieldContainer[Any]: ...
def __init__(self,
value: Optional[Any] = ...,
repeated_value: Optional[Iterable[Any]] = ...,
) -> None: ...
def __init__(self, value: Optional[Any] = ..., repeated_value: Optional[Iterable[Any]] = ...) -> None: ...
class TestValue(Message):
@property
def value(self) -> Value: ...
@property
def repeated_value(self) -> RepeatedCompositeFieldContainer[Value]: ...
def __init__(self,
value: Optional[Value] = ...,
repeated_value: Optional[Iterable[Value]] = ...,
) -> None: ...
def __init__(self, value: Optional[Value] = ..., repeated_value: Optional[Iterable[Value]] = ...) -> None: ...
class TestListValue(Message):
@property
def value(self) -> ListValue: ...
@property
def repeated_value(self) -> RepeatedCompositeFieldContainer[ListValue]: ...
def __init__(self,
value: Optional[ListValue] = ...,
repeated_value: Optional[Iterable[ListValue]] = ...,
) -> None: ...
def __init__(self, value: Optional[ListValue] = ..., repeated_value: Optional[Iterable[ListValue]] = ...) -> None: ...
class TestBoolValue(Message):
class BoolMapEntry(Message):
key: bool
value: int
def __init__(self,
key: Optional[bool] = ...,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, key: Optional[bool] = ..., value: Optional[int] = ...) -> None: ...
bool_value: bool
@property
def bool_map(self) -> MutableMapping[bool, int]: ...
def __init__(self,
bool_value: Optional[bool] = ...,
bool_map: Optional[Mapping[bool, int]] = ...,
) -> None: ...
def __init__(self, bool_value: Optional[bool] = ..., bool_map: Optional[Mapping[bool, int]] = ...) -> None: ...
class TestCustomJsonName(Message):
value: int
def __init__(self,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, value: Optional[int] = ...) -> None: ...
class TestExtensions(Message):
@property
def extensions(self) -> TestAllExtensions: ...
def __init__(self,
extensions: Optional[TestAllExtensions] = ...,
) -> None: ...
def __init__(self, extensions: Optional[TestAllExtensions] = ...) -> None: ...
class TestEnumValue(Message):
enum_value1: EnumType
enum_value2: EnumType
enum_value3: EnumType
def __init__(self,
enum_value1: Optional[EnumType] = ...,
enum_value2: Optional[EnumType] = ...,
enum_value3: Optional[EnumType] = ...,
) -> None: ...
def __init__(
self, enum_value1: Optional[EnumType] = ..., enum_value2: Optional[EnumType] = ..., enum_value3: Optional[EnumType] = ...
) -> None: ...

View File

@@ -1,80 +1,38 @@
from google.protobuf.message import (
Message,
)
from typing import (
Optional,
Text,
)
from google.protobuf.message import Message
from typing import Optional, Text
class DoubleValue(Message):
value: float
def __init__(self,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, value: Optional[float] = ...) -> None: ...
class FloatValue(Message):
value: float
def __init__(self,
value: Optional[float] = ...,
) -> None: ...
def __init__(self, value: Optional[float] = ...) -> None: ...
class Int64Value(Message):
value: int
def __init__(self,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, value: Optional[int] = ...) -> None: ...
class UInt64Value(Message):
value: int
def __init__(self,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, value: Optional[int] = ...) -> None: ...
class Int32Value(Message):
value: int
def __init__(self,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, value: Optional[int] = ...) -> None: ...
class UInt32Value(Message):
value: int
def __init__(self,
value: Optional[int] = ...,
) -> None: ...
def __init__(self, value: Optional[int] = ...) -> None: ...
class BoolValue(Message):
value: bool
def __init__(self,
value: Optional[bool] = ...,
) -> None: ...
def __init__(self, value: Optional[bool] = ...) -> None: ...
class StringValue(Message):
value: Text
def __init__(self,
value: Optional[Text] = ...,
) -> None: ...
def __init__(self, value: Optional[Text] = ...) -> None: ...
class BytesValue(Message):
value: bytes
def __init__(self,
value: Optional[bytes] = ...,
) -> None: ...
def __init__(self, value: Optional[bytes] = ...) -> None: ...