
    j                         d Z ddlmZmZmZmZ ddlZ G d dej        ej        ej	        ej
                  Z G d de          Z G d d	eej                  Zd
edefdZdS )z:Base class for interceptors that operate on all RPC types.    )AnyCallableList
NamedTupleNc                   x     e Zd Zdeddf fdZdededefdZdededefd	Zdeded
efdZdeded
efdZ	 xZ
S )_GenericClientInterceptorinterceptor_functionreturnNc                 V    t                                                       || _        d S N)super__init___fn)selfr	   	__class__s     e/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/pymilvus/client/interceptor.pyr   z"_GenericClientInterceptor.__init__   s$    '    continuationclient_call_detailsrequestc                     |                      |t          |f                    \  }}} ||t          |                    }|r ||          n|S r   r   iternext)r   r   r   r   new_detailsnew_request_iteratorpostprocessresponses           r   intercept_unary_unaryz/_GenericClientInterceptor.intercept_unary_unary   sb    9=wj!1!1:
 :
6);  <T2F-G-GHH(3A{{8$$$Ar   c                     |                      |t          |f                    \  }}} ||t          |                    }|r ||          n|S r   r   )r   r   r   r   r   r   r   response_its           r   intercept_unary_streamz0_GenericClientInterceptor.intercept_unary_stream&   sd     :>wj!1!1:
 :
6); #l;5I0J0JKK+6G{{;'''KGr   request_iteratorc                 l    |                      ||          \  }}} |||          }|r ||          n|S r   r   )r   r   r   r#   r   r   r   r   s           r   intercept_stream_unaryz0_GenericClientInterceptor.intercept_stream_unary2   sS     :>!1:
 :
6);  <-ABB(3A{{8$$$Ar   c                 l    |                      ||          \  }}} |||          }|r ||          n|S r   r%   )r   r   r   r#   r   r   r   r!   s           r   intercept_stream_streamz1_GenericClientInterceptor.intercept_stream_stream>   sS     :>!1:
 :
6); #l;0DEE+6G{{;'''KGr   )__name__
__module____qualname__r   r   r   r   r"   r&   r(   __classcell__)r   s   @r   r   r      s&       (X ($ ( ( ( ( ( (B( BQT B_b B B B B
H
H !
H 	
H 
H 
H 
H
B
B !
B 	
B 
B 
B 
B
H
H !
H 	
H 
H 
H 
H 
H 
H 
H 
Hr   r   c                   8    e Zd ZU eed<   eed<   eed<   eed<   dS )ClientCallDetailsTuplemethodtimeoutmetadatacredentialsN)r)   r*   r+   r   __annotations__ r   r   r.   r.   K   s9         KKKLLLMMMr   r.   c                       e Zd ZdS )_ClientCallDetailsN)r)   r*   r+   r4   r   r   r6   r6   R   s        Dr   r6   headersvaluesc                 N     dt           dt           f fd}t          |          S )Nr   r#   c                     g }| j         t          | j                   }t                    D ]}|                    |           t	          | j        | j        || j                  } | |d fS r   )r1   listzipappendr6   r/   r0   r2   )r   r#   r1   itemr7   r8   s       r   intercept_callz0header_adder_interceptor.<locals>.intercept_callW   s     '3/899H(( 	" 	"DOOD!!!!0&'+	
 
 #$4d::r   )r   r   )r7   r8   r?   s   `` r   header_adder_interceptorr@   V   sG    ; ;; ; ; ; ; ; ;" %^444r   )__doc__typingr   r   r   r   grpcUnaryUnaryClientInterceptorUnaryStreamClientInterceptorStreamUnaryClientInterceptorStreamStreamClientInterceptorr   r.   ClientCallDetailsr6   r@   r4   r   r   <module>rI      s
   A @ 2 2 2 2 2 2 2 2 2 2 2 2 3H 3H 3H 3H 3H$%%&	3H 3H 3Hl    Z   	 	 	 	 	/1G 	 	 	5d 5D 5 5 5 5 5 5r   