
    Xj                        d Z ddlmZ ddlZddlZddlZddlmZmZm	Z	 ddl
Z
ddlZddlmZ  e            Z G d de          Z G d d	e          Z ej         ej                              Zd
 Z G d de          Zd Zd Zd Zeg df         Zej        Zee	e ef         gdf         Z!ee edge	e df         f         Z"eddd#d            Z#dZ$ej%        dk    rddl&m'Z' ddl&m(Z( dd l&m)Z) dd!l&m*Z* e$d"z  Z$dS dS )$zbgRPC's experimental APIs.

These APIs are subject to be removed during any minor version release.
    )annotationsN)CallableOptionalUnion)cygrpcc                      e Zd ZdZdZdS )ChannelOptionszIndicates a channel option unique to gRPC Python.

    This enumeration is part of an EXPERIMENTAL API.

    Attributes:
      SingleThreadedUnaryStream: Perform unary-stream RPCs on a single thread.
    SingleThreadedUnaryStreamN)__name__
__module____qualname____doc__r
        W/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/grpc/experimental/__init__.pyr	   r	       s"          !<r   r	   c                      e Zd ZdZdS )
UsageErrorzDRaised by the gRPC library to indicate usage not allowed by the API.Nr   r   r   r   r   r   r   r   r   ,   s        NNNNr   r   c                     t           S )zeCreates a ChannelCredentials for use with an insecure channel.

    THIS IS AN EXPERIMENTAL API.
    )_insecure_channel_credentialsr   r   r   insecure_channel_credentialsr   7   s
    
 )(r   c                      e Zd ZdZdS )ExperimentalApiWarningz&A warning that an API is experimental.Nr   r   r   r   r   r   ?   s        0000r   r   c                    | t           vrSt                               |            d                    |           dz   }t          j        |t
          d|z              d S d S )Nz8'{}' is an experimental API. It is subject to change or z5removal between minor releases. Proceed with caution.   )
stacklevel)_EXPERIMENTAL_APIS_USEDaddformatwarningswarnr   )api_namestack_offsetmsgs      r   _warn_experimentalr%   C   sv    ...##H---FMM  FF 	 	c1a,>NOOOOOO /.r   c                F     t          j                    fd            }|S )Nc                 >    t          j        d            | i |S )N   )r%   r   )argskwargsfs     r   _wrapperz"experimental_api.<locals>._wrapperP   s*    1:q)))q$!&!!!r   )	functoolswraps)r+   r,   s   ` r   experimental_apir/   O   s8    _Q" " " " " Or   c                T   |sdS |j         sO|j        s$|                     | |j                            S |                     | |j                            S |j        s$|                     | |j                            S |                     | |j                            S )a  Wraps the server method handler function.

    The server implementation requires all server handlers being wrapped as
    RpcMethodHandler objects. This helper function ease the pain of writing
    server handler wrappers.

    Args:
        wrapper: A wrapper function that takes in a method handler behavior
          (the actual function) and returns a wrapped function.
        handler: A RpcMethodHandler object to be wrapped.

    Returns:
        A newly created RpcMethodHandler.
    Nunary_unaryunary_streamstream_unarystream_stream)request_streamingresponse_streaming_replacer2   r4   r6   r8   )wrapperhandlers     r   wrap_server_method_handlerr>   X   s      t$ L) 	N ##8K0L0L#MMMWWW5I-J-JKKK% LWWW5I-J-JKKK'''2G*H*HIIIr   PrivateKeySignOnCompletePrivateKeySignCancel)root_certificatesprivate_key_sign_fn'CustomPrivateKeySign'rA   Optional[bytes]certificate_chainbytesreturngrpc.ChannelCredentialsc                T    t          j        t          j        |d||                     S )a  Creates a ChannelCredentials for use with an SSL-enabled Channel with a custom signer.

    THIS IS AN EXPERIMENTAL API.
    This API will be removed in a future version and combined with `grpc.ssl_channel_credentials`.

    Args:
      private_key_sign_fn: a function with the signature of
        `CustomPrivateKeySign`. This function can return synchronously or
        asynchronously.  To return synchronously, return the signed bytes.  To
        return asynchronously, return a callable matching the
        `PrivateKeySignCancel` signature.This can be a no-op if no cancellation is
        needed. In the async case, this function must return this callable
        quickly, then call the passed in `PrivateKeySignOnComplete` when the async
        signing operation is complete to trigger gRPC to continue the handshake.
      root_certificates: The PEM-encoded root certificates as a byte string,
        or None to retrieve them from a default location chosen by gRPC
        runtime.
      certificate_chain: The PEM-encoded certificate chain as a byte string
        to use

    Returns:
      A ChannelCredentials for use with an SSL-enabled Channel.
    N)grpcChannelCredentials_cygrpcSSLChannelCredentials)rB   rA   rE   s      r   *ssl_channel_credentials_with_custom_signerrN      s4    < "%t%68K	
 	
  r   )r	   r   r   r   rN   r>   )      r7   r5   r3   r1   )r8   r6   r4   r2   )rB   rC   rA   rD   rE   rF   rG   rH   )+r   
__future__r   copyr-   systypingr   r   r   r    rJ   grpc._cythonr   rL   setr   objectr	   	Exceptionr   rK   channel_credentials_insecurer   r   Warningr   r%   r/   r>   r@   PrivateKeySignatureAlgorithmrF   r?   CustomPrivateKeySignrN   __all__version_infogrpc._simple_stubsr8   r6   r4   r2   r   r   r   <module>r`      s    # " " " " "      



 , , , , , , , , , ,   * * * * * *#%% 	< 	< 	< 	< 	<V 	< 	< 	<O O O O O O O O !8 7(G(**! ! 
) ) )1 1 1 1 1W 1 1 1	P 	P 	P  J J J>  D) &C #U5)+;%<$=t$CD   $"
 
%'
'(*   *.! ! ! ! ! !H f000000////////////......  GGG r   