
    _Og                          S r SSKJr  SSKJr   " S S\R
                  5      r " S S\R
                  5      r " S	 S
\5      r " S S\5      r	g)z
This module contains the classes relating to notifications.

See also: http://developer.github.com/v3/activity/notifications/
    )dumps   )modelsc                   <    \ rS rSrSrS rS rS rS rS r	S r
S	rg
)Thread   a  Object representing a notification thread.

.. versionchanged:: 1.0.0

    The ``comment``, ``thread``, and ``url`` attributes are no longer
    present because GitHub stopped returning the comment that caused
    the notification.

    The ``is_unread`` method was removed since it just returned the
    ``unread`` attribute.

This object has the following attributes:

.. attribute:: id

    The unique identifier for this notification across all GitHub
    notifications.

.. attribute:: last_read_at

    A :class:`~datetime.datetime` object representing the date and time
    when the authenticated user last read this thread.

.. attribute:: reason

    The reason the authenticated user is receiving this notification.

.. attribute:: repository

    A :class:`~github3.repos.ShortRepository` this thread originated on.

.. attribute:: subject

    A dictionary with the subject of the notification, for example, which
    issue, pull request, or diff this is in relation to.

.. attribute:: unread

    A boolean attribute indicating whether this thread has been read or
    not.

.. attribute:: updated_at

    A :class:`~datetime.datetime` representing the date and time when this
    thread was last updated.

See also:
http://developer.github.com/v3/activity/notifications/
c                    SSK Jn  US   U l        US   U l        U R	                  US   5      U l        US   U l        UR                  US   U 5      U l        US   U l	        US	   U l
        U R	                  US
   5      U l        g )Nr   )reposurlidlast_read_atreason
repositorysubjectunread
updated_at) r
   _apir   	_strptimer   r   ShortRepositoryr   r   r   r   )selfthreadr
   s      Z/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/notifications.py_update_attributesThread._update_attributes>   s    5M	, NN6.+ABX&//|0DdKi(X&..)=>    c                 V    SR                  U R                  R                  S5      5      $ )Nz<Thread [{}]>title)formatr   getr   s    r   _reprThread._reprJ   s"    %%dll&6&6w&?@@r   c                 z    U R                  SU R                  S9nU R                  U R                  U5      SS5      $ )ziDelete subscription for this thread.

:returns:
    True if successful, False otherwise
:rtype:
    bool
subscriptionbase_url     )
_build_urlr   _boolean_delete)r   r   s     r   delete_subscriptionThread.delete_subscriptionM   s6     oontyyoA}}T\\#.S99r   c                 Z    U R                  U R                  U R                  5      SS5      $ )z]Mark the thread as read.

:returns:
    True if successful, False otherwise
:rtype:
    bool
   r)   )r+   _patchr   r!   s    r   markThread.markX   s$     }}T[[3S#>>r   c                     U R                  SU R                  S9nXS.nU R                  U R                  U[	        U5      S9S5      nU R                  [        U5      $ )ab  Set the user's subscription for this thread.

:param bool subscribed:
    (required), determines if notifications should be received from
    this thread.
:param bool ignored:
    (required), determines if notifications should be ignored from this
    thread.
:returns:
    new subscription
:rtype:
    :class:`~github3.notifications.ThreadSubscription`
r%   r&   
subscribedignoreddata   )r*   r   _json_putr   _instance_or_nullThreadSubscription)r   r6   r7   r   subjsons         r   set_subscriptionThread.set_subscriptionb   sW     oontyyoA'<zz$))CeCj)93?%%&8$??r   c                     U R                  SU R                  S9nU R                  U R                  U5      S5      nU R	                  [
        U5      $ )zCheck the status of the user's subscription to this thread.

:returns:
    the subscription for this thread
:rtype:
    :class:`~github3.notifications.ThreadSubscription`
r%   r&   r:   )r*   r   r;   _getr=   r>   )r   r   r@   s      r   r%   Thread.subscriptionu   sF     oontyyoAzz$))C.#.%%&8$??r   )r   r   r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r"   r-   r2   rA   r%   __static_attributes__ r   r   r   r      s)    0d
?A	:?@&
@r   r   c                   4    \ rS rSrSrS rS rS rS rS r	Sr
g)	_Subscription   aV  This object wraps thread and repository subscription information.

See also:
developer.github.com/v3/activity/notifications/#get-a-thread-subscription

.. versionchanged:: 1.0.0

    The ``is_ignored`` and ``is_subscribed`` methods were removed. Use the
    :attr`ignored` and :attr:`subscribed` attributes instead.

This object has the following attributes:

.. attribute:: created_at

    A :class:`~datetime.datetime` object representing the date and time
    the user was subscribed to the thread.

.. attribute:: ignored

    A boolean attribute indicating whether the user ignored this.

.. attribute:: reason

    The reason the user is subscribed to the thread.

.. attribute:: subscribed

    A boolean attribute indicating whether the user is subscribed or not.

.. attribute:: thread_url

    The URL of the thread resource in the GitHub API.
c                     US   U l         U R                  US   5      U l        US   U l        US   U l        US   U l        g )Nr   
created_atr7   r   r6   )r   r   rQ   r7   r   r6   )r   r?   s     r   r    _Subscription._update_attributes   sD    J	..\):;9~(ml+r   c                 <    SU R                    SU R                   S3$ )N<z [z]>)
class_namer6   r!   s    r   r"   _Subscription._repr   s!    4??#2doo%6b99r   c                 Z    U R                  U R                  U R                  5      SS5      $ )z^Delete this subscription.

:returns:
    True if successful, False otherwise
:rtype:
    bool
r(   r)   )r+   r,   r   r!   s    r   delete_Subscription.delete   s$     }}T\\$))4c3??r   c                     XS.nU R                  U R                  U R                  [        U5      S9S5      nU R	                  U5        g)a
  Set the user's subscription for this subscription.

:param bool subscribed:
    (required), determines if notifications should be received from
    this thread.
:param bool ignored:
    (required), determines if notifications should be ignored from this
    thread.
r5   r8   r:   N)r;   r<   r   r   r   )r   r6   r7   r?   r@   s        r   set_Subscription.set   s?     (<zz$))DIIE#J)?E%r   )r   rQ   r7   r   r6   N)rF   rG   rH   rI   rJ   rU   r   r"   rX   r[   rK   rL   r   r   rN   rN      s$     D !J,:@&r   rN   c                   0   ^  \ rS rSrSrS rU 4S jrSrU =r$ )r>      aT  This object provides a representation of a thread subscription.

See also:
developer.github.com/v3/activity/notifications/#get-a-thread-subscription

.. versionchanged:: 1.0.0

    The ``is_ignored`` and ``is_subscribed`` methods were removed. Use the
    :attr`ignored` and :attr:`subscribed` attributes instead.

This object has the following attributes:

.. attribute:: created_at

    A :class:`~datetime.datetime` object representing the date and time
    the user was subscribed to the thread.

.. attribute:: ignored

    A boolean attribute indicating whether the user ignored this.

.. attribute:: reason

    The reason the user is subscribed to the thread.

.. attribute:: subscribed

    A boolean attribute indicating whether the user is subscribed or not.

.. attribute:: thread_url

    The URL of the thread resource in the GitHub API.
c                 8   > [         TU ]  U5        US   U l        g )N
thread_url)superr   r`   r   r?   	__class__s     r   _update_subscription'ThreadSubscription._update_subscription   s    "3'l+r   )r`   	rF   rG   rH   rI   rJ   rU   rd   rK   __classcell__rc   s   @r   r>   r>      s     D &J, ,r   r>   c                   0   ^  \ rS rSrSrS rU 4S jrSrU =r$ )RepositorySubscription   a\  This object provides a representation of a thread subscription.

See also:
developer.github.com/v3/activity/notifications/#get-a-thread-subscription

.. versionchanged:: 1.0.0

    The ``is_ignored`` and ``is_subscribed`` methods were removed. Use the
    :attr`ignored` and :attr:`subscribed` attributes instead.

This object has the following attributes:

.. attribute:: created_at

    A :class:`~datetime.datetime` object representing the date and time
    the user was subscribed to the thread.

.. attribute:: ignored

    A boolean attribute indicating whether the user ignored this.

.. attribute:: reason

    The reason the user is subscribed to the thread.

.. attribute:: repository_url

    The URL of the repository resource in the GitHub API.

.. attribute:: subscribed

    A boolean attribute indicating whether the user is subscribed or not.
c                 P   > [         TU ]  U5        UR                  S5      U l        g )Nrepository_url)ra   r   r    rm   rb   s     r   rd   +RepositorySubscription._update_subscription  s"    "3'!gg&67r   )rm   rf   rh   s   @r   rj   rj      s     D *J8 8r   rj   N)
rJ   r@   r   r   r   
GitHubCorer   rN   r>   rj   rL   r   r   <module>rp      sW   
  t@V t@nE&F%% E&P', ',T'8] '8r   