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/lib/python3.10/site-packages/tweepy/__pycache__/client.cpython-310.pyc
o

+we�F�@sHddlmZddlZzddlmZWney&ddlmZedd�ZYnwddlZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZdd	lmZmZmZmZmZmZmZdd
lmZddlmZddlmZdd
l m!Z!ddl"m#Z#ddl$m%Z%ddl&m'Z'e�(e)�Z*edd�Z+Gdd�d�Z,Gdd�de,�Z-dS)�)�
namedtupleN)�cache)�	lru_cache)�maxsize)�python_version)�OAuth1UserHandler)�DirectMessageEvent)�
BadRequest�	Forbidden�
HTTPException�NotFound�TooManyRequests�TwitterServerError�Unauthorized)�List��Media��Place��Poll)�Space��Tweet��User�Response)�data�includes�errors�metac@sdeZdZ		dedd�dd�Zddd�Ziddddfd	d
�Zddd�Zdd
d�Zdd�Z	dd�Z
dS)�
BaseClientNF)�return_type�wait_on_rate_limitcCsV||_||_||_||_||_||_||_t��|_	dt
��dtj�dtj��|_
dS)NzPython/z
 Requests/z Tweepy/)�bearer_token�consumer_key�consumer_secret�access_token�access_token_secretr"r#�requests�Session�sessionr�__version__�tweepy�
user_agent)�selfr$r%r&r'r(r"r#�r0�F/home/arjun/projects/env/lib/python3.10/site-packages/tweepy/client.py�__init__+s

���zBaseClient.__init__cCs�d}d|ji}d}|rt|j|j|j|j�}|��}nd|j��|d<t�	d|�d||�d|�d|�d	|��
�|j
j|||||||d
���}	t�	d|	j�d|	j
�d|	j�d|	j���|	jd
krft|	��|	jdkrot|	��|	jdkrxt|	��|	jdkr�t|	��|	jdkr�|jr�t|	jd�}
|
tt���d}|dkr�t�d|�d��t�|�|�|||||�Wd�St|	��|	jdkr�t|	��d|	jkr�dks�t|	��t|	��|	Wd�S1s�wYdS)Nzhttps://api.twitter.comz
User-AgentzBearer �
AuthorizationzMaking API request: � z
Parameters: z

Headers: z
Body: )�params�json�headers�authzReceived API response: z

Content: i�i�i�i�i�zx-rate-limit-reset�rz"Rate limit exceeded. Sleeping for z	 seconds.i���i,)r.rr%r&r'r(�
apply_authr$�log�debugr+�request�status_code�reasonr7�contentr	rr
rr#�int�time�warning�sleepr
rr)r/�method�router5r6�	user_auth�hostr7r8�response�
reset_time�
sleep_timer0r0r1r>@s�
�
����������




��
�
�$�zBaseClient.requestr0c
CsT|�||�}|j|||||d�}	|jtjur|	S|	��}	|jtur#|	S|j|	|d�S)N)r5r6rH��	data_type)�_process_paramsr>r"r)rr6�dict�_construct_response)
r/rFrGr5�endpoint_parametersr6rNrH�request_paramsrJr0r0r1�
_make_request{s
�
zBaseClient._make_requestcCsT|�d�}|j||d�}|�di�}|�|�}|�dg�}|�di�}t||||�S)NrrMrrr )�get�
_process_data�_process_includesr)r/rJrNrrrr r0r0r1rQ�s

zBaseClient._construct_responsecs<�durt|t�r�fdd�|D�}|S|dur�|�}|S)Ncsg|]}�|��qSr0r0)�.0�resultrMr0r1�
<listcomp>��z,BaseClient._process_data.<locals>.<listcomp>)�
isinstance�list)r/rrNr0rMr1rV�s
�zBaseClient._process_datacCs�d|vrdd�|dD�|d<d|vrdd�|dD�|d<d|vr-dd�|dD�|d<d|vr<d	d�|dD�|d<d
|vrKdd�|d
D�|d
<|S)N�mediacS�g|]}t|��qSr0r)rXr^r0r0r1rZ�r[z0BaseClient._process_includes.<locals>.<listcomp>�placescSr_r0r)rX�placer0r0r1rZ�r[�pollscSr_r0r)rX�pollr0r0r1rZ�r[�tweetscSr_r0r)rX�tweetr0r0r1rZ�r[�userscSr_r0r)rX�userr0r0r1rZ�r[r0)r/rr0r0r1rW�szBaseClient._process_includesc	Cs�dd�|D�}i}|��D]N\}}z||}Wnty(t�d|���Ynwt|t�r9d�tt|��||<q
t|t	j	�rS|j
durK|�t	jj
�}|�d�||<q
|dur[|||<q
|S)NcSsi|]	}|�dd�|�qS)�.�_)�replace)rX�endpoint_parameterr0r0r1�
<dictcomp>�s��z.BaseClient._process_params.<locals>.<dictcomp>zUnexpected parameter: �,z%Y-%m-%dT%H:%M:%SZ)�items�KeyErrorr<�warnr\r]�join�map�str�datetime�tzinfo�
astimezone�timezone�utc�strftime)r/r5rRrS�
param_name�param_valuer0r0r1rO�s,��


��zBaseClient._process_params)NNNNN)NNF)N)�__name__�
__module__�__qualname__rr2r>rTrQrVrWrOr0r0r0r1r!)s��
<
�


r!c@s�eZdZdZdd�dd�Zedd��Zedd	��Zd
d�Zdd
�Z	dd�Z
dd�dd�Zdd�dd�Zdd�dd�Z
dd�dd�Zdd�dd�Zdd�dd�Zdd�dd�Zd d d d d d d d d d d d dd!�
d"d#�Zdd�d$d%�Zdd�d&d'�Zdd�d(d)�Zdd�d*d+�Zd,d-�Zdd�d.d/�Zdd�d0d1�Zdd�d2d3�Zdd�d4d5�Zd6d7�Zd8d9�Zdd�d:d;�Zdd�d<d=�Zdd�d>d?�Z dd�d@dA�Z!dd�dBdC�Z"dd�dDdE�Z#dd�dFdG�Z$dd�dHdI�Z%dd�dJdK�Z&dd�dLdM�Z'dd�dNdO�Z(dd�dPdQ�Z)dd�dRdS�Z*dd�dTdU�Z+d d ddV�dWdX�Z,d d ddY�dZd[�Z-dd�d\d]�Z.d^d_�Z/d d d`�dadb�Z0dcdd�Z1dedf�Z2dgdh�Z3d d ddi�djdk�Z4e4Z5d d d d ddl�dmdn�Z6e6Z7d d ddo�dpdq�Z8e8Z9dd�drds�Z:dd�dtdu�Z;dd�dvdw�Z<dd�dxdy�Z=dd�dzd{�Z>dd�d|d}�Z?dd�d~d�Z@dd�d�d��ZAdd�d�d��ZBdd�d�d��ZCdd�d�d��ZDdd�d�d��ZEd d d dd��d�d��ZFd d dd��d�d��ZGdd�d�d��ZHdd�d�d��ZIdd�d�d��ZJd�d��ZKd�d��ZLd d d��d�d��ZMd S)��Clienta0Client(         bearer_token=None, consumer_key=None, consumer_secret=None,         access_token=None, access_token_secret=None, *, return_type=Response,         wait_on_rate_limit=False     )

    Twitter API v2 Client

    .. versionadded:: 4.0

    Parameters
    ----------
    bearer_token : str | None
        Twitter API OAuth 2.0 Bearer Token / Access Token
    consumer_key : str | None
        Twitter API OAuth 1.0a Consumer Key
    consumer_secret : str | None
        Twitter API OAuth 1.0a Consumer Secret
    access_token : str | None
        Twitter API OAuth 1.0a Access Token
    access_token_secret : str | None
        Twitter API OAuth 1.0a Access Token Secret
    return_type : type[dict | requests.Response | Response]
        Type to return from requests to the API
    wait_on_rate_limit : bool
        Whether to wait when rate limit is reached

    Attributes
    ----------
    session : requests.Session
        Requests Session used to make requests to the API
    user_agent : str
        User agent used when making requests to the API
    F��oauth_1cCs@|r|jdurtd��|�|j�S|jdurtd��|�|j�S)Nz9Access Token must be provided for OAuth 1.0a User ContextzMAccess Token must be provided for OAuth 2.0 Authorization Code Flow with PKCE)r'�	TypeError�#_get_oauth_1_authenticating_user_idr$�#_get_oauth_2_authenticating_user_id)r/r�r0r0r1�_get_authenticating_user_id�s
