o
    "h                     @   s   d Z ddlZddlmZmZ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 dd	lmZmZ er>dd
lmZ G dd de
ZG dd deZG dd deZdS )zSThis module contains an objects that represents a InputProfilePhoto and subclasses.    N)TYPE_CHECKINGOptionalUnion)	constants)TelegramObject)enum)to_timedelta)parse_file_input)	FileInputJSONDict)	InputFilec                       sL   e Zd ZdZejjZ	 ejjZ	 dZddde	de
e f fddZ  ZS )	InputProfilePhotoaD  This object describes a profile photo to set. Currently, it can be one of

    * :class:`InputProfilePhotoStatic`
    * :class:`InputProfilePhotoAnimated`

    .. versionadded:: 22.1

    Args:
        type (:obj:`str`): Type of the profile photo.

    Attributes:
        type (:obj:`str`): Type of the profile photo.

    )typeN
api_kwargsr   r   c                   s,   t  j|d ttj||| _|   d S )Nr   )super__init__r   
get_memberr   InputProfilePhotoTyper   _freeze)selfr   r   	__class__ T/var/www/html/venv/lib/python3.10/site-packages/telegram/_files/inputprofilephoto.pyr   :   s   zInputProfilePhoto.__init__)__name__
__module____qualname____doc__r   r   STATICANIMATED	__slots__strr   r   r   __classcell__r   r   r   r   r   #   s    r   c                       s8   e Zd ZdZdZdddedee f fddZ  Z	S )	InputProfilePhotoStatica  A static profile photo in the .JPG format.

    .. versionadded:: 22.1

    Args:
        photo (:term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path`): The static profile photo. |uploadinputnopath|

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputProfilePhotoType.STATIC`.
        photo (:class:`telegram.InputFile` | :obj:`str`): The static profile photo.

    )photoNr   r%   r   c                   sR   t  jtjj|d |   t|ddd| _W d    d S 1 s"w   Y  d S N)r   r   T)attach
local_mode)r   r   r   r   r   	_unfrozenr	   r%   )r   r%   r   r   r   r   r   W   s   

"z InputProfilePhotoStatic.__init__)
r   r   r   r   r!   r
   r   r   r   r#   r   r   r   r   r$   F   s    r$   c                	       sL   e Zd ZdZdZ	d
dddedeeej	df de
e f fdd	Z  ZS )InputProfilePhotoAnimatedab  An animated profile photo in the MPEG4 format.

    .. versionadded:: 22.1

    Args:
        animation (:term:`file object` | :class:`~telegram.InputFile` | :obj:`bytes` |             :class:`pathlib.Path`): The animated profile photo. |uploadinputnopath|
        main_frame_timestamp (:class:`datetime.timedelta` | :obj:`int` | :obj:`float`, optional):
            Timestamp in seconds of the frame that will be used as the static profile photo.
            Defaults to ``0.0``.

    Attributes:
        type (:obj:`str`): :tg-const:`telegram.constants.InputProfilePhotoType.ANIMATED`.
        animation (:class:`telegram.InputFile` | :obj:`str`): The animated profile photo.
        main_frame_timestamp (:class:`datetime.timedelta`): Optional. Timestamp in seconds of the
            frame that will be used as the static profile photo. Defaults to ``0.0``.
    )	animationmain_frame_timestampNr   r+   r,   r   c                   s\   t  jtjj|d |   t|ddd| _t|| _	W d    d S 1 s'w   Y  d S r&   )
r   r   r   r   r    r)   r	   r+   r   r,   )r   r+   r,   r   r   r   r   r   {   s   
"z"InputProfilePhotoAnimated.__init__)N)r   r   r   r   r!   r
   r   floatdtm	timedeltar   r   r   r#   r   r   r   r   r*   f   s    r*   )r   datetimer.   typingr   r   r   telegramr   telegram._telegramobjectr   telegram._utilsr   telegram._utils.argumentparsingr   telegram._utils.filesr	   telegram._utils.typesr
   r   r   r   r$   r*   r   r   r   r   <module>   s   # 