
    ,Of\                    P   d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm	Z	m
Z
mZ d dlZd dlmZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl m!Z!m"Z"m#Z#m$Z$ d d	lm%Z% d d
l&m'Z'm(Z( d dl)m*Z* d dl+m,Z, d dl-m.Z. d dl/m0Z0 erld dl1m2Z2 d dlm3Z3 d dlm4Z4 d dl5m6Z6 d dl7m8Z8 d dlm9Z9 d dlm:Z: d dlm;Z; d dlm<Z< d dlm=Z= d dl>m?Z? d dlm@Z@ d dlmAZA d dlBmCZC d dlDmEZE d dlFmGZG d dlHmIZI d d lmJZJ  ed!e!"      ZK G d# d$      ZLy)%    )annotationsN)datetime)TYPE_CHECKINGAnyBinaryIOTypeVar)Retry)Consts)GithubIntegration)GithubObjectNotSetOpt
is_defined)GithubRetry)HookDeliveryHookDeliverySummary)HookDescription)PaginatedList)	RateLimit)	Requester)AppAuthentication)ApplicationOAuth)AuthenticatedUser)Commit)ContentFile)Event)Gist)	GithubApp)GitignoreTemplate)GlobalAdvisory)Issue)License)	NamedUser)Organization)Project)ProjectColumn)
Repository)TopicTGithubObject)boundc                     e Zd ZU dZded<    e       Zddddej                  ej                  ej                  ej                  dedej                  ej                  df	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d7dZd8dZd9dZd:d	Zed;d
       Zej(                  d<d       Zed=d       Zej(                  d>d       Zed?d       Zed=d       Zd@dZedAd       ZefdBdZdCdZdDdZefdEdZdFdZefdGdZ dHdZ!efdIdZ"dJdZ#dKdLdZ$eef	 	 	 	 	 dMdZ%dNdZ&dOdZ'dPd Z(efdQd!Z)dRd"Z*eeeeeeeeeeeeeeeeef	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dSd#Z+eef	 	 	 	 	 	 	 	 	 dTd$Z,eef	 	 	 	 	 	 	 	 	 dUd%Z-eef	 	 	 	 	 	 	 	 	 dVd&Z.eedf	 	 	 	 	 	 	 	 	 	 	 dWd'Z/eef	 	 	 	 	 	 	 	 	 dXd(Z0dYd)Z1efdZd*Z2d[d+Z3d\d,Z4d]d-Z5d^d.Z6d_d/Z7d`d0Z8dad1Z9	 db	 	 	 	 	 	 	 dcd2Z:ddded3Z;dfd4Z<dgd5Z=efdhd6Z>y)iGithubz
    This is the main class you instantiate to access the Github API v3.

    Optional parameters allow different authentication methods.

    r   _Github__requesterNTc                   |t        |t              sJ |       |t        |t              sJ |       |t        |t              sJ |       t        |t              sJ |       t        |t              sJ |       |t        |t              sJ |       t        |t              sJ |       t        |	t        t        f      sJ |	       |
;t        |
t              s+t        |
t        j
                  j                        sJ |
       |t        |t              sJ |       ||dk\  sJ ||dk\  sJ |+t        |t        j                  j                        sJ |       |<t        j                  dt               t        j                  j                  ||      }n|;t        j                  dt               t        j                  j                  |      }n\|;t        j                  dt               t        j                  j                  |      }n|t        j                  dt               |}t        ||||||	|
|||
      | _        y)a  
        :param login_or_token: string deprecated, use auth=github.Auth.Login(...) or auth=github.Auth.Token(...) instead
        :param password: string deprecated, use auth=github.Auth.Login(...) instead
        :param jwt: string deprecated, use auth=github.Auth.AppAuth(...) or auth=github.Auth.AppAuthToken(...) instead
        :param app_auth: github.AppAuthentication deprecated, use auth=github.Auth.AppInstallationAuth(...) instead
        :param base_url: string
        :param timeout: integer
        :param user_agent: string
        :param per_page: int
        :param verify: boolean or string
        :param retry: int or urllib3.util.retry.Retry object,
                      defaults to github.Github.default_retry,
                      set to None to disable retries
        :param pool_size: int
        :param seconds_between_requests: float
        :param seconds_between_writes: float
        :param auth: authentication method
        Nr   zdArguments login_or_token and password are deprecated, please use auth=github.Auth.Login(...) insteadcategoryzUArgument login_or_token is deprecated, please use auth=github.Auth.Token(...) insteadzrArgument jwt is deprecated, please use auth=github.Auth.AppAuth(...) or auth=github.Auth.AppAuthToken(...) insteadz]Argument app_auth is deprecated, please use auth=github.Auth.AppInstallationAuth(...) instead)
