
    ,Of                         d dl Z d dlmZmZmZmZmZmZmZ  G d de	      Z
 G d de
      Z G d de
      Z G d	 d
e
      Z G d de
      Z G d de	      Z G d de
      Z G d de
      Zy)    N)AnyDictListOptionalTupleTypeUnionc            
            e Zd ZdZ	 	 	 ddededeeeef      dee   f fdZ	e
dee   fd       Ze
defd	       Ze
defd
       Ze
deeeef      fd       ZdefdZdefdZ xZS )GithubExceptiona0  
    Error handling in PyGithub is done with exceptions. This class is the base of all exceptions raised by PyGithub
    (but :class:`github.GithubException.BadAttributeException`).

    Some other types of exceptions might be raised by underlying libraries, for example for network-related issues.

    statusdataheadersmessagec                 p    t         |           || _        || _        || _        || _        ||||f| _        y N)super__init___GithubException__status_GithubException__data_GithubException__headers_GithubException__messageargs)selfr   r   r   r   	__class__s        6lib/python3.12/site-packages/github/GithubException.pyr   zGithubException.__init__5   s<     	  T7G4	    returnc                     | j                   S r   )r   r   s    r   r   zGithubException.messageC   s    ~~r   c                     | j                   S )z8
        The status returned by the Github API.
        )r   r   s    r   r   zGithubException.statusG   s    
 }}r   c                     | j                   S )z@
        The (decoded) data returned by the Github API.
        )r   r   s    r   r   zGithubException.dataN   s    
 {{r   c                     | j                   S )z9
        The headers returned by the Github API.
        )r   r   s    r   r   zGithubException.headersU   s    
 ~~r   c                 V    | j                   j                   d| j                          dS )N())r   __name____str__r   s    r   __repr__zGithubException.__repr__\   s'    ..))*!DLLN+;1==r   c                     | j                   r| j                    d| j                   }n| j                   }| j                  %|dt        j                  | j                        z   z  }|S )Nz:  )r   r   r   jsondumps)r   msgs     r   r'   zGithubException.__str___   sX    >>^^$Bt{{m4C[[MC99 3DII...C
r   )NNN)r&   
__module____qualname____doc__intr   r   r   strr   propertyr   r   r   r   r(   r'   __classcell__)r   s   @r   r   r   ,   s     ,0!%55 5 $sCx.)	5
 #5 #      c   $sCx.1  ># >	 	r   r   c                       e Zd ZdZy)BadCredentialsExceptionzm
    Exception raised in case of bad credentials (when Github API replies with a 401 or 403 HTML status)
    Nr&   r.   r/   r0    r   r   r6   r6   k       r   r6   c                       e Zd ZdZy)UnknownObjectExceptionzs
    Exception raised when a non-existing object is requested (when Github API replies with a 404 HTML status)
    Nr7   r8   r   r   r;   r;   q   r9   r   r;   c                       e Zd ZdZy)BadUserAgentExceptionz
    Exception raised when request is sent with a bad user agent header (when Github API replies with a 403 bad user
    agent HTML status)
    Nr7   r8   r   r   r=   r=   w       r   r=   c                       e Zd ZdZy)RateLimitExceededExceptionz
    Exception raised when the rate limit is exceeded (when Github API replies with a 403 rate limit exceeded HTML
    status)
    Nr7   r8   r   r   r@   r@   ~   r>   r   r@   c                   V   e Zd ZdZdedeeeee	   ee	   f   ee
   f   eee	   ee	   f   eee
      eeee	   ee	   f      f   dee   fdZedefd       Zedeeee
      eee	   ee	   f   eeee	   ee	   f   ee
   f   eeee	   ee	   f      f   fd       Zedee   fd	       Zy
)BadAttributeExceptionzP
    Exception raised when Github returns an attribute with the wrong type.
    actualValueexpectedTypetransformationExceptionc                 .    || _         || _        || _        y r   )#_BadAttributeException__actualValue$_BadAttributeException__expectedType/_BadAttributeException__transformationException)r   rC   rD   rE   s       r   r   zBadAttributeException.__init__   s     )*)@&r   r   c                     | j                   S )z/
        The value returned by Github.
        )rG   r   s    r   actual_valuez"BadAttributeException.actual_value   s    
 !!!r   c                     | j                   S )z-
        The type PyGithub expected.
        )rH   r   s    r   expected_typez#BadAttributeException.expected_type   s     """r   c                     | j                   S )zN
        The exception raised when PyGithub tried to parse the value.
        )rI   r   s    r   transformation_exceptionz.BadAttributeException.transformation_exception   s    
 ---r   N)r&   r.   r/   r0   r   r	   r   r   r   r2   dictr   r   	Exceptionr   r3   rK   rM   rO   r8   r   r   rB   rB      sX   AA tCy$s)+,d4j89$s)T#Y&'dtCy$s)+,-/
A "*)!4A "c " " #	T$Zd3ic"#U49d3i'($t*45U49d3i'()	+
# # .(9*= . .r   rB   c                       e Zd ZdZy)TwoFactorExceptionza
    Exception raised when Github requires a onetime password for two-factor authentication.
    Nr7   r8   r   r   rS   rS      r9   r   rS   c                       e Zd ZdZy)IncompletableObjectzy
    Exception raised when we can not request an object from Github because the data returned did not include a URL.
    Nr7   r8   r   r   rU   rU      r9   r   rU   )r+   typingr   r   r   r   r   r   r	   rQ   r   r6   r;   r=   r@   rB   rS   rU   r8   r   r   <module>rW      sv   P  @ @ @<i <~o _ O  ..I ..b / r   