-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathjson_format.pyi
More file actions
43 lines (39 loc) · 1.32 KB
/
json_format.pyi
File metadata and controls
43 lines (39 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from typing import Any, TypeVar
from google.protobuf.descriptor_pool import DescriptorPool
from google.protobuf.message import Message
_MessageT = TypeVar("_MessageT", bound=Message)
class Error(Exception): ...
class SerializeToJsonError(Error): ...
class ParseError(Error): ...
class EnumStringValueParseError(ParseError): ...
def MessageToJson(
message: Message,
preserving_proto_field_name: bool = False,
indent: int | None = 2,
sort_keys: bool = False,
use_integers_for_enums: bool = False,
descriptor_pool: DescriptorPool | None = None,
ensure_ascii: bool = True,
always_print_fields_with_no_presence: bool = False,
) -> str: ...
def MessageToDict(
message: Message,
always_print_fields_with_no_presence: bool = False,
preserving_proto_field_name: bool = False,
use_integers_for_enums: bool = False,
descriptor_pool: DescriptorPool | None = None,
) -> dict[str, Any]: ...
def Parse(
text: bytes | str,
message: _MessageT,
ignore_unknown_fields: bool = False,
descriptor_pool: DescriptorPool | None = None,
max_recursion_depth: int = 100,
) -> _MessageT: ...
def ParseDict(
js_dict: dict[str, Any],
message: _MessageT,
ignore_unknown_fields: bool = False,
descriptor_pool: DescriptorPool | None = None,
max_recursion_depth: int = 100,
) -> _MessageT: ...