isinstancestrintboolurllib3utilr	   githubAuthwarningswarnDeprecationWarningLoginTokenAppAuthTokenr   r-   )selflogin_or_tokenpasswordjwtapp_authbase_urltimeout
user_agentper_pageverifyretry	pool_sizeseconds_between_requestsseconds_between_writesauths                  0lib/python3.12/site-packages/github/MainClass.py__init__zGithub.__init__   s1   H %NC)HX.XH:h#<FhF<{jc27C72(C(2(2('3'00'!Z
C%@L*L@(C(2(2(&4+.66.}
5# 6*UGLLL^L^:_faff_ Jy#$>I	I>'/3Kq3PPP%-1G11LLL|z$0@0@AG4GAMM6+
 ;;$$^X>D'MMj+ ;;$$^4D_MM= ,	 ;;++C0D!MMr+ D$$"
    c                8    | j                   j                          y)zClose connections to the server. Alternatively, use the Github
        object as a context manager:

        .. code-block:: python

          with github.Github(...) as gh:
            # do something
        N)r-   closer?   s    rN   rR   zGithub.close  s     	 rP   c                    | S N rS   s    rN   	__enter__zGithub.__enter__  s    rP   c                $    | j                          y rU   )rR   )r?   exc_typeexc_valexc_tbs       rN   __exit__zGithub.__exit__  s    

rP   c                .    | j                   j                  S rU   r-   FIX_REPO_GET_GIT_REFrS   s    rN   r_   zGithub.FIX_REPO_GET_GIT_REF  s    444rP   c                &    || j                   _        y rU   r^   r?   values     rN   r_   zGithub.FIX_REPO_GET_GIT_REF  s    05-rP   c                .    | j                   j                  S rU   r-   rG   rS   s    rN   rG   zGithub.per_page  s    (((rP   c                &    || j                   _        y rU   rd   ra   s     rN   rG   zGithub.per_page!  s    $)!rP   c                    | j                   j                  \  }}|dk  r| j                          | j                   j                  S )zS
        First value is requests remaining, second value is request limit.
        r   )r-   rate_limitingget_rate_limit)r?   	remaininglimits      rN   rg   zGithub.rate_limiting(  s?    
  ++99	519!---rP   c                    | j                   j                  dk(  r| j                          | j                   j                  S )zJ
        Unix timestamp indicating when rate limiting will reset.
        r   )r-   rate_limiting_resettimerh   rS   s    rN   rl   zGithub.rate_limiting_resettime2  s6    
 33q8!777rP   c                v    | j                   j                  dd      \  }}t        | j                   ||d   d      S )z
        Rate limit status for different resources (core/search/graphql).

        :calls: `GET /rate_limit
        <https://docs.github.com/en/rest/reference/rate-limit>`_

        GETz/rate_limit	resourcesT)r-   requestJsonAndCheckr   r?   headersdatas      rN   rh   zGithub.get_rate_limit;  s<     ((<<UMR))7D4EtLLrP   c                .    | j                   j                  S )z'
        :type: list of string
        )r-   oauth_scopesrS   s    rN   ru   zGithub.oauth_scopesF  s    
 ,,,rP   c                   t        |t              sJ |       t        j                  j	                  |      }| j
                  j                  dd|       \  }}t        j                  j                  | j
                  ||d      S )zv
        :calls: `GET /license/{license} <https://docs.github.com/en/rest/reference/licenses#get-a-license>`_
        rn   z
/licenses/T	completed)	r1   r2   urllibparsequoter-   rp   r7   r"   )r?   keyrr   rs   s       rN   get_licensezGithub.get_licenseM  sw    
 #s#(S(#ll  %((<<UjQTPUDVW~~%%d&6&6QU%VVrP   c                f    i }t        t        j                  j                  | j                  d|      S )z~
        :calls: `GET /licenses <https://docs.github.com/en/rest/reference/licenses#get-all-commonly-used-licenses>`_
        z	/licenses)r   r7   r"   r-   )r?   url_parameterss     rN   get_licenseszGithub.get_licensesW  s+    
 *,V^^33T5E5E{TbccrP   c                b    t        t        j                  j                  | j                  dd      S )zp
        :calls: `GET /events <https://docs.github.com/en/rest/reference/activity#list-public-events>`_
        z/eventsN)r   r7   r   r-   rS   s    rN   
