
    Agy              
           d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ  G d dej                   ej                  dg d	            Zd
 Zd Zd Zd Zd Zd Zd Zd Zy)z-Utilities for RPC Framework's Face interface.    N)cardinality)style)stream)facec                       e Zd Zy)_MethodImplementationN)__name__
__module____qualname__     ]/var/www/openai/venv/lib/python3.12/site-packages/grpc/framework/interfaces/face/utilities.pyr   r      s    $ 	r   r   )
r   r   unary_unary_inlineunary_stream_inlinestream_unary_inlinestream_stream_inlineunary_unary_eventunary_stream_eventstream_unary_eventstream_stream_eventc                     t        t        j                  j                  t        j
                  j                  | ddddddd
      S )a]  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a unary-unary RPC method as a callable value
        that takes a request value and an face.ServicerContext object and
        returns a response value.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   CardinalityUNARY_UNARYr   ServiceINLINEbehaviors    r   r   r   .   sE     !++ r   c                     t        t        j                  j                  t        j
                  j                  d| dddddd
      S )al  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a unary-stream RPC method as a callable
        value that takes a request value and an face.ServicerContext object and
        returns an iterator of response values.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   r   UNARY_STREAMr   r   r   r   s    r   r   r   G   sE     !,, r   c                     t        t        j                  j                  t        j
                  j                  dd| ddddd
      S )al  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a stream-unary RPC method as a callable
        value that takes an iterator of request values and an
        face.ServicerContext object and returns a response value.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   r   STREAM_UNARYr   r   r   r   s    r   r   r   `   sE     !,, r   c                     t        t        j                  j                  t        j
                  j                  ddd| dddd
      S )a{  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a stream-stream RPC method as a callable
        value that takes an iterator of request values and an
        face.ServicerContext object and returns an iterator of response values.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   r   STREAM_STREAMr   r   r   r   s    r   r   r   y   sE     !-- r   c                     t        t        j                  j                  t        j
                  j                  dddd| ddd
      S )a~  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a unary-unary RPC method as a callable
        value that takes a request value, a response callback to which to pass
        the response value of the RPC, and an face.ServicerContext.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   r   r   r   r   EVENTr   s    r   r   r      sE     !++ r   c                     t        t        j                  j                  t        j
                  j                  ddddd| dd
      S )a~  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a unary-stream RPC method as a callable
        value that takes a request value, a stream.Consumer to which to pass the
        response values of the RPC, and an face.ServicerContext.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   r   r   r   r   r%   r   s    r   r   r      sE     !,, r   c                     t        t        j                  j                  t        j
                  j                  dddddd| d
      S )a  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a stream-unary RPC method as a callable
        value that takes a response callback to which to pass the response value
        of the RPC and an face.ServicerContext and returns a stream.Consumer to
        which the request values of the RPC should be passed.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   r   r!   r   r   r%   r   s    r   r   r      sE     !,, r   c                     t        t        j                  j                  t        j
                  j                  ddddddd| 
      S )a  Creates an face.MethodImplementation for the given behavior.

    Args:
      behavior: The implementation of a stream-stream RPC method as a callable
        value that takes a stream.Consumer to which to pass the response values
        of the RPC and an face.ServicerContext and returns a stream.Consumer to
        which the request values of the RPC should be passed.

    Returns:
      An face.MethodImplementation derived from the given behavior.
    N)r   r   r   r#   r   r   r%   r   s    r   r   r      sE     !-- r   )__doc__collectionsgrpc.framework.commonr   r   grpc.framework.foundationr   grpc.framework.interfaces.facer   MethodImplementation
namedtupler   r   r   r   r   r   r   r   r   r   r   r   <module>r0      sn    4  . ' , /	K	
	*2222224r   