
    bf                     b    d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z  G d de          Z
dS )	   )_DICT_VERSION_STATUS)MastodonIllegalArgumentError)_DEFAULT_STREAM_TIMEOUT"_DEFAULT_STREAM_RECONNECT_WAIT_SEC)api_version)Mastodonc                      e Zd Z edde          dedefd            Z edde          dededdfd            Z edde          dedefd            Z	 edde          ddedefd            Z
 edde          dedefd	            Z ed
d
e          dedefd            Z eddd          d             ZdS )r   z1.1.0z1.4.2Fc                 8    |                      d|||||          S )zx
        Streams events that are relevant to the authorized user, i.e. home
        timeline and notifications.
        z/api/v1/streaming/user	run_asynctimeoutreconnect_asyncreconnect_async_wait_sec_Mastodon__streamselflistenerr   r   r   r   s         j/home/feoh/.local/pipx/venvs/mastodon-archive/lib/python3.11/site-packages/mastodon/streaming_endpoints.pystream_userzMastodon.stream_user   s7     }}5x9^e  xG  bz}  {  {  	{    c                 z    d}|r|dz  }|r|rt          d          |dz  }|                     ||||||          S )z
        Streams public events.

        Set `local` to True to only get local statuses.
        Set `remote` to True to only get remote statuses.
        z/api/v1/streaming/public/localz@Cannot pass both local and remote - use either one or the other.z/remoter   )r   r   )	r   r   r   r   r   r   localremotebases	            r   stream_publiczMastodon.stream_public   sr     * 	HD 	 w23uvvvID}}T8y'cr  Nf}  g  g  	gr   c                 8    |                      |||||d          S )z
        Streams local public events.

        This function is deprecated. Please use :ref:`stream_public() <stream_public()>` with parameter `local` set to True instead.
        T)r   r   r   r   r   )r   r   s         r   stream_localzMastodon.stream_local(   s9     !!(ibq  Me  mq!  r  r  	rr   c                     |                     d          rt          d          d}|r|dz  }|                     | d| |||||          S )z
        Stream for all public statuses for the hashtag 'tag' seen by the connected
        instance.

        Set `local` to True to only get local statuses.
        #z#Tag parameter should omit leading #z/api/v1/streaming/hashtagr   z?tag=r   )
startswithr   r   )	r   tagr   r   r   r   r   r   r   s	            r   stream_hashtagzMastodon.stream_hashtag2   s     >># 	V./TUUU* 	HD}}00300(iY`  sB  ]u}  v  v  	vr   z2.1.0c                 h    |                      |          }|                     d| |||||          S )zg
        Stream events for the current user, restricted to accounts on the given
        list.
        z/api/v1/streaming/list?list=r   )_Mastodon__unpack_idr   )r   idr   r   r   r   r   s          r   stream_listzMastodon.stream_listA   sS     b!!}}@B@@(V_ip  CR  mE}  F  F  	Fr   z2.6.0c                 8    |                      d|||||          S )z_
        Streams direct message events for the logged-in user, as conversation events.
        z/api/v1/streaming/directr   r   r   s         r   stream_directzMastodon.stream_directJ   s7    
 }}7Y`g  zI  d|}  }  }  	}r   z2.5.0c                 h    |                      dd|                                 d          }|dv rdS dS )zd
        Returns without True if streaming API is okay, False or raises an error otherwise.
        GETz/api/v1/streaming/healthF)base_url_overrideparse)s   OKs   successT)_Mastodon__api_request_Mastodon__get_streaming_base)r   api_okays     r   stream_healthyzMastodon.stream_healthyQ   sO    
 %%e-G[_[t[t[v[v  D%  E  E***4ur   N)__name__
__module____qualname__r   r   r   r   r   r   r   r$   r(   r*   r2    r   r   r   r      s        ['#788.3=Tfk  Gi { { { 98{ ['#78805?Vhm  Ik  sx  AF g g g 98g  ['#788/4>Ugl  Hj r r r 98r ['#788275Ri  |A  \~ v v v 98v ['#78827AXjo  Km F F F 98F ['#78805?Vhm  Ik } } } 98} ['7++  ,+  r   r   N)versionsr   errorsr   defaultsr   r   utilityr   	internalsr   	Internalsr6   r   r   <module>r=      s    + * * * * * 0 0 0 0 0 0 Q Q Q Q Q Q Q Q             , , , , , ,N N N N Ny N N N N Nr   