get_eventszGithub.get_events`  s%    
 V\\//1A1A9dSSrP   c                z   |t         u r/t        j                  j                  | j                  i ddid      S t	        |t
              sJ |       t        j                  j                  |      }| j                  j                  dd|       \  }}t        j                  j                  | j                  ||d      S )z
        :calls: `GET /users/{user} <https://docs.github.com/en/rest/reference/users>`_ or `GET /user <https://docs.github.com/en/rest/reference/users>`_
        urlz/userFrw   rn   z/users/T)r   r7   r   r-   r1   r2   ry   rz   r{   rp   r#   r?   loginrr   rs   s       rN   get_userzGithub.get_userg  s     F?++==d>N>NPRUZ\cTdpu=vveS)050)LL&&u-E ,,@@'RWQXHYZMGT##--d.>.>Y]-^^rP   c                    t        |t              sJ |       | j                  j                  dd|       \  }}t        j
                  j                  | j                  ||d      S )z
        :calls: `GET /user/{id} <https://docs.github.com/en/rest/reference/users>`_
        :param user_id: int
        :rtype: :class:`github.NamedUser.NamedUser`
        rn   z/user/Trw   )r1   r3   r-   rp   r7   r#   )r?   user_idrr   rs   s       rN   get_user_by_idzGithub.get_user_by_ids  sc     '3'00'((<<UfWIDVW))$*:*:GTUY)ZZrP   c                    |t         u st        |t              sJ |       t               }|t         ur||d<   t	        t
        j                  j                  | j                  d|      S )zY
        :calls: `GET /users <https://docs.github.com/en/rest/reference/users>`_
        sincez/users)r   r1   r3   dictr   r7   r#   r-   r?   r   r   s      rN   	get_userszGithub.get_users}  s\     *UC"8?%?8&+N7#V--779I9I8UcddrP   c                   t        |t              sJ |       t        j                  j	                  |      }| j
                  j                  dd|       \  }}t        j                  j                  | j
                  ||d      S )z]
        :calls: `GET /orgs/{org} <https://docs.github.com/en/rest/reference/orgs>`_
        rn   z/orgs/Trw   )	r1   r2   ry   rz   r{   r-   rp   r7   r$   r   s       rN   get_organizationzGithub.get_organization  sw     %%,u,%""5)((<<UfUGDTU""//0@0@'4[_/``rP   c                    |t         u st        |t              sJ |       t               }|t         ur||d<   t	        t
        j                  j                  | j                  d|      S )zs
        :calls: `GET /organizations <https://docs.github.com/en/rest/reference/orgs#list-organizations>`_
        r   z/organizations)r   r1   r3   r   r   r7   r$   r-   r   s      rN   get_organizationszGithub.get_organizations  sc     *UC"8?%?8&+N7#,,	
 	
rP   c                    t        |t              sJ |       t        j                  j                  | j                  |      S )z
        :calls: `GET /enterprises/{enterprise} <https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin>`_
        :param enterprise: string
        :rtype: :class:`Enterprise`
        )r1   r2   r7   
Enterpriser-   )r?   
enterprises     rN   get_enterprisezGithub.get_enterprise  s8     *c*6J6*  ++D,<,<jIIrP   Fc                j   t        |t        t        f      sJ |       t        |t              rdnd}| | }|r/t        j                  j	                  | j
                  i d|id      S | j
                  j                  d|      \  }}t        j                  j	                  | j
                  ||d      S )z
        :calls: `GET /repos/{owner}/{repo} <https://docs.github.com/en/rest/reference/repos>`_ or `GET /repositories/{id} <https://docs.github.com/en/rest/reference/repos>`_
        z/repositories/z/repos/r   Frw   rn   T)r1   r2   r3   r7   r'   r-   rp   )r?   full_name_or_idlazyurl_baser   rr   rs   s          rN   get_repozGithub.get_repo  s     /C:6GG6'1/3'G#Y
?+,$$//0@0@"ucl^c/dd((<<UCH  ++D,<,<gtW[+\\rP   c                    |t         u st        |t              sJ |       i }|t         ur||d<   |t         ur|dv sJ |       ||d<   t        t        j
                  j
                  | j                  d|      S )z
        :calls: `GET /repositories <https://docs.github.com/en/rest/reference/repos#list-public-repositories>`_
        :param since: integer
        :param visibility: string ('all','public')
        r   )publicall
visibilityz/repositories)r   r1   r3   r   r7   r'   r-   )r?   r   r   r   s       rN   	get_reposzGithub.get_repos  s     *UC"8?%?8)+&+N7#V#!22>J>2+5N<(((	
 	
rP   c                    | j                   j                  dd|ddt        j                  i      \  }}t        j
                  j                  | j                   ||d      S )zz
        :calls: `GET /projects/{project_id} <https://docs.github.com/en/rest/reference/projects#get-a-project>`_
        rn   z
/projects/dAcceptrr   Trw   )r-   rp   r
   mediaTypeProjectsPreviewr7   r%   r?   idrr   rs   s       rN   get_projectzGithub.get_project  sg     ((<<Av>>? = 

 ~~%%d&6&6QU%VVrP   c                    | j                   j                  dd|z  dt        j                  i      \  }}t        j
                  j                  | j                   ||d      S )z
        :calls: `GET /projects/columns/{column_id} <https://docs.github.com/en/rest/reference/projects#get-a-project-column>`_
        rn   z/projects/columns/%dr   r   Trw   )r-   rp   r
   r   r7   r&   r   s       rN   get_project_columnzGithub.get_project_column  se     ((<<"R'v>>? = 

 ##11$2B2BGT]a1bbrP   c                    t        |t              sJ |       | j                  j                  dd|       \  }}t        j
                  j                  | j                  ||d      S )z^
        :calls: `GET /gists/{id} <https://docs.github.com/en/rest/reference/gists>`_
        rn   z/gists/Trw   )r1   r2   r-   rp   r7   r   r   s       rN   get_gistzGithub.get_gist  s_     "c"&B&"((<<UgbTNS{{ 0 0'44PPrP   c                    |t         u st        |t              sJ |       t               }t	        |      r|j                  d      |d<   t        t        j                  j                  | j                  d|      S )z`
        :calls: `GET /gists/public <https://docs.github.com/en/rest/reference/gists>`_
        z%Y-%m-%dT%H:%M:%SZr   z/gists/public)
