o
    2g                     @   s"   d Z ddlmZ G dd dZdS )z!Provide the InboxableMixin class.   )API_PATHc                   @   s@   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dS )InboxableMixinzLInterface for :class:`.RedditBase` subclasses that originate from the inbox.c                 C      | j jtd d| jid dS )a]  Block the user who sent the item.

        .. note::

            This method pertains only to objects which were retrieved via the inbox.

        Example usage:

        .. code-block:: python

            comment = reddit.comment("dkk4qjd")
            comment.block()

            # or, identically:

            comment.author.block()

        blockiddataN_redditpostr   fullnameself r   [/home/garg/my-data/venv/lib/python3.10/site-packages/praw/models/reddit/mixins/inboxable.pyr   	   s   zInboxableMixin.blockc                 C      | j j| g dS )a  Mark the item as collapsed.

        .. note::

            This method pertains only to objects which were retrieved via the inbox.

        Example usage:

        .. code-block:: python

            inbox = reddit.inbox()

            # select first inbox item and collapse it message = next(inbox)
            message.collapse()

        .. seealso::

            :meth:`.uncollapse`

        N)r
   inboxcollapser   r   r   r   r      s   zInboxableMixin.collapsec                 C   r   )a  Mark a single inbox item as read.

        .. note::

            This method pertains only to objects which were retrieved via the inbox.

        Example usage:

        .. code-block:: python

            inbox = reddit.inbox.unread()

            for message in inbox:
                # process unread messages
                ...

        .. seealso::

            :meth:`.mark_unread`

        To mark the whole inbox as read with a single network request, use
        :meth:`.Inbox.mark_all_read`

        N)r
   r   	mark_readr   r   r   r   r   5   s   zInboxableMixin.mark_readc                 C   r   )a  Mark the item as unread.

        .. note::

            This method pertains only to objects which were retrieved via the inbox.

        Example usage:

        .. code-block:: python

            inbox = reddit.inbox(limit=10)

            for message in inbox:
                # process messages
                ...

        .. seealso::

            :meth:`.mark_read`

        N)r
   r   mark_unreadr   r   r   r   r   P      zInboxableMixin.mark_unreadc                 C   r   )a  Unblock a subreddit.

        .. note::

            This method pertains only to objects which were retrieved via the inbox.

        For example, to unblock all blocked subreddits that you can find by going
        through your inbox:

        .. code-block:: python

            from praw.models import SubredditMessage

            subs = set()
            for item in reddit.inbox.messages(limit=None):
                if isinstance(item, SubredditMessage):
                    if (
                        item.subject == "[message from blocked subreddit]"
                        and str(item.subreddit) not in subs
                    ):
                        item.unblock_subreddit()
                        subs.add(str(item.subreddit))

        unblock_subredditr   r   Nr	   r   r   r   r   r   h   s   z InboxableMixin.unblock_subredditc                 C   r   )a  Mark the item as uncollapsed.

        .. note::

            This method pertains only to objects which were retrieved via the inbox.

        Example usage:

        .. code-block:: python

            inbox = reddit.inbox()

            # select first inbox item and uncollapse it
            message = next(inbox)
            message.uncollapse()

        .. seealso::

            :meth:`.collapse`

        N)r
   r   
uncollapser   r   r   r   r      r   zInboxableMixin.uncollapseN)
__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   r   r      s    r   N)r   constr   r   r   r   r   r   <module>   s    