
    _Og9                     b    S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\R                  5      r	g	)
zInvitation related logic.    )dumps   )models)users)requires_authc                   |    \ rS rSrSrS r\" / SQ5      rS rS r	\
S 5       r\
S 5       r\
S 5       r\
S	 5       rS
rg)
Invitation	   aa  Representation of an invitation to collaborate on a repository.

.. attribute:: created_at

    A :class:`~datetime.datetime` instance representing the time and date
    when this invitation was created.

.. attribute:: html_url

    The URL to view this invitation in a browser.

.. attribute:: id

    The unique identifier for this invitation.

.. attribute:: invitee

    A :class:`~github3.users.ShortUser` representing the user who was
    invited to collaborate.

.. attribute:: inviter

    A :class:`~github3.users.ShortUser` representing the user who invited
    the ``invitee``.

.. attribute:: permissions

    The permissions that the ``invitee`` will have on the repository. Valid
    values are ``read``, ``write``, and ``admin``.

.. attribute:: repository

    A :class:`~github3.repos.ShortRepository` representing the repository
    on which the ``invitee` was invited to collaborate.

.. attribute:: url

    The API URL that the ``invitee`` can use to respond to the invitation.
    Note that the ``inviter`` must use a different URL, not returned by
    the API, to update or cancel the invitation.
)adminreadwritec                 B   SSK Jn  U R                  US   5      U l        US   U l        US   U l        [        R                  " US   U 5      U l        [        R                  " US   U 5      U l	        US   U l
        UR                  US	   U 5      U l        US
   U l        g )N   )repo
created_athtml_urlidinviteeinviterpermissions
repositoryurl) r   	_strptimer   r   r   r   	ShortUserr   r   r   ShortRepositoryr   r   )self
invitationr   s      ]/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/repos/invitation.py_update_attributesInvitation._update_attributes7   s    ..L)AB":.T"z)'<dCz)'<dC%m4..z,/GNe$    c                 6    SU R                   R                   S3$ )Nz<Invitation [z]>)r   	full_namer   s    r   _reprInvitation._reprC   s    t889<<r"   c                 Z    U R                  U R                  U R                  5      SS5      $ )z\Accept this invitation.

:returns:
    True if successful, False otherwise
:rtype:
    bool
     )_boolean_patchr   r%   s    r   acceptInvitation.acceptF   s$     }}T[[2C==r"   c                 Z    U R                  U R                  U R                  5      SS5      $ )z]Decline this invitation.

:returns:
    True if successful, False otherwise
:rtype:
    bool
r)   r*   )r+   _deleter   r%   s    r   declineInvitation.declineQ   s$     }}T\\$((3S#>>r"   c                     U R                  SU R                  U R                  R                  S9nU R	                  U R                  U5      SS5      $ )z\Delete this invitation.

:returns:
    True if successful, False otherwise
:rtype:
    bool
invitationsbase_urlr)   r*   )
_build_urlr   r   r   r+   r0   )r   r   s     r   deleteInvitation.delete\   sJ     oo477T__-@-@  
 }}T\\#.S99r"   c           	      |   XR                   ;  a<  [        SR                  SR                  [	        U R                   5      5      5      5      eU R                  SU R                  U R                  R                  S9nSU0nU R                  U R                  U[        U5      S9S5      nU R                  [        U5      $ )a  Update this invitation.

:param str permissions:
    (required), the permissions that will be granted by this invitation
    once it has been updated. Options: 'admin', 'read', 'write'
:returns:
    The updated invitation
:rtype:
    :class:`~github3.repos.invitation.Invitation`
z'permissions' must be one of {}z, r4   r5   r   )data   )allowed_permissions
ValueErrorformatjoinsortedr7   r   r   r   _jsonr,   r   _instance_or_nullr	   )r   r   r   r;   jsons        r   updateInvitation.updatej   s     666188IIfT%=%=>? 
 oo477T__-@-@  
 {+zz$++cd+<cB%%j$77r"   )r   r   r   r   r   r   r   r   N)__name__
__module____qualname____firstlineno____doc__
class_name	frozensetr=   r    r&   r   r-   r1   r8   rE   __static_attributes__ r"   r   r	   r	   	   su    (T J#$>?
%= > > ? ? : : 8 8r"   r	   N)
rK   rD   r   r   r   r   
decoratorsr   
GitHubCorer	   rO   r"   r   <module>rR      s(        &x8"" x8r"   