Protobuf stubs update using mypy-protobuf (#4785)

* Add script to generate protoc stubs using mypy-protobuf generated stubs

* Use generate_proto_stubs to generate stubs for protobuf 3.14.0

* Skip _pb2.pyi from flake8,black,isort,pytype
This commit is contained in:
Nipunn Koorapati
2020-11-25 18:48:26 +00:00
committed by GitHub
parent 04bfaf55f2
commit 9af49c0b69
34 changed files with 2755 additions and 4402 deletions

View File

@@ -22,5 +22,5 @@ per-file-ignores =
# We are checking with Python 3 but many of the stubs are Python 2 stubs.
builtins = StandardError,apply,basestring,buffer,cmp,coerce,execfile,file,intern,long,raw_input,reduce,reload,unichr,unicode,xrange
exclude = .venv*,@*,.git
exclude = .venv*,@*,.git,*_pb2.pyi
max-line-length = 130

View File

@@ -1,11 +1,13 @@
[tool.black]
line_length = 130
target_version = ["py37"]
exclude = ".*_pb2.pyi"
[tool.isort]
profile = "black"
combine_as_imports = true
line_length = 130
skip_glob = "*_pb2.pyi"
extra_standard_library = [
"typing_extensions",
"_typeshed",

66
scripts/generate_proto_stubs.sh Executable file
View File

@@ -0,0 +1,66 @@
#!/bin/bash
# Some of the proto .pyi stubs in third_party/2and3/google/protobuf/
# are autogenerated using the mypy-protobuf project on the
# latest `.proto` files shipped with protoc.
#
# When run, this script will autogenerate the _pb2.pyi stubs to
# third_party/2and3/google/protobuf. It should be run any time there's
# a meaningful update to either PROTOBUF_VERSION or MYPY_PROTOBUF_VERSION,
# followed by committing the changes to typeshed
#
# Update these two variables when rerunning script
PROTOBUF_VERSION=3.14.0
MYPY_PROTOBUF_VERSION=v1.23
set -ex
if uname -a | grep Darwin; then
PLAT=osx
else
PLAT=linux
fi
REPO_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..)
TMP_DIR=$(mktemp -d)
PYTHON_PROTOBUF_FILENAME=protobuf-python-${PROTOBUF_VERSION}.zip
PROTOC_FILENAME=protoc-${PROTOBUF_VERSION}-${PLAT}-x86_64.zip
PROTOC_URL=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_FILENAME}
PYTHON_PROTOBUF_URL=https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/${PYTHON_PROTOBUF_FILENAME}
cd $TMP_DIR
echo "Working in $TMP_DIR"
# Install protoc
wget $PROTOC_URL
mkdir protoc_install
unzip $PROTOC_FILENAME -d protoc_install
# Fetch protoc-python (which contains all the .proto files)
wget $PYTHON_PROTOBUF_URL
unzip $PYTHON_PROTOBUF_FILENAME
PYTHON_PROTOBUF_DIR=protobuf-$PROTOBUF_VERSION
# Install mypy-protobuf
VENV=venv
python3 -m virtualenv $VENV
source $VENV/bin/activate
python3 -m pip install git+https://github.com/dropbox/mypy-protobuf@${MYPY_PROTOBUF_VERSION}#subdirectory=python
# Remove existing pyi
find $REPO_ROOT/third_party/2and3/ -name "*_pb2.pyi" -delete
# Roughly reproduce the subset of .proto files on the public interface as described
# by find_package_modules in the protobuf setup.py.
# The logic (as of 3.14.0) can roughly be described as a whitelist of .proto files
# further limited to exclude *test* and internal/
# https://github.com/protocolbuffers/protobuf/blob/master/python/setup.py
PROTO_FILES=$(grep "generate_proto.*google" $PYTHON_PROTOBUF_DIR/python/setup.py | \
cut -d\" -f2 | \
grep -v "test" | \
grep -v google/protobuf/internal/ | \
grep -v google/protobuf/pyext/python.proto | \
sed "s:^:$PYTHON_PROTOBUF_DIR/python/:" | \
xargs -L1 realpath --relative-to=. \
)
# And regenerate!
protoc_install/bin/protoc --proto_path=$PYTHON_PROTOBUF_DIR/src --mypy_out=$REPO_ROOT/third_party/2and3 $PROTO_FILES

View File

@@ -16,3 +16,31 @@ third_party/2and3/attr/converters.pyi
third_party/2and3/attr/filters.pyi
third_party/2and3/attr/validators.pyi
third_party/2and3/pynamodb/models.pyi
# _pb2.pyi have some constructs that break pytype
# Eg
# pytype.pyi.parser.ParseError: File: "/Users/nipunn/src/typeshed/third_party/2and3/google/protobuf/descriptor_pb2.pyi", line 195
# b"TypeValue = typing___NewType('TypeValue', builtin___int)"
third_party/2and3/google/protobuf/any_pb2.pyi
third_party/2and3/google/protobuf/api_pb2.pyi
third_party/2and3/google/protobuf/compiler/plugin_pb2.pyi
third_party/2and3/google/protobuf/descriptor.pyi
third_party/2and3/google/protobuf/descriptor_pb2.pyi
third_party/2and3/google/protobuf/duration_pb2.pyi
third_party/2and3/google/protobuf/empty_pb2.pyi
third_party/2and3/google/protobuf/field_mask_pb2.pyi
third_party/2and3/google/protobuf/internal/containers.pyi
third_party/2and3/google/protobuf/internal/enum_type_wrapper.pyi
third_party/2and3/google/protobuf/internal/extension_dict.pyi
third_party/2and3/google/protobuf/json_format.pyi
third_party/2and3/google/protobuf/message.pyi
third_party/2and3/google/protobuf/message_factory.pyi
third_party/2and3/google/protobuf/service.pyi
third_party/2and3/google/protobuf/source_context_pb2.pyi
third_party/2and3/google/protobuf/struct_pb2.pyi
third_party/2and3/google/protobuf/symbol_database.pyi
third_party/2and3/google/protobuf/timestamp_pb2.pyi
third_party/2and3/google/protobuf/type_pb2.pyi
third_party/2and3/google/protobuf/util/json_format_pb2.pyi
third_party/2and3/google/protobuf/util/json_format_proto3_pb2.pyi
third_party/2and3/google/protobuf/wrappers_pb2.pyi

View File

@@ -1,9 +1,41 @@
from typing import Optional, Text
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.internal import well_known_types
from google.protobuf.message import Message
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
class Any(Message, well_known_types.Any_):
type_url: Text
value: bytes
def __init__(self, type_url: Optional[Text] = ..., value: Optional[bytes] = ...) -> None: ...
from typing import (
Optional as typing___Optional,
Text as typing___Text,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class Any(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
type_url: typing___Text = ...
value: builtin___bytes = ...
def __init__(self,
*,
type_url : typing___Optional[typing___Text] = None,
value : typing___Optional[builtin___bytes] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"type_url",b"type_url",u"value",b"value"]) -> None: ...
type___Any = Any

View File

@@ -1,15 +0,0 @@
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
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: ...

View File

@@ -1,54 +1,112 @@
from typing import Iterable, Optional, Text
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
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 google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer,
)
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: ...
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
class Method(Message):
name: Text
request_type_url: Text
request_streaming: bool
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: ...
from google.protobuf.source_context_pb2 import (
SourceContext as google___protobuf___source_context_pb2___SourceContext,
)
class Mixin(Message):
name: Text
root: Text
def __init__(self, name: Optional[Text] = ..., root: Optional[Text] = ...) -> None: ...
from google.protobuf.type_pb2 import (
Option as google___protobuf___type_pb2___Option,
SyntaxValue as google___protobuf___type_pb2___SyntaxValue,
)
from typing import (
Iterable as typing___Iterable,
Optional as typing___Optional,
Text as typing___Text,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class Api(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
version: typing___Text = ...
syntax: google___protobuf___type_pb2___SyntaxValue = ...
@property
def methods(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Method]: ...
@property
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___type_pb2___Option]: ...
@property
def source_context(self) -> google___protobuf___source_context_pb2___SourceContext: ...
@property
def mixins(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Mixin]: ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
methods : typing___Optional[typing___Iterable[type___Method]] = None,
options : typing___Optional[typing___Iterable[google___protobuf___type_pb2___Option]] = None,
version : typing___Optional[typing___Text] = None,
source_context : typing___Optional[google___protobuf___source_context_pb2___SourceContext] = None,
mixins : typing___Optional[typing___Iterable[type___Mixin]] = None,
syntax : typing___Optional[google___protobuf___type_pb2___SyntaxValue] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"source_context",b"source_context"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"methods",b"methods",u"mixins",b"mixins",u"name",b"name",u"options",b"options",u"source_context",b"source_context",u"syntax",b"syntax",u"version",b"version"]) -> None: ...
type___Api = Api
class Method(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
request_type_url: typing___Text = ...
request_streaming: builtin___bool = ...
response_type_url: typing___Text = ...
response_streaming: builtin___bool = ...
syntax: google___protobuf___type_pb2___SyntaxValue = ...
@property
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___type_pb2___Option]: ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
request_type_url : typing___Optional[typing___Text] = None,
request_streaming : typing___Optional[builtin___bool] = None,
response_type_url : typing___Optional[typing___Text] = None,
response_streaming : typing___Optional[builtin___bool] = None,
options : typing___Optional[typing___Iterable[google___protobuf___type_pb2___Option]] = None,
syntax : typing___Optional[google___protobuf___type_pb2___SyntaxValue] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"options",b"options",u"request_streaming",b"request_streaming",u"request_type_url",b"request_type_url",u"response_streaming",b"response_streaming",u"response_type_url",b"response_type_url",u"syntax",b"syntax"]) -> None: ...
type___Method = Method
class Mixin(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
root: typing___Text = ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
root : typing___Optional[typing___Text] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"root",b"root"]) -> None: ...
type___Mixin = Mixin