��
��z"Client._get_authenticating_user_idcCs|�d�dS)N�-r)�	partition)r/r'r0r0r1r�sz*Client._get_oauth_1_authenticating_user_idcCs<|j}|j}||_t|_|jdd�dd}||_||_|S)NF�rHr�id)r$r"rP�get_me)r/r'�original_access_token�original_return_type�user_idr0r0r1r�sz*Client._get_oauth_2_authenticating_user_idcCs$|��}d|�d|��}|�d|�S)aVAllows a user or authenticated user ID to remove a Bookmark of a
        Tweet.

        .. note::

            A request is made beforehand to Twitter's API to determine the
            authenticating user's ID. This is cached and only done once per
            :class:`Client` instance for each access token used.

        .. versionadded:: 4.8

        Parameters
        ----------
        tweet_id : int | str
            The ID of the Tweet that you would like the ``id`` to remove a
            Bookmark of.

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/delete-users-id-bookmarks-tweet_id
        �	/2/users/z/bookmarks/�DELETE�r�rT�r/�tweet_idr�rGr0r0r1�remove_bookmarks
�zClient.remove_bookmarkcKs(|��}d|�d�}|jd||dtd�S)a%get_bookmarks(             *, expansions=None, max_results=None, media_fields=None,             pagination_token=None, place_fields=None, poll_fields=None,             tweet_fields=None, user_fields=None         )

        Allows you to get an authenticated user's 800 most recent bookmarked
        Tweets.

        .. note::

            A request is made beforehand to Twitter's API to determine the
            authenticating user's ID. This is cached and only done once per
            :class:`Client` instance for each access token used.

        .. versionadded:: 4.8

        Parameters
        ----------
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the ``next_token``
            returned in your previous response. To go back one page, pass the
            ``previous_token`` returned in your previous response.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/get-users-id-bookmarks
        r��
/bookmarks�GET��
expansions�max_results�media.fields�pagination_token�place.fields�poll.fields�tweet.fields�user.fields�r5rRrN�r�rTr)r/r5r�rGr0r0r1�
get_bookmarks>s8�zClient.get_bookmarkscCs,|��}d|�d�}|jd|dt|�id�S)aVCauses the authenticating user to Bookmark the target Tweet provided
        in the request body.

        .. note::

            A request is made beforehand to Twitter's API to determine the
            authenticating user's ID. This is cached and only done once per
            :class:`Client` instance for each access token used.

        .. versionadded:: 4.8

        Parameters
        ----------
        tweet_id : int | str
            The ID of the Tweet that you would like the user ``id`` to
            Bookmark.

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/post-users-id-bookmarks
        r�r��POSTr��r6�r�rTrsr�r0r0r1�bookmark�s
�zClient.bookmarkTr�cC�|jdd|�d�ddi|d�S)a�Hides a reply to a Tweet.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        id : int | str
            Unique identifier of the Tweet to hide. The Tweet must belong to a
            conversation initiated by the authenticating user.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/hide-replies/api-reference/put-tweets-id-hidden
        �PUT�
/2/tweets/�/hidden�hiddenT�r6rH�rT�r/r�rHr0r0r1�
hide_reply���zClient.hide_replycCr�)a�Unhides a reply to a Tweet.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        id : int | str
            Unique identifier of the Tweet to unhide. The Tweet must belong to
            a conversation initiated by the authenticating user.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/hide-replies/api-reference/put-tweets-id-hidden
        r�r�r�r�Fr�r�r�r0r0r1�unhide_reply�r�zClient.unhide_replycC�,|j|d�}d|�d|��}|jd||d�S)aTUnlike a Tweet.

        The request succeeds with no action when the user sends a request to a
        user they're not liking the Tweet or have already unliked the Tweet.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        tweet_id : int | str
            The ID of the Tweet that you would like to unlike.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/delete-users-id-likes-tweet_id
        r�r�z/likes/r�r�r��r/r�rHr�rGr0r0r1�unlike��
*�z
Client.unlikecK�|jdd|�d�|dt|d�S)u�get_liking_users(             id, *, expansions=None, max_results=None, media_fields=None,             pagination_token=None, place_fields=None, poll_fields=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Allows you to get information about a Tweet’s liking users.

        .. versionchanged:: 4.6
            Added ``max_results`` and ``pagination_token`` parameters

        Parameters
        ----------
        id : int | str
            Tweet ID of the Tweet to request liking users of.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the ``next_token``
            returned in your previous response. To go back one page, pass the
            ``previous_token`` returned in your previous response.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/get-tweets-id-liking_users
        r�r�z
/liking_usersr��r5rRrNrH�rTr�r/r�rHr5r0r0r1�get_liking_users�
1�zClient.get_liking_userscKr�)u3get_liked_tweets(             id, *, expansions=None, max_results=None, media_fields=None,             pagination_token=None, place_fields=None, poll_fields=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Allows you to get information about a user’s liked Tweets.

        The Tweets returned by this endpoint count towards the Project-level
        `Tweet cap`_.

        Parameters
        ----------
        id : int | str
            User ID of the user to request liked Tweets for.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 5 and 100. By default, each page will return 100
            results.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the ``next_token``
            returned in your previous response. To go back one page, pass the
            ``previous_token`` returned in your previous response.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/get-users-id-liked_tweets

        .. _Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
        r�r�z
/liked_tweetsr�r��rTrr�r0r0r1�get_liked_tweetsMs
3�zClient.get_liked_tweetscC�2|j|d�}d|�d�}|jd|dt|�i|d�S)a�Like a Tweet.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        tweet_id : int | str
            The ID of the Tweet that you would like to Like.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-id-likes
        r�r�z/likesr�r�r�r�r�r0r0r1�like��'�zClient.likecC�|jdd|��|d�S)aSAllows an authenticated user ID to delete a Tweet.

        .. versionadded:: 4.3

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        id : int | str
            The Tweet ID you are deleting.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/delete-tweets-id
        r�r�r�r�r�r0r0r1�delete_tweet�s�zClient.delete_tweetN)