r   r1   r   r   r   strftimer   r7   r   r-   r   s      rN   	get_gistszGithub.get_gists  sd     *UH"=DuD=e&+nn5I&JN7#V[[--t/?/?R`aarP   c                   t        |t              sJ |       t        j                  j	                  |      }| j
                  j                  dd|       \  }}t        j                  j                  | j
                  ||d      S )z
        :calls: `GET /advisories/{ghsa_id} <https://docs.github.com/en/rest/security-advisories/global-advisories>`_
        :param ghsa_id: string
        :rtype: :class:`github.GlobalAdvisory.GlobalAdvisory`
        rn   z/advisories/Trw   )	r1   r2   ry   rz   r{   r-   rp   r7   r    )r?   ghsa_idrr   rs   s       rN   get_global_advisoryzGithub.get_global_advisory  sy     '3'00',,$$W-((<<UlSZR[D\]$$33D4D4Dgt_c3ddrP   c                   |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u st        |t              sJ |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u s't        |t
              st        |t              sJ |       |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u s't        |t
              st        |t              sJ |       |	t         j                  j                  u st        |	t              sJ |	       |
t         j                  j                  u st        |
t              sJ |
       |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u st        |t              sJ |       |t         j                  j                  u st        |t              sJ |       t               }|t         j                  j                  ur|dv sJ |       ||d<   |t         j                  j                  ur||d<   |t         j                  j                  ur||d<   |t         j                  j                  ur||d<   |t         j                  j                  ur|dv sJ |       ||d<   |t         j                  j                  ur=t        |t
              r(dj                  |D cg c]  }t	        |       c}      }||d	<   |t         j                  j                  ur||d
<   |t         j                  j                  ur&t        |t
              rdj                  |      }||d<   |	t         j                  j                  ur|	|d<   |
t         j                  j                  ur|
|d<   |t         j                  j                  ur||d<   |t         j                  j                  ur||d<   |t         j                  j                  ur||d<   |t         j                  j                  ur|dv sJ |       ||d<   |t         j                  j                  ur|dv sJ |       ||d<   t         j                  j                  t         j                  j                  | j                  d|      S c c}w )a  
        :calls: `GET /advisories <https://docs.github.com/en/rest/security-advisories/global-advisories>`
        :param type: Optional string
        :param ghsa_id: Optional string
        :param cve_id: Optional string
        :param ecosystem: Optional string
        :param severity: Optional string
        :param cwes: Optional comma separated string or list of integer or string
        :param is_withdrawn: Optional bool
        :param affects: Optional comma separated string or list of string
        :param published: Optional string
        :param updated: Optional string
        :param modified: Optional string
        :param before: Optional string
        :param after: Optional string
        :param sort: Optional string
        :param direction: Optional string
        :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.GlobalAdvisory.GlobalAdvisory`
        )reviewed
unreviewedmalwaretyper   cve_id	ecosystem)nulllowmediumhighcriticalseverity,cwesis_withdrawnaffects	publishedupdatedmodifiedbeforeafter)r   r   sortascdesc	directionz/advisories)r7   r   r   r1   r2   listr4   r   joinr   r    r-   )r?   r   r   r   r   r   r   r   r   r   r   r   keywordsr   r   rG   r   r   r   cwes                       rN   get_global_advisorieszGithub.get_global_advisories   s   N v**111Zc5JPDPJ&--444
7C8PPP,,333z&#7NVPVVNF//666*YPS:T_V__T6..555Hc9R\T\\Rv**111Zd5KzZ^`cOdjfjjdv22999ZVZ=[i]ii[&--444
7D8QU_`gilUmvovvmF//666*YPS:T_V__T&--444
7C8PYRYYP6..555Hc9R\T\\R,,333z&#7NVPVVN++222j6LSeSLv**111Zc5JPDPJF//666*YPS:T_V__T59Vv**111@@F$F@%)N6"&--444(/N9%,,333'-N8$ F//666*3N;'6..555LLVhVL)1N:&v**111$%xxT :cS :;%)N6"v22999-9N>*&--444'4(((7+(/N9%F//666*3N;'&--444(/N9%6..555)1N:&,,333'-N8$++222&+N7#v**111339T93%)N6"F//666/::/*3N;'##11!!00	
 	
1 !;s   Wc                   t        |t              sJ |       t               }|t        ur|dv sJ |       ||d<   |t        ur|dv sJ |       ||d<   g }|r|j	                  |       |j                         D ]  \  }}|j	                  | d|         dj                  |      |d<   |d   sJ d       t        t        j                  j                  | j                  d	|      S )
a%  
        :calls: `GET /search/repositories <https://docs.github.com/en/rest/reference/search>`_
        :param query: string
        :param sort: string ('stars', 'forks', 'updated')
        :param order: string ('asc', 'desc')
        :param qualifiers: keyword dict query qualifiers
        )starsforksr   r   r   order: qneed at least one qualifierz/search/repositories)r1   r2   r   r   appenditemsr   r   r7   r'   r-   	r?   queryr   r   