View File

@@ -1,50 +1,135 @@
from typing import Iterable, Optional, Text
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
EnumDescriptor as google___protobuf___descriptor___EnumDescriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.descriptor_pb2 import FileDescriptorProto
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper
from google.protobuf.message import Message
from google.protobuf.descriptor_pb2 import (
FileDescriptorProto as google___protobuf___descriptor_pb2___FileDescriptorProto,
GeneratedCodeInfo as google___protobuf___descriptor_pb2___GeneratedCodeInfo,
)
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: ...
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer,
)
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: ...
from google.protobuf.internal.enum_type_wrapper import (
_EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper,
)
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] = ...
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
from typing import (
Iterable as typing___Iterable,
NewType as typing___NewType,
Optional as typing___Optional,
Text as typing___Text,
cast as typing___cast,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class Version(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
major: builtin___int = ...
minor: builtin___int = ...
patch: builtin___int = ...
suffix: typing___Text = ...
def __init__(self,
*,
major : typing___Optional[builtin___int] = None,
minor : typing___Optional[builtin___int] = None,
patch : typing___Optional[builtin___int] = None,
suffix : typing___Optional[typing___Text] = None,
) -> None: ...
class _Feature(EnumTypeWrapper):
FEATURE_NONE: int
FEATURE_PROTO_3_OPTIONAL: int
Feature: CodeGeneratorResponse._Feature
FEATURE_NONE: int
FEATURE_PROTO_3_OPTIONAL: int
supported_features: int
error: Text
def HasField(self, field_name: typing_extensions___Literal[u"major",b"major",u"minor",b"minor",u"patch",b"patch",u"suffix",b"suffix"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"major",b"major",u"minor",b"minor",u"patch",b"patch",u"suffix",b"suffix"]) -> None: ...
type___Version = Version
class CodeGeneratorRequest(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
file_to_generate: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ...
parameter: typing___Text = ...
@property
def file(self) -> RepeatedCompositeFieldContainer[CodeGeneratorResponse.File]: ...
def __init__(self, error: Optional[Text] = ..., file: Optional[Iterable[CodeGeneratorResponse.File]] = ...) -> None: ...
def proto_file(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___descriptor_pb2___FileDescriptorProto]: ...
@property
def compiler_version(self) -> type___Version: ...
def __init__(self,
*,
file_to_generate : typing___Optional[typing___Iterable[typing___Text]] = None,
parameter : typing___Optional[typing___Text] = None,
proto_file : typing___Optional[typing___Iterable[google___protobuf___descriptor_pb2___FileDescriptorProto]] = None,
compiler_version : typing___Optional[type___Version] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"compiler_version",b"compiler_version",u"parameter",b"parameter"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"compiler_version",b"compiler_version",u"file_to_generate",b"file_to_generate",u"parameter",b"parameter",u"proto_file",b"proto_file"]) -> None: ...
type___CodeGeneratorRequest = CodeGeneratorRequest
class CodeGeneratorResponse(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
FeatureValue = typing___NewType('FeatureValue', builtin___int)
type___FeatureValue = FeatureValue
Feature: _Feature
class _Feature(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[CodeGeneratorResponse.FeatureValue]):
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ...
FEATURE_NONE = typing___cast(CodeGeneratorResponse.FeatureValue, 0)
FEATURE_PROTO3_OPTIONAL = typing___cast(CodeGeneratorResponse.FeatureValue, 1)
FEATURE_NONE = typing___cast(CodeGeneratorResponse.FeatureValue, 0)
FEATURE_PROTO3_OPTIONAL = typing___cast(CodeGeneratorResponse.FeatureValue, 1)
type___Feature = Feature
class File(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
insertion_point: typing___Text = ...
content: typing___Text = ...
@property
def generated_code_info(self) -> google___protobuf___descriptor_pb2___GeneratedCodeInfo: ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
insertion_point : typing___Optional[typing___Text] = None,
content : typing___Optional[typing___Text] = None,
generated_code_info : typing___Optional[google___protobuf___descriptor_pb2___GeneratedCodeInfo] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"content",b"content",u"generated_code_info",b"generated_code_info",u"insertion_point",b"insertion_point",u"name",b"name"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"content",b"content",u"generated_code_info",b"generated_code_info",u"insertion_point",b"insertion_point",u"name",b"name"]) -> None: ...
type___File = File
error: typing___Text = ...
supported_features: builtin___int = ...
@property
def file(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___CodeGeneratorResponse.File]: ...
def __init__(self,
*,
error : typing___Optional[typing___Text] = None,
supported_features : typing___Optional[builtin___int] = None,
file : typing___Optional[typing___Iterable[type___CodeGeneratorResponse.File]] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"error",b"error",u"supported_features",b"supported_features"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"error",b"error",u"file",b"file",u"supported_features",b"supported_features"]) -> None: ...
type___CodeGeneratorResponse = CodeGeneratorResponse

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,40 @@
from typing import Optional
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.internal import well_known_types
from google.protobuf.message import Message
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
class Duration(Message, well_known_types.Duration):
seconds: int
nanos: int
def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ...
from typing import (
Optional as typing___Optional,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class Duration(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
seconds: builtin___int = ...
nanos: builtin___int = ...
def __init__(self,
*,
seconds : typing___Optional[builtin___int] = None,
nanos : typing___Optional[builtin___int] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"nanos",b"nanos",u"seconds",b"seconds"]) -> None: ...
type___Duration = Duration

View File

@@ -1,4 +1,20 @@
from google.protobuf.message import Message
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
class Empty(Message):
def __init__(self) -> None: ...
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class Empty(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
def __init__(self,
) -> None: ...
type___Empty = Empty

View File

@@ -1,9 +1,44 @@
from typing import Iterable, Optional, Text
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.internal import well_known_types
from google.protobuf.internal.containers import RepeatedScalarFieldContainer
from google.protobuf.message import Message
from google.protobuf.internal.containers import (
RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer,
)
class FieldMask(Message, well_known_types.FieldMask):
paths: RepeatedScalarFieldContainer[Text]
def __init__(self, paths: Optional[Iterable[Text]] = ...) -> None: ...
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
from typing import (
Iterable as typing___Iterable,
Optional as typing___Optional,
Text as typing___Text,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class FieldMask(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
paths: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ...
def __init__(self,
*,
paths : typing___Optional[typing___Iterable[typing___Text]] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"paths",b"paths"]) -> None: ...
type___FieldMask = FieldMask

View File

@@ -1,199 +0,0 @@
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.message import Message
from google.protobuf.unittest_import_pb2 import ImportEnumForMap
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: ...
class UnknownMapFieldEntry(Message):
key: int
value: Proto2MapEnum
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: ...
class TestEnumMapPlusExtra(Message):
class KnownMapFieldEntry(Message):
key: int
value: Proto2MapEnumPlusExtra
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: ...
@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: ...
class TestImportEnumMap(Message):
class ImportEnumAmpEntry(Message):
key: int
value: ImportEnumForMap
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: ...
class TestIntIntMap(Message):
class MEntry(Message):
key: int
value: int
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: ...
class TestMaps(Message):
class MInt32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
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: ...
class MUint32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
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: ...
class MSint32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
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: ...
class MFixed32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
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: ...
class MSfixed32Entry(Message):
key: int
@property
def value(self) -> TestIntIntMap: ...
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: ...
class MBoolEntry(Message):
key: bool
@property
def value(self) -> TestIntIntMap: ...
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: ...
@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: ...
class TestSubmessageMaps(Message):
@property
def m(self) -> TestMaps: ...
def __init__(self, m: Optional[TestMaps] = ...) -> None: ...

View File

@@ -1,376 +0,0 @@
from typing import List, Mapping, MutableMapping, Optional, Text, Tuple
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
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: ...
class MapInt64Int64Entry(Message):
key: int
value: int
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: ...
class MapUint64Uint64Entry(Message):
key: int
value: int
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: ...
class MapSint64Sint64Entry(Message):
key: int
value: int
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: ...
class MapFixed64Fixed64Entry(Message):
key: int
value: int
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: ...
class MapSfixed64Sfixed64Entry(Message):
key: int
value: int
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: ...
class MapInt32DoubleEntry(Message):
key: int
value: float
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: ...
class MapStringStringEntry(Message):
key: Text
value: Text
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: ...
class MapInt32EnumEntry(Message):
key: int
value: MapEnum
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: ...
class MapStringForeignMessageEntry(Message):
key: Text
@property
def value(self) -> ForeignMessage1: ...
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: ...
@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]: ...
@property
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: ...
class TestMapSubmessage(Message):
@property
def test_map(self) -> TestMap: ...
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: ...
@property
def map_int32_message(self) -> MutableMapping[int, TestAllTypes]: ...
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: ...
class Map2Entry(Message):
key: int
value: int
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: ...
class TestRequiredMessageMap(Message):
class MapFieldEntry(Message):
key: int
@property
def value(self) -> TestRequired: ...
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: ...
class TestArenaMap(Message):
class MapInt32Int32Entry(Message):
key: int
value: int
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: ...
class MapUint32Uint32Entry(Message):
key: int
value: int
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: ...
class MapSint32Sint32Entry(Message):
key: int
value: int
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: ...
class MapFixed32Fixed32Entry(Message):
key: int
value: int
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: ...
class MapSfixed32Sfixed32Entry(Message):
key: int
value: int
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: ...
class MapInt32FloatEntry(Message):
key: int
value: float
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: ...
class MapBoolBoolEntry(Message):
key: bool
value: bool
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: ...
class MapInt32BytesEntry(Message):
key: int
value: bytes
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: ...
class MapInt32ForeignMessageEntry(Message):
key: int
@property
def value(self) -> ForeignMessage1: ...
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: ...
@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]: ...
@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: ...
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]]: ...
TYPE_FOO: MessageContainingEnumCalledType.Type
class TypeEntry(Message):
key: Text
@property
def value(self) -> MessageContainingEnumCalledType: ...
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: ...
class MessageContainingMapCalledEntry(Message):
class EntryEntry(Message):
key: int
value: int
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: ...
class TestRecursiveMapMessage(Message):
class AEntry(Message):
key: Text
@property
def value(self) -> TestRecursiveMapMessage: ...
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: ...

