+
     h  c                   sX   R t Rt^ RIt^ RIHt ^ RIt^ RIt^ RIHt ^ RI	t	^ RI
t
^ RIHt ^ RIHt ^ RIHt Rt]! ]P$                  P&                  ]P$                  P(                  ]P$                  P*                  ]P$                  P,                  .4      t]! ]P$                  P*                  ]P$                  P,                  .4      t]! ]P$                  P2                  ]P$                  P4                  .4      tR	tR
tRt]	P>                  ! R4      t ]	P>                  ! R4      t! ! R R]"4      t# ! R R]#4      t$ ! R R]#4      t%R5R lt&R6R lt'R t( ! R R])4      t*R t+R t,R t-R7R lt.R7R lt/]0]13t2 ! R R])4      t3R8R  lt4R! t5R" t6R# t7R$R%R&.R'R(R).R*R(R).R+R,R-.R.R/R0.R1R(R).R2R3R4./t8R# )9at  Contains 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())
zjieluo@google.com (Jie Luo)N)OrderedDict)methodcaller)type_checkers)
descriptor)symbol_databasez%Y-%m-%dT%H:%M:%SZInfinityz	-InfinityZNaNu.   [-](?![-])|(?<![-])[-]z\[[a-zA-Z0-9\._]*\]$c                   s    ] tR t^NtRtRtR# )Errorz'Top-level module error for json_format. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       @/usr/lib/python3.14/site-packages/google/protobuf/json_format.pyr   r   N   s    /r   r   c                   s    ] tR t^RtRtRtR# )SerializeToJsonErrorz&Thrown if serialization to JSON fails.r   Nr   r   r   r   r   r   R   s    .r   r   c                   s    ] tR t^VtRtRtR# )
ParseErrorz Thrown in case of parsing error.r   Nr   r   r   r   r   r   V   s    (r   r   c                sF    \        VVVVVR7      pVP                  WV4      # )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.

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   printers	   &&&&&&&& r   MessageToJsonr   Z   s2    > $!%'' 
		gy	99r   c                sD    \        VVVVVR7      pVP                  V 4      # )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)r   r   r   r   r   r   r   s   &&&&&& r   MessageToDictr       s0    8 $!%'' 
	%	%g	..r   c                 s    V P                   \        P                  P                  8H  ;'       dC    V P                  P
                  ;'       d%    V P                  P                  4       P                  # N)typer   FieldDescriptorZTYPE_MESSAGEmessage_typeZhas_optionsZ
GetOptionsZ	map_entry)field   &r   _IsMapEntryr'      sZ    
**
22??
? 4 4



(
(4 4



'
'
)
3
35r   c                   sj   a  ] tR t^t o RtRR ltR tR tR tR t	R t
R	 tR
 tR tR tR tRtV tR# )r   z)JSON format printer for protocol message.Nc                s    Wn         W n        W0n        W@n        V'       d   R P	                  V4      V n        R# RV n        R# )z.{}gN)r   r   r   r   formatfloat_format)selfr   r   r   r   r   s   &&&&&&r   __init__Z_Printer.__init__   s9     +I''B$"8* --8ddr   c                sT    V P                  V4      p\        P                  ! WBVR 7      # ))r   r   )r   jsonZdumps)r*   r   r   r   js   &&&& r   r   Z_Printer.ToJsonString   s#    		"	"7	+B::b9==r   c                s    VP                   pVP                  p\        V4      '       d   V P                  V4      # V\        9   d%   \        \        V,          ^ ,          V4      ! V 4      # / pV P                  W4      # )zEConverts message to an object according to Proto3 JSON Specification.)
DESCRIPTOR	full_name_IsWrapperMessage_WrapperMessageToJsonObject_WKTJSONMETHODSr   _RegularMessageToJsonObject)r*   r   message_descriptorr0   r-      &&   r   r   Z_Printer._MessageToJsonObject   sp     ++",,I+,,--g66O#/)4Q7A$GG	B++G88r   c                s   VP                  4       p V EFV  w  rEV P                  '       d   VP                  pMVP                  p\	        V4      '       dx   VP
                  P                  R,          p/ pV FL  p	\        V	\        4      '       d   V	'       d   Rp