qualifiersr   query_chunks	qualifierrb   s	            rN   search_repositorieszGithub.search_repositoriesg  s    %%,u,%v88>$>8%)N6"O+2U2+&+N7#& * 0 0 2 	8Iu9+Qug 67	8 "hh|4sc"A$AA"(("	
 	
rP   c                   t        |t              sJ |       t               }|t        ur|dv sJ |       ||d<   |t        ur|dv sJ |       ||d<   g }|r|j	                  |       |j                         D ]  \  }}|j	                  | d|         dj                  |      |d<   |d   sJ d       t        t        j                  j                  | j                  d	|      S )
av  
        :calls: `GET /search/users <https://docs.github.com/en/rest/reference/search>`_
        :param query: string
        :param sort: string ('followers', 'repositories', 'joined')
        :param order: string ('asc', 'desc')
        :param qualifiers: keyword dict query qualifiers
        :rtype: :class:`PaginatedList` of :class:`github.NamedUser.NamedUser`
        )	followersrepositoriesjoinedr   r   r   r   r   r   r   z/search/users)r1   r2   r   r   r   r   r   r   r7   r#   r-   r   s	            rN   search_userszGithub.search_users  s    %%,u,%vBBHDHB%)N6"O+2U2+&+N7#& * 0 0 2 	8Iu9+Qug 67	8 "hh|4sc"A$AA"&&	
 	
rP   c                   t        |t              sJ |       t               }|t        ur|dv sJ |       ||d<   |t        ur|dv sJ |       ||d<   g }|r|j	                  |       |j                         D ]  \  }}|j	                  | d|         dj                  |      |d<   |d   sJ d       t        t        j                  j                  | j                  d	|      S )
aj  
        :calls: `GET /search/issues <https://docs.github.com/en/rest/reference/search>`_
        :param query: string
        :param sort: string ('comments', 'created', 'updated')
        :param order: string ('asc', 'desc')
        :param qualifiers: keyword dict query qualifiers
        :rtype: :class:`PaginatedList` of :class:`github.Issue.Issue`
        )commentscreatedr   r   r   r   r   r   r   r   z/search/issues)r1   r2   r   r   r   r   r   r   r7   r!   r-   r   s	            rN   search_issueszGithub.search_issues  s    %%,u,%v==CtC=%)N6"O+2U2+&+N7#& * 0 0 2 	8Iu9+Qug 67	8 "hh|4sc"A$AA"V\\//1A1ACSUcddrP   c                   t        |t              sJ |       t               }|t        ur|dv sJ |       ||d<   |t        ur|dv sJ |       ||d<   g }|r|j	                  |       |j                         D ]  \  }}	|j	                  | d|	         dj                  |      |d<   |d   sJ d       |rd	t        j                  ind
}
t        t        j                  j                  | j                  d||
      S )a  
        :calls: `GET /search/code <https://docs.github.com/en/rest/reference/search>`_
        :param query: string
        :param sort: string ('indexed')
        :param order: string ('asc', 'desc')
        :param highlight: boolean (True, False)
        :param qualifiers: keyword dict query qualifiers
        :rtype: :class:`PaginatedList` of :class:`github.ContentFile.ContentFile`
        )indexedr   r   r   r   r   r   r   r   Nz/search/coder   )r1   r2   r   r   r   r   r   r
   highLightSearchPreviewr   r7   r   r-   )r?   r   r   r   	highlightr   r   r   r   rb   rr   s              rN   search_codezGithub.search_code  s!   " %%,u,%v<'--'%)N6"O+2U2+&+N7#& * 0 0 2 	8Iu9+Qug 67	8 "hh|4sc"A$AA"?H8V::;d**
 	