View File

@@ -1,7 +1,39 @@
from typing import Optional, Text
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.message import Message
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
class SourceContext(Message):
file_name: Text
def __init__(self, file_name: Optional[Text] = ...) -> None: ...
from typing import (
Optional as typing___Optional,
Text as typing___Text,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class SourceContext(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
file_name: typing___Text = ...
def __init__(self,
*,
file_name : typing___Optional[typing___Text] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"file_name",b"file_name"]) -> None: ...
type___SourceContext = SourceContext

View File

@@ -1,55 +1,120 @@
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
EnumDescriptor as google___protobuf___descriptor___EnumDescriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.internal import well_known_types
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
from google.protobuf.message import Message
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer,
)
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]]: ...
from google.protobuf.internal.enum_type_wrapper import (
_EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper,
)
NULL_VALUE: NullValue
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
from typing import (
Iterable as typing___Iterable,
Mapping as typing___Mapping,
MutableMapping as typing___MutableMapping,
NewType as typing___NewType,
Optional as typing___Optional,
Text as typing___Text,
cast as typing___cast,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
NullValueValue = typing___NewType('NullValueValue', builtin___int)
type___NullValueValue = NullValueValue
NullValue: _NullValue
class _NullValue(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[NullValueValue]):
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ...
NULL_VALUE = typing___cast(NullValueValue, 0)
NULL_VALUE = typing___cast(NullValueValue, 0)
type___NullValue = NullValue
class Struct(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
class FieldsEntry(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
key: typing___Text = ...
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: ...
@property
def fields(self) -> MutableMapping[Text, Value]: ...
def __init__(self, fields: Optional[Mapping[Text, Value]] = ...) -> None: ...
def value(self) -> type___Value: ...
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,
*,
key : typing___Optional[typing___Text] = None,
value : typing___Optional[type___Value] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ...
type___FieldsEntry = FieldsEntry
Value = _Value
class ListValue(Message, well_known_types.ListValue):
@property
def values(self) -> RepeatedCompositeFieldContainer[Value]: ...
def __init__(self, values: Optional[Iterable[Value]] = ...) -> None: ...
def fields(self) -> typing___MutableMapping[typing___Text, type___Value]: ...
def __init__(self,
*,
fields : typing___Optional[typing___Mapping[typing___Text, type___Value]] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"fields",b"fields"]) -> None: ...
type___Struct = Struct
class Value(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
null_value: type___NullValueValue = ...
number_value: builtin___float = ...
string_value: typing___Text = ...
bool_value: builtin___bool = ...
@property
def struct_value(self) -> type___Struct: ...
@property
def list_value(self) -> type___ListValue: ...
def __init__(self,
*,
null_value : typing___Optional[type___NullValueValue] = None,
number_value : typing___Optional[builtin___float] = None,
string_value : typing___Optional[typing___Text] = None,
bool_value : typing___Optional[builtin___bool] = None,
struct_value : typing___Optional[type___Struct] = None,
list_value : typing___Optional[type___ListValue] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"bool_value",b"bool_value",u"kind",b"kind",u"list_value",b"list_value",u"null_value",b"null_value",u"number_value",b"number_value",u"string_value",b"string_value",u"struct_value",b"struct_value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"bool_value",b"bool_value",u"kind",b"kind",u"list_value",b"list_value",u"null_value",b"null_value",u"number_value",b"number_value",u"string_value",b"string_value",u"struct_value",b"struct_value"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions___Literal[u"kind",b"kind"]) -> typing_extensions___Literal["null_value","number_value","string_value","bool_value","struct_value","list_value"]: ...
type___Value = Value
class ListValue(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
@property
def values(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Value]: ...
def __init__(self,
*,
values : typing___Optional[typing___Iterable[type___Value]] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"values",b"values"]) -> None: ...
type___ListValue = ListValue

View File

@@ -1,345 +0,0 @@
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
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: ...
class MapInt32Int32Entry(Message):
key: int
value: int
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: ...
class MapUint32Uint32Entry(Message):
key: int
value: int
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: ...
class MapSint32Sint32Entry(Message):
key: int
value: int
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: ...
class MapFixed32Fixed32Entry(Message):
key: int
value: int
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: ...
class MapSfixed32Sfixed32Entry(Message):
key: int
value: int
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: ...
class MapInt32FloatEntry(Message):
key: int
value: float
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: ...
class MapBoolBoolEntry(Message):
key: bool
value: bool
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: ...
class MapStringBytesEntry(Message):
key: Text
value: bytes
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: ...
class MapStringForeignMessageEntry(Message):
key: Text
@property
def value(self) -> ForeignMessageProto2: ...
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: ...
class MapStringForeignEnumEntry(Message):
key: Text
value: ForeignEnumProto2
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: ...
class MessageSetCorrect(Message):
def __init__(self) -> None: ...
class MessageSetCorrectExtension1(Message):
bytes: Text
def __init__(self, bytes: Optional[Text] = ...) -> None: ...
class MessageSetCorrectExtension2(Message):
i: int
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]: ...
@property
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]: ...
@property
def map_string_foreign_message(self) -> MutableMapping[Text, ForeignMessageProto2]: ...
@property
def map_string_nested_enum(self) -> MutableMapping[Text, TestAllTypesProto2.NestedEnum]: ...
@property
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: ...
class ForeignMessageProto2(Message):
c: int
def __init__(self, c: Optional[int] = ...) -> None: ...

View File

@@ -1,436 +0,0 @@
from typing import Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple
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,
DoubleValue,
FloatValue,
Int32Value,
Int64Value,
StringValue,
UInt32Value,
UInt64Value,
)
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: ...
class MapInt32Int32Entry(Message):
key: int
value: int
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: ...
class MapUint32Uint32Entry(Message):
key: int
value: int
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: ...
class MapSint32Sint32Entry(Message):
key: int
value: int
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: ...
class MapFixed32Fixed32Entry(Message):
key: int
value: int
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: ...
class MapSfixed32Sfixed32Entry(Message):
key: int
value: int
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: ...
class MapInt32FloatEntry(Message):
key: int
value: float
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: ...
class MapBoolBoolEntry(Message):
key: bool
value: bool
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: ...
class MapStringBytesEntry(Message):
key: Text
value: bytes
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: ...
class MapStringForeignMessageEntry(Message):
key: Text
@property
def value(self) -> ForeignMessage: ...
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: ...
class MapStringForeignEnumEntry(Message):
key: Text
value: ForeignEnum
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: ...
class ForeignMessage(Message):
c: int
def __init__(self, c: Optional[int] = ...) -> None: ...

View File

@@ -1,9 +1,40 @@
from typing import Optional
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.internal import well_known_types
from google.protobuf.message import Message
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
class Timestamp(Message, well_known_types.Timestamp):
seconds: int
nanos: int
def __init__(self, seconds: Optional[int] = ..., nanos: Optional[int] = ...) -> None: ...
from typing import (
Optional as typing___Optional,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class Timestamp(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
seconds: builtin___int = ...
nanos: builtin___int = ...
def __init__(self,
*,
seconds : typing___Optional[builtin___int] = None,
nanos : typing___Optional[builtin___int] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"nanos",b"nanos",u"seconds",b"seconds"]) -> None: ...
type___Timestamp = Timestamp

View File

@@ -1,145 +1,238 @@
from typing import Iterable, List, Optional, Text, Tuple
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.any_pb2 import (
Any as google___protobuf___any_pb2___Any,
)
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 google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
EnumDescriptor as google___protobuf___descriptor___EnumDescriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
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]]: ...
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer,
)
SYNTAX_PROTO2: Syntax
SYNTAX_PROTO3: Syntax
from google.protobuf.internal.enum_type_wrapper import (
_EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper,
)
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: ...
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
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
TYPE_DOUBLE: Field.Kind
TYPE_FLOAT: Field.Kind
TYPE_INT64: Field.Kind
TYPE_UINT64: Field.Kind
TYPE_INT32: Field.Kind
TYPE_FIXED64: Field.Kind
TYPE_FIXED32: Field.Kind
TYPE_BOOL: Field.Kind
TYPE_STRING: Field.Kind
TYPE_GROUP: Field.Kind
TYPE_MESSAGE: Field.Kind
TYPE_BYTES: Field.Kind
TYPE_UINT32: Field.Kind
TYPE_ENUM: Field.Kind
TYPE_SFIXED32: Field.Kind
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
CARDINALITY_OPTIONAL: Field.Cardinality
CARDINALITY_REQUIRED: Field.Cardinality
CARDINALITY_REPEATED: Field.Cardinality
kind: Field.Kind
cardinality: Field.Cardinality
number: int
name: Text
type_url: Text
oneof_index: int
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: ...
from google.protobuf.source_context_pb2 import (
SourceContext as google___protobuf___source_context_pb2___SourceContext,
)
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: ...
from typing import (
Iterable as typing___Iterable,
NewType as typing___NewType,
Optional as typing___Optional,
Text as typing___Text,
cast as typing___cast,
)
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: ...
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
SyntaxValue = typing___NewType('SyntaxValue', builtin___int)
type___SyntaxValue = SyntaxValue
Syntax: _Syntax
class _Syntax(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[SyntaxValue]):
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ...
SYNTAX_PROTO2 = typing___cast(SyntaxValue, 0)
SYNTAX_PROTO3 = typing___cast(SyntaxValue, 1)
SYNTAX_PROTO2 = typing___cast(SyntaxValue, 0)
SYNTAX_PROTO3 = typing___cast(SyntaxValue, 1)
type___Syntax = Syntax
class Type(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
oneofs: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ...
syntax: type___SyntaxValue = ...
class Option(Message):
name: Text
@property
def value(self) -> Any: ...
def __init__(self, name: Optional[Text] = ..., value: Optional[Any] = ...) -> None: ...
def fields(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Field]: ...
@property
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ...
@property
def source_context(self) -> google___protobuf___source_context_pb2___SourceContext: ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
fields : typing___Optional[typing___Iterable[type___Field]] = None,
oneofs : typing___Optional[typing___Iterable[typing___Text]] = None,
options : typing___Optional[typing___Iterable[type___Option]] = None,
source_context : typing___Optional[google___protobuf___source_context_pb2___SourceContext] = None,
syntax : typing___Optional[type___SyntaxValue] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"source_context",b"source_context"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"fields",b"fields",u"name",b"name",u"oneofs",b"oneofs",u"options",b"options",u"source_context",b"source_context",u"syntax",b"syntax"]) -> None: ...
type___Type = Type
class Field(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
KindValue = typing___NewType('KindValue', builtin___int)
type___KindValue = KindValue
Kind: _Kind
class _Kind(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[Field.KindValue]):
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ...
TYPE_UNKNOWN = typing___cast(Field.KindValue, 0)
TYPE_DOUBLE = typing___cast(Field.KindValue, 1)
TYPE_FLOAT = typing___cast(Field.KindValue, 2)
TYPE_INT64 = typing___cast(Field.KindValue, 3)
TYPE_UINT64 = typing___cast(Field.KindValue, 4)
TYPE_INT32 = typing___cast(Field.KindValue, 5)
TYPE_FIXED64 = typing___cast(Field.KindValue, 6)
TYPE_FIXED32 = typing___cast(Field.KindValue, 7)
TYPE_BOOL = typing___cast(Field.KindValue, 8)
TYPE_STRING = typing___cast(Field.KindValue, 9)
TYPE_GROUP = typing___cast(Field.KindValue, 10)
TYPE_MESSAGE = typing___cast(Field.KindValue, 11)
TYPE_BYTES = typing___cast(Field.KindValue, 12)
TYPE_UINT32 = typing___cast(Field.KindValue, 13)
TYPE_ENUM = typing___cast(Field.KindValue, 14)
TYPE_SFIXED32 = typing___cast(Field.KindValue, 15)
TYPE_SFIXED64 = typing___cast(Field.KindValue, 16)
TYPE_SINT32 = typing___cast(Field.KindValue, 17)
TYPE_SINT64 = typing___cast(Field.KindValue, 18)
TYPE_UNKNOWN = typing___cast(Field.KindValue, 0)
TYPE_DOUBLE = typing___cast(Field.KindValue, 1)
TYPE_FLOAT = typing___cast(Field.KindValue, 2)
TYPE_INT64 = typing___cast(Field.KindValue, 3)
TYPE_UINT64 = typing___cast(Field.KindValue, 4)
TYPE_INT32 = typing___cast(Field.KindValue, 5)
TYPE_FIXED64 = typing___cast(Field.KindValue, 6)
TYPE_FIXED32 = typing___cast(Field.KindValue, 7)
TYPE_BOOL = typing___cast(Field.KindValue, 8)
TYPE_STRING = typing___cast(Field.KindValue, 9)
TYPE_GROUP = typing___cast(Field.KindValue, 10)
TYPE_MESSAGE = typing___cast(Field.KindValue, 11)
TYPE_BYTES = typing___cast(Field.KindValue, 12)
TYPE_UINT32 = typing___cast(Field.KindValue, 13)
TYPE_ENUM = typing___cast(Field.KindValue, 14)
TYPE_SFIXED32 = typing___cast(Field.KindValue, 15)
TYPE_SFIXED64 = typing___cast(Field.KindValue, 16)
TYPE_SINT32 = typing___cast(Field.KindValue, 17)
TYPE_SINT64 = typing___cast(Field.KindValue, 18)
type___Kind = Kind
CardinalityValue = typing___NewType('CardinalityValue', builtin___int)
type___CardinalityValue = CardinalityValue
Cardinality: _Cardinality
class _Cardinality(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[Field.CardinalityValue]):
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ...
CARDINALITY_UNKNOWN = typing___cast(Field.CardinalityValue, 0)
CARDINALITY_OPTIONAL = typing___cast(Field.CardinalityValue, 1)
CARDINALITY_REQUIRED = typing___cast(Field.CardinalityValue, 2)
CARDINALITY_REPEATED = typing___cast(Field.CardinalityValue, 3)
CARDINALITY_UNKNOWN = typing___cast(Field.CardinalityValue, 0)
CARDINALITY_OPTIONAL = typing___cast(Field.CardinalityValue, 1)
CARDINALITY_REQUIRED = typing___cast(Field.CardinalityValue, 2)
CARDINALITY_REPEATED = typing___cast(Field.CardinalityValue, 3)
type___Cardinality = Cardinality
kind: type___Field.KindValue = ...
cardinality: type___Field.CardinalityValue = ...
number: builtin___int = ...
name: typing___Text = ...
type_url: typing___Text = ...
oneof_index: builtin___int = ...
packed: builtin___bool = ...
json_name: typing___Text = ...
default_value: typing___Text = ...
@property
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ...
def __init__(self,
*,
kind : typing___Optional[type___Field.KindValue] = None,
cardinality : typing___Optional[type___Field.CardinalityValue] = None,
number : typing___Optional[builtin___int] = None,
name : typing___Optional[typing___Text] = None,
type_url : typing___Optional[typing___Text] = None,
oneof_index : typing___Optional[builtin___int] = None,
packed : typing___Optional[builtin___bool] = None,
options : typing___Optional[typing___Iterable[type___Option]] = None,
json_name : typing___Optional[typing___Text] = None,
default_value : typing___Optional[typing___Text] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"cardinality",b"cardinality",u"default_value",b"default_value",u"json_name",b"json_name",u"kind",b"kind",u"name",b"name",u"number",b"number",u"oneof_index",b"oneof_index",u"options",b"options",u"packed",b"packed",u"type_url",b"type_url"]) -> None: ...
type___Field = Field
class Enum(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
syntax: type___SyntaxValue = ...
@property
def enumvalue(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___EnumValue]: ...
@property
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ...
@property
def source_context(self) -> google___protobuf___source_context_pb2___SourceContext: ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
enumvalue : typing___Optional[typing___Iterable[type___EnumValue]] = None,
options : typing___Optional[typing___Iterable[type___Option]] = None,
source_context : typing___Optional[google___protobuf___source_context_pb2___SourceContext] = None,
syntax : typing___Optional[type___SyntaxValue] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"source_context",b"source_context"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"enumvalue",b"enumvalue",u"name",b"name",u"options",b"options",u"source_context",b"source_context",u"syntax",b"syntax"]) -> None: ...
type___Enum = Enum
class EnumValue(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
number: builtin___int = ...
@property
def options(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Option]: ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
number : typing___Optional[builtin___int] = None,
options : typing___Optional[typing___Iterable[type___Option]] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"number",b"number",u"options",b"options"]) -> None: ...
type___EnumValue = EnumValue
class Option(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
name: typing___Text = ...
@property
def value(self) -> google___protobuf___any_pb2___Any: ...
def __init__(self,
*,
name : typing___Optional[typing___Text] = None,
value : typing___Optional[google___protobuf___any_pb2___Any] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"name",b"name",u"value",b"value"]) -> None: ...
type___Option = Option