MRp
M\        V	4      p
V P                  WuV	,          4      W&   KN  	  WV&   K  VP                  \        P                  P                  8X  d'   V Uu. uF  pV P                  WK4      NK  	  upW&&   EK  VP                  '       d*   RVP                   ,          pV P                  WE4      W&&   EKC  V P                  WE4      W&&   EKY  	  V P"                  '       Ed   VP$                  pVP&                   EF   pVP                  \        P                  P                  8w  d*   VP(                  \        P                  P*                  8X  g   VP,                  '       d   Kj  V P                  '       d   VP                  pMVP                  pWb9   d   K  \	        V4      '       d   / W&&   K  VP                  \        P                  P                  8X  d   . W&&   K  V P                  WDP.                  4      W&&   EK  	  V# u upi   \0         d+   p\3        RP5                  XP                  T4      4      hRp?ii ; i)z?Converts normal message according to Proto3 JSON Specification.valuetruefalsez[%s]z#Failed to serialize {0} field: {1}.N)
ListFieldsr   name	json_namer'   r$   fields_by_name
isinstanceboolstr_FieldToJsonObjectlabelr   r#   LABEL_REPEATEDis_extensionr0   r   r/   fieldscpp_typeCPPTYPE_MESSAGEcontaining_oneofZdefault_value
ValueErrorr   r(   )r*   r   r-   rE   r%   r7   r;   Zv_fieldZjs_mapkeyZrecorded_keyZkr5   es   &&&           r   r4   Z$_Printer._RegularMessageToJsonObject   sT   !F8G ,%+++$$u&&55g>'&c#t$$%& Xl#'#:#:s$%F   T([[J66EEE  %&$! --e7$&"(%//)$,,U:"(,,U:"(9 !> 
	,	,	,$//'..E{{j88GGG~~!;!;!K!KK$$$---::D??DZBH{{j88GGGBH..u6I6IJBH% /0 IG&>  G 
/
6
6uzz1
EG GGsL   BJ& A"J& :J!J& .AJ& A?J& J& B	J& !J& &K1%KKc                s.   VP                   \        P                  P                  8X  d   V P	                  V4      # VP                   \        P                  P
                  8X  d   V P                  '       d   V# VP                  P                  R8X  d   R# VP                  P                  P                  VR4      pVe   VP                  # VP                  P                  R8X  d   V# \        R4      hVP                   \        P                  P                  8X  dQ   VP                   \        P                  P"                  8X  d&   \$        P&                  ! V4      P)                  R4      # V# VP                   \        P                  P*                  8X  d   \-        V4      # VP                   \.        9   d   \1        V4      # VP                   \2        9   d   \4        P6                  ! V4      '       d   VR8  d   \8        # \:        # \4        P<                  ! V4      '       d   \>        # VP                   \        P                  P@                  8X  dG   V PB                  '       d   \E        \G        W PB                  4      4      # \H        PJ                  ! V4      # V# )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        )&rF   r   r#   rG   r   CPPTYPE_ENUMr   	enum_typer0   values_by_numbergetr;   filesyntaxr   CPPTYPE_STRINGr"   
