
    Ii"                         S r SSKr " S S\5      r " S S\5      r " S S\\5      r " S	 S
\\5      r " S S\\	5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      rS rS rS rg)z
Python SDK for Opsgenie REST API

Python SDK for Opsgenie REST API  # noqa: E501

The version of the OpenAPI document: 2.0.0
Contact: support@opsgenie.com
Generated by: https://openapi-generator.tech
    Nc                       \ rS rSrSrSrg)OpenApiException   z2The base exception class for all OpenAPIExceptions N__name__
__module____qualname____firstlineno____doc____static_attributes__r       =/venv/lib/python3.13/site-packages/opsgenie_sdk/exceptions.pyr   r      s    <r   r   c                       \ rS rSrSrSrg)RetryableException   zQThe base exception class for all Exceptions for which a retry attempt can be mader   Nr   r   r   r   r   r      s    [r   r   c                   0   ^  \ rS rSr  SU 4S jjrSrU =r$ )ApiTypeError   c                    > X l         X0l        X@l        UnU(       a  SR                  U[	        U5      5      n[
        [        U ]  U5        g)a[  Raises an exception for TypeErrors

Args:
    msg (str): the exception message

Keyword Args:
    path_to_item (list): a list of keys an indices to get to the
                         current_item
                         None if unset
    valid_classes (tuple): the primitive classes that current item
                           should be an instance of
                           None if unset
    key_type (bool): False if our value is a value in a dict
                     True if it is a key in a dict
                     False if our item is an item in a list
                     None if unset

{0} at {1}N)path_to_itemvalid_classeskey_typeformatrender_pathsuperr   __init__)selfmsgr   r   r   full_msg	__class__s         r   r   ApiTypeError.__init__   sD    & )* #**3L0IJHlD*84r   )r   r   r   NNNr   r	   r
   r   r   r   __classcell__r"   s   @r   r   r      s    =A5 5r   r   c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )ApiValueError5   c                    > X l         UnU(       a  SR                  U[        U5      5      n[        [        U ]  U5        g)z
Args:
    msg (str): the exception message

Keyword Args:
    path_to_item (list) the path to the exception in the
        received_data dict. None if unset
r   N)r   r   r   r   r)   r   r   r    r   r!   r"   s       r   r   ApiValueError.__init__6   s9     )#**3L0IJHmT+H5r   r   Nr%   r'   s   @r   r)   r)   5   s    6 6r   r)   c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )ApiKeyErrorG   c                    > X l         UnU(       a  SR                  U[        U5      5      n[        [        U ]  U5        g)z
Args:
    msg (str): the exception message

Keyword Args:
    path_to_item (None/list) the path to the exception in the
        received_data dict