�direct_message_deep_link�for_super_followers_only�place_id�	media_ids�media_tagged_user_ids�poll_duration_minutes�poll_options�quote_tweet_id�exclude_reply_user_ids�in_reply_to_tweet_id�reply_settings�textrHc
Csi}|dur
||d<|dur||d<|durd|i|d<|dur:ddd�|D�i|d	<|dur:d
d�|D�|d	d<|durNd|i|d
<|durN||d
d<|durXt|�|d<|
dursdt|
�i|d<|	dursdd�|	D�|dd<|dur{||d<|dur�||d<|jdd||
d�S)uyCreates a Tweet on behalf of an authenticated user.

        .. versionadded:: 4.3

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        direct_message_deep_link : str | None
            `Tweets a link directly to a Direct Message conversation`_ with an
            account.
        for_super_followers_only : bool | None
            Allows you to Tweet exclusively for `Super Followers`_.
        place_id : str | None
            Place ID being attached to the Tweet for geo location.
        media_ids : list[int | str] | None
            A list of Media IDs being attached to the Tweet. This is only
            required if the request includes the ``tagged_user_ids``.
        media_tagged_user_ids : list[int | str] | None
            A list of User IDs being tagged in the Tweet with Media. If the
            user you're tagging doesn't have photo-tagging enabled, their names
            won't show up in the list of tagged users even though the Tweet is
            successfully created.
        poll_duration_minutes : int | None
            Duration of the poll in minutes for a Tweet with a poll. This is
            only required if the request includes ``poll.options``.
        poll_options : list[str] | None
            A list of poll options for a Tweet with a poll.
        quote_tweet_id : int | str | None
            Link to the Tweet being quoted.
        exclude_reply_user_ids : list[int | str] | None
            A list of User IDs to be excluded from the reply Tweet thus
            removing a user from a thread.
        in_reply_to_tweet_id : int | str | None
            Tweet ID of the Tweet being replied to. Please note that
            ``in_reply_to_tweet_id`` needs to be in the request if
            ``exclude_reply_user_ids`` is present.
        reply_settings : str | None
            `Settings`_ to indicate who can reply to the Tweet. Limited to
            "mentionedUsers" and "following". If the field isn’t specified, it
            will default to everyone.
        text : str | None
            Text of the Tweet being created. This field is required if
            ``media.media_ids`` is not present.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets

        .. _Tweets a link directly to a Direct Message conversation: https://business.twitter.com/en/help/campaign-editing-and-optimization/public-to-private-conversation.html
        .. _Super Followers: https://help.twitter.com/en/using-twitter/super-follows
        .. _Settings: https://blog.twitter.com/en_us/topics/product/2020/new-conversation-settings-coming-to-a-tweet-near-you
        Nr�r�r��geor�cSr_r0�rs)rX�media_idr0r0r1rZ%r[z'Client.create_tweet.<locals>.<listcomp>r^cSr_r0r�)rX�media_tagged_user_idr0r0r1rZ(����tagged_user_ids�optionsrc�duration_minutesr�r��replycSr_r0r�)rX�exclude_reply_user_idr0r0r1rZ8r�r�r�r�r��	/2/tweetsr�)rsrT)r/r�r�r�r�r�r�r�r�r�r�r�r�rHr6r0r0r1�create_tweet�sBC����zClient.create_tweetcKr�)a�	get_quote_tweets(             id, *, exclude=None, expansions=None, max_results=None,             media_fields=None, pagination_token=None, place_fields=None,             poll_fields=None, tweet_fields=None, user_fields=None,             user_auth=False         )

        Returns Quote Tweets for a Tweet specified by the requested Tweet ID.

        The Tweets returned by this endpoint count towards the Project-level
        `Tweet cap`_.

        .. versionadded:: 4.7

        .. versionchanged:: 4.11
            Added ``exclude`` parameter

        Parameters
        ----------
        id : int | str
            Unique identifier of the Tweet to request.
        exclude : list[str] | str | None
            Comma-separated list of the types of Tweets to exclude from the
            response.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            Specifies the number of Tweets to try and retrieve, up to a maximum
            of 100 per distinct request. By default, 10 results are returned if
            this parameter is not supplied. The minimum permitted value is 10.
            It is possible to receive less than the ``max_results`` per request
            throughout the pagination process.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            This parameter is used to move forwards through 'pages' of results,
            based on the value of the ``next_token``. The value used with the
            parameter is pulled directly from the response provided by the API,
            and should not be modified.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/quote-tweets/api-reference/get-tweets-id-quote_tweets

        .. _Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
        r�r�z
/quote_tweets)	�excluder�r�r�r�r�r�r�r�r�r�r�r0r0r1�get_quote_tweetsIs
=�zClient.get_quote_tweetscCr�)a�Allows an authenticated user ID to remove the Retweet of a Tweet.

        The request succeeds with no action when the user sends a request to a
        user they're not Retweeting the Tweet or have already removed the
        Retweet of.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        source_tweet_id : int | str
            The ID of the Tweet that you would like to remove the Retweet of.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/delete-users-id-retweets-tweet_id
        r�r�z
/retweets/r�r�r�)r/�source_tweet_idrHr�rGr0r0r1�	unretweet�s
+�zClient.unretweetcKr�)a�get_retweeters(             id, *, expansions=None, max_results=None, media_fields=None,             pagination_token=None, place_fields=None, poll_fields=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Allows you to get information about who has Retweeted a Tweet.

        .. versionchanged:: 4.6
            Added ``max_results`` and ``pagination_token`` parameters

        Parameters
        ----------
        id : int | str
            Tweet ID of the Tweet to request Retweeting users of.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the ``next_token``
            returned in your previous response. To go back one page, pass the
            ``previous_token`` returned in your previous response.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/get-tweets-id-retweeted_by
        r�r�z
/retweeted_byr�r�r�r�r0r0r1�get_retweeters�r�zClient.get_retweeterscCr�)a�Causes the user ID to Retweet the target Tweet.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        tweet_id : int | str
            The ID of the Tweet that you would like to Retweet.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets
        r�r�z	/retweetsr�r�r�r�r�r0r0r1�retweet�r�zClient.retweetcK�||d<|jdd|dtd�S)a�search_all_tweets(             query, *, end_time=None, expansions=None, max_results=None,             media_fields=None, next_token=None, place_fields=None,             poll_fields=None, since_id=None, sort_order=None,             start_time=None, tweet_fields=None, until_id=None,             user_fields=None         )

        This endpoint is only available to those users who have been approved
        for the `Academic Research product track`_.

        The full-archive search endpoint returns the complete history of public
        Tweets matching a search query; since the first Tweet was created March
        26, 2006.

        The Tweets returned by this endpoint count towards the Project-level
        `Tweet cap`_.

        .. note::

            By default, a request will return Tweets from up to 30 days ago if
            the ``start_time`` parameter is not provided.

        .. versionchanged:: 4.6
            Added ``sort_order`` parameter

        Parameters
        ----------
        query : str
            One query for matching Tweets. Up to 1024 characters.
        end_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). Used with ``start_time``.
            The newest, most recent UTC timestamp to which the Tweets will be
            provided. Timestamp is in second granularity and is exclusive (for
            example, 12:00:01 excludes the first second of the minute). If used
            without ``start_time``, Tweets from 30 days before ``end_time``
            will be returned by default. If not specified, ``end_time`` will
            default to [now - 30 seconds].
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of search results to be returned by a request. A
            number between 10 and the system limit (currently 500). By default,
            a request response will return 10 results.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        next_token : str | None
            This parameter is used to get the next 'page' of results. The value
            used with the parameter is pulled directly from the response
            provided by the API, and should not be modified. You can learn more
            by visiting our page on `pagination`_.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        since_id : int | str | None
            Returns results with a Tweet ID greater than (for example, more
            recent than) the specified ID. The ID specified is exclusive and
            responses will not include it. If included with the same request as
            a ``start_time`` parameter, only ``since_id`` will be used.
        sort_order : str | None
            This parameter is used to specify the order in which you want the
            Tweets returned. By default, a request will return the most recent
            Tweets first (sorted by recency).
        start_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp
            from which the Tweets will be provided. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute). By default, a request will return
            Tweets from up to 30 days ago if you do not include this parameter.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        until_id : int | str | None
            Returns results with a Tweet ID less than (that is, older than) the
            specified ID. Used with ``since_id``. The ID specified is exclusive
            and responses will not include it.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all

        .. _Academic Research product track: https://developer.twitter.com/en/docs/projects/overview#product-track
        .. _Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
        .. _pagination: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/paginate
        �queryr�z/2/tweets/search/all��end_timer�r�r��
