
    #Ii                         S SK J r   S SKJrJrJr  S SKrS SKrS SKJrJ	r	J
r
Jr  \(       a  S SKJr   " S S\R                  R                  5      rg)    )datetime)TYPE_CHECKINGListOptionalN)	AttributeNotSetOpt_NotSetType)AuthorizationApplicationc                      \ rS rSr% Sr\S   \S'   \\   \S'   \\   \S'   \\	\
      \S'   \\	\
      \S'   \\
   \S	'   \\
   \S
'   \\   \S'   \\
   \S'   S\
4S jr\S#S j5       r\S\4S j5       r\S\4S j5       r\S\	\
   4S j5       r\S\	\
   4S j5       r\S\
4S j5       r\S\
4S j5       r\S\4S j5       r\S\
4S j5       rS$S jr\\\\\4S\\\
      S\\\
      S\\\
      S\\
   S\\
   SS4S jjrS  rS! rS"rg)%Authorization)   z
This class represents Authorizations. The reference can be found here https://docs.github.com/en/enterprise-server@3.0/rest/reference/oauth-authorizations
r   _app_created_at_id_note	_note_url_scopes_token_updated_at_urlreturnc                 P    U R                  SU R                  R                  05      $ )Nscopes)get__repr__r   valueselfs    :/venv/lib/python3.13/site-packages/github/Authorization.py__repr__Authorization.__repr__8   s"    4<<+=+= >??    c                 d    U R                  U R                  5        U R                  R                  $ N)_completeIfNotSetr   r   r   s    r   appAuthorization.app;   "    tyy)yyr"   c                 d    U R                  U R                  5        U R                  R                  $ )z
:type: datetime.datetime
)r%   r   r   r   s    r   
created_atAuthorization.created_at@   s*    
 	t//0%%%r"   c                 d    U R                  U R                  5        U R                  R                  $ r$   )r%   r   r   r   s    r   idAuthorization.idH   s"    txx(xx~~r"   c                 d    U R                  U R                  5        U R                  R                  $ r$   )r%   r   r   r   s    r   noteAuthorization.noteM   s$    tzz*zzr"   c                 d    U R                  U R                  5        U R                  R                  $ r$   )r%   r   r   r   s    r   note_urlAuthorization.note_urlR   s$    t~~.~~###r"   c                 d    U R                  U R                  5        U R                  R                  $ r$   )r%   r   r   r   s    r   r   Authorization.scopesW   s$    t||,||!!!r"   c                 d    U R                  U R                  5        U R                  R                  $ r$   )r%   r   r   r   s    r   tokenAuthorization.token\   s$    t{{+{{   r"   c                 d    U R                  U R                  5        U R                  R                  $ r$   )r%   r   r   r   s    r   
updated_atAuthorization.updated_ata   s(    t//0%%%r"   c                 d    U R                  U R                  5        U R                  R                  $ r$   )r%   r   r   r   s    r   urlAuthorization.urlf   r(   r"   Nc                 T    U R                   R                  SU R                  5      u  pg)zl
:calls: `DELETE /authorizations/{id} <https://docs.github.com/en/developers/apps/authorizing-oauth-apps>`_
DELETEN)
_requesterrequestJsonAndCheckr>   )r   headersdatas      r   deleteAuthorization.deletek   s"     ;;HdhhOr"   r   
add_scopesremove_scopesr0   r3   c                 f   [        U[        5      (       d  [        S U 5       5      (       d   U5       e[        U[        5      (       d  [        S U 5       5      (       d   U5       e[        U[        5      (       d  [        S U 5       5      (       d   U5       e[        U[        [        45      (       d   U5       e[        U[        [        45      (       d   U5       e[        R
                  " UUUUUS.5      nU R                  R                  SU R                  US9u  pxU R                  U5        g)a	  
:calls: `PATCH /authorizations/{id} <https://docs.github.com/en/developers/apps/authorizing-oauth-apps>`_
:param scopes: list of string
:param add_scopes: list of string
:param remove_scopes: list of string
:param note: string
:param note_url: string
:rtype: None
c              3   B   #    U  H  n[        U[        5      v   M     g 7fr$   
isinstancestr.0elements     r   	<genexpr>%Authorization.edit.<locals>.<genexpr>   s      6
4:Jw$$F   c              3   B   #    U  H  n[        U[        5      v   M     g 7fr$   rL   rO   s     r   rR   rS      s      :
4>Jw$$JrT   c              3   B   #    U  H  n[        U[        5      v   M     g 7fr$   rL   rO   s     r   rR   rS      s      =
4AJw$$MrT   )r   rH   rI   r0   r3   PATCH)inputN)
rM   r
   allrN   r   remove_unset_itemsrB   rC   r>   _useAttributes)	r   r   rH   rI   r0   r3   post_parametersrD   rE   s	            r   editAuthorization.editq   sH   " &+..# 6
4:6
 3
 3
 		 
 *k22c :
4>:
 7
 7
 		 
 -55 =
4A=
 :
 :
 		 
 $c 2339T93([#$677AA7 33 (!.$
 ;;TXX_ < 
 	D!r"   c                     [         U l        [         U l        [         U l        [         U l        [         U l        [         U l        [         U l        [         U l        [         U l	        g r$   )
r   r   r   r   r   r   r   r   r   r   r   s    r   _initAttributesAuthorization._initAttributes   sC    	!
!	r"   c                 f   SU;   a2  U R                  [        R                  R                  US   5      U l        SU;   a  U R	                  US   5      U l        SU;   a  U R                  US   5      U l        SU;   a  U R                  US   5      U l	        SU;   a  U R                  US   5      U l
        SU;   a  U R                  US   5      U l        SU;   a  U R                  US   5      U l        SU;   a  U R	                  US   5      U l        S	U;   a  U R                  US	   5      U l        g g )
Nr&   r*   r-   r0   r3   r   r8   r;   r>   )_makeClassAttributegithubr   r   _makeDatetimeAttributer   _makeIntAttributer   _makeStringAttributer   r   _makeListOfStringsAttributer   r   r   r   )r   
attributess     r   r[   Authorization._useAttributes   s4   J00//HH5!DI :%#:::l;STD:--j.>?DHZ22:f3EFDJ#!66z*7MNDNz!;;Jx<PQDLj 33Jw4GHDK:%#:::l;STDJ11*U2CDDI r"   )	r   r   r   r   r   r   r   r   r   )r   r   )r   N)__name__
__module____qualname____firstlineno____doc__r   __annotations__r   intr   rN   r    propertyr&   r*   r-   r0   r3   r   r8   r;   r>   rF   r   r	   r   r]   r`   r[   __static_attributes__ r"   r   r   r   )   s    .
//8$$	3Xc]###''s^cN8$$
C.@# @   &H & & C    hsm     $(3- $ $ " " " !s ! ! &H & & S  P "(%+(.#*"DI*" S	N*" 49~	*"
 #h*" c(*" 
*"X	Er"   r   )r   typingr   r   r   github.AuthorizationApplicationrd   github.GithubObjectr   r   r	   r
   r   GithubObjectCompletableGithubObjectr   rt   r"   r   <module>rz      s>   <  0 0 &  C CHTEF''?? TEr"   