U
    ๖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ed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)ฺabsentc                C   s   |S ฉNฉ )ฺselfฺvaluer   r   r   ๚G/tmp/pip-unpacked-wheel-n0lo1xd6/proto/marshal/rules/stringy_numbers.pyฺ	to_python   s    zStringyNumberRule.to_pythonc                 C   s   |d k	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                   @   s   e Zd ZeZejZdS )ฺ	Int64RuleN)r   r   r   ฺintr   r   ZINT64ฺ_proto_typer   r   r   r	   r   (   s   r   c                   @   s   e Zd ZeZejZdS )ฺ
UInt64RuleN)r   r   r   r   r   r   ZUINT64r   r   r   r   r	   r   -   s   r   c                   @   s   e Zd ZeZejZdS )ฺ
SInt64RuleN)r   r   r   r   r   r   ZSINT64r   r   r   r   r	   r   2   s   r   c                   @   s   e Zd ZeZejZdS )ฺFixed64RuleN)r   r   r   r   r   r   ZFIXED64r   r   r   r   r	   r   7   s   r   c                   @   s   e Zd ZeZejZdS )ฺSFixed64RuleN)r   r   r   r   r   r   ZSFIXED64r   r   r   r   r	   r   <   s   r   N)	Zproto.primitivesr   r   r   r   r   r   r   ZSTRINGY_NUMBER_RULESr   r   r   r	   ฺ<module>   s   ๛