next_tokenr�r�r��since_id�
sort_order�
start_timer��until_idr�r�r��r/r�r5r0r0r1�search_all_tweets.s\�zClient.search_all_tweetscK�||d<|jdd|dt|d�S)a�search_recent_tweets(             query, *, end_time=None, expansions=None, max_results=None,             media_fields=None, next_token=None, place_fields=None,             poll_fields=None, since_id=None, sort_order=None,             start_time=None, tweet_fields=None, until_id=None,             user_fields=None, user_auth=False         )

        The recent search endpoint returns Tweets from the last seven days that
        match a search query.

        The Tweets returned by this endpoint count towards the Project-level
        `Tweet cap`_.

        .. versionchanged:: 4.6
            Added ``sort_order`` parameter

        Parameters
        ----------
        query : str
            One rule for matching Tweets. If you are using a
            `Standard Project`_ at the Basic `access level`_, you can use the
            basic set of `operators`_ and can make queries up to 512 characters
            long. If you are using an `Academic Research Project`_ at the Basic
            access level, you can use all available operators and can make
            queries up to 1,024 characters long.
        end_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The newest, most recent
            UTC timestamp to which the Tweets will be provided. Timestamp is in
            second granularity and is exclusive (for example, 12:00:01 excludes
            the first second of the minute). By default, a request will return
            Tweets from as recent as 30 seconds ago if you do not include this
            parameter.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of search results to be returned by a request. A
            number between 10 and 100. By default, a request response will
            return 10 results.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        next_token : str | None
            This parameter is used to get the next 'page' of results. The value
            used with the parameter is pulled directly from the response
            provided by the API, and should not be modified.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        since_id : int | str | None
            Returns results with a Tweet ID greater than (that is, more recent
            than) the specified ID. The ID specified is exclusive and responses
            will not include it. If included with the same request as a
            ``start_time`` parameter, only ``since_id`` will be used.
        sort_order : str | None
            This parameter is used to specify the order in which you want the
            Tweets returned. By default, a request will return the most recent
            Tweets first (sorted by recency).
        start_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp
            (from most recent seven days) from which the Tweets will be
            provided. Timestamp is in second granularity and is inclusive (for
            example, 12:00:01 includes the first second of the minute). If
            included with the same request as a ``since_id`` parameter, only
            ``since_id`` will be used. By default, a request will return Tweets
            from up to seven days ago if you do not include this parameter.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        until_id : int | str | None
            Returns results with a Tweet ID less than (that is, older than) the
            specified ID. The ID specified is exclusive and responses will not
            include it.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent

        .. _Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
        .. _Standard Project: https://developer.twitter.com/en/docs/projects
        .. _access level: https://developer.twitter.com/en/products/twitter-api/early-access/guide.html#na_1
        .. _operators: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query
        .. _Academic Research Project: https://developer.twitter.com/en/docs/projects
        r�r�z/2/tweets/search/recentr�r�r�)r/r�rHr5r0r0r1�search_recent_tweets�s\�zClient.search_recent_tweetscKr�)a�get_users_mentions(             id, *, end_time=None, expansions=None, max_results=None,             media_fields=None, pagination_token=None, place_fields=None,             poll_fields=None, since_id=None, start_time=None,             tweet_fields=None, until_id=None, user_fields=None,             user_auth=False         )

        Returns Tweets mentioning a single user specified by the requested user
        ID. By default, the most recent ten Tweets are returned per request.
        Using pagination, up to the most recent 800 Tweets can be retrieved.

        The Tweets returned by this endpoint count towards the Project-level
        `Tweet cap`_.

        Parameters
        ----------
        id : int | str
            Unique identifier of the user for whom to return Tweets mentioning
            the user. User ID can be referenced using the `user/lookup`_
            endpoint. More information on Twitter IDs is `here`_.
        end_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The new UTC timestamp
            from which the Tweets will be provided. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute).

            Please note that this parameter does not support a millisecond
            value.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            Specifies the number of Tweets to try and retrieve, up to a maximum
            of 100 per distinct request. By default, 10 results are returned if
            this parameter is not supplied. The minimum permitted value is 5.
            It is possible to receive less than the ``max_results`` per request
            throughout the pagination process.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            This parameter is used to move forwards or backwards through
            'pages' of results, based on the value of the ``next_token`` or
            ``previous_token`` in the response. The value used with the
            parameter is pulled directly from the response provided by the API,
            and should not be modified.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        since_id : int | str | None
            Returns results with a Tweet ID greater than (that is, more recent
            than) the specified 'since' Tweet ID. There are limits to the
            number of Tweets that can be accessed through the API. If the limit
            of Tweets has occurred since the ``since_id``, the ``since_id``
            will be forced to the oldest ID available. More information on
            Twitter IDs is `here`_.
        start_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp
            from which the Tweets will be provided. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute).

            Please note that this parameter does not support a millisecond
            value.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        until_id : int | str | None
            Returns results with a Tweet ID less less than (that is, older
            than) the specified 'until' Tweet ID. There are limits to the
            number of Tweets that can be accessed through the API. If the limit
            of Tweets has occurred since the ``until_id``, the ``until_id``
            will be forced to the most recent ID available. More information on
            Twitter IDs is `here`_.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-mentions

        .. _Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
        .. _user/lookup: https://developer.twitter.com/en/docs/twitter-api/users/lookup/introduction
        .. _here: https://developer.twitter.com/en/docs/twitter-ids
        r�r�z	/mentions)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r0r0r1�get_users_mentions�s
[�zClient.get_users_mentionscK�.|j|d�}d|�d�}|jd||dt|d�S)a�get_home_timeline(             *, end_time=None, exclude=None, expansions=None,             max_results=None, media_fields=None, pagination_token=None,             place_fields=None, poll_fields=None, since_id=None,             start_time=None, tweet_fields=None, until_id=None,             user_fields=None, user_auth=True         )

        Allows you to retrieve a collection of the most recent Tweets and
        Retweets posted by you and users you follow. This endpoint returns up
        to the last 3200 Tweets.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        Parameters
        ----------
        end_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The new UTC timestamp
            from which the Tweets will be provided. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute).

            Please note that this parameter does not support a millisecond
            value.
        exclude : list[str] | str | None
            Comma-separated list of the types of Tweets to exclude from the
            response.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            Specifies the number of Tweets to try and retrieve, up to a maximum
            of 100 per distinct request. By default, 100 results are returned
            if this parameter is not supplied. The minimum permitted value is
            1. It is possible to receive less than the ``max_results`` per
            request throughout the pagination process.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            This parameter is used to move forwards or backwards through
            'pages' of results, based on the value of the ``next_token`` or
            ``previous_token`` in the response. The value used with the
            parameter is pulled directly from the response provided by the API,
            and should not be modified.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        since_id : int | str | None
            Returns results with a Tweet ID greater than (that is, more recent
            than) the specified 'since' Tweet ID. There are limits to the
            number of Tweets that can be accessed through the API. If the
            limit of Tweets has occurred since the ``since_id``, the
            ``since_id`` will be forced to the oldest ID available. More
            information on Twitter IDs is `here`_.
        start_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp
            from which the Tweets will be provided. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute).

            Please note that this parameter does not support a millisecond
            value.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        until_id : int | str | None
            Returns results with a Tweet ID less than (that is, older than) the
            specified 'until' Tweet ID. There are limits to the number of
            Tweets that can be accessed through the API. If the limit of Tweets
            has occurred since the ``until_id``, the ``until_id`` will be
            forced to the most recent ID available. More information on Twitter
            IDs is `here`_.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-reverse-chronological

        .. _here: https://developer.twitter.com/en/docs/twitter-ids
        r�r�z /timelines/reverse_chronologicalr��
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��r/rHr5r�rGr0r0r1�get_home_timelinebs\�zClient.get_home_timelinecKr�)aget_users_tweets(             id, *, end_time=None, exclude=None, expansions=None,             max_results=None, media_fields=None, pagination_token=None,             place_fields=None, poll_fields=None, since_id=None,             start_time=None, tweet_fields=None, until_id=None,             user_fields=None, user_auth=False         )

        Returns Tweets composed by a single user, specified by the requested
        user ID. By default, the most recent ten Tweets are returned per
        request. Using pagination, the most recent 3,200 Tweets can be
        retrieved.

        The Tweets returned by this endpoint count towards the Project-level
        `Tweet cap`_.

        Parameters
        ----------
        id : int | str
            Unique identifier of the Twitter account (user ID) for whom to
            return results. User ID can be referenced using the `user/lookup`_
            endpoint. More information on Twitter IDs is `here`_.
        end_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The newest or most recent
            UTC timestamp from which the Tweets will be provided. Only the 3200
            most recent Tweets are available. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute). Minimum allowable time is
            2010-11-06T00:00:01Z

            Please note that this parameter does not support a millisecond
            value.
        exclude : list[str] | str | None
            Comma-separated list of the types of Tweets to exclude from the
            response. When ``exclude=retweets`` is used, the maximum historical
            Tweets returned is still 3200. When the ``exclude=replies``
            parameter is used for any value, only the most recent 800 Tweets
            are available.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            Specifies the number of Tweets to try and retrieve, up to a maximum
            of 100 per distinct request. By default, 10 results are returned if
            this parameter is not supplied. The minimum permitted value is 5.
            It is possible to receive less than the ``max_results`` per request
            throughout the pagination process.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            This parameter is used to move forwards or backwards through
            'pages' of results, based on the value of the ``next_token`` or
            ``previous_token`` in the response. The value used with the
            parameter is pulled directly from the response provided by the API,
            and should not be modified.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        since_id : int | str | None
            Returns results with a Tweet ID greater than (that is, more recent
            than) the specified 'since' Tweet ID. Only the 3200 most recent
            Tweets are available. The result will exclude the ``since_id``. If
            the limit of Tweets has occurred since the ``since_id``, the
            ``since_id`` will be forced to the oldest ID available.
        start_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest or earliest
            UTC timestamp from which the Tweets will be provided. Only the 3200
            most recent Tweets are available. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute). Minimum allowable time is
            2010-11-06T00:00:00Z

            Please note that this parameter does not support a millisecond
            value.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        until_id : int | str | None
            Returns results with a Tweet ID less less than (that is, older
            than) the specified 'until' Tweet ID. Only the 3200 most recent
            Tweets are available. The result will exclude the ``until_id``. If
            the limit of Tweets has occurred since the ``until_id``, the
            ``until_id`` will be forced to the most recent ID available.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets

        .. _Tweet cap: https://developer.twitter.com/en/docs/projects/overview#tweet-cap
        .. _user/lookup: https://developer.twitter.com/en/docs/twitter-api/users/lookup/introduction
        .. _here: https://developer.twitter.com/en/docs/twitter-ids
        r�r��/tweetsr�r�r�r�r0r0r1�get_users_tweets�s