TYPE_BYTESbase64Z	b64encodedecodeCPPTYPE_BOOLr?   _INT64_TYPESr@   _FLOAT_TYPESmathisinf_NEG_INFINITY	_INFINITYisnan_NANCPPTYPE_FLOATr)   floatr(   r   ZToShortestFloat)r*   r%   r7   
enum_value   &&& r   rA   Z_Printer._FieldToJsonObject  s   ~~33CCC&&u--	:55BB	B		$	$	$		"	"&A	A??3377tDj		::(," $L M 	M	:55DD	D	z11<<	<&--g66	:55BB	B%[	<	'Z	<	'	E		3;

	E			:55CC	Cve%6%678
8..u5
5Lr   c                s   VP                  4       '       g   / # \        4       pVP                  pW2R&   \        W0P                  4      pVP                  VP                  4       VP                  pVP                  p\        V4      '       d   V P                  V4      VR&   V# V\        9   d*   \        \        V,          ^ ,          V4      ! V 4      VR&   V# V P                  WB4      # )z<Converts Any message according to Proto3 JSON Specification.@typer7   )r:   r    type_url_CreateMessageFromTypeUrlr   ZParseFromStringr7   r/   r0   r1   r2   r3   r   r4   )r*   r   r-   rg   sub_messager5   r0      &&     r   _AnyMessageToJsonObjectZ _Printer._AnyMessageToJsonObject;  s    i	BHwK+H6J6JKK.$//",,I+,,44[AbkiO# !;A!>!,..24bki++K<<r   c                s"    VP                  4       # )z8Converts message according to Proto3 JSON Specification.)r   r*   r      &&r   _GenericMessageToJsonObjectZ$_Printer._GenericMessageToJsonObjectP  s     !!r   c                s   VP                  R4      pVe   VR8X  d   R# VR8X  d   V P                  VP                  4      # VR8X  d   VP                  pM\	        W4      pVP
                  P                  V,          pV P                  WC4      # )z>Converts Value message according to Proto3 JSON Specification.ZkindN
null_value
list_valuestruct_value)Z
WhichOneof_ListValueMessageToJsonObjectrp   rq   getattrr/   r=   rA   )r*   r   Zwhichr7   Zoneof_descriptorr6   r   _ValueMessageToJsonObjectZ"_Printer._ValueMessageToJsonObjectV  s    v&E }-//0B0BCC""eg%e))88?""#3;;r   c                sb    VP                    Uu. uF  pV P                  V4      NK  	  up# u upi )zBConverts ListValue message according to Proto3 JSON Specification.)valuesrt   )r*   r   r7   s   && r   rr   Z&_Printer._ListValueMessageToJsonObjectf  s8     !)' **51') ) )s   ,c                sf    VP                   p/ pV F  pV P                  W$,          4      W4&   K  	  V# )z?Converts Struct message according to Proto3 JSON Specification.)rE   rt   )r*   r   rE   ZretrJ   r6   r   _StructMessageToJsonObjectZ#_Printer._StructMessageToJsonObjectk  s3    ^^F
C//<ch Jr   c                sp    V P                  VP                  P                  R ,          VP                  4      # r7   )rA   r/   r=   r7   rl   rm   r   r2   Z$_Printer._WrapperMessageToJsonObjects  s1    ""))'2GMMC Cr   )r   r)   r   r   r   FFFNN)r   r	   r
   r   r   r+   r   r   r4   rA   rk   rn   rt   rr   rv   r2   r   __classdictcell__Z__classdict__   @r   r   r      sH     1 >	9>@)V=*"< )
C Cr   r   c                 s4    V P                   P                  R 8H  # )zgoogle/protobuf/wrappers.proto)rS   r;   )r5   r&   r   r1   r1   x  s    		 	 	%	%)I	IIr   c                 sh    / pV  F)  w  r#W!9   d   \        R P                  V4      4      hW1V&   K+  	  V# )z'Failed to load JSON: duplicate key {0}.)r   r(   )r-   Zresultr;   r7   s   &   r   _DuplicateCheckerr|   |  s=    &kd~@GGMNN4L  
-r   c                s&   \         P                  ! 4       pVf   VP                  MTpV P                  R4      R,          p VP	                  V4      pTP                  T4      pT! 4       #   \
         d    \        RP                  T 4      4      hi ; i)z"Creates a message from a type URL.Z/z1Can not find message descriptor by type_url: {0}.)	r   ZDefaultpoolsplitZFindMessageTypeByNameKeyError	TypeErrorr(   ZGetPrototype)rg   r   Zdbr~   Z	type_namer5   Zmessage_classrj   r   rh   rh     s     "#+$nnS!"%)N33I> //"45-		 
 N
;BB8LN NNs   A* *&Bc                s   \        V \        4      '       g   V P                  R4      p  \        P                  ! V \
        R7      p\        YAY#4      #   \         d)   p\        RP                  \        T4      4      4      hRp?ii ; i)a  Parses 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.

Returns:
  The same message passed as argument.

Raises::
  ParseError: On JSON parsing problems.
rN   )Zobject_pairs_hookzFailed to load JSON: {0}.N)
r>   r@   rX   r,   Zloadsr|   rI   r   r(   	ParseDict)Ztextr   ignore_unknown_fieldsr   r-   rK   s   &&&&  r   Parser     su      
D#		;;wDA	D,=	>B 
2 5	GG 
 A
