
    {i4                        S r SSKJr  SSKJr  SSKJrJrJr  SSK	J
r
  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJrJr  \(       a  SSKr " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)zProvide the helper classes.    )annotations)dumps)TYPE_CHECKINGAny	Generator   )API_PATH)_deprecate_args   )PRAWBase)Draft)
LiveThread)Multireddit	SubredditNc                      \ rS rSrSr S   SS jjrSS jrSSSSSSSSSSSS.                         SS	 jjrS
rg)DraftHelper   zProvide a set of functions to interact with :class:`.Draft` instances.

.. note::

    The methods provided by this class will only work on the currently authenticated
    user's :class:`.Draft`\ s.

Nc                P    Ub  [        U R                  US9$ U R                  5       $ )ah  Return a list of :class:`.Draft` instances.

:param draft_id: When provided, this returns a :class:`.Draft` instance
    (default: ``None``).

:returns: A :class:`.Draft` instance if ``draft_id`` is provided. Otherwise, a
    list of :class:`.Draft` objects.

.. note::

    Drafts fetched using a specific draft ID are lazily loaded, so you might
    have to access an attribute to get all the expected attributes.

This method can be used to fetch a specific draft by ID, like so:

.. code-block:: python

    draft_id = "124862bc-e1e9-11eb-aa4f-e68667a77cbb"
    draft = reddit.drafts(draft_id)
    print(draft)

