HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/tweepy/__pycache__/tweet.cpython-310.pyc
o

+we�&�@s`ddlZddlmZmZddlmZgd�Zegd�ZGdd�dee�ZGdd	�d	ee�Z	dS)
�N)�DataMapping�
HashableID)�parse_datetime)�attachments�	author_id�context_annotations�conversation_id�
created_at�
edit_controls�edit_history_tweet_ids�entities�geo�id�in_reply_to_user_id�lang�possibly_sensitive�public_metrics�referenced_tweets�reply_settings�source�text�withheld)�non_public_metrics�organic_metrics�promoted_metricsc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�Tweetu+Tweets are the basic building block of all things Twitter. The Tweet
    object has a long list of ‘root-level’ fields, such as ``id``, ``text``,
    and ``created_at``. Tweet objects are also the ‘parent’ object to several
    child objects including ``user``, ``media``, ``poll``, and ``place``. Use
    the field parameter ``tweet.fields`` when requesting these root-level
    fields on the Tweet object.

    The Tweet object that can be found and expanded in the user resource.
    Additional Tweets related to the requested Tweet can also be found and
    expanded in the Tweet resource. The object is available for expansion with
    ``?expansions=pinned_tweet_id`` in the user resource or
    ``?expansions=referenced_tweets.id`` in the Tweet resource to get the
    object with only default fields. Use the expansion with the field
    parameter: ``tweet.fields`` when requesting additional fields to complete
    the object.

    .. versionadded:: 4.0

    .. versionchanged:: 4.11
        Added ``edit_history_tweet_ids`` and ``edit_controls`` fields

    Attributes
    ----------
    data : dict
        The JSON data representing the Tweet.
    id : int
        The unique identifier of the requested Tweet.
    text : str
        The actual UTF-8 text of the Tweet. See `twitter-text`_ for details on
        what characters are currently considered valid.
    edit_history_tweet_ids : list[int]
        Unique identifiers indicating all versions of a Tweet. For Tweets with
        no edits, there will be one ID. For Tweets with an edit history, there
        will be multiple IDs, arranged in ascending order reflecting the order
        of edits. The most recent version is the last position of the array.
    attachments : dict | None
        Specifies the type of attachments (if any) present in this Tweet.
    author_id : int | None
        The unique identifier of the User who posted this Tweet.
    context_annotations : list
        Contains context annotations for the Tweet.
    conversation_id : int | None
        The Tweet ID of the original Tweet of the conversation (which includes
        direct replies, replies of replies).
    created_at : datetime.datetime | None
        Creation time of the Tweet.
    edit_controls : dict | None
        When present, this indicates how much longer the Tweet can be edited
        and the number of remaining edits. Tweets are only editable for the
        first 30 minutes after creation and can be edited up to five times.
    entities : dict | None
        Entities which have been parsed out of the text of the Tweet.
        Additionally see entities in Twitter Objects.
    geo : dict | None
        Contains details about the location tagged by the user in this Tweet,
        if they specified one.
    in_reply_to_user_id : int | None
        If the represented Tweet is a reply, this field will contain the
        original Tweet’s author ID. This will not necessarily always be the
        user directly mentioned in the Tweet.
    lang : str | None
        Language of the Tweet, if detected by Twitter. Returned as a BCP47
        language tag.
    non_public_metrics : dict | None
        Non-public engagement metrics for the Tweet at the time of the request. 

        Requires user context authentication.
    organic_metrics : dict | None
        Engagement metrics, tracked in an organic context, for the Tweet at the
        time of the request.

        Requires user context authentication.
    possibly_sensitive : bool | None
        This field only surfaces when a Tweet contains a link. The meaning of
        the field doesn’t pertain to the Tweet content itself, but instead it
        is an indicator that the URL contained in the Tweet may contain content
        or media identified as sensitive content. 
    promoted_metrics : dict | None
        Engagement metrics, tracked in a promoted context, for the Tweet at the
        time of the request.

        Requires user context authentication.
    public_metrics : dict | None
        Public engagement metrics for the Tweet at the time of the request.
    referenced_tweets : list[ReferencedTweet] | None
        A list of Tweets this Tweet refers to. For example, if the parent Tweet
        is a Retweet, a Retweet with comment (also known as Quoted Tweet) or a
        Reply, it will include the related Tweet referenced to by its parent.
    reply_settings : str | None
        Shows you who can reply to a given Tweet. Fields returned are
        "everyone", "mentioned_users", and "followers".
    source : str | None
        The name of the app the user Tweeted from.

        .. note::

            As of December 20, 2022, this field has been removed from the Tweet
            payload. [#]_
    withheld : dict | None
        When present, contains withholding details for `withheld content`_.

    References
    ----------
    https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet

    .. _twitter-text: https://github.com/twitter/twitter-text/
    .. _withheld content: https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country
    )�datarrrrrrrr	r
rr
rrrrrrrrrrrcCs�||_t|d�|_|d|_zttt|d��|_Wnty,tj	dt
dd�Ynw|�d�|_|�d�|_
|j
durDt|j
�|_
|�d	g�|_|�d
�|_|jdur\t|j�|_|�d�|_|jdurmt|j�|_|�d�|_|jdur�t|jd
�|jd
<t|jd�|jd<|�d�|_|�d�|_|�d�|_|jdur�t|j�|_|�d�|_|�d�|_|�d�|_|�d�|_|�d�|_|�d�|_|�d�|_|jdur�dd�|jD�|_|�d�|_|�d�|_|�d�|_dS)Nrrrz7Tweet data missing default edit_history_tweet_ids field�)�
stacklevelrrrrr	r
�edits_remaining�editable_untilrr
rrrrrrrrcSsg|]}t|��qS�)�ReferencedTweet)�.0�referenced_tweetr!r!�E/home/arjun/projects/env/lib/python3.10/site-packages/tweepy/tweet.py�
<listcomp>�s��z"Tweet.__init__.<locals>.<listcomp>rrr) r�intrr�list�mapr�KeyError�warnings�warn�RuntimeWarning�getrrrrr	rr
rr
rrrrrrrrrrr��selfrr!r!r%�__init__�sh

�
��




�
�

�zTweet.__init__cCs
t|j�S�N)�lenr�r0r!r!r%�__len__�s
z
Tweet.__len__cCsd|j�dt|j��d�S)Nz
<Tweet id=z text=�>)r�reprrr4r!r!r%�__repr__�szTweet.__repr__cCs|jSr2)rr4r!r!r%�__str__�sz
Tweet.__str__N)	�__name__�
__module__�__qualname__�__doc__�	__slots__r1r5r8r9r!r!r!r%r*sm	Arc@s$eZdZdZdZdd�Zdd�ZdS)r"a�.. versionadded:: 4.0

    .. versionchanged:: 4.12
        Changed ``type`` to be optional

    Attributes
    ----------
    data : dict
        The JSON data representing the referenced Tweet.
    id : int
        The unique identifier of the referenced Tweet.
    type : str | None

    References
    ----------
    https://developer.twitter.com/en/docs/twitter-api/data-dictionary/object-model/tweet
    )rr�typecCs$||_t|d�|_|�d�|_dS)Nrr?)rr'rr.r?r/r!r!r%r1szReferencedTweet.__init__cCs2d|j��}|jdur|d|j��7}|d7}|S)Nz<ReferencedTweet id=z type=r6)rr?)r0�representationr!r!r%r8s

zReferencedTweet.__repr__N)r:r;r<r=r>r1r8r!r!r!r%r"�s
r")
r+�
tweepy.mixinsrr�tweepy.utilsr�PUBLIC_TWEET_FIELDS�TWEET_FIELDSrr"r!r!r!r%�<module>sC