d�zClient.get_users_tweetscK�||d<|jdd|dd�S)a�get_all_tweets_count(             query, *, end_time=None, granularity=None, next_token=None,             since_id=None, start_time=None, until_id=None         )

        This endpoint is only available to those users who have been approved
        for the `Academic Research product track`_.

        The full-archive search endpoint returns the complete history of public
        Tweets matching a search query; since the first Tweet was created March
        26, 2006.

        Parameters
        ----------
        query : str
            One query for matching Tweets. Up to 1024 characters.
        end_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). Used with ``start_time``.
            The newest, most recent UTC timestamp to which the Tweets will be
            provided. Timestamp is in second granularity and is exclusive (for
            example, 12:00:01 excludes the first second of the minute). If used
            without ``start_time``, Tweets from 30 days before ``end_time``
            will be returned by default. If not specified, ``end_time`` will
            default to [now - 30 seconds].
        granularity : str | None
            This is the granularity that you want the timeseries count data to
            be grouped by. You can request ``minute``, ``hour``, or ``day``
            granularity. The default granularity, if not specified is ``hour``.
        next_token : str | None
            This parameter is used to get the next 'page' of results. The value
            used with the parameter is pulled directly from the response
            provided by the API, and should not be modified. You can learn more
            by visiting our page on `pagination`_.
        since_id : int | str | None
            Returns results with a Tweet ID greater than (for example, more
            recent than) the specified ID. The ID specified is exclusive and
            responses will not include it. If included with the same request as
            a ``start_time`` parameter, only ``since_id`` will be used.
        start_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp
            from which the Tweets will be provided. Timestamp is in second
            granularity and is inclusive (for example, 12:00:01 includes the
            first second of the minute). By default, a request will return
            Tweets from up to 30 days ago if you do not include this parameter.
        until_id : int | str | None
            Returns results with a Tweet ID less than (that is, older than) the
            specified ID. Used with ``since_id``. The ID specified is exclusive
            and responses will not include it.

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-all

        .. _Academic Research product track: https://developer.twitter.com/en/docs/projects/overview#product-track
        .. _pagination: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/paginate
        r�r�z/2/tweets/counts/all)r��granularityr�r�r�r�r��r5rRr�r�r0r0r1�get_all_tweets_count;s
=�zClient.get_all_tweets_countcKr�)a�get_recent_tweets_count(             query, *, end_time=None, granularity=None, since_id=None,             start_time=None, until_id=None         )

        The recent Tweet counts endpoint returns count of Tweets from the last
        seven days that match a search query.

        Parameters
        ----------
        query : str
            One rule for matching Tweets. If you are using a
            `Standard Project`_ at the Basic `access level`_, you can use the
            basic set of `operators`_ and can make queries up to 512 characters
            long. If you are using an `Academic Research Project`_ at the Basic
            access level, you can use all available operators and can make
            queries up to 1,024 characters long.
        end_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The newest, most recent
            UTC timestamp to which the Tweets will be provided. Timestamp is in
            second granularity and is exclusive (for example, 12:00:01 excludes
            the first second of the minute). By default, a request will return
            Tweets from as recent as 30 seconds ago if you do not include this
            parameter.
        granularity : str | None
            This is the granularity that you want the timeseries count data to
            be grouped by. You can request ``minute``, ``hour``, or ``day``
            granularity. The default granularity, if not specified is ``hour``.
        since_id : int | str | None
            Returns results with a Tweet ID greater than (that is, more recent
            than) the specified ID. The ID specified is exclusive and responses
            will not include it. If included with the same request as a
            ``start_time`` parameter, only ``since_id`` will be used.
        start_time : datetime.datetime | str | None
            YYYY-MM-DDTHH:mm:ssZ (ISO 8601/RFC 3339). The oldest UTC timestamp
            (from most recent seven days) from which the Tweets will be
            provided. Timestamp is in second granularity and is inclusive (for
            example, 12:00:01 includes the first second of the minute). If
            included with the same request as a ``since_id`` parameter, only
            ``since_id`` will be used. By default, a request will return Tweets
            from up to seven days ago if you do not include this parameter.
        until_id : int | str | None
            Returns results with a Tweet ID less than (that is, older than) the
            specified ID. The ID specified is exclusive and responses will not
            include it.

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent

        .. _Standard Project: https://developer.twitter.com/en/docs/projects
        .. _access level: https://developer.twitter.com/en/products/twitter-api/early-access/guide.html#na_1
        .. _operators: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query
        .. _Academic Research Project: https://developer.twitter.com/en/docs/projects
        r�r�z/2/tweets/counts/recent)r�r�r�r�r�r�r�r�r�r0r0r1�get_recent_tweets_count�s
<�zClient.get_recent_tweets_countcK�|jdd|��|dt|d�S)a�get_tweet(             id, *, expansions=None, media_fields=None, place_fields=None,             poll_fields=None, tweet_fields=None, user_fields=None,             user_auth=False         )

        Returns a variety of information about a single Tweet specified by
        the requested ID.

        Parameters
        ----------
        id : int | str
            Unique identifier of the Tweet to request
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id
        r�r��r�r�r�r�r�r�r�r�r�r0r0r1�	get_tweet�s
%�zClient.get_tweetcKr�)asget_tweets(             ids, *, expansions=None, media_fields=None, place_fields=None,             poll_fields=None, tweet_fields=None, user_fields=None,             user_auth=False         )

        Returns a variety of information about the Tweet specified by the
        requested ID or list of IDs.

        Parameters
        ----------
        ids : list[int | str] | str
            A comma separated list of Tweet IDs. Up to 100 are allowed in a
            single request. Make sure to not include a space between commas and
            fields.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets
        �idsr�r�)r�r�r�r�r�r�r�r�r�)r/r�rHr5r0r0r1�
get_tweets�s'�zClient.get_tweetscCr�)aTUnblock another user.

        The request succeeds with no action when the user sends a request to a
        user they're not blocking or have already unblocked.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        target_user_id : int | str
            The user ID of the user that you would like to unblock.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/delete-users-user_id-blocking
        r�r�z
/blocking/r�r�r��r/�target_user_idrH�source_user_idrGr0r0r1�unblock'r�zClient.unblockcKr�)a�get_blocked(             *, expansions=None, max_results=None, pagination_token=None,             tweet_fields=None, user_fields=None, user_auth=True         )

        Returns a list of users who are blocked by the authenticating user.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 1000. By default, each page will return 100
            results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/get-users-blocking
        r�r��	/blockingr��r�r�r�r�r�r��r�rTrr�r0r0r1�get_blockedXs8�zClient.get_blockedcCr�)a�Block another user.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        target_user_id : int | str
            The user ID of the user that you would like to block.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/post-users-user_id-blocking
        r�r�rr�r�r�r��r/r�rHr�rGr0r0r1�block�r�zClient.blockcCr�)a�Allows a user ID to unfollow another user.

        The request succeeds with no action when the authenticated user sends a
        request to a user they're not following or have already unfollowed.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.2
            Renamed from :meth:`Client.unfollow`

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        target_user_id : int | str
            The user ID of the user that you would like to unfollow.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/delete-users-source_id-following
        r�r�z/following/r�r�r�r�r0r0r1�
unfollow_user�s
-�zClient.unfollow_usercC�t�dt�|j||d�S)z�Alias for :meth:`Client.unfollow_user`

        .. deprecated:: 4.2
            Use :meth:`Client.unfollow_user` instead.
        z@Client.unfollow is deprecated; use Client.unfollow_user instead.r�)�warningsrp�DeprecationWarningr�r/r�rHr0r0r1�unfollow�
�zClient.unfollowcKr�)a?get_users_followers(             id, *, expansions=None, max_results=None, pagination_token=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Returns a list of users who are followers of the specified user ID.

        Parameters
        ----------
        id : int | str
            The user ID whose followers you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and the 1000. By default, each page will return
            100 results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the ``next_token``
            returned in your previous response. To go back one page, pass the
            ``previous_token`` returned in your previous response.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-followers
        r�r��
/followersrr�r�r�r0r0r1�get_users_followerss
'�zClient.get_users_followerscKr�)a7get_users_following(             id, *, expansions=None, max_results=None, pagination_token=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Returns a list of users the specified user ID is following.

        Parameters
        ----------
        id : int | str
            The user ID whose following you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and the 1000. By default, each page will return
            100 results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the ``next_token``
            returned in your previous response. To go back one page, pass the
            ``previous_token`` returned in your previous response.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-following
        r�r��
/followingrr�r�r�r0r0r1�get_users_following<s
'�zClient.get_users_followingcCr�)a~Allows a user ID to follow another user.

        If the target user does not have public Tweets, this endpoint will send
        a follow request.

        The request succeeds with no action when the authenticated user sends a
        request to a user they're already following, or if they're sending a
        follower request to a user that does not have public Tweets.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.2
            Renamed from :meth:`Client.follow`

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        target_user_id : int | str
            The user ID of the user that you would like to follow.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following
        r�r�rr�r�r�r�r�r0r0r1�follow_userks1�zClient.follow_usercCr	)z~Alias for :meth:`Client.follow_user`

        .. deprecated:: 4.2
            Use :meth:`Client.follow_user` instead.
        z<Client.follow is deprecated; use Client.follow_user instead.r�)r
rprrrr0r0r1�follow�rz
Client.followcCr�)aqAllows an authenticated user ID to unmute the target user.

        The request succeeds with no action when the user sends a request to a
        user they're not muting or have already unmuted.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        target_user_id : int | str
            The user ID of the user that you would like to unmute.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/delete-users-user_id-muting
        r�r�z/muting/r�r�r�r�r0r0r1�unmute�r�z
Client.unmutecKr�)a�get_muted(             *, expansions=None, max_results=None, pagination_token=None,             tweet_fields=None, user_fields=None, user_auth=True         )

        Returns a list of users who are muted by the authenticating user.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionadded:: 4.1

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 1000. By default, each page will return 100
            results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/get-users-muting
        r�r��/mutingr�rr�rr�r0r0r1�	get_muted�s:�zClient.get_mutedcCr�)a�Allows an authenticated user ID to mute the target user.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        target_user_id : int | str
            The user ID of the user that you would like to mute.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/post-users-user_id-muting
        r�r�rr�r�r�r�rr0r0r1�mute(	r�zClient.mute)r��usernamerHcKsj|dur|durtd��d}|dur|d|��7}n|dur&|d|��7}ntd��|jd||dt|d	�S)
a�get_user(*, id=None, username=None, expansions=None,                     tweet_fields=None, user_fields=None, user_auth=False)

        Returns a variety of information about a single user specified by the
        requested ID or username.

        Parameters
        ----------
        id : int | str | None
            The ID of the user to lookup.
        username : str | None
            The Twitter username (handle) of the user.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If ID and username are not passed or both are passed

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id
        https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by-username-username
        Nz!Expected ID or username, not both�/2/users�/z
/by/username/zID or username is requiredr��r�r�r�r��r�rTr)r/r�rrHr5rGr0r0r1�get_userY	s$�zClient.get_user)r��	usernamesrHcKsf|dur|durtd��d}|dur||d<n|dur$|d7}||d<ntd��|jd||d	t|d
�S)a�get_users(*, ids=None, usernames=None, expansions=None,                      tweet_fields=None, user_fields=None, user_auth=False)

        Returns a variety of information about one or more users specified by
        the requested IDs or usernames.

        Parameters
        ----------
        ids : list[int | str] | str | None
            A comma separated list of user IDs. Up to 100 are allowed in a
            single request. Make sure to not include a space between commas and
            fields.
        usernames : list[str] | str | None
            A comma separated list of Twitter usernames (handles). Up to 100
            are allowed in a single request. Make sure to not include a space
            between commas and fields.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If IDs and usernames are not passed or both are passed

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users
        https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by
        Nz#Expected IDs or usernames, not bothrr�z/byrzIDs or usernames are requiredr�)r�rr�r�r�r�r)r/r�rrHr5rGr0r0r1�	get_users�	s)

�zClient.get_userscKs|jdd|dt|d�S)a"get_me(*, expansions=None, tweet_fields=None, user_fields=None,                   user_auth=True)

        Returns information about an authorized user.

        .. versionadded:: 4.5

        Parameters
        ----------
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me
        r�z/2/users/merr�r�)r/rHr5r0r0r1r��	s
�z
Client.get_mecKr�)apsearch_spaces(query, *, expansions=None, max_results=None,                          space_fields=None, state=None, user_fields=None)

        Return live or scheduled Spaces matching your specified search terms

        .. versionadded:: 4.1

        .. versionchanged:: 4.2
            ``state`` is now an optional parameter.

        Parameters
        ----------
        query : str
            Your search term. This can be any text (including mentions and
            Hashtags) present in the title of the Space.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to return in this request. Specify a
            value between 1 and 100.
        space_fields : list[str] | str | None
            :ref:`space_fields_parameter`
        state : str | None
            Determines the type of results to return. This endpoint returns all
            Spaces by default. Use ``live`` to only return live Spaces or
            ``scheduled`` to only return upcoming Spaces.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search
        r�r�z/2/spaces/search)r�r�r��space.fields�stater�r��rTrr�r0r0r1�
search_spaces�	s&�zClient.search_spaces)r��user_idscKsd|dur|durtd��d}|dur||d<n|dur$|d7}||d<ntd��|jd||d	td
�S)aget_spaces(*, ids=None, user_ids=None, expansions=None,                       space_fields=None, user_fields=None)

        Returns details about multiple live or scheduled Spaces (created by the
        specified user IDs if specified). Up to 100 comma-separated Space or
        user IDs can be looked up using this endpoint.

        .. versionadded:: 4.1

        Parameters
        ----------
        ids : list[str] | str | None
            A comma separated list of Spaces (up to 100).
        user_ids : list[int | str] | str | None
            A comma separated list of user IDs (up to 100).
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        space_fields : list[str] | str | None
            :ref:`space_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`

        Raises
        ------
        TypeError
            If IDs and user IDs are not passed or both are passed

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces
        https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids
        Nz"Expected IDs or user IDs, not bothz	/2/spacesr�z/by/creator_idsr%zIDs or user IDs are requiredr�)r�r%r�r!r�r�)r�rTr)r/r�r%r5rGr0r0r1�
get_spaces 
s%

