o
    ZzjÁ  ã                   @   sl   d Z ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZ G d	d
„ d
eƒZdS )zCThis module contains an object that represents a Telegram Location.é    N)ÚFinal)Ú	constants)ÚTelegramObject)Úto_timedelta)Úget_timedelta_value)ÚJSONDictÚ
TimePeriodc                       sÄ   e Zd ZU dZdZ				dddœdedededB dedB d	edB d
edB dedB f‡ fdd„Z	e
deejB dB fdd„ƒZejjZee ed< 	 ejjZee ed< 	 ejjZee ed< ‡  ZS )ÚLocationa 	  This object represents a point on the map.

    Objects of this class are comparable in terms of equality. Two objects of this class are
    considered equal, if their :attr:`longitude` and :attr:`latitude` are equal.

    Args:
        longitude (:obj:`float`): Longitude as defined by the sender.
        latitude (:obj:`float`): Latitude as defined by the sender.
        horizontal_accuracy (:obj:`float`, optional): The radius of uncertainty for the location,
            measured in meters; 0-:tg-const:`telegram.Location.HORIZONTAL_ACCURACY`.
        live_period (:obj:`int` | :class:`datetime.timedelta`, optional): Time relative to the
            message sending date, during which the location can be updated, in seconds. For active
            live locations only.

            .. versionchanged:: v22.2
                |time-period-input|
        heading (:obj:`int`, optional): The direction in which user is moving, in degrees;
            :tg-const:`telegram.Location.MIN_HEADING`-:tg-const:`telegram.Location.MAX_HEADING`.
            For active live locations only.
        proximity_alert_radius (:obj:`int`, optional): Maximum distance for proximity alerts about
            approaching another chat member, in meters. For sent live locations only.

    Attributes:
        longitude (:obj:`float`): Longitude as defined by the sender.
        latitude (:obj:`float`): Latitude as defined by the sender.
        horizontal_accuracy (:obj:`float`): Optional. The radius of uncertainty for the location,
            measured in meters; 0-:tg-const:`telegram.Location.HORIZONTAL_ACCURACY`.
        live_period (:obj:`int` | :class:`datetime.timedelta`): Optional. Time relative to the
            message sending date, during which the location can be updated, in seconds. For active
            live locations only.

            .. deprecated:: v22.2
                |time-period-int-deprecated|
        heading (:obj:`int`): Optional. The direction in which user is moving, in degrees;
            :tg-const:`telegram.Location.MIN_HEADING`-:tg-const:`telegram.Location.MAX_HEADING`.
            For active live locations only.
        proximity_alert_radius (:obj:`int`): Optional. Maximum distance for proximity alerts about
            approaching another chat member, in meters. For sent live locations only.

    )Ú_live_periodÚheadingÚhorizontal_accuracyÚlatitudeÚ	longitudeÚproximity_alert_radiusN©Ú
api_kwargsr   r   r   Úlive_periodr   r   r   c                   s\   t ƒ j|d� || _|| _|| _t|ƒ| _|| _|rt|ƒnd | _	| j| jf| _
|  ¡  d S )Nr   )ÚsuperÚ__init__r   r   r   r   r
   r   Úintr   Ú	_id_attrsÚ_freeze)Úselfr   r   r   r   r   r   r   ©Ú	__class__© úS/var/www/kodo/tsheker/venv/lib/python3.10/site-packages/telegram/_files/location.pyr   R   s   
ÿzLocation.__init__Úreturnc                 C   s   t | jdd�S )Nr   )Ú	attribute)r   r
   )r   r   r   r   r   n   s   zLocation.live_periodÚHORIZONTAL_ACCURACYÚMIN_HEADINGÚMAX_HEADING)NNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Úfloatr   r   r   r   ÚpropertyÚdtmÚ	timedeltar   r   ÚLocationLimitr   r   Ú__annotations__r    r!   Ú__classcell__r   r   r   r   r	      s@   
 )ù	÷þýüûúù	÷r	   )r%   Údatetimer)   Útypingr   Útelegramr   Útelegram._telegramobjectr   Útelegram._utils.argumentparsingr   Útelegram._utils.datetimer   Útelegram._utils.typesr   r   r	   r   r   r   r   Ú<module>   s   