rP   c                   t        |t              sJ |       t               }|t        ur|dv sJ |       ||d<   |t        ur|dv sJ |       ||d<   g }|r|j	                  |       |j                         D ]  \  }}|j	                  | d|         dj                  |      |d<   |d   sJ d       t        t        j                  j                  | j                  d	|d
t        j                  i      S )al  
        :calls: `GET /search/commits <https://docs.github.com/en/rest/reference/search>`_
        :param query: string
        :param sort: string ('author-date', 'committer-date')
        :param order: string ('asc', 'desc')
        :param qualifiers: keyword dict query qualifiers
        :rtype: :class:`PaginatedList` of :class:`github.Commit.Commit`
        )zauthor-datezcommitter-dater   r   r   r   r   r   r   z/search/commitsr   r   )r1   r2   r   r   r   r   r   r   r7   r   r-   r
   mediaTypeCommitSearchPreviewr   s	            rN   search_commitszGithub.search_commits
  s    %%,u,%v<<BdB<%)N6"O+2U2+&+N7#& * 0 0 2 	8Iu9+Qug 67	8 "hh|4sc"A$AA"MM  vBBC
 	
rP   c                   t        |t              sJ |       t               }g }|r|j                  |       |j	                         D ]  \  }}|j                  | d|         dj                  |      |d<   |d   sJ d       t        t        j                  j                  | j                  d|dt        j                  i      S )z
        :calls: `GET /search/topics <https://docs.github.com/en/rest/reference/search>`_
        :param query: string
        :param qualifiers: keyword dict query qualifiers
        :rtype: :class:`PaginatedList` of :class:`github.Topic.Topic`
        r   r   r   r   z/search/topicsr   r   )r1   r2   r   r   r   r   r   r7   r(   r-   r
   mediaTypeTopicsPreview)r?   r   r   r   r   r   rb   s          rN   search_topicszGithub.search_topics4  s     %%,u,%& * 0 0 2 	8Iu9+Qug 67	8 "hh|4sc"A$AA"LLv<<=
 	
