U
    #FZhû  ã                   @   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   új/home/aprabhat/apps/x.techxrdev.in/venv/lib/python3.8/site-packages/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   û