File: //opt/cppython/lib/python3.8/site-packages/google/protobuf/__pycache__/proto_json.cpython-38.pyc
U
ID�g � @ s~ d Z ddlmZmZ ddlmZ ddlmZ ddlm Z dee
e
e
ee eed�d d
�Z
dee ee
ee eed�d
d�ZdS )z1Contains the Nextgen Pythonic Protobuf JSON APIs.� )�Optional�Type)�Message)�DescriptorPool)�json_formatFN)�message�$always_print_fields_with_no_presence�preserving_proto_field_name�use_integers_for_enums�descriptor_pool�float_precision�returnc C s t j| ||||d�S )a� Converts protobuf message to a dictionary.
When the dictionary is encoded to JSON, it conforms to proto3 JSON spec.
Args:
message: The protocol buffers message instance to serialize.
always_print_fields_with_no_presence: If True, fields without
presence (implicit presence scalars, repeated fields, and map fields) will
always be serialized. Any field that supports presence is not affected by
this option (including singular message fields and oneof fields).
preserving_proto_field_name: If True, use the original proto field names as
defined in the .proto file. If False, convert the field names to
lowerCamelCase.
use_integers_for_enums: If true, print integers instead of enum names.
descriptor_pool: A Descriptor Pool for resolving types. If None use the
default.
float_precision: If set, use this to specify float field valid digits.
Returns:
A dict representation of the protocol buffer message.
)r r r
r )r Z
MessageToDict)r r r r
r r � r �G/opt/cppython/lib/python3.8/site-packages/google/protobuf/proto_json.py� serialize s �r �d )�
message_class�js_dict�ignore_unknown_fieldsr �max_recursion_depthr
c C s | � }t j|||||d� |S )a- Parses a JSON dictionary representation into a message.
Args:
message_class: The message meta class.
js_dict: Dict representation of a JSON message.
ignore_unknown_fields: If True, do not raise errors for unknown fields.
descriptor_pool: A Descriptor Pool for resolving types. If None use the
default.
max_recursion_depth: max recursion depth of JSON message to be deserialized.
JSON messages over this depth will fail to be deserialized. Default value
is 100.
Returns:
A new message passed from json_dict.
)r r r r r )r Z ParseDict)r r r r r Znew_messager r r �parse5 s �r )FFFNN)FNr )�__doc__�typingr r Zgoogle.protobuf.messager Zgoogle.protobuf.descriptor_poolr Zgoogle.protobufr �bool�int�dictr r r r r r �<module> s: ��( ��