rP   c                $   t        |t              sJ |       |t        u s+t        |t        j                  j                        sJ |       d|i}t        |      rd|d<   |j                  |d<   | j                  j                  dd|      \  }}}|S )z
        :calls: `POST /markdown <https://docs.github.com/en/rest/reference/markdown>`_
        :param text: string
        :param context: :class:`github.Repository.Repository`
        :rtype: string
        textgfmmodecontextPOSTz	/markdown)input)	r1   r2   r   r7   r'   r   	_identityr-   requestJson)r?   r   r   post_parametersstatusrr   rs   s          rN   render_markdownzGithub.render_markdownP  s     $$*d*$& Jw8I8I8T8T$U^W^^U!4.g&+OF#)0):):OI& $ 0 0 < <V[Xg < hrP   c                    t        |t              sJ |       t        j                  j	                  |      }| j
                  j                  dd|       \  }}t        | j
                  ||d      S )zi
        :calls: `GET /hooks/{name} <https://docs.github.com/en/rest/reference/repos#webhooks>`_
        rn   /hooks/Trw   )r1   r2   ry   rz   r{   r-   rp   r   r?   namerr   
attributess       rN   get_hookzGithub.get_hook`  sk     $$*d*$||!!$'"..BB5GTXSYJZ[t//*PTUUrP   c           	         | j                   j                  dd      \  }}|D cg c]  }t        | j                   ||d       c}S c c}w )z
        :calls: `GET /hooks <https://docs.github.com/en/rest/reference/repos#webhooks>`_
        :rtype: list of :class:`github.HookDescription.HookDescription`
        rn   z/hooksTrw   )r-   rp   r   )r?   rr   rs   r  s       rN   	get_hookszGithub.get_hooksi  sG    
 ((<<UHMimn[e 0 0':QUVnnns    Ac                    t        |t              sJ |       t        |t              sJ |       | j                  j                  dd| d|       \  }}t	        | j                  ||d      S )z
        :calls: `GET /hooks/{hook_id}/deliveries/{delivery_id} <https://docs.github.com/en/rest/reference/repos#webhooks>`_
        :param hook_id: integer
        :param delivery_id: integer
        :rtype: :class:`HookDelivery`
        rn   r  z/deliveries/Trw   )r1   r3   r-   rp   r   )r?   hook_iddelivery_idrr   r  s        rN   get_hook_deliveryzGithub.get_hook_deliveryq  st     '3'00'+s+8[8+"..BB5GT[S\\hithuJvwD,,gzTRRrP   c           	         t        |t              sJ |       | j                  j                  dd| d      \  }}|D cg c]  }t	        | j                  ||d       c}S c c}w )z
        :calls: `GET /hooks/{hook_id}/deliveries <https://docs.github.com/en/rest/reference/repos#webhooks>`_
        :param hook_id: integer
        :rtype: list of :class:`HookDeliverySummary`
        rn   r  z/deliveriesTrw   )r1   r3   r-   rp   r   )r?   r  rr   rs   r  s        rN   get_hook_deliverieszGithub.get_hook_deliveries}  sg     '3'00'((<<UggYVaDbcmqr_i#D$4$4gzUYZrrrs    A"c                D    | j                   j                  dd      \  }}|S )zk
        :calls: `GET /gitignore/templates <https://docs.github.com/en/rest/reference/gitignore>`_
        rn   z/gitignore/templatesr-   rp   rq   s      rN   get_gitignore_templateszGithub.get_gitignore_templates  s&     ((<<UDZ[rP   c                   t        |t              sJ |       t        j                  j	                  |      }| j
                  j                  dd|       \  }}t        j                  j                  | j
                  ||d      S )zr
        :calls: `GET /gitignore/templates/{name} <https://docs.github.com/en/rest/reference/gitignore>`_
        rn   z/gitignore/templates/Trw   )	r1   r2   ry   rz   r{   r-   rp   r7   r   r  s       rN   get_gitignore_templatezGithub.get_gitignore_template  s|     $$*d*$||!!$'"..BB5LabfagJhi''99$:J:JGU_ko9pprP   c                D    | j                   j                  dd      \  }}|S )z
        :calls: `GET /emojis <https://docs.github.com/en/rest/reference/emojis>`_
        :rtype: dictionary of type => url for emoji`
        rn   z/emojisr  )r?   rr   r  s      rN   
get_emojiszGithub.get_emojis  s'    
 #..BB5)TrP   c                6    |i } || j                   ||d      S )a`  
        Creates an object from raw_data previously obtained by :attr:`GithubObject.raw_data`, and optionally headers
        previously obtained by :attr:`GithubObject.raw_headers`.

        :param klass: the class of the object to create
        :param raw_data: dict
        :param headers: dict
        :rtype: instance of class ``klass``

        Trw   )r-   )r?   klassraw_datarr   s       rN   create_from_raw_datazGithub.create_from_raw_data  s%     ?GT%%wDIIrP   c                t    t        j                  |j                  |j                  |j                  f||       y)a)  
        Dumps (pickles) a PyGithub object to a file-like object. Some effort is made to not pickle sensitive
        information like the Github credentials used in the :class:`Github` instance. But NO EFFORT is made to remove
        sensitive information from the object's attributes.

        :param obj: the object to pickle :param file: the file-like object to pickle to :param protocol: the
        `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-stream-format>`_
         :param obj: the object to pickle :param file: the file-like object to pickle to :param protocol: the
        `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
         :param obj: the object to pickle :param file: the file-like object to pickle to :param protocol: the
        `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
             stream-format>`_ :param obj: the object to pickle :param file: the file-like object to pickle to :param
        protocol: the
        `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
        :param obj: the object to pickle
        :param file: the file-like object to pickle to
        :param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
            stream-format>`_
        :param obj: the object to pickle
        :param file: the file-like object to pickle to
        :param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
        :param obj: the object to pickle
        :param file: the file-like object to pickle to
        :param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
            stream-format>`_
        :param obj: the object to pickle
        :param file: the file-like object to pickle to
        :param protocol: the `pickling protocol <https://python.readthedocs.io/en/latest/library/pickle.html#data-
            stream-format>`_

        N)pickledump	__class__r  raw_headers)r?   objfileprotocols       rN   r  zGithub.dump  s(    @ 	S]]CLL#//BD(SrP   c                F     | j                   t        j                  |       S )z
        Loads (unpickles) a PyGithub object from a file-like object.

        :param f: the file-like object to unpickle from
        :return: the unpickled object

        )r  r  load)r?   fs     rN   r&  zGithub.load  s     )t((&++a.99rP   c                b    t         j                  j                  | j                  i ||dd      S )N)	client_idclient_secretF)rr   r  rx   )r7   r   r-   )r?   r)  r*  s      rN   get_oauth_applicationzGithub.get_oauth_application  s7    &&77%.O	 8 
 	