077A?
@@As   A B#A??Bc                s>    \        W#4      pVP                  W4       V# )aw  Parses 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.

Returns:
  The same message passed as argument.
)_ParserConvertMessage)Zjs_dictr   r   r   Zparserr.   r   r   r     s"      (:&)	.r   c                   s`   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )r   i  z(JSON format parser for protocol message.c                s    Wn         W n        R # r!   )r   r   )r*   r   r      &&&r   r+   Z_Parser.__init__  s    !6*r   c                s   VP                   pVP                  p\        V4      '       d   V P                  W4       R# V\        9   d'   \        \        V,          ^,          W4      ! V 4       R# V P                  W4       R# )zConvert a JSON object into a message.

Args:
  value: A JSON object.
  message: A WKT or regular protocol message to record the data.

Raises:
  ParseError: In case of convert problems.
N)r/   r0   r1   _ConvertWrapperMessager3   r   _ConvertFieldValuePair)r*   r7   r   r5   r0   s   &&&  r   r   Z_Parser.ConvertMessage  sd     !++",,I+,,
!!%1	o	%?9-a0%A$G
!!%1r   c                s~   . pVP                   p\        R VP                   4       4      pV EF_  p VP                  VR4      pV'       g   VP                  P                  VR4      pV'       g   \
        P                  V4      '       d   VP                  '       g%   \        RP                  VP                  4      4      hV^R pVP                  P                  V4      pV'       g?   RP                  VP                  R4      RR 4      pVP                  P                  V4      pV'       g_   V P                  '       d   EK  \        RP                  VP                  TVP                   U	u. uF  qP                   NK  	  up	4      4      hWc9   d0   \        RP                  VP                   P                  V4      4      hVP#                  V4       W,          p
VP$                  ea   V
e]   VP$                  P&                  pW9   d0   \        RP                  VP                   P                  V4      4      hVP#                  V4       V
f   VP(                  \*        P,                  P.                  8X  d9   VP0                  P                  R8X  d   \3        W'P&                  4      p^ Vn        MvVP(                  \*        P,                  P6                  8X  d3   VP8                  P                  R	8X  d   \;        W'P&                  ^ 4       MVP=                  VP&                  4       EK  \?        V4      '       d1   VP=                  VP&                  4       V PA                  WV4       EK;  VPB                  \*        P,                  PD                  8X  Ed'   VP=                  VP&                  4       \G        V
\H        4      '       g   \        R
P                  Wj4      4      hVP(                  \*        P,                  P.                  8X  dk   V
 Fa  p\3        W'P&                  4      PK                  4       pVf'   VP                   P                  R8w  d   \        R4      hV PM                  W4       Kc  	  EKC  V
 F?  pVf   \        R4      h\3        W'P&                  4      P#                  \O        W4      4       KA  	  EK  VP(                  \*        P,                  P.                  8X  d`   VPP                  '       d   VP                  V,          pM\3        W'P&                  4      pVPS                  4        V PM                  W4       EK  VPP                  '       d   \O        W4      VP                  V&   EK@  \;        W'P&                  \O        W4      4       EKb  	  R# u up	i   \         dJ   pX'       d)   TP$                  f   \        RP                  Yn4      4      h\        \U        T4      4      hRp?i\V         d    p\        RP                  Yn4      4      hRp?i\X         d    p\        RP                  Yn4      4      hRp?ii ; i)zConvert 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.

Raises:
  ParseError: In case of problems converting.