View File

@@ -1,20 +0,0 @@
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
class NestedMessage(Message):
d: int
def __init__(self, d: Optional[int] = ...) -> None: ...
class ArenaMessage(Message):
@property
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: ...

View File

@@ -1,227 +0,0 @@
from typing import Iterable, List, Optional, Text, Tuple
from google.protobuf.descriptor_pb2 import FileOptions
from google.protobuf.internal.containers import RepeatedCompositeFieldContainer, RepeatedScalarFieldContainer
from google.protobuf.message import Message
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]]: ...
ANENUM_VAL1: TestMessageWithCustomOptions.AnEnum
ANENUM_VAL2: TestMessageWithCustomOptions.AnEnum
field1: Text
oneof_field: int
def __init__(self, field1: Optional[Text] = ..., oneof_field: Optional[int] = ...) -> None: ...
class CustomOptionFooRequest(Message):
def __init__(self) -> None: ...
class CustomOptionFooResponse(Message):
def __init__(self) -> None: ...
class CustomOptionFooClientMessage(Message):
def __init__(self) -> None: ...
class CustomOptionFooServerMessage(Message):
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]]: ...
TEST_OPTION_ENUM_TYPE1: DummyMessageContainingEnum.TestEnumType
TEST_OPTION_ENUM_TYPE2: DummyMessageContainingEnum.TestEnumType
def __init__(self) -> None: ...
class DummyMessageInvalidAsOptionType(Message):
def __init__(self) -> None: ...
class CustomOptionMinIntegerValues(Message):
def __init__(self) -> None: ...
class CustomOptionMaxIntegerValues(Message):
def __init__(self) -> None: ...
class CustomOptionOtherValues(Message):
def __init__(self) -> None: ...
class SettingRealsFromPositiveInts(Message):
def __init__(self) -> None: ...
class SettingRealsFromNegativeInts(Message):
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: ...
class ComplexOptionType2(Message):
class ComplexOptionType4(Message):
waldo: int
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: ...
class ComplexOptionType3(Message):
class ComplexOptionType5(Message):
plugh: int
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: ...
class ComplexOpt6(Message):
xyzzy: int
def __init__(self, xyzzy: Optional[int] = ...) -> None: ...
class VariousComplexOptions(Message):
def __init__(self) -> None: ...
class AggregateMessageSet(Message):
def __init__(self) -> None: ...
class AggregateMessageSetElement(Message):
s: Text
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: ...
class AggregateMessage(Message):
fieldname: int
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: ...
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: ...
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: ...
class TestMessageWithRequiredEnumOption(Message):
def __init__(self) -> None: ...