rP   c                r   |t         u rHt        j                  dt               t	        di | j
                  j                  j                         S t        |t              sJ |       t        j                  j                  |      }t        j                  j                  | j
                  i dd| id      S )z
        :calls: `GET /apps/{slug} <https://docs.github.com/en/rest/reference/apps>`_ or `GET /app <https://docs.github.com/en/rest/reference/apps>`_
        zArgument slug is mandatory, calling this method without the slug argument is deprecated, please use github.GithubIntegration(auth=github.Auth.AppAuth(...)).get_app() insteadr/   r   z/apps/Frw   rV   )r   r9   r:   r;   r   r-   kwargsget_appr1   r2   ry   rz   r{   r7   r   )r?   slugs     rN   r.  zGithub.get_app  s    
 6> MM\+
 %?t'7'7'>'>?GGIIdC(.$.(<<%%d+D##--d.>.>UfUYTZOD\hm-nnrP   )r@   
str | NonerA   r0  rB   r0  rC   zAppAuthentication | NonerD   r2   rE   r3   rF   r2   rG   r3   rH   z
bool | strrI   zint | Retry | NonerJ   z
int | NonerK   float | NonerL   r1  rM   zgithub.Auth.Auth | NonereturnNone)r2  r3  )r2  r,   )rY   r   rZ   r   r[   r   r2  r3  )r2  r4   )rb   r4   r2  r3  )r2  r3   )rb   r3   r2  r3  )r2  ztuple[int, int])r2  r   )r2  zlist[str] | None)r|   Opt[str]r2  r"   )r2  zPaginatedList[License])r2  zPaginatedList[Event])r   r4  r2  zNamedUser | AuthenticatedUser)r   r3   r2  r#   )r   Opt[int]r2  PaginatedList[NamedUser])r   r2   r2  r$   )r   r5  r2  zPaginatedList[Organization])r   r2   r2  zgithub.Enterprise.Enterprise)F)r   z	int | strr   r4   r2  r'   )r   r5  r   r4  r2  PaginatedList[Repository])r   r3   r2  r%   )r   r3   r2  r&   )r   r2   r2  r   )r   zOpt[datetime]r2  zPaginatedList[Gist])r   r2   r2  r    )$r   r4  r   r4  r   r4  r   r4  r   r4  r   zlist[Opt[str]] | Opt[str]r   z	Opt[bool]r   zlist[str] | Opt[str]r   r4  r   r4  r   r4  r   r4  r   r4  r   r4  rG   r4  r   r4  r   r4  r2  zPaginatedList[GlobalAdvisory])
r   r2   r   r4  r   r4  r   r   r2  r7  )
r   r2   r   r4  r   r4  r   r   r2  r6  )
r   r2   r   r4  r   r4  r   r   r2  zPaginatedList[Issue])r   r2   r   r4  r   r4  r   r4   r   r   r2  zPaginatedList[ContentFile])
r   r2   r   r4  r   r4  r   r   r2  zPaginatedList[Commit])r   r2   r   r   r2  zPaginatedList[Topic])r   r2   r   zOpt[Repository]r2  r2   )r  r2   r2  r   )r2  zlist[HookDescription])r  r3   r  r3   r2  r   )r  r3   r2  zlist[HookDeliverySummary])r2  z	list[str])r  r2   r2  r   )r2  zdict[str, str]rU   )r  ztype[TGithubObject]r  zdict[str, Any]rr   zdict[str, str | int] | Noner2  r)   )r   )r"  r   r#  r   r$  r3   r2  r3  )r'  r   r2  r   )r)  r2   r*  r2   r2  r   )r/  r4  r2  r   )?__name__
__module____qualname____doc____annotations__r   default_retryr
   DEFAULT_BASE_URLDEFAULT_TIMEOUTDEFAULT_USER_AGENTDEFAULT_PER_PAGE DEFAULT_SECONDS_BETWEEN_REQUESTSDEFAULT_SECONDS_BETWEEN_WRITESrO   rR   rW   r\   propertyr_   setterrG   rg   rl   rh   ru   r   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r  r  r  r  r  r  r  r  r&  r+  r.  rV   rP   rN   r,   r,      s%    MM &*#-1//-- 33//!$1 $171X1X/5/T/T(,Y
"Y
 Y
 	Y

 +Y
 Y
 Y
 Y
 Y
 Y
 "Y
 Y
 #/Y
 !-Y
 &Y
  
!Y
v	! 5 5   6 !6 ) ) __* * . . 8 8	M - - +1 WdT *0 
_[ +1 ea 39 
J
] !%

 
 
#	
0	W	cQ 06 b	e  "!$#*0"((.$"##! #$%e
e
 e
 	e

 e
 e
 (e
  e
 &e
 e
 e
 e
 e
 e
 e
  !e
" #e
$ %e
& 
''e
T   	&
&
 &
 	&

 &
 
#&
V   	'
'
 '
 	'

 '
 
"'
X   	"e"e "e 	"e
 "e 
"eN   ,
,
 ,
 	,

 ,
 ,
 
$,
b   	(
(
 (
 	(

 (
 
(
T
8 EK  Vo
Ssq lpJ(J4BJMhJ	J$ TD:
 (. orP   r,   )M
__future__r   r  urllib.parsery   r9   r   typingr   r   r   r   r5   urllib3.utilr	   github.ApplicationOAuthr7   github.Authgithub.AuthenticatedUsergithub.Enterprisegithub.Eventgithub.Gistgithub.GithubAppgithub.GithubIntegrationgithub.GithubRetrygithub.GitignoreTemplategithub.GlobalAdvisorygithub.Licensegithub.NamedUsergithub.Topicr
   r   github.GithubObjectr   r   r   r   r   github.HookDeliveryr   r   github.HookDescriptionr   github.PaginatedListr   github.RateLimitr   github.Requesterr   github.AppAuthenticationr   r   r   github.Commitr   github.ContentFiler   r   r   r   r   r    github.Issuer!   r"   r#   github.Organizationr$   github.Projectr%   github.ProjectColumnr&   github.Repositoryr'   r(   r)   r,   rV   rP   rN   <module>rf     s   z #     8 8                  6 E E * A 2 . & &:8:$." *:4"&*0&2,"|<`o `orP   