
                         D    d dl mZ d dlmZ d dlmZ d dlmZ dedefdZ	y)	    )GoogleAPICallError)is_retryable)	ErrorInfo)
status_pb2errorreturnc                 X   t        |       r| j                  sy| j                  }|j                         y|j                         D ]  \  }}|dk(  st        j                  j                  |      }|j                         j                  d   |j                  k7  s|j                         |j                  k7  r y|j                  D ]`  }|j                  t        j                        s#t               }|j                  |      s?|j                  dk(  sO|j                  dk(  s_  y  y)z
    Determines whether the given error contains the stream RESET signal, sent by
    the server to instruct clients to reset stream state.

    Returns: True if the error contains the RESET signal.
    Fzgrpc-status-details-binr   RESETzpubsublite.googleapis.comT)r   responsetrailing_metadatar   Status
FromStringcodevaluedetailsmessageIsr   
DESCRIPTORUnpackreasondomain)r   callkeyr   rich_statusdetailinfos          Elib/third_party/google/cloud/pubsublite/internal/wire/reset_signal.pyis_reset_signalr      s     enn>>D',,.
U++$++66u=K		!!!$(8(88<<>[%8%88%--99Y112$;Dd+ KK72 KK+FF# . /"     N)
google.api_core.exceptionsr   -google.cloud.pubsublite.internal.status_codesr   google.rpc.error_details_pb2r   
google.rpcr   boolr    r   r   <module>r&      s'    : F 2 !- $ r   