c              3   s>   "   T F  pVP                   V3x  K  	  R # 5ir!   )r<   )Z.0fs   & r   Z	<genexpr>Z1_Parser._ConvertFieldValuePair.<locals>.<genexpr>  s!      C(A1 !"Q/(As   Nz)Message type {0} does not have extensionsZ.zVMessage type "{0}" has no field named "{1}".
 Available Fields(except extensions): {2}z9Message type "{0}" should not have multiple "{1}" fields.z?Message type "{0}" should not have multiple "{1}" oneof fields.google.protobuf.ValuerL   z.repeated field {0} must be in [] which is {1}.zAnull is not allowed to be used as an element in a repeated field.zFailed to parse {0} field: {1}.r}   )-r/   dictrE   rR   r=   _VALID_EXTENSION_NAMEZmatchZis_extendabler   r(   r0   Z
ExtensionsZ_FindExtensionByNameZjoinr   r   r<   ZappendrH   r;   rF   r   r#   rG   r$   rs   ro   rO   rP   setattr
ClearFieldr'   _ConvertMapFieldValuerB   rC   r>   listaddr   _ConvertScalarFieldValuerD   ZSetInParentr@   rI   r   )r*   r-   r   Znamesr5   Zfields_by_json_namer;   r%   Z
identifierr   r7   Z
oneof_nameri   itemrK   s   &&&            r   r   Z_Parser._ConvertFieldValuePair  s    E ++ C(:(A(AC CeL#''d3$3377dC%.44T::#111HOO",,. / /Abz*$$99*E% *"2"23"7"<=J&&;;JGE''';<BF%//);)B)BC)BAKK)BC=EF F
 = ++16&11;;T,CD D 	T!!-%2C--22*  3396!(!3!3!=!=z4KL L ,,z
"=nn
 : : J JJ$$..2II!'::6K%&K"*"<"<"I"IIOO--1LLGZZ+uzz*
 u


UZZ
(

$
$UU
;[[J66EEE


UZZ
(E4(( $$*F4$79 9^^z99III#GZZ8<<>k,((226MM  "9 : :!!$4    "9 : :gzz*11*479	  ^^z99III!,,U3K!'::6K

!
!
#


e
1(@(NGu%GZZ)A%)OP{ 6 DF  #U++3<CCDLM
M3q6"
" L:AA$JKK L:AA$JKKLs   =V0VVBV/V*V.VF"V'>V(DV0AV8:V3A
V VV-VVX<#AW''X<4X<5XX<X<X77X<c                s   \        V\        4      '       d   V'       g   R#  VR,          p\	        Y0P
                  4      pTP                  pTP                  p\        T4      '       d   T P                  TR,          T4       MPT\        9   d.   \        \        T,          ^,          TR,          T4      ! T 4       MTR T P                  Y4       Y1R&   TP                  4       Tn        Y2n        R#   \         d    \        R4      hi ; i)z/Convert a JSON representation into Any message.Nrf   z*@type is missing when parsing any message.r7   )r>   r   r   r   rh   r   r/   r0   r1   r   r3   r   r   ZSerializeToStringr7   rg   )r*   r7   r   rg   ri   r5   r0      &&&    r   _ConvertAnyMessageZ_Parser._ConvertAnyMessageT  s    %uEwh ,H6J6JKK$//",,I+,,
!!%.+>	o	%
)
$Q
'wFFJL .
!!%5Gn113GM#  ECDDEs   	C0 0Dc                sf     VP                  V4       R#   \         d   p\        T4      hRp?ii ; i)z?Convert a JSON representation into message with FromJsonString.N)ZFromJsonStringrI   r   )r*   r7   r   rK   re   r   _ConvertGenericMessageZ_Parser._ConvertGenericMessagem  s/    U# qMs    0+0c                s   \        V\        4      '       d   V P                  WP                  4       R# \        V\        4      '       d   V P                  WP                  4       R# Vf
   ^ Vn        R# \        V\        4      '       d	   Wn	        R# \        V\        4      '       d	   Wn        R# \        V\        4      '       d	   Wn        R# \        RP                  V\!        V4      4      4      h)z1Convert a JSON representation into Value message.Nz"Value {0} has unexpected type {1}.)r>   r   _ConvertStructMessagerq   r   _ConvertListValueMessagerp   ro   r?   Z
bool_valuer@   Zstring_value_INT_OR_FLOATZnumber_valuer   r(   r"   )r*   r7   r   r   r   _ConvertValueMessageZ_Parser._ConvertValueMessagev  s    %
  (<(<=	E4	 	 
$$U,>,>?	g	E4	 	  	E3		"	E=	)	)";BB
e  r   c                s    \        V\        4      '       g   \        RP                  V4      4      hVP	                  R4       V F,  pV P                  W2P                  P                  4       4       K.  	  R# )z5Convert a JSON representation into ListValue message.z%ListValue must be in [] which is {0}.ru   N)r>   r   r   r(   r   r   ru   r   )r*   r7   r   r   re   r   r   Z _Parser._ConvertListValueMessage  s_    eT""
1
8
8
?A Ax 
nn&8&8&:; r   c                s    \        V\        4      '       g   \        RP                  V4      4      hVP	                  4        V F,  pV P                  W,          VP                  V,          4       K.  	  R# )z2Convert a JSON representation into Struct message.z&Struct must be in a dict which is {0}.N)r>   r   r   r(   ZClearr   rE   )r*   r7   r   rJ   re   r   r   Z_Parser._ConvertStructMessage  s_    eT""
2
9
9%
@B B MMO

GNN3,?@ 
r   c                sl    VP                   P                  R,          p\        VR\        W4      4       R# )z3Convert a JSON representation into Wrapper message.r7   N)r/   r=   r   r   )r*   r7   r   r%   re   r   r   Z_Parser._ConvertWrapperMessage  s*    --g6EGW6uDEr   c                s$   \        V\        4      '       g&   \        RP                  VP                  V4      4      hVP
                  P                  R,          pVP
                  P                  R,          pV F  p\        WdR4      pVP                  \        P                  P                  8X  d5   V P                  W,          \        W#P                  4      V,          4       Kl  \        W,          V4      \        W#P                  4      V&   K  	  R# )a  Convert 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.

Raises:
  ParseError: In case of convert problems.
z-Map field {0} must be in a dict which is {1}.rJ   r7   TN)r>   r   r   r(   r;   r$   r=   r   rF   r   r#   rG   r   rs   )r*   r7   r   r%   Z	key_fieldZvalue_fieldrJ   Z	key_values   &&&&    r   r   Z_Parser._ConvertMapFieldValue  s     eT""
9
@
@jj%!" " ""11%8I$$33G<K*34@i			!;!;!K!K	KEJZZ)!!*), 	- 3KJ3%$Y/ r   )r   r   N)r   r	   r
   r   r   r+   r   r   r   r   r   r   r   r   r   r   ry   rz   r{   r   r   r     sC     0+2&tLl 2$<
F
% %r   r   c                s   VP                   \        9   d   \        V 4      # VP                   \        9   d   \	        W4      # VP                   \
        P                  P                  8X  d   \        W4      # VP                   \
        P                  P                  8X  d   VP                  \
        P                  P                  8X  dh   \        V \        4      '       d   V P                  R4      pMT pVR^\        V4      ^,          ,
          ,          ,           p\         P"                  ! V4      # \$        P'                  V 4      '       d   \)        R4      hV # VP                   \
        P                  P*                  8X  d   VP,                  P.                  P1                  V R4      pVf    \3        V 4      pVP,                  P4                  P1                  VR4      pTfL   TP<                  P>                  R8X  d   T# \)        RP9                  YP,                  P:                  4      4      hVP@                  # R#   \6         d0    \)        RP9                  YP,                  P:                  4      4      hi ; i)a0  Convert a single scalar field value.

Args:
  value: A scalar value to convert the scalar field value.
  field: The descriptor of the field to convert.
  require_str: If True, the field value must be a str.

Returns:
  The converted scalar field value

Raises:
  ParseError: In case of convert problems.
rN   s   =zUnpaired surrogateNz)Invalid enum value {0} for enum type {1}.rM   )!rF   
_INT_TYPES_ConvertIntegerr[   _ConvertFloatr   r#   rY   _ConvertBoolrU   r"   rV   r>   r@   ZencodeZlenrW   Zurlsafe_b64decode_UNPAIRED_SURROGATE_PATTERNZsearchr   rO   rP   Zvalues_by_namerR   intrQ   rI   r(   r0   rS   rT   number)r7   r%   require_strZencodedZpadded_valuerd   r   r   r   r   r     s    ^^z!5!!~~%&&~~33@@@++~~33BBBzzZ//:::	E3		,,w'tq3w<!+;';<<l%%l33 
%	+	+E	2	2-..l~~33@@@//33E4@J/U__5599&$G
 
	::(-DKK??,,. / 	/! A  /DKK??,,. / 	//s   *1H8 8:I2c                s   \        V \        4      '       d1   V P                  4       '       g   \        RP	                  V 4      4      h\        V \
        4      '       d1   V P                  R4      R8w  d   \        RP	                  V 4      4      h\        V \        4      '       d   \        RP	                  V 4      4      h\        V 4      # )zConvert an integer.

Args:
  value: A scalar value to convert.

Returns:
  The integer value.

Raises:
  ParseError: If an integer couldn't be consumed.
zCouldn't parse integer: {0}.Z zCouldn't parse integer: "{0}".z3Bool value {0} is not acceptable for integer field.r}   )	r>   rc   Z
is_integerr   r(   r@   Zfindr?   r   rw   r&   r   r   r     s     ue&6&6&8&8
4;;EB
CCs

32 5
6==eD
EEt
 &&,fUm5 5 
Ur   c                s   \        V \        4      '       d   \        P                  ! V 4      '       d   \	        R4      h\        P
                  ! V 4      '       d   V ^ 8  d   \	        R4      h\	        R4      hVP                  \        P                  P                  8X  dA   V \        P                  8  d   \	        R4      hV \        P                  8  d   \	        R4      hV R8X  d   \	        R4      h \        V 4      #   \         dd    T \        8X  d   \        R4      u # T \        8X  d   \        R	4      u # T \         8X  d   \        R4      u # \	        R
P#                  T 4      4      hi ; i)z!Convert an floating point number.z-Couldn't parse NaN, use quoted "NaN" instead.zJCouldn't parse Infinity or value too large, use quoted "Infinity" instead.zLCouldn't parse -Infinity or value too small, use quoted "-Infinity" instead.zFloat value too largezFloat value too smallZnanz.Couldn't parse float "nan", use "NaN" instead.z-infZinfzCouldn't parse float: {0}.)r>   rc   r\   r`   r   r]   rF   r   r#   rb   r   Z
_FLOAT_MAXZ
_FLOAT_MINrI   r^   r_   ra   r(   )r7   r%   rm   r   r   r     s2   uzz%GHHzz%	 : ; 	;  ; < 	<~~33AAA	))	)011	))	)011
e^
F
GGD<	 	D6]	)	5\	$5\4;;EBCC	Ds   3
C> >!E,!E,9E,E,c                s    V'       d-   V R8X  d   R# V R8X  d   R# \        RP                  V 4      4      h\        V \        4      '       g   \        R4      hV # )zConvert 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.
r8   Tr9   Fz$Expected "true" or "false", not {0}.z&Expected true or false without quotes.)r   r(   r>   r?   )r7   r   rm   r   r   r   0  sQ     	'	=DDUKLL	E4	 	 
=
>>	,r   zgoogle.protobuf.Anyrk   r   zgoogle.protobuf.Durationrn   r   zgoogle.protobuf.FieldMaskzgoogle.protobuf.ListValuerr   r   zgoogle.protobuf.Structrv   r   zgoogle.protobuf.Timestampr   rt   r   )FFi   FFNNrx   )FN)F)9r   Z
__author__rW   Zcollectionsr    r,   r\   Zoperatorr   ZreZsysZgoogle.protobuf.internalr   Zgoogle.protobufr   r   Z_TIMESTAMPFOMATZ	frozensetr#   ZCPPTYPE_INT32ZCPPTYPE_UINT32ZCPPTYPE_INT64ZCPPTYPE_UINT64r   rZ   rb   ZCPPTYPE_DOUBLEr[   r_   r^   ra   Zcompiler   r   Z	Exceptionr   r   r   r   r    r'   Zobjectr   r1   r|   rh   r   r   r   rc   r   r   r   r   r   r   r3   r   r   r   <module>r      s  >
 +
  #   ! 	 
 2 & + &
22@@"22AA"22@@"22AAC D
 *44BB$44CCE F*44BB$44CCE F	 jjMO  

#:; 0I 0/5 /) )%:P#/L5GCv GCTJH2* ev%f v%r3l2!DH4 502!>!9!;"?":"<"A"<">;68"?":"<946r   