
    'i                         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 dd	lmZ dd
lmZmZ  G d de
      Z G d de      Z G d de      Zy)zCThis module contains objects that represent paid media in Telegram.    N)Final)	constants)	InputFile)TelegramObject)enum)to_timedeltaparse_file_input)	FileInputJSONDictc                        e Zd ZU dZdZej                  j                  Zee	   e
d<   	 ej                  j                  Zee	   e
d<   	 ddde	dedz  d	df fd
Zeded	e	ez  fd       Z xZS )InputStoryContentaN  This object describes the content of a story to post. Currently, it can be one of:

    * :class:`telegram.InputStoryContentPhoto`
    * :class:`telegram.InputStoryContentVideo`

    .. versionadded:: 22.1

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

    Attributes:
        type (:obj:`str`): Type of the content.
    )typePHOTOVIDEON
api_kwargsr   r   returnc                    t         |   |       t        j                  t        j
                  ||      | _        | j                          y )Nr   )super__init__r   
get_memberr   InputStoryContentTyper   _freeze)selfr   r   	__class__s      l/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/telegram/_files/_inputstorycontent.pyr   zInputStoryContent.__init__7   s9     	J/)H)H$PTU	    
file_inputc                     t        | dd      S )NT)attach
local_moder	   )r   s    r   _parse_file_inputz#InputStoryContent._parse_file_inputB   s      
4DIIr   )__name__
__module____qualname____doc__	__slots__r   r   r   r   str__annotations__r   r   r   staticmethodr   r   r#   __classcell__r   s   @r   r   r   !   s     I!77==E5:=A!77==E5:=A '+			 tO		
 
	 Ji JC)O J Jr   r   c                   @     e Zd ZdZdZdddededz  ddf fdZ xZS )	InputStoryContentPhotoa  Describes a photo to post as a story.

    .. versionadded:: 22.1

    Args:
        photo (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,             optional): The photo to post as a story. The photo must be of the
            size :tg-const:`telegram.constants.InputStoryContentLimit.PHOTO_WIDTH`
            x :tg-const:`telegram.constants.InputStoryContentLimit.PHOTO_HEIGHT` and must not
            exceed :tg-const:`telegram.constants.InputStoryContentLimit.PHOTOSIZE_UPLOAD` MB.
            |uploadinputnopath|.

    Attributes:
        type (:obj:`str`): Type of the content, must be :attr:`~telegram.InputStoryContent.PHOTO`.
        photo (:class:`telegram.InputFile`): The photo to post as a story. The photo must be of the
            size :tg-const:`telegram.constants.InputStoryContentLimit.PHOTO_WIDTH`
            x :tg-const:`telegram.constants.InputStoryContentLimit.PHOTO_HEIGHT` and must not
            exceed :tg-const:`telegram.constants.InputStoryContentLimit.PHOTOSIZE_UPLOAD` MB.

    )photoNr   r0   r   r   c                    t         |   t        j                  |       | j	                         5  | j                  |      | _        d d d        y # 1 sw Y   y xY wN)r   r   )r   r   r   r   	_unfrozenr#   r0   )r   r0   r   r   s      r   r   zInputStoryContentPhoto.__init__a   sS     	/55*M^^ 	H*.*@*@*GDJ	H 	H 	Hs   AA)	r$   r%   r&   r'   r(   r   r   r   r,   r-   s   @r   r/   r/   I   sC    * I '+		H	H tO		H
 
	H 	Hr   r/   c                        e Zd ZdZdZ	 	 	 ddddedeej                  z  dz  deej                  z  dz  de	dz  d	e
dz  d
df fdZ xZS )InputStoryContentVideoa	  
    Describes a video to post as a story.

    .. versionadded:: 22.1

    Args:
        video (:term:`file object` | :obj:`bytes` | :class:`pathlib.Path` | :obj:`str`,             optional): The video to post as a story. The video must be of
            the size :tg-const:`telegram.constants.InputStoryContentLimit.VIDEO_WIDTH`
            x :tg-const:`telegram.constants.InputStoryContentLimit.VIDEO_HEIGHT`,
            streamable, encoded with ``H.265`` codec, with key frames added
            each second in the ``MPEG4`` format, and must not exceed
            :tg-const:`telegram.constants.InputStoryContentLimit.VIDEOSIZE_UPLOAD` MB.
            |uploadinputnopath|.
        duration (:class:`datetime.timedelta` | :obj:`int` | :obj:`float`, optional): Precise
            duration of the video in seconds;
            0-:tg-const:`telegram.constants.InputStoryContentLimit.MAX_VIDEO_DURATION`
        cover_frame_timestamp (:class:`datetime.timedelta` | :obj:`int` | :obj:`float`, optional):
            Timestamp in seconds of the frame that will be used as the static cover for the story.
            Defaults to ``0.0``.
        is_animation (:obj:`bool`, optional): Pass :obj:`True` if the video has no sound

    Attributes:
        type (:obj:`str`): Type of the content, must be :attr:`~telegram.InputStoryContent.VIDEO`.
        video (:class:`telegram.InputFile`): The video to post as a story. The video must be of
            the size :tg-const:`telegram.constants.InputStoryContentLimit.VIDEO_WIDTH`
            x :tg-const:`telegram.constants.InputStoryContentLimit.VIDEO_HEIGHT`,
            streamable, encoded with ``H.265`` codec, with key frames added
            each second in the ``MPEG4`` format, and must not exceed
            :tg-const:`telegram.constants.InputStoryContentLimit.VIDEOSIZE_UPLOAD` MB.
        duration (:class:`datetime.timedelta`): Optional. Precise duration of the video in seconds;
            0-:tg-const:`telegram.constants.InputStoryContentLimit.MAX_VIDEO_DURATION`
        cover_frame_timestamp (:class:`datetime.timedelta`): Optional. Timestamp in seconds of the
            frame that will be used as the static cover for the story. Defaults to ``0.0``.
        is_animation (:obj:`bool`): Optional. Pass :obj:`True` if the video has no sound
    )cover_frame_timestampdurationis_animationvideoNr   r9   r7   r6   r8   r   r   c                   t         |   t        j                  |       | j	                         5  | j                  |      | _        t        |      | _        t        |      | _	        || _
        d d d        y # 1 sw Y   y xY wr2   )r   r   r   r   r3   r#   r9   r   r7   r6   r8   )r   r9   r7   r6   r8   r   r   s         r   r   zInputStoryContentVideo.__init__   sq     	/55*M^^ 	:*.*@*@*GDJ2>x2HDM?KLa?bD&-9D		: 	: 	:s   >A88B)NNN)r$   r%   r&   r'   r(   r   floatdtm	timedeltaboolr   r   r,   r-   s   @r   r5   r5   m   s    #J OI
 26>B$(: '+:: #--'$.:  %s}}4t;	:
 Tk: tO: 
: :r   r5   )r'   datetimer<   typingr   telegramr   telegram._files.inputfiler   telegram._telegramobjectr   telegram._utilsr   telegram._utils.argumentparsingr   telegram._utils.filesr
   telegram._utils.typesr   r   r   r/   r5    r   r   <module>rI      sR   & J    / 3   8 2 5%J %JP!H. !HH7:. 7:r   