o
    {j6h                     @   s   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 					dded	e
d
e
de
dee dedefddZ			ddee dede
dee dedefddZdS )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   MessageToDict)r   r   r	   r
   r   r    r   i/var/www/html/chefvision.cloud.itp360.com/venv/lib/python3.10/site-packages/google/protobuf/proto_json.py	serialize   s   r   d   message_classjs_dictignore_unknown_fieldsmax_recursion_depthc                 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   	ParseDict)r   r   r   r   r   new_messager   r   r   parse5   s   r   )FFFNN)FNr   )__doc__typingr   r   google.protobuf.messager   google.protobuf.descriptor_poolr   google.protobufr   boolintdictr   r   r   r   r   r   <module>   sR   
(