diff --git a/.flake8 b/.flake8 index e45a7f11787b..7f5ae75e78e6 100644 --- a/.flake8 +++ b/.flake8 @@ -7,10 +7,11 @@ select = Y extend-ignore = Y041,Y090,Y091 per-file-ignores = # Generated protobuf files: + # Y015: mypy-protobuf aliases TypeAlias and Literal with private names. # Y021: Include docstrings # Y023: Alias typing as typing_extensions # Y026: Have implicit type aliases # Y053: have literals >50 characters long - stubs/*_pb2.pyi: Y021, Y023, Y026, Y053 + stubs/*_pb2.pyi: Y015, Y021, Y023, Y026, Y053 exclude = .venv*,.git diff --git a/scripts/sync_protobuf/google_protobuf.py b/scripts/sync_protobuf/google_protobuf.py index 358e5c454e44..93cc4742d4de 100755 --- a/scripts/sync_protobuf/google_protobuf.py +++ b/scripts/sync_protobuf/google_protobuf.py @@ -28,7 +28,6 @@ EXTRACTED_PACKAGE_DIR = f"protobuf-{PACKAGE_VERSION}" VERSION_PATTERN = re.compile(r'def game_version\(\):\n return "(.+?)"') -PROTO_FILE_PATTERN = re.compile(r'"//:(.*)_proto"') def extract_python_version(file_path: Path) -> str: @@ -42,36 +41,39 @@ def extract_python_version(file_path: Path) -> str: def extract_proto_file_paths(temp_dir: Path) -> list[str]: - """ - Roughly reproduce the subset of .proto files on the public interface - as described in py_proto_library calls in - https://github.com/protocolbuffers/protobuf/blob/main/python/dist/BUILD.bazel . - """ - with (temp_dir / EXTRACTED_PACKAGE_DIR / "python" / "dist" / "BUILD.bazel").open() as file: - matched_lines = filter(None, (re.search(PROTO_FILE_PATTERN, line) for line in file)) - proto_files = [ - EXTRACTED_PACKAGE_DIR + "/src/google/protobuf/" + match.group(1).replace("compiler_", "compiler/") + ".proto" - for match in matched_lines - ] - return proto_files + """Read the language-neutral protos shipped in the Python distribution.""" + source_dir = temp_dir / EXTRACTED_PACKAGE_DIR / "src" / "google" / "protobuf" + build = (source_dir / "BUILD.bazel").read_text() + filegroups = dict(re.findall(r'filegroup\(\s*name = "([^"]+)",\s*srcs = (?:glob\()?\[(.*?)\]', build, re.DOTALL)) + + def sources(name: str) -> set[str]: + result: set[str] = set() + for source in re.findall(r'"([^"]+)"', filegroups[name]): + if source.startswith(":"): + result.update(sources(source[1:])) + else: + result.update(str(path.relative_to(source_dir)) for path in source_dir.glob(source)) + return result + + proto_files = sources("language_neutral_proto_srcs") | {"descriptor.proto", "compiler/plugin.proto"} + return [str((source_dir / proto).relative_to(temp_dir)) for proto in sorted(proto_files)] def main() -> None: temp_dir = Path(tempfile.mkdtemp()) - # Fetch s2clientprotocol (which contains all the .proto files) + # Fetch protobuf (which contains all the .proto files) archive_path = temp_dir / ARCHIVE_FILENAME download_file(ARCHIVE_URL, archive_path) extract_archive(archive_path, temp_dir) + proto_files = extract_proto_file_paths(temp_dir) + # Remove existing pyi for old_stub in STUBS_FOLDER.rglob("*_pb2.pyi"): old_stub.unlink() protoc_version = run_protoc( - proto_paths=(f"{EXTRACTED_PACKAGE_DIR}/src",), - mypy_out=STUBS_FOLDER, - proto_globs=extract_proto_file_paths(temp_dir), - cwd=temp_dir, + proto_paths=(f"{EXTRACTED_PACKAGE_DIR}/src",), mypy_out=STUBS_FOLDER, proto_globs=proto_files, cwd=temp_dir ) python_protobuf_version = extract_python_version(temp_dir / EXTRACTED_PACKAGE_DIR / "version.json") diff --git a/stubs/protobuf/METADATA.toml b/stubs/protobuf/METADATA.toml index 70379af2df82..3c28d75e1670 100644 --- a/stubs/protobuf/METADATA.toml +++ b/stubs/protobuf/METADATA.toml @@ -1,8 +1,8 @@ # Using an exact number in the specifier for scripts/sync_protobuf/google_protobuf.py # When updating, also re-run the script -version = "~=7.35.1" +version = "~=7.36.2" upstream-repository = "https://github.com/protocolbuffers/protobuf" -extra-description = "Partially generated using [mypy-protobuf==3.6.0](https://github.com/nipunn1313/mypy-protobuf/tree/v3.6.0) and libprotoc 35.1 on [protobuf v35.1](https://github.com/protocolbuffers/protobuf/releases/tag/v35.1) (python `protobuf==7.35.1`)." +extra-description = "Partially generated using [mypy-protobuf==5.1.0](https://github.com/nipunn1313/mypy-protobuf/tree/v5.1.0) and libprotoc 35.1 on [protobuf v36.2](https://github.com/protocolbuffers/protobuf/releases/tag/v36.2) (python `protobuf==7.36.2`)." partial-stub = true [tool.stubtest] diff --git a/stubs/protobuf/google/protobuf/any_pb2.pyi b/stubs/protobuf/google/protobuf/any_pb2.pyi index 991e4261c80a..409ea3ebf7be 100644 --- a/stubs/protobuf/google/protobuf/any_pb2.pyi +++ b/stubs/protobuf/google/protobuf/any_pb2.pyi @@ -32,17 +32,23 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import typing +import builtins as _builtins +import sys +import typing as _typing -import google.protobuf.descriptor -import google.protobuf.internal.well_known_types -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message +from google.protobuf.internal import well_known_types as _well_known_types -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -@typing.final -class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Any): +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class Any(_message.Message, _well_known_types.Any): """`Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. @@ -75,11 +81,11 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - TYPE_URL_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - type_url: builtins.str + TYPE_URL_FIELD_NUMBER: _builtins.int + VALUE_FIELD_NUMBER: _builtins.int + type_url: _builtins.str """Identifies the type of the serialized Protobuf message with a URI reference consisting of a prefix ending in a slash and the fully-qualified type name. @@ -110,9 +116,13 @@ class Any(google.protobuf.message.Message, google.protobuf.internal.well_known_t implemented one and considers contacting these URLs to be problematic and a potential security issue. Do not attempt to contact type URLs. """ - value: builtins.bytes + value: _builtins.bytes """Holds a Protobuf serialization of the type described by type_url.""" - def __init__(self, *, type_url: builtins.str | None = ..., value: builtins.bytes | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["type_url", b"type_url", "value", b"value"]) -> None: ... - -global___Any = Any + def __init__(self, *, type_url: _builtins.str | None = ..., value: _builtins.bytes | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["type_url", b"type_url", "value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Any: _TypeAlias = Any # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/api_pb2.pyi b/stubs/protobuf/google/protobuf/api_pb2.pyi index 9c65bc6ac8fc..d33101c6f223 100644 --- a/stubs/protobuf/google/protobuf/api_pb2.pyi +++ b/stubs/protobuf/google/protobuf/api_pb2.pyi @@ -32,20 +32,34 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import collections.abc -import typing - -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.message -import google.protobuf.source_context_pb2 -import google.protobuf.type_pb2 - -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class Api(google.protobuf.message.Message): +import builtins as _builtins +import sys +import typing as _typing +from collections import abc as _abc + +from google.protobuf import ( + descriptor as _descriptor, + message as _message, + source_context_pb2 as _source_context_pb2, + type_pb2 as _type_pb2, +) +from google.protobuf.internal import containers as _containers + +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never + +if sys.version_info >= (3, 13): + from warnings import deprecated as _deprecated +else: + from typing_extensions import deprecated as _deprecated + +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class Api(_message.Message): """Api is a light-weight descriptor for an API Interface. Interfaces are also described as "protocol buffer services" in some contexts, @@ -62,21 +76,21 @@ class Api(google.protobuf.message.Message): make use of FileDescriptorSet which preserves the necessary information. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - NAME_FIELD_NUMBER: builtins.int - METHODS_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - VERSION_FIELD_NUMBER: builtins.int - SOURCE_CONTEXT_FIELD_NUMBER: builtins.int - MIXINS_FIELD_NUMBER: builtins.int - SYNTAX_FIELD_NUMBER: builtins.int - EDITION_FIELD_NUMBER: builtins.int - name: builtins.str + DESCRIPTOR: _descriptor.Descriptor + + NAME_FIELD_NUMBER: _builtins.int + METHODS_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + VERSION_FIELD_NUMBER: _builtins.int + SOURCE_CONTEXT_FIELD_NUMBER: _builtins.int + MIXINS_FIELD_NUMBER: _builtins.int + SYNTAX_FIELD_NUMBER: _builtins.int + EDITION_FIELD_NUMBER: _builtins.int + name: _builtins.str """The fully qualified name of this interface, including package name followed by the interface's simple name. """ - version: builtins.str + 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 @@ -97,67 +111,67 @@ class Api(google.protobuf.message.Message): be omitted. Zero major versions must only be used for experimental, non-GA interfaces. """ - syntax: google.protobuf.type_pb2.Syntax.ValueType + syntax: _type_pb2.Syntax.ValueType """The source syntax of the service.""" - edition: builtins.str + edition: _builtins.str """The source edition string, only valid when syntax is SYNTAX_EDITIONS.""" - @property - def methods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Method]: + @_builtins.property + def methods(self) -> _containers.RepeatedCompositeFieldContainer[Global___Method]: """The methods of this interface, in unspecified order.""" - @property - def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]: + @_builtins.property + def options(self) -> _containers.RepeatedCompositeFieldContainer[_type_pb2.Option]: """Any metadata attached to the interface.""" - @property - def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: + @_builtins.property + def source_context(self) -> _source_context_pb2.SourceContext: """Source context for the protocol buffer service represented by this message. """ - @property - def mixins(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Mixin]: + @_builtins.property + def mixins(self) -> _containers.RepeatedCompositeFieldContainer[Global___Mixin]: """Included interfaces. See [Mixin][].""" def __init__( self, *, - 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 = ..., - edition: builtins.str | None = ..., + name: _builtins.str | None = ..., + methods: _abc.Iterable[Global___Method] | None = ..., + options: _abc.Iterable[_type_pb2.Option] | None = ..., + version: _builtins.str | None = ..., + source_context: _source_context_pb2.SourceContext | None = ..., + mixins: _abc.Iterable[Global___Mixin] | None = ..., + syntax: _type_pb2.Syntax.ValueType | None = ..., + edition: _builtins.str | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["source_context", b"source_context"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "edition", - b"edition", - "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 - -@typing.final -class Method(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal["source_context", b"source_context"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "edition", + b"edition", + "methods", + b"methods", + "mixins", + b"mixins", + "name", + b"name", + "options", + b"options", + "source_context", + b"source_context", + "syntax", + b"syntax", + "version", + b"version", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Api: _TypeAlias = Api # noqa: Y015 + +@_typing.final +class Method(_message.Message): """Method represents a method of an API interface. New usages of this message as an alternative to MethodDescriptorProto are @@ -166,80 +180,104 @@ class Method(google.protobuf.message.Message): make use of FileDescriptorSet which preserves the necessary information. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - NAME_FIELD_NUMBER: builtins.int - REQUEST_TYPE_URL_FIELD_NUMBER: builtins.int - REQUEST_STREAMING_FIELD_NUMBER: builtins.int - RESPONSE_TYPE_URL_FIELD_NUMBER: builtins.int - RESPONSE_STREAMING_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - SYNTAX_FIELD_NUMBER: builtins.int - EDITION_FIELD_NUMBER: builtins.int - name: builtins.str + DESCRIPTOR: _descriptor.Descriptor + + NAME_FIELD_NUMBER: _builtins.int + REQUEST_TYPE_URL_FIELD_NUMBER: _builtins.int + REQUEST_STREAMING_FIELD_NUMBER: _builtins.int + RESPONSE_TYPE_URL_FIELD_NUMBER: _builtins.int + RESPONSE_STREAMING_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + SYNTAX_FIELD_NUMBER: _builtins.int + EDITION_FIELD_NUMBER: _builtins.int + name: _builtins.str """The simple name of this method.""" - request_type_url: builtins.str + request_type_url: _builtins.str """A URL of the input message type.""" - request_streaming: builtins.bool + request_streaming: _builtins.bool """If true, the request is streamed.""" - response_type_url: builtins.str + response_type_url: _builtins.str """The URL of the output message type.""" - response_streaming: builtins.bool + response_streaming: _builtins.bool """If true, the response is streamed.""" - syntax: google.protobuf.type_pb2.Syntax.ValueType - """The source syntax of this method. - This field should be ignored, instead the syntax should be inherited from - Api. This is similar to Field and EnumValue. - """ - edition: builtins.str - """The source edition string, only valid when syntax is SYNTAX_EDITIONS. + @_builtins.property + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def syntax(self) -> _type_pb2.Syntax.ValueType: + """The source syntax of this method. - This field should be ignored, instead the edition should be inherited from - Api. This is similar to Field and EnumValue. - """ - @property - def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.type_pb2.Option]: + This field should be ignored, instead the syntax should be inherited from + Api. This is similar to Field and EnumValue. + """ + @syntax.setter + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def syntax(self, value: _type_pb2.Syntax.ValueType) -> None: + """The source syntax of this method. + + This field should be ignored, instead the syntax should be inherited from + Api. This is similar to Field and EnumValue. + """ + + @_builtins.property + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def edition(self) -> _builtins.str: + """The source edition string, only valid when syntax is SYNTAX_EDITIONS. + + This field should be ignored, instead the edition should be inherited from + Api. This is similar to Field and EnumValue. + """ + @edition.setter + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def edition(self, value: _builtins.str) -> None: + """The source edition string, only valid when syntax is SYNTAX_EDITIONS. + + This field should be ignored, instead the edition should be inherited from + Api. This is similar to Field and EnumValue. + """ + + @_builtins.property + def options(self) -> _containers.RepeatedCompositeFieldContainer[_type_pb2.Option]: """Any metadata attached to the method.""" def __init__( self, *, - 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 = ..., - edition: builtins.str | 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: _abc.Iterable[_type_pb2.Option] | None = ..., + syntax: _type_pb2.Syntax.ValueType | None = ..., + edition: _builtins.str | None = ..., ) -> None: ... - def ClearField( - self, - field_name: typing.Literal[ - "edition", - b"edition", - "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 - -@typing.final -class Mixin(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "edition", + b"edition", + "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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Method: _TypeAlias = Method # noqa: Y015 + +@_typing.final +class Mixin(_message.Message): """Declares an API Interface to be included in this interface. The including interface must redeclare all the methods from the included interface, but documentation and options are inherited as follows: @@ -320,17 +358,21 @@ class Mixin(google.protobuf.message.Message): } """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - ROOT_FIELD_NUMBER: builtins.int - name: builtins.str + NAME_FIELD_NUMBER: _builtins.int + ROOT_FIELD_NUMBER: _builtins.int + name: _builtins.str """The fully qualified name of the interface which is included.""" - root: builtins.str + root: _builtins.str """If non-empty specifies a path under which inherited HTTP paths are rooted. """ - def __init__(self, *, name: builtins.str | None = ..., root: builtins.str | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["name", b"name", "root", b"root"]) -> None: ... - -global___Mixin = Mixin + def __init__(self, *, name: _builtins.str | None = ..., root: _builtins.str | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "root", b"root"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Mixin: _TypeAlias = Mixin # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi index a6f744c26074..5ab66110515f 100644 --- a/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi +++ b/stubs/protobuf/google/protobuf/compiler/plugin_pb2.pyi @@ -15,82 +15,81 @@ 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 builtins as _builtins import sys -import typing +import typing as _typing +from collections import abc as _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 +from google.protobuf import descriptor as _descriptor, descriptor_pb2 as _descriptor_pb2, message as _message +from google.protobuf.internal import containers as _containers, enum_type_wrapper as _enum_type_wrapper -if sys.version_info >= (3, 10): - import typing as typing_extensions +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias else: - import typing_extensions + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +DESCRIPTOR: _descriptor.FileDescriptor -@typing.final -class Version(google.protobuf.message.Message): +@_typing.final +class Version(_message.Message): """The version number of protocol compiler.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - MAJOR_FIELD_NUMBER: builtins.int - MINOR_FIELD_NUMBER: builtins.int - PATCH_FIELD_NUMBER: builtins.int - SUFFIX_FIELD_NUMBER: builtins.int - major: builtins.int - minor: builtins.int - patch: builtins.int - suffix: builtins.str + MAJOR_FIELD_NUMBER: _builtins.int + MINOR_FIELD_NUMBER: _builtins.int + PATCH_FIELD_NUMBER: _builtins.int + SUFFIX_FIELD_NUMBER: _builtins.int + major: _builtins.int + minor: _builtins.int + patch: _builtins.int + 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, *, - major: builtins.int | None = ..., - minor: builtins.int | None = ..., - patch: builtins.int | None = ..., - suffix: builtins.str | None = ..., + major: _builtins.int | None = ..., + minor: _builtins.int | None = ..., + patch: _builtins.int | None = ..., + suffix: _builtins.str | None = ..., ) -> None: ... - def HasField( - self, field_name: typing.Literal["major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix"] - ) -> builtins.bool: ... - def ClearField( - self, field_name: typing.Literal["major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix"] - ) -> None: ... - -global___Version = Version - -@typing.final -class CodeGeneratorRequest(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "major", b"major", "minor", b"minor", "patch", b"patch", "suffix", b"suffix" + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Version: _TypeAlias = Version # noqa: Y015 + +@_typing.final +class CodeGeneratorRequest(_message.Message): """An encoded CodeGeneratorRequest is written to the plugin's stdin.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - FILE_TO_GENERATE_FIELD_NUMBER: builtins.int - PARAMETER_FIELD_NUMBER: builtins.int - PROTO_FILE_FIELD_NUMBER: builtins.int - SOURCE_FILE_DESCRIPTORS_FIELD_NUMBER: builtins.int - COMPILER_VERSION_FIELD_NUMBER: builtins.int - parameter: builtins.str + FILE_TO_GENERATE_FIELD_NUMBER: _builtins.int + PARAMETER_FIELD_NUMBER: _builtins.int + PROTO_FILE_FIELD_NUMBER: _builtins.int + SOURCE_FILE_DESCRIPTORS_FIELD_NUMBER: _builtins.int + COMPILER_VERSION_FIELD_NUMBER: _builtins.int + parameter: _builtins.str """The generator parameter passed on the command-line.""" - @property - def file_to_generate(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + @_builtins.property + def file_to_generate(self) -> _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. """ - @property - def proto_file( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.descriptor_pb2.FileDescriptorProto]: + @_builtins.property + def proto_file(self) -> _containers.RepeatedCompositeFieldContainer[_descriptor_pb2.FileDescriptorProto]: """FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. @@ -112,63 +111,59 @@ class CodeGeneratorRequest(google.protobuf.message.Message): fully qualified. """ - @property - def source_file_descriptors( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.descriptor_pb2.FileDescriptorProto]: + @_builtins.property + def source_file_descriptors(self) -> _containers.RepeatedCompositeFieldContainer[_descriptor_pb2.FileDescriptorProto]: """File descriptors with all options, including source-retention options. These descriptors are only provided for the files listed in files_to_generate. """ - @property - def compiler_version(self) -> global___Version: + @_builtins.property + def compiler_version(self) -> Global___Version: """The version number of protocol compiler.""" def __init__( self, *, - file_to_generate: collections.abc.Iterable[builtins.str] | None = ..., - parameter: builtins.str | None = ..., - proto_file: collections.abc.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto] | None = ..., - source_file_descriptors: collections.abc.Iterable[google.protobuf.descriptor_pb2.FileDescriptorProto] | None = ..., - compiler_version: global___Version | None = ..., + file_to_generate: _abc.Iterable[_builtins.str] | None = ..., + parameter: _builtins.str | None = ..., + proto_file: _abc.Iterable[_descriptor_pb2.FileDescriptorProto] | None = ..., + source_file_descriptors: _abc.Iterable[_descriptor_pb2.FileDescriptorProto] | None = ..., + compiler_version: Global___Version | None = ..., ) -> None: ... - def HasField( - self, field_name: typing.Literal["compiler_version", b"compiler_version", "parameter", b"parameter"] - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "compiler_version", - b"compiler_version", - "file_to_generate", - b"file_to_generate", - "parameter", - b"parameter", - "proto_file", - b"proto_file", - "source_file_descriptors", - b"source_file_descriptors", - ], - ) -> None: ... - -global___CodeGeneratorRequest = CodeGeneratorRequest - -@typing.final -class CodeGeneratorResponse(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "compiler_version", b"compiler_version", "parameter", b"parameter" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "compiler_version", + b"compiler_version", + "file_to_generate", + b"file_to_generate", + "parameter", + b"parameter", + "proto_file", + b"proto_file", + "source_file_descriptors", + b"source_file_descriptors", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___CodeGeneratorRequest: _TypeAlias = CodeGeneratorRequest # noqa: Y015 + +@_typing.final +class CodeGeneratorResponse(_message.Message): """The plugin writes an encoded CodeGeneratorResponse to stdout.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor class _Feature: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _FeatureEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _FeatureEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[CodeGeneratorResponse._Feature.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor FEATURE_NONE: CodeGeneratorResponse._Feature.ValueType # 0 FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse._Feature.ValueType # 1 FEATURE_SUPPORTS_EDITIONS: CodeGeneratorResponse._Feature.ValueType # 2 @@ -180,17 +175,17 @@ class CodeGeneratorResponse(google.protobuf.message.Message): FEATURE_PROTO3_OPTIONAL: CodeGeneratorResponse.Feature.ValueType # 1 FEATURE_SUPPORTS_EDITIONS: CodeGeneratorResponse.Feature.ValueType # 2 - @typing.final - class File(google.protobuf.message.Message): + @_typing.final + class File(_message.Message): """Represents a single generated file.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _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: builtins.str + NAME_FIELD_NUMBER: _builtins.int + INSERTION_POINT_FIELD_NUMBER: _builtins.int + CONTENT_FIELD_NUMBER: _builtins.int + GENERATED_CODE_INFO_FIELD_NUMBER: _builtins.int + 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 @@ -203,7 +198,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: builtins.str + 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 @@ -242,10 +237,10 @@ class CodeGeneratorResponse(google.protobuf.message.Message): If |insertion_point| is present, |name| must also be present. """ - content: builtins.str + content: _builtins.str """The file contents.""" - @property - def generated_code_info(self) -> google.protobuf.descriptor_pb2.GeneratedCodeInfo: + @_builtins.property + def generated_code_info(self) -> _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. @@ -254,44 +249,41 @@ class CodeGeneratorResponse(google.protobuf.message.Message): def __init__( self, *, - name: builtins.str | None = ..., - insertion_point: builtins.str | None = ..., - content: builtins.str | None = ..., - generated_code_info: google.protobuf.descriptor_pb2.GeneratedCodeInfo | None = ..., + name: _builtins.str | None = ..., + insertion_point: _builtins.str | None = ..., + content: _builtins.str | None = ..., + generated_code_info: _descriptor_pb2.GeneratedCodeInfo | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.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.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 - MINIMUM_EDITION_FIELD_NUMBER: builtins.int - MAXIMUM_EDITION_FIELD_NUMBER: builtins.int - FILE_FIELD_NUMBER: builtins.int - error: builtins.str + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "content", + b"content", + "generated_code_info", + b"generated_code_info", + "insertion_point", + b"insertion_point", + "name", + b"name", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "content", + b"content", + "generated_code_info", + b"generated_code_info", + "insertion_point", + b"insertion_point", + "name", + b"name", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + ERROR_FIELD_NUMBER: _builtins.int + SUPPORTED_FEATURES_FIELD_NUMBER: _builtins.int + MINIMUM_EDITION_FIELD_NUMBER: _builtins.int + MAXIMUM_EDITION_FIELD_NUMBER: _builtins.int + FILE_FIELD_NUMBER: _builtins.int + 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. @@ -301,62 +293,57 @@ 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 + 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. """ - minimum_edition: builtins.int + minimum_edition: _builtins.int """The minimum edition this plugin supports. This will be treated as an Edition enum, but we want to allow unknown values. It should be specified according the edition enum value, *not* the edition number. Only takes effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. """ - maximum_edition: builtins.int + maximum_edition: _builtins.int """The maximum edition this plugin supports. This will be treated as an Edition enum, but we want to allow unknown values. It should be specified according the edition enum value, *not* the edition number. Only takes effect for plugins that have FEATURE_SUPPORTS_EDITIONS set. """ - @property - def file( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CodeGeneratorResponse.File]: ... + @_builtins.property + def file(self) -> _containers.RepeatedCompositeFieldContainer[Global___CodeGeneratorResponse.File]: ... def __init__( self, *, - error: builtins.str | None = ..., - supported_features: builtins.int | None = ..., - minimum_edition: builtins.int | None = ..., - maximum_edition: builtins.int | None = ..., - file: collections.abc.Iterable[global___CodeGeneratorResponse.File] | None = ..., + error: _builtins.str | None = ..., + supported_features: _builtins.int | None = ..., + minimum_edition: _builtins.int | None = ..., + maximum_edition: _builtins.int | None = ..., + file: _abc.Iterable[Global___CodeGeneratorResponse.File] | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "error", - b"error", - "maximum_edition", - b"maximum_edition", - "minimum_edition", - b"minimum_edition", - "supported_features", - b"supported_features", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "error", - b"error", - "file", - b"file", - "maximum_edition", - b"maximum_edition", - "minimum_edition", - b"minimum_edition", - "supported_features", - b"supported_features", - ], - ) -> None: ... - -global___CodeGeneratorResponse = CodeGeneratorResponse + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "error", + b"error", + "maximum_edition", + b"maximum_edition", + "minimum_edition", + b"minimum_edition", + "supported_features", + b"supported_features", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "error", + b"error", + "file", + b"file", + "maximum_edition", + b"maximum_edition", + "minimum_edition", + b"minimum_edition", + "supported_features", + b"supported_features", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___CodeGeneratorResponse: _TypeAlias = CodeGeneratorResponse # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi index 808972d04292..aa71d6e45c8b 100644 --- a/stubs/protobuf/google/protobuf/descriptor_pb2.pyi +++ b/stubs/protobuf/google/protobuf/descriptor_pb2.pyi @@ -10,29 +10,33 @@ 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 builtins as _builtins import sys -import typing +import typing as _typing +from collections import abc as _abc -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message +from google.protobuf.internal import containers as _containers, enum_type_wrapper as _enum_type_wrapper -if sys.version_info >= (3, 10): - import typing as typing_extensions +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias else: - import typing_extensions + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 13): + from warnings import deprecated as _deprecated +else: + from typing_extensions import deprecated as _deprecated + +DESCRIPTOR: _descriptor.FileDescriptor class _Edition: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 -class _EditionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Edition.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor +class _EditionEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[_Edition.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor EDITION_UNKNOWN: _Edition.ValueType # 0 """A placeholder for an unknown edition value.""" EDITION_LEGACY: _Edition.ValueType # 900 @@ -107,16 +111,14 @@ EDITION_MAX: Edition.ValueType # 2147483647 ever be used by plugins that can expect to never require any changes to support a new edition. """ -global___Edition = Edition +Global___Edition: _TypeAlias = Edition # noqa: Y015 class _SymbolVisibility: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 -class _SymbolVisibilityEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SymbolVisibility.ValueType], builtins.type -): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor +class _SymbolVisibilityEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[_SymbolVisibility.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor VISIBILITY_UNSET: _SymbolVisibility.ValueType # 0 VISIBILITY_LOCAL: _SymbolVisibility.ValueType # 1 VISIBILITY_EXPORT: _SymbolVisibility.ValueType # 2 @@ -132,49 +134,53 @@ class SymbolVisibility(_SymbolVisibility, metaclass=_SymbolVisibilityEnumTypeWra VISIBILITY_UNSET: SymbolVisibility.ValueType # 0 VISIBILITY_LOCAL: SymbolVisibility.ValueType # 1 VISIBILITY_EXPORT: SymbolVisibility.ValueType # 2 -global___SymbolVisibility = SymbolVisibility +Global___SymbolVisibility: _TypeAlias = SymbolVisibility # noqa: Y015 -@typing.final -class FileDescriptorSet(google.protobuf.message.Message): +@_typing.final +class FileDescriptorSet(_message.Message): """The protocol compiler can output a FileDescriptorSet containing the .proto files it parses. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - FILE_FIELD_NUMBER: builtins.int - @property - def file(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FileDescriptorProto]: ... - def __init__(self, *, file: collections.abc.Iterable[global___FileDescriptorProto] | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["file", b"file"]) -> None: ... + FILE_FIELD_NUMBER: _builtins.int + @_builtins.property + def file(self) -> _containers.RepeatedCompositeFieldContainer[Global___FileDescriptorProto]: ... + def __init__(self, *, file: _abc.Iterable[Global___FileDescriptorProto] | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["file", b"file"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___FileDescriptorSet = FileDescriptorSet +Global___FileDescriptorSet: _TypeAlias = FileDescriptorSet # noqa: Y015 -@typing.final -class FileDescriptorProto(google.protobuf.message.Message): +@_typing.final +class FileDescriptorProto(_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 - PUBLIC_DEPENDENCY_FIELD_NUMBER: builtins.int - WEAK_DEPENDENCY_FIELD_NUMBER: builtins.int - OPTION_DEPENDENCY_FIELD_NUMBER: builtins.int - MESSAGE_TYPE_FIELD_NUMBER: builtins.int - ENUM_TYPE_FIELD_NUMBER: builtins.int - SERVICE_FIELD_NUMBER: builtins.int - EXTENSION_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - SOURCE_CODE_INFO_FIELD_NUMBER: builtins.int - SYNTAX_FIELD_NUMBER: builtins.int - EDITION_FIELD_NUMBER: builtins.int - name: builtins.str + DESCRIPTOR: _descriptor.Descriptor + + NAME_FIELD_NUMBER: _builtins.int + PACKAGE_FIELD_NUMBER: _builtins.int + DEPENDENCY_FIELD_NUMBER: _builtins.int + PUBLIC_DEPENDENCY_FIELD_NUMBER: _builtins.int + WEAK_DEPENDENCY_FIELD_NUMBER: _builtins.int + OPTION_DEPENDENCY_FIELD_NUMBER: _builtins.int + MESSAGE_TYPE_FIELD_NUMBER: _builtins.int + ENUM_TYPE_FIELD_NUMBER: _builtins.int + SERVICE_FIELD_NUMBER: _builtins.int + EXTENSION_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + SOURCE_CODE_INFO_FIELD_NUMBER: _builtins.int + SYNTAX_FIELD_NUMBER: _builtins.int + EDITION_FIELD_NUMBER: _builtins.int + name: _builtins.str """file name, relative to root of source tree""" - package: builtins.str + package: _builtins.str """e.g. "foo", "foo.bar", etc.""" - syntax: builtins.str + syntax: _builtins.str """The syntax of the proto file. The supported values are "proto2", "proto3", and "editions". @@ -183,46 +189,46 @@ class FileDescriptorProto(google.protobuf.message.Message): cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - edition: global___Edition.ValueType + edition: Global___Edition.ValueType """The edition of the proto file. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + @_builtins.property + def dependency(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: """Names of files imported by this file.""" - @property - def public_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + @_builtins.property + def public_dependency(self) -> _containers.RepeatedScalarFieldContainer[_builtins.int]: """Indexes of the public imported files in the dependency list above.""" - @property - def weak_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + @_builtins.property + def weak_dependency(self) -> _containers.RepeatedScalarFieldContainer[_builtins.int]: """Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use. """ - @property - def option_dependency(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + @_builtins.property + def option_dependency(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: """Names of files imported by this file purely for the purpose of providing option extensions. These are excluded from the dependency list above. """ - @property - def message_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto]: + @_builtins.property + def message_type(self) -> _containers.RepeatedCompositeFieldContainer[Global___DescriptorProto]: """All top-level definitions in this file.""" - @property - def enum_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumDescriptorProto]: ... - @property - def service(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ServiceDescriptorProto]: ... - @property - def extension(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FieldDescriptorProto]: ... - @property - def options(self) -> global___FileOptions: ... - @property - def source_code_info(self) -> global___SourceCodeInfo: + @_builtins.property + def enum_type(self) -> _containers.RepeatedCompositeFieldContainer[Global___EnumDescriptorProto]: ... + @_builtins.property + def service(self) -> _containers.RepeatedCompositeFieldContainer[Global___ServiceDescriptorProto]: ... + @_builtins.property + def extension(self) -> _containers.RepeatedCompositeFieldContainer[Global___FieldDescriptorProto]: ... + @_builtins.property + def options(self) -> Global___FileOptions: ... + @_builtins.property + def source_code_info(self) -> Global___SourceCodeInfo: """This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by @@ -232,162 +238,157 @@ class FileDescriptorProto(google.protobuf.message.Message): def __init__( self, *, - 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 = ..., - option_dependency: collections.abc.Iterable[builtins.str] | 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 = ..., - edition: global___Edition.ValueType | None = ..., - ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "edition", - b"edition", - "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.Literal[ - "dependency", - b"dependency", - "edition", - b"edition", - "enum_type", - b"enum_type", - "extension", - b"extension", - "message_type", - b"message_type", - "name", - b"name", - "option_dependency", - b"option_dependency", - "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", - ], + name: _builtins.str | None = ..., + package: _builtins.str | None = ..., + dependency: _abc.Iterable[_builtins.str] | None = ..., + public_dependency: _abc.Iterable[_builtins.int] | None = ..., + weak_dependency: _abc.Iterable[_builtins.int] | None = ..., + option_dependency: _abc.Iterable[_builtins.str] | None = ..., + message_type: _abc.Iterable[Global___DescriptorProto] | None = ..., + enum_type: _abc.Iterable[Global___EnumDescriptorProto] | None = ..., + service: _abc.Iterable[Global___ServiceDescriptorProto] | None = ..., + extension: _abc.Iterable[Global___FieldDescriptorProto] | None = ..., + options: Global___FileOptions | None = ..., + source_code_info: Global___SourceCodeInfo | None = ..., + syntax: _builtins.str | None = ..., + edition: Global___Edition.ValueType | None = ..., ) -> None: ... - -global___FileDescriptorProto = FileDescriptorProto - -@typing.final -class DescriptorProto(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "edition", + b"edition", + "name", + b"name", + "options", + b"options", + "package", + b"package", + "source_code_info", + b"source_code_info", + "syntax", + b"syntax", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "dependency", + b"dependency", + "edition", + b"edition", + "enum_type", + b"enum_type", + "extension", + b"extension", + "message_type", + b"message_type", + "name", + b"name", + "option_dependency", + b"option_dependency", + "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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___FileDescriptorProto: _TypeAlias = FileDescriptorProto # noqa: Y015 + +@_typing.final +class DescriptorProto(_message.Message): """Describes a message type.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - @typing.final - class ExtensionRange(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + @_typing.final + class ExtensionRange(_message.Message): + DESCRIPTOR: _descriptor.Descriptor - START_FIELD_NUMBER: builtins.int - END_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - start: builtins.int + START_FIELD_NUMBER: _builtins.int + END_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + start: _builtins.int """Inclusive.""" - end: builtins.int + end: _builtins.int """Exclusive.""" - @property - def options(self) -> global___ExtensionRangeOptions: ... + @_builtins.property + def options(self) -> Global___ExtensionRangeOptions: ... def __init__( self, *, - start: builtins.int | None = ..., - end: builtins.int | None = ..., - options: global___ExtensionRangeOptions | None = ..., + start: _builtins.int | None = ..., + end: _builtins.int | None = ..., + options: Global___ExtensionRangeOptions | None = ..., ) -> None: ... - def HasField( - self, field_name: typing.Literal["end", b"end", "options", b"options", "start", b"start"] - ) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["end", b"end", "options", b"options", "start", b"start"]) -> None: ... - - @typing.final - class ReservedRange(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal["end", b"end", "options", b"options", "start", b"start"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["end", b"end", "options", b"options", "start", b"start"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + @_typing.final + class ReservedRange(_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 + DESCRIPTOR: _descriptor.Descriptor - START_FIELD_NUMBER: builtins.int - END_FIELD_NUMBER: builtins.int - start: builtins.int + START_FIELD_NUMBER: _builtins.int + END_FIELD_NUMBER: _builtins.int + start: _builtins.int """Inclusive.""" - end: builtins.int + end: _builtins.int """Exclusive.""" - def __init__(self, *, start: builtins.int | None = ..., end: builtins.int | None = ...) -> None: ... - def HasField(self, field_name: typing.Literal["end", b"end", "start", b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["end", b"end", "start", b"start"]) -> None: ... - - NAME_FIELD_NUMBER: builtins.int - FIELD_FIELD_NUMBER: builtins.int - EXTENSION_FIELD_NUMBER: builtins.int - NESTED_TYPE_FIELD_NUMBER: builtins.int - ENUM_TYPE_FIELD_NUMBER: builtins.int - EXTENSION_RANGE_FIELD_NUMBER: builtins.int - ONEOF_DECL_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - RESERVED_RANGE_FIELD_NUMBER: builtins.int - RESERVED_NAME_FIELD_NUMBER: builtins.int - VISIBILITY_FIELD_NUMBER: builtins.int - name: builtins.str - visibility: global___SymbolVisibility.ValueType + def __init__(self, *, start: _builtins.int | None = ..., end: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["end", b"end", "start", b"start"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["end", b"end", "start", b"start"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + NAME_FIELD_NUMBER: _builtins.int + FIELD_FIELD_NUMBER: _builtins.int + EXTENSION_FIELD_NUMBER: _builtins.int + NESTED_TYPE_FIELD_NUMBER: _builtins.int + ENUM_TYPE_FIELD_NUMBER: _builtins.int + EXTENSION_RANGE_FIELD_NUMBER: _builtins.int + ONEOF_DECL_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + RESERVED_RANGE_FIELD_NUMBER: _builtins.int + RESERVED_NAME_FIELD_NUMBER: _builtins.int + VISIBILITY_FIELD_NUMBER: _builtins.int + name: _builtins.str + visibility: Global___SymbolVisibility.ValueType """Support for `export` and `local` keywords on enums.""" - @property - def field(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FieldDescriptorProto]: ... - @property - def extension(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FieldDescriptorProto]: ... - @property - def nested_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto]: ... - @property - def enum_type(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumDescriptorProto]: ... - @property - def extension_range( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto.ExtensionRange]: ... - @property - def oneof_decl( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___OneofDescriptorProto]: ... - @property - def options(self) -> global___MessageOptions: ... - @property - def reserved_range( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DescriptorProto.ReservedRange]: ... - @property - def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + @_builtins.property + def field(self) -> _containers.RepeatedCompositeFieldContainer[Global___FieldDescriptorProto]: ... + @_builtins.property + def extension(self) -> _containers.RepeatedCompositeFieldContainer[Global___FieldDescriptorProto]: ... + @_builtins.property + def nested_type(self) -> _containers.RepeatedCompositeFieldContainer[Global___DescriptorProto]: ... + @_builtins.property + def enum_type(self) -> _containers.RepeatedCompositeFieldContainer[Global___EnumDescriptorProto]: ... + @_builtins.property + def extension_range(self) -> _containers.RepeatedCompositeFieldContainer[Global___DescriptorProto.ExtensionRange]: ... + @_builtins.property + def oneof_decl(self) -> _containers.RepeatedCompositeFieldContainer[Global___OneofDescriptorProto]: ... + @_builtins.property + def options(self) -> Global___MessageOptions: ... + @_builtins.property + def reserved_range(self) -> _containers.RepeatedCompositeFieldContainer[Global___DescriptorProto.ReservedRange]: ... + @_builtins.property + def reserved_name(self) -> _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. """ @@ -395,64 +396,63 @@ class DescriptorProto(google.protobuf.message.Message): def __init__( self, *, - 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 = ..., - visibility: global___SymbolVisibility.ValueType | None = ..., - ) -> None: ... - def HasField( - self, field_name: typing.Literal["name", b"name", "options", b"options", "visibility", b"visibility"] - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.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", - "visibility", - b"visibility", - ], + name: _builtins.str | None = ..., + field: _abc.Iterable[Global___FieldDescriptorProto] | None = ..., + extension: _abc.Iterable[Global___FieldDescriptorProto] | None = ..., + nested_type: _abc.Iterable[Global___DescriptorProto] | None = ..., + enum_type: _abc.Iterable[Global___EnumDescriptorProto] | None = ..., + extension_range: _abc.Iterable[Global___DescriptorProto.ExtensionRange] | None = ..., + oneof_decl: _abc.Iterable[Global___OneofDescriptorProto] | None = ..., + options: Global___MessageOptions | None = ..., + reserved_range: _abc.Iterable[Global___DescriptorProto.ReservedRange] | None = ..., + reserved_name: _abc.Iterable[_builtins.str] | None = ..., + visibility: Global___SymbolVisibility.ValueType | None = ..., ) -> None: ... - -global___DescriptorProto = DescriptorProto - -@typing.final -class ExtensionRangeOptions(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "name", b"name", "options", b"options", "visibility", b"visibility" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.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", + "visibility", + b"visibility", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___DescriptorProto: _TypeAlias = DescriptorProto # noqa: Y015 + +@_typing.final +class ExtensionRangeOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor class _VerificationState: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _VerificationStateEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ExtensionRangeOptions._VerificationState.ValueType], - builtins.type, + _enum_type_wrapper._EnumTypeWrapper[ExtensionRangeOptions._VerificationState.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor DECLARATION: ExtensionRangeOptions._VerificationState.ValueType # 0 """All the extensions of the range must be declared.""" UNVERIFIED: ExtensionRangeOptions._VerificationState.ValueType # 1 @@ -464,124 +464,115 @@ class ExtensionRangeOptions(google.protobuf.message.Message): """All the extensions of the range must be declared.""" UNVERIFIED: ExtensionRangeOptions.VerificationState.ValueType # 1 - @typing.final - class Declaration(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + @_typing.final + class Declaration(_message.Message): + DESCRIPTOR: _descriptor.Descriptor - NUMBER_FIELD_NUMBER: builtins.int - FULL_NAME_FIELD_NUMBER: builtins.int - TYPE_FIELD_NUMBER: builtins.int - RESERVED_FIELD_NUMBER: builtins.int - REPEATED_FIELD_NUMBER: builtins.int - number: builtins.int + NUMBER_FIELD_NUMBER: _builtins.int + FULL_NAME_FIELD_NUMBER: _builtins.int + TYPE_FIELD_NUMBER: _builtins.int + RESERVED_FIELD_NUMBER: _builtins.int + REPEATED_FIELD_NUMBER: _builtins.int + number: _builtins.int """The extension number declared within the extension range.""" - full_name: builtins.str + full_name: _builtins.str """The fully-qualified name of the extension field. There must be a leading dot in front of the full name. """ - type: builtins.str + type: _builtins.str """The fully-qualified type name of the extension field. Unlike Metadata.type, Declaration.type must have a leading dot for messages and enums. """ - reserved: builtins.bool + reserved: _builtins.bool """If true, indicates that the number is reserved in the extension range, and any extension field with the number will fail to compile. Set this when a declared extension field is deleted. """ - repeated: builtins.bool + repeated: _builtins.bool """If true, indicates that the extension must be defined as repeated. Otherwise the extension must be defined as optional. """ def __init__( self, *, - number: builtins.int | None = ..., - full_name: builtins.str | None = ..., - type: builtins.str | None = ..., - reserved: builtins.bool | None = ..., - repeated: builtins.bool | None = ..., + number: _builtins.int | None = ..., + full_name: _builtins.str | None = ..., + type: _builtins.str | None = ..., + reserved: _builtins.bool | None = ..., + repeated: _builtins.bool | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "full_name", b"full_name", "number", b"number", "repeated", b"repeated", "reserved", b"reserved", "type", b"type" - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "full_name", b"full_name", "number", b"number", "repeated", b"repeated", "reserved", b"reserved", "type", b"type" - ], - ) -> None: ... - - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - DECLARATION_FIELD_NUMBER: builtins.int - FEATURES_FIELD_NUMBER: builtins.int - VERIFICATION_FIELD_NUMBER: builtins.int - verification: global___ExtensionRangeOptions.VerificationState.ValueType + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "full_name", b"full_name", "number", b"number", "repeated", b"repeated", "reserved", b"reserved", "type", b"type" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "full_name", b"full_name", "number", b"number", "repeated", b"repeated", "reserved", b"reserved", "type", b"type" + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + DECLARATION_FIELD_NUMBER: _builtins.int + FEATURES_FIELD_NUMBER: _builtins.int + VERIFICATION_FIELD_NUMBER: _builtins.int + verification: Global___ExtensionRangeOptions.VerificationState.ValueType """The verification state of the range. TODO: flip the default to DECLARATION once all empty ranges are marked as UNVERIFIED. """ - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" - @property - def declaration( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ExtensionRangeOptions.Declaration]: + @_builtins.property + def declaration(self) -> _containers.RepeatedCompositeFieldContainer[Global___ExtensionRangeOptions.Declaration]: """For external users: DO NOT USE. We are in the process of open sourcing extension declaration and executing internal cleanups before it can be used externally. """ - @property - def features(self) -> global___FeatureSet: + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition.""" def __init__( self, *, - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., - declaration: collections.abc.Iterable[global___ExtensionRangeOptions.Declaration] | None = ..., - features: global___FeatureSet | None = ..., - verification: global___ExtensionRangeOptions.VerificationState.ValueType | None = ..., - ) -> None: ... - def HasField(self, field_name: typing.Literal["features", b"features", "verification", b"verification"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "declaration", - b"declaration", - "features", - b"features", - "uninterpreted_option", - b"uninterpreted_option", - "verification", - b"verification", - ], + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., + declaration: _abc.Iterable[Global___ExtensionRangeOptions.Declaration] | None = ..., + features: Global___FeatureSet | None = ..., + verification: Global___ExtensionRangeOptions.VerificationState.ValueType | None = ..., ) -> None: ... - -global___ExtensionRangeOptions = ExtensionRangeOptions - -@typing.final -class FieldDescriptorProto(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal["features", b"features", "verification", b"verification"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "declaration", + b"declaration", + "features", + b"features", + "uninterpreted_option", + b"uninterpreted_option", + "verification", + b"verification", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___ExtensionRangeOptions: _TypeAlias = ExtensionRangeOptions # noqa: Y015 + +@_typing.final +class FieldDescriptorProto(_message.Message): """Describes a field within a message.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor class _Type: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _TypeEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Type.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _TypeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Type.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor TYPE_DOUBLE: FieldDescriptorProto._Type.ValueType # 1 """0 is reserved for errors. Order is weird for historical reasons. @@ -660,13 +651,11 @@ class FieldDescriptorProto(google.protobuf.message.Message): """Uses ZigZag encoding.""" class _Label: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _LabelEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Label.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _LabelEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FieldDescriptorProto._Label.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor LABEL_OPTIONAL: FieldDescriptorProto._Label.ValueType # 1 """0 is reserved for errors""" LABEL_REPEATED: FieldDescriptorProto._Label.ValueType # 3 @@ -686,52 +675,52 @@ class FieldDescriptorProto(google.protobuf.message.Message): can be used to get this behavior. """ - NAME_FIELD_NUMBER: builtins.int - NUMBER_FIELD_NUMBER: builtins.int - LABEL_FIELD_NUMBER: builtins.int - TYPE_FIELD_NUMBER: builtins.int - TYPE_NAME_FIELD_NUMBER: builtins.int - EXTENDEE_FIELD_NUMBER: builtins.int - DEFAULT_VALUE_FIELD_NUMBER: builtins.int - ONEOF_INDEX_FIELD_NUMBER: builtins.int - JSON_NAME_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - PROTO3_OPTIONAL_FIELD_NUMBER: builtins.int - name: builtins.str - number: builtins.int - label: global___FieldDescriptorProto.Label.ValueType - type: global___FieldDescriptorProto.Type.ValueType + NAME_FIELD_NUMBER: _builtins.int + NUMBER_FIELD_NUMBER: _builtins.int + LABEL_FIELD_NUMBER: _builtins.int + TYPE_FIELD_NUMBER: _builtins.int + TYPE_NAME_FIELD_NUMBER: _builtins.int + EXTENDEE_FIELD_NUMBER: _builtins.int + DEFAULT_VALUE_FIELD_NUMBER: _builtins.int + ONEOF_INDEX_FIELD_NUMBER: _builtins.int + JSON_NAME_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + PROTO3_OPTIONAL_FIELD_NUMBER: _builtins.int + 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: builtins.str + 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: builtins.str + 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: builtins.str + 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 + 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: builtins.str + 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. """ - proto3_optional: builtins.bool + proto3_optional: _builtins.bool """If true, this is a proto3 "optional". When a proto3 field is optional, it tracks presence regardless of field type. @@ -754,105 +743,105 @@ class FieldDescriptorProto(google.protobuf.message.Message): Proto2 optional fields do not set this flag, because they already indicate optional with `LABEL_OPTIONAL`. """ - @property - def options(self) -> global___FieldOptions: ... + @_builtins.property + def options(self) -> Global___FieldOptions: ... def __init__( self, *, - 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.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.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", - ], + 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: ... - -global___FieldDescriptorProto = FieldDescriptorProto - -@typing.final -class OneofDescriptorProto(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___FieldDescriptorProto: _TypeAlias = FieldDescriptorProto # noqa: Y015 + +@_typing.final +class OneofDescriptorProto(_message.Message): """Describes a oneof.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - name: builtins.str - @property - def options(self) -> global___OneofOptions: ... - def __init__(self, *, name: builtins.str | None = ..., options: global___OneofOptions | None = ...) -> None: ... - def HasField(self, field_name: typing.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["name", b"name", "options", b"options"]) -> None: ... + NAME_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + name: _builtins.str + @_builtins.property + def options(self) -> Global___OneofOptions: ... + def __init__(self, *, name: _builtins.str | None = ..., options: Global___OneofOptions | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "options", b"options"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "options", b"options"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___OneofDescriptorProto = OneofDescriptorProto +Global___OneofDescriptorProto: _TypeAlias = OneofDescriptorProto # noqa: Y015 -@typing.final -class EnumDescriptorProto(google.protobuf.message.Message): +@_typing.final +class EnumDescriptorProto(_message.Message): """Describes an enum type.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - @typing.final - class EnumReservedRange(google.protobuf.message.Message): + @_typing.final + class EnumReservedRange(_message.Message): """Range of reserved numeric values. Reserved values may not be used by entries in the same enum. Reserved ranges may not overlap. @@ -861,42 +850,43 @@ class EnumDescriptorProto(google.protobuf.message.Message): domain. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - START_FIELD_NUMBER: builtins.int - END_FIELD_NUMBER: builtins.int - start: builtins.int + START_FIELD_NUMBER: _builtins.int + END_FIELD_NUMBER: _builtins.int + start: _builtins.int """Inclusive.""" - end: builtins.int + end: _builtins.int """Inclusive.""" - def __init__(self, *, start: builtins.int | None = ..., end: builtins.int | None = ...) -> None: ... - def HasField(self, field_name: typing.Literal["end", b"end", "start", b"start"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.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 - VISIBILITY_FIELD_NUMBER: builtins.int - name: builtins.str - visibility: global___SymbolVisibility.ValueType + def __init__(self, *, start: _builtins.int | None = ..., end: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["end", b"end", "start", b"start"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["end", b"end", "start", b"start"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> 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 + VISIBILITY_FIELD_NUMBER: _builtins.int + name: _builtins.str + visibility: Global___SymbolVisibility.ValueType """Support for `export` and `local` keywords on enums.""" - @property - def value(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumValueDescriptorProto]: ... - @property - def options(self) -> global___EnumOptions: ... - @property - def reserved_range( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumDescriptorProto.EnumReservedRange]: + @_builtins.property + def value(self) -> _containers.RepeatedCompositeFieldContainer[Global___EnumValueDescriptorProto]: ... + @_builtins.property + def options(self) -> Global___EnumOptions: ... + @_builtins.property + def reserved_range(self) -> _containers.RepeatedCompositeFieldContainer[Global___EnumDescriptorProto.EnumReservedRange]: """Range of reserved numeric values. Reserved numeric values may not be used by enum values in the same enum declaration. Reserved ranges may not overlap. """ - @property - def reserved_name(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + @_builtins.property + def reserved_name(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: """Reserved enum value names, which may not be reused. A given name may only be reserved once. """ @@ -904,162 +894,163 @@ class EnumDescriptorProto(google.protobuf.message.Message): def __init__( self, *, - 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 = ..., - visibility: global___SymbolVisibility.ValueType | None = ..., - ) -> None: ... - def HasField( - self, field_name: typing.Literal["name", b"name", "options", b"options", "visibility", b"visibility"] - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "name", - b"name", - "options", - b"options", - "reserved_name", - b"reserved_name", - "reserved_range", - b"reserved_range", - "value", - b"value", - "visibility", - b"visibility", - ], + name: _builtins.str | None = ..., + value: _abc.Iterable[Global___EnumValueDescriptorProto] | None = ..., + options: Global___EnumOptions | None = ..., + reserved_range: _abc.Iterable[Global___EnumDescriptorProto.EnumReservedRange] | None = ..., + reserved_name: _abc.Iterable[_builtins.str] | None = ..., + visibility: Global___SymbolVisibility.ValueType | None = ..., ) -> None: ... - -global___EnumDescriptorProto = EnumDescriptorProto - -@typing.final -class EnumValueDescriptorProto(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "name", b"name", "options", b"options", "visibility", b"visibility" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "name", + b"name", + "options", + b"options", + "reserved_name", + b"reserved_name", + "reserved_range", + b"reserved_range", + "value", + b"value", + "visibility", + b"visibility", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___EnumDescriptorProto: _TypeAlias = EnumDescriptorProto # noqa: Y015 + +@_typing.final +class EnumValueDescriptorProto(_message.Message): """Describes a value within an enum.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - NUMBER_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - name: builtins.str - number: builtins.int - @property - def options(self) -> global___EnumValueOptions: ... + NAME_FIELD_NUMBER: _builtins.int + NUMBER_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + name: _builtins.str + number: _builtins.int + @_builtins.property + def options(self) -> Global___EnumValueOptions: ... def __init__( self, *, - name: builtins.str | None = ..., - number: builtins.int | None = ..., - options: global___EnumValueOptions | None = ..., + name: _builtins.str | None = ..., + number: _builtins.int | None = ..., + options: Global___EnumValueOptions | None = ..., ) -> None: ... - def HasField( - self, field_name: typing.Literal["name", b"name", "number", b"number", "options", b"options"] - ) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["name", b"name", "number", b"number", "options", b"options"]) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "number", b"number", "options", b"options"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "number", b"number", "options", b"options"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___EnumValueDescriptorProto = EnumValueDescriptorProto +Global___EnumValueDescriptorProto: _TypeAlias = EnumValueDescriptorProto # noqa: Y015 -@typing.final -class ServiceDescriptorProto(google.protobuf.message.Message): +@_typing.final +class ServiceDescriptorProto(_message.Message): """Describes a service.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - METHOD_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - name: builtins.str - @property - def method(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___MethodDescriptorProto]: ... - @property - def options(self) -> global___ServiceOptions: ... + NAME_FIELD_NUMBER: _builtins.int + METHOD_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + name: _builtins.str + @_builtins.property + def method(self) -> _containers.RepeatedCompositeFieldContainer[Global___MethodDescriptorProto]: ... + @_builtins.property + def options(self) -> Global___ServiceOptions: ... def __init__( self, *, - name: builtins.str | None = ..., - method: collections.abc.Iterable[global___MethodDescriptorProto] | None = ..., - options: global___ServiceOptions | None = ..., + name: _builtins.str | None = ..., + method: _abc.Iterable[Global___MethodDescriptorProto] | None = ..., + options: Global___ServiceOptions | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["name", b"name", "options", b"options"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["method", b"method", "name", b"name", "options", b"options"]) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "options", b"options"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["method", b"method", "name", b"name", "options", b"options"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___ServiceDescriptorProto = ServiceDescriptorProto +Global___ServiceDescriptorProto: _TypeAlias = ServiceDescriptorProto # noqa: Y015 -@typing.final -class MethodDescriptorProto(google.protobuf.message.Message): +@_typing.final +class MethodDescriptorProto(_message.Message): """Describes a method of a service.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _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: builtins.str - input_type: builtins.str + 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: _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: builtins.str - client_streaming: builtins.bool + output_type: _builtins.str + client_streaming: _builtins.bool """Identifies if client streams multiple client messages""" - server_streaming: builtins.bool + server_streaming: _builtins.bool """Identifies if server streams multiple server messages""" - @property - def options(self) -> global___MethodOptions: ... + @_builtins.property + def options(self) -> Global___MethodOptions: ... def __init__( self, *, - 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.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.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", - ], + 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: ... - -global___MethodDescriptorProto = MethodDescriptorProto - -@typing.final -class FileOptions(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___MethodDescriptorProto: _TypeAlias = MethodDescriptorProto # noqa: Y015 + +@_typing.final +class FileOptions(_message.Message): """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. @@ -1090,16 +1081,14 @@ class FileOptions(google.protobuf.message.Message): to automatically assign option numbers. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor class _OptimizeMode: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _OptimizeModeEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FileOptions._OptimizeMode.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _OptimizeModeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FileOptions._OptimizeMode.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor SPEED: FileOptions._OptimizeMode.ValueType # 1 """Generate complete code for parsing, serialization,""" CODE_SIZE: FileOptions._OptimizeMode.ValueType # 2 @@ -1121,41 +1110,41 @@ class FileOptions(google.protobuf.message.Message): 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 - JAVA_GENERATE_EQUALS_AND_HASH_FIELD_NUMBER: builtins.int - JAVA_STRING_CHECK_UTF8_FIELD_NUMBER: builtins.int - OPTIMIZE_FOR_FIELD_NUMBER: builtins.int - GO_PACKAGE_FIELD_NUMBER: builtins.int - CC_GENERIC_SERVICES_FIELD_NUMBER: builtins.int - JAVA_GENERIC_SERVICES_FIELD_NUMBER: builtins.int - PY_GENERIC_SERVICES_FIELD_NUMBER: builtins.int - DEPRECATED_FIELD_NUMBER: builtins.int - CC_ENABLE_ARENAS_FIELD_NUMBER: builtins.int - OBJC_CLASS_PREFIX_FIELD_NUMBER: builtins.int - CSHARP_NAMESPACE_FIELD_NUMBER: builtins.int - SWIFT_PREFIX_FIELD_NUMBER: builtins.int - PHP_CLASS_PREFIX_FIELD_NUMBER: builtins.int - PHP_NAMESPACE_FIELD_NUMBER: builtins.int - PHP_METADATA_NAMESPACE_FIELD_NUMBER: builtins.int - RUBY_PACKAGE_FIELD_NUMBER: builtins.int - FEATURES_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - java_package: builtins.str + JAVA_PACKAGE_FIELD_NUMBER: _builtins.int + JAVA_OUTER_CLASSNAME_FIELD_NUMBER: _builtins.int + JAVA_MULTIPLE_FILES_FIELD_NUMBER: _builtins.int + JAVA_GENERATE_EQUALS_AND_HASH_FIELD_NUMBER: _builtins.int + JAVA_STRING_CHECK_UTF8_FIELD_NUMBER: _builtins.int + OPTIMIZE_FOR_FIELD_NUMBER: _builtins.int + GO_PACKAGE_FIELD_NUMBER: _builtins.int + CC_GENERIC_SERVICES_FIELD_NUMBER: _builtins.int + JAVA_GENERIC_SERVICES_FIELD_NUMBER: _builtins.int + PY_GENERIC_SERVICES_FIELD_NUMBER: _builtins.int + DEPRECATED_FIELD_NUMBER: _builtins.int + CC_ENABLE_ARENAS_FIELD_NUMBER: _builtins.int + OBJC_CLASS_PREFIX_FIELD_NUMBER: _builtins.int + CSHARP_NAMESPACE_FIELD_NUMBER: _builtins.int + SWIFT_PREFIX_FIELD_NUMBER: _builtins.int + PHP_CLASS_PREFIX_FIELD_NUMBER: _builtins.int + PHP_NAMESPACE_FIELD_NUMBER: _builtins.int + PHP_METADATA_NAMESPACE_FIELD_NUMBER: _builtins.int + RUBY_PACKAGE_FIELD_NUMBER: _builtins.int + FEATURES_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + 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: builtins.str + 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 + 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 file. Thus, these types will *not* be nested inside the wrapper class @@ -1163,9 +1152,17 @@ 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 + + @_builtins.property + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def java_generate_equals_and_hash(self) -> _builtins.bool: + """This option does nothing.""" + @java_generate_equals_and_hash.setter + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def java_generate_equals_and_hash(self, value: _builtins.bool) -> None: + """This option does nothing.""" + + java_string_check_utf8: _builtins.bool """A proto2 file can set this to true to opt in to UTF-8 checking for Java, which will throw an exception if invalid UTF-8 is parsed from the wire or assigned to a string field. @@ -1177,15 +1174,15 @@ class FileOptions(google.protobuf.message.Message): false has no effect: it cannot be used to opt proto3 files out of UTF-8 checks. """ - optimize_for: global___FileOptions.OptimizeMode.ValueType - go_package: builtins.str + optimize_for: Global___FileOptions.OptimizeMode.ValueType + 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 + 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 main code generators in each language (without additional plugins). @@ -1197,61 +1194,59 @@ 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 - deprecated: builtins.bool + java_generic_services: _builtins.bool + py_generic_services: _builtins.bool + deprecated: _builtins.bool """Is this file deprecated? Depending on the target platform, this can emit Deprecated annotations 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 + 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: builtins.str + 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: builtins.str + csharp_namespace: _builtins.str """Namespace for generated classes; defaults to the package.""" - swift_prefix: builtins.str + 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: builtins.str + 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: builtins.str + 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: builtins.str + 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: builtins.str + 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 features(self) -> global___FeatureSet: + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See the documentation for the "Options" section above. """ @@ -1259,135 +1254,132 @@ class FileOptions(google.protobuf.message.Message): def __init__( self, *, - 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 = ..., - 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 = ..., - features: global___FeatureSet | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | 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 = ..., + 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 = ..., + features: Global___FeatureSet | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "cc_enable_arenas", - b"cc_enable_arenas", - "cc_generic_services", - b"cc_generic_services", - "csharp_namespace", - b"csharp_namespace", - "deprecated", - b"deprecated", - "features", - b"features", - "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_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.Literal[ - "cc_enable_arenas", - b"cc_enable_arenas", - "cc_generic_services", - b"cc_generic_services", - "csharp_namespace", - b"csharp_namespace", - "deprecated", - b"deprecated", - "features", - b"features", - "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_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 - -@typing.final -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 - MAP_ENTRY_FIELD_NUMBER: builtins.int - DEPRECATED_LEGACY_JSON_FIELD_CONFLICTS_FIELD_NUMBER: builtins.int - FEATURES_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - message_set_wire_format: builtins.bool + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "cc_enable_arenas", + b"cc_enable_arenas", + "cc_generic_services", + b"cc_generic_services", + "csharp_namespace", + b"csharp_namespace", + "deprecated", + b"deprecated", + "features", + b"features", + "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_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", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "cc_enable_arenas", + b"cc_enable_arenas", + "cc_generic_services", + b"cc_generic_services", + "csharp_namespace", + b"csharp_namespace", + "deprecated", + b"deprecated", + "features", + b"features", + "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_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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___FileOptions: _TypeAlias = FileOptions # noqa: Y015 + +@_typing.final +class MessageOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + MESSAGE_SET_WIRE_FORMAT_FIELD_NUMBER: _builtins.int + NO_STANDARD_DESCRIPTOR_ACCESSOR_FIELD_NUMBER: _builtins.int + DEPRECATED_FIELD_NUMBER: _builtins.int + MAP_ENTRY_FIELD_NUMBER: _builtins.int + DEPRECATED_LEGACY_JSON_FIELD_CONFLICTS_FIELD_NUMBER: _builtins.int + FEATURES_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + message_set_wire_format: _builtins.bool """Set true to use the old proto1 MessageSet wire format for extensions. This is provided for backwards-compatibility with the MessageSet wire format. You should not use this for any other reason: It's less @@ -1407,18 +1399,18 @@ 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 + 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 + 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 + map_entry: _builtins.bool """Whether the message is an automatically generated map entry type for the maps field. @@ -1441,94 +1433,105 @@ class MessageOptions(google.protobuf.message.Message): instead. The option should only be implicitly set by the proto compiler parser. """ - deprecated_legacy_json_field_conflicts: builtins.bool - """Enable the legacy handling of JSON field name conflicts. This lowercases - and strips underscored from the fields before comparison in proto3 only. - The new behavior takes `json_name` into account and applies to proto2 as - well. - This should only be used as a temporary measure against broken builds due - to the change in behavior for JSON field name conflicts. + @_builtins.property + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_legacy_json_field_conflicts(self) -> _builtins.bool: + """Enable the legacy handling of JSON field name conflicts. This lowercases + and strips underscored from the fields before comparison in proto3 only. + The new behavior takes `json_name` into account and applies to proto2 as + well. - TODO This is legacy behavior we plan to remove once downstream - teams have had time to migrate. - """ - @property - def features(self) -> global___FeatureSet: + This should only be used as a temporary measure against broken builds due + to the change in behavior for JSON field name conflicts. + + TODO This is legacy behavior we plan to remove once downstream + teams have had time to migrate. + """ + @deprecated_legacy_json_field_conflicts.setter + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_legacy_json_field_conflicts(self, value: _builtins.bool) -> None: + """Enable the legacy handling of JSON field name conflicts. This lowercases + and strips underscored from the fields before comparison in proto3 only. + The new behavior takes `json_name` into account and applies to proto2 as + well. + + This should only be used as a temporary measure against broken builds due + to the change in behavior for JSON field name conflicts. + + TODO This is legacy behavior we plan to remove once downstream + teams have had time to migrate. + """ + + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" def __init__( self, *, - message_set_wire_format: builtins.bool | None = ..., - no_standard_descriptor_accessor: builtins.bool | None = ..., - deprecated: builtins.bool | None = ..., - map_entry: builtins.bool | None = ..., - deprecated_legacy_json_field_conflicts: builtins.bool | None = ..., - features: global___FeatureSet | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., - ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "deprecated", - b"deprecated", - "deprecated_legacy_json_field_conflicts", - b"deprecated_legacy_json_field_conflicts", - "features", - b"features", - "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.Literal[ - "deprecated", - b"deprecated", - "deprecated_legacy_json_field_conflicts", - b"deprecated_legacy_json_field_conflicts", - "features", - b"features", - "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", - ], + message_set_wire_format: _builtins.bool | None = ..., + no_standard_descriptor_accessor: _builtins.bool | None = ..., + deprecated: _builtins.bool | None = ..., + map_entry: _builtins.bool | None = ..., + deprecated_legacy_json_field_conflicts: _builtins.bool | None = ..., + features: Global___FeatureSet | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... - -global___MessageOptions = MessageOptions - -@typing.final -class FieldOptions(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "deprecated", + b"deprecated", + "deprecated_legacy_json_field_conflicts", + b"deprecated_legacy_json_field_conflicts", + "features", + b"features", + "map_entry", + b"map_entry", + "message_set_wire_format", + b"message_set_wire_format", + "no_standard_descriptor_accessor", + b"no_standard_descriptor_accessor", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "deprecated", + b"deprecated", + "deprecated_legacy_json_field_conflicts", + b"deprecated_legacy_json_field_conflicts", + "features", + b"features", + "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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___MessageOptions: _TypeAlias = MessageOptions # noqa: Y015 + +@_typing.final +class FieldOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor class _CType: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _CTypeEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._CType.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _CTypeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FieldOptions._CType.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor STRING: FieldOptions._CType.ValueType # 0 """Default mode.""" CORD: FieldOptions._CType.ValueType # 1 @@ -1555,13 +1558,11 @@ class FieldOptions(google.protobuf.message.Message): STRING_PIECE: FieldOptions.CType.ValueType # 2 class _JSType: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _JSTypeEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._JSType.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _JSTypeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FieldOptions._JSType.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor JS_NORMAL: FieldOptions._JSType.ValueType # 0 """Use the default type.""" JS_STRING: FieldOptions._JSType.ValueType # 1 @@ -1578,13 +1579,13 @@ class FieldOptions(google.protobuf.message.Message): """Use JavaScript numbers.""" class _OptionRetention: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _OptionRetentionEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._OptionRetention.ValueType], builtins.type + _enum_type_wrapper._EnumTypeWrapper[FieldOptions._OptionRetention.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor RETENTION_UNKNOWN: FieldOptions._OptionRetention.ValueType # 0 RETENTION_RUNTIME: FieldOptions._OptionRetention.ValueType # 1 RETENTION_SOURCE: FieldOptions._OptionRetention.ValueType # 2 @@ -1597,13 +1598,13 @@ class FieldOptions(google.protobuf.message.Message): RETENTION_SOURCE: FieldOptions.OptionRetention.ValueType # 2 class _OptionTargetType: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _OptionTargetTypeEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FieldOptions._OptionTargetType.ValueType], builtins.type + _enum_type_wrapper._EnumTypeWrapper[FieldOptions._OptionTargetType.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor TARGET_TYPE_UNKNOWN: FieldOptions._OptionTargetType.ValueType # 0 TARGET_TYPE_FILE: FieldOptions._OptionTargetType.ValueType # 1 TARGET_TYPE_EXTENSION_RANGE: FieldOptions._OptionTargetType.ValueType # 2 @@ -1632,107 +1633,107 @@ class FieldOptions(google.protobuf.message.Message): TARGET_TYPE_SERVICE: FieldOptions.OptionTargetType.ValueType # 8 TARGET_TYPE_METHOD: FieldOptions.OptionTargetType.ValueType # 9 - @typing.final - class EditionDefault(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + @_typing.final + class EditionDefault(_message.Message): + DESCRIPTOR: _descriptor.Descriptor - EDITION_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - edition: global___Edition.ValueType - value: builtins.str + EDITION_FIELD_NUMBER: _builtins.int + VALUE_FIELD_NUMBER: _builtins.int + edition: Global___Edition.ValueType + value: _builtins.str """Textproto value.""" - def __init__(self, *, edition: global___Edition.ValueType | None = ..., value: builtins.str | None = ...) -> None: ... - def HasField(self, field_name: typing.Literal["edition", b"edition", "value", b"value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["edition", b"edition", "value", b"value"]) -> None: ... - - @typing.final - class FeatureSupport(google.protobuf.message.Message): + def __init__(self, *, edition: Global___Edition.ValueType | None = ..., value: _builtins.str | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["edition", b"edition", "value", b"value"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["edition", b"edition", "value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + @_typing.final + class FeatureSupport(_message.Message): """Information about the support window of a feature.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - EDITION_INTRODUCED_FIELD_NUMBER: builtins.int - EDITION_DEPRECATED_FIELD_NUMBER: builtins.int - DEPRECATION_WARNING_FIELD_NUMBER: builtins.int - EDITION_REMOVED_FIELD_NUMBER: builtins.int - REMOVAL_ERROR_FIELD_NUMBER: builtins.int - edition_introduced: global___Edition.ValueType + EDITION_INTRODUCED_FIELD_NUMBER: _builtins.int + EDITION_DEPRECATED_FIELD_NUMBER: _builtins.int + DEPRECATION_WARNING_FIELD_NUMBER: _builtins.int + EDITION_REMOVED_FIELD_NUMBER: _builtins.int + REMOVAL_ERROR_FIELD_NUMBER: _builtins.int + edition_introduced: Global___Edition.ValueType """The edition that this feature was first available in. In editions earlier than this one, the default assigned to EDITION_LEGACY will be used, and proto files will not be able to override it. """ - edition_deprecated: global___Edition.ValueType + edition_deprecated: Global___Edition.ValueType """The edition this feature becomes deprecated in. Using this after this edition may trigger warnings. """ - deprecation_warning: builtins.str + deprecation_warning: _builtins.str """The deprecation warning text if this feature is used after the edition it was marked deprecated in. """ - edition_removed: global___Edition.ValueType + edition_removed: Global___Edition.ValueType """The edition this feature is no longer available in. In editions after this one, the last default assigned will be used, and proto files will not be able to override it. """ - removal_error: builtins.str + removal_error: _builtins.str """The removal error text if this feature is used after the edition it was removed in. """ def __init__( self, *, - edition_introduced: global___Edition.ValueType | None = ..., - edition_deprecated: global___Edition.ValueType | None = ..., - deprecation_warning: builtins.str | None = ..., - edition_removed: global___Edition.ValueType | None = ..., - removal_error: builtins.str | None = ..., + edition_introduced: Global___Edition.ValueType | None = ..., + edition_deprecated: Global___Edition.ValueType | None = ..., + deprecation_warning: _builtins.str | None = ..., + edition_removed: Global___Edition.ValueType | None = ..., + removal_error: _builtins.str | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "deprecation_warning", - b"deprecation_warning", - "edition_deprecated", - b"edition_deprecated", - "edition_introduced", - b"edition_introduced", - "edition_removed", - b"edition_removed", - "removal_error", - b"removal_error", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "deprecation_warning", - b"deprecation_warning", - "edition_deprecated", - b"edition_deprecated", - "edition_introduced", - b"edition_introduced", - "edition_removed", - b"edition_removed", - "removal_error", - b"removal_error", - ], - ) -> None: ... - - CTYPE_FIELD_NUMBER: builtins.int - PACKED_FIELD_NUMBER: builtins.int - JSTYPE_FIELD_NUMBER: builtins.int - LAZY_FIELD_NUMBER: builtins.int - UNVERIFIED_LAZY_FIELD_NUMBER: builtins.int - DEPRECATED_FIELD_NUMBER: builtins.int - WEAK_FIELD_NUMBER: builtins.int - DEBUG_REDACT_FIELD_NUMBER: builtins.int - RETENTION_FIELD_NUMBER: builtins.int - TARGETS_FIELD_NUMBER: builtins.int - EDITION_DEFAULTS_FIELD_NUMBER: builtins.int - FEATURES_FIELD_NUMBER: builtins.int - FEATURE_SUPPORT_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - ctype: global___FieldOptions.CType.ValueType + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "deprecation_warning", + b"deprecation_warning", + "edition_deprecated", + b"edition_deprecated", + "edition_introduced", + b"edition_introduced", + "edition_removed", + b"edition_removed", + "removal_error", + b"removal_error", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "deprecation_warning", + b"deprecation_warning", + "edition_deprecated", + b"edition_deprecated", + "edition_introduced", + b"edition_introduced", + "edition_removed", + b"edition_removed", + "removal_error", + b"removal_error", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + CTYPE_FIELD_NUMBER: _builtins.int + PACKED_FIELD_NUMBER: _builtins.int + JSTYPE_FIELD_NUMBER: _builtins.int + LAZY_FIELD_NUMBER: _builtins.int + UNVERIFIED_LAZY_FIELD_NUMBER: _builtins.int + DEPRECATED_FIELD_NUMBER: _builtins.int + WEAK_FIELD_NUMBER: _builtins.int + DEBUG_REDACT_FIELD_NUMBER: _builtins.int + RETENTION_FIELD_NUMBER: _builtins.int + TARGETS_FIELD_NUMBER: _builtins.int + EDITION_DEFAULTS_FIELD_NUMBER: _builtins.int + FEATURES_FIELD_NUMBER: _builtins.int + FEATURE_SUPPORT_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + ctype: Global___FieldOptions.CType.ValueType """NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. The ctype option instructs the C++ code generator to use a different representation of the field than it normally would. See the specific @@ -1741,7 +1742,7 @@ class FieldOptions(google.protobuf.message.Message): type "bytes" in the open source release. TODO: make ctype actually deprecated. """ - packed: builtins.bool + 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 writing the tag and type for each element, the entire array is encoded as @@ -1750,7 +1751,7 @@ class FieldOptions(google.protobuf.message.Message): Editions, but the `repeated_field_encoding` feature can be used to control the behavior. """ - jstype: global___FieldOptions.JSType.ValueType + 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 (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING @@ -1763,7 +1764,7 @@ 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 + 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 inner message's contents will not be parsed but instead stored in encoded @@ -1787,331 +1788,337 @@ class FieldOptions(google.protobuf.message.Message): fields. Failed verification would result in parsing failure (except when uninitialized messages are acceptable). """ - unverified_lazy: builtins.bool + 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 + 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 - """DEPRECATED. DO NOT USE! - For Google-internal migration only. Do not use. - """ - debug_redact: builtins.bool + + @_builtins.property + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def weak(self) -> _builtins.bool: + """DEPRECATED. DO NOT USE! + For Google-internal migration only. Do not use. + """ + @weak.setter + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def weak(self, value: _builtins.bool) -> None: + """DEPRECATED. DO NOT USE! + For Google-internal migration only. Do not use. + """ + + debug_redact: _builtins.bool """Indicate that the field value should not be printed out when using debug formats, e.g. when the field contains sensitive credentials. """ - retention: global___FieldOptions.OptionRetention.ValueType - @property - def targets( - self, - ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[global___FieldOptions.OptionTargetType.ValueType]: ... - @property - def edition_defaults( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FieldOptions.EditionDefault]: ... - @property - def features(self) -> global___FeatureSet: + retention: Global___FieldOptions.OptionRetention.ValueType + @_builtins.property + def targets(self) -> _containers.RepeatedScalarFieldContainer[Global___FieldOptions.OptionTargetType.ValueType]: ... + @_builtins.property + def edition_defaults(self) -> _containers.RepeatedCompositeFieldContainer[Global___FieldOptions.EditionDefault]: ... + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def feature_support(self) -> global___FieldOptions.FeatureSupport: ... - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def feature_support(self) -> Global___FieldOptions.FeatureSupport: ... + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" def __init__( self, *, - 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 = ..., - debug_redact: builtins.bool | None = ..., - retention: global___FieldOptions.OptionRetention.ValueType | None = ..., - targets: collections.abc.Iterable[global___FieldOptions.OptionTargetType.ValueType] | None = ..., - edition_defaults: collections.abc.Iterable[global___FieldOptions.EditionDefault] | None = ..., - features: global___FeatureSet | None = ..., - feature_support: global___FieldOptions.FeatureSupport | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | 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 = ..., + debug_redact: _builtins.bool | None = ..., + retention: Global___FieldOptions.OptionRetention.ValueType | None = ..., + targets: _abc.Iterable[Global___FieldOptions.OptionTargetType.ValueType] | None = ..., + edition_defaults: _abc.Iterable[Global___FieldOptions.EditionDefault] | None = ..., + features: Global___FeatureSet | None = ..., + feature_support: Global___FieldOptions.FeatureSupport | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "ctype", - b"ctype", - "debug_redact", - b"debug_redact", - "deprecated", - b"deprecated", - "feature_support", - b"feature_support", - "features", - b"features", - "jstype", - b"jstype", - "lazy", - b"lazy", - "packed", - b"packed", - "retention", - b"retention", - "unverified_lazy", - b"unverified_lazy", - "weak", - b"weak", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "ctype", - b"ctype", - "debug_redact", - b"debug_redact", - "deprecated", - b"deprecated", - "edition_defaults", - b"edition_defaults", - "feature_support", - b"feature_support", - "features", - b"features", - "jstype", - b"jstype", - "lazy", - b"lazy", - "packed", - b"packed", - "retention", - b"retention", - "targets", - b"targets", - "uninterpreted_option", - b"uninterpreted_option", - "unverified_lazy", - b"unverified_lazy", - "weak", - b"weak", - ], - ) -> None: ... - -global___FieldOptions = FieldOptions - -@typing.final -class OneofOptions(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - FEATURES_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - @property - def features(self) -> global___FeatureSet: + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "ctype", + b"ctype", + "debug_redact", + b"debug_redact", + "deprecated", + b"deprecated", + "feature_support", + b"feature_support", + "features", + b"features", + "jstype", + b"jstype", + "lazy", + b"lazy", + "packed", + b"packed", + "retention", + b"retention", + "unverified_lazy", + b"unverified_lazy", + "weak", + b"weak", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "ctype", + b"ctype", + "debug_redact", + b"debug_redact", + "deprecated", + b"deprecated", + "edition_defaults", + b"edition_defaults", + "feature_support", + b"feature_support", + "features", + b"features", + "jstype", + b"jstype", + "lazy", + b"lazy", + "packed", + b"packed", + "retention", + b"retention", + "targets", + b"targets", + "uninterpreted_option", + b"uninterpreted_option", + "unverified_lazy", + b"unverified_lazy", + "weak", + b"weak", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___FieldOptions: _TypeAlias = FieldOptions # noqa: Y015 + +@_typing.final +class OneofOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + FEATURES_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" def __init__( self, *, - features: global___FeatureSet | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., - ) -> None: ... - def HasField(self, field_name: typing.Literal["features", b"features"]) -> builtins.bool: ... - def ClearField( - self, field_name: typing.Literal["features", b"features", "uninterpreted_option", b"uninterpreted_option"] + features: Global___FeatureSet | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... - -global___OneofOptions = OneofOptions - -@typing.final -class EnumOptions(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - ALLOW_ALIAS_FIELD_NUMBER: builtins.int - DEPRECATED_FIELD_NUMBER: builtins.int - DEPRECATED_LEGACY_JSON_FIELD_CONFLICTS_FIELD_NUMBER: builtins.int - FEATURES_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - allow_alias: builtins.bool + _HasFieldArgType: _TypeAlias = _typing.Literal["features", b"features"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "features", b"features", "uninterpreted_option", b"uninterpreted_option" + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___OneofOptions: _TypeAlias = OneofOptions # noqa: Y015 + +@_typing.final +class EnumOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + ALLOW_ALIAS_FIELD_NUMBER: _builtins.int + DEPRECATED_FIELD_NUMBER: _builtins.int + DEPRECATED_LEGACY_JSON_FIELD_CONFLICTS_FIELD_NUMBER: _builtins.int + FEATURES_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + allow_alias: _builtins.bool """Set this option to true to allow mapping different tag names to the same value. """ - deprecated: builtins.bool + 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. """ - deprecated_legacy_json_field_conflicts: builtins.bool - """Enable the legacy handling of JSON field name conflicts. This lowercases - and strips underscored from the fields before comparison in proto3 only. - The new behavior takes `json_name` into account and applies to proto2 as - well. - TODO Remove this legacy behavior once downstream teams have - had time to migrate. - """ - @property - def features(self) -> global___FeatureSet: + + @_builtins.property + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_legacy_json_field_conflicts(self) -> _builtins.bool: + """Enable the legacy handling of JSON field name conflicts. This lowercases + and strips underscored from the fields before comparison in proto3 only. + The new behavior takes `json_name` into account and applies to proto2 as + well. + TODO Remove this legacy behavior once downstream teams have + had time to migrate. + """ + @deprecated_legacy_json_field_conflicts.setter + @_deprecated("""This field has been marked as deprecated using proto field options.""") + def deprecated_legacy_json_field_conflicts(self, value: _builtins.bool) -> None: + """Enable the legacy handling of JSON field name conflicts. This lowercases + and strips underscored from the fields before comparison in proto3 only. + The new behavior takes `json_name` into account and applies to proto2 as + well. + TODO Remove this legacy behavior once downstream teams have + had time to migrate. + """ + + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" def __init__( self, *, - allow_alias: builtins.bool | None = ..., - deprecated: builtins.bool | None = ..., - deprecated_legacy_json_field_conflicts: builtins.bool | None = ..., - features: global___FeatureSet | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., - ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "allow_alias", - b"allow_alias", - "deprecated", - b"deprecated", - "deprecated_legacy_json_field_conflicts", - b"deprecated_legacy_json_field_conflicts", - "features", - b"features", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "allow_alias", - b"allow_alias", - "deprecated", - b"deprecated", - "deprecated_legacy_json_field_conflicts", - b"deprecated_legacy_json_field_conflicts", - "features", - b"features", - "uninterpreted_option", - b"uninterpreted_option", - ], + allow_alias: _builtins.bool | None = ..., + deprecated: _builtins.bool | None = ..., + deprecated_legacy_json_field_conflicts: _builtins.bool | None = ..., + features: Global___FeatureSet | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... - -global___EnumOptions = EnumOptions - -@typing.final -class EnumValueOptions(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - DEPRECATED_FIELD_NUMBER: builtins.int - FEATURES_FIELD_NUMBER: builtins.int - DEBUG_REDACT_FIELD_NUMBER: builtins.int - FEATURE_SUPPORT_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - deprecated: builtins.bool + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "allow_alias", + b"allow_alias", + "deprecated", + b"deprecated", + "deprecated_legacy_json_field_conflicts", + b"deprecated_legacy_json_field_conflicts", + "features", + b"features", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "allow_alias", + b"allow_alias", + "deprecated", + b"deprecated", + "deprecated_legacy_json_field_conflicts", + b"deprecated_legacy_json_field_conflicts", + "features", + b"features", + "uninterpreted_option", + b"uninterpreted_option", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___EnumOptions: _TypeAlias = EnumOptions # noqa: Y015 + +@_typing.final +class EnumValueOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + DEPRECATED_FIELD_NUMBER: _builtins.int + FEATURES_FIELD_NUMBER: _builtins.int + DEBUG_REDACT_FIELD_NUMBER: _builtins.int + FEATURE_SUPPORT_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + deprecated: _builtins.bool """Is this enum value deprecated? Depending on the target platform, this can emit Deprecated annotations for the enum value, or it will be completely ignored; in the very least, this is a formalization for deprecating enum values. """ - debug_redact: builtins.bool + debug_redact: _builtins.bool """Indicate that fields annotated with this enum value should not be printed out when using debug formats, e.g. when the field contains sensitive credentials. """ - @property - def features(self) -> global___FeatureSet: + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def feature_support(self) -> global___FieldOptions.FeatureSupport: + @_builtins.property + def feature_support(self) -> Global___FieldOptions.FeatureSupport: """Information about the support window of a feature value.""" - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" def __init__( self, *, - deprecated: builtins.bool | None = ..., - features: global___FeatureSet | None = ..., - debug_redact: builtins.bool | None = ..., - feature_support: global___FieldOptions.FeatureSupport | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., - ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "debug_redact", - b"debug_redact", - "deprecated", - b"deprecated", - "feature_support", - b"feature_support", - "features", - b"features", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "debug_redact", - b"debug_redact", - "deprecated", - b"deprecated", - "feature_support", - b"feature_support", - "features", - b"features", - "uninterpreted_option", - b"uninterpreted_option", - ], + deprecated: _builtins.bool | None = ..., + features: Global___FeatureSet | None = ..., + debug_redact: _builtins.bool | None = ..., + feature_support: Global___FieldOptions.FeatureSupport | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... - -global___EnumValueOptions = EnumValueOptions - -@typing.final -class ServiceOptions(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - FEATURES_FIELD_NUMBER: builtins.int - DEPRECATED_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - deprecated: builtins.bool + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "debug_redact", + b"debug_redact", + "deprecated", + b"deprecated", + "feature_support", + b"feature_support", + "features", + b"features", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "debug_redact", + b"debug_redact", + "deprecated", + b"deprecated", + "feature_support", + b"feature_support", + "features", + b"features", + "uninterpreted_option", + b"uninterpreted_option", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___EnumValueOptions: _TypeAlias = EnumValueOptions # noqa: Y015 + +@_typing.final +class ServiceOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + FEATURES_FIELD_NUMBER: _builtins.int + DEPRECATED_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + deprecated: _builtins.bool """Note: Field numbers 1 through 32 are reserved for Google's internal RPC framework. We apologize for hoarding these numbers to ourselves, but we were already using them long before we decided to release Protocol @@ -2122,49 +2129,47 @@ 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 features(self) -> global___FeatureSet: + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" def __init__( self, *, - features: global___FeatureSet | None = ..., - deprecated: builtins.bool | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., - ) -> None: ... - def HasField(self, field_name: typing.Literal["deprecated", b"deprecated", "features", b"features"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "deprecated", b"deprecated", "features", b"features", "uninterpreted_option", b"uninterpreted_option" - ], + features: Global___FeatureSet | None = ..., + deprecated: _builtins.bool | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["deprecated", b"deprecated", "features", b"features"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "deprecated", b"deprecated", "features", b"features", "uninterpreted_option", b"uninterpreted_option" + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___ServiceOptions = ServiceOptions +Global___ServiceOptions: _TypeAlias = ServiceOptions # noqa: Y015 -@typing.final -class MethodOptions(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor +@_typing.final +class MethodOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor class _IdempotencyLevel: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _IdempotencyLevelEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[MethodOptions._IdempotencyLevel.ValueType], builtins.type + _enum_type_wrapper._EnumTypeWrapper[MethodOptions._IdempotencyLevel.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor IDEMPOTENCY_UNKNOWN: MethodOptions._IdempotencyLevel.ValueType # 0 NO_SIDE_EFFECTS: MethodOptions._IdempotencyLevel.ValueType # 1 """implies idempotent""" @@ -2183,11 +2188,11 @@ class MethodOptions(google.protobuf.message.Message): IDEMPOTENT: MethodOptions.IdempotencyLevel.ValueType # 2 """idempotent, but may have side effects""" - DEPRECATED_FIELD_NUMBER: builtins.int - IDEMPOTENCY_LEVEL_FIELD_NUMBER: builtins.int - FEATURES_FIELD_NUMBER: builtins.int - UNINTERPRETED_OPTION_FIELD_NUMBER: builtins.int - deprecated: builtins.bool + DEPRECATED_FIELD_NUMBER: _builtins.int + IDEMPOTENCY_LEVEL_FIELD_NUMBER: _builtins.int + FEATURES_FIELD_NUMBER: _builtins.int + UNINTERPRETED_OPTION_FIELD_NUMBER: _builtins.int + deprecated: _builtins.bool """Note: Field numbers 1 through 32 are reserved for Google's internal RPC framework. We apologize for hoarding these numbers to ourselves, but we were already using them long before we decided to release Protocol @@ -2198,53 +2203,48 @@ 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 features(self) -> global___FeatureSet: + idempotency_level: Global___MethodOptions.IdempotencyLevel.ValueType + @_builtins.property + def features(self) -> Global___FeatureSet: """Any features defined in the specific edition. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language. """ - @property - def uninterpreted_option( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption]: + @_builtins.property + def uninterpreted_option(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption]: """The parser stores options it doesn't recognize here. See above.""" def __init__( self, *, - deprecated: builtins.bool | None = ..., - idempotency_level: global___MethodOptions.IdempotencyLevel.ValueType | None = ..., - features: global___FeatureSet | None = ..., - uninterpreted_option: collections.abc.Iterable[global___UninterpretedOption] | None = ..., - ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "deprecated", b"deprecated", "features", b"features", "idempotency_level", b"idempotency_level" - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "deprecated", - b"deprecated", - "features", - b"features", - "idempotency_level", - b"idempotency_level", - "uninterpreted_option", - b"uninterpreted_option", - ], + deprecated: _builtins.bool | None = ..., + idempotency_level: Global___MethodOptions.IdempotencyLevel.ValueType | None = ..., + features: Global___FeatureSet | None = ..., + uninterpreted_option: _abc.Iterable[Global___UninterpretedOption] | None = ..., ) -> None: ... - -global___MethodOptions = MethodOptions - -@typing.final -class UninterpretedOption(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "deprecated", b"deprecated", "features", b"features", "idempotency_level", b"idempotency_level" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "deprecated", + b"deprecated", + "features", + b"features", + "idempotency_level", + b"idempotency_level", + "uninterpreted_option", + b"uninterpreted_option", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___MethodOptions: _TypeAlias = MethodOptions # noqa: Y015 + +@_typing.final +class UninterpretedOption(_message.Message): """A message representing a option the parser does not recognize. This only appears in options protos created by the compiler::Parser class. DescriptorPool resolves these when building Descriptor objects. Therefore, @@ -2253,10 +2253,10 @@ class UninterpretedOption(google.protobuf.message.Message): in them. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - @typing.final - class NamePart(google.protobuf.message.Message): + @_typing.final + class NamePart(_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 extension (denoted with parentheses in options specs in .proto files). @@ -2264,90 +2264,86 @@ class UninterpretedOption(google.protobuf.message.Message): "foo.(bar.baz).moo". """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - NAME_PART_FIELD_NUMBER: builtins.int - IS_EXTENSION_FIELD_NUMBER: builtins.int - name_part: builtins.str - is_extension: builtins.bool - def __init__(self, *, name_part: builtins.str | None = ..., is_extension: builtins.bool | None = ...) -> None: ... - def HasField( - self, field_name: typing.Literal["is_extension", b"is_extension", "name_part", b"name_part"] - ) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["is_extension", b"is_extension", "name_part", b"name_part"]) -> None: ... - - NAME_FIELD_NUMBER: builtins.int - IDENTIFIER_VALUE_FIELD_NUMBER: builtins.int - POSITIVE_INT_VALUE_FIELD_NUMBER: builtins.int - NEGATIVE_INT_VALUE_FIELD_NUMBER: builtins.int - DOUBLE_VALUE_FIELD_NUMBER: builtins.int - STRING_VALUE_FIELD_NUMBER: builtins.int - AGGREGATE_VALUE_FIELD_NUMBER: builtins.int - identifier_value: builtins.str + DESCRIPTOR: _descriptor.Descriptor + + NAME_PART_FIELD_NUMBER: _builtins.int + IS_EXTENSION_FIELD_NUMBER: _builtins.int + name_part: _builtins.str + is_extension: _builtins.bool + def __init__(self, *, name_part: _builtins.str | None = ..., is_extension: _builtins.bool | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["is_extension", b"is_extension", "name_part", b"name_part"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["is_extension", b"is_extension", "name_part", b"name_part"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + NAME_FIELD_NUMBER: _builtins.int + IDENTIFIER_VALUE_FIELD_NUMBER: _builtins.int + POSITIVE_INT_VALUE_FIELD_NUMBER: _builtins.int + NEGATIVE_INT_VALUE_FIELD_NUMBER: _builtins.int + DOUBLE_VALUE_FIELD_NUMBER: _builtins.int + STRING_VALUE_FIELD_NUMBER: _builtins.int + AGGREGATE_VALUE_FIELD_NUMBER: _builtins.int + 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: builtins.str - @property - def name( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___UninterpretedOption.NamePart]: ... + positive_int_value: _builtins.int + negative_int_value: _builtins.int + double_value: _builtins.float + string_value: _builtins.bytes + aggregate_value: _builtins.str + @_builtins.property + def name(self) -> _containers.RepeatedCompositeFieldContainer[Global___UninterpretedOption.NamePart]: ... def __init__( self, *, - 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 = ..., + name: _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.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.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 - -@typing.final -class FeatureSet(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___UninterpretedOption: _TypeAlias = UninterpretedOption # noqa: Y015 + +@_typing.final +class FeatureSet(_message.Message): """=================================================================== Features @@ -2359,16 +2355,14 @@ class FeatureSet(google.protobuf.message.Message): conflict here. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor class _FieldPresence: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _FieldPresenceEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeatureSet._FieldPresence.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _FieldPresenceEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FeatureSet._FieldPresence.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor FIELD_PRESENCE_UNKNOWN: FeatureSet._FieldPresence.ValueType # 0 EXPLICIT: FeatureSet._FieldPresence.ValueType # 1 IMPLICIT: FeatureSet._FieldPresence.ValueType # 2 @@ -2381,13 +2375,11 @@ class FeatureSet(google.protobuf.message.Message): LEGACY_REQUIRED: FeatureSet.FieldPresence.ValueType # 3 class _EnumType: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _EnumTypeEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeatureSet._EnumType.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _EnumTypeEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FeatureSet._EnumType.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor ENUM_TYPE_UNKNOWN: FeatureSet._EnumType.ValueType # 0 OPEN: FeatureSet._EnumType.ValueType # 1 CLOSED: FeatureSet._EnumType.ValueType # 2 @@ -2398,13 +2390,13 @@ class FeatureSet(google.protobuf.message.Message): CLOSED: FeatureSet.EnumType.ValueType # 2 class _RepeatedFieldEncoding: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _RepeatedFieldEncodingEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeatureSet._RepeatedFieldEncoding.ValueType], builtins.type + _enum_type_wrapper._EnumTypeWrapper[FeatureSet._RepeatedFieldEncoding.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor REPEATED_FIELD_ENCODING_UNKNOWN: FeatureSet._RepeatedFieldEncoding.ValueType # 0 PACKED: FeatureSet._RepeatedFieldEncoding.ValueType # 1 EXPANDED: FeatureSet._RepeatedFieldEncoding.ValueType # 2 @@ -2415,13 +2407,13 @@ class FeatureSet(google.protobuf.message.Message): EXPANDED: FeatureSet.RepeatedFieldEncoding.ValueType # 2 class _Utf8Validation: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _Utf8ValidationEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeatureSet._Utf8Validation.ValueType], builtins.type + _enum_type_wrapper._EnumTypeWrapper[FeatureSet._Utf8Validation.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor UTF8_VALIDATION_UNKNOWN: FeatureSet._Utf8Validation.ValueType # 0 VERIFY: FeatureSet._Utf8Validation.ValueType # 2 NONE: FeatureSet._Utf8Validation.ValueType # 3 @@ -2432,13 +2424,13 @@ class FeatureSet(google.protobuf.message.Message): NONE: FeatureSet.Utf8Validation.ValueType # 3 class _MessageEncoding: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _MessageEncodingEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeatureSet._MessageEncoding.ValueType], builtins.type + _enum_type_wrapper._EnumTypeWrapper[FeatureSet._MessageEncoding.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor MESSAGE_ENCODING_UNKNOWN: FeatureSet._MessageEncoding.ValueType # 0 LENGTH_PREFIXED: FeatureSet._MessageEncoding.ValueType # 1 DELIMITED: FeatureSet._MessageEncoding.ValueType # 2 @@ -2449,13 +2441,11 @@ class FeatureSet(google.protobuf.message.Message): DELIMITED: FeatureSet.MessageEncoding.ValueType # 2 class _JsonFormat: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _JsonFormatEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeatureSet._JsonFormat.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _JsonFormatEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[FeatureSet._JsonFormat.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor JSON_FORMAT_UNKNOWN: FeatureSet._JsonFormat.ValueType # 0 ALLOW: FeatureSet._JsonFormat.ValueType # 1 LEGACY_BEST_EFFORT: FeatureSet._JsonFormat.ValueType # 2 @@ -2466,13 +2456,13 @@ class FeatureSet(google.protobuf.message.Message): LEGACY_BEST_EFFORT: FeatureSet.JsonFormat.ValueType # 2 class _EnforceNamingStyle: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _EnforceNamingStyleEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[FeatureSet._EnforceNamingStyle.ValueType], builtins.type + _enum_type_wrapper._EnumTypeWrapper[FeatureSet._EnforceNamingStyle.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor ENFORCE_NAMING_STYLE_UNKNOWN: FeatureSet._EnforceNamingStyle.ValueType # 0 STYLE2024: FeatureSet._EnforceNamingStyle.ValueType # 1 STYLE_LEGACY: FeatureSet._EnforceNamingStyle.ValueType # 2 @@ -2484,21 +2474,18 @@ class FeatureSet(google.protobuf.message.Message): STYLE_LEGACY: FeatureSet.EnforceNamingStyle.ValueType # 2 STYLE2026: FeatureSet.EnforceNamingStyle.ValueType # 3 - @typing.final - class VisibilityFeature(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + @_typing.final + class VisibilityFeature(_message.Message): + DESCRIPTOR: _descriptor.Descriptor class _DefaultSymbolVisibility: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _DefaultSymbolVisibilityEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ - FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType - ], - builtins.type, + _enum_type_wrapper._EnumTypeWrapper[FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType # 0 EXPORT_ALL: FeatureSet.VisibilityFeature._DefaultSymbolVisibility.ValueType # 1 """Default pre-EDITION_2024, all UNSET visibility are export.""" @@ -2527,170 +2514,216 @@ class FeatureSet(google.protobuf.message.Message): """ def __init__(self) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + @_typing.final + class ProtoLimitsFeature(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + class _EnforceProtoLimits: + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 + + class _EnforceProtoLimitsEnumTypeWrapper( + _enum_type_wrapper._EnumTypeWrapper[FeatureSet.ProtoLimitsFeature._EnforceProtoLimits.ValueType], _builtins.type + ): + DESCRIPTOR: _descriptor.EnumDescriptor + PROTO_LIMITS_UNKNOWN: FeatureSet.ProtoLimitsFeature._EnforceProtoLimits.ValueType # 0 + LEGACY_NO_EXPLICIT_LIMITS: FeatureSet.ProtoLimitsFeature._EnforceProtoLimits.ValueType # 1 + """Default pre-EDITION_2026: there are no limit enforcement at the protoc + level. Practical limits still exist, but they will tend to fail while + compiling protoc-generated code, and these limits tend to be language + or toolchain specific. + """ + PROTO_LIMITS2026: FeatureSet.ProtoLimitsFeature._EnforceProtoLimits.ValueType # 2 + """A set of limits enforced by Edition 2026 by default. For a detailed + list of all the limits please consult the Edition 2026 documentation. + """ - FIELD_PRESENCE_FIELD_NUMBER: builtins.int - ENUM_TYPE_FIELD_NUMBER: builtins.int - REPEATED_FIELD_ENCODING_FIELD_NUMBER: builtins.int - UTF8_VALIDATION_FIELD_NUMBER: builtins.int - MESSAGE_ENCODING_FIELD_NUMBER: builtins.int - JSON_FORMAT_FIELD_NUMBER: builtins.int - ENFORCE_NAMING_STYLE_FIELD_NUMBER: builtins.int - DEFAULT_SYMBOL_VISIBILITY_FIELD_NUMBER: builtins.int - field_presence: global___FeatureSet.FieldPresence.ValueType - enum_type: global___FeatureSet.EnumType.ValueType - repeated_field_encoding: global___FeatureSet.RepeatedFieldEncoding.ValueType - utf8_validation: global___FeatureSet.Utf8Validation.ValueType - message_encoding: global___FeatureSet.MessageEncoding.ValueType - json_format: global___FeatureSet.JsonFormat.ValueType - enforce_naming_style: global___FeatureSet.EnforceNamingStyle.ValueType - default_symbol_visibility: global___FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType + class EnforceProtoLimits(_EnforceProtoLimits, metaclass=_EnforceProtoLimitsEnumTypeWrapper): ... + PROTO_LIMITS_UNKNOWN: FeatureSet.ProtoLimitsFeature.EnforceProtoLimits.ValueType # 0 + LEGACY_NO_EXPLICIT_LIMITS: FeatureSet.ProtoLimitsFeature.EnforceProtoLimits.ValueType # 1 + """Default pre-EDITION_2026: there are no limit enforcement at the protoc + level. Practical limits still exist, but they will tend to fail while + compiling protoc-generated code, and these limits tend to be language + or toolchain specific. + """ + PROTO_LIMITS2026: FeatureSet.ProtoLimitsFeature.EnforceProtoLimits.ValueType # 2 + """A set of limits enforced by Edition 2026 by default. For a detailed + list of all the limits please consult the Edition 2026 documentation. + """ + + def __init__(self) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + FIELD_PRESENCE_FIELD_NUMBER: _builtins.int + ENUM_TYPE_FIELD_NUMBER: _builtins.int + REPEATED_FIELD_ENCODING_FIELD_NUMBER: _builtins.int + UTF8_VALIDATION_FIELD_NUMBER: _builtins.int + MESSAGE_ENCODING_FIELD_NUMBER: _builtins.int + JSON_FORMAT_FIELD_NUMBER: _builtins.int + ENFORCE_NAMING_STYLE_FIELD_NUMBER: _builtins.int + DEFAULT_SYMBOL_VISIBILITY_FIELD_NUMBER: _builtins.int + ENFORCE_PROTO_LIMITS_FIELD_NUMBER: _builtins.int + field_presence: Global___FeatureSet.FieldPresence.ValueType + enum_type: Global___FeatureSet.EnumType.ValueType + repeated_field_encoding: Global___FeatureSet.RepeatedFieldEncoding.ValueType + utf8_validation: Global___FeatureSet.Utf8Validation.ValueType + message_encoding: Global___FeatureSet.MessageEncoding.ValueType + json_format: Global___FeatureSet.JsonFormat.ValueType + enforce_naming_style: Global___FeatureSet.EnforceNamingStyle.ValueType + default_symbol_visibility: Global___FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType + enforce_proto_limits: Global___FeatureSet.ProtoLimitsFeature.EnforceProtoLimits.ValueType def __init__( self, *, - field_presence: global___FeatureSet.FieldPresence.ValueType | None = ..., - enum_type: global___FeatureSet.EnumType.ValueType | None = ..., - repeated_field_encoding: global___FeatureSet.RepeatedFieldEncoding.ValueType | None = ..., - utf8_validation: global___FeatureSet.Utf8Validation.ValueType | None = ..., - message_encoding: global___FeatureSet.MessageEncoding.ValueType | None = ..., - json_format: global___FeatureSet.JsonFormat.ValueType | None = ..., - enforce_naming_style: global___FeatureSet.EnforceNamingStyle.ValueType | None = ..., - default_symbol_visibility: global___FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType | None = ..., + field_presence: Global___FeatureSet.FieldPresence.ValueType | None = ..., + enum_type: Global___FeatureSet.EnumType.ValueType | None = ..., + repeated_field_encoding: Global___FeatureSet.RepeatedFieldEncoding.ValueType | None = ..., + utf8_validation: Global___FeatureSet.Utf8Validation.ValueType | None = ..., + message_encoding: Global___FeatureSet.MessageEncoding.ValueType | None = ..., + json_format: Global___FeatureSet.JsonFormat.ValueType | None = ..., + enforce_naming_style: Global___FeatureSet.EnforceNamingStyle.ValueType | None = ..., + default_symbol_visibility: Global___FeatureSet.VisibilityFeature.DefaultSymbolVisibility.ValueType | None = ..., + enforce_proto_limits: Global___FeatureSet.ProtoLimitsFeature.EnforceProtoLimits.ValueType | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "default_symbol_visibility", - b"default_symbol_visibility", - "enforce_naming_style", - b"enforce_naming_style", - "enum_type", - b"enum_type", - "field_presence", - b"field_presence", - "json_format", - b"json_format", - "message_encoding", - b"message_encoding", - "repeated_field_encoding", - b"repeated_field_encoding", - "utf8_validation", - b"utf8_validation", - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "default_symbol_visibility", - b"default_symbol_visibility", - "enforce_naming_style", - b"enforce_naming_style", - "enum_type", - b"enum_type", - "field_presence", - b"field_presence", - "json_format", - b"json_format", - "message_encoding", - b"message_encoding", - "repeated_field_encoding", - b"repeated_field_encoding", - "utf8_validation", - b"utf8_validation", - ], - ) -> None: ... - -global___FeatureSet = FeatureSet - -@typing.final -class FeatureSetDefaults(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "default_symbol_visibility", + b"default_symbol_visibility", + "enforce_naming_style", + b"enforce_naming_style", + "enforce_proto_limits", + b"enforce_proto_limits", + "enum_type", + b"enum_type", + "field_presence", + b"field_presence", + "json_format", + b"json_format", + "message_encoding", + b"message_encoding", + "repeated_field_encoding", + b"repeated_field_encoding", + "utf8_validation", + b"utf8_validation", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "default_symbol_visibility", + b"default_symbol_visibility", + "enforce_naming_style", + b"enforce_naming_style", + "enforce_proto_limits", + b"enforce_proto_limits", + "enum_type", + b"enum_type", + "field_presence", + b"field_presence", + "json_format", + b"json_format", + "message_encoding", + b"message_encoding", + "repeated_field_encoding", + b"repeated_field_encoding", + "utf8_validation", + b"utf8_validation", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___FeatureSet: _TypeAlias = FeatureSet # noqa: Y015 + +@_typing.final +class FeatureSetDefaults(_message.Message): """A compiled specification for the defaults of a set of features. These messages are generated from FeatureSet extensions and can be used to seed feature resolution. The resolution with this object becomes a simple search for the closest matching edition, followed by proto merges. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - @typing.final - class FeatureSetEditionDefault(google.protobuf.message.Message): + @_typing.final + class FeatureSetEditionDefault(_message.Message): """A map from every known edition with a unique set of defaults to its defaults. Not all editions may be contained here. For a given edition, the defaults at the closest matching edition ordered at or before it should be used. This field must be in strict ascending order by edition. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - EDITION_FIELD_NUMBER: builtins.int - OVERRIDABLE_FEATURES_FIELD_NUMBER: builtins.int - FIXED_FEATURES_FIELD_NUMBER: builtins.int - edition: global___Edition.ValueType - @property - def overridable_features(self) -> global___FeatureSet: + EDITION_FIELD_NUMBER: _builtins.int + OVERRIDABLE_FEATURES_FIELD_NUMBER: _builtins.int + FIXED_FEATURES_FIELD_NUMBER: _builtins.int + edition: Global___Edition.ValueType + @_builtins.property + def overridable_features(self) -> Global___FeatureSet: """Defaults of features that can be overridden in this edition.""" - @property - def fixed_features(self) -> global___FeatureSet: + @_builtins.property + def fixed_features(self) -> Global___FeatureSet: """Defaults of features that can't be overridden in this edition.""" def __init__( self, *, - edition: global___Edition.ValueType | None = ..., - overridable_features: global___FeatureSet | None = ..., - fixed_features: global___FeatureSet | None = ..., + edition: Global___Edition.ValueType | None = ..., + overridable_features: Global___FeatureSet | None = ..., + fixed_features: Global___FeatureSet | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal[ - "edition", b"edition", "fixed_features", b"fixed_features", "overridable_features", b"overridable_features" - ], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "edition", b"edition", "fixed_features", b"fixed_features", "overridable_features", b"overridable_features" - ], - ) -> None: ... - - DEFAULTS_FIELD_NUMBER: builtins.int - MINIMUM_EDITION_FIELD_NUMBER: builtins.int - MAXIMUM_EDITION_FIELD_NUMBER: builtins.int - minimum_edition: global___Edition.ValueType + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "edition", b"edition", "fixed_features", b"fixed_features", "overridable_features", b"overridable_features" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "edition", b"edition", "fixed_features", b"fixed_features", "overridable_features", b"overridable_features" + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + DEFAULTS_FIELD_NUMBER: _builtins.int + MINIMUM_EDITION_FIELD_NUMBER: _builtins.int + MAXIMUM_EDITION_FIELD_NUMBER: _builtins.int + minimum_edition: Global___Edition.ValueType """The minimum supported edition (inclusive) when this was constructed. Editions before this will not have defaults. """ - maximum_edition: global___Edition.ValueType + maximum_edition: Global___Edition.ValueType """The maximum known edition (inclusive) when this was constructed. Editions after this will not have reliable defaults. """ - @property - def defaults( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[ - global___FeatureSetDefaults.FeatureSetEditionDefault - ]: ... + @_builtins.property + def defaults(self) -> _containers.RepeatedCompositeFieldContainer[Global___FeatureSetDefaults.FeatureSetEditionDefault]: ... def __init__( self, *, - defaults: collections.abc.Iterable[global___FeatureSetDefaults.FeatureSetEditionDefault] | None = ..., - minimum_edition: global___Edition.ValueType | None = ..., - maximum_edition: global___Edition.ValueType | None = ..., + defaults: _abc.Iterable[Global___FeatureSetDefaults.FeatureSetEditionDefault] | None = ..., + minimum_edition: Global___Edition.ValueType | None = ..., + maximum_edition: Global___Edition.ValueType | None = ..., ) -> None: ... - def HasField( - self, field_name: typing.Literal["maximum_edition", b"maximum_edition", "minimum_edition", b"minimum_edition"] - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "defaults", b"defaults", "maximum_edition", b"maximum_edition", "minimum_edition", b"minimum_edition" - ], - ) -> None: ... - -global___FeatureSetDefaults = FeatureSetDefaults - -@typing.final -class SourceCodeInfo(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "maximum_edition", b"maximum_edition", "minimum_edition", b"minimum_edition" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "defaults", b"defaults", "maximum_edition", b"maximum_edition", "minimum_edition", b"minimum_edition" + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___FeatureSetDefaults: _TypeAlias = FeatureSetDefaults # noqa: Y015 + +@_typing.final +class SourceCodeInfo(_message.Message): """=================================================================== Optional source code info @@ -2698,18 +2731,18 @@ class SourceCodeInfo(google.protobuf.message.Message): FileDescriptorProto was generated. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - @typing.final - class Location(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + @_typing.final + class Location(_message.Message): + DESCRIPTOR: _descriptor.Descriptor - PATH_FIELD_NUMBER: builtins.int - SPAN_FIELD_NUMBER: builtins.int - LEADING_COMMENTS_FIELD_NUMBER: builtins.int - TRAILING_COMMENTS_FIELD_NUMBER: builtins.int - LEADING_DETACHED_COMMENTS_FIELD_NUMBER: builtins.int - leading_comments: builtins.str + PATH_FIELD_NUMBER: _builtins.int + SPAN_FIELD_NUMBER: _builtins.int + LEADING_COMMENTS_FIELD_NUMBER: _builtins.int + TRAILING_COMMENTS_FIELD_NUMBER: _builtins.int + LEADING_DETACHED_COMMENTS_FIELD_NUMBER: _builtins.int + 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. @@ -2758,9 +2791,9 @@ class SourceCodeInfo(google.protobuf.message.Message): // ignored detached comments. """ - trailing_comments: builtins.str - @property - def path(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + trailing_comments: _builtins.str + @_builtins.property + def path(self) -> _containers.RepeatedScalarFieldContainer[_builtins.int]: """Identifies which part of the FileDescriptorProto was defined at this location. @@ -2784,10 +2817,27 @@ class SourceCodeInfo(google.protobuf.message.Message): [ 4, 3, 2, 7 ] this path refers to the whole field declaration (from the beginning of the label to the terminating semicolon). + + For options, the path refers to the interpreted option in the descriptor. + E.g., for a custom option `(my_opt) = "foo"` on a message using extension + number 10101, the path is: + [ 4, 3, 7, 10101 ] + refers to: + file.message_type(3) // 4, 3 + .options() // 7 + .my_opt() // 10101 + + Sub-locations corresponding to the interpreted option's corresponding + `UninterpretedOption` are also appended to the interpreted option, which + deviates from the actual FileDescriptorProto path. E.g.: + [ 4, 3, 7, 10101, 2 ] + refers to the option name `(my_opt)`, and: + [ 4, 3, 7, 10101, 7 ] + refers to the "foo" string value of the option. """ - @property - def span(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + @_builtins.property + def span(self) -> _containers.RepeatedScalarFieldContainer[_builtins.int]: """Always has exactly three or four elements: start line, start column, end line (optional, otherwise assumed same as start line), end column. These are packed into a single field for efficiency. Note that line @@ -2795,39 +2845,39 @@ class SourceCodeInfo(google.protobuf.message.Message): 1 to each before displaying to a user. """ - @property - def leading_detached_comments(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + @_builtins.property + def leading_detached_comments(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: ... def __init__( self, *, - 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.Literal["leading_comments", b"leading_comments", "trailing_comments", b"trailing_comments"] - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "leading_comments", - b"leading_comments", - "leading_detached_comments", - b"leading_detached_comments", - "path", - b"path", - "span", - b"span", - "trailing_comments", - b"trailing_comments", - ], + path: _abc.Iterable[_builtins.int] | None = ..., + span: _abc.Iterable[_builtins.int] | None = ..., + leading_comments: _builtins.str | None = ..., + trailing_comments: _builtins.str | None = ..., + leading_detached_comments: _abc.Iterable[_builtins.str] | None = ..., ) -> None: ... - - LOCATION_FIELD_NUMBER: builtins.int - @property - def location(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SourceCodeInfo.Location]: + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "leading_comments", b"leading_comments", "trailing_comments", b"trailing_comments" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "leading_comments", + b"leading_comments", + "leading_detached_comments", + b"leading_detached_comments", + "path", + b"path", + "span", + b"span", + "trailing_comments", + b"trailing_comments", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + LOCATION_FIELD_NUMBER: _builtins.int + @_builtins.property + def location(self) -> _containers.RepeatedCompositeFieldContainer[Global___SourceCodeInfo.Location]: """A Location identifies a piece of source code in a .proto file which corresponds to a particular definition. This information is intended to be useful to IDEs, code indexers, documentation generators, and similar @@ -2873,33 +2923,36 @@ class SourceCodeInfo(google.protobuf.message.Message): be recorded in the future. """ - def __init__(self, *, location: collections.abc.Iterable[global___SourceCodeInfo.Location] | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["location", b"location"]) -> None: ... + def __init__(self, *, location: _abc.Iterable[Global___SourceCodeInfo.Location] | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["location", b"location"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___SourceCodeInfo = SourceCodeInfo +Global___SourceCodeInfo: _TypeAlias = SourceCodeInfo # noqa: Y015 -@typing.final -class GeneratedCodeInfo(google.protobuf.message.Message): +@_typing.final +class GeneratedCodeInfo(_message.Message): """Describes the relationship between generated code and its original source 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 + DESCRIPTOR: _descriptor.Descriptor - @typing.final - class Annotation(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor + @_typing.final + class Annotation(_message.Message): + DESCRIPTOR: _descriptor.Descriptor class _Semantic: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 class _SemanticEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[GeneratedCodeInfo.Annotation._Semantic.ValueType], - builtins.type, + _enum_type_wrapper._EnumTypeWrapper[GeneratedCodeInfo.Annotation._Semantic.ValueType], _builtins.type ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DESCRIPTOR: _descriptor.EnumDescriptor NONE: GeneratedCodeInfo.Annotation._Semantic.ValueType # 0 """There is no effect or the effect is indescribable.""" SET: GeneratedCodeInfo.Annotation._Semantic.ValueType # 1 @@ -2919,25 +2972,25 @@ class GeneratedCodeInfo(google.protobuf.message.Message): ALIAS: GeneratedCodeInfo.Annotation.Semantic.ValueType # 2 """An alias to the element is returned.""" - PATH_FIELD_NUMBER: builtins.int - SOURCE_FILE_FIELD_NUMBER: builtins.int - BEGIN_FIELD_NUMBER: builtins.int - END_FIELD_NUMBER: builtins.int - SEMANTIC_FIELD_NUMBER: builtins.int - source_file: builtins.str + PATH_FIELD_NUMBER: _builtins.int + SOURCE_FILE_FIELD_NUMBER: _builtins.int + BEGIN_FIELD_NUMBER: _builtins.int + END_FIELD_NUMBER: _builtins.int + SEMANTIC_FIELD_NUMBER: _builtins.int + source_file: _builtins.str """Identifies the filesystem path to the original source .proto.""" - begin: builtins.int + begin: _builtins.int """Identifies the starting offset in bytes in the generated code that relates to the identified object. """ - end: builtins.int + end: _builtins.int """Identifies the ending offset in bytes in the generated code that relates to the identified object. The end offset should be one past the last relevant byte (so the length of the text = end - begin). """ - semantic: global___GeneratedCodeInfo.Annotation.Semantic.ValueType - @property - def path(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: + semantic: Global___GeneratedCodeInfo.Annotation.Semantic.ValueType + @_builtins.property + def path(self) -> _containers.RepeatedScalarFieldContainer[_builtins.int]: """Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path. """ @@ -2945,33 +2998,34 @@ class GeneratedCodeInfo(google.protobuf.message.Message): def __init__( self, *, - path: collections.abc.Iterable[builtins.int] | None = ..., - source_file: builtins.str | None = ..., - begin: builtins.int | None = ..., - end: builtins.int | None = ..., - semantic: global___GeneratedCodeInfo.Annotation.Semantic.ValueType | None = ..., + path: _abc.Iterable[_builtins.int] | None = ..., + source_file: _builtins.str | None = ..., + begin: _builtins.int | None = ..., + end: _builtins.int | None = ..., + semantic: Global___GeneratedCodeInfo.Annotation.Semantic.ValueType | None = ..., ) -> None: ... - def HasField( - self, - field_name: typing.Literal["begin", b"begin", "end", b"end", "semantic", b"semantic", "source_file", b"source_file"], - ) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "begin", b"begin", "end", b"end", "path", b"path", "semantic", b"semantic", "source_file", b"source_file" - ], - ) -> None: ... - - ANNOTATION_FIELD_NUMBER: builtins.int - @property - def annotation( - self, - ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___GeneratedCodeInfo.Annotation]: + _HasFieldArgType: _TypeAlias = _typing.Literal[ + "begin", b"begin", "end", b"end", "semantic", b"semantic", "source_file", b"source_file" + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "begin", b"begin", "end", b"end", "path", b"path", "semantic", b"semantic", "source_file", b"source_file" + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + ANNOTATION_FIELD_NUMBER: _builtins.int + @_builtins.property + def annotation(self) -> _containers.RepeatedCompositeFieldContainer[Global___GeneratedCodeInfo.Annotation]: """An Annotation connects some span of text in generated code to an element of its generating .proto file. """ - def __init__(self, *, annotation: collections.abc.Iterable[global___GeneratedCodeInfo.Annotation] | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["annotation", b"annotation"]) -> None: ... + def __init__(self, *, annotation: _abc.Iterable[Global___GeneratedCodeInfo.Annotation] | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["annotation", b"annotation"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___GeneratedCodeInfo = GeneratedCodeInfo +Global___GeneratedCodeInfo: _TypeAlias = GeneratedCodeInfo # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/duration_pb2.pyi b/stubs/protobuf/google/protobuf/duration_pb2.pyi index 2cb846889f4d..8687da88a035 100644 --- a/stubs/protobuf/google/protobuf/duration_pb2.pyi +++ b/stubs/protobuf/google/protobuf/duration_pb2.pyi @@ -32,17 +32,23 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import typing +import builtins as _builtins +import sys +import typing as _typing -import google.protobuf.descriptor -import google.protobuf.internal.well_known_types -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message +from google.protobuf.internal import well_known_types as _well_known_types -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -@typing.final -class Duration(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Duration): +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class Duration(_message.Message, _well_known_types.Duration): """A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" @@ -103,16 +109,16 @@ class Duration(google.protobuf.message.Message, google.protobuf.internal.well_kn microsecond should be expressed in JSON format as "3.000001s". """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - SECONDS_FIELD_NUMBER: builtins.int - NANOS_FIELD_NUMBER: builtins.int - seconds: builtins.int + SECONDS_FIELD_NUMBER: _builtins.int + NANOS_FIELD_NUMBER: _builtins.int + seconds: _builtins.int """Signed seconds of the span of time. Must be from -315,576,000,000 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 + 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 `seconds` field and a positive or negative `nanos` field. For durations @@ -120,7 +126,11 @@ 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, *, seconds: builtins.int | None = ..., nanos: builtins.int | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["nanos", b"nanos", "seconds", b"seconds"]) -> None: ... - -global___Duration = Duration + def __init__(self, *, seconds: _builtins.int | None = ..., nanos: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["nanos", b"nanos", "seconds", b"seconds"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Duration: _TypeAlias = Duration # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/empty_pb2.pyi b/stubs/protobuf/google/protobuf/empty_pb2.pyi index 317979279540..bb28da5c5e24 100644 --- a/stubs/protobuf/google/protobuf/empty_pb2.pyi +++ b/stubs/protobuf/google/protobuf/empty_pb2.pyi @@ -32,15 +32,22 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import typing +import builtins as _builtins +import sys +import typing as _typing -import google.protobuf.descriptor -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -@typing.final -class Empty(google.protobuf.message.Message): +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class Empty(_message.Message): """A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: @@ -50,8 +57,13 @@ class Empty(google.protobuf.message.Message): } """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor def __init__(self) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___Empty = Empty +Global___Empty: _TypeAlias = Empty # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi index 32d7594145a9..0167ac65bfe0 100644 --- a/stubs/protobuf/google/protobuf/field_mask_pb2.pyi +++ b/stubs/protobuf/google/protobuf/field_mask_pb2.pyi @@ -32,19 +32,24 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import collections.abc -import typing +import builtins as _builtins +import sys +import typing as _typing +from collections import abc as _abc -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.internal.well_known_types -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message +from google.protobuf.internal import containers as _containers, well_known_types as _well_known_types -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -@typing.final -class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_known_types.FieldMask): +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class FieldMask(_message.Message, _well_known_types.FieldMask): """`FieldMask` represents a set of symbolic field paths, for example: paths: "f.a" @@ -244,14 +249,18 @@ class FieldMask(google.protobuf.message.Message, google.protobuf.internal.well_k `INVALID_ARGUMENT` error if any path is unmappable. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - PATHS_FIELD_NUMBER: builtins.int - @property - def paths(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + PATHS_FIELD_NUMBER: _builtins.int + @_builtins.property + def paths(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: """The set of field mask paths.""" - def __init__(self, *, paths: collections.abc.Iterable[builtins.str] | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["paths", b"paths"]) -> None: ... + def __init__(self, *, paths: _abc.Iterable[_builtins.str] | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["paths", b"paths"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___FieldMask = FieldMask +Global___FieldMask: _TypeAlias = FieldMask # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/internal/encoder.pyi b/stubs/protobuf/google/protobuf/internal/encoder.pyi index 958de8f3f86f..6fc67317e418 100644 --- a/stubs/protobuf/google/protobuf/internal/encoder.pyi +++ b/stubs/protobuf/google/protobuf/internal/encoder.pyi @@ -1,34 +1,35 @@ from collections.abc import Callable -from typing import TypeAlias +from typing import Any, TypeAlias from google.protobuf.descriptor import FieldDescriptor -_Sizer: TypeAlias = Callable[[int, bool, bool], int] +_Sizer: TypeAlias = Callable[[Any], int] +_SizerFactory: TypeAlias = Callable[[int, bool, bool], _Sizer] -Int32Sizer: _Sizer -Int64Sizer: _Sizer -EnumSizer: _Sizer -UInt32Sizer: _Sizer -UInt64Sizer: _Sizer -SInt32Sizer: _Sizer -SInt64Sizer: _Sizer -Fixed32Sizer: _Sizer -SFixed32Sizer: _Sizer -FloatSizer: _Sizer -Fixed64Sizer: _Sizer -SFixed64Sizer: _Sizer -DoubleSizer: _Sizer -BoolSizer: _Sizer +Int32Sizer: _SizerFactory +Int64Sizer: _SizerFactory +EnumSizer: _SizerFactory +UInt32Sizer: _SizerFactory +UInt64Sizer: _SizerFactory +SInt32Sizer: _SizerFactory +SInt64Sizer: _SizerFactory +Fixed32Sizer: _SizerFactory +SFixed32Sizer: _SizerFactory +FloatSizer: _SizerFactory +Fixed64Sizer: _SizerFactory +SFixed64Sizer: _SizerFactory +DoubleSizer: _SizerFactory +BoolSizer: _SizerFactory def StringSizer(field_number: int, is_repeated: bool, is_packed: bool) -> _Sizer: ... def BytesSizer(field_number: int, is_repeated: bool, is_packed: bool) -> _Sizer: ... def GroupSizer(field_number: int, is_repeated: bool, is_packed: bool) -> _Sizer: ... def MessageSizer(field_number: int, is_repeated: bool, is_packed: bool) -> _Sizer: ... def MessageSetItemSizer(field_number: int) -> _Sizer: ... -def MapSizer(field_descriptor: FieldDescriptor, is_message_map: bool) -> _Sizer: ... +def MapSizer(field_descriptor: FieldDescriptor, key_sizer: _Sizer, value_sizer: _Sizer) -> _Sizer: ... def TagBytes(field_number: int, wire_type: int) -> bytes: ... -_Encoder: TypeAlias = Callable[[Callable[[bytes], int], bytes, bool], int] +_Encoder: TypeAlias = Callable[[Callable[[bytes], object], Any, bool], None] def Int32Encoder(field_number: int, is_repeated: bool, is_packed: bool) -> _Encoder: ... def Int64Encoder(field_number: int, is_repeated: bool, is_packed: bool) -> _Encoder: ... @@ -49,4 +50,6 @@ def BytesEncoder(field_number: int, is_repeated: bool, is_packed: bool) -> _Enco def GroupEncoder(field_number: int, is_repeated: bool, is_packed: bool) -> _Encoder: ... def MessageEncoder(field_number: int, is_repeated: bool, is_packed: bool) -> _Encoder: ... def MessageSetItemEncoder(field_number: int) -> _Encoder: ... -def MapEncoder(field_descriptor: FieldDescriptor) -> _Encoder: ... +def MapEncoder( + field_descriptor: FieldDescriptor, key_encoder: _Encoder, value_encoder: _Encoder, key_sizer: _Sizer, value_sizer: _Sizer +) -> _Encoder: ... diff --git a/stubs/protobuf/google/protobuf/json_enumvalue_options_pb2.pyi b/stubs/protobuf/google/protobuf/json_enumvalue_options_pb2.pyi new file mode 100644 index 000000000000..77c437664bd5 --- /dev/null +++ b/stubs/protobuf/google/protobuf/json_enumvalue_options_pb2.pyi @@ -0,0 +1,52 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Protocol Buffers - Google's data interchange format +Copyright 2026 Google LLC. All rights reserved. + +Use of this source code is governed by a BSD-style +license that can be found in the LICENSE file or at +https://developers.google.com/open-source/licenses/bsd +""" + +import builtins as _builtins +import sys +import typing as _typing + +from google.protobuf import descriptor as _descriptor, descriptor_pb2 as _descriptor_pb2, message as _message +from google.protobuf.internal import extension_dict as _extension_dict + +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never + +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class JsonEnumValueOptions(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + STRING_FIELD_NUMBER: _builtins.int + string: _builtins.str + """Allows user to specify a custom string to use when serializing an enum + value to JSON. + + Sample usage: + enum Foo { + ... + FOO_BAR = 42 [(pb.enumvalue.json).string = "my_custom_name"]; + } + """ + def __init__(self, *, string: _builtins.str | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["string", b"string"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["string", b"string"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___JsonEnumValueOptions: _TypeAlias = JsonEnumValueOptions # noqa: Y015 + +JSON_FIELD_NUMBER: _builtins.int +json: _extension_dict._ExtensionFieldDescriptor[_descriptor_pb2.EnumValueOptions, Global___JsonEnumValueOptions] diff --git a/stubs/protobuf/google/protobuf/json_options_pb2.pyi b/stubs/protobuf/google/protobuf/json_options_pb2.pyi new file mode 100644 index 000000000000..d98b441a9b4e --- /dev/null +++ b/stubs/protobuf/google/protobuf/json_options_pb2.pyi @@ -0,0 +1,9 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +A convenience proto that houses all JSON-related options.""" + +from google.protobuf import descriptor as _descriptor +from google.protobuf.json_enumvalue_options_pb2 import JsonEnumValueOptions as JsonEnumValueOptions, json as json + +DESCRIPTOR: _descriptor.FileDescriptor diff --git a/stubs/protobuf/google/protobuf/message.pyi b/stubs/protobuf/google/protobuf/message.pyi index bca40ddb4667..b78652b41648 100644 --- a/stubs/protobuf/google/protobuf/message.pyi +++ b/stubs/protobuf/google/protobuf/message.pyi @@ -47,3 +47,5 @@ class Message: def FromString(cls, s: bytes) -> Self: ... # TODO: check kwargs def __new__(cls, *args, **kwargs) -> Self: ... + +class FrozenInstanceError(AttributeError): ... diff --git a/stubs/protobuf/google/protobuf/source_context_pb2.pyi b/stubs/protobuf/google/protobuf/source_context_pb2.pyi index 9d74fb3d5926..fb9ae53b332a 100644 --- a/stubs/protobuf/google/protobuf/source_context_pb2.pyi +++ b/stubs/protobuf/google/protobuf/source_context_pb2.pyi @@ -32,28 +32,38 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import typing +import builtins as _builtins +import sys +import typing as _typing -import google.protobuf.descriptor -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -@typing.final -class SourceContext(google.protobuf.message.Message): +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class SourceContext(_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 + DESCRIPTOR: _descriptor.Descriptor - FILE_NAME_FIELD_NUMBER: builtins.int - file_name: builtins.str + FILE_NAME_FIELD_NUMBER: _builtins.int + 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, *, file_name: builtins.str | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["file_name", b"file_name"]) -> None: ... + def __init__(self, *, file_name: _builtins.str | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["file_name", b"file_name"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___SourceContext = SourceContext +Global___SourceContext: _TypeAlias = SourceContext # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/struct_pb2.pyi b/stubs/protobuf/google/protobuf/struct_pb2.pyi index deb905128c6d..14c9f68c2c97 100644 --- a/stubs/protobuf/google/protobuf/struct_pb2.pyi +++ b/stubs/protobuf/google/protobuf/struct_pb2.pyi @@ -32,30 +32,32 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import collections.abc +import builtins as _builtins import sys -import typing - -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 - -if sys.version_info >= (3, 10): - import typing as typing_extensions +import typing as _typing +from collections import abc as _abc + +from google.protobuf import descriptor as _descriptor, message as _message +from google.protobuf.internal import ( + containers as _containers, + enum_type_wrapper as _enum_type_wrapper, + well_known_types as _well_known_types, +) + +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias else: - import typing_extensions + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +DESCRIPTOR: _descriptor.FileDescriptor class _NullValue: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 -class _NullValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NullValue.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor +class _NullValueEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[_NullValue.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor NULL_VALUE: _NullValue.ValueType # 0 """Null value.""" @@ -66,17 +68,17 @@ class NullValue(_NullValue, metaclass=_NullValueEnumTypeWrapper): the null value for the `Value` type union. A field of type `NullValue` with any value other than `0` is considered - invalid. Most ProtoJSON serializers will emit a Value with a `null_value` set - as a JSON `null` regardless of the integer value, and so will round trip to - a `0` value. + invalid. Most ProtoJSON serializers will emit a `Value` with a `null_value` + set as a JSON `null` regardless of the integer value, and so will round trip + to a `0` value. """ NULL_VALUE: NullValue.ValueType # 0 """Null value.""" -global___NullValue = NullValue +Global___NullValue: _TypeAlias = NullValue # noqa: Y015 -@typing.final -class Struct(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Struct): +@_typing.final +class Struct(_message.Message, _well_known_types.Struct): """Represents a JSON object. An unordered key-value map, intending to perfectly capture the semantics of a @@ -92,33 +94,40 @@ class Struct(google.protobuf.message.Message, google.protobuf.internal.well_know typed message should be preferred instead of using this type. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - @typing.final - class FieldsEntry(google.protobuf.message.Message): - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - KEY_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - key: builtins.str - @property - def value(self) -> global___Value: ... - def __init__(self, *, key: builtins.str | None = ..., value: global___Value | None = ...) -> None: ... - def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - - FIELDS_FIELD_NUMBER: builtins.int - @property - def fields(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___Value]: + DESCRIPTOR: _descriptor.Descriptor + + @_typing.final + class FieldsEntry(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + KEY_FIELD_NUMBER: _builtins.int + VALUE_FIELD_NUMBER: _builtins.int + key: _builtins.str + @_builtins.property + def value(self) -> Global___Value: ... + def __init__(self, *, key: _builtins.str | None = ..., value: Global___Value | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + + FIELDS_FIELD_NUMBER: _builtins.int + @_builtins.property + def fields(self) -> _containers.MessageMap[_builtins.str, Global___Value]: """Unordered map of dynamically typed values.""" - def __init__(self, *, fields: collections.abc.Mapping[builtins.str, global___Value] | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["fields", b"fields"]) -> None: ... + def __init__(self, *, fields: _abc.Mapping[_builtins.str, Global___Value] | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["fields", b"fields"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___Struct = Struct +Global___Struct: _TypeAlias = Struct # noqa: Y015 -@typing.final -class Value(google.protobuf.message.Message): +@_typing.final +class Value(_message.Message): """Represents a JSON value. `Value` represents a dynamically typed value which can be either @@ -127,100 +136,102 @@ class Value(google.protobuf.message.Message): variants. Absence of any variant is an invalid state. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - NULL_VALUE_FIELD_NUMBER: builtins.int - NUMBER_VALUE_FIELD_NUMBER: builtins.int - STRING_VALUE_FIELD_NUMBER: builtins.int - BOOL_VALUE_FIELD_NUMBER: builtins.int - STRUCT_VALUE_FIELD_NUMBER: builtins.int - LIST_VALUE_FIELD_NUMBER: builtins.int - null_value: global___NullValue.ValueType + NULL_VALUE_FIELD_NUMBER: _builtins.int + NUMBER_VALUE_FIELD_NUMBER: _builtins.int + STRING_VALUE_FIELD_NUMBER: _builtins.int + BOOL_VALUE_FIELD_NUMBER: _builtins.int + STRUCT_VALUE_FIELD_NUMBER: _builtins.int + LIST_VALUE_FIELD_NUMBER: _builtins.int + null_value: Global___NullValue.ValueType """Represents a JSON `null`.""" - number_value: builtins.float + number_value: _builtins.float """Represents a JSON number. Must not be `NaN`, `Infinity` or `-Infinity`, since those are not supported in JSON. This also cannot represent large Int64 values, since JSON format generally does not support them in its number type. """ - string_value: builtins.str + string_value: _builtins.str """Represents a JSON string.""" - bool_value: builtins.bool + bool_value: _builtins.bool """Represents a JSON boolean (`true` or `false` literal in JSON).""" - @property - def struct_value(self) -> global___Struct: + @_builtins.property + def struct_value(self) -> Global___Struct: """Represents a JSON object.""" - @property - def list_value(self) -> global___ListValue: + @_builtins.property + def list_value(self) -> Global___ListValue: """Represents a JSON array.""" def __init__( self, *, - 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 = ..., + 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.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.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.Literal["kind", b"kind"] - ) -> typing.Literal["null_value", "number_value", "string_value", "bool_value", "struct_value", "list_value"] | None: ... - -global___Value = Value - -@typing.final -class ListValue(google.protobuf.message.Message, google.protobuf.internal.well_known_types.ListValue): + _HasFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + _WhichOneofReturnType_kind: _TypeAlias = _typing.Literal[ + "null_value", "number_value", "string_value", "bool_value", "struct_value", "list_value" + ] # noqa: Y015 + _WhichOneofArgType_kind: _TypeAlias = _typing.Literal["kind", b"kind"] # noqa: Y015 + def WhichOneof(self, oneof_group: _WhichOneofArgType_kind) -> _WhichOneofReturnType_kind | None: ... + +Global___Value: _TypeAlias = Value # noqa: Y015 + +@_typing.final +class ListValue(_message.Message, _well_known_types.ListValue): """Represents a JSON array.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUES_FIELD_NUMBER: builtins.int - @property - def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Value]: + VALUES_FIELD_NUMBER: _builtins.int + @_builtins.property + def values(self) -> _containers.RepeatedCompositeFieldContainer[Global___Value]: """Repeated field of dynamically typed values.""" - def __init__(self, *, values: collections.abc.Iterable[global___Value] | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["values", b"values"]) -> None: ... + def __init__(self, *, values: _abc.Iterable[Global___Value] | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["values", b"values"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___ListValue = ListValue +Global___ListValue: _TypeAlias = ListValue # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi index ac976d88455b..47c131039a6f 100644 --- a/stubs/protobuf/google/protobuf/timestamp_pb2.pyi +++ b/stubs/protobuf/google/protobuf/timestamp_pb2.pyi @@ -32,17 +32,23 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import typing +import builtins as _builtins +import sys +import typing as _typing -import google.protobuf.descriptor -import google.protobuf.internal.well_known_types -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message +from google.protobuf.internal import well_known_types as _well_known_types -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -@typing.final -class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_known_types.Timestamp): +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class Timestamp(_message.Message, _well_known_types.Timestamp): """A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on @@ -134,23 +140,27 @@ class Timestamp(google.protobuf.message.Message, google.protobuf.internal.well_k ) to obtain a formatter capable of generating timestamps in this format. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - SECONDS_FIELD_NUMBER: builtins.int - NANOS_FIELD_NUMBER: builtins.int - seconds: builtins.int + SECONDS_FIELD_NUMBER: _builtins.int + NANOS_FIELD_NUMBER: _builtins.int + seconds: _builtins.int """Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). """ - nanos: builtins.int + nanos: _builtins.int """Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. """ - def __init__(self, *, seconds: builtins.int | None = ..., nanos: builtins.int | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["nanos", b"nanos", "seconds", b"seconds"]) -> None: ... - -global___Timestamp = Timestamp + def __init__(self, *, seconds: _builtins.int | None = ..., nanos: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["nanos", b"nanos", "seconds", b"seconds"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Timestamp: _TypeAlias = Timestamp # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/type_pb2.pyi b/stubs/protobuf/google/protobuf/type_pb2.pyi index a8a7eb07c778..8c14bbab3c1b 100644 --- a/stubs/protobuf/google/protobuf/type_pb2.pyi +++ b/stubs/protobuf/google/protobuf/type_pb2.pyi @@ -32,31 +32,33 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -import builtins -import collections.abc +import builtins as _builtins import sys -import typing - -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 - -if sys.version_info >= (3, 10): - import typing as typing_extensions +import typing as _typing +from collections import abc as _abc + +from google.protobuf import ( + any_pb2 as _any_pb2, + descriptor as _descriptor, + message as _message, + source_context_pb2 as _source_context_pb2, +) +from google.protobuf.internal import containers as _containers, enum_type_wrapper as _enum_type_wrapper + +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias else: - import typing_extensions + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +DESCRIPTOR: _descriptor.FileDescriptor class _Syntax: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 -class _SyntaxEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Syntax.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor +class _SyntaxEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[_Syntax.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor SYNTAX_PROTO2: _Syntax.ValueType # 0 """Syntax `proto2`.""" SYNTAX_PROTO3: _Syntax.ValueType # 1 @@ -73,10 +75,10 @@ SYNTAX_PROTO3: Syntax.ValueType # 1 """Syntax `proto3`.""" SYNTAX_EDITIONS: Syntax.ValueType # 2 """Syntax `editions`.""" -global___Syntax = Syntax +Global___Syntax: _TypeAlias = Syntax # noqa: Y015 -@typing.final -class Type(google.protobuf.message.Message): +@_typing.final +class Type(_message.Message): """A protocol buffer message type. New usages of this message as an alternative to DescriptorProto are strongly @@ -85,73 +87,73 @@ class Type(google.protobuf.message.Message): FileDescriptorSet which preserves the necessary information. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _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 - EDITION_FIELD_NUMBER: builtins.int - name: builtins.str + 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 + EDITION_FIELD_NUMBER: _builtins.int + name: _builtins.str """The fully qualified message name.""" - syntax: global___Syntax.ValueType + syntax: Global___Syntax.ValueType """The source syntax.""" - edition: builtins.str + edition: _builtins.str """The source edition string, only valid when syntax is SYNTAX_EDITIONS.""" - @property - def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Field]: + @_builtins.property + def fields(self) -> _containers.RepeatedCompositeFieldContainer[Global___Field]: """The list of fields.""" - @property - def oneofs(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + @_builtins.property + def oneofs(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: """The list of types appearing in `oneof` definitions in this type.""" - @property - def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: + @_builtins.property + def options(self) -> _containers.RepeatedCompositeFieldContainer[Global___Option]: """The protocol buffer options.""" - @property - def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: + @_builtins.property + def source_context(self) -> _source_context_pb2.SourceContext: """The source context.""" def __init__( self, *, - 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 = ..., - edition: builtins.str | None = ..., - ) -> None: ... - def HasField(self, field_name: typing.Literal["source_context", b"source_context"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "edition", - b"edition", - "fields", - b"fields", - "name", - b"name", - "oneofs", - b"oneofs", - "options", - b"options", - "source_context", - b"source_context", - "syntax", - b"syntax", - ], + name: _builtins.str | None = ..., + fields: _abc.Iterable[Global___Field] | None = ..., + oneofs: _abc.Iterable[_builtins.str] | None = ..., + options: _abc.Iterable[Global___Option] | None = ..., + source_context: _source_context_pb2.SourceContext | None = ..., + syntax: Global___Syntax.ValueType | None = ..., + edition: _builtins.str | None = ..., ) -> None: ... - -global___Type = Type - -@typing.final -class Field(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal["source_context", b"source_context"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "edition", + b"edition", + "fields", + b"fields", + "name", + b"name", + "oneofs", + b"oneofs", + "options", + b"options", + "source_context", + b"source_context", + "syntax", + b"syntax", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Type: _TypeAlias = Type # noqa: Y015 + +@_typing.final +class Field(_message.Message): """A single field of a message type. New usages of this message as an alternative to FieldDescriptorProto are @@ -160,14 +162,14 @@ class Field(google.protobuf.message.Message): make use of FileDescriptorSet which preserves the necessary information. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor class _Kind: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Kind.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _KindEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[Field._Kind.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor TYPE_UNKNOWN: Field._Kind.ValueType # 0 """Field type unknown.""" TYPE_DOUBLE: Field._Kind.ValueType # 1 @@ -250,13 +252,11 @@ class Field(google.protobuf.message.Message): """Field type sint64.""" class _Cardinality: - ValueType = typing.NewType("ValueType", builtins.int) - V: typing_extensions.TypeAlias = ValueType + ValueType = _typing.NewType("ValueType", _builtins.int) + V: _TypeAlias = ValueType # noqa: Y015 - class _CardinalityEnumTypeWrapper( - google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Field._Cardinality.ValueType], builtins.type - ): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + class _CardinalityEnumTypeWrapper(_enum_type_wrapper._EnumTypeWrapper[Field._Cardinality.ValueType], _builtins.type): + DESCRIPTOR: _descriptor.EnumDescriptor CARDINALITY_UNKNOWN: Field._Cardinality.ValueType # 0 """For fields with unknown cardinality.""" CARDINALITY_OPTIONAL: Field._Cardinality.ValueType # 1 @@ -278,86 +278,87 @@ class Field(google.protobuf.message.Message): CARDINALITY_REPEATED: Field.Cardinality.ValueType # 3 """For repeated fields.""" - KIND_FIELD_NUMBER: builtins.int - CARDINALITY_FIELD_NUMBER: builtins.int - NUMBER_FIELD_NUMBER: builtins.int - NAME_FIELD_NUMBER: builtins.int - TYPE_URL_FIELD_NUMBER: builtins.int - ONEOF_INDEX_FIELD_NUMBER: builtins.int - PACKED_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - JSON_NAME_FIELD_NUMBER: builtins.int - DEFAULT_VALUE_FIELD_NUMBER: builtins.int - kind: global___Field.Kind.ValueType + KIND_FIELD_NUMBER: _builtins.int + CARDINALITY_FIELD_NUMBER: _builtins.int + NUMBER_FIELD_NUMBER: _builtins.int + NAME_FIELD_NUMBER: _builtins.int + TYPE_URL_FIELD_NUMBER: _builtins.int + ONEOF_INDEX_FIELD_NUMBER: _builtins.int + PACKED_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + JSON_NAME_FIELD_NUMBER: _builtins.int + DEFAULT_VALUE_FIELD_NUMBER: _builtins.int + kind: Global___Field.Kind.ValueType """The field type.""" - cardinality: global___Field.Cardinality.ValueType + cardinality: Global___Field.Cardinality.ValueType """The field cardinality.""" - number: builtins.int + number: _builtins.int """The field number.""" - name: builtins.str + name: _builtins.str """The field name.""" - type_url: builtins.str + 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 + 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 + packed: _builtins.bool """Whether to use alternative packed wire representation.""" - json_name: builtins.str + json_name: _builtins.str """The field JSON name.""" - default_value: builtins.str + default_value: _builtins.str """The string value of the default value of this field. Proto2 syntax only.""" - @property - def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: + @_builtins.property + def options(self) -> _containers.RepeatedCompositeFieldContainer[Global___Option]: """The protocol buffer options.""" def __init__( self, *, - 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.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", - ], + 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: _abc.Iterable[Global___Option] | None = ..., + json_name: _builtins.str | None = ..., + default_value: _builtins.str | None = ..., ) -> None: ... - -global___Field = Field - -@typing.final -class Enum(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.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", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Field: _TypeAlias = Field # noqa: Y015 + +@_typing.final +class Enum(_message.Message): """Enum type definition. New usages of this message as an alternative to EnumDescriptorProto are @@ -366,65 +367,65 @@ class Enum(google.protobuf.message.Message): make use of FileDescriptorSet which preserves the necessary information. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _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 - EDITION_FIELD_NUMBER: builtins.int - name: builtins.str + 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 + EDITION_FIELD_NUMBER: _builtins.int + name: _builtins.str """Enum type name.""" - syntax: global___Syntax.ValueType + syntax: Global___Syntax.ValueType """The source syntax.""" - edition: builtins.str + edition: _builtins.str """The source edition string, only valid when syntax is SYNTAX_EDITIONS.""" - @property - def enumvalue(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnumValue]: + @_builtins.property + def enumvalue(self) -> _containers.RepeatedCompositeFieldContainer[Global___EnumValue]: """Enum value definitions.""" - @property - def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: + @_builtins.property + def options(self) -> _containers.RepeatedCompositeFieldContainer[Global___Option]: """Protocol buffer options.""" - @property - def source_context(self) -> google.protobuf.source_context_pb2.SourceContext: + @_builtins.property + def source_context(self) -> _source_context_pb2.SourceContext: """The source context.""" def __init__( self, *, - 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 = ..., - edition: builtins.str | None = ..., + name: _builtins.str | None = ..., + enumvalue: _abc.Iterable[Global___EnumValue] | None = ..., + options: _abc.Iterable[Global___Option] | None = ..., + source_context: _source_context_pb2.SourceContext | None = ..., + syntax: Global___Syntax.ValueType | None = ..., + edition: _builtins.str | None = ..., ) -> None: ... - def HasField(self, field_name: typing.Literal["source_context", b"source_context"]) -> builtins.bool: ... - def ClearField( - self, - field_name: typing.Literal[ - "edition", - b"edition", - "enumvalue", - b"enumvalue", - "name", - b"name", - "options", - b"options", - "source_context", - b"source_context", - "syntax", - b"syntax", - ], - ) -> None: ... - -global___Enum = Enum - -@typing.final -class EnumValue(google.protobuf.message.Message): + _HasFieldArgType: _TypeAlias = _typing.Literal["source_context", b"source_context"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal[ + "edition", + b"edition", + "enumvalue", + b"enumvalue", + "name", + b"name", + "options", + b"options", + "source_context", + b"source_context", + "syntax", + b"syntax", + ] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___Enum: _TypeAlias = Enum # noqa: Y015 + +@_typing.final +class EnumValue(_message.Message): """Enum value definition. New usages of this message as an alternative to EnumValueDescriptorProto are @@ -433,32 +434,36 @@ class EnumValue(google.protobuf.message.Message): make use of FileDescriptorSet which preserves the necessary information. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - NUMBER_FIELD_NUMBER: builtins.int - OPTIONS_FIELD_NUMBER: builtins.int - name: builtins.str + NAME_FIELD_NUMBER: _builtins.int + NUMBER_FIELD_NUMBER: _builtins.int + OPTIONS_FIELD_NUMBER: _builtins.int + name: _builtins.str """Enum value name.""" - number: builtins.int + number: _builtins.int """Enum value number.""" - @property - def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Option]: + @_builtins.property + def options(self) -> _containers.RepeatedCompositeFieldContainer[Global___Option]: """Protocol buffer options.""" def __init__( self, *, - name: builtins.str | None = ..., - number: builtins.int | None = ..., - options: collections.abc.Iterable[global___Option] | None = ..., + name: _builtins.str | None = ..., + number: _builtins.int | None = ..., + options: _abc.Iterable[Global___Option] | None = ..., ) -> None: ... - def ClearField(self, field_name: typing.Literal["name", b"name", "number", b"number", "options", b"options"]) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "number", b"number", "options", b"options"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___EnumValue = EnumValue +Global___EnumValue: _TypeAlias = EnumValue # noqa: Y015 -@typing.final -class Option(google.protobuf.message.Message): +@_typing.final +class Option(_message.Message): """A protocol buffer option, which can be attached to a message, field, enumeration, etc. @@ -467,26 +472,29 @@ class Option(google.protobuf.message.Message): are strongly discouraged. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - name: builtins.str + NAME_FIELD_NUMBER: _builtins.int + VALUE_FIELD_NUMBER: _builtins.int + 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: + @_builtins.property + def value(self) -> _any_pb2.Any: """The option's value packed in an Any message. If the value is a primitive, the corresponding wrapper type defined in google/protobuf/wrappers.proto should be used. If the value is an enum, it should be stored as an int32 value using the google.protobuf.Int32Value type. """ - def __init__(self, *, name: builtins.str | None = ..., value: google.protobuf.any_pb2.Any | None = ...) -> None: ... - def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... - def ClearField(self, field_name: typing.Literal["name", b"name", "value", b"value"]) -> None: ... + def __init__(self, *, name: _builtins.str | None = ..., value: _any_pb2.Any | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["name", b"name", "value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___Option = Option +Global___Option: _TypeAlias = Option # noqa: Y015 diff --git a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi index b3d875bccf67..390e219c84cf 100644 --- a/stubs/protobuf/google/protobuf/wrappers_pb2.pyi +++ b/stubs/protobuf/google/protobuf/wrappers_pb2.pyi @@ -49,16 +49,22 @@ 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 typing +import builtins as _builtins +import sys +import typing as _typing -import google.protobuf.descriptor -import google.protobuf.message +from google.protobuf import descriptor as _descriptor, message as _message -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor +if sys.version_info >= (3, 11): + from typing import Never as _Never, TypeAlias as _TypeAlias +else: + from typing import TypeAlias as _TypeAlias + from typing_extensions import Never as _Never -@typing.final -class DoubleValue(google.protobuf.message.Message): +DESCRIPTOR: _descriptor.FileDescriptor + +@_typing.final +class DoubleValue(_message.Message): """Wrapper message for `double`. The JSON representation for `DoubleValue` is JSON number. @@ -67,18 +73,22 @@ class DoubleValue(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.float + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.float """The double value.""" - def __init__(self, *, value: builtins.float | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.float | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___DoubleValue = DoubleValue +Global___DoubleValue: _TypeAlias = DoubleValue # noqa: Y015 -@typing.final -class FloatValue(google.protobuf.message.Message): +@_typing.final +class FloatValue(_message.Message): """Wrapper message for `float`. The JSON representation for `FloatValue` is JSON number. @@ -87,18 +97,22 @@ class FloatValue(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.float + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.float """The float value.""" - def __init__(self, *, value: builtins.float | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.float | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___FloatValue = FloatValue +Global___FloatValue: _TypeAlias = FloatValue # noqa: Y015 -@typing.final -class Int64Value(google.protobuf.message.Message): +@_typing.final +class Int64Value(_message.Message): """Wrapper message for `int64`. The JSON representation for `Int64Value` is JSON string. @@ -107,18 +121,22 @@ class Int64Value(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.int + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.int """The int64 value.""" - def __init__(self, *, value: builtins.int | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___Int64Value = Int64Value +Global___Int64Value: _TypeAlias = Int64Value # noqa: Y015 -@typing.final -class UInt64Value(google.protobuf.message.Message): +@_typing.final +class UInt64Value(_message.Message): """Wrapper message for `uint64`. The JSON representation for `UInt64Value` is JSON string. @@ -127,18 +145,22 @@ class UInt64Value(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.int + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.int """The uint64 value.""" - def __init__(self, *, value: builtins.int | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___UInt64Value = UInt64Value +Global___UInt64Value: _TypeAlias = UInt64Value # noqa: Y015 -@typing.final -class Int32Value(google.protobuf.message.Message): +@_typing.final +class Int32Value(_message.Message): """Wrapper message for `int32`. The JSON representation for `Int32Value` is JSON number. @@ -147,18 +169,22 @@ class Int32Value(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.int + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.int """The int32 value.""" - def __init__(self, *, value: builtins.int | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___Int32Value = Int32Value +Global___Int32Value: _TypeAlias = Int32Value # noqa: Y015 -@typing.final -class UInt32Value(google.protobuf.message.Message): +@_typing.final +class UInt32Value(_message.Message): """Wrapper message for `uint32`. The JSON representation for `UInt32Value` is JSON number. @@ -167,18 +193,22 @@ class UInt32Value(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.int + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.int """The uint32 value.""" - def __init__(self, *, value: builtins.int | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.int | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___UInt32Value = UInt32Value +Global___UInt32Value: _TypeAlias = UInt32Value # noqa: Y015 -@typing.final -class BoolValue(google.protobuf.message.Message): +@_typing.final +class BoolValue(_message.Message): """Wrapper message for `bool`. The JSON representation for `BoolValue` is JSON `true` and `false`. @@ -187,18 +217,22 @@ class BoolValue(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.bool + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.bool """The bool value.""" - def __init__(self, *, value: builtins.bool | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.bool | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___BoolValue = BoolValue +Global___BoolValue: _TypeAlias = BoolValue # noqa: Y015 -@typing.final -class StringValue(google.protobuf.message.Message): +@_typing.final +class StringValue(_message.Message): """Wrapper message for `string`. The JSON representation for `StringValue` is JSON string. @@ -207,18 +241,22 @@ class StringValue(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.str + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.str """The string value.""" - def __init__(self, *, value: builtins.str | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... + def __init__(self, *, value: _builtins.str | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... -global___StringValue = StringValue +Global___StringValue: _TypeAlias = StringValue # noqa: Y015 -@typing.final -class BytesValue(google.protobuf.message.Message): +@_typing.final +class BytesValue(_message.Message): """Wrapper message for `bytes`. The JSON representation for `BytesValue` is JSON string. @@ -227,12 +265,16 @@ class BytesValue(google.protobuf.message.Message): has no plan to be removed. """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTOR: _descriptor.Descriptor - VALUE_FIELD_NUMBER: builtins.int - value: builtins.bytes + VALUE_FIELD_NUMBER: _builtins.int + value: _builtins.bytes """The bytes value.""" - def __init__(self, *, value: builtins.bytes | None = ...) -> None: ... - def ClearField(self, field_name: typing.Literal["value", b"value"]) -> None: ... - -global___BytesValue = BytesValue + def __init__(self, *, value: _builtins.bytes | None = ...) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___BytesValue: _TypeAlias = BytesValue # noqa: Y015