
    iR                         % S r SSKJr  SSKJr  SSKrSSKJrJr  SSK	r	SSK
Jr  S r SSKr SSKJr  0 r\\\4   \S	'   0 r\\\4   \S
'   0 r\b%  \R.                   H  r\\\R2                  S   '   M      " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\\S9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( S)\&5      r) " S* S+\%5      r* " S, S-\*5      r+ " S. S/\%5      r, " S0 S1\,5      r- " S2 S3\%5      r. " S4 S5\%5      r/ " S6 S7\%5      r0 " S8 S9\05      r1 " S: S;\05      r2 " S< S=\%5      r3 " S> S?\%5      r4 " S@ SA\%5      r5 " SB SC\%5      r6 " SD SE\65      r7 " SF SG\%5      r8 " SH SI\5      r9 " SJ SK\95      r: " SL SM\95      r; " SN SO\95      r< " SP SQ\95      r= " SR SS\95      r> " ST SU\95      r? " SV SW\95      r@ " SX SY\@5      rA " SZ S[\B5      rCS\ rDS] rES^ rF SiS_\GS`\GSa\\   4Sb jjrHSc rISd rJSe rKSf rLSg rMSh rNg! \ a    \" 5         Sr GN8f = f! \ a    Sr GNGf = f)jzExceptions raised by Google API core & clients.

This module provides base classes for all errors raised by libraries based
on :mod:`google.api_core`, including both HTTP and gRPC clients.
    )absolute_import)unicode_literalsN)OptionalDict)error_details_pb2c                  :    [         R                  " S[        5        g )NzCPlease install grpcio-status to obtain helpful grpc error messages.)warningswarnImportWarning     E/app/.venv/lib/python3.13/site-packages/google/api_core/exceptions.py$_warn_could_not_import_grpcio_statusr      s    MMMr   )
rpc_status_HTTP_CODE_TO_EXCEPTION_GRPC_CODE_TO_EXCEPTIONc                       \ rS rSrSrSrg)GoogleAPIError?   z;Base class for all exceptions raised by Google API Clients.r   N__name__
__module____qualname____firstlineno____doc____static_attributes__r   r   r   r   r   ?   s    Er   r   c                       \ rS rSrSrSrg)DuplicateCredentialArgsE   z,Raised when multiple credentials are passed.r   Nr   r   r   r   r   r   E   s    6r   r   c                   B   ^  \ rS rSrSrU 4S jr\S 5       rS rSr	U =r
$ )
RetryErrorK   zRaised when a function has exhausted all of its available retries.

Args:
    message (str): The exception message.
    cause (Exception): The last exception raised when retrying the
        function.
c                 D   > [         [        U ]  U5        Xl        X l        g N)superr!   __init__message_cause)selfr'   cause	__class__s      r   r&   RetryError.__init__T   s    j$(1r   c                     U R                   $ )z5The last exception raised when retrying the function.)r(   r)   s    r   r*   RetryError.causeY   s     {{r   c                 N    SR                  U R                  U R                  5      $ )Nz{}, last exception: {})formatr'   r*   r.   s    r   __str__RetryError.__str__^   s    '..t||TZZHHr   )r(   r'   )r   r   r   r   r   r&   propertyr*   r2   r   __classcell__r+   s   @r   r!   r!   K   s-    
  I Ir   r!   c                       \ rS rSrSrS rSrg)_GoogleAPICallErrorMetab   z8Metaclass for registering GoogleAPICallError subclasses.c                     [         R                  XX#5      nUR                  b   [        R	                  UR                  U5        UR
                  b   [        R	                  UR
                  U5        U$ r$   )type__new__coder   
setdefaultgrpc_status_coder   )mcsnamebases
class_dictclss        r   r<   _GoogleAPICallErrorMeta.__new__e   sW    ll3e888#..sxx=+#..s/C/CSI
r   r   N)r   r   r   r   r   r<   r   r   r   r   r8   r8   b   s
    Br   r8   c                      ^  \ rS rSr% SrSr\\   \S'    Sr	\S   \S'    SU 4S jjr
S r\S	 5       r\S
 5       r\S 5       r\S 5       r\S 5       r\S 5       rSrU =r$ )GoogleAPICallErrorn   a  Base class for exceptions raised by calling API methods.

Args:
    message (str): The exception message.
    errors (Sequence[Any]): An optional list of error details.
    details (Sequence[Any]): An optional list of objects defined in google.rpc.error_details.
    response (Union[requests.Request, grpc.Call]): The response or
        gRPC call metadata.
    error_info (Union[error_details_pb2.ErrorInfo, None]): An optional object containing error info
        (google.rpc.error_details.ErrorInfo).
Nr=   zgrpc.StatusCoder?   c                 j   > [         [        U ]  U5        Xl         X l        X0l        X@l        XPl        g r$   )r%   rG   r&   r'   _errors_details	_response_error_info)r)   r'   errorsdetailsresponse
error_infor+   s         r   r&   GoogleAPICallError.__init__   s0     $09)!%r   c                    SR                  U R                  U R                  5      nU R                  (       a  SR                  XR                  5      nU$ U R                  (       a  U R                   Vs/ s HD  n[        US5      (       d  M  [        US5      (       d  M)  UR                   SUR                   3PMF     nnU(       a!  SR                  USR                  U5      5      nU$ s  snf )Nz{} {}r=   r'   z: 
)r1   r=   r'   rO   rN   hasattrjoin)r)   	error_msgerrorrN   s       r   r2   GoogleAPICallError.__str__   s    NN499dll;	<<y,,?I  {{ "&!,uf- 529%2K 5uzzl"U]]O4!,  
  'y$))F:K LIs   4C+C+ C+c                 T    U R                   (       a  U R                   R                  $ S$ )zThe reason of the error.

Reference:
    https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112

Returns:
    Union[str, None]: An optional string containing reason of the error.
N)rM   reasonr.   s    r   r[   GoogleAPICallError.reason   #     +/*:*:t&&DDr   c                 T    U R                   (       a  U R                   R                  $ S$ )a  The logical grouping to which the "reason" belongs.

Reference:
    https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112

Returns:
    Union[str, None]: An optional string containing a logical grouping to which the "reason" belongs.
N)rM   domainr.   s    r   r_   GoogleAPICallError.domain   r]   r   c                 T    U R                   (       a  U R                   R                  $ S$ )a  Additional structured details about this error.

Reference:
    https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto#L112

Returns:
    Union[Dict[str, str], None]: An optional object containing structured details about the error.
N)rM   metadatar.   s    r   rb   GoogleAPICallError.metadata   s#     -1,<,<t((F$Fr   c                 ,    [        U R                  5      $ )z]Detailed error information.

Returns:
    Sequence[Any]: A list of additional error details.
)listrJ   r.   s    r   rN   GoogleAPICallError.errors   s     DLL!!r   c                 ,    [        U R                  5      $ )a<  Information contained in google.rpc.status.details.

Reference:
    https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto
    https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto

Returns:
    Sequence[Any]: A list of structured objects from error_details.proto
)re   rK   r.   s    r   rO   GoogleAPICallError.details   s     DMM""r   c                     U R                   $ )zQOptional[Union[requests.Request, grpc.Call]]: The response or
gRPC call metadata.)rL   r.   s    r   rP   GoogleAPICallError.response   s     ~~r   )rK   rM   rJ   rL   r'   )r   r   NN)r   r   r   r   r   r=   r   int__annotations__r?   r&   r2   r4   r[   r_   rb   rN   rO   rP   r   r5   r6   s   @r   rG   rG   n   s    
 D(3- 59h018&" 	E 	E 	E 	E 	G 	G " " 
# 
#  r   rG   )	metaclassc                       \ rS rSrSrSrg)Redirection   z8Base class for for all redirection (HTTP 3xx) responses.r   Nr   r   r   r   ro   ro      s    Br   ro   c                   D    \ rS rSrSr\R                  R                  rSr	g)MovedPermanently   z7Exception mapping a ``301 Moved Permanently`` response.r   N)
r   r   r   r   r   httpclientMOVED_PERMANENTLYr=   r   r   r   r   rr   rr          A;;((Dr   rr   c                   D    \ rS rSrSr\R                  R                  rSr	g)NotModified   z2Exception mapping a ``304 Not Modified`` response.r   N)
r   r   r   r   r   rt   ru   NOT_MODIFIEDr=   r   r   r   r   ry   ry          <;;##Dr   ry   c                   D    \ rS rSrSr\R                  R                  rSr	g)TemporaryRedirect   z8Exception mapping a ``307 Temporary Redirect`` response.r   N)
r   r   r   r   r   rt   ru   TEMPORARY_REDIRECTr=   r   r   r   r   r~   r~          B;;))Dr   r~   c                       \ rS rSrSrSrSrg)ResumeIncomplete   zException mapping a ``308 Resume Incomplete`` response.

.. note:: :attr:`http.client.PERMANENT_REDIRECT` is ``308``, but Google
    APIs differ in their use of this status code.
i4  r   N)r   r   r   r   r   r=   r   r   r   r   r   r      s     Dr   r   c                       \ rS rSrSrSrg)ClientErrori  z5Base class for all client error (HTTP 4xx) responses.r   Nr   r   r   r   r   r     s    ?r   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)
BadRequesti
  z1Exception mapping a ``400 Bad Request`` response.r   N)
r   r   r   r   r   rt   ru   BAD_REQUESTr=   r   r   r   r   r   r   
      ;;;""Dr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)InvalidArgumenti  zCException mapping a :attr:`grpc.StatusCode.INVALID_ARGUMENT` error.Nr   )
r   r   r   r   r   grpc
StatusCodeINVALID_ARGUMENTr?   r   r   r   r   r   r     s    M;?;Kt77QUr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)FailedPreconditioni  zFException mapping a :attr:`grpc.StatusCode.FAILED_PRECONDITION`
error.Nr   )
r   r   r   r   r   r   r   FAILED_PRECONDITIONr?   r   r   r   r   r   r     s"     ?C>Nt::TXr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)
OutOfRangei  z?Exception mapping a :attr:`grpc.StatusCode.OUT_OF_RANGE` error.Nr   )
r   r   r   r   r   r   r   OUT_OF_RANGEr?   r   r   r   r   r   r     s    I7;7Gt33Tr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)Unauthorizedi#  z2Exception mapping a ``401 Unauthorized`` response.r   N)
r   r   r   r   r   rt   ru   UNAUTHORIZEDr=   r   r   r   r   r   r   #  r|   r   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)Unauthenticatedi)  zBException mapping a :attr:`grpc.StatusCode.UNAUTHENTICATED` error.Nr   )
r   r   r   r   r   r   r   UNAUTHENTICATEDr?   r   r   r   r   r   r   )  s    L:>:Jt66PTr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)	Forbiddeni/  z/Exception mapping a ``403 Forbidden`` response.r   N)
r   r   r   r   r   rt   ru   	FORBIDDENr=   r   r   r   r   r   r   /  s    9;;  Dr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)PermissionDeniedi5  zDException mapping a :attr:`grpc.StatusCode.PERMISSION_DENIED` error.Nr   )
r   r   r   r   r   r   r   PERMISSION_DENIEDr?   r   r   r   r   r   r   5      N<@<Lt88RVr   r   c                   z    \ rS rSrSr\R                  R                  r\	b  \	R                  R                  OSrSrg)NotFoundi;  z\Exception mapping a ``404 Not Found`` response or a
:attr:`grpc.StatusCode.NOT_FOUND` error.Nr   )r   r   r   r   r   rt   ru   	NOT_FOUNDr=   r   r   r?   r   r   r   r   r   r   ;  s/    0 ;;  D484Dt00$r   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)MethodNotAllowediC  z8Exception mapping a ``405 Method Not Allowed`` response.r   N)
r   r   r   r   r   rt   ru   METHOD_NOT_ALLOWEDr=   r   r   r   r   r   r   C  r   r   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)ConflictiI  z.Exception mapping a ``409 Conflict`` response.r   N)
r   r   r   r   r   rt   ru   CONFLICTr=   r   r   r   r   r   r   I  s    8;;Dr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)AlreadyExistsiO  zAException mapping a :attr:`grpc.StatusCode.ALREADY_EXISTS` error.Nr   )
r   r   r   r   r   r   r   ALREADY_EXISTSr?   r   r   r   r   r   r   O  s    K9=9It55tr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)AbortediU  z:Exception mapping a :attr:`grpc.StatusCode.ABORTED` error.Nr   )
r   r   r   r   r   r   r   ABORTEDr?   r   r   r   r   r   r   U      D262Bt..r   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)LengthRequiredi[  z5Exception mapping a ``411 Length Required`` response.r   N)
r   r   r   r   r   rt   ru   LENGTH_REQUIREDr=   r   r   r   r   r   r   [      ?;;&&Dr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)PreconditionFailedia  z9Exception mapping a ``412 Precondition Failed`` response.r   N)
r   r   r   r   r   rt   ru   PRECONDITION_FAILEDr=   r   r   r   r   r   r   a  s    C;;**Dr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)RequestRangeNotSatisfiableig  zCException mapping a ``416 Request Range Not Satisfiable`` response.r   N)
r   r   r   r   r   rt   ru   REQUESTED_RANGE_NOT_SATISFIABLEr=   r   r   r   r   r   r   g  s    M;;66Dr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)TooManyRequestsim  z7Exception mapping a ``429 Too Many Requests`` response.r   N)
r   r   r   r   r   rt   ru   TOO_MANY_REQUESTSr=   r   r   r   r   r   r   m  rw   r   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)ResourceExhaustedis  zEException mapping a :attr:`grpc.StatusCode.RESOURCE_EXHAUSTED` error.Nr   )
r   r   r   r   r   r   r   RESOURCE_EXHAUSTEDr?   r   r   r   r   r   r   s  s    O=A=Mt99SWr   r   c                   R    \ rS rSrSrSr\b  \R                  R                  OSr	Sr
g)	Cancellediy  z<Exception mapping a :attr:`grpc.StatusCode.CANCELLED` error.i  Nr   )r   r   r   r   r   r=   r   r   	CANCELLEDr?   r   r   r   r   r   r   y  s#    F D484Dt00$r   r   c                       \ rS rSrSrSrg)ServerErrori  zBase for 5xx responses.r   Nr   r   r   r   r   r     s    !r   r   c                   z    \ rS rSrSr\R                  R                  r\	b  \	R                  R                  OSrSrg)InternalServerErrori  zhException mapping a ``500 Internal Server Error`` response. or a
:attr:`grpc.StatusCode.INTERNAL` error.Nr   )r   r   r   r   r   rt   ru   INTERNAL_SERVER_ERRORr=   r   r   INTERNALr?   r   r   r   r   r   r     s/    / ;;,,D373Ct//r   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)Unknowni  z:Exception mapping a :attr:`grpc.StatusCode.UNKNOWN` error.Nr   )
r   r   r   r   r   r   r   UNKNOWNr?   r   r   r   r   r   r     r   r   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)DataLossi  z<Exception mapping a :attr:`grpc.StatusCode.DATA_LOSS` error.Nr   )
r   r   r   r   r   r   r   	DATA_LOSSr?   r   r   r   r   r   r     s    F484Dt00$r   r   c                   z    \ rS rSrSr\R                  R                  r\	b  \	R                  R                  OSrSrg)MethodNotImplementedi  zfException mapping a ``501 Not Implemented`` response or a
:attr:`grpc.StatusCode.UNIMPLEMENTED` error.Nr   )r   r   r   r   r   rt   ru   NOT_IMPLEMENTEDr=   r   r   UNIMPLEMENTEDr?   r   r   r   r   r   r     s/    4 ;;&&D8<8Ht44dr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)
BadGatewayi  z1Exception mapping a ``502 Bad Gateway`` response.r   N)
r   r   r   r   r   rt   ru   BAD_GATEWAYr=   r   r   r   r   r   r     r   r   r   c                   z    \ rS rSrSr\R                  R                  r\	b  \	R                  R                  OSrSrg)ServiceUnavailablei  zhException mapping a ``503 Service Unavailable`` response or a
:attr:`grpc.StatusCode.UNAVAILABLE` error.Nr   )r   r   r   r   r   rt   ru   SERVICE_UNAVAILABLEr=   r   r   UNAVAILABLEr?   r   r   r   r   r   r     s/    2 ;;**D6:6Ft22Dr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)GatewayTimeouti  z5Exception mapping a ``504 Gateway Timeout`` response.r   N)
r   r   r   r   r   rt   ru   GATEWAY_TIMEOUTr=   r   r   r   r   r   r     r   r   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)DeadlineExceededi  zDException mapping a :attr:`grpc.StatusCode.DEADLINE_EXCEEDED` error.Nr   )
r   r   r   r   r   r   r   DEADLINE_EXCEEDEDr?   r   r   r   r   r   r     r   r   r   c                       \ rS rSrSrSrg)"AsyncRestUnsupportedParameterErrori  zPRaised when an unsupported parameter is configured against async rest transport.r   Nr   r   r   r   r   r     s    Zr   r   c                 6    [         R                  U [        5      $ )zReturn the exception class for a specific HTTP status code.

Args:
    status_code (int): The HTTP status code.

Returns:
    :func:`type`: the appropriate subclass of :class:`GoogleAPICallError`.
)r   getrG   status_codes    r   exception_class_for_http_statusr          #&&{4FGGr   c                 T    [        U 5      nU" U40 UD6nUR                  c  Xl        U$ )ao  Create a :class:`GoogleAPICallError` from an HTTP status code.

Args:
    status_code (int): The HTTP status code.
    message (str): The exception message.
    kwargs: Additional arguments passed to the :class:`GoogleAPICallError`
        constructor.

Returns:
    GoogleAPICallError: An instance of the appropriate subclass of
        :class:`GoogleAPICallError`.
)r   r=   r   r'   kwargserror_classrX   s        r   from_http_statusr     s1     2+>K*6*Ezz 
Lr   c                 Z    U(       a  UR                  5       OS nSR                  UUU S9nU$ )Nz{method} {url}: {error})methodurlrX   )upperr1   )rX   r   r   r'   s       r   _format_rest_error_messager     s6    %V\\^4F'.. / G
 Nr   r   r   payloadc           	      x   U(       d  0 OUnUR                  S0 5      R                  SS5      nUR                  S0 5      R                  SS5      nUR                  S0 5      R                  SS5      n[        [        S U5      5      nU(       a  US   OS	n[        XAU5      n	[	        U R
                  U	UUU US
9n
U
$ )ae  Create a :class:`GoogleAPICallError` from a google auth rest response.

Args:
    response Union[google.auth.transport.Response, google.auth.aio.transport.Response]: The HTTP response.
    method Optional(str): The HTTP request method.
    url Optional(str): The HTTP request url.
    payload Optional(dict): The HTTP response payload. If not passed in, it is read from response for a response type of google.auth.transport.Response.

Returns:
    GoogleAPICallError: An instance of the appropriate subclass of
        :class:`GoogleAPICallError`, with the message and errors populated
        from the response.
rX   r'   unknown errorrN   r   rO   c                 ,    U R                  SS5      S:H  $ )Nz@type z(type.googleapis.com/google.rpc.ErrorInfo)r   )details    r   <lambda>,format_http_response_error.<locals>.<lambda>	  s    6::gr29:r   r   NrN   rO   rP   rQ   )r   re   filterr   r   r   )rP   r   r   r   error_messagerN   rO   error_info_listrQ   r'   	exceptions              r   format_http_response_errorr    s       bWGKK,00OLM[["%))(B7Fkk'2&**9b9G:	
O (7#DJ(DG I r   c                      U R                  5       n[        X R                  R
                  U R                  R                  U5      $ ! [         a    SSU R                  =(       d    S00n NZf = f)a7  Create a :class:`GoogleAPICallError` from a :class:`requests.Response`.

Args:
    response (requests.Response): The HTTP response.

Returns:
    GoogleAPICallError: An instance of the appropriate subclass of
        :class:`GoogleAPICallError`, with the message and errors populated
        from the response.
rX   r'   r   )json
ValueErrortextr  requestr   r   )rP   r   s     r   from_http_responser    sl    K--/ &""))8+;+;+?+?   KY(HIJKs   A #A-,A-c                 6    [         R                  U [        5      $ )zReturn the exception class for a specific :class:`grpc.StatusCode`.

Args:
    status_code (grpc.StatusCode): The gRPC status code.

Returns:
    :func:`type`: the appropriate subclass of :class:`GoogleAPICallError`.
)r   r   rG   r   s    r   exception_class_for_grpc_statusr
  0  r   r   c                     [        U [        5      (       a  [        R                  X 5      n [	        U 5      nU" U40 UD6nUR
                  c  Xl        U$ )a  Create a :class:`GoogleAPICallError` from a :class:`grpc.StatusCode`.

Args:
    status_code (Union[grpc.StatusCode, int]): The gRPC status code.
    message (str): The exception message.
    kwargs: Additional arguments passed to the :class:`GoogleAPICallError`
        constructor.

Returns:
    GoogleAPICallError: An instance of the appropriate subclass of
        :class:`GoogleAPICallError`.
)
isinstancerk   _INT_TO_GRPC_CODEr   r
  r?   r   s        r   from_grpc_statusr  <  sQ     +s##'++KE1+>K*6*E%!,Lr   c                 @    [        U S5      =(       a    [        U S5      $ )Nr=   rO   )rU   )rpc_excs    r   _is_informative_grpc_errorr  V  s    7F#C(CCr   c           
        ^ [         (       d  [        5         / S 4$  [         R                  " U 5      nU(       d  / S 4$ [        R
                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  [        R                  /
nS n/ nUR                   H}  m[!        [#        U4S jU5      5      n[%        U5      S:X  a  TnOUS   " 5       nTR'                  U5        UR)                  U5        [+        U[        R                  5      (       d  M{  UnM     XC4$ ! [         a    / S 4s $ f = f)Nc                 :   > TR                  U R                  5      $ r$   )Is
DESCRIPTOR)xr   s    r   r   +_parse_grpc_error_details.<locals>.<lambda>v  s    VYYq||4r   r   )r   r   	from_callNotImplementedErrorr   r   PreconditionFailureQuotaFailure	ErrorInfo	RetryInfoResourceInfoRequestInfo	DebugInfoHelpLocalizedMessagerO   re   r   lenUnpackappendr  )r  statuspossible_errorsrQ   error_detailsmatched_detail_clsinfor   s          @r   _parse_grpc_error_detailsr+  Z  sH   :,.4x%%g. 4x 	$$--&&####&&%%##**O JM..!4oF
 !"a'D%a(*DMM$T"d-7788J ! $$C  4xs   E) )E:9E:c           	         [         b  [        U [         R                  5      (       d  [        U 5      (       a8  [	        U 5      u  p[        U R                  5       U R                  5       U 4UU US9$ [        [        U 5      U 4U S9$ )zCreate a :class:`GoogleAPICallError` from a :class:`grpc.RpcError`.

Args:
    rpc_exc (grpc.RpcError): The gRPC error.

Returns:
    GoogleAPICallError: An instance of the appropriate subclass of
        :class:`GoogleAPICallError`.
r   )rN   rP   )
r   r  Callr  r+  r  r=   rO   rG   str)r  rO   err_infos      r   from_grpc_errorr0    sw     	Z;;	#G	,	,5g>LLNOO:
 	
 "#g,zGTTr   r$   )Or   
__future__r   r   http.clientrt   typingr   r   r	   
google.rpcr   r   r   grpc_statusr   ImportErrorr   rk   	Exceptionrl   r   r  r   r  valuer   r   r!   r;   r8   rG   ro   rr   ry   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.  r  r  r
  r  r  r+  r0  r   r   r   <module>r9     s)   ' '  !  (	* 13 c9n- 202 c9n- 2
  __()!''!*% 	Y 		n 	I I.	d 	u3J upC$ C){ )$+ $* *{ @$ @# #Vj VY YR R$; $Ul U! !Wy WO{ O*{ * {  TH TMh M'[ '+ +7 7)k )X XO O"$ "N+ NMk MO{ OS; S# #Q Q'[ 'W~ W	)< 		H, @D'' #'.6tn'T(	H4D'%TUs  ,.
  Ds.   I1 I I.*I1 -I..I1 1I=<I=