id)r   _reddit_draft_list)selfdraft_ids     M/home/james-whalen/.local/lib/python3.13/site-packages/praw/models/helpers.py__call__DraftHelper.__call__   s*    2 (33!!    c                H    U R                   R                  [        S   SS0S9$ )zZGet a list of :class:`.Draft` instances.

:returns: A list of :class:`.Draft` instances.

draftsmd_bodyTparamsr   getr	   r   s    r   r   DraftHelper._draft_list:   s(     || 2It;LMMr   FTflair_id
flair_textis_public_linknsfworiginal_contentselftextsend_repliesspoiler	subreddittitleurlc                  U(       a  U(       a  Sn[        U5      e[        U	[        5      (       a  U R                  R	                  U	5      n	[
        R                  " SUUUUUUUUU	U
US.UD6nU R                  R                  [        S   US9$ )a  Create a new :class:`.Draft`.

:param flair_id: The flair template to select (default: ``None``).
:param flair_text: If the template's ``flair_text_editable`` value is ``True``,
    this value will set a custom text (default: ``None``). ``flair_id`` is
    required when ``flair_text`` is provided.
:param is_public_link: Whether to enable public viewing of the draft before it
    is submitted (default: ``False``).
:param nsfw: Whether the draft should be marked NSFW (default: ``False``).
:param original_content: Whether the submission should be marked as original
    content (default: ``False``).
:param selftext: The Markdown formatted content for a text submission draft. Use
    ``None`` to make a title-only submission draft (default: ``None``).
    ``selftext`` can not be provided if ``url`` is provided.
:param send_replies: When ``True``, messages will be sent to the submission
    author when comments are made to the submission (default: ``True``).
:param spoiler: Whether the submission should be marked as a spoiler (default:
    ``False``).
:param subreddit: The subreddit to create the draft for. This accepts a
    subreddit display name, :class:`.Subreddit` object, or
    :class:`.UserSubreddit` object. If ``None``, the :class:`.UserSubreddit` of
    currently authenticated user will be used (default: ``None``).
:param title: The title of the draft (default: ``None``).
:param url: The URL for a ``link`` submission draft (default: ``None``). ``url``
    can not be provided if ``selftext`` is provided.

Additional keyword arguments can be provided to handle new parameters as Reddit
introduces them.

:returns: The new :class:`.Draft` object.

z4Exactly one of 'selftext' or 'url' must be provided.r(   draftdata )		TypeError
isinstancestrr   r1   r   _prepare_datapostr	   )r   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   draft_kwargsmsgr7   s                  r   createDraftHelper.createB   s    d HCC. i%%..y9I"" 
!)-%
 
 ||  '!2 >>r   r8   )N)r   
str | Nonereturnz+list[praw.models.Draft] | praw.models.Draft)rC   zlist[praw.models.Draft])r)   rB   r*   rB   r+   boolr,   rD   r-   rD   r.   rB   r/   rD   r0   rD   r1   z>str | praw.models.Subreddit | praw.models.UserSubreddit | Noner2   rB   r3   rB   r>   r   rC   zpraw.models.Draft)	__name__
__module____qualname____firstlineno____doc__r   r   r@   __static_attributes__r8   r   r   r   r      s     &*"""	4":N  $!%$!&#!  F? F? 	F?
 F? F? F? F? F? F? KF? F? F?  !F?" 
#F? F?r   r   c                  z    \ rS rSrSrSS jr\" SSSS5      SS	SS
.         SS jj5       rSS jrSS jr	Sr
g)
LiveHelper   zDProvide a set of functions to interact with :class:`.LiveThread`\ s.c                *    [        U R                  US9$ )zReturn a new lazy instance of :class:`.LiveThread`.

This method is intended to be used as:

.. code-block:: python

    livethread = reddit.live("ukaeu1ik4sw5")

:param id: A live thread ID, e.g., ``ukaeu1ik4sw5``.

r   )r   r   )r   r   s     r   r   LiveHelper.__call__   s     $,,2..r   r2   descriptionr,   	resourcesNF)rP   r,   rQ   c               N    U R                   R                  [        S   UUUUS.S9$ )a  Create a new :class:`.LiveThread`.

:param title: The title of the new :class:`.LiveThread`.
:param description: The new :class:`.LiveThread`'s description.
:param nsfw: Indicate whether this thread is not safe for work (default:
    ``False``).
:param resources: Markdown formatted information that is useful for the
    :class:`.LiveThread`.

:returns: The new :class:`.LiveThread` object.


livecreate)rP   r,   rQ   r2   r6   )r   r=   r	   )r   r2   rP   r,   rQ   s        r   r@   LiveHelper.create   s9    * ||  \"*&	 ! 
 	
r   c                f   ^ ^ [        T[        5      (       d  Sn[        U5      eUU 4S jnU" 5       $ )a  Fetch information about each live thread in ``ids``.

:param ids: A list of IDs for a live thread.

:returns: A generator that yields :class:`.LiveThread` instances.

:raises: ``prawcore.ServerError`` if invalid live threads are requested.

Requests will be issued in batches for each 100 IDs.

.. note::

    This method doesn't support IDs for live updates.

.. warning::

    Unlike :meth:`.Reddit.info`, the output of this method may not reflect the
    order of input.

Usage:

.. code-block:: python

    ids = ["3rgnbke2rai6hen7ciytwcxadi", "sw7bubeycai6hey4ciytwamw3a", "t8jnufucss07"]
    for thread in reddit.live.info(ids):
        print(thread.title)

zids must be a listc               3     >#    [        S[        T5      S5       HT  n TX S-    n[        S   R                  SR	                  U5      S9nSS0nTR
                  R                  X#S9 S h  vN   MV     g  N	7f)Nr   d   	live_info,)idslimitr"   )rangelenr	   formatjoinr   r%   )position	ids_chunkr3   r#   rZ   r   s       r   	generator"LiveHelper.info.<locals>.generator   sv     !!SXs3c>:	{+22sxx	7J2K!3<<++C+???	 4 @s   A&A5)A3*
A5)r:   listr9   )r   rZ   r?   rb   s   ``  r   infoLiveHelper.info   s1    : #t$$&CC. 	@ {r   c                F    U R                   R                  [        S   5      $ )zGet the currently featured live thread.

:returns: The :class:`.LiveThread` object, or ``None`` if there is no currently
    featured live thread.

Usage:

.. code-block:: python

    thread = reddit.live.now()  # LiveThread object or None

live_nowr$   r&   s    r   nowLiveHelper.now   s     || 455r   r8   )r   r;   rC   praw.models.LiveThread)
r2   r;   rP   rB   r,   rD   rQ   r;   rC   rk   )rZ   z	list[str]rC   z-Generator[praw.models.LiveThread, None, None])rC   zpraw.models.LiveThread | None)rE   rF   rG   rH   rI   r   r
   r@   re   ri   rJ   r8   r   r   rL   rL      sp    O/ WmV[A
 #'

  	

 
 
 
 
 B
<(T6r   rL   c            	          \ rS rSrSr\" SS5            SS j5       r\" SSSS	S
SS5      SSSSSS.               SS jj5       rSrg)MultiredditHelper   z9Provide a set of functions to interact with multireddits.redditornamec               >    SU SU 3n[        U R                  XS.S9$ )zReturn a lazy instance of :class:`.Multireddit`.

:param name: The name of the multireddit.
:param redditor: A redditor name or :class:`.Redditor` instance who owns the
    multireddit.

z/user/z/m/)rp   path)_data)r   r   )r   rp   ro   rr   s       r   r   MultiredditHelper.__call__   s*     zTF+4<</KLLr   display_name
subredditsdescription_md	icon_name	key_color
visibilityweighting_schemeNprivateclassic)rw   rx   ry   rz   r{   c                   UUUUU Vs/ s H  nS[        U5      0PM     snUUS.n	U R                  R                  [        S   S[	        U	5      0S9$ s  snf )a  Create a new :class:`.Multireddit`.

:param display_name: The display name for the new multireddit.
:param subreddits: Subreddits to add to the new multireddit. Can be a list of
    either :class:`.Subreddit` instances or subreddit display names.
:param description_md: Description for the new multireddit, formatted in
    markdown.
:param icon_name: Can be one of: ``"art and design"``, ``"ask"``, ``"books"``,
    ``"business"``, ``"cars"``, ``"comics"``, ``"cute animals"``, ``"diy"``,
    ``"entertainment"``, ``"food and drink"``, ``"funny"``, ``"games"``,
    ``"grooming"``, ``"health"``, ``"life advice"``, ``"military"``, ``"models
    pinup"``, ``"music"``, ``"news"``, ``"philosophy"``, ``"pictures and
    gifs"``, ``"science"``, ``"shopping"``, ``"sports"``, ``"style"``,
    ``"tech"``, ``"travel"``, ``"unusual stories"``, ``"video"``, or ``None``.
:param key_color: RGB hex color code of the form ``"#FFFFFF"``.
:param visibility: Can be one of: ``"hidden"``, ``"private"``, or ``"public"``
    (default: ``"private"``).
:param weighting_scheme: Can be one of: ``"classic"`` or ``"fresh"`` (default:
    ``"classic"``).

:returns: The new :class:`.Multireddit` object.

rp   )rw   ru   rx   ry   rv   rz   r{   multireddit_basemodelr6   )r;   r   r=   r	   r   )
r   rw   ru   rx   ry   rv   rz   r{   subr   s
             r   r@   MultiredditHelper.create  sq    X -(""9CD#FCH-D$ 0
 ||  '(u/F ! 
 	
	 Es   Ar8   )rp   r;   ro   zstr | praw.models.RedditorrC   praw.models.Multireddit)rw   rB   ru   r;   rx   rB   ry   rB   rv   zstr | praw.models.Subredditrz   r;   r{   r;   rC   r   )	rE   rF   rG   rH   rI   r
   r   r@   rJ   r8   r   r   rm   rm      s    CZ(MM&@M	 M )M  &* $ $# )-
 #-
 	-

 -
 -
 0-
 -
 -
 
!-
-
r   rm   c                  r    \ rS rSrSrSS jr\" SSSSS5      S	S
SSS.             SS jj5       rSrg)SubredditHelperi?  z7Provide a set of functions to interact with Subreddits.c                    UR                  5       nUS:X  a  U R                  R                  5       $ US:X  a  U R                  R                  SS9$ [        U R                  US9$ )zaReturn a lazy instance of :class:`.Subreddit`.

:param display_name: The name of the subreddit.

randomrandnsfwT)r,   )ru   )lowerr   random_subredditr   )r   ru   
lower_names      r   r   SubredditHelper.__call__B  s^     "'')
!<<0022#<<00d0;;LAAr   rp   r2   	link_typesubreddit_typewikimodeanypublicNdisabled)r   r   r2   r   c          
     r    [         R                  " SU R                  UUUU=(       d    UUS.UD6  U " U5      $ )aC  Create a new :class:`.Subreddit`.

:param name: The name for the new subreddit.
:param link_type: The types of submissions users can make. One of ``"any"``,
    ``"link"``, or ``"self"`` (default: ``"any"``).
:param subreddit_type: One of ``"archived"``, ``"employees_only"``,
    ``"gold_only"``, ``"gold_restricted"``, ``"private"``, ``"public"``, or
    ``"restricted"`` (default: ``"public"``).
:param title: The title of the subreddit. When ``None`` or ``""`` use the value
    of ``name``.
:param wikimode: One of ``"anyone"``, ``"disabled"``, or ``"modonly"`` (default:
    ``"disabled"``).

Any keyword parameters not provided, or set explicitly to ``None``, will take on
a default value assigned by the Reddit server.

.. seealso::

    :meth:`~.SubredditModeration.update` for documentation of other available
    settings.

)r   r   rp   r   r2   r   r8   )r   _create_or_updater   )r   rp   r   r   r2   r   other_settingss          r   r@   SubredditHelper.createQ  sH    B 	## 	
LL)-4	
 	
 Dzr   r8   )ru   r;   rC   praw.models.Subreddit)rp   r;   r   r;   r   r;   r2   rB   r   r;   r   rB   rC   r   )	rE   rF   rG   rH   rI   r   r
   r@   rJ   r8   r   r   r   r   ?  s    AB VWk3CZP
 & ")) 	)
 ) ) ) %) 
) Q)r   r   )rI   
__future__r   jsonr   typingr   r   r   constr	   utilr
   baser   reddit.draftr   reddit.liver   reddit.multir   r   praw.modelsprawr   rL   rm   r   r8   r   r   <module>r      se    ! "  0 0  "   # 0u?( u?pg6 g6TG
 G
T<h <r   