View File

@@ -1,39 +0,0 @@
from typing import List, Optional, Tuple
from google.protobuf.message import Message
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: ...

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,226 +0,0 @@
from typing import Iterable, List, Optional, Text, Tuple
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
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: ...
class OptionalGroup(Message):
a: int
def __init__(self, a: Optional[int] = ...) -> None: ...
class RepeatedGroup(Message):
a: int
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]: ...
@property
def repeated_nested_message(self) -> RepeatedCompositeFieldContainer[TestAllTypes.NestedMessage]: ...
@property
def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ...
@property
def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ...
@property
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: ...
class ForeignMessage(Message):
c: int
def __init__(self, c: Optional[int] = ...) -> None: ...
class TestNoArenaMessage(Message):
@property
def arena_message(self) -> ArenaMessage: ...
def __init__(self, arena_message: Optional[ArenaMessage] = ...) -> None: ...

View File

@@ -1,21 +0,0 @@
from typing import List, Optional, Tuple
from google.protobuf.message import Message
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: ...

File diff suppressed because it is too large Load Diff

View File

@@ -1,249 +0,0 @@
from typing import Iterable, List, Optional, Text, Tuple
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
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
FOO: TestAllTypes.NestedEnum
BAR: TestAllTypes.NestedEnum
BAZ: TestAllTypes.NestedEnum
NEG: TestAllTypes.NestedEnum
class NestedMessage(Message):
bb: int
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]: ...
@property
def repeated_foreign_message(self) -> RepeatedCompositeFieldContainer[ForeignMessage]: ...
@property
def repeated_import_message(self) -> RepeatedCompositeFieldContainer[ImportMessage]: ...
@property
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: ...
class TestPackedTypes(Message):
packed_int32: RepeatedScalarFieldContainer[int]
packed_int64: RepeatedScalarFieldContainer[int]
packed_uint32: RepeatedScalarFieldContainer[int]
packed_uint64: RepeatedScalarFieldContainer[int]
packed_sint32: RepeatedScalarFieldContainer[int]
packed_sint64: RepeatedScalarFieldContainer[int]
packed_fixed32: RepeatedScalarFieldContainer[int]
packed_fixed64: RepeatedScalarFieldContainer[int]
packed_sfixed32: RepeatedScalarFieldContainer[int]
packed_sfixed64: RepeatedScalarFieldContainer[int]
packed_float: RepeatedScalarFieldContainer[float]
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: ...
class TestUnpackedTypes(Message):
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_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: ...
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: ...
class ForeignMessage(Message):
c: int
def __init__(self, c: Optional[int] = ...) -> None: ...
class TestEmptyMessage(Message):
def __init__(self) -> None: ...