�zClient.get_spacescKs|jdd|��|dtd�S)a>get_space(id, *, expansions=None, space_fields=None,                      user_fields=None)

        Returns a variety of information about a single Space specified by the
        requested ID.

        .. versionadded:: 4.1

        Parameters
        ----------
        id : list[str] | str
            Unique identifier of the Space to request.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        space_fields : list[str] | str | None
            :ref:`space_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id
        r��
/2/spaces/)r�r!r�r�r#�r/r�r5r0r0r1�	get_spaceY
s
�zClient.get_spacecK�|jdd|�d�|dtd�S)a
get_space_buyers(             id, *, expansions=None, media_fields=None, place_fields=None,             poll_fields=None, tweet_fields=None, user_fields=None         )

        Returns a list of user who purchased a ticket to the requested Space.
        You must authenticate the request using the Access Token of the creator
        of the requested Space.

        .. versionadded:: 4.4

        Parameters
        ----------
        id : str
            Unique identifier of the Space for which you want to request
            Tweets.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-buyers
        r�r'z/buyersr�r�r�r(r0r0r1�get_space_buyers|
s
&�zClient.get_space_buyerscKr*)a�get_space_tweets(             id, *, expansions=None, media_fields=None, place_fields=None,             poll_fields=None, tweet_fields=None, user_fields=None         )

        Returns Tweets shared in the requested Spaces.

        .. versionadded:: 4.6

        Parameters
        ----------
        id : str
            Unique identifier of the Space containing the Tweets you'd like to
            access.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-tweets
        r�r'r�r�r�r�r(r0r0r1�get_space_tweets�
s
$�zClient.get_space_tweets)�dm_conversation_id�participant_idrHcKs^|dur|durtd��|durd|�d�}n
|dur"d|�d�}nd}|jd||dt|d	�S)
a�get_direct_message_events(             *, dm_conversation_id=None, participant_id=None,             dm_event_fields=None, event_types=None, expansions=None,             max_results=None, media_fields=None, pagination_token=None,             tweet_fields=None, user_fields=None, user_auth=True         )

        If ``dm_conversation_id`` is passed, returns a list of Direct Messages
        within the conversation specified. Messages are returned in reverse
        chronological order.

        If ``participant_id`` is passed, returns a list of Direct Messages (DM)
        events within a 1-1 conversation with the user specified. Messages are
        returned in reverse chronological order.

        If neither is passed, returns a list of Direct Messages for the
        authenticated user, both sent and received. Direct Message events are
        returned in reverse chronological order. Supports retrieving events
        from the previous 30 days.

        .. note::
        
            There is an alias for this method named ``get_dm_events``.

        .. versionadded:: 4.12

        Parameters
        ----------
        dm_conversation_id : str | None
            The ``id`` of the Direct Message conversation for which events are
            being retrieved.
        participant_id : int | str | None
            The ``participant_id`` of the user that the authenicating user is
            having a 1-1 conversation with.
        dm_event_fields : list[str] | str | None
            Extra fields to include in the event payload. ``id`` and
            ``event_type`` are returned by default. The ``text`` value isn't
            included for ``ParticipantsJoin`` and ``ParticipantsLeave`` events.
        event_types : str
            The type of Direct Message event to returm. If not included, all
            types are returned.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned in a page. Must be
            between 1 and 100. The default is 100.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            Contains either the ``next_token`` or ``previous_token`` value.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If both ``dm_conversation_id`` and ``participant_id`` are passed

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_events
        https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_conversations-with-participant_id-dm_events
        https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_conversations-dm_conversation_id-dm_events
        N�7Expected DM conversation ID or participant ID, not both�/2/dm_conversations/z
/dm_events�/2/dm_conversations/with/z/2/dm_eventsr�)zdm_event.fields�event_typesr�r�r�r�r�r�r�)r�rTr)r/r-r.rHr5�pathr0r0r1�get_direct_message_events�
sL��z Client.get_direct_message_events)r-r.r�r�rHcCs�|dur|durtd��|durd|�d�}n|dur"d|�d�}ntd��i}|dur5dt|�ig|d<|dur=||d	<|jd
|||d�S)a�If ``dm_conversation_id`` is passed, creates a Direct Message on
        behalf of the authenticated user, and adds it to the specified
        conversation.

        If ``participant_id`` is passed, creates a one-to-one Direct Message
        and adds it to the one-to-one conversation. This method either creates
        a new one-to-one conversation or retrieves the current conversation and
        adds the Direct Message to it.

        .. note::
        
            There is an alias for this method named ``create_dm``.

        .. versionadded:: 4.12

        Parameters
        ----------
        dm_conversation_id : str | None
            The ``dm_conversation_id`` of the conversation to add the Direct
            Message to. Supports both 1-1 and group conversations.
        participant_id : int | str | None
            The User ID of the account this one-to-one Direct Message is to be
            sent to.
        media_id : int | str | None
            A single Media ID being attached to the Direct Message. This field
            is required if ``text`` is not present. For this launch, only 1
            attachment is supported.
        text : str | None
            Text of the Direct Message being created. This field is required if
            ``media_id`` is not present. Text messages support up to 10,000
            characters.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If ``dm_conversation_id`` and ``participant_id`` are not passed or
            both are passed

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations-dm_conversation_id-messages
        https://developer.twitter.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations-with-participant_id-messages
        Nr/r0z	/messagesr1z0DM conversation ID or participant ID is requiredr��attachmentsr�r�r�)r�rsrT)r/r-r.r�r�rHr3r6r0r0r1�create_direct_message<s5�zClient.create_direct_message)r�r�rHcCsZdittt|��d�}|durdt|�ig|dd<|dur$||dd<|jdd	||d
�S)a�Creates a new group conversation and adds a Direct Message to it on
        behalf of the authenticated user.

        .. note::
        
            There is an alias for this method named ``create_dm_conversation``.

        .. versionadded:: 4.12

        Parameters
        ----------
        media_id : int | str | None
            A single Media ID being attached to the Direct Message. This field
            is required if ``text`` is not present. For this launch, only 1
            attachment is supported.
        text : str | None
            Text of the Direct Message being created. This field is required if
            ``media_id`` is not present. Text messages support up to 10,000
            characters.
        participant_ids : list[int | str]
            An array of User IDs that the conversation is created with.
            Conversations can have up to 50 participants.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations
        �Group)�conversation_type�message�participant_idsNr�r9r5r�r�z/2/dm_conversationsr�)r]rrrsrT)r/r�r�r:rHr6r0r0r1�"create_direct_message_conversation�s%��z)Client.create_direct_message_conversationcKr�)aget_list_tweets(             id, *, expansions=None, max_results=None, media_fields=None,             pagination_token=None, place_fields=None, poll_fields=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Returns a list of Tweets from the specified List.

        .. versionadded:: 4.4

        .. versionchanged:: 4.10.1
            Added ``media_fields``, ``place_fields``, and ``poll_fields``
            parameters

        Parameters
        ----------
        id : list[str] | str
            The ID of the List whose Tweets you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        media_fields : list[str] | str | None
            :ref:`media_fields_parameter`
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the next_token
            returned in your previous response. To go back one page, pass the
            previous_token returned in your previous response.
        place_fields : list[str] | str | None
            :ref:`place_fields_parameter`
        poll_fields : list[str] | str | None
            :ref:`poll_fields_parameter`
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-tweets/api-reference/get-lists-id-tweets
        r��	/2/lists/r�r�r�r�r�r0r0r1�get_list_tweets�s
4�zClient.get_list_tweetscCr�)aEnables the authenticated user to unfollow a List.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        list_id : int | str
            The ID of the List that you would like the user to unfollow.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/delete-users-id-followed-lists-list_id
        r�r�z/followed_lists/r�r�r��r/�list_idrHr�rGr0r0r1�
unfollow_list��
)�zClient.unfollow_listcKr�)a_get_list_followers(             id, *, expansions=None, max_results=None, pagination_token=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Returns a list of users who are followers of the specified List.

        .. versionadded:: 4.4

        Parameters
        ----------
        id : list[str] | str
            The ID of the List whose followers you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the next_token
            returned in your previous response. To go back one page, pass the
            previous_token returned in your previous response.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-lists-id-followers
        r�r<rrr�r�r�r0r0r1�get_list_followers+�
)�zClient.get_list_followerscKr�)aJget_followed_lists(             id, *, expansions=None, list_fields=None, max_results=None,             pagination_token=None, user_fields=None, user_auth=False         )

        Returns all Lists a specified user follows.

        .. versionadded:: 4.4

        Parameters
        ----------
        id : list[str] | str
            The user ID whose followed Lists you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        list_fields : list[str] | str | None
            :ref:`list_fields_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the next_token
            returned in your previous response. To go back one page, pass the
            previous_token returned in your previous response.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-users-id-followed_lists
        r�r��/followed_lists�r��list.fieldsr�r�r�r��rTrr�r0r0r1�get_followed_lists\rCzClient.get_followed_listscCr�)aEnables the authenticated user to follow a List.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        list_id : int | str
            The ID of the List that you would like the user to follow.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/post-users-id-followed-lists
        r�r�rDr�r?r�r�r>r0r0r1�follow_list��
)�zClient.follow_listcKr�)aoget_list(id, *, expansions=None, list_fields=None,                     user_fields=None, user_auth=False)

        Returns the details of a specified List.

        .. versionadded:: 4.4

        Parameters
        ----------
        id : list[str] | str
            The ID of the List to lookup.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        list_fields : list[str] | str | None
            :ref:`list_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-lists-id
        r�r<�r�rFr�r�rGr�r0r0r1�get_list�s
�zClient.get_listcKr�)aCget_owned_lists(             id, *, expansions=None, list_fields=None, max_results=None,             pagination_token=None, user_fields=None, user_auth=False         )

        Returns all Lists owned by the specified user.

        .. versionadded:: 4.4

        Parameters
        ----------
        id : list[str] | str
            The user ID whose owned Lists you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        list_fields : list[str] | str | None
            :ref:`list_fields_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the next_token
            returned in your previous response. To go back one page, pass the
            previous_token returned in your previous response.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-users-id-owned_lists
        r�r�z/owned_listsrEr�rGr�r0r0r1�get_owned_lists�rCzClient.get_owned_listscCs|jdd|�d|��|d�S)a�Enables the authenticated user to remove a member from a List they
        own.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        id : int | str
            The ID of the List you are removing a member from.
        user_id : int | str
            The ID of the user you wish to remove as a member of the List.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/delete-lists-id-members-user_id
        r�r<z	/members/r�r��r/r�r�rHr0r0r1�remove_list_member
