From 7beaebff405a7e0adeb0a83cd517e1f3836c3139 Mon Sep 17 00:00:00 2001 From: Nipunn Koorapati Date: Thu, 25 Aug 2022 23:24:11 -0700 Subject: [PATCH] Bump to mypy-protobuf 3.3.0 (#8612) * Bump to mypy-protobuf 3.3.0 * Remove some ignores for formatting --- .flake8 | 4 +- pyproject.toml | 6 +- scripts/generate_proto_stubs.sh | 2 +- stubs/protobuf/METADATA.toml | 2 +- stubs/protobuf/google/protobuf/any_pb2.pyi | 55 +- stubs/protobuf/google/protobuf/api_pb2.pyi | 132 +-- .../google/protobuf/compiler/plugin_pb2.pyi | 132 +-- .../google/protobuf/descriptor_pb2.pyi | 798 +++++++++--------- .../protobuf/google/protobuf/duration_pb2.pyi | 53 +- stubs/protobuf/google/protobuf/empty_pb2.pyi | 37 +- .../google/protobuf/field_mask_pb2.pyi | 53 +- .../google/protobuf/source_context_pb2.pyi | 52 +- stubs/protobuf/google/protobuf/struct_pb2.pyi | 123 ++- .../google/protobuf/timestamp_pb2.pyi | 53 +- stubs/protobuf/google/protobuf/type_pb2.pyi | 255 +++--- .../protobuf/google/protobuf/wrappers_pb2.pyi | 140 +-- tests/check_new_syntax.py | 3 - 17 files changed, 1108 insertions(+), 792 deletions(-) diff --git a/.flake8 b/.flake8 index 8d1d4a3e8..7e2e59346 100644 --- a/.flake8 +++ b/.flake8 @@ -31,5 +31,7 @@ per-file-ignores = # https://github.com/PyCQA/flake8/issues/1079 # F811 redefinition of unused '...' stdlib/typing.pyi: E301, E302, E305, E501, E701, E741, F401, F403, F405, F811, F822, Y037 + # Generate protobuf files include docstrings + *_pb2.pyi: E301, E302, E305, E501, E701, Y021, Y026 -exclude = .venv*,.git,*_pb2.pyi +exclude = .venv*,.git diff --git a/pyproject.toml b/pyproject.toml index 73161bff3..a6285f887 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,17 @@ [tool.black] line_length = 130 target_version = ["py310"] -force-exclude = ".*_pb2.pyi" skip_magic_trailing_comma = true +# Exclude protobuf files because they have long line lengths +# Ideally, we could configure black to allow longer line lengths +# for just these files, but doesn't seem possible yet. +force-exclude = ".*_pb2.pyi" [tool.isort] profile = "black" combine_as_imports = true line_length = 130 skip = [".git", ".github", ".venv"] -skip_glob = "*_pb2.pyi" extra_standard_library = [ "typing_extensions", "_typeshed", diff --git a/scripts/generate_proto_stubs.sh b/scripts/generate_proto_stubs.sh index 2456bb61b..4677d36a8 100755 --- a/scripts/generate_proto_stubs.sh +++ b/scripts/generate_proto_stubs.sh @@ -12,7 +12,7 @@ set -ex -o pipefail # # Update these two variables when rerunning script PROTOBUF_VERSION=3.20.1 -MYPY_PROTOBUF_VERSION=v3.2.0 +MYPY_PROTOBUF_VERSION=v3.3.0 if uname -a | grep Darwin; then # brew install coreutils wget diff --git a/stubs/protobuf/METADATA.toml b/stubs/protobuf/METADATA.toml index 6fa7cd81f..6967a3b44 100644 --- a/stubs/protobuf/METADATA.toml +++ b/stubs/protobuf/METADATA.toml @@ -1,2 +1,2 @@ version = "3.20.*" -extra_description = "Generated with aid from mypy-protobuf v3.2.0" +extra_description = "Generated with aid from mypy-protobuf v3.3.0" diff --git a/stubs/protobuf/google/protobuf/any_pb2.pyi b/stubs/protobuf/google/protobuf/any_pb2.pyi index 4ab19dbb4..060b28cdf 100644 --- a/stubs/protobuf/google/protobuf/any_pb2.pyi +++ b/stubs/protobuf/google/protobuf/any_pb2.pyi @@ -1,13 +1,46 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -95,10 +128,12 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t "value": "1.212s" } """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TYPE_URL_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int - type_url: typing.Text + type_url: builtins.str """A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent @@ -127,14 +162,14 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t Schemes other than `http`, `https` (or the empty scheme) might be used with implementation specific semantics. """ - value: builtins.bytes """Must be a valid serialized protocol buffer of the above specified type.""" - - def __init__(self, + def __init__( + self, *, - type_url: typing.Optional[typing.Text] = ..., - value: typing.Optional[builtins.bytes] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["type_url",b"type_url","value",b"value"]) -> None: ... + type_url: builtins.str | None = ..., + value: builtins.bytes | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["type_url", b"type_url", "value", b"value"]) -> None: ... + global___Any = Any diff --git a/stubs/protobuf/google/protobuf/api_pb2.pyi b/stubs/protobuf/google/protobuf/api_pb2.pyi index d2d0ca52f..7c8a56033 100644 --- a/stubs/protobuf/google/protobuf/api_pb2.pyi +++ b/stubs/protobuf/google/protobuf/api_pb2.pyi @@ -1,15 +1,49 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import google.protobuf.source_context_pb2 import google.protobuf.type_pb2 -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -24,7 +58,9 @@ class Api(google.protobuf.message.Message): this message itself. See https://cloud.google.com/apis/design/glossary for detailed terminology. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int METHODS_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int @@ -32,20 +68,17 @@ class Api(google.protobuf.message.Message): SOURCE_CONTEXT_FIELD_NUMBER: builtins.int MIXINS_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The fully qualified name of this interface, including package name followed by the interface's simple name. """ - @property def methods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Method]: """The methods of this interface, in unspecified order.""" - pass @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]: """Any metadata attached to the interface.""" - pass - version: typing.Text + version: builtins.str """A version string for this interface. If specified, must have the form `major-version.minor-version`, as in `1.10`. If the minor version is omitted, it defaults to zero. If the entire version field is empty, the @@ -66,37 +99,37 @@ class Api(google.protobuf.message.Message): be omitted. Zero major versions must only be used for experimental, non-GA interfaces. """ - @property def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: """Source context for the protocol buffer service represented by this message. """ - pass @property def mixins(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Mixin]: """Included interfaces. See [Mixin][].""" - pass syntax: google.protobuf.type_pb2.Syntax.ValueType """The source syntax of the service.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - methods: typing.Optional[typing.Iterable[global___Method]] = ..., - options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ..., - version: typing.Optional[typing.Text] = ..., - source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ..., - mixins: typing.Optional[typing.Iterable[global___Mixin]] = ..., - syntax: typing.Optional[google.protobuf.type_pb2.Syntax.ValueType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["methods",b"methods","mixins",b"mixins","name",b"name","options",b"options","source_context",b"source_context","syntax",b"syntax","version",b"version"]) -> None: ... + name: builtins.str | None = ..., + methods: collections.abc.Iterable[global___Method] | None = ..., + options: collections.abc.Iterable[google.protobuf.type_pb2.Option] | None = ..., + version: builtins.str | None = ..., + source_context: google.protobuf.source_context_pb2.SourceContext | None = ..., + mixins: collections.abc.Iterable[global___Mixin] | None = ..., + syntax: google.protobuf.type_pb2.Syntax.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["source_context", b"source_context"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["methods", b"methods", "mixins", b"mixins", "name", b"name", "options", b"options", "source_context", b"source_context", "syntax", b"syntax", "version", b"version"]) -> None: ... + global___Api = Api class Method(google.protobuf.message.Message): """Method represents a method of an API interface.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int REQUEST_TYPE_URL_FIELD_NUMBER: builtins.int REQUEST_STREAMING_FIELD_NUMBER: builtins.int @@ -104,39 +137,34 @@ class Method(google.protobuf.message.Message): RESPONSE_STREAMING_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The simple name of this method.""" - - request_type_url: typing.Text + request_type_url: builtins.str """A URL of the input message type.""" - request_streaming: builtins.bool """If true, the request is streamed.""" - - response_type_url: typing.Text + response_type_url: builtins.str """The URL of the output message type.""" - response_streaming: builtins.bool """If true, the response is streamed.""" - @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]: """Any metadata attached to the method.""" - pass syntax: google.protobuf.type_pb2.Syntax.ValueType """The source syntax of this method.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - request_type_url: typing.Optional[typing.Text] = ..., - request_streaming: typing.Optional[builtins.bool] = ..., - response_type_url: typing.Optional[typing.Text] = ..., - response_streaming: typing.Optional[builtins.bool] = ..., - options: typing.Optional[typing.Iterable[google.protobuf.type_pb2.Option]] = ..., - syntax: typing.Optional[google.protobuf.type_pb2.Syntax.ValueType] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","request_streaming",b"request_streaming","request_type_url",b"request_type_url","response_streaming",b"response_streaming","response_type_url",b"response_type_url","syntax",b"syntax"]) -> None: ... + name: builtins.str | None = ..., + request_type_url: builtins.str | None = ..., + request_streaming: builtins.bool | None = ..., + response_type_url: builtins.str | None = ..., + response_streaming: builtins.bool | None = ..., + options: collections.abc.Iterable[google.protobuf.type_pb2.Option] | None = ..., + syntax: google.protobuf.type_pb2.Syntax.ValueType | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options", "request_streaming", b"request_streaming", "request_type_url", b"request_type_url", "response_streaming", b"response_streaming", "response_type_url", b"response_type_url", "syntax", b"syntax"]) -> None: ... + global___Method = Method class Mixin(google.protobuf.message.Message): @@ -219,21 +247,23 @@ class Mixin(google.protobuf.message.Message): ... } """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int ROOT_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The fully qualified name of the interface which is included.""" - - root: typing.Text + root: builtins.str """If non-empty specifies a path under which inherited HTTP paths are rooted. """ - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - root: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","root",b"root"]) -> None: ... + name: builtins.str | None = ..., + root: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "root", b"root"]) -> None: ... + global___Mixin = Mixin diff --git a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi index 543116729..5cdccb792 100644 --- a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi +++ b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi @@ -1,21 +1,44 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Author: kenton@google.com (Kenton Varda) + +WARNING: The plugin interface is currently EXPERIMENTAL and is subject to + change. + +protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +just a program that reads a CodeGeneratorRequest from stdin and writes a +CodeGeneratorResponse to stdout. + +Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +of dealing with the raw protocol defined here. + +A plugin executable needs only to be placed somewhere in the path. The +plugin should be named "protoc-gen-$NAME", and will then be used when the +flag "--${NAME}_out" is passed to protoc. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.descriptor_pb2 import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class Version(google.protobuf.message.Message): """The version number of protocol compiler.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + MAJOR_FIELD_NUMBER: builtins.int MINOR_FIELD_NUMBER: builtins.int PATCH_FIELD_NUMBER: builtins.int @@ -23,39 +46,40 @@ class Version(google.protobuf.message.Message): major: builtins.int minor: builtins.int patch: builtins.int - suffix: typing.Text + suffix: builtins.str """A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should be empty for mainline stable releases. """ - - def __init__(self, + def __init__( + self, *, - major: typing.Optional[builtins.int] = ..., - minor: typing.Optional[builtins.int] = ..., - patch: typing.Optional[builtins.int] = ..., - suffix: typing.Optional[typing.Text] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["major",b"major","minor",b"minor","patch",b"patch","suffix",b"suffix"]) -> None: ... + major: builtins.int | None = ..., + minor: builtins.int | None = ..., + patch: builtins.int | None = ..., + suffix: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix"]) -> None: ... + global___Version = Version class CodeGeneratorRequest(google.protobuf.message.Message): """An encoded CodeGeneratorRequest is written to the plugin's stdin.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FILE_TO_GENERATE_FIELD_NUMBER: builtins.int PARAMETER_FIELD_NUMBER: builtins.int PROTO_FILE_FIELD_NUMBER: builtins.int COMPILER_VERSION_FIELD_NUMBER: builtins.int @property - def file_to_generate(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def file_to_generate(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below. """ - pass - parameter: typing.Text + parameter: builtins.str """The generator parameter passed on the command-line.""" - @property def proto_file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.descriptor_pb2.FileDescriptorProto]: """FileDescriptorProtos for all files in files_to_generate and everything @@ -73,47 +97,52 @@ class CodeGeneratorRequest(google.protobuf.message.Message): Type names of fields and extensions in the FileDescriptorProto are always fully qualified. """ - pass @property def compiler_version(self) -> global___Version: """The version number of protocol compiler.""" - pass - def __init__(self, + def __init__( + self, *, - file_to_generate: typing.Optional[typing.Iterable[typing.Text]] = ..., - parameter: typing.Optional[typing.Text] = ..., - proto_file: typing.Optional[typing.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto]] = ..., - compiler_version: typing.Optional[global___Version] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","parameter",b"parameter"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["compiler_version",b"compiler_version","file_to_generate",b"file_to_generate","parameter",b"parameter","proto_file",b"proto_file"]) -> None: ... + file_to_generate: collections.abc.Iterable[builtins.str] | None = ..., + parameter: builtins.str | None = ..., + proto_file: collections.abc.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto] | None = ..., + compiler_version: global___Version | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["compiler_version", b"compiler_version", "parameter", b"parameter"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["compiler_version", b"compiler_version", "file_to_generate", b"file_to_generate", "parameter", b"parameter", "proto_file", b"proto_file"]) -> None: ... + global___CodeGeneratorRequest = CodeGeneratorRequest class CodeGeneratorResponse(google.protobuf.message.Message): """The plugin writes an encoded CodeGeneratorResponse to stdout.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Feature: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], builtins.type): + + class _FeatureEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor FEATURE_NONE: CodeGeneratorResponse._Feature.ValueType # 0 FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse._Feature.ValueType # 1 + class Feature(_Feature, metaclass=_FeatureEnumTypeWrapper): """Sync with code_generator.h.""" - pass FEATURE_NONE: CodeGeneratorResponse.Feature.ValueType # 0 FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse.Feature.ValueType # 1 class File(google.protobuf.message.Message): """Represents a single generated file.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int INSERTION_POINT_FIELD_NUMBER: builtins.int CONTENT_FIELD_NUMBER: builtins.int GENERATED_CODE_INFO_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The file name, relative to the output directory. The name must not contain "." or ".." components and must be relative, not be absolute (so, the file cannot lie outside the output directory). "/" must be used as @@ -126,8 +155,7 @@ class CodeGeneratorResponse(google.protobuf.message.Message): this writing protoc does not optimize for this -- it will read the entire CodeGeneratorResponse before writing files to disk. """ - - insertion_point: typing.Text + insertion_point: builtins.str """If non-empty, indicates that the named file should already exist, and the content here is to be inserted into that file at a defined insertion point. This feature allows a code generator to extend the output @@ -166,31 +194,29 @@ class CodeGeneratorResponse(google.protobuf.message.Message): If |insertion_point| is present, |name| must also be present. """ - - content: typing.Text + content: builtins.str """The file contents.""" - @property def generated_code_info(self) -> google.protobuf.descriptor_pb2.GeneratedCodeInfo: """Information describing the file content being inserted. If an insertion point is used, this information will be appropriately offset and inserted into the code generation metadata for the generated files. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - insertion_point: typing.Optional[typing.Text] = ..., - content: typing.Optional[typing.Text] = ..., - generated_code_info: typing.Optional[google.protobuf.descriptor_pb2.GeneratedCodeInfo] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["content",b"content","generated_code_info",b"generated_code_info","insertion_point",b"insertion_point","name",b"name"]) -> None: ... + name: builtins.str | None = ..., + insertion_point: builtins.str | None = ..., + content: builtins.str | None = ..., + generated_code_info: google.protobuf.descriptor_pb2.GeneratedCodeInfo | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["content", b"content", "generated_code_info", b"generated_code_info", "insertion_point", b"insertion_point", "name", b"name"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["content", b"content", "generated_code_info", b"generated_code_info", "insertion_point", b"insertion_point", "name", b"name"]) -> None: ... ERROR_FIELD_NUMBER: builtins.int SUPPORTED_FEATURES_FIELD_NUMBER: builtins.int FILE_FIELD_NUMBER: builtins.int - error: typing.Text + error: builtins.str """Error message. If non-empty, code generation failed. The plugin process should exit with status code zero even if it reports an error in this way. @@ -200,20 +226,20 @@ class CodeGeneratorResponse(google.protobuf.message.Message): unparseable -- should be reported by writing a message to stderr and exiting with a non-zero status code. """ - supported_features: builtins.int """A bitmask of supported features that the code generator supports. This is a bitwise "or" of values from the Feature enum. """ - @property def file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CodeGeneratorResponse.File]: ... - def __init__(self, + def __init__( + self, *, - error: typing.Optional[typing.Text] = ..., - supported_features: typing.Optional[builtins.int] = ..., - file: typing.Optional[typing.Iterable[global___CodeGeneratorResponse.File]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["error",b"error","supported_features",b"supported_features"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["error",b"error","file",b"file","supported_features",b"supported_features"]) -> None: ... + error: builtins.str | None = ..., + supported_features: builtins.int | None = ..., + file: collections.abc.Iterable[global___CodeGeneratorResponse.File] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["error", b"error", "supported_features", b"supported_features"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["error", b"error", "file", b"file", "supported_features", b"supported_features"]) -> None: ... + global___CodeGeneratorResponse = CodeGeneratorResponse diff --git a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index 8eb16f779..9ee7ef49b 100644 --- a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -1,14 +1,27 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Author: kenton@google.com (Kenton Varda) + Based on original Protocol Buffers design by + Sanjay Ghemawat, Jeff Dean, and others. + +The messages in this file describe the definitions found in .proto files. +A valid .proto file can be translated directly to a FileDescriptorProto +without any other information (e.g. without reading its imports). """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -16,20 +29,26 @@ class FileDescriptorSet(google.protobuf.message.Message): """The protocol compiler can output a FileDescriptorSet containing the .proto files it parses. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FILE_FIELD_NUMBER: builtins.int @property def file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FileDescriptorProto]: ... - def __init__(self, + def __init__( + self, *, - file: typing.Optional[typing.Iterable[global___FileDescriptorProto]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["file",b"file"]) -> None: ... + file: collections.abc.Iterable[global___FileDescriptorProto] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["file", b"file"]) -> None: ... + global___FileDescriptorSet = FileDescriptorSet class FileDescriptorProto(google.protobuf.message.Message): """Describes a complete .proto file.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int PACKAGE_FIELD_NUMBER: builtins.int DEPENDENCY_FIELD_NUMBER: builtins.int @@ -42,30 +61,24 @@ class FileDescriptorProto(google.protobuf.message.Message): OPTIONS_FIELD_NUMBER: builtins.int SOURCE_CODE_INFO_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """file name, relative to root of source tree""" - - package: typing.Text + package: builtins.str """e.g. "foo", "foo.bar", etc.""" - @property - def dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Names of files imported by this file.""" - pass @property def public_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """Indexes of the public imported files in the dependency list above.""" - pass @property def weak_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use. """ - pass @property def message_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto]: """All top-level definitions in this file.""" - pass @property def enum_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumDescriptorProto]: ... @property @@ -81,77 +94,80 @@ class FileDescriptorProto(google.protobuf.message.Message): functionality of the descriptors -- the information is needed only by development tools. """ - pass - syntax: typing.Text + syntax: builtins.str """The syntax of the proto file. The supported values are "proto2" and "proto3". """ - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - package: typing.Optional[typing.Text] = ..., - dependency: typing.Optional[typing.Iterable[typing.Text]] = ..., - public_dependency: typing.Optional[typing.Iterable[builtins.int]] = ..., - weak_dependency: typing.Optional[typing.Iterable[builtins.int]] = ..., - message_type: typing.Optional[typing.Iterable[global___DescriptorProto]] = ..., - enum_type: typing.Optional[typing.Iterable[global___EnumDescriptorProto]] = ..., - service: typing.Optional[typing.Iterable[global___ServiceDescriptorProto]] = ..., - extension: typing.Optional[typing.Iterable[global___FieldDescriptorProto]] = ..., - options: typing.Optional[global___FileOptions] = ..., - source_code_info: typing.Optional[global___SourceCodeInfo] = ..., - syntax: typing.Optional[typing.Text] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","package",b"package","source_code_info",b"source_code_info","syntax",b"syntax"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["dependency",b"dependency","enum_type",b"enum_type","extension",b"extension","message_type",b"message_type","name",b"name","options",b"options","package",b"package","public_dependency",b"public_dependency","service",b"service","source_code_info",b"source_code_info","syntax",b"syntax","weak_dependency",b"weak_dependency"]) -> None: ... + name: builtins.str | None = ..., + package: builtins.str | None = ..., + dependency: collections.abc.Iterable[builtins.str] | None = ..., + public_dependency: collections.abc.Iterable[builtins.int] | None = ..., + weak_dependency: collections.abc.Iterable[builtins.int] | None = ..., + message_type: collections.abc.Iterable[global___DescriptorProto] | None = ..., + enum_type: collections.abc.Iterable[global___EnumDescriptorProto] | None = ..., + service: collections.abc.Iterable[global___ServiceDescriptorProto] | None = ..., + extension: collections.abc.Iterable[global___FieldDescriptorProto] | None = ..., + options: global___FileOptions | None = ..., + source_code_info: global___SourceCodeInfo | None = ..., + syntax: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options", "package", b"package", "source_code_info", b"source_code_info", "syntax", b"syntax"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["dependency", b"dependency", "enum_type", b"enum_type", "extension", b"extension", "message_type", b"message_type", "name", b"name", "options", b"options", "package", b"package", "public_dependency", b"public_dependency", "service", b"service", "source_code_info", b"source_code_info", "syntax", b"syntax", "weak_dependency", b"weak_dependency"]) -> None: ... + global___FileDescriptorProto = FileDescriptorProto class DescriptorProto(google.protobuf.message.Message): """Describes a message type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class ExtensionRange(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + START_FIELD_NUMBER: builtins.int END_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int start: builtins.int """Inclusive.""" - end: builtins.int """Exclusive.""" - @property def options(self) -> global___ExtensionRangeOptions: ... - def __init__(self, + def __init__( + self, *, - start: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - options: typing.Optional[global___ExtensionRangeOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["end",b"end","options",b"options","start",b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["end",b"end","options",b"options","start",b"start"]) -> None: ... + start: builtins.int | None = ..., + end: builtins.int | None = ..., + options: global___ExtensionRangeOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end", b"end", "options", b"options", "start", b"start"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["end", b"end", "options", b"options", "start", b"start"]) -> None: ... class ReservedRange(google.protobuf.message.Message): """Range of reserved tag numbers. Reserved tag numbers may not be used by fields or extension ranges in the same message. Reserved ranges may not overlap. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + START_FIELD_NUMBER: builtins.int END_FIELD_NUMBER: builtins.int start: builtins.int """Inclusive.""" - end: builtins.int """Exclusive.""" - - def __init__(self, + def __init__( + self, *, - start: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> None: ... + start: builtins.int | None = ..., + end: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> None: ... NAME_FIELD_NUMBER: builtins.int FIELD_FIELD_NUMBER: builtins.int @@ -163,7 +179,7 @@ class DescriptorProto(google.protobuf.message.Message): OPTIONS_FIELD_NUMBER: builtins.int RESERVED_RANGE_FIELD_NUMBER: builtins.int RESERVED_NAME_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def field(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FieldDescriptorProto]: ... @property @@ -181,67 +197,70 @@ class DescriptorProto(google.protobuf.message.Message): @property def reserved_range(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto.ReservedRange]: ... @property - def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - field: typing.Optional[typing.Iterable[global___FieldDescriptorProto]] = ..., - extension: typing.Optional[typing.Iterable[global___FieldDescriptorProto]] = ..., - nested_type: typing.Optional[typing.Iterable[global___DescriptorProto]] = ..., - enum_type: typing.Optional[typing.Iterable[global___EnumDescriptorProto]] = ..., - extension_range: typing.Optional[typing.Iterable[global___DescriptorProto.ExtensionRange]] = ..., - oneof_decl: typing.Optional[typing.Iterable[global___OneofDescriptorProto]] = ..., - options: typing.Optional[global___MessageOptions] = ..., - reserved_range: typing.Optional[typing.Iterable[global___DescriptorProto.ReservedRange]] = ..., - reserved_name: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["enum_type",b"enum_type","extension",b"extension","extension_range",b"extension_range","field",b"field","name",b"name","nested_type",b"nested_type","oneof_decl",b"oneof_decl","options",b"options","reserved_name",b"reserved_name","reserved_range",b"reserved_range"]) -> None: ... + name: builtins.str | None = ..., + field: collections.abc.Iterable[global___FieldDescriptorProto] | None = ..., + extension: collections.abc.Iterable[global___FieldDescriptorProto] | None = ..., + nested_type: collections.abc.Iterable[global___DescriptorProto] | None = ..., + enum_type: collections.abc.Iterable[global___EnumDescriptorProto] | None = ..., + extension_range: collections.abc.Iterable[global___DescriptorProto.ExtensionRange] | None = ..., + oneof_decl: collections.abc.Iterable[global___OneofDescriptorProto] | None = ..., + options: global___MessageOptions | None = ..., + reserved_range: collections.abc.Iterable[global___DescriptorProto.ReservedRange] | None = ..., + reserved_name: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["enum_type", b"enum_type", "extension", b"extension", "extension_range", b"extension_range", "field", b"field", "name", b"name", "nested_type", b"nested_type", "oneof_decl", b"oneof_decl", "options", b"options", "reserved_name", b"reserved_name", "reserved_range", b"reserved_range"]) -> None: ... + global___DescriptorProto = DescriptorProto class ExtensionRangeOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option",b"uninterpreted_option"]) -> None: ... + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___ExtensionRangeOptions = ExtensionRangeOptions class FieldDescriptorProto(google.protobuf.message.Message): """Describes a field within a message.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Type: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Type.ValueType], builtins.type): + + class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Type.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor TYPE_DOUBLE: FieldDescriptorProto._Type.ValueType # 1 """0 is reserved for errors. Order is weird for historical reasons. """ - TYPE_FLOAT: FieldDescriptorProto._Type.ValueType # 2 TYPE_INT64: FieldDescriptorProto._Type.ValueType # 3 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if negative values are likely. """ - TYPE_UINT64: FieldDescriptorProto._Type.ValueType # 4 TYPE_INT32: FieldDescriptorProto._Type.ValueType # 5 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if negative values are likely. """ - TYPE_FIXED64: FieldDescriptorProto._Type.ValueType # 6 TYPE_FIXED32: FieldDescriptorProto._Type.ValueType # 7 TYPE_BOOL: FieldDescriptorProto._Type.ValueType # 8 @@ -252,43 +271,34 @@ class FieldDescriptorProto(google.protobuf.message.Message): implementations should still be able to parse the group wire format and treat group fields as unknown fields. """ - TYPE_MESSAGE: FieldDescriptorProto._Type.ValueType # 11 """Length-delimited aggregate.""" - TYPE_BYTES: FieldDescriptorProto._Type.ValueType # 12 """New in version 2.""" - TYPE_UINT32: FieldDescriptorProto._Type.ValueType # 13 TYPE_ENUM: FieldDescriptorProto._Type.ValueType # 14 TYPE_SFIXED32: FieldDescriptorProto._Type.ValueType # 15 TYPE_SFIXED64: FieldDescriptorProto._Type.ValueType # 16 TYPE_SINT32: FieldDescriptorProto._Type.ValueType # 17 """Uses ZigZag encoding.""" - TYPE_SINT64: FieldDescriptorProto._Type.ValueType # 18 """Uses ZigZag encoding.""" - class Type(_Type, metaclass=_TypeEnumTypeWrapper): - pass - + class Type(_Type, metaclass=_TypeEnumTypeWrapper): ... TYPE_DOUBLE: FieldDescriptorProto.Type.ValueType # 1 """0 is reserved for errors. Order is weird for historical reasons. """ - TYPE_FLOAT: FieldDescriptorProto.Type.ValueType # 2 TYPE_INT64: FieldDescriptorProto.Type.ValueType # 3 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if negative values are likely. """ - TYPE_UINT64: FieldDescriptorProto.Type.ValueType # 4 TYPE_INT32: FieldDescriptorProto.Type.ValueType # 5 """Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if negative values are likely. """ - TYPE_FIXED64: FieldDescriptorProto.Type.ValueType # 6 TYPE_FIXED32: FieldDescriptorProto.Type.ValueType # 7 TYPE_BOOL: FieldDescriptorProto.Type.ValueType # 8 @@ -299,40 +309,33 @@ class FieldDescriptorProto(google.protobuf.message.Message): implementations should still be able to parse the group wire format and treat group fields as unknown fields. """ - TYPE_MESSAGE: FieldDescriptorProto.Type.ValueType # 11 """Length-delimited aggregate.""" - TYPE_BYTES: FieldDescriptorProto.Type.ValueType # 12 """New in version 2.""" - TYPE_UINT32: FieldDescriptorProto.Type.ValueType # 13 TYPE_ENUM: FieldDescriptorProto.Type.ValueType # 14 TYPE_SFIXED32: FieldDescriptorProto.Type.ValueType # 15 TYPE_SFIXED64: FieldDescriptorProto.Type.ValueType # 16 TYPE_SINT32: FieldDescriptorProto.Type.ValueType # 17 """Uses ZigZag encoding.""" - TYPE_SINT64: FieldDescriptorProto.Type.ValueType # 18 """Uses ZigZag encoding.""" - class _Label: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _LabelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Label.ValueType], builtins.type): + + class _LabelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Label.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor LABEL_OPTIONAL: FieldDescriptorProto._Label.ValueType # 1 """0 is reserved for errors""" - LABEL_REQUIRED: FieldDescriptorProto._Label.ValueType # 2 LABEL_REPEATED: FieldDescriptorProto._Label.ValueType # 3 - class Label(_Label, metaclass=_LabelEnumTypeWrapper): - pass + class Label(_Label, metaclass=_LabelEnumTypeWrapper): ... LABEL_OPTIONAL: FieldDescriptorProto.Label.ValueType # 1 """0 is reserved for errors""" - LABEL_REQUIRED: FieldDescriptorProto.Label.ValueType # 2 LABEL_REPEATED: FieldDescriptorProto.Label.ValueType # 3 @@ -347,46 +350,40 @@ class FieldDescriptorProto(google.protobuf.message.Message): JSON_NAME_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int PROTO3_OPTIONAL_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str number: builtins.int label: global___FieldDescriptorProto.Label.ValueType type: global___FieldDescriptorProto.Type.ValueType """If type_name is set, this need not be set. If both this and type_name are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. """ - - type_name: typing.Text + type_name: builtins.str """For message and enum types, this is the name of the type. If the name starts with a '.', it is fully-qualified. Otherwise, C++-like scoping rules are used to find the type (i.e. first the nested types within this message are searched, then within the parent, on up to the root namespace). """ - - extendee: typing.Text + extendee: builtins.str """For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name. """ - - default_value: typing.Text + default_value: builtins.str """For numeric types, contains the original text representation of the value. For booleans, "true" or "false". For strings, contains the default text contents (not escaped in any way). For bytes, contains the C escaped value. All bytes >= 128 are escaped. """ - oneof_index: builtins.int """If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof. """ - - json_name: typing.Text + json_name: builtins.str """JSON name of this field. The value is set by protocol compiler. If the user has set a "json_name" option on this field, that option's value will be used. Otherwise, it's deduced from the field's name by converting it to camelCase. """ - @property def options(self) -> global___FieldOptions: ... proto3_optional: builtins.bool @@ -412,45 +409,52 @@ class FieldDescriptorProto(google.protobuf.message.Message): Proto2 optional fields do not set this flag, because they already indicate optional with `LABEL_OPTIONAL`. """ - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - number: typing.Optional[builtins.int] = ..., - label: typing.Optional[global___FieldDescriptorProto.Label.ValueType] = ..., - type: typing.Optional[global___FieldDescriptorProto.Type.ValueType] = ..., - type_name: typing.Optional[typing.Text] = ..., - extendee: typing.Optional[typing.Text] = ..., - default_value: typing.Optional[typing.Text] = ..., - oneof_index: typing.Optional[builtins.int] = ..., - json_name: typing.Optional[typing.Text] = ..., - options: typing.Optional[global___FieldOptions] = ..., - proto3_optional: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["default_value",b"default_value","extendee",b"extendee","json_name",b"json_name","label",b"label","name",b"name","number",b"number","oneof_index",b"oneof_index","options",b"options","proto3_optional",b"proto3_optional","type",b"type","type_name",b"type_name"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["default_value",b"default_value","extendee",b"extendee","json_name",b"json_name","label",b"label","name",b"name","number",b"number","oneof_index",b"oneof_index","options",b"options","proto3_optional",b"proto3_optional","type",b"type","type_name",b"type_name"]) -> None: ... + name: builtins.str | None = ..., + number: builtins.int | None = ..., + label: global___FieldDescriptorProto.Label.ValueType | None = ..., + type: global___FieldDescriptorProto.Type.ValueType | None = ..., + type_name: builtins.str | None = ..., + extendee: builtins.str | None = ..., + default_value: builtins.str | None = ..., + oneof_index: builtins.int | None = ..., + json_name: builtins.str | None = ..., + options: global___FieldOptions | None = ..., + proto3_optional: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["default_value", b"default_value", "extendee", b"extendee", "json_name", b"json_name", "label", b"label", "name", b"name", "number", b"number", "oneof_index", b"oneof_index", "options", b"options", "proto3_optional", b"proto3_optional", "type", b"type", "type_name", b"type_name"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["default_value", b"default_value", "extendee", b"extendee", "json_name", b"json_name", "label", b"label", "name", b"name", "number", b"number", "oneof_index", b"oneof_index", "options", b"options", "proto3_optional", b"proto3_optional", "type", b"type", "type_name", b"type_name"]) -> None: ... + global___FieldDescriptorProto = FieldDescriptorProto class OneofDescriptorProto(google.protobuf.message.Message): """Describes a oneof.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def options(self) -> global___OneofOptions: ... - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - options: typing.Optional[global___OneofOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + options: global___OneofOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> None: ... + global___OneofDescriptorProto = OneofDescriptorProto class EnumDescriptorProto(google.protobuf.message.Message): """Describes an enum type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class EnumReservedRange(google.protobuf.message.Message): """Range of reserved numeric values. Reserved values may not be used by entries in the same enum. Reserved ranges may not overlap. @@ -459,29 +463,30 @@ class EnumDescriptorProto(google.protobuf.message.Message): is inclusive such that it can appropriately represent the entire int32 domain. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + START_FIELD_NUMBER: builtins.int END_FIELD_NUMBER: builtins.int start: builtins.int """Inclusive.""" - end: builtins.int """Inclusive.""" - - def __init__(self, + def __init__( + self, *, - start: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["end",b"end","start",b"start"]) -> None: ... + start: builtins.int | None = ..., + end: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["end", b"end", "start", b"start"]) -> None: ... NAME_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int RESERVED_RANGE_FIELD_NUMBER: builtins.int RESERVED_NAME_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def value(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumValueDescriptorProto]: ... @property @@ -492,108 +497,114 @@ class EnumDescriptorProto(google.protobuf.message.Message): by enum values in the same enum declaration. Reserved ranges may not overlap. """ - pass @property - def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Reserved enum value names, which may not be reused. A given name may only be reserved once. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - value: typing.Optional[typing.Iterable[global___EnumValueDescriptorProto]] = ..., - options: typing.Optional[global___EnumOptions] = ..., - reserved_range: typing.Optional[typing.Iterable[global___EnumDescriptorProto.EnumReservedRange]] = ..., - reserved_name: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options","reserved_name",b"reserved_name","reserved_range",b"reserved_range","value",b"value"]) -> None: ... + name: builtins.str | None = ..., + value: collections.abc.Iterable[global___EnumValueDescriptorProto] | None = ..., + options: global___EnumOptions | None = ..., + reserved_range: collections.abc.Iterable[global___EnumDescriptorProto.EnumReservedRange] | None = ..., + reserved_name: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options", "reserved_name", b"reserved_name", "reserved_range", b"reserved_range", "value", b"value"]) -> None: ... + global___EnumDescriptorProto = EnumDescriptorProto class EnumValueDescriptorProto(google.protobuf.message.Message): """Describes a value within an enum.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int NUMBER_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str number: builtins.int @property def options(self) -> global___EnumValueOptions: ... - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - number: typing.Optional[builtins.int] = ..., - options: typing.Optional[global___EnumValueOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","number",b"number","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","number",b"number","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + number: builtins.int | None = ..., + options: global___EnumValueOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "number", b"number", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "number", b"number", "options", b"options"]) -> None: ... + global___EnumValueDescriptorProto = EnumValueDescriptorProto class ServiceDescriptorProto(google.protobuf.message.Message): """Describes a service.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int METHOD_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str @property def method(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MethodDescriptorProto]: ... @property def options(self) -> global___ServiceOptions: ... - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - method: typing.Optional[typing.Iterable[global___MethodDescriptorProto]] = ..., - options: typing.Optional[global___ServiceOptions] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["name",b"name","options",b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["method",b"method","name",b"name","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + method: collections.abc.Iterable[global___MethodDescriptorProto] | None = ..., + options: global___ServiceOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["method", b"method", "name", b"name", "options", b"options"]) -> None: ... + global___ServiceDescriptorProto = ServiceDescriptorProto class MethodDescriptorProto(google.protobuf.message.Message): """Describes a method of a service.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int INPUT_TYPE_FIELD_NUMBER: builtins.int OUTPUT_TYPE_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int CLIENT_STREAMING_FIELD_NUMBER: builtins.int SERVER_STREAMING_FIELD_NUMBER: builtins.int - name: typing.Text - input_type: typing.Text + name: builtins.str + input_type: builtins.str """Input and output type names. These are resolved in the same way as FieldDescriptorProto.type_name, but must refer to a message type. """ - - output_type: typing.Text + output_type: builtins.str @property def options(self) -> global___MethodOptions: ... client_streaming: builtins.bool """Identifies if client streams multiple client messages""" - server_streaming: builtins.bool """Identifies if server streams multiple server messages""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - input_type: typing.Optional[typing.Text] = ..., - output_type: typing.Optional[typing.Text] = ..., - options: typing.Optional[global___MethodOptions] = ..., - client_streaming: typing.Optional[builtins.bool] = ..., - server_streaming: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["client_streaming",b"client_streaming","input_type",b"input_type","name",b"name","options",b"options","output_type",b"output_type","server_streaming",b"server_streaming"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["client_streaming",b"client_streaming","input_type",b"input_type","name",b"name","options",b"options","output_type",b"output_type","server_streaming",b"server_streaming"]) -> None: ... + name: builtins.str | None = ..., + input_type: builtins.str | None = ..., + output_type: builtins.str | None = ..., + options: global___MethodOptions | None = ..., + client_streaming: builtins.bool | None = ..., + server_streaming: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["client_streaming", b"client_streaming", "input_type", b"input_type", "name", b"name", "options", b"options", "output_type", b"output_type", "server_streaming", b"server_streaming"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["client_streaming", b"client_streaming", "input_type", b"input_type", "name", b"name", "options", b"options", "output_type", b"output_type", "server_streaming", b"server_streaming"]) -> None: ... + global___MethodDescriptorProto = MethodDescriptorProto class FileOptions(google.protobuf.message.Message): - """=================================================================== - Options - - Each of the definitions above may have "options" attached. These are + """Each of the definitions above may have "options" attached. These are just annotations which may cause code to be generated slightly differently or may contain hints for code that manipulates protocol messages. @@ -621,41 +632,37 @@ class FileOptions(google.protobuf.message.Message): https://developers.google.com/protocol-buffers/docs/proto#options If this turns out to be popular, a web service will be set up to automatically assign option numbers. - """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _OptimizeMode: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _OptimizeModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FileOptions._OptimizeMode.ValueType], builtins.type): + + class _OptimizeModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FileOptions._OptimizeMode.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor SPEED: FileOptions._OptimizeMode.ValueType # 1 """Generate complete code for parsing, serialization,""" - CODE_SIZE: FileOptions._OptimizeMode.ValueType # 2 """etc. Use ReflectionOps to implement these methods. """ - LITE_RUNTIME: FileOptions._OptimizeMode.ValueType # 3 """Generate code using MessageLite and the lite runtime.""" class OptimizeMode(_OptimizeMode, metaclass=_OptimizeModeEnumTypeWrapper): """Generated classes can be optimized for speed or code size.""" - pass SPEED: FileOptions.OptimizeMode.ValueType # 1 """Generate complete code for parsing, serialization,""" - CODE_SIZE: FileOptions.OptimizeMode.ValueType # 2 """etc. Use ReflectionOps to implement these methods. """ - LITE_RUNTIME: FileOptions.OptimizeMode.ValueType # 3 """Generate code using MessageLite and the lite runtime.""" - JAVA_PACKAGE_FIELD_NUMBER: builtins.int JAVA_OUTER_CLASSNAME_FIELD_NUMBER: builtins.int JAVA_MULTIPLE_FILES_FIELD_NUMBER: builtins.int @@ -677,21 +684,19 @@ class FileOptions(google.protobuf.message.Message): PHP_METADATA_NAMESPACE_FIELD_NUMBER: builtins.int RUBY_PACKAGE_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - java_package: typing.Text + java_package: builtins.str """Sets the Java package where classes generated from this .proto will be placed. By default, the proto package is used, but this is often inappropriate because proto packages do not normally start with backwards domain names. """ - - java_outer_classname: typing.Text + java_outer_classname: builtins.str """Controls the name of the wrapper Java class generated for the .proto file. That class will always contain the .proto file's getDescriptor() method as well as any top-level extensions defined in the .proto file. If java_multiple_files is disabled, then all the other classes from the .proto file will be nested inside the single wrapper outer class. """ - java_multiple_files: builtins.bool """If enabled, then the Java code generator will generate a separate .java file for each top-level message, enum, and service defined in the .proto @@ -700,10 +705,8 @@ class FileOptions(google.protobuf.message.Message): generated to contain the file's getDescriptor() method as well as any top-level extensions defined in the file. """ - java_generate_equals_and_hash: builtins.bool """This option does nothing.""" - java_string_check_utf8: builtins.bool """If set true, then the Java2 code generator will generate code that throws an exception whenever an attempt is made to assign a non-UTF-8 @@ -712,16 +715,14 @@ class FileOptions(google.protobuf.message.Message): However, an extension field still accepts non-UTF-8 byte sequences. This option has no effect on when used with the lite runtime. """ - optimize_for: global___FileOptions.OptimizeMode.ValueType - go_package: typing.Text + go_package: builtins.str """Sets the Go package where structs generated from this .proto will be placed. If omitted, the Go package will be derived from the following: - The basename of the package import path, if provided. - Otherwise, the package statement in the .proto file, if present. - Otherwise, the basename of the .proto file, without extension. """ - cc_generic_services: builtins.bool """Should generic services be generated in each language? "Generic" services are not specific to any particular RPC system. They are generated by the @@ -734,7 +735,6 @@ class FileOptions(google.protobuf.message.Message): these default to false. Old code which depends on generic services should explicitly set them to true. """ - java_generic_services: builtins.bool py_generic_services: builtins.bool php_generic_services: builtins.bool @@ -744,86 +744,79 @@ class FileOptions(google.protobuf.message.Message): for everything in the file, or it will be completely ignored; in the very least, this is a formalization for deprecating files. """ - cc_enable_arenas: builtins.bool """Enables the use of arenas for the proto messages in this file. This applies only to generated classes for C++. """ - - objc_class_prefix: typing.Text + objc_class_prefix: builtins.str """Sets the objective c class prefix which is prepended to all objective c generated classes from this .proto. There is no default. """ - - csharp_namespace: typing.Text + csharp_namespace: builtins.str """Namespace for generated classes; defaults to the package.""" - - swift_prefix: typing.Text + swift_prefix: builtins.str """By default Swift generators will take the proto package and CamelCase it replacing '.' with underscore and use that to prefix the types/symbols defined. When this options is provided, they will use this value instead to prefix the types/symbols defined. """ - - php_class_prefix: typing.Text + php_class_prefix: builtins.str """Sets the php class prefix which is prepended to all php generated classes from this .proto. Default is empty. """ - - php_namespace: typing.Text + php_namespace: builtins.str """Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace. """ - - php_metadata_namespace: typing.Text + php_metadata_namespace: builtins.str """Use this option to change the namespace of php generated metadata classes. Default is empty. When this option is empty, the proto file name will be used for determining the namespace. """ - - ruby_package: typing.Text + ruby_package: builtins.str """Use this option to change the package of ruby generated classes. Default is empty. When this option is not set, the package name will be used for determining the ruby package. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See the documentation for the "Options" section above. """ - pass - def __init__(self, + def __init__( + self, *, - java_package: typing.Optional[typing.Text] = ..., - java_outer_classname: typing.Optional[typing.Text] = ..., - java_multiple_files: typing.Optional[builtins.bool] = ..., - java_generate_equals_and_hash: typing.Optional[builtins.bool] = ..., - java_string_check_utf8: typing.Optional[builtins.bool] = ..., - optimize_for: typing.Optional[global___FileOptions.OptimizeMode.ValueType] = ..., - go_package: typing.Optional[typing.Text] = ..., - cc_generic_services: typing.Optional[builtins.bool] = ..., - java_generic_services: typing.Optional[builtins.bool] = ..., - py_generic_services: typing.Optional[builtins.bool] = ..., - php_generic_services: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - cc_enable_arenas: typing.Optional[builtins.bool] = ..., - objc_class_prefix: typing.Optional[typing.Text] = ..., - csharp_namespace: typing.Optional[typing.Text] = ..., - swift_prefix: typing.Optional[typing.Text] = ..., - php_class_prefix: typing.Optional[typing.Text] = ..., - php_namespace: typing.Optional[typing.Text] = ..., - php_metadata_namespace: typing.Optional[typing.Text] = ..., - ruby_package: typing.Optional[typing.Text] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["cc_enable_arenas",b"cc_enable_arenas","cc_generic_services",b"cc_generic_services","csharp_namespace",b"csharp_namespace","deprecated",b"deprecated","go_package",b"go_package","java_generate_equals_and_hash",b"java_generate_equals_and_hash","java_generic_services",b"java_generic_services","java_multiple_files",b"java_multiple_files","java_outer_classname",b"java_outer_classname","java_package",b"java_package","java_string_check_utf8",b"java_string_check_utf8","objc_class_prefix",b"objc_class_prefix","optimize_for",b"optimize_for","php_class_prefix",b"php_class_prefix","php_generic_services",b"php_generic_services","php_metadata_namespace",b"php_metadata_namespace","php_namespace",b"php_namespace","py_generic_services",b"py_generic_services","ruby_package",b"ruby_package","swift_prefix",b"swift_prefix"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["cc_enable_arenas",b"cc_enable_arenas","cc_generic_services",b"cc_generic_services","csharp_namespace",b"csharp_namespace","deprecated",b"deprecated","go_package",b"go_package","java_generate_equals_and_hash",b"java_generate_equals_and_hash","java_generic_services",b"java_generic_services","java_multiple_files",b"java_multiple_files","java_outer_classname",b"java_outer_classname","java_package",b"java_package","java_string_check_utf8",b"java_string_check_utf8","objc_class_prefix",b"objc_class_prefix","optimize_for",b"optimize_for","php_class_prefix",b"php_class_prefix","php_generic_services",b"php_generic_services","php_metadata_namespace",b"php_metadata_namespace","php_namespace",b"php_namespace","py_generic_services",b"py_generic_services","ruby_package",b"ruby_package","swift_prefix",b"swift_prefix","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + java_package: builtins.str | None = ..., + java_outer_classname: builtins.str | None = ..., + java_multiple_files: builtins.bool | None = ..., + java_generate_equals_and_hash: builtins.bool | None = ..., + java_string_check_utf8: builtins.bool | None = ..., + optimize_for: global___FileOptions.OptimizeMode.ValueType | None = ..., + go_package: builtins.str | None = ..., + cc_generic_services: builtins.bool | None = ..., + java_generic_services: builtins.bool | None = ..., + py_generic_services: builtins.bool | None = ..., + php_generic_services: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + cc_enable_arenas: builtins.bool | None = ..., + objc_class_prefix: builtins.str | None = ..., + csharp_namespace: builtins.str | None = ..., + swift_prefix: builtins.str | None = ..., + php_class_prefix: builtins.str | None = ..., + php_namespace: builtins.str | None = ..., + php_metadata_namespace: builtins.str | None = ..., + ruby_package: builtins.str | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["cc_enable_arenas", b"cc_enable_arenas", "cc_generic_services", b"cc_generic_services", "csharp_namespace", b"csharp_namespace", "deprecated", b"deprecated", "go_package", b"go_package", "java_generate_equals_and_hash", b"java_generate_equals_and_hash", "java_generic_services", b"java_generic_services", "java_multiple_files", b"java_multiple_files", "java_outer_classname", b"java_outer_classname", "java_package", b"java_package", "java_string_check_utf8", b"java_string_check_utf8", "objc_class_prefix", b"objc_class_prefix", "optimize_for", b"optimize_for", "php_class_prefix", b"php_class_prefix", "php_generic_services", b"php_generic_services", "php_metadata_namespace", b"php_metadata_namespace", "php_namespace", b"php_namespace", "py_generic_services", b"py_generic_services", "ruby_package", b"ruby_package", "swift_prefix", b"swift_prefix"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["cc_enable_arenas", b"cc_enable_arenas", "cc_generic_services", b"cc_generic_services", "csharp_namespace", b"csharp_namespace", "deprecated", b"deprecated", "go_package", b"go_package", "java_generate_equals_and_hash", b"java_generate_equals_and_hash", "java_generic_services", b"java_generic_services", "java_multiple_files", b"java_multiple_files", "java_outer_classname", b"java_outer_classname", "java_package", b"java_package", "java_string_check_utf8", b"java_string_check_utf8", "objc_class_prefix", b"objc_class_prefix", "optimize_for", b"optimize_for", "php_class_prefix", b"php_class_prefix", "php_generic_services", b"php_generic_services", "php_metadata_namespace", b"php_metadata_namespace", "php_namespace", b"php_namespace", "py_generic_services", b"py_generic_services", "ruby_package", b"ruby_package", "swift_prefix", b"swift_prefix", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___FileOptions = FileOptions class MessageOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + MESSAGE_SET_WIRE_FORMAT_FIELD_NUMBER: builtins.int NO_STANDARD_DESCRIPTOR_ACCESSOR_FIELD_NUMBER: builtins.int DEPRECATED_FIELD_NUMBER: builtins.int @@ -849,20 +842,17 @@ class MessageOptions(google.protobuf.message.Message): Because this is an option, the above two restrictions are not enforced by the protocol compiler. """ - no_standard_descriptor_accessor: builtins.bool """Disables the generation of the standard "descriptor()" accessor, which can conflict with a field of the same name. This is meant to make migration from proto1 easier; new code should avoid fields named "descriptor". """ - deprecated: builtins.bool """Is this message deprecated? Depending on the target platform, this can emit Deprecated annotations for the message, or it will be completely ignored; in the very least, this is a formalization for deprecating messages. """ - map_entry: builtins.bool """Whether the message is an automatically generated map entry type for the maps field. @@ -886,71 +876,64 @@ class MessageOptions(google.protobuf.message.Message): instead. The option should only be implicitly set by the proto compiler parser. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - message_set_wire_format: typing.Optional[builtins.bool] = ..., - no_standard_descriptor_accessor: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - map_entry: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","map_entry",b"map_entry","message_set_wire_format",b"message_set_wire_format","no_standard_descriptor_accessor",b"no_standard_descriptor_accessor"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","map_entry",b"map_entry","message_set_wire_format",b"message_set_wire_format","no_standard_descriptor_accessor",b"no_standard_descriptor_accessor","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + message_set_wire_format: builtins.bool | None = ..., + no_standard_descriptor_accessor: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + map_entry: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "map_entry", b"map_entry", "message_set_wire_format", b"message_set_wire_format", "no_standard_descriptor_accessor", b"no_standard_descriptor_accessor"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "map_entry", b"map_entry", "message_set_wire_format", b"message_set_wire_format", "no_standard_descriptor_accessor", b"no_standard_descriptor_accessor", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___MessageOptions = MessageOptions class FieldOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _CType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _CTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._CType.ValueType], builtins.type): + + class _CTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._CType.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor STRING: FieldOptions._CType.ValueType # 0 """Default mode.""" - CORD: FieldOptions._CType.ValueType # 1 STRING_PIECE: FieldOptions._CType.ValueType # 2 - class CType(_CType, metaclass=_CTypeEnumTypeWrapper): - pass + class CType(_CType, metaclass=_CTypeEnumTypeWrapper): ... STRING: FieldOptions.CType.ValueType # 0 """Default mode.""" - CORD: FieldOptions.CType.ValueType # 1 STRING_PIECE: FieldOptions.CType.ValueType # 2 class _JSType: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _JSTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._JSType.ValueType], builtins.type): + + class _JSTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._JSType.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor JS_NORMAL: FieldOptions._JSType.ValueType # 0 """Use the default type.""" - JS_STRING: FieldOptions._JSType.ValueType # 1 """Use JavaScript strings.""" - JS_NUMBER: FieldOptions._JSType.ValueType # 2 """Use JavaScript numbers.""" - class JSType(_JSType, metaclass=_JSTypeEnumTypeWrapper): - pass - + class JSType(_JSType, metaclass=_JSTypeEnumTypeWrapper): ... JS_NORMAL: FieldOptions.JSType.ValueType # 0 """Use the default type.""" - JS_STRING: FieldOptions.JSType.ValueType # 1 """Use JavaScript strings.""" - JS_NUMBER: FieldOptions.JSType.ValueType # 2 """Use JavaScript numbers.""" - CTYPE_FIELD_NUMBER: builtins.int PACKED_FIELD_NUMBER: builtins.int JSTYPE_FIELD_NUMBER: builtins.int @@ -965,7 +948,6 @@ class FieldOptions(google.protobuf.message.Message): options below. This option is not yet implemented in the open source release -- sorry, we'll try to include it in a future version! """ - packed: builtins.bool """The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly @@ -973,7 +955,6 @@ class FieldOptions(google.protobuf.message.Message): a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding. """ - jstype: global___FieldOptions.JSType.ValueType """The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types @@ -987,7 +968,6 @@ class FieldOptions(google.protobuf.message.Message): This option is an enum to permit additional types to be added, e.g. goog.math.Integer. """ - lazy: builtins.bool """Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the @@ -1024,58 +1004,58 @@ class FieldOptions(google.protobuf.message.Message): TODO(b/211906113): Enable validation on lazy fields. """ - unverified_lazy: builtins.bool """unverified_lazy does no correctness checks on the byte stream. This should only be used where lazy with verification is prohibitive for performance reasons. """ - deprecated: builtins.bool """Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields. """ - weak: builtins.bool """For Google-internal migration only. Do not use.""" - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - ctype: typing.Optional[global___FieldOptions.CType.ValueType] = ..., - packed: typing.Optional[builtins.bool] = ..., - jstype: typing.Optional[global___FieldOptions.JSType.ValueType] = ..., - lazy: typing.Optional[builtins.bool] = ..., - unverified_lazy: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - weak: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["ctype",b"ctype","deprecated",b"deprecated","jstype",b"jstype","lazy",b"lazy","packed",b"packed","unverified_lazy",b"unverified_lazy","weak",b"weak"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["ctype",b"ctype","deprecated",b"deprecated","jstype",b"jstype","lazy",b"lazy","packed",b"packed","uninterpreted_option",b"uninterpreted_option","unverified_lazy",b"unverified_lazy","weak",b"weak"]) -> None: ... + ctype: global___FieldOptions.CType.ValueType | None = ..., + packed: builtins.bool | None = ..., + jstype: global___FieldOptions.JSType.ValueType | None = ..., + lazy: builtins.bool | None = ..., + unverified_lazy: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + weak: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["ctype", b"ctype", "deprecated", b"deprecated", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["ctype", b"ctype", "deprecated", b"deprecated", "jstype", b"jstype", "lazy", b"lazy", "packed", b"packed", "uninterpreted_option", b"uninterpreted_option", "unverified_lazy", b"unverified_lazy", "weak", b"weak"]) -> None: ... + global___FieldOptions = FieldOptions class OneofOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option",b"uninterpreted_option"]) -> None: ... + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___OneofOptions = OneofOptions class EnumOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + ALLOW_ALIAS_FIELD_NUMBER: builtins.int DEPRECATED_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @@ -1083,30 +1063,30 @@ class EnumOptions(google.protobuf.message.Message): """Set this option to true to allow mapping different tag names to the same value. """ - deprecated: builtins.bool """Is this enum deprecated? Depending on the target platform, this can emit Deprecated annotations for the enum, or it will be completely ignored; in the very least, this is a formalization for deprecating enums. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - allow_alias: typing.Optional[builtins.bool] = ..., - deprecated: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["allow_alias",b"allow_alias","deprecated",b"deprecated"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["allow_alias",b"allow_alias","deprecated",b"deprecated","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + allow_alias: builtins.bool | None = ..., + deprecated: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["allow_alias", b"allow_alias", "deprecated", b"deprecated"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["allow_alias", b"allow_alias", "deprecated", b"deprecated", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___EnumOptions = EnumOptions class EnumValueOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + DEPRECATED_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int deprecated: builtins.bool @@ -1115,22 +1095,23 @@ class EnumValueOptions(google.protobuf.message.Message): for the enum value, or it will be completely ignored; in the very least, this is a formalization for deprecating enum values. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - deprecated: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + deprecated: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___EnumValueOptions = EnumValueOptions class ServiceOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + DEPRECATED_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int deprecated: builtins.bool @@ -1144,31 +1125,32 @@ class ServiceOptions(google.protobuf.message.Message): for the service, or it will be completely ignored; in the very least, this is a formalization for deprecating services. """ - @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - deprecated: typing.Optional[builtins.bool] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + deprecated: builtins.bool | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___ServiceOptions = ServiceOptions class MethodOptions(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _IdempotencyLevel: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _IdempotencyLevelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[MethodOptions._IdempotencyLevel.ValueType], builtins.type): + + class _IdempotencyLevelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[MethodOptions._IdempotencyLevel.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor IDEMPOTENCY_UNKNOWN: MethodOptions._IdempotencyLevel.ValueType # 0 NO_SIDE_EFFECTS: MethodOptions._IdempotencyLevel.ValueType # 1 """implies idempotent""" - IDEMPOTENT: MethodOptions._IdempotencyLevel.ValueType # 2 """idempotent, but may have side effects""" @@ -1177,16 +1159,13 @@ class MethodOptions(google.protobuf.message.Message): or neither? HTTP based RPC implementation may choose GET verb for safe methods, and PUT verb for idempotent methods instead of the default POST. """ - pass IDEMPOTENCY_UNKNOWN: MethodOptions.IdempotencyLevel.ValueType # 0 NO_SIDE_EFFECTS: MethodOptions.IdempotencyLevel.ValueType # 1 """implies idempotent""" - IDEMPOTENT: MethodOptions.IdempotencyLevel.ValueType # 2 """idempotent, but may have side effects""" - DEPRECATED_FIELD_NUMBER: builtins.int IDEMPOTENCY_LEVEL_FIELD_NUMBER: builtins.int UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int @@ -1201,20 +1180,20 @@ class MethodOptions(google.protobuf.message.Message): for the method, or it will be completely ignored; in the very least, this is a formalization for deprecating methods. """ - idempotency_level: global___MethodOptions.IdempotencyLevel.ValueType @property def uninterpreted_option(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - pass - def __init__(self, + def __init__( + self, *, - deprecated: typing.Optional[builtins.bool] = ..., - idempotency_level: typing.Optional[global___MethodOptions.IdempotencyLevel.ValueType] = ..., - uninterpreted_option: typing.Optional[typing.Iterable[global___UninterpretedOption]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","idempotency_level",b"idempotency_level"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["deprecated",b"deprecated","idempotency_level",b"idempotency_level","uninterpreted_option",b"uninterpreted_option"]) -> None: ... + deprecated: builtins.bool | None = ..., + idempotency_level: global___MethodOptions.IdempotencyLevel.ValueType | None = ..., + uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "idempotency_level", b"idempotency_level"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["deprecated", b"deprecated", "idempotency_level", b"idempotency_level", "uninterpreted_option", b"uninterpreted_option"]) -> None: ... + global___MethodOptions = MethodOptions class UninterpretedOption(google.protobuf.message.Message): @@ -1225,7 +1204,9 @@ class UninterpretedOption(google.protobuf.message.Message): or produced by Descriptor::CopyTo()) will never have UninterpretedOptions in them. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class NamePart(google.protobuf.message.Message): """The name of the uninterpreted option. Each string represents a segment in a dot-separated name. is_extension is true iff a segment represents an @@ -1233,18 +1214,21 @@ class UninterpretedOption(google.protobuf.message.Message): E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents "foo.(bar.baz).qux". """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_PART_FIELD_NUMBER: builtins.int IS_EXTENSION_FIELD_NUMBER: builtins.int - name_part: typing.Text + name_part: builtins.str is_extension: builtins.bool - def __init__(self, + def __init__( + self, *, - name_part: typing.Optional[typing.Text] = ..., - is_extension: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["is_extension",b"is_extension","name_part",b"name_part"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["is_extension",b"is_extension","name_part",b"name_part"]) -> None: ... + name_part: builtins.str | None = ..., + is_extension: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["is_extension", b"is_extension", "name_part", b"name_part"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["is_extension", b"is_extension", "name_part", b"name_part"]) -> None: ... NAME_FIELD_NUMBER: builtins.int IDENTIFIER_VALUE_FIELD_NUMBER: builtins.int @@ -1255,28 +1239,29 @@ class UninterpretedOption(google.protobuf.message.Message): AGGREGATE_VALUE_FIELD_NUMBER: builtins.int @property def name(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption.NamePart]: ... - identifier_value: typing.Text + identifier_value: builtins.str """The value of the uninterpreted option, in whatever type the tokenizer identified it as during parsing. Exactly one of these should be set. """ - positive_int_value: builtins.int negative_int_value: builtins.int double_value: builtins.float string_value: builtins.bytes - aggregate_value: typing.Text - def __init__(self, + aggregate_value: builtins.str + def __init__( + self, *, - name: typing.Optional[typing.Iterable[global___UninterpretedOption.NamePart]] = ..., - identifier_value: typing.Optional[typing.Text] = ..., - positive_int_value: typing.Optional[builtins.int] = ..., - negative_int_value: typing.Optional[builtins.int] = ..., - double_value: typing.Optional[builtins.float] = ..., - string_value: typing.Optional[builtins.bytes] = ..., - aggregate_value: typing.Optional[typing.Text] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["aggregate_value",b"aggregate_value","double_value",b"double_value","identifier_value",b"identifier_value","negative_int_value",b"negative_int_value","positive_int_value",b"positive_int_value","string_value",b"string_value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["aggregate_value",b"aggregate_value","double_value",b"double_value","identifier_value",b"identifier_value","name",b"name","negative_int_value",b"negative_int_value","positive_int_value",b"positive_int_value","string_value",b"string_value"]) -> None: ... + name: collections.abc.Iterable[global___UninterpretedOption.NamePart] | None = ..., + identifier_value: builtins.str | None = ..., + positive_int_value: builtins.int | None = ..., + negative_int_value: builtins.int | None = ..., + double_value: builtins.float | None = ..., + string_value: builtins.bytes | None = ..., + aggregate_value: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["aggregate_value", b"aggregate_value", "double_value", b"double_value", "identifier_value", b"identifier_value", "negative_int_value", b"negative_int_value", "positive_int_value", b"positive_int_value", "string_value", b"string_value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["aggregate_value", b"aggregate_value", "double_value", b"double_value", "identifier_value", b"identifier_value", "name", b"name", "negative_int_value", b"negative_int_value", "positive_int_value", b"positive_int_value", "string_value", b"string_value"]) -> None: ... + global___UninterpretedOption = UninterpretedOption class SourceCodeInfo(google.protobuf.message.Message): @@ -1286,9 +1271,12 @@ class SourceCodeInfo(google.protobuf.message.Message): Encapsulates information about the original source file from which a FileDescriptorProto was generated. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class Location(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PATH_FIELD_NUMBER: builtins.int SPAN_FIELD_NUMBER: builtins.int LEADING_COMMENTS_FIELD_NUMBER: builtins.int @@ -1320,7 +1308,6 @@ class SourceCodeInfo(google.protobuf.message.Message): this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon). """ - pass @property def span(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: """Always has exactly three or four elements: start line, start column, @@ -1329,8 +1316,7 @@ class SourceCodeInfo(google.protobuf.message.Message): and column numbers are zero-based -- typically you will want to add 1 to each before displaying to a user. """ - pass - leading_comments: typing.Text + leading_comments: builtins.str """If this SourceCodeInfo represents a complete declaration, these are any comments appearing before and after the declaration which appear to be attached to the declaration. @@ -1379,20 +1365,20 @@ class SourceCodeInfo(google.protobuf.message.Message): // ignored detached comments. """ - - trailing_comments: typing.Text + trailing_comments: builtins.str @property - def leading_detached_comments(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ... - def __init__(self, + def leading_detached_comments(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, *, - path: typing.Optional[typing.Iterable[builtins.int]] = ..., - span: typing.Optional[typing.Iterable[builtins.int]] = ..., - leading_comments: typing.Optional[typing.Text] = ..., - trailing_comments: typing.Optional[typing.Text] = ..., - leading_detached_comments: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["leading_comments",b"leading_comments","trailing_comments",b"trailing_comments"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["leading_comments",b"leading_comments","leading_detached_comments",b"leading_detached_comments","path",b"path","span",b"span","trailing_comments",b"trailing_comments"]) -> None: ... + path: collections.abc.Iterable[builtins.int] | None = ..., + span: collections.abc.Iterable[builtins.int] | None = ..., + leading_comments: builtins.str | None = ..., + trailing_comments: builtins.str | None = ..., + leading_detached_comments: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["leading_comments", b"leading_comments", "trailing_comments", b"trailing_comments"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["leading_comments", b"leading_comments", "leading_detached_comments", b"leading_detached_comments", "path", b"path", "span", b"span", "trailing_comments", b"trailing_comments"]) -> None: ... LOCATION_FIELD_NUMBER: builtins.int @property @@ -1441,12 +1427,13 @@ class SourceCodeInfo(google.protobuf.message.Message): ignore those that it doesn't understand, as more types of locations could be recorded in the future. """ - pass - def __init__(self, + def __init__( + self, *, - location: typing.Optional[typing.Iterable[global___SourceCodeInfo.Location]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["location",b"location"]) -> None: ... + location: collections.abc.Iterable[global___SourceCodeInfo.Location] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["location", b"location"]) -> None: ... + global___SourceCodeInfo = SourceCodeInfo class GeneratedCodeInfo(google.protobuf.message.Message): @@ -1454,9 +1441,12 @@ class GeneratedCodeInfo(google.protobuf.message.Message): file. A GeneratedCodeInfo message is associated with only one generated source file, but may contain references to different source .proto files. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class Annotation(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + PATH_FIELD_NUMBER: builtins.int SOURCE_FILE_FIELD_NUMBER: builtins.int BEGIN_FIELD_NUMBER: builtins.int @@ -1466,30 +1456,27 @@ class GeneratedCodeInfo(google.protobuf.message.Message): """Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path. """ - pass - source_file: typing.Text + source_file: builtins.str """Identifies the filesystem path to the original source .proto.""" - begin: builtins.int """Identifies the starting offset in bytes in the generated code that relates to the identified object. """ - end: builtins.int """Identifies the ending offset in bytes in the generated code that relates to the identified offset. The end offset should be one past the last relevant byte (so the length of the text = end - begin). """ - - def __init__(self, + def __init__( + self, *, - path: typing.Optional[typing.Iterable[builtins.int]] = ..., - source_file: typing.Optional[typing.Text] = ..., - begin: typing.Optional[builtins.int] = ..., - end: typing.Optional[builtins.int] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["begin",b"begin","end",b"end","source_file",b"source_file"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["begin",b"begin","end",b"end","path",b"path","source_file",b"source_file"]) -> None: ... + path: collections.abc.Iterable[builtins.int] | None = ..., + source_file: builtins.str | None = ..., + begin: builtins.int | None = ..., + end: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["begin", b"begin", "end", b"end", "source_file", b"source_file"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["begin", b"begin", "end", b"end", "path", b"path", "source_file", b"source_file"]) -> None: ... ANNOTATION_FIELD_NUMBER: builtins.int @property @@ -1497,10 +1484,11 @@ class GeneratedCodeInfo(google.protobuf.message.Message): """An Annotation connects some span of text in generated code to an element of its generating .proto file. """ - pass - def __init__(self, + def __init__( + self, *, - annotation: typing.Optional[typing.Iterable[global___GeneratedCodeInfo.Annotation]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["annotation",b"annotation"]) -> None: ... + annotation: collections.abc.Iterable[global___GeneratedCodeInfo.Annotation] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["annotation", b"annotation"]) -> None: ... + global___GeneratedCodeInfo = GeneratedCodeInfo diff --git a/stubs/protobuf/google/protobuf/duration_pb2.pyi b/stubs/protobuf/google/protobuf/duration_pb2.pyi index 07e905033..1f7536ec4 100644 --- a/stubs/protobuf/google/protobuf/duration_pb2.pyi +++ b/stubs/protobuf/google/protobuf/duration_pb2.pyi @@ -1,13 +1,46 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -71,7 +104,9 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s". """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SECONDS_FIELD_NUMBER: builtins.int NANOS_FIELD_NUMBER: builtins.int seconds: builtins.int @@ -79,7 +114,6 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn to +315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years """ - nanos: builtins.int """Signed fractions of a second at nanosecond resolution of the span of time. Durations less than one second are represented with a 0 @@ -88,11 +122,12 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn of the same sign as the `seconds` field. Must be from -999,999,999 to +999,999,999 inclusive. """ - - def __init__(self, + def __init__( + self, *, - seconds: typing.Optional[builtins.int] = ..., - nanos: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["nanos",b"nanos","seconds",b"seconds"]) -> None: ... + seconds: builtins.int | None = ..., + nanos: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["nanos", b"nanos", "seconds", b"seconds"]) -> None: ... + global___Duration = Duration diff --git a/stubs/protobuf/google/protobuf/empty_pb2.pyi b/stubs/protobuf/google/protobuf/empty_pb2.pyi index 6615bb960..97fd53f6d 100644 --- a/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -1,6 +1,35 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import google.protobuf.descriptor import google.protobuf.message @@ -18,7 +47,11 @@ class Empty(google.protobuf.message.Message): The JSON representation for `Empty` is empty JSON object `{}`. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self, - ) -> None: ... + + def __init__( + self, + ) -> None: ... + global___Empty = Empty diff --git a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi index c14cfe6ab..95419b83b 100644 --- a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi +++ b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi @@ -1,14 +1,48 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -213,15 +247,18 @@ class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_k request should verify the included field paths, and return an `INVALID_ARGUMENT` error if any path is unmappable. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PATHS_FIELD_NUMBER: builtins.int @property - def paths(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def paths(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """The set of field mask paths.""" - pass - def __init__(self, + def __init__( + self, *, - paths: typing.Optional[typing.Iterable[typing.Text]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["paths",b"paths"]) -> None: ... + paths: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["paths", b"paths"]) -> None: ... + global___FieldMask = FieldMask diff --git a/stubs/protobuf/google/protobuf/source_context_pb2.pyi b/stubs/protobuf/google/protobuf/source_context_pb2.pyi index d2f3e8db9..ad6fc42ee 100644 --- a/stubs/protobuf/google/protobuf/source_context_pb2.pyi +++ b/stubs/protobuf/google/protobuf/source_context_pb2.pyi @@ -1,12 +1,45 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -14,16 +47,19 @@ class SourceContext(google.protobuf.message.Message): """`SourceContext` represents information about the source of a protobuf element, like the file in which it is defined. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FILE_NAME_FIELD_NUMBER: builtins.int - file_name: typing.Text + file_name: builtins.str """The path-qualified name of the .proto file that contained the associated protobuf element. For example: `"google/protobuf/source_context.proto"`. """ - - def __init__(self, + def __init__( + self, *, - file_name: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["file_name",b"file_name"]) -> None: ... + file_name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["file_name", b"file_name"]) -> None: ... + global___SourceContext = SourceContext diff --git a/stubs/protobuf/google/protobuf/struct_pb2.pyi b/stubs/protobuf/google/protobuf/struct_pb2.pyi index e1377c074..8d0756b1e 100644 --- a/stubs/protobuf/google/protobuf/struct_pb2.pyi +++ b/stubs/protobuf/google/protobuf/struct_pb2.pyi @@ -1,22 +1,58 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.internal.well_known_types import google.protobuf.message +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _NullValue: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _NullValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NullValue.ValueType], builtins.type): + +class _NullValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NullValue.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor NULL_VALUE: _NullValue.ValueType # 0 """Null value.""" @@ -27,14 +63,11 @@ class NullValue(_NullValue, metaclass=_NullValueEnumTypeWrapper): The JSON representation for `NullValue` is JSON `null`. """ - pass NULL_VALUE: NullValue.ValueType # 0 """Null value.""" - global___NullValue = NullValue - class Struct(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Struct): """`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` @@ -45,32 +78,37 @@ class Struct(google.protobuf.message.Message, google.protobuf.internal.well_know The JSON representation for `Struct` is JSON object. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class FieldsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int - key: typing.Text + key: builtins.str @property def value(self) -> global___Value: ... - def __init__(self, + def __init__( + self, *, - key: typing.Optional[typing.Text] = ..., - value: typing.Optional[global___Value] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["key",b"key","value",b"value"]) -> None: ... + key: builtins.str | None = ..., + value: global___Value | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["key", b"key", "value", b"value"]) -> None: ... FIELDS_FIELD_NUMBER: builtins.int @property - def fields(self) -> google.protobuf.internal.containers.MessageMap[typing.Text, global___Value]: + def fields(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___Value]: """Unordered map of dynamically typed values.""" - pass - def __init__(self, + def __init__( + self, *, - fields: typing.Optional[typing.Mapping[typing.Text, global___Value]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["fields",b"fields"]) -> None: ... + fields: collections.abc.Mapping[builtins.str, global___Value] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["fields", b"fields"]) -> None: ... + global___Struct = Struct class Value(google.protobuf.message.Message): @@ -81,7 +119,9 @@ class Value(google.protobuf.message.Message): The JSON representation for `Value` is JSON value. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NULL_VALUE_FIELD_NUMBER: builtins.int NUMBER_VALUE_FIELD_NUMBER: builtins.int STRING_VALUE_FIELD_NUMBER: builtins.int @@ -90,36 +130,32 @@ class Value(google.protobuf.message.Message): LIST_VALUE_FIELD_NUMBER: builtins.int null_value: global___NullValue.ValueType """Represents a null value.""" - number_value: builtins.float """Represents a double value.""" - - string_value: typing.Text + string_value: builtins.str """Represents a string value.""" - bool_value: builtins.bool """Represents a boolean value.""" - @property def struct_value(self) -> global___Struct: """Represents a structured value.""" - pass @property def list_value(self) -> global___ListValue: """Represents a repeated `Value`.""" - pass - def __init__(self, + def __init__( + self, *, - null_value: typing.Optional[global___NullValue.ValueType] = ..., - number_value: typing.Optional[builtins.float] = ..., - string_value: typing.Optional[typing.Text] = ..., - bool_value: typing.Optional[builtins.bool] = ..., - struct_value: typing.Optional[global___Struct] = ..., - list_value: typing.Optional[global___ListValue] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["bool_value",b"bool_value","kind",b"kind","list_value",b"list_value","null_value",b"null_value","number_value",b"number_value","string_value",b"string_value","struct_value",b"struct_value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["bool_value",b"bool_value","kind",b"kind","list_value",b"list_value","null_value",b"null_value","number_value",b"number_value","string_value",b"string_value","struct_value",b"struct_value"]) -> None: ... - def WhichOneof(self, oneof_group: typing_extensions.Literal["kind",b"kind"]) -> typing.Optional[typing_extensions.Literal["null_value","number_value","string_value","bool_value","struct_value","list_value"]]: ... + null_value: global___NullValue.ValueType | None = ..., + number_value: builtins.float | None = ..., + string_value: builtins.str | None = ..., + bool_value: builtins.bool | None = ..., + struct_value: global___Struct | None = ..., + list_value: global___ListValue | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["bool_value", b"bool_value", "kind", b"kind", "list_value", b"list_value", "null_value", b"null_value", "number_value", b"number_value", "string_value", b"string_value", "struct_value", b"struct_value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["bool_value", b"bool_value", "kind", b"kind", "list_value", b"list_value", "null_value", b"null_value", "number_value", b"number_value", "string_value", b"string_value", "struct_value", b"struct_value"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["kind", b"kind"]) -> typing_extensions.Literal["null_value", "number_value", "string_value", "bool_value", "struct_value", "list_value"] | None: ... + global___Value = Value class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_known_types.ListValue): @@ -127,15 +163,18 @@ class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_k The JSON representation for `ListValue` is JSON array. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUES_FIELD_NUMBER: builtins.int @property def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Value]: """Repeated field of dynamically typed values.""" - pass - def __init__(self, + def __init__( + self, *, - values: typing.Optional[typing.Iterable[global___Value]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["values",b"values"]) -> None: ... + values: collections.abc.Iterable[global___Value] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["values", b"values"]) -> None: ... + global___ListValue = ListValue diff --git a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi index e3c8d9b5d..cefde9085 100644 --- a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi +++ b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi @@ -1,13 +1,46 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins import google.protobuf.descriptor import google.protobuf.internal.well_known_types import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -104,7 +137,9 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D ) to obtain a formatter capable of generating timestamps in this format. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SECONDS_FIELD_NUMBER: builtins.int NANOS_FIELD_NUMBER: builtins.int seconds: builtins.int @@ -112,18 +147,18 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. """ - nanos: builtins.int """Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. """ - - def __init__(self, + def __init__( + self, *, - seconds: typing.Optional[builtins.int] = ..., - nanos: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["nanos",b"nanos","seconds",b"seconds"]) -> None: ... + seconds: builtins.int | None = ..., + nanos: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["nanos", b"nanos", "seconds", b"seconds"]) -> None: ... + global___Timestamp = Timestamp diff --git a/stubs/protobuf/google/protobuf/type_pb2.pyi b/stubs/protobuf/google/protobuf/type_pb2.pyi index 7cc9f8c2d..cbb60b40b 100644 --- a/stubs/protobuf/google/protobuf/type_pb2.pyi +++ b/stubs/protobuf/google/protobuf/type_pb2.pyi @@ -1,248 +1,235 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2008 Google Inc. All rights reserved. +https://developers.google.com/protocol-buffers/ + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ import builtins +import collections.abc import google.protobuf.any_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message import google.protobuf.source_context_pb2 +import sys import typing -import typing_extensions + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _Syntax: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _SyntaxEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Syntax.ValueType], builtins.type): + +class _SyntaxEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Syntax.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor SYNTAX_PROTO2: _Syntax.ValueType # 0 """Syntax `proto2`.""" - SYNTAX_PROTO3: _Syntax.ValueType # 1 """Syntax `proto3`.""" class Syntax(_Syntax, metaclass=_SyntaxEnumTypeWrapper): """The syntax in which a protocol buffer element is defined.""" - pass SYNTAX_PROTO2: Syntax.ValueType # 0 """Syntax `proto2`.""" - SYNTAX_PROTO3: Syntax.ValueType # 1 """Syntax `proto3`.""" - global___Syntax = Syntax - class Type(google.protobuf.message.Message): """A protocol buffer message type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int FIELDS_FIELD_NUMBER: builtins.int ONEOFS_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int SOURCE_CONTEXT_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The fully qualified message name.""" - @property def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Field]: """The list of fields.""" - pass @property - def oneofs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: + def oneofs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """The list of types appearing in `oneof` definitions in this type.""" - pass @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """The protocol buffer options.""" - pass @property def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: """The source context.""" - pass syntax: global___Syntax.ValueType """The source syntax.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - fields: typing.Optional[typing.Iterable[global___Field]] = ..., - oneofs: typing.Optional[typing.Iterable[typing.Text]] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ..., - syntax: typing.Optional[global___Syntax.ValueType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["fields",b"fields","name",b"name","oneofs",b"oneofs","options",b"options","source_context",b"source_context","syntax",b"syntax"]) -> None: ... + name: builtins.str | None = ..., + fields: collections.abc.Iterable[global___Field] | None = ..., + oneofs: collections.abc.Iterable[builtins.str] | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + source_context: google.protobuf.source_context_pb2.SourceContext | None = ..., + syntax: global___Syntax.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["source_context", b"source_context"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["fields", b"fields", "name", b"name", "oneofs", b"oneofs", "options", b"options", "source_context", b"source_context", "syntax", b"syntax"]) -> None: ... + global___Type = Type class Field(google.protobuf.message.Message): """A single field of a message type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + class _Kind: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Kind.ValueType], builtins.type): + + class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Kind.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor TYPE_UNKNOWN: Field._Kind.ValueType # 0 """Field type unknown.""" - TYPE_DOUBLE: Field._Kind.ValueType # 1 """Field type double.""" - TYPE_FLOAT: Field._Kind.ValueType # 2 """Field type float.""" - TYPE_INT64: Field._Kind.ValueType # 3 """Field type int64.""" - TYPE_UINT64: Field._Kind.ValueType # 4 """Field type uint64.""" - TYPE_INT32: Field._Kind.ValueType # 5 """Field type int32.""" - TYPE_FIXED64: Field._Kind.ValueType # 6 """Field type fixed64.""" - TYPE_FIXED32: Field._Kind.ValueType # 7 """Field type fixed32.""" - TYPE_BOOL: Field._Kind.ValueType # 8 """Field type bool.""" - TYPE_STRING: Field._Kind.ValueType # 9 """Field type string.""" - TYPE_GROUP: Field._Kind.ValueType # 10 """Field type group. Proto2 syntax only, and deprecated.""" - TYPE_MESSAGE: Field._Kind.ValueType # 11 """Field type message.""" - TYPE_BYTES: Field._Kind.ValueType # 12 """Field type bytes.""" - TYPE_UINT32: Field._Kind.ValueType # 13 """Field type uint32.""" - TYPE_ENUM: Field._Kind.ValueType # 14 """Field type enum.""" - TYPE_SFIXED32: Field._Kind.ValueType # 15 """Field type sfixed32.""" - TYPE_SFIXED64: Field._Kind.ValueType # 16 """Field type sfixed64.""" - TYPE_SINT32: Field._Kind.ValueType # 17 """Field type sint32.""" - TYPE_SINT64: Field._Kind.ValueType # 18 """Field type sint64.""" class Kind(_Kind, metaclass=_KindEnumTypeWrapper): """Basic field types.""" - pass TYPE_UNKNOWN: Field.Kind.ValueType # 0 """Field type unknown.""" - TYPE_DOUBLE: Field.Kind.ValueType # 1 """Field type double.""" - TYPE_FLOAT: Field.Kind.ValueType # 2 """Field type float.""" - TYPE_INT64: Field.Kind.ValueType # 3 """Field type int64.""" - TYPE_UINT64: Field.Kind.ValueType # 4 """Field type uint64.""" - TYPE_INT32: Field.Kind.ValueType # 5 """Field type int32.""" - TYPE_FIXED64: Field.Kind.ValueType # 6 """Field type fixed64.""" - TYPE_FIXED32: Field.Kind.ValueType # 7 """Field type fixed32.""" - TYPE_BOOL: Field.Kind.ValueType # 8 """Field type bool.""" - TYPE_STRING: Field.Kind.ValueType # 9 """Field type string.""" - TYPE_GROUP: Field.Kind.ValueType # 10 """Field type group. Proto2 syntax only, and deprecated.""" - TYPE_MESSAGE: Field.Kind.ValueType # 11 """Field type message.""" - TYPE_BYTES: Field.Kind.ValueType # 12 """Field type bytes.""" - TYPE_UINT32: Field.Kind.ValueType # 13 """Field type uint32.""" - TYPE_ENUM: Field.Kind.ValueType # 14 """Field type enum.""" - TYPE_SFIXED32: Field.Kind.ValueType # 15 """Field type sfixed32.""" - TYPE_SFIXED64: Field.Kind.ValueType # 16 """Field type sfixed64.""" - TYPE_SINT32: Field.Kind.ValueType # 17 """Field type sint32.""" - TYPE_SINT64: Field.Kind.ValueType # 18 """Field type sint64.""" - class _Cardinality: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType - class _CardinalityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Cardinality.ValueType], builtins.type): + + class _CardinalityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Cardinality.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor CARDINALITY_UNKNOWN: Field._Cardinality.ValueType # 0 """For fields with unknown cardinality.""" - CARDINALITY_OPTIONAL: Field._Cardinality.ValueType # 1 """For optional fields.""" - CARDINALITY_REQUIRED: Field._Cardinality.ValueType # 2 """For required fields. Proto2 syntax only.""" - CARDINALITY_REPEATED: Field._Cardinality.ValueType # 3 """For repeated fields.""" class Cardinality(_Cardinality, metaclass=_CardinalityEnumTypeWrapper): """Whether a field is optional, required, or repeated.""" - pass CARDINALITY_UNKNOWN: Field.Cardinality.ValueType # 0 """For fields with unknown cardinality.""" - CARDINALITY_OPTIONAL: Field.Cardinality.ValueType # 1 """For optional fields.""" - CARDINALITY_REQUIRED: Field.Cardinality.ValueType # 2 """For required fields. Proto2 syntax only.""" - CARDINALITY_REPEATED: Field.Cardinality.ValueType # 3 """For repeated fields.""" - KIND_FIELD_NUMBER: builtins.int CARDINALITY_FIELD_NUMBER: builtins.int NUMBER_FIELD_NUMBER: builtins.int @@ -255,132 +242,125 @@ class Field(google.protobuf.message.Message): DEFAULT_VALUE_FIELD_NUMBER: builtins.int kind: global___Field.Kind.ValueType """The field type.""" - cardinality: global___Field.Cardinality.ValueType """The field cardinality.""" - number: builtins.int """The field number.""" - - name: typing.Text + name: builtins.str """The field name.""" - - type_url: typing.Text + type_url: builtins.str """The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. """ - oneof_index: builtins.int """The index of the field type in `Type.oneofs`, for message or enumeration types. The first type has index 1; zero means the type is not in the list. """ - packed: builtins.bool """Whether to use alternative packed wire representation.""" - @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """The protocol buffer options.""" - pass - json_name: typing.Text + json_name: builtins.str """The field JSON name.""" - - default_value: typing.Text + default_value: builtins.str """The string value of the default value of this field. Proto2 syntax only.""" - - def __init__(self, + def __init__( + self, *, - kind: typing.Optional[global___Field.Kind.ValueType] = ..., - cardinality: typing.Optional[global___Field.Cardinality.ValueType] = ..., - number: typing.Optional[builtins.int] = ..., - name: typing.Optional[typing.Text] = ..., - type_url: typing.Optional[typing.Text] = ..., - oneof_index: typing.Optional[builtins.int] = ..., - packed: typing.Optional[builtins.bool] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - json_name: typing.Optional[typing.Text] = ..., - default_value: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["cardinality",b"cardinality","default_value",b"default_value","json_name",b"json_name","kind",b"kind","name",b"name","number",b"number","oneof_index",b"oneof_index","options",b"options","packed",b"packed","type_url",b"type_url"]) -> None: ... + kind: global___Field.Kind.ValueType | None = ..., + cardinality: global___Field.Cardinality.ValueType | None = ..., + number: builtins.int | None = ..., + name: builtins.str | None = ..., + type_url: builtins.str | None = ..., + oneof_index: builtins.int | None = ..., + packed: builtins.bool | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + json_name: builtins.str | None = ..., + default_value: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["cardinality", b"cardinality", "default_value", b"default_value", "json_name", b"json_name", "kind", b"kind", "name", b"name", "number", b"number", "oneof_index", b"oneof_index", "options", b"options", "packed", b"packed", "type_url", b"type_url"]) -> None: ... + global___Field = Field class Enum(google.protobuf.message.Message): """Enum type definition.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int ENUMVALUE_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int SOURCE_CONTEXT_FIELD_NUMBER: builtins.int SYNTAX_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """Enum type name.""" - @property def enumvalue(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumValue]: """Enum value definitions.""" - pass @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """Protocol buffer options.""" - pass @property def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: """The source context.""" - pass syntax: global___Syntax.ValueType """The source syntax.""" - - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - enumvalue: typing.Optional[typing.Iterable[global___EnumValue]] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - source_context: typing.Optional[google.protobuf.source_context_pb2.SourceContext] = ..., - syntax: typing.Optional[global___Syntax.ValueType] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["source_context",b"source_context"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["enumvalue",b"enumvalue","name",b"name","options",b"options","source_context",b"source_context","syntax",b"syntax"]) -> None: ... + name: builtins.str | None = ..., + enumvalue: collections.abc.Iterable[global___EnumValue] | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + source_context: google.protobuf.source_context_pb2.SourceContext | None = ..., + syntax: global___Syntax.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["source_context", b"source_context"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["enumvalue", b"enumvalue", "name", b"name", "options", b"options", "source_context", b"source_context", "syntax", b"syntax"]) -> None: ... + global___Enum = Enum class EnumValue(google.protobuf.message.Message): """Enum value definition.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int NUMBER_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """Enum value name.""" - number: builtins.int """Enum value number.""" - @property def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: """Protocol buffer options.""" - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - number: typing.Optional[builtins.int] = ..., - options: typing.Optional[typing.Iterable[global___Option]] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","number",b"number","options",b"options"]) -> None: ... + name: builtins.str | None = ..., + number: builtins.int | None = ..., + options: collections.abc.Iterable[global___Option] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "number", b"number", "options", b"options"]) -> None: ... + global___EnumValue = EnumValue class Option(google.protobuf.message.Message): """A protocol buffer option, which can be attached to a message, field, enumeration, etc. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int - name: typing.Text + name: builtins.str """The option's name. For protobuf built-in options (options defined in descriptor.proto), this is the short name. For example, `"map_entry"`. For custom options, it should be the fully-qualified name. For example, `"google.api.http"`. """ - @property def value(self) -> google.protobuf.any_pb2.Any: """The option's value packed in an Any message. If the value is a primitive, @@ -388,12 +368,13 @@ class Option(google.protobuf.message.Message): should be used. If the value is an enum, it should be stored as an int32 value using the google.protobuf.Int32Value type. """ - pass - def __init__(self, + def __init__( + self, *, - name: typing.Optional[typing.Text] = ..., - value: typing.Optional[google.protobuf.any_pb2.Any] = ..., - ) -> None: ... - def HasField(self, field_name: typing_extensions.Literal["value",b"value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing_extensions.Literal["name",b"name","value",b"value"]) -> None: ... + name: builtins.str | None = ..., + value: google.protobuf.any_pb2.Any | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["name", b"name", "value", b"value"]) -> None: ... + global___Option = Option diff --git a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi index 5bb133eae..c3155f65b 100644 --- a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi +++ b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi @@ -1,12 +1,25 @@ """ @generated by mypy-protobuf. Do not edit manually! isort:skip_file +Wrappers for primitive (non-message) types. These types are useful +for embedding primitives in the `google.protobuf.Any` type and for places +where we need to distinguish between the absence of a primitive +typed field and its default value. + +These wrappers have no meaningful use within repeated fields as they lack +the ability to detect presence on individual elements. +These wrappers have no meaningful use within a map or a oneof since +individual entries of a map or fields of a oneof can already detect presence. """ import builtins import google.protobuf.descriptor import google.protobuf.message -import typing -import typing_extensions +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @@ -15,16 +28,19 @@ class DoubleValue(google.protobuf.message.Message): The JSON representation for `DoubleValue` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.float """The double value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.float] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.float | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___DoubleValue = DoubleValue class FloatValue(google.protobuf.message.Message): @@ -32,16 +48,19 @@ class FloatValue(google.protobuf.message.Message): The JSON representation for `FloatValue` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.float """The float value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.float] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.float | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___FloatValue = FloatValue class Int64Value(google.protobuf.message.Message): @@ -49,16 +68,19 @@ class Int64Value(google.protobuf.message.Message): The JSON representation for `Int64Value` is JSON string. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The int64 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___Int64Value = Int64Value class UInt64Value(google.protobuf.message.Message): @@ -66,16 +88,19 @@ class UInt64Value(google.protobuf.message.Message): The JSON representation for `UInt64Value` is JSON string. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The uint64 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___UInt64Value = UInt64Value class Int32Value(google.protobuf.message.Message): @@ -83,16 +108,19 @@ class Int32Value(google.protobuf.message.Message): The JSON representation for `Int32Value` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The int32 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___Int32Value = Int32Value class UInt32Value(google.protobuf.message.Message): @@ -100,16 +128,19 @@ class UInt32Value(google.protobuf.message.Message): The JSON representation for `UInt32Value` is JSON number. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.int """The uint32 value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.int] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___UInt32Value = UInt32Value class BoolValue(google.protobuf.message.Message): @@ -117,16 +148,19 @@ class BoolValue(google.protobuf.message.Message): The JSON representation for `BoolValue` is JSON `true` and `false`. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.bool """The bool value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.bool] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___BoolValue = BoolValue class StringValue(google.protobuf.message.Message): @@ -134,16 +168,19 @@ class StringValue(google.protobuf.message.Message): The JSON representation for `StringValue` is JSON string. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: typing.Text - """The string value.""" - def __init__(self, + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + VALUE_FIELD_NUMBER: builtins.int + value: builtins.str + """The string value.""" + def __init__( + self, *, - value: typing.Optional[typing.Text] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___StringValue = StringValue class BytesValue(google.protobuf.message.Message): @@ -151,14 +188,17 @@ class BytesValue(google.protobuf.message.Message): The JSON representation for `BytesValue` is JSON string. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + VALUE_FIELD_NUMBER: builtins.int value: builtins.bytes """The bytes value.""" - - def __init__(self, + def __init__( + self, *, - value: typing.Optional[builtins.bytes] = ..., - ) -> None: ... - def ClearField(self, field_name: typing_extensions.Literal["value",b"value"]) -> None: ... + value: builtins.bytes | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["value", b"value"]) -> None: ... + global___BytesValue = BytesValue diff --git a/tests/check_new_syntax.py b/tests/check_new_syntax.py index 151c75b04..32f7c80e8 100755 --- a/tests/check_new_syntax.py +++ b/tests/check_new_syntax.py @@ -96,9 +96,6 @@ def check_new_syntax(tree: ast.AST, path: Path, stub: str) -> list[str]: def main() -> None: errors = [] for path in chain(Path("stdlib").rglob("*.pyi"), Path("stubs").rglob("*.pyi")): - if Path("stubs/protobuf/google/protobuf") in path.parents: # TODO: fix protobuf stubs - continue - with open(path) as f: stub = f.read() tree = ast.parse(stub)