View File

@@ -0,0 +1,329 @@
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
EnumDescriptor as google___protobuf___descriptor___EnumDescriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.internal.containers import (
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer,
RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer,
)
from google.protobuf.internal.enum_type_wrapper import (
_EnumTypeWrapper as google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper,
)
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
from typing import (
Iterable as typing___Iterable,
Mapping as typing___Mapping,
MutableMapping as typing___MutableMapping,
NewType as typing___NewType,
Optional as typing___Optional,
Text as typing___Text,
cast as typing___cast,
)
from typing_extensions import (
Literal as typing_extensions___Literal,
)
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class TestFlagsAndStrings(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
class RepeatedGroup(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
f: typing___Text = ...
def __init__(self,
*,
f : typing___Optional[typing___Text] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"f",b"f"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"f",b"f"]) -> None: ...
type___RepeatedGroup = RepeatedGroup
A: builtin___int = ...
@property
def repeatedgroup(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___TestFlagsAndStrings.RepeatedGroup]: ...
def __init__(self,
*,
A : typing___Optional[builtin___int] = None,
repeatedgroup : typing___Optional[typing___Iterable[type___TestFlagsAndStrings.RepeatedGroup]] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"A",b"A"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"A",b"A",u"repeatedgroup",b"repeatedgroup"]) -> None: ...
type___TestFlagsAndStrings = TestFlagsAndStrings
class TestBase64ByteArrays(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
a: builtin___bytes = ...
def __init__(self,
*,
a : typing___Optional[builtin___bytes] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"a",b"a"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"a",b"a"]) -> None: ...
type___TestBase64ByteArrays = TestBase64ByteArrays
class TestJavaScriptJSON(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
a: builtin___int = ...
final: builtin___float = ...
Var: typing___Text = ...
def __init__(self,
*,
a : typing___Optional[builtin___int] = None,
final : typing___Optional[builtin___float] = None,
Var : typing___Optional[typing___Text] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"Var",b"Var",u"a",b"a",u"final",b"final",u"in",b"in"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"Var",b"Var",u"a",b"a",u"final",b"final",u"in",b"in"]) -> None: ...
type___TestJavaScriptJSON = TestJavaScriptJSON
class TestJavaScriptOrderJSON1(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
d: builtin___int = ...
c: builtin___int = ...
x: builtin___bool = ...
b: builtin___int = ...
a: builtin___int = ...
def __init__(self,
*,
d : typing___Optional[builtin___int] = None,
c : typing___Optional[builtin___int] = None,
x : typing___Optional[builtin___bool] = None,
b : typing___Optional[builtin___int] = None,
a : typing___Optional[builtin___int] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b",u"c",b"c",u"d",b"d",u"x",b"x"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b",u"c",b"c",u"d",b"d",u"x",b"x"]) -> None: ...
type___TestJavaScriptOrderJSON1 = TestJavaScriptOrderJSON1
class TestJavaScriptOrderJSON2(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
d: builtin___int = ...
c: builtin___int = ...
x: builtin___bool = ...
b: builtin___int = ...
a: builtin___int = ...
@property
def z(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___TestJavaScriptOrderJSON1]: ...
def __init__(self,
*,
d : typing___Optional[builtin___int] = None,
c : typing___Optional[builtin___int] = None,
x : typing___Optional[builtin___bool] = None,
b : typing___Optional[builtin___int] = None,
a : typing___Optional[builtin___int] = None,
z : typing___Optional[typing___Iterable[type___TestJavaScriptOrderJSON1]] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b",u"c",b"c",u"d",b"d",u"x",b"x"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b",u"c",b"c",u"d",b"d",u"x",b"x",u"z",b"z"]) -> None: ...
type___TestJavaScriptOrderJSON2 = TestJavaScriptOrderJSON2
class TestLargeInt(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
a: builtin___int = ...
b: builtin___int = ...
def __init__(self,
*,
a : typing___Optional[builtin___int] = None,
b : typing___Optional[builtin___int] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b"]) -> None: ...
type___TestLargeInt = TestLargeInt
class TestNumbers(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
MyTypeValue = typing___NewType('MyTypeValue', builtin___int)
type___MyTypeValue = MyTypeValue
MyType: _MyType
class _MyType(google___protobuf___internal___enum_type_wrapper____EnumTypeWrapper[TestNumbers.MyTypeValue]):
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ...
OK = typing___cast(TestNumbers.MyTypeValue, 0)
WARNING = typing___cast(TestNumbers.MyTypeValue, 1)
ERROR = typing___cast(TestNumbers.MyTypeValue, 2)
OK = typing___cast(TestNumbers.MyTypeValue, 0)
WARNING = typing___cast(TestNumbers.MyTypeValue, 1)
ERROR = typing___cast(TestNumbers.MyTypeValue, 2)
type___MyType = MyType
a: type___TestNumbers.MyTypeValue = ...
b: builtin___int = ...
c: builtin___float = ...
d: builtin___bool = ...
e: builtin___float = ...
f: builtin___int = ...
def __init__(self,
*,
a : typing___Optional[type___TestNumbers.MyTypeValue] = None,
b : typing___Optional[builtin___int] = None,
c : typing___Optional[builtin___float] = None,
d : typing___Optional[builtin___bool] = None,
e : typing___Optional[builtin___float] = None,
f : typing___Optional[builtin___int] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b",u"c",b"c",u"d",b"d",u"e",b"e",u"f",b"f"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"a",b"a",u"b",b"b",u"c",b"c",u"d",b"d",u"e",b"e",u"f",b"f"]) -> None: ...
type___TestNumbers = TestNumbers
class TestCamelCase(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
normal_field: typing___Text = ...
CAPITAL_FIELD: builtin___int = ...
CamelCaseField: builtin___int = ...
def __init__(self,
*,
normal_field : typing___Optional[typing___Text] = None,
CAPITAL_FIELD : typing___Optional[builtin___int] = None,
CamelCaseField : typing___Optional[builtin___int] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"CAPITAL_FIELD",b"CAPITAL_FIELD",u"CamelCaseField",b"CamelCaseField",u"normal_field",b"normal_field"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"CAPITAL_FIELD",b"CAPITAL_FIELD",u"CamelCaseField",b"CamelCaseField",u"normal_field",b"normal_field"]) -> None: ...
type___TestCamelCase = TestCamelCase
class TestBoolMap(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
class BoolMapEntry(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
key: builtin___bool = ...
value: builtin___int = ...
def __init__(self,
*,
key : typing___Optional[builtin___bool] = None,
value : typing___Optional[builtin___int] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ...
type___BoolMapEntry = BoolMapEntry
@property
def bool_map(self) -> typing___MutableMapping[builtin___bool, builtin___int]: ...
def __init__(self,
*,
bool_map : typing___Optional[typing___Mapping[builtin___bool, builtin___int]] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"bool_map",b"bool_map"]) -> None: ...
type___TestBoolMap = TestBoolMap
class TestRecursion(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___int = ...
@property
def child(self) -> type___TestRecursion: ...
def __init__(self,
*,
value : typing___Optional[builtin___int] = None,
child : typing___Optional[type___TestRecursion] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"child",b"child",u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"child",b"child",u"value",b"value"]) -> None: ...
type___TestRecursion = TestRecursion
class TestStringMap(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
class StringMapEntry(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
key: typing___Text = ...
value: typing___Text = ...
def __init__(self,
*,
key : typing___Optional[typing___Text] = None,
value : typing___Optional[typing___Text] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ...
type___StringMapEntry = StringMapEntry
@property
def string_map(self) -> typing___MutableMapping[typing___Text, typing___Text]: ...
def __init__(self,
*,
string_map : typing___Optional[typing___Mapping[typing___Text, typing___Text]] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"string_map",b"string_map"]) -> None: ...
type___TestStringMap = TestStringMap
class TestStringSerializer(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
class StringMapEntry(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
key: typing___Text = ...
value: typing___Text = ...
def __init__(self,
*,
key : typing___Optional[typing___Text] = None,
value : typing___Optional[typing___Text] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ...
type___StringMapEntry = StringMapEntry
scalar_string: typing___Text = ...
repeated_string: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ...
@property
def string_map(self) -> typing___MutableMapping[typing___Text, typing___Text]: ...
def __init__(self,
*,
scalar_string : typing___Optional[typing___Text] = None,
repeated_string : typing___Optional[typing___Iterable[typing___Text]] = None,
string_map : typing___Optional[typing___Mapping[typing___Text, typing___Text]] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"scalar_string",b"scalar_string"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"repeated_string",b"repeated_string",u"scalar_string",b"scalar_string",u"string_map",b"string_map"]) -> None: ...
type___TestStringSerializer = TestStringSerializer
class TestMessageWithExtension(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
def __init__(self,
) -> None: ...
type___TestMessageWithExtension = TestMessageWithExtension
class TestExtension(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: typing___Text = ...
def __init__(self,
*,
value : typing___Optional[typing___Text] = None,
) -> None: ...
def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___TestExtension = TestExtension

File diff suppressed because it is too large Load Diff

View File

@@ -1,39 +1,127 @@
from typing import Optional, Text
# @generated by generate_proto_mypy_stubs.py. Do not edit!
import sys
from google.protobuf.descriptor import (
Descriptor as google___protobuf___descriptor___Descriptor,
FileDescriptor as google___protobuf___descriptor___FileDescriptor,
)
from google.protobuf.message import Message
from google.protobuf.message import (
Message as google___protobuf___message___Message,
)
class DoubleValue(Message):
value: float
def __init__(self, value: Optional[float] = ...) -> None: ...
from typing import (
Optional as typing___Optional,
Text as typing___Text,
)
class FloatValue(Message):
value: float
def __init__(self, value: Optional[float] = ...) -> None: ...
from typing_extensions import (
Literal as typing_extensions___Literal,
)
class Int64Value(Message):
value: int
def __init__(self, value: Optional[int] = ...) -> None: ...
class UInt64Value(Message):
value: int
def __init__(self, value: Optional[int] = ...) -> None: ...
builtin___bool = bool
builtin___bytes = bytes
builtin___float = float
builtin___int = int
class Int32Value(Message):
value: int
def __init__(self, value: Optional[int] = ...) -> None: ...
class UInt32Value(Message):
value: int
def __init__(self, value: Optional[int] = ...) -> None: ...
DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ...
class BoolValue(Message):
value: bool
def __init__(self, value: Optional[bool] = ...) -> None: ...
class DoubleValue(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___float = ...
class StringValue(Message):
value: Text
def __init__(self, value: Optional[Text] = ...) -> None: ...
def __init__(self,
*,
value : typing___Optional[builtin___float] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___DoubleValue = DoubleValue
class BytesValue(Message):
value: bytes
def __init__(self, value: Optional[bytes] = ...) -> None: ...
class FloatValue(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___float = ...
def __init__(self,
*,
value : typing___Optional[builtin___float] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___FloatValue = FloatValue
class Int64Value(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___int = ...
def __init__(self,
*,
value : typing___Optional[builtin___int] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___Int64Value = Int64Value
class UInt64Value(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___int = ...
def __init__(self,
*,
value : typing___Optional[builtin___int] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___UInt64Value = UInt64Value
class Int32Value(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___int = ...
def __init__(self,
*,
value : typing___Optional[builtin___int] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___Int32Value = Int32Value
class UInt32Value(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___int = ...
def __init__(self,
*,
value : typing___Optional[builtin___int] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___UInt32Value = UInt32Value
class BoolValue(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___bool = ...
def __init__(self,
*,
value : typing___Optional[builtin___bool] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___BoolValue = BoolValue
class StringValue(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: typing___Text = ...
def __init__(self,
*,
value : typing___Optional[typing___Text] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___StringValue = StringValue
class BytesValue(google___protobuf___message___Message):
DESCRIPTOR: google___protobuf___descriptor___Descriptor = ...
value: builtin___bytes = ...
def __init__(self,
*,
value : typing___Optional[builtin___bytes] = None,
) -> None: ...
def ClearField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> None: ...
type___BytesValue = BytesValue