o
    8๘h๛  ใ                   @   s|   d dl mZ G dd dZG dd deZG dd deZG dd	 d	eZG d
d deZG dd deZeeeeegZdS )้    )ฺ	ProtoTypec                   @   s,   e Zd ZdZdddefddZdd ZdS )	ฺStringyNumberRuleaE  A marshal between certain numeric types and strings

    This is a necessary hack to allow round trip conversion
    from messages to dicts back to messages.

    See https://github.com/protocolbuffers/protobuf/issues/2679
    and
    https://developers.google.com/protocol-buffers/docs/proto3#json
    for more details.
    N)ฺabsentr   c                C   s   |S ฉNฉ )ฺselfฺvaluer   r   r   ๚[/home/air/sos/back/venv/lib/python3.10/site-packages/proto/marshal/rules/stringy_numbers.pyฺ	to_python   s   zStringyNumberRule.to_pythonc                 C   s   |d ur	|   |กS d S r   )ฺ_python_type)r   r   r   r   r	   ฺto_proto!   s   
zStringyNumberRule.to_proto)ฺ__name__ฺ
__module__ฺ__qualname__ฺ__doc__ฺboolr
   r   r   r   r   r	   r      s    r   c                   @   ๓   e Zd ZeZejZdS )ฺ	Int64RuleN)r   r   r   ฺintr   r   ฺINT64ฺ_proto_typer   r   r   r	   r   (   ๓    
r   c                   @   r   )ฺ
UInt64RuleN)r   r   r   r   r   r   ฺUINT64r   r   r   r   r	   r   -   r   r   c                   @   r   )ฺ
SInt64RuleN)r   r   r   r   r   r   ฺSINT64r   r   r   r   r	   r   2   r   r   c                   @   r   )ฺFixed64RuleN)r   r   r   r   r   r   ฺFIXED64r   r   r   r   r	   r   7   r   r   c                   @   r   )ฺSFixed64RuleN)r   r   r   r   r   r   ฺSFIXED64r   r   r   r   r	   r   <   r   r   N)	ฺproto.primitivesr   r   r   r   r   r   r   ฺSTRINGY_NUMBER_RULESr   r   r   r	   ฺ<module>   s   ๛