r   N)r   r   r   r   r1   r   r,   s       r   r   ApiKeyError.__init__H   s9     )#**3L0IJHk4)(3r   r.   r/   r%   r'   s   @r   r1   r1   G   s    4 4r   r1   c                   $    \ rS rSrSS jrS rSrg)ApiExceptionX   Nc                     U(       aI  UR                   U l         UR                  U l        UR                  U l        UR	                  5       U l        g Xl         X l        S U l        S U l        g r/   statusreasondatabody
getheadersheadersr   r:   r;   	http_resps       r   r   ApiException.__init__Z   R    #**DK#**DK!DI$//1DL K KDIDLr   c                    SR                  U R                  U R                  5      nU R                  (       a  USR                  U R                  5      -  nU R                  (       a  USR                  U R                  5      -  nU$ )#Custom error messages for exceptionz({0})
Reason: {1}
HTTP response headers: {0}
HTTP response body: {0}
r   r:   r;   r?   r=   r   error_messages     r   __str__ApiException.__str__f   o    ((.t{{DKK(H 	<<;BB M 998??		JJMr   r=   r?   r;   r:   r$   r   r	   r
   r   r   rK   r   r   r   r   r6   r6   X       
 r   r6   c                   $    \ rS rSrSS jrS rSrg)AuthenticationExceptiont   Nc                     U(       aI  UR                   U l         UR                  U l        UR                  U l        UR	                  5       U l        g Xl         X l        S U l        S U l        g r/   r9   r@   s       r   r    AuthenticationException.__init__v   rC   r   c                    SR                  U R                  U R                  5      nU R                  (       a  USR                  U R                  5      -  nU R                  (       a  USR                  U R                  5      -  nU$ )rE   zAYou are not authorized to perform this action: ({0})
Reason: {1}
rF   rG   rH   rI   s     r   rK   AuthenticationException.__str__   rM   r   rN   r$   rO   r   r   r   rR   rR   t   rP   r   rR   c                   $    \ rS rSrSS jrS rSrg)ServerErrorException   Nc                     U(       aI  UR                   U l         UR                  U l        UR                  U l        UR	                  5       U l        g Xl         X l        S U l        S U l        g r/   r9   r@   s       r   r   ServerErrorException.__init__   rC   r   c                    SR                  U R                  U R                  5      nU R                  (       a  USR                  U R                  5      -  nU R                  (       a  USR                  U R                  5      -  nU$ )rE   z5There is an internal server error: ({0})
Reason: {1}
rF   rG   rH   rI   s     r   rK   ServerErrorException.__str__   rM   r   rN   r$   rO   r   r   r   rY   rY      rP   r   rY   c                   $    \ rS rSrSS jrS rSrg)ConfigurationException   Nc                     U(       aI  UR                   U l         UR                  U l        UR                  U l        UR	                  5       U l        g Xl         X l        S U l        S U l        g r/   r9   r@   s       r   r   ConfigurationException.__init__   rC   r   c                    SR                  U R                  U R                  5      nU R                  (       a  USR                  U R                  5      -  nU R                  (       a  USR                  U R                  5      -  nU$ )rE   z=You have configured something incorrectly: ({0})
Reason: {1}
rF   rG   rH   rI   s     r   rK   ConfigurationException.__str__   rM   r   rN   r$   rO   r   r   r   r`   r`      rP   r   r`   c                     SnU  HL  n[        U[        R                  5      (       a  USR                  U5      -  nM8  USR                  U5      -  nMN     U$ )z)Returns a string representation of a path z[{0}]z['{0}'])
isinstancesixinteger_typesr   )r   resultpths      r   r   r      sS    Fc3,,--gnnS))Fi&&s++F	 
 Mr   c                 z   U R                   n0 S[        SS9_S[        SS9_S[        SS9_S[        S	S9_S
[        SS9_S[        SS9_S[        SS9_S[        SS9_S[        SS9_S[        SS9_S[        SS9_S[        SS9_S[        SS9_S[        SS9_S[	        SS9_S [	        S!S9_S"[	        S#S9_[	        S$S9[	        S%S9S&.ER                  U[        S'S95      nU R                   Ul         U R                  S(-   UR                  -   Ul        U R                  Ul        U R                  5       Ul
        U$ ))Ni  zInvalid JSON body)r;   i  z,apiKey is invalid or integration is disabledi  zRapiKey is valid but the account cannot do this action because of subscription plani  zNapiKey is valid but the apiKey cannot do this operation because of permissionsi  zResource or handler not foundi  z*URL is valid but HTTP method not supportedi  z1Requested format is not supported (Accept header)i  zNID or name conflicts with another entity. E.g. integration name already existsi  zFeature is deprecatedi  z:Request body format is not supported (Content-Type header)i  z!The given range is not supported.i  zSemantic errors in request bodyi  z?Entity is used by another entity (schedule,escalation,team,etc)i  
Throttlingi  zInternal Server Errori  zNot Implementedi  zBad Gatewayz Back-end servers are at capacityzGateway Timeout)i  i  zAPI Encountered a Problemz: )r:   r`   rR   r6   rY   getr;   r<   r=   r>   r?   )responsehttp_error_code	exceptions      r   build_exceptionrs      s   ooO#+>?$,Z[ 	$gi
 	$ce 	\!@A 	$,XY 	#+^_ 	#ce 	#+BC 	#+gh 	#+NO 	#+LM  	#+lm!" 	\.#$ 	!)@A%& 	!):;'( 	!7)* ")KL!):;-. 
c/</JKL/ 2  I-	0@0@@I]]IN ++-Ir   c                  .    [         [        [        [        4$ r/   )r6   rR   rY   r`   r   r   r   get_all_exceptionsru      s    02FH^^^r   )r   ri   	Exceptionr   r   	TypeErrorr   
ValueErrorr)   KeyErrorr1   r6   rR   rY   r`   r   rs   ru   r   r   r   <module>rz      s    =y =\) \5#Y 5:6$j 6$4"H 4"% 80 8- 8/ 8 F_r   