o
    iy                  	   @   s   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 dej	e
dg d	Zd
d Zdd Zdd Zdd Zdd Zdd Zdd Zdd ZdS )z-Utilities for RPC Framework's Face interface.    N)cardinality)style)stream)facec                   @   s   e Zd ZdS )_MethodImplementationN)__name__
__module____qualname__ r
   r
   e/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/grpc/framework/interfaces/face/utilities.pyr      s    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                 C   s"   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behaviorr
   r
   r   r   .      r   c                 C   s"   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   r
   r
   r   r   G   r   r   c                 C   s"   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   r
   r
   r   r   `   r   r   c                 C   s"   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   r
   r
   r   r   y   r   r   c                 C   s"   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   r
   r
   r   r      r   r   c                 C   s"   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   r
   r
   r   r      r   r   c                 C   s"   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   r
   r
   r   r         r   c                 C   s"   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   r
   r
   r   r      r   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
   r   <module>   s*   