s�zClient.remove_list_membercKr�)aWget_list_members(             id, *, expansions=None, max_results=None, pagination_token=None,             tweet_fields=None, user_fields=None, user_auth=False         )

        Returns a list of users who are members of the specified List.

        .. versionadded:: 4.4

        Parameters
        ----------
        id : list[str] | str
            The ID of the List whose members you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the next_token
            returned in your previous response. To go back one page, pass the
            previous_token returned in your previous response.
        tweet_fields : list[str] | str | None
            :ref:`tweet_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-lists-id-members
        r�r<�/membersrr�r�r�r0r0r1�get_list_members5
rCzClient.get_list_memberscKr�)aWget_list_memberships(             id, *, expansions=None, list_fields=None, max_results=None,             pagination_token=None, user_fields=None, user_auth=False         )

        Returns all Lists a specified user is a member of.

        .. versionadded:: 4.4

        Parameters
        ----------
        id : list[str] | str
            The user ID whose List memberships you would like to retrieve.
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        list_fields : list[str] | str | None
            :ref:`list_fields_parameter`
        max_results : int | None
            The maximum number of results to be returned per page. This can be
            a number between 1 and 100. By default, each page will return 100
            results.
        pagination_token : str | None
            Used to request the next page of results if all results weren't
            returned with the latest request, or to go back to the previous
            page of results. To return the next page, pass the next_token
            returned in your previous response. To go back one page, pass the
            previous_token returned in your previous response.
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-users-id-list_memberships
        r�r�z/list_membershipsrEr�rGr�r0r0r1�get_list_membershipsf
rCzClient.get_list_membershipscCs"|jdd|�d�dt|�i|d�S)a�Enables the authenticated user to add a member to a List they own.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        id : int | str
            The ID of the List you are adding a member to.
        user_id : int | str
            The ID of the user you wish to add as a member of the List.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/post-lists-id-members
        r�r<rPr�r�)rTrsrNr0r0r1�add_list_member�
s�zClient.add_list_membercCr�)a_Enables the authenticated user to delete a List that they own.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        id : int | str
            The ID of the List to be deleted.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id
        r�r<r�r�r�r0r0r1�delete_list�
s�zClient.delete_list)�description�name�privaterHcCsLi}|dur
||d<|dur||d<|dur||d<|jdd|��||d�S)anEnables the authenticated user to update the meta data of a
        specified List that they own.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        id : int | str
            The ID of the List to be updated.
        description : str | None
            Updates the description of the List.
        name : str | None
            Updates the name of the List.
        private : bool | None
            Determines whether the List should be private.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/put-lists-id
        NrUrVrWr�r<r�r�)r/r�rUrVrWrHr6r0r0r1�update_list�
s�zClient.update_list)rUrWrHcCs:d|i}|dur||d<|dur||d<|jdd||d�S)a�Enables the authenticated user to create a List.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        Parameters
        ----------
        name : str
            The name of the List you wish to create.
        description : str | None
            Description of the List.
        private : bool | None
            Determine whether the List should be private.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists
        rVNrUrWr�z/2/listsr�r�)r/rVrUrWrHr6r0r0r1�create_lists�zClient.create_listcCr�)aEnables the authenticated user to unpin a List.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        list_id : int | str
            The ID of the List that you would like the user to unpin.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/pinned-lists/api-reference/delete-users-id-pinned-lists-list_id
        r�r�z/pinned_lists/r�r�r�r>r0r0r1�
unpin_list+rAzClient.unpin_listcKr�)aget_pinned_lists(*, expansions=None, list_fields=None,                             user_fields=None, user_auth=True)

        Returns the Lists pinned by a specified user.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionadded:: 4.4

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        expansions : list[str] | str | None
            :ref:`expansions_parameter`
        list_fields : list[str] | str | None
            :ref:`list_fields_parameter`
        user_fields : list[str] | str | None
            :ref:`user_fields_parameter`
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/pinned-lists/api-reference/get-users-id-pinned_lists
        r�r��
/pinned_listsr�rKr�)r�rTrr�r0r0r1�get_pinned_lists[s0�zClient.get_pinned_listscCr�)a�Enables the authenticated user to pin a List.

        .. note::

            When using OAuth 2.0 Authorization Code Flow with PKCE with
            ``user_auth=False``, a request is made beforehand to Twitter's API
            to determine the authenticating user's ID. This is cached and only
            done once per :class:`Client` instance for each access token used.

        .. versionadded:: 4.2

        .. versionchanged:: 4.5
            Added ``user_auth`` parameter

        .. versionchanged:: 4.8
            Added support for using OAuth 2.0 Authorization Code Flow with PKCE

        .. versionchanged:: 4.8
            Changed to raise :class:`TypeError` when the access token isn't set

        Parameters
        ----------
        list_id : int | str
            The ID of the List that you would like the user to pin.
        user_auth : bool
            Whether or not to use OAuth 1.0a User Context to authenticate

        Raises
        ------
        TypeError
            If the access token isn't set

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/lists/pinned-lists/api-reference/post-users-id-pinned-lists
        r�r�r[r�r?r�r�r>r0r0r1�pin_list�rJzClient.pin_listcKr�)a�get_compliance_jobs(type, *, status=None)

        Returns a list of recent compliance jobs.

        .. versionadded:: 4.1

        Parameters
        ----------
        type : str
            Allows to filter by job type - either by tweets or user ID. Only
            one filter (tweets or users) can be specified per request.
        status : str | None
            Allows to filter by job status. Only one filter can be specified
            per request.
            Default: ``all``

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs
        �typer��/2/compliance/jobs)r^�statusr�r�)r/r^r5r0r0r1�get_compliance_jobs�s
�zClient.get_compliance_jobscCs|�dd|���S)a�Get a single compliance job with the specified ID.

        .. versionadded:: 4.1

        Parameters
        ----------
        id : int | str
            The unique identifier for the compliance job you want to retrieve.

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs-id
        r�z/2/compliance/jobs/r�)r/r�r0r0r1�get_compliance_job�s
�zClient.get_compliance_job)rV�	resumablecCs8d|i}|dur||d<|dur||d<|jdd|d�S)aJCreates a new compliance job for Tweet IDs or user IDs.

        A compliance job will contain an ID and a destination URL. The
        destination URL represents the location that contains the list of IDs
        consumed by your app.

        You can run one batch job at a time.

        .. versionadded:: 4.1

        Parameters
        ----------
        type : str
            Specify whether you will be uploading tweet or user IDs. You can
            either specify tweets or users.
        name : str | None
            A name for this job, useful to identify multiple jobs using a label
            you define.
        resumable : bool | None
            Specifies whether to enable the upload URL with support for
            resumable uploads. If true, this endpoint will return a pre-signed
            URL with resumable uploads enabled.

        Returns
        -------
        dict | requests.Response | Response

        References
        ----------
        https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs
        r^NrVrcr�r_r�r�)r/r^rVrcr6r0r0r1�create_compliance_job�s �zClient.create_compliance_job)Nr|r}r~�__doc__r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr
rrrrrrrrr r�r$r&r)r+r,r4�
get_dm_eventsr6�	create_dmr;�create_dm_conversationr=r@rBrHrIrLrMrOrQrRrSrTrXrYrZr\r]rarbrdr0r0r0r1r�s�#

&D(1:<1�tH2:1gidipFG-21C140/91E16=#19#./�`�H�2?0112$311 �.�*0:2r).�collectionsrrt�	functoolsr�ImportErrorr�logging�platformrrCr
r)r-�tweepy.authr�tweepy.direct_message_eventr�
tweepy.errorsr	r
rrr
rr�tweepy.listr�tweepy.mediar�tweepy.placer�tweepy.pollr�tweepy.spacer�tweepy.tweetr�tweepy.userr�	getLoggerr|r<rr!rr0r0r0r1�<module>s:�$

#