
    R                        % 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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%  \R0                   H  r\\\R4                  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/ S0\&5      r- " S1 S2\-5      r. " S3 S4\&5      r/ " S5 S6\&5      r0 " S7 S8\&5      r1 " S9 S:\15      r2 " S; S<\15      r3 " S= S>\&5      r4 " S? S@\&5      r5 " SA SB\&5      r6 " SC SD\&5      r7 " SE SF\75      r8 " SG SH\&5      r9 " SI SJ\ 5      r: " SK SL\:5      r; " SM SN\:5      r< " SO SP\:5      r= " SQ SR\:5      r> " SS ST\:5      r? " SU SV\:5      r@ " SW SX\:5      rA " SY SZ\A5      rB " S[ S\\C5      rDS] rES^ rFS_ rG SjS`\HSa\HSb\\   4Sc jjrISd rJSe rKSf rLSg rMSh rNSi rOg! \ a    \" 5         Sr GN8f = f! \ a    Sr GNGf = f)kzExceptions 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)Union)error_details_pb2c                  :    [         R                  " S[        5        g )NzCPlease install grpcio-status to obtain helpful grpc error messages.)warningswarnImportWarning     -lib/third_party/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)DuplicateCredentialArgsF   z,Raised when multiple credentials are passed.r   Nr   r   r   r   r   r   F   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
$ )
RetryErrorL   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__U   s    j$(1r   c                     U R                   $ )z5The last exception raised when retrying the function.)r)   r*   s    r   r+   RetryError.causeZ   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+   r3   r   __classcell__r,   s   @r   r"   r"   L   s-    
  I Ir   r"   c                       \ rS rSrSrS rSrg)_GoogleAPICallErrorMetac   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__f   sW    ll3e888#..sxx=+#..s/C/CSI
r   r   N)r   r   r   r   r   r=   r   r   r   r   r9   r9   c   s
    Br   r9   c                      ^  \ rS rSr% SrSr\\S4   \S'    Sr	 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$ )GoogleAPICallErroro   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>   c                 j   > [         [        U ]  U5        Xl         X l        X0l        X@l        XPl        g r%   )r&   rH   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: 
)r2   r>   r(   rP   rO   hasattrjoin)r*   	error_msgerrorrO   s       r   r3   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)rN   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)rN   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)rN   metadatar/   s    r   rc   GoogleAPICallError.metadata   s#     -1,<,<t((F$Fr   c                 ,    [        U R                  5      $ )z]Detailed error information.

Returns:
    Sequence[Any]: A list of additional error details.
)listrK   r/   s    r   rO   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
)rf   rL   r/   s    r   rP   GoogleAPICallError.details   s     DMM""r   c                     U R                   $ )zQOptional[Union[requests.Request, grpc.Call]]: The response or
gRPC call metadata.)rM   r/   s    r   rQ   GoogleAPICallError.response   s     ~~r   )rL   rN   rK   rM   r(   )r   r   NN)r   r   r   r   r   r>   r   int__annotations__r@   r'   r3   r5   r\   r`   rc   rO   rP   rQ   r   r6   r7   s   @r   rH   rH   o   s    
 "D%T	
! &" 	E 	E 	E 	E 	G 	G " " 
# 
#  r   rH   )	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   rp   rp      s    Br   rp   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   rs   rs          A;;((Dr   rs   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   ru   rv   NOT_MODIFIEDr>   r   r   r   r   rz   rz          <;;##Dr   rz   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   ru   rv   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   ru   rv   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   ru   rv   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)	Forbiddeni0  z/Exception mapping a ``403 Forbidden`` response.r   N)
r   r   r   r   r   ru   rv   	FORBIDDENr>   r   r   r   r   r   r   0  s    9;;  Dr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)PermissionDeniedi6  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   6      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   ru   rv   	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)MethodNotAllowediD  z8Exception mapping a ``405 Method Not Allowed`` response.r   N)
r   r   r   r   r   ru   rv   METHOD_NOT_ALLOWEDr>   r   r   r   r   r   r   D  r   r   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)ConflictiJ  z.Exception mapping a ``409 Conflict`` response.r   N)
r   r   r   r   r   ru   rv   CONFLICTr>   r   r   r   r   r   r   J  s    8;;Dr   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)AlreadyExistsiP  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   P  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)AbortediV  z:Exception mapping a :attr:`grpc.StatusCode.ABORTED` error.Nr   )
r   r   r   r   r   r   r   ABORTEDr@   r   r   r   r   r   r   V      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   ru   rv   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)PreconditionFailedib  z9Exception mapping a ``412 Precondition Failed`` response.r   N)
r   r   r   r   r   ru   rv   PRECONDITION_FAILEDr>   r   r   r   r   r   r   b  s    C;;**Dr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)RequestRangeNotSatisfiableih  zCException mapping a ``416 Request Range Not Satisfiable`` response.r   N)
r   r   r   r   r   ru   rv   REQUESTED_RANGE_NOT_SATISFIABLEr>   r   r   r   r   r   r   h  s    M;;66Dr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)TooManyRequestsin  z7Exception mapping a ``429 Too Many Requests`` response.r   N)
r   r   r   r   r   ru   rv   TOO_MANY_REQUESTSr>   r   r   r   r   r   r   n  rx   r   r   c                   N    \ rS rSrSr\b  \R                  R                  OSrSr	g)ResourceExhaustedit  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   t  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)	Cancellediz  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   z  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   ru   rv   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   ru   rv   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   ru   rv   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   ru   rv   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   ru   rv   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   getrH   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_classrY   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urlrY   )upperr2   )rY   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.
rY   r(   unknown errorrO   r   rP   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rO   rP   rQ   rR   )r   rf   filterr   r   r   )rQ   r   r   r   error_messagerO   rP   error_info_listrR   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.
rY   r(   r   )json
ValueErrortextr  requestr   r   )rQ   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   rH   r   s    r   exception_class_for_grpc_statusr  1  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`.
)
isinstancerl   _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>   rP   )rV   )rpc_excs    r   _is_informative_grpc_errorr  W  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>w  s    VYYq||4r   r   )r   r   	from_callNotImplementedErrorr   r   PreconditionFailureQuotaFailure	ErrorInfo	RetryInfoResourceInfoRequestInfo	DebugInfoHelpLocalizedMessagerP   rf   r   lenUnpackappendr  )r  statuspossible_errorsrR   error_detailsmatched_detail_clsinfor   s          @r   _parse_grpc_error_detailsr,  [  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   )rO   rQ   )
r   r  Callr  r,  r  r>   rP   rH   str)r  rP   err_infos      r   from_grpc_errorr1    sw     	Z;;	#G	,	,5g>LLNOO:
 	
 "#g,zGTTr   r%   )Pr   
__future__r   r   http.clientru   typingr   r   r   r
   
google.rpcr   r   r   grpc_statusr   ImportErrorr   rl   	Exceptionrm   r   r  r   r  valuer   r   r"   r<   r9   rH   rp   rs   rz   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,  r1  r   r   r   <module>r:     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.   I7 I! !I40I7 3I44I7 7JJ