
    {i_*                        S r SSKJr  SSK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  \(       a  SSKr " S S\5      rg)zProvide the Front class.    )annotations)TYPE_CHECKINGIterator   )API_PATH)_deprecate_args   )PRAWBase)ListingGenerator)stream_generatorNc                      \ rS rSrSr    SS jrSS jr    SS jrS rSS jr	SS jr
    SS	 jrSS
 jr    SS jr    SS jr    SS jr    SS jrSS jr\" S5      SS.     SS jj5       rSrg)Inbox   z3Inbox is a Listing class that represents the inbox.c                >    [        U R                  [        S   40 UD6$ )aP  Return a :class:`.ListingGenerator` for all inbox comments and messages.

Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

To output the type and ID of all items available via this listing do:

.. code-block:: python

    for item in reddit.inbox.all(limit=None):
        print(repr(item))

inboxr   _redditr   selfgenerator_kwargss     K/home/james-whalen/.local/lib/python3.13/site-packages/praw/models/inbox.pyall	Inbox.all   s        hw.?TCSTT    c                    U(       aM  SSR                  S USS  5       5      0nU R                  R                  [        S   US9  USS nU(       a  ML  gg)a  Mark an inbox message as collapsed.

:param items: A list containing instances of :class:`.Message`.

Requests are batched at 25 items (reddit limit).

For example, to collapse all unread Messages, try:

.. code-block:: python

    from praw.models import Message

    unread_messages = []
    for item in reddit.inbox.unread(limit=None):
        if isinstance(item, Message):
            unread_messages.append(item)
    reddit.inbox.collapse(unread_messages)

.. seealso::

    :meth:`.Message.uncollapse`

id,c              3  8   #    U  H  oR                   v   M     g 7fNfullname.0xs     r   	<genexpr>!Inbox.collapse.<locals>.<genexpr>?        "Bz!::z   N   collapsedatajoinr   postr   r   itemsr,   s      r   r*   Inbox.collapse&   sT    0 #(("BuSbz"BBCDLLhz2>"#JE er   c                >    [        U R                  [        S   40 UD6$ )aA  Return a :class:`.ListingGenerator` for comment replies.

Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

To output the author of one request worth of comment replies try:

.. code-block:: python

    for reply in reddit.inbox.comment_replies():
        print(reply.author)

comment_repliesr   r   s     r   r4   Inbox.comment_repliesC   s(       LL(#45
9I
 	
r   c                H    U R                   R                  [        S   5        g)zMark all messages as read with just one API call.

Example usage:

.. code-block:: python

    reddit.inbox.mark_all_read()

.. note::

    This method returns after Reddit acknowledges your request, instead of after
    the request has been fulfilled.

read_all_messagesN)r   r/   r   )r   s    r   mark_all_readInbox.mark_all_readW   s     	(#678r   c                    U(       aM  SSR                  S USS  5       5      0nU R                  R                  [        S   US9  USS nU(       a  ML  gg)a  Mark Comments or Messages as read.

:param items: A list containing instances of :class:`.Comment` and/or
    :class:`.Message` to be marked as read relative to the authorized user's
    inbox.

Requests are batched at 25 items (reddit limit).

For example, to mark all unread Messages as read, try:

.. code-block:: python

    from praw.models import Message

    unread_messages = []
    for item in reddit.inbox.unread(limit=None):
        if isinstance(item, Message):
            unread_messages.append(item)
    reddit.inbox.mark_read(unread_messages)

.. seealso::

    - :meth:`.Comment.mark_read`
    - :meth:`.Message.mark_read`

r   r   c              3  8   #    U  H  oR                   v   M     g 7fr   r    r"   s     r   r%   "Inbox.mark_read.<locals>.<genexpr>   r'   r(   Nr)   read_messager+   r-   r0   s      r   	mark_readInbox.mark_readh   sT    6 #(("BuSbz"BBCDLLh~6TB"#JE er   c                    U(       aM  SSR                  S USS  5       5      0nU R                  R                  [        S   US9  USS nU(       a  ML  gg)a  Unmark Comments or Messages as read.

:param items: A list containing instances of :class:`.Comment` and/or
    :class:`.Message` to be marked as unread relative to the authorized user's
    inbox.

Requests are batched at 25 items (Reddit limit).

For example, to mark the first 10 items as unread try:

.. code-block:: python

    to_unread = list(reddit.inbox.all(limit=10))
    reddit.inbox.mark_unread(to_unread)

.. seealso::

    - :meth:`.Comment.mark_unread`
    - :meth:`.Message.mark_unread`

r   r   c              3  8   #    U  H  oR                   v   M     g 7fr   r    r"   s     r   r%   $Inbox.mark_unread.<locals>.<genexpr>   r'   r(   Nr)   unread_messager+   r-   r0   s      r   mark_unreadInbox.mark_unread   sU    , #(("BuSbz"BBCDLLh'78tD"#JE er   c                >    [        U R                  [        S   40 UD6$ )a  Return a :class:`.ListingGenerator` for mentions.

A mention is :class:`.Comment` in which the authorized redditor is named in its
body like u/spez.

Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

For example, to output the author and body of the first 25 mentions try:

.. code-block:: python

    for mention in reddit.inbox.mentions(limit=25):
        print(f"{mention.author}\\n{mention.body}\\n")

mentionsr   r   s     r   rG   Inbox.mentions   s     &  hz.BWFVWWr   c                j   U R                   R                  [        S   R                  US95      nUS   /US   R                  -    Vs0 s H  o3R
                  U_M     nnUR                  5        H&  u  pSUR                  UR                  S5      Ul        M(     USUR                  5        3   $ s  snf )zReturn a :class:`.Message` corresponding to ``message_id``.

:param message_id: The base36 ID of a message.

For example:

.. code-block:: python

    message = reddit.inbox.message("7bnlgu")

message)r   r   Nt4_)
r   getr   formatrepliesr!   r1   	parent_idparentlower)r   
message_idlistingrJ   messages	_fullnames         r   rJ   Inbox.message   s     ,,""8I#6#=#=#=#LM6=aj\GAJDVDV5V
5V'g%5V 	 
 #+.."2I%\\'*;*;TBGN #3#j..01233
s   B0c                >    [        U R                  [        S   40 UD6$ )aI  Return a :class:`.ListingGenerator` for inbox messages.

Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

For example, to output the subject of the most recent 5 messages try:

.. code-block:: python

    for message in reddit.inbox.messages(limit=5):
        print(message.subject)

rT   r   r   s     r   rT   Inbox.messages   s        hz.BWFVWWr   c                >    [        U R                  [        S   40 UD6$ )aE  Return a :class:`.ListingGenerator` for sent messages.

Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

For example, to output the recipient of the most recent 15 messages try:

.. code-block:: python

    for message in reddit.inbox.sent(limit=15):
        print(message.dest)

sentr   r   s     r   rZ   
Inbox.sent   s        hv.>SBRSSr   c                .    [        U R                  40 UD6$ )aM  Yield new inbox items as they become available.

Items are yielded oldest first. Up to 100 historical items will initially be
returned.

Keyword arguments are passed to :func:`.stream_generator`.

For example, to retrieve all new inbox items, try:

.. code-block:: python

    for item in reddit.inbox.stream():
        print(item)

)r   unread)r   stream_optionss     r   streamInbox.stream   s    $  >~>>r   c                >    [        U R                  [        S   40 UD6$ )aJ  Return a :class:`.ListingGenerator` for submission replies.

Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

To output the author of one request worth of submission replies try:

.. code-block:: python

    for reply in reddit.inbox.submission_replies():
        print(reply.author)

submission_repliesr   r   s     r   rb   Inbox.submission_replies  s(       LL(#78
<L
 	
r   c                    U(       aM  SSR                  S USS  5       5      0nU R                  R                  [        S   US9  USS nU(       a  ML  gg)a  Mark an inbox message as uncollapsed.

:param items: A list containing instances of :class:`.Message`.

Requests are batched at 25 items (reddit limit).

For example, to uncollapse all unread Messages, try:

.. code-block:: python

    from praw.models import Message

    unread_messages = []
    for item in reddit.inbox.unread(limit=None):
        if isinstance(item, Message):
            unread_messages.append(item)
    reddit.inbox.uncollapse(unread_messages)

.. seealso::

    :meth:`.Message.collapse`

r   r   c              3  8   #    U  H  oR                   v   M     g 7fr   r    r"   s     r   r%   #Inbox.uncollapse.<locals>.<genexpr>1  r'   r(   Nr)   
uncollapser+   r-   r0   s      r   rg   Inbox.uncollapse  sT    0 #(("BuSbz"BBCDLLh|44@"#JE er   r>   F)r>   c               `    U R                  USUS9  [        U R                  [        S   40 UD6$ )aP  Return a :class:`.ListingGenerator` for unread comments and messages.

:param mark_read: Marks the inbox as read (default: ``False``).

.. note::

    This only marks the inbox as read not the messages. Use
    :meth:`.Inbox.mark_read` to mark the messages.

Additional keyword arguments are passed in the initialization of
:class:`.ListingGenerator`.

For example, to output the author of unread comments try:

.. code-block:: python

    from praw.models import Comment

    for item in reddit.inbox.unread(limit=None):
        if isinstance(item, Comment):
            print(item.author)

params)	argumentskeymarkr]   )_safely_add_argumentsr   r   r   )r   r>   r   s      r   r]   Inbox.unread5  s<    < 	""&H9 	# 	
  hx.@UDTUUr    N)r   str | int | dict[str, str]returnz3Iterator[praw.models.Message | praw.models.Comment])r1   zlist[praw.models.Message])r   rq   rr   zIterator[praw.models.Comment])r1   z/list[praw.models.Comment | praw.models.Message])rR   strrr   zpraw.models.Message)r   rq   rr   zIterator[praw.models.Message])r^   rq   rr   3Iterator[praw.models.Comment | praw.models.Message])r>   boolr   rq   rr   rt   )__name__
__module____qualname____firstlineno____doc__r   r*   r4   r8   r>   rD   rG   rJ   rT   rZ   r_   rb   rg   r   r]   __static_attributes__rp   r   r   r   r      s   =U"<U	<U$:
"<
	&
(9"@6X"<X	&X*4(X"<X	&X$T"<T	&T$? :?	<?(
"<
	&
(: [!   V  V 7	 V
 
= V " Vr   r   )rz   
__future__r   typingr   r   constr   utilr   baser
   listing.generatorr   r   praw.modelsprawr   rp   r   r   <module>r      s3     " *  "  / "EVH EVr   