HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/google/protobuf/__pycache__/json_format.cpython-311.pyc
�

�ncP�����dZdZddlZddlmZddlZddlZddlmZddl	Z	ddl
Z
ddlmZddl
mZddl
mZd	Zeejjejjejjejjg��Zeejjejjg��Zeejjejjg��Zd
ZdZdZe	jd
��Z e	jd��Z!Gd�de"��Z#Gd�de#��Z$Gd�de#��Z%								d4d�Z&					d5d�Z'd�Z(Gd�de)��Z*d�Z+d�Z,d�Z-			d6d!�Z.			d6d"�Z/e0e1fZ2Gd#�d$e)��Z3d7d%�Z4d&�Z5d'�Z6d(�Z7d)d*gd+d,gd+d,gd-d.gd/d0gd+d,gd1d2gd3�Z8dS)8atContains routines for printing protocol messages in JSON format.

Simple usage example:

  # Create a proto object and serialize it to a json format string.
  message = my_proto_pb2.MyMessage(foo='bar')
  json_string = json_format.MessageToJson(message)

  # Parse a json format string to proto object.
  message = json_format.Parse(json_string, my_proto_pb2.MyMessage())
zjieluo@google.com (Jie Luo)�N)�OrderedDict)�methodcaller)�
type_checkers)�
descriptor)�symbol_databasez%Y-%m-%dT%H:%M:%S�Infinityz	-Infinity�NaNu.[�-�](?![�-�])|(?<![�-�])[�-�]z\[[a-zA-Z0-9\._]*\]$c��eZdZdZdS)�Errorz'Top-level module error for json_format.N��__name__�
__module__�__qualname__�__doc__���=D:\Python311\Lib\site-packages\google/protobuf/json_format.pyrrNs������/�/�/�/rrc��eZdZdZdS)�SerializeToJsonErrorz&Thrown if serialization to JSON fails.NrrrrrrRs������.�.�.�.rrc��eZdZdZdS)�
ParseErrorz Thrown in case of parsing error.NrrrrrrVs������(�(�(�(rrF�Tc	�Z�t|||||���}	|	�||||��S)a�Converts protobuf message to JSON format.

  Args:
    message: The protocol buffers message instance to serialize.
    including_default_value_fields: If True, singular primitive fields,
        repeated fields, and map fields will always be serialized.  If
        False, only serialize non-empty fields.  Singular message fields
        and oneof fields are not affected by this option.
    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.
    indent: The JSON object will be pretty-printed with this indent level.
        An indent level of 0 or negative will only insert newlines.
    sort_keys: If True, then the output will be sorted by field names.
    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.
    ensure_ascii: If True, strings with non-ASCII characters are escaped.
        If False, Unicode strings are returned unchanged.

  Returns:
    A string containing the JSON formatted protocol buffer message.
  ��float_precision)�_Printer�ToJsonString)
�message�including_default_value_fields�preserving_proto_field_name�indent�	sort_keys�use_integers_for_enums�descriptor_poolr�ensure_ascii�printers
          r�
MessageToJsonr'ZsD��D
�$�!���%�
'�
'�
'�'�
�	�	�g�v�y�,�	G�	G�Grc�T�t|||||���}|�|��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.
    including_default_value_fields: If True, singular primitive fields,
        repeated fields, and map fields will always be serialized.  If
        False, only serialize non-empty fields.  Singular message fields
        and oneof fields are not affected by this option.
    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�_MessageToJsonObject)rrr r#r$rr&s       r�
MessageToDictr*�s=��8
�$�!���%�
'�
'�
'�'�
�	%�	%�g�	.�	.�.rc��|jtjjko)|jjo|j���jS�N)�typer�FieldDescriptor�TYPE_MESSAGE�message_type�has_options�
GetOptions�	map_entry)�fields r�_IsMapEntryr5�s?��
�*�
�2�?�
?�4�
�
�
(�4�
�
�
'�
'�
)�
)�
3�5rc�`�eZdZdZ					dd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
d�Zd�Zd
�Z
d�ZdS)rz)JSON format printer for protocol message.FNc��||_||_||_||_|rd�|��|_dSd|_dS)Nz.{}g)rr r#r$�format�float_format)�selfrr r#r$rs      r�__init__z_Printer.__init__�sU��+I�D�'�'B�D�$�"8�D��*�D���� �-�-��8�8�d�����d���rc�\�|�|��}tj||||���S)N)r!r"r%)r)�json�dumps)r:rr!r"r%�jss      rrz_Printer.ToJsonString�s;��	
�	"�	"�7�	+�	+�B��:�
�6�Y�\�K�K�K�Krc��|j}|j}t|��r|�|��S|tvr*tt|d|��|��Si}|�||��S)zEConverts message to an object according to Proto3 JSON Specification.r)�
DESCRIPTOR�	full_name�_IsWrapperMessage�_WrapperMessageToJsonObject�_WKTJSONMETHODSr�_RegularMessageToJsonObject)r:r�message_descriptorrBr?s     rr)z_Printer._MessageToJsonObject�s��� �+��"�,�I��+�,�,�7�
�
-�
-�g�
6�
6�6��O�#�H�
A�\�/�)�4�Q�7��
A�
A�$�
G�
G�G�	�B��+�+�G�R�8�8�8rc�B���|���}	|D�]\�}�jr�j}n�j}t	���rj�jjd}i}|D]M}t|t��r|rd}	nd}	nt|��}	��
|||��||	<�N|||<���jtj
jkr��fd�|D��||<�‰jr$d�jz}��
�|��||<���
�|��||<���jr�|j}
|
jD]���jtj
jkr�jtj
jks�jr�>�jr�j}n�j}||vr�Yt	���ri||<�n�jtj
jkrg||<����
��j��||<��n:#t0$r-}t3d��j|�����d}~wwxYw|S)z?Converts normal message according to Proto3 JSON Specification.�value�true�falsec�<��g|]}���|����Sr)�_FieldToJsonObject)�.0�kr4r:s  ��r�
<listcomp>z8_Printer._RegularMessageToJsonObject.<locals>.<listcomp>�s9���&�&�&���-�-�e�Q�7�7�&�&�&rz[%s]z#Failed to serialize {0} field: {1}.N)�
ListFieldsr �name�	json_namer5r0�fields_by_name�
isinstance�bool�strrM�labelrr.�LABEL_REPEATED�is_extensionrBrrA�fields�cpp_type�CPPTYPE_MESSAGE�containing_oneof�
default_value�
ValueErrorrr8)
r:rr?r[rIrR�v_field�js_map�key�recorded_keyrG�er4s
`           @rrFz$_Printer._RegularMessageToJsonObject�s�����
�
�
�
!�
!�F�8G� �;�;�,�%���+�	!���$�$���$��u���	;��&�5�g�>�'��&��	%�	%�c��#�t�$�$�
&��'�%���&��� ��X�X�l�#'�#:�#:���s��$%�$%�F�<� � ��"�T�(�(�
�[�J�6�E�
E�	;�&�&�&�&�&�$�&�&�&�"�T�(�(�
�
�	;��%�/�)�$��,�,�U�E�:�:�"�T�(�(��,�,�U�E�:�:�"�T�(�(�
�	,�K�$�/��'�.�	K�	K�E��{�j�8�G�G���~��!;�!K�K���$��
�
�
-�#��:�D�D��?�D�
�R�Z���
��
�
�K��B�t�H�H��{�j�8�G�G�K��B�t�H�H��.�.�u�e�6I�J�J�B�t�H�H����G�G�G� �
/�
6�
6�u�z�1�
E�
E�
G�
G�G�����G�����Is�GG%�%
H�/(H�Hc��|jtjjkr|�|��S|jtjjkre|jr|S|jjdkrdS|jj	�
|d��}|�|jS|jj
dkr|Std���|jtjjkrC|jtjjkr't%j|���d��S|S|jtjjkrt-|��S|jt.vrt1|��S|jt2vr�t5j|��r|dkrt8St:St5j|��rt>S|jtjj kr=|j!r"tEtG||j!����StIj%|��S|S)z<Converts field value according to Proto3 JSON Specification.�google.protobuf.NullValueN�proto3zKEnum field contains an integer value which can not mapped to an enum value.�utf-8g)&r\rr.r]r)�CPPTYPE_ENUMr#�	enum_typerB�values_by_number�getrR�file�syntaxr�CPPTYPE_STRINGr-�
TYPE_BYTES�base64�	b64encode�decode�CPPTYPE_BOOLrV�_INT64_TYPESrW�_FLOAT_TYPES�math�isinf�
_NEG_INFINITY�	_INFINITY�isnan�_NAN�
CPPTYPE_FLOATr9�floatr8r�ToShortestFloat)r:r4rI�
enum_values    rrMz_Printer._FieldToJsonObjects����~��3�C�C�%6�
�
&�
&�u�
-�
-�-�	��:�5�B�	B�#6�	
�	$����	��	"�&A�	A���t��?�3�7�7��t�D�D�j�	�M�����:���(�	��,�"�$L�M�M�	M�	��:�5�D�	D�6�	��z�1�<�	<�����&�&�-�-�g�6�6�6���	��:�5�B�	B�6�
�%�[�[��	��<�	'�6�
��Z�Z��	��<�	'�6�	
��E�	�	���3�;�	��
��
�	
��E�	�	����	��:�5�C�	C�6���	6��v�e�T�%6�7�7�8�8�
8��.�u�5�5�
5��Lrc���|���siSt��}|j}||d<t||j��}|�|j��|j}|j}t|��r|�
|��|d<|S|tvr/tt|d|��|��|d<|S|�
||��S)z<Converts Any message according to Proto3 JSON Specification.�@typerIr)rQr�type_url�_CreateMessageFromTypeUrlr$�ParseFromStringrIrArBrCrDrErrF)r:rr?r��sub_messagerGrBs       r�_AnyMessageToJsonObjectz _Printer._AnyMessageToJsonObject?s���������
�i�	���B���H��B�w�K�+�H�d�6J�K�K�K�����
�.�.�.�$�/��"�,�I��+�,�,���4�4�[�A�A�b��k�
�i��O�#��.�L���!;�A�!>�!,�.�.�.2�4�4�b��k�
�i��+�+�K��<�<�<rc�*�|���S)z8Converts message according to Proto3 JSON Specification.)r�r:rs  r�_GenericMessageToJsonObjectz$_Printer._GenericMessageToJsonObjectTs�����!�!�!rc��|�d��}|�|dkrdS|dkr|�|j��S|dkr|j}nt	||��}|jj|}|�||��S)z>Converts Value message according to Proto3 JSON Specification.�kindN�
null_value�
list_value�struct_value)�
WhichOneof�_ListValueMessageToJsonObjectr�r��getattrrArTrM)r:r�whichrI�oneof_descriptors     r�_ValueMessageToJsonObjectz"_Printer._ValueMessageToJsonObjectZs������v�&�&�E�
����-��
�T����D�
�
/�
/��0B�
C�
C�C����&��"�e�e��g�u�%�%�e��)�8��?���"�"�#3�U�;�;�;rc�*���fd�|jD��S)zBConverts ListValue message according to Proto3 JSON Specification.c�:��g|]}��|����Sr)r�)rNrIr:s  �rrPz:_Printer._ListValueMessageToJsonObject.<locals>.<listcomp>ls7���)�)�)��
�*�*�5�1�1�)�)�)r)�valuesr�s` rr�z&_Printer._ListValueMessageToJsonObjectjs0���)�)�)�)� ��)�)�)�)rc�^�|j}i}|D] }|�||��||<�!|S)z?Converts Struct message according to Proto3 JSON Specification.)r[r�)r:rr[�retrcs     r�_StructMessageToJsonObjectz#_Printer._StructMessageToJsonObjectos?��
�^�F�
�C��=�=���/�/��s��<�<�c�#�h�h��Jrc�X�|�|jjd|j��S)NrI)rMrArTrIr�s  rrDz$_Printer._WrapperMessageToJsonObjectws/���"�"���)�'�2�G�M�C�C�Cr�FFFNN)r
rrrr;rr)rFrMr�r�r�r�r�rDrrrrr�s�������1�1�&+�"'�"���
���� K�K�K�
	9�	9�	9�>�>�>�@)�)�)�V=�=�=�*"�"�"�<�<�<� )�)�)�
���C�C�C�C�Crrc�"�|jjdkS)Nzgoogle/protobuf/wrappers.proto)rnrR)rGs rrCrC|s��	�	 �	%�)I�	I�Irc�p�i}|D]0\}}||vr"td�|�����|||<�1|S)Nz'Failed to load JSON: duplicate key {0}.)rr8)r?�resultrRrIs    r�_DuplicateCheckerr��sT��
�&����k�d�E��v�~�O��@�G�G��M�M�N�N�N��F�4�L�L�	�-rc�@�tj��}|�|jn|}|�d��d}	|�|��}n0#t
$r#t
d�|�����wxYw|�|��}|��S)z"Creates a message from a type URL.N�/���z0Can not find message descriptor by type_url: {0})	r�Default�pool�split�FindMessageTypeByName�KeyError�	TypeErrorr8�GetPrototype)r�r$�dbr��	type_namerG�
message_classs       rr�r��s����� � �"�#�	@�����$��n�n�S�!�!�"�%�)�M��3�3�I�>�>����	�M�M�M�
�:�A�A�(�K�K�M�M�M�M�����/�/�"4�5�5�-�	����s�A�-A>�dc�8�t|t��s|�d��}	tj|t
���}nA#t$r4}td�t|�������d}~wwxYwt|||||��S)alParses a JSON representation of a protocol message into a message.

  Args:
    text: Message JSON representation.
    message: A protocol buffer message to merge into.
    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:
    The same message passed as argument.

  Raises::
    ParseError: On JSON parsing problems.
  ri)�object_pairs_hookzFailed to load JSON: {0}.N)
rUrWrtr=�loadsr�r`rr8�	ParseDict)�textr�ignore_unknown_fieldsr$�max_recursion_depthr?res       r�Parser��s���.
�D�#�	�	� ��;�;�w���D�A�	
��D�,=�	>�	>�	>�B�B��	�A�A�A�
�0�7�7��A���?�?�
@�
@�@�����A����	�2�w� 5��&�
(�
(�(s�A�
B�/B�Bc�V�t|||��}|�||d��|S)a8Parses a JSON dictionary representation into a message.

  Args:
    js_dict: Dict representation of a JSON message.
    message: A protocol buffer message to merge into.
    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:
    The same message passed as argument.
  �)�_Parser�ConvertMessage)�js_dictrr�r$r��parsers      rr�r��s4��(�(�/�;N�O�O�&������"�-�-�-�	�.rc�N�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
dS)
r�z(JSON format parser for protocol message.c�>�||_||_||_d|_dS)Nr)r�r$r��recursion_depth)r:r�r$r�s    rr;z_Parser.__init__�s(��!6�D��*�D��2�D���D���rc���|xjdz
c_|j|jkr'td�|j�����|j}|j}|s|j}t|��r|�|||��nM|tvr-tt|d|||��|��n|�|||��|xjdzc_dS)aConvert a JSON object into a message.

    Args:
      value: A JSON object.
      message: A WKT or regular protocol message to record the data.
      path: parent path to log parse error info.

    Raises:
      ParseError: In case of convert problems.
    �z,Message too deep. Max recursion depth is {0}N)r�r�rr8rArBrRrC�_ConvertWrapperMessagerEr�_ConvertFieldValuePair)r:rIr�pathrGrBs      rr�z_Parser.ConvertMessage�s
��	���A������d�6�6�%��E�L�L�
�
"�$�$�
%�
%�%� �+��"�,�I��%�
�
$�d��+�,�,�8�
�!�!�%��$�7�7�7�7�	�o�	%�8�G�l�?�9�-�a�0�%��$�G�G��M�M�M�M�
�!�!�%��$�7�7�7����A�����rc
���g}|j}td�|jD����}|D�]9}	|�|d��}|s|j�|d��}|s�t
�|��r�|js(td�	|j
|�����|dd�}	|j�|	��}|sJd�
|	�d��dd���}	|j�|	��}|sA|jr��td�	|j
||d�|jD�������||vr.td	�	|jj
||�����|�|��||}
|j�U|
�S|jj}||vr.td
�	|jj
||�����|�|��|
��|jt(jjkr-|jj
dkrt1||j��}d|_n[|jt(jjkr'|jj
d
krt9||jd��n|�|j�����t=|��rH|�|j��|�|
||d�	||�����n�|j t(jj!k�r�|�|j��tE|
tF��s$td�	||
|�����|jt(jjkr�tI|
��D]�\}
}t1||j���%��}|�4|jj
dkr$td�	|||
�����|�&||d�	|||
�������nztI|
��D]w\}
}|�$td�	|||
�����t1||j���tO||d�	|||
�������xn�|jt(jjkrj|j(r|j|}nt1||j��}|�)��|�&|
|d�	||����nn|j(r.tO|
|d�	||����|j|<n9t9||jtO|
|d�	||���������#t$rM}|r*|j�#td�	||�����ttU|�����d}~wtV$r(}td�	||�����d}~wtX$r(}td�	||�����d}~wwxYwdS)a'Convert field value pairs into regular message.

    Args:
      js: A JSON object to convert the field value pairs.
      message: A regular protocol message to record the data.
      path: parent path to log parse error info.

    Raises:
      ParseError: In case of problems converting.
    c3�(K�|]
}|j|fV��dSr,�rS�rN�fs  r�	<genexpr>z1_Parser._ConvertFieldValuePair.<locals>.<genexpr>sE����C�C�#$�!"��Q�/�C�C�C�C�C�CrNz0Message type {0} does not have extensions at {1}r�r��.zaMessage type "{0}" has no field named "{1}" at "{2}".
 Available Fields(except extensions): "{3}"c��g|]	}|j��
Srr�r�s  rrPz2_Parser._ConvertFieldValuePair.<locals>.<listcomp>$s��C�C�C�A�A�K�C�C�CrzBMessage type "{0}" should not have multiple "{1}" fields at "{2}".zHMessage type "{0}" should not have multiple "{1}" oneof fields at "{2}".�google.protobuf.Valuerrg�{0}.{1}z4repeated field {0} must be in [] which is {1} at {2}zPnull is not allowed to be used as an element in a repeated field at {0}.{1}[{2}]z{0}.{1}[{2}]zFailed to parse {0} field: {1}.)-rA�dictr[rmrT�_VALID_EXTENSION_NAME�match�
is_extendablerr8rB�
Extensions�_FindExtensionByName�joinr�r��appendr^rRr\rr.r]r0r�r�rjrk�setattr�
ClearFieldr5�_ConvertMapFieldValuerXrYrU�list�	enumerate�addr��_ConvertScalarFieldValuerZ�SetInParentrWr`r�)r:r?rr��namesrG�fields_by_json_namerRr4�
identifierrI�
oneof_namer��index�itemres                rr�z_Parser._ConvertFieldValuePair�s���
�E� �+���C�C�(:�(A�C�C�C�C�C���qL�qL��pL�#�'�'��d�3�3���	D�$�3�7�7��d�C�C�%��	H�.�4�4�T�:�:�	H�#�1�9��B�I�I�&�0�$�8�8�9�9�
9��A�b�D�z�*��$�9�9�*�E�E�%��H����*�"2�"2�3�"7�"7����"<�=�=�J��&�;�;�J�G�G�E��	F�
�
'����=�>D�f�%�/��t�C�C�);�)B�C�C�C�?E�?E�F�F�F�
�5�=�	J��4�4:�F�&�1�;�T�4�5I�5I�J�J�J�	���T�����4����!�	#�%�	#��-�2�*�
�5�
 �(��<�<B�F�!(�!3�!=�z�!%�='�='�(�(�
(��,�,�z�
"�
"�
"��
	��n�
� :� J�J�+��$�.�2I�I�+�!�'�5�:�6�6�K�%&�K�"�"���*�"<�"I�I�+��O�-�1L�L�+��G�U�Z��+�+�+�+����u�z�*�*�*�
��u���.	H�
�
�
�U�Z�
(�
(�
(�
�
$�
$�U�G�U�%.�%5�%5�d�D�%A�%A�C�C�C�C�
�[�J�6�E�
E�*	H�
�
�
�U�Z�
(�
(�
(��E�4�(�(�E��*�*0�&��u�d�*C�*C�E�E�
E�
�^�z�9�I�
I�N�(��/�/�	
L�	
L���t�#�G�U�Z�8�8�<�<�>�>�k��9��(�2�6M�M�9� �"H�HN��%)�4��I8�I8�9�9�9��!�!�$��"0�"7�"7��d�E�"J�"J�L�L�L�L�	
L� )��/�/�
N�
N���t��9� �"H�HN��%)�4��I8�I8�9�9�9��g�u�z�*�*�1�1�*��E�>�#8�#8��t�U�#K�#K�M�M�N�N�N�N�
N��^�z�9�I�
I�	H�
�
�7�!�,�U�3�K�K�!�'�5�:�6�6�K�
�
!�
!�
#�
#�
#�
�
�
�e�[�)�2B�2B�4��2N�2N�
O�
O�
O�
O�
�
�H�(@��u�i�.�.�t�T�:�:�)<�)<�G��u�%�%�
����(���)2�)9�)9�$��)E�)E�G�G�
H�
H�
H����#�#�#��	#�U�+�	#��<�C�C�D�!�L�L�M�M�
M��3�q�6�6�"�"�
"�����
�L�L�L��:�A�A�$��J�J�K�K�K�����
�L�L�L��:�A�A�$��J�J�K�K�K�����L����aqL�qLs?�C7V+�&FV+�0K9V+�+
Y"�5AW=�=
Y"�
#X-�-
Y"�:#Y�Y"c	��t|t��r|sdS	|d}n0#t$r#td�|�����wxYw	t||j��}n5#t$r(}td�||�����d}~wwxYw|j}|j	}t|��r1|�|d|d�|����nn|tvrFtt|d|d|d�|����|��n|d=|�|||��||d<|���|_||_dS)z/Convert a JSON representation into Any message.Nr�z0@type is missing when parsing any message at {0}�
{0} at {1}rI�	{0}.valuer�)rUr�r�rr8r�r$r�rArBrCr�rErr��SerializeToStringrIr�)	r:rIrr�r�r�rerGrBs	         r�_ConvertAnyMessagez_Parser._ConvertAnyMessage{s����%����
�u�
��f�K��w��h�h���K�K�K��
<�
C�
C�D�
I�
I�
K�
K�K�K����5�-�h��8L�M�M�k�k���5�5�5��|�*�*�1�d�3�3�4�4�4�����5����$�/��"�,�I��+�,�,�
 �
�!�!�%��.�+�"-�"4�"4�T�":�":�<�<�<�<�	�o�	%� �-�l�?�9�-�a�0�%��.�+��%�%�d�+�+�-�-��������.�
�!�!�%��d�;�;�;��e�G�n��1�1�3�3�G�M��G���s!�$�-A�A+�+
B�5#B�Bc��	|�|��dS#t$r(}td�||�����d}~wwxYw)z?Convert a JSON representation into message with FromJsonString.r�N)�FromJsonStringr`rr8)r:rIrr�res     r�_ConvertGenericMessagez_Parser._ConvertGenericMessage�s^��5�
���U�#�#�#�#�#���5�5�5��|�*�*�1�d�3�3�4�4�4�����5���s��
A�#A�Ac��t|t��r|�||j|��dSt|t��r|�||j|��dS|�	d|_dSt|t��r	||_	dSt|t��r	||_dSt|t��r	||_
dStd�|t!|��|�����)z1Convert a JSON representation into Value message.Nrz(Value {0} has unexpected type {1} at {2})rUr��_ConvertStructMessager�r��_ConvertListValueMessager�r�rV�
bool_valuerW�string_value�
_INT_OR_FLOAT�number_valuerr8r-)r:rIrr�s    r�_ConvertValueMessagez_Parser._ConvertValueMessage�s���%����%�
� � ���(<�d�C�C�C�C�C�	�E�4�	 �	 �%�
�#�#�E�7�+=�t�D�D�D�D�D�	�
%��g����	�E�4�	 �	 �%� �g����	�E�3�	�	�%�"�g����	�E�=�	)�	)�%�"�g�����A�H�H�
��e���d�$�$�
%�
%�%rc	�N�t|t��s#td�||�����|�d��t|��D]G\}}|�||j���d�||�����HdS)z5Convert a JSON representation into ListValue message.z+ListValue must be in [] which is {0} at {1}r��{0}[{1}]N)	rUr�rr8r�r�r�r�r�)r:rIrr�r�r�s      rr�z _Parser._ConvertListValueMessage�s����e�T�"�"���D�K�K�
����
�
�����x� � � � ��'�'�@�@���t�
����g�n�&8�&8�&:�&:� *� 1� 1�$�� >� >�@�@�@�@�@�@rc	� �t|t��s#td�||�����|���|D]>}|�|||j|d�||�����?dS)z2Convert a JSON representation into Struct message.z,Struct must be in a dict which is {0} at {1}r�N)rUr�rr8�Clearr�r[)r:rIrr�rcs     rr�z_Parser._ConvertStructMessage�s����e�T�"�"���E�L�L�
����
�
���M�M�O�O�O��=�=��
����c�
�G�N�3�,?� )� 0� 0��s� ;� ;�=�=�=�=�
�Frc��|jjd}t|dt||d�|�������dS)z3Convert a JSON representation into Wrapper message.rIr��r�N)rArTr�r�r8)r:rIrr�r4s     rr�z_Parser._ConvertWrapperMessage�sX����-�g�6�E���� ���K�4F�4F�t�4L�4L�M�M�M�O�O�O�O�Orc	�l�t|t��s)td�|j||�����|jjd}|jjd}|D]�}t||d�|��d��}|jtj
jkrK|�||t||j��|d�||������t|||d�||�����t||j��|<��dS)	afConvert map field value for a message map field.

    Args:
      value: A JSON object to convert the map field value.
      message: A protocol message to record the converted data.
      field: The descriptor of the map field to be converted.
      path: parent path to log parse error info.

    Raises:
      ParseError: In case of convert problems.
    z3Map field {0} must be in a dict which is {1} at {2}rcrIz{0}.keyTr�r�N)rUr�rr8rRr0rTr�r\rr.r]r�r�)	r:rIrr4r��	key_field�value_fieldrc�	key_values	         rr�z_Parser._ConvertMapFieldValue�sY���e�T�"�"�(��
?�
F�
F��j�%��'�'�
(�
(�(��"�1�%�8�I��$�3�G�<�K��	N�	N��*�3�	�+4�+;�+;�D�+A�+A�4�I�I�i�	�	��!;�!K�	K�N����E�#�J�#�G�U�Z�8�8��C�&�-�-�d�I�>�>�	@�	@�	@�	@�3K��#�J��*�*;�*;�D�)�*L�*L�3N�3N�3N�����$�$�Y�/�/�	N�	NrN)r
rrrr;r�r�r�r�r�r�r�r�r�rrrr�r��s�������0�0�������6@L�@L�@L�D � � �>5�5�5�%�%�%�$@�@�@����O�O�O�N�N�N�N�Nrr�c��	|jtvrt|��S|jtvrt	||��S|jt
jjkrt||��S|jt
jj	kr�|j
t
jjkr\t|t��r|�d��}n|}|ddt|��dzz
zz}t!j|��St$�|��rt)d���|S|jt
jjkr�|jj�|d��}|��	t3|��}|jj�|d��}n;#t6$r.t)d�||jj�����wxYw|�?|jjdkr|St)d�||jj�����|j SdS#t($r(}t)d�||�����d}~wwxYw)	aqConvert a single scalar field value.

  Args:
    value: A scalar value to convert the scalar field value.
    field: The descriptor of the field to convert.
    path: parent path to log parse error info.
    require_str: If True, the field value must be a str.

  Returns:
    The converted scalar field value

  Raises:
    ParseError: In case of convert problems.
  ri�=�zUnpaired surrogateNz(Invalid enum value {0} for enum type {1}rhr�)!r\�
_INT_TYPES�_ConvertIntegerrw�
_ConvertFloatrr.ru�_ConvertBoolrpr-rqrUrW�encode�lenrr�urlsafe_b64decode�_UNPAIRED_SURROGATE_PATTERN�searchrrjrk�values_by_namerm�intrlr`r8rBrnro�number)	rIr4r��require_str�encoded�padded_valuer�rres	         rr�r��sg��(3��~��#�%�
�U�
#�
#�#�	��<�	'�#�
�5�%�
(�
(�(�	��:�5�B�	B�!�
�%��
-�
-�-�	��:�5�D�	D��	��z�1�<�	<�
��e�S�!�!�	��L�L��)�)�'�'��'����S��\�\�A�-=�)=�!>�>���'��5�5�5�'�-�-�e�4�4�	1��/�0�0�
0���	��:�5�B�	B���?�1�5�5�e�T�B�B�j�	�1�	1��u�:�:�&���7�;�;�F�D�I�I�*�*���	1�	1�	1��E�L�L��U�_�.�0�0�1�1�1�	1�����	1�
�Z�
�(�
*���M��E�L�L��U�_�.�0�0�1�1�1�
�
��!���"
�3�3�3�
�\�(�(��D�1�1�
2�
2�2�����3���sR�H�H�)H�'BH�7*H�"<H�/F�H�8G�H�3H�
I�#I�Ic���t|t��r6|���s"td�|�����t|t
��r;|�d��dkr"td�|�����t|t��r"td�|�����t|��S)z�Convert an integer.

  Args:
    value: A scalar value to convert.

  Returns:
    The integer value.

  Raises:
    ParseError: If an integer couldn't be consumed.
  zCouldn't parse integer: {0}� r�zCouldn't parse integer: "{0}"z2Bool value {0} is not acceptable for integer field)	rUr�
is_integerrr8rW�findrVr)rIs rrr+s�����u���C�e�&6�&6�&8�&8�C�
�3�:�:�5�A�A�
B�
B�B���s���E��
�
�3���2� 5�E�
�5�<�<�U�C�C�
D�
D�D���t���4�
�%�%+�V�E�]�]�4�4�4�

�U���rc���t|t��r�tj|��rt	d���tj|��r$|dkrt	d���t	d���|jtjj	kr>|tjkrt	d���|tjkrt	d���|dkrt	d���	t|��S#t$rw|tkrtd	��cYS|tkrtd
��cYS|t krtd��cYSt	d�|�����wxYw)z!Convert an floating point number.z,Couldn't parse NaN, use quoted "NaN" insteadrzICouldn't parse Infinity or value too large, use quoted "Infinity" insteadzKCouldn't parse -Infinity or value too small, use quoted "-Infinity" insteadzFloat value too largezFloat value too small�nanz-Couldn't parse float "nan", use "NaN" insteadz-inf�infzCouldn't parse float: {0})rUrrxr|rryr\rr.r~r�
_FLOAT_MAX�
_FLOAT_MINr`rzr{r}r8)rIr4s  rrrDs�����u���2��z�%���H��F�G�G�G��z�%���;�	���;��9�:�:�	:��:�;�;�	;��~��3�A�A�2�	��)�	)�2��0�1�1�1�	��)�	)�2��0�1�1�1�
�e�^�G�
�E�
F�
F�F�C���<�<���	�	C�	C�	C��
��C�
�6�]�]����	�)�	�C�
�5�\�\����	�$��C�
�5�\�\�����3�:�:�5�A�A�B�B�B�	C���s�C.�.$E/�E/�0E/�#E/c��|r2|dkrdS|dkrdStd�|�����t|t��std���|S)z�Convert a boolean value.

  Args:
    value: A scalar value to convert.
    require_str: If True, value must be a str.

  Returns:
    The bool parsed.

  Raises:
    ParseError: If a boolean value couldn't be consumed.
  rJTrKFz#Expected "true" or "false", not {0}z%Expected true or false without quotes)rr8rUrV)rIrs  rrrhsu���L����L�
�T�	�'�	�L�
�U��<�C�C�E�J�J�K�K�K�	�E�4�	 �	 �>�
�<�
=�
=�=�	�,rr�r�r�r�r�r�r�r�r�r�)zgoogle.protobuf.Anyzgoogle.protobuf.Durationzgoogle.protobuf.FieldMaskzgoogle.protobuf.ListValuezgoogle.protobuf.Structzgoogle.protobuf.Timestampr�)FFrFFNNTr�)FNr�)F)9r�
__author__rr�collectionsrr=rx�operatorr�re�sys�google.protobuf.internalr�google.protobufrr�_TIMESTAMPFOMAT�	frozensetr.�
CPPTYPE_INT32�CPPTYPE_UINT32�
CPPTYPE_INT64�CPPTYPE_UINT64rrvr~�CPPTYPE_DOUBLErwr{rzr}�compilerr��	Exceptionrrrr'r*r5�objectrrCr�r�r�r�rrr�r�r�rrrrErrr�<module>r.s���>
�
�+�
��
�
�
�#�#�#�#�#�#���������!�!�!�!�!�!�	�	�	�	�
�
�
�
�2�2�2�2�2�2�&�&�&�&�&�&�+�+�+�+�+�+�&��
�Y�
�2�@�"�2�A�"�2�@�"�2�A�C�D�D�
��y�*�4�B�$�4�C�E�F�F���y�*�4�B�$�4�C�E�F�F���	��
���(�b�j�M�O�O��#��
�#:�;�;��0�0�0�0�0�I�0�0�0�/�/�/�/�/�5�/�/�/�)�)�)�)�)��)�)�)�$)� %��� ����(H�(H�(H�(H�Z$)� %� ���
#/�#/�#/�#/�L5�5�5�HC�HC�HC�HC�HC�v�HC�HC�HC�VJ�J�J������� !&��!�	(�(�(�(�F%*�"�"%�	����2�e��
�ZN�ZN�ZN�ZN�ZN�f�ZN�ZN�ZN�z73�73�73�73�t���2!C�!C�!C�H���46�0�2�!>�!9�!;�"?�":�"<�"A�"<�">�;�6�8�"?�":�"<�9�4�6�����r