
    _Og                     6    S r SSKJr  SSKJr   " S S\5      rg)z.This module contains the Authorization object.   )requires_basic_auth)
GitHubCorec                   v    \ rS rSrSrS rS rS r\SS j5       r	\S 5       r
\SS	 j5       r\SS
 j5       rSrg)Authorization   a
  Representation of an OAuth Authorization.

See also: https://developer.github.com/v3/oauth_authorizations/

This object has the following attributes:

.. attribute:: app

    Details about the application the authorization was created for.

.. attribute:: created_at

    A :class:`~datetime.datetime` representing when this authorization was
    created.

.. attribute:: fingerprint

    .. versionadded:: 1.0

    The optional parameter that is used to allow an OAuth application to
    create multiple authorizations for the same user. This will help
    distinguish two authorizations for the same app.

.. attribute:: hashed_token

    .. versionadded:: 1.0

    This is the base64 of the SHA-256 digest of the token.

    .. seealso::

        `Removing Authorization Tokens`_
            The blog post announcing the removal of :attr:`token`.

.. attribute:: id

    The unique identifier for this authorization.

.. attribute:: note_url

    The URL that points to a longer description about the purpose of this
    autohrization.

.. attribute:: note

    The short note provided when this authorization was created.

.. attribute:: scopes

    The list of scopes assigned to this token.

    .. seealso::

        `Scopes for OAuth Applications`_
            GitHub's documentation around available scopes and what they
            mean

.. attribute:: token

    If this authorization was created, this will contain the full token.
    Otherwise, this attribute will be an empty string.

.. attribute:: token_last_eight

    .. versionadded:: 1.0

    The last eight characters of the token. This allows users to identify
    a token after the initial retrieval.

.. attribute:: updated_at

    A :class:`~datetime.datetime` representing when this authorization was
    most recently updated.

.. _Scopes for OAuth Applications:
    https://developer.github.com/apps/building-oauth-apps/scopes-for-oauth-apps/
.. _Removing Authorization Tokens:
    https://developer.github.com/changes/2014-12-08-removing-authorizations-token/#what-should-you-do
c                    US   U l         US   U l        U R                  US   5      U l        US   U l        US   U l        US   U l        US   U l        US   U l        US	   U l	        US
   U l
        U R                  US   5      U l        g )Nurlapp
created_atfingerprintidnote_urlnotescopestokentoken_last_eight
updated_at)_apir
   	_strptimer   r   r   r   r   r   r   r   r   )selfauths     R/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/auths.py_update_attributes Authorization._update_attributesW   s    K	;..l);<.t*Z(L	8n']
 $%7 8..l);<    c                 "    SU R                    S3$ )Nz<Authorization [z]>)namer   s    r   _reprAuthorization._reprd   s    !$))B//r   c                     Ub  X!S'   Ub  X1S'   U R                  U R                  U R                  US9S5      nU(       a  U R                  U5        gg)z5Helper for add_scopes, replace_scopes, remove_scopes.r   r   )data   TF)_json_postr   r   )r   scopes_datar   r   jsons        r   _updateAuthorization._updateg   sV    "&&.
#zz$**TYY[*A3G##D)r   Nc                 *    U R                  SU0X#5      $ )am  Add the scopes to this authorization.

.. versionadded:: 1.0

:param list scopes:
    Adds these scopes to the ones present on this authorization
:param str note:
    (optional), Note about the authorization
:param str note_url:
    (optional), URL to link to when the user views the authorization
:returns:
    True if successful, False otherwise
:rtype:
    bool

add_scopesr(   r   r   r   r   s       r   r+   Authorization.add_scopesu   s    " ||\62DCCr   c                 Z    U R                  U R                  U R                  5      SS5      $ )z_Delete this authorization.

:returns:
    True if successful, False otherwise
:rtype:
    bool
   i  )_boolean_deleter   r   s    r   deleteAuthorization.delete   s$     }}T\\$))4c3??r   c                 *    U R                  SU0X#5      $ )av  Remove the scopes from this authorization.

.. versionadded:: 1.0

:param list scopes:
    Remove these scopes from the ones present on this authorization
:param str note:
    (optional), Note about the authorization
:param str note_url:
    (optional), URL to link to when the user views the authorization
:returns:
    True if successful, False otherwise
:rtype:
    bool
	rm_scopesr,   r-   s       r   remove_scopesAuthorization.remove_scopes   s    " ||[&14BBr   c                 *    U R                  SU0X#5      $ )ac  Replace the scopes on this authorization.

.. versionadded:: 1.0

:param list scopes:
    Use these scopes instead of the previous list
:param str note:
    (optional), Note about the authorization
:param str note_url:
    (optional), URL to link to when the user views the authorization
:returns:
    True if successful, False otherwise
:rtype:
    bool
r   r,   r-   s       r   replace_scopesAuthorization.replace_scopes   s    " ||Xv.??r   )r   r
   r   r   r   r   r   r   r   r   r   )NN)__name__
__module____qualname____firstlineno____doc__r   r   r(   r   r+   r3   r7   r:   __static_attributes__ r   r   r   r      sp    N`=0 D D$ @ @ C C$ @ @r   r   N)r@   
decoratorsr   modelsr   r   rB   r   r   <module>rE      s    4 + q@J q@r   