a
    !f                     @   s  d Z ddlZddl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
ZG d	d
 d
ed
dZG dd de
ejdZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd dejZG dd  d eejdZG d!d" d"eejdZG d#d$ d$ejZG d%d& d&ejZG d'd( d(ejZG d)d* d*ejZG d+d, d,ejZG d-d. d.ejZ G d/d0 d0ejZ!G d1d2 d2ejZ"G d3d4 d4ejZ#dS )5z4Interfaces defining the Face layer of RPC Framework.    N)cardinality)style)future)streamc                       s(   e Zd ZdZ fddZdd Z  ZS )NoSuchMethodErrorzRaised by customer code to indicate an unrecognized method.

  Attributes:
    group: The group of the unrecognized method.
    name: The name of the unrecognized method.
  c                    s   t t|   || _|| _dS )zConstructor.

    Args:
      group: The group identifier of the unrecognized RPC name.
      method: The method identifier of the unrecognized RPC name.
    N)superr   __init__groupmethodselfr	   r
   	__class__ d/var/www/html/python-backend/venv/lib/python3.9/site-packages/grpc/framework/interfaces/face/face.pyr   &   s    zNoSuchMethodError.__init__c                 C   s   d| j | jf S )Nzface.NoSuchMethodError(%s, %s))r	   r
   r   r   r   r   __repr__1   s    zNoSuchMethodError.__repr__)__name__
__module____qualname____doc__r   r   __classcell__r   r   r   r   r      s   r   c                   @   s(   e Zd ZdZejG dd dejZdS )AbortionaE  A value describing RPC abortion.

  Attributes:
    kind: A Kind value identifying how the RPC failed.
    initial_metadata: The initial metadata from the other side of the RPC or
      None if no initial metadata value was received.
    terminal_metadata: The terminal metadata from the other side of the RPC or
      None if no terminal metadata value was received.
    code: The code value from the other side of the RPC or None if no code value
      was received.
    details: The details value from the other side of the RPC or None if no
      details value was received.
  c                   @   s,   e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
zAbortion.KindzTypes of RPC abortion.	cancelledZexpiredzlocal shutdownzremote shutdownznetwork failurezlocal failurezremote failureN)r   r   r   r   	CANCELLEDZEXPIREDZLOCAL_SHUTDOWNZREMOTE_SHUTDOWNZNETWORK_FAILUREZLOCAL_FAILUREZREMOTE_FAILUREr   r   r   r   KindN   s   r   N)r   r   r   r   enumuniqueEnumr   r   r   r   r   r   8   s   r   )kindinitial_metadataterminal_metadatacodedetailsc                       s(   e Zd ZdZ fddZdd Z  ZS )AbortionErrora  Common super type for exceptions indicating RPC abortion.

    initial_metadata: The initial metadata from the other side of the RPC or
      None if no initial metadata value was received.
    terminal_metadata: The terminal metadata from the other side of the RPC or
      None if no terminal metadata value was received.
    code: The code value from the other side of the RPC or None if no code value
      was received.
    details: The details value from the other side of the RPC or None if no
      details value was received.
  c                    s*   t t|   || _|| _|| _|| _d S )N)r   r$   r   r    r!   r"   r#   )r   r    r!   r"   r#   r   r   r   r   h   s
    zAbortionError.__init__c                 C   s   d| j j| j| jf S )Nz%s(code=%s, details="%s"))r   r   r"   r#   r   r   r   r   __str__o   s    zAbortionError.__str__)r   r   r   r   r   r%   r   r   r   r   r   r$   [   s   r$   )	metaclassc                   @   s   e Zd ZdZdS )CancellationErrorz)Indicates that an RPC has been cancelled.Nr   r   r   r   r   r   r   r   r'   t   s   r'   c                   @   s   e Zd ZdZdS )ExpirationErrorz0Indicates that an RPC has expired ("timed out").Nr(   r   r   r   r   r)   x   s   r)   c                   @   s   e Zd ZdZdS )LocalShutdownErrorzCIndicates that an RPC has terminated due to local shutdown of RPCs.Nr(   r   r   r   r   r*   |   s   r*   c                   @   s   e Zd ZdZdS )RemoteShutdownErrorzDIndicates that an RPC has terminated due to remote shutdown of RPCs.Nr(   r   r   r   r   r+      s   r+   c                   @   s   e Zd ZdZdS )NetworkErrorz2Indicates that some error occurred on the network.Nr(   r   r   r   r   r,      s   r,   c                   @   s   e Zd ZdZdS )
LocalErrorz;Indicates that an RPC has terminated due to a local defect.Nr(   r   r   r   r   r-      s   r-   c                   @   s   e Zd ZdZdS )RemoteErrorz<Indicates that an RPC has terminated due to a remote defect.Nr(   r   r   r   r   r.      s   r.   c                   @   sV   e Zd ZdZejdd Zejdd Zejdd Zejdd	 Z	ejd
d Z
dS )
RpcContextz,Provides RPC-related information and action.c                 C   s
   t  dS )z6Describes whether the RPC is active or has terminated.NNotImplementedErrorr   r   r   r   	is_active   s    zRpcContext.is_activec                 C   s
   t  dS )zDescribes the length of allowed time remaining for the RPC.

    Returns:
      A nonnegative float indicating the length of allowed time in seconds
      remaining for the RPC to complete before it is considered to have timed
      out.
    Nr0   r   r   r   r   time_remaining   s    	zRpcContext.time_remainingc                 C   s
   t  dS )zRegisters a callback to be called if the RPC is aborted.

    Args:
      abortion_callback: A callable to be called and passed an Abortion value
        in the event of RPC abortion.
    Nr0   )r   abortion_callbackr   r   r   add_abortion_callback   s    z RpcContext.add_abortion_callbackc                 C   s
   t  dS )zZCancels the RPC.

    Idempotent and has no effect if the RPC has already terminated.
    Nr0   r   r   r   r   cancel   s    zRpcContext.cancelc                 C   s
   t  dS )zAccesses a custom object specified by an implementation provider.

    Returns:
      A value specified by the provider of a Face interface implementation
        affording custom state and behavior.
    Nr0   r   r   r   r   protocol_context   s    zRpcContext.protocol_contextN)r   r   r   r   abcabstractmethodr2   r3   r5   r6   r7   r   r   r   r   r/      s   



	
r/   c                   @   sH   e Zd ZdZejdd Zejdd Zejdd Zejdd	 Z	d
S )Callz*Invocation-side utility object for an RPC.c                 C   s
   t  dS )aH  Accesses the initial metadata from the service-side of the RPC.

    This method blocks until the value is available or is known not to have been
    emitted from the service-side of the RPC.

    Returns:
      The initial metadata object emitted by the service-side of the RPC, or
        None if there was no such value.
    Nr0   r   r   r   r   r       s    zCall.initial_metadatac                 C   s
   t  dS )aJ  Accesses the terminal metadata from the service-side of the RPC.

    This method blocks until the value is available or is known not to have been
    emitted from the service-side of the RPC.

    Returns:
      The terminal metadata object emitted by the service-side of the RPC, or
        None if there was no such value.
    Nr0   r   r   r   r   r!      s    zCall.terminal_metadatac                 C   s
   t  dS )a6  Accesses the code emitted by the service-side of the RPC.

    This method blocks until the value is available or is known not to have been
    emitted from the service-side of the RPC.

    Returns:
      The code object emitted by the service-side of the RPC, or None if there
        was no such value.
    Nr0   r   r   r   r   r"      s    z	Call.codec                 C   s
   t  dS )aA  Accesses the details value emitted by the service-side of the RPC.

    This method blocks until the value is available or is known not to have been
    emitted from the service-side of the RPC.

    Returns:
      The details value emitted by the service-side of the RPC, or None if there
        was no such value.
    Nr0   r   r   r   r   r#      s    zCall.detailsN)
r   r   r   r   r8   r9   r    r!   r"   r#   r   r   r   r   r:      s   


r:   c                   @   sV   e Zd ZdZejdd Zejdd Zejdd Zejdd	 Z	ejd
d Z
dS )ServicerContextz2A context object passed to method implementations.c                 C   s
   t  dS )aA  Accesses the metadata from the invocation-side of the RPC.

    This method blocks until the value is available or is known not to have been
    emitted from the invocation-side of the RPC.

    Returns:
      The metadata object emitted by the invocation-side of the RPC, or None if
        there was no such value.
    Nr0   r   r   r   r   invocation_metadata   s    z#ServicerContext.invocation_metadatac                 C   s
   t  dS )aP  Accepts the service-side initial metadata value of the RPC.

    This method need not be called by method implementations if they have no
    service-side initial metadata to transmit.

    Args:
      initial_metadata: The service-side initial metadata value of the RPC to
        be transmitted to the invocation side of the RPC.
    Nr0   r   r    r   r   r   r      s    z ServicerContext.initial_metadatac                 C   s
   t  dS )aT  Accepts the service-side terminal metadata value of the RPC.

    This method need not be called by method implementations if they have no
    service-side terminal metadata to transmit.

    Args:
      terminal_metadata: The service-side terminal metadata value of the RPC to
        be transmitted to the invocation side of the RPC.
    Nr0   )r   r!   r   r   r   r!     s    z!ServicerContext.terminal_metadatac                 C   s
   t  dS )zAccepts the service-side code of the RPC.

    This method need not be called by method implementations if they have no
    code to transmit.

    Args:
      code: The code of the RPC to be transmitted to the invocation side of the
        RPC.
    Nr0   )r   r"   r   r   r   r"   "  s    zServicerContext.codec                 C   s
   t  dS )a&  Accepts the service-side details of the RPC.

    This method need not be called by method implementations if they have no
    service-side details to transmit.

    Args:
      details: The service-side details value of the RPC to be transmitted to
        the invocation side of the RPC.
    Nr0   )r   r#   r   r   r   r#   /  s    zServicerContext.detailsN)r   r   r   r   r8   r9   r<   r    r!   r"   r#   r   r   r   r   r;      s   



r;   c                   @   s:   e Zd ZdZejdd Zejdd Zejdd ZdS )	ResponseReceiverz;Invocation-side object used to accept the output of an RPC.c                 C   s
   t  dS )zReceives the initial metadata from the service-side of the RPC.

    Args:
      initial_metadata: The initial metadata object emitted from the
        service-side of the RPC.
    Nr0   r=   r   r   r   r    @  s    z!ResponseReceiver.initial_metadatac                 C   s
   t  dS )zReceives a response from the service-side of the RPC.

    Args:
      response: A response object emitted from the service-side of the RPC.
    Nr0   )r   responser   r   r   r?   J  s    zResponseReceiver.responsec                 C   s
   t  dS )aR  Receives the completion values emitted from the service-side of the RPC.

    Args:
      terminal_metadata: The terminal metadata object emitted from the
        service-side of the RPC.
      code: The code object emitted from the service-side of the RPC.
      details: The details object emitted from the service-side of the RPC.
    Nr0   )r   r!   r"   r#   r   r   r   completeS  s    
zResponseReceiver.completeN)	r   r   r   r   r8   r9   r    r?   r@   r   r   r   r   r>   =  s   
	
r>   c                   @   s@   e Zd ZdZejd
ddZejdddZejddd	ZdS )UnaryUnaryMultiCallablez5Affords invoking a unary-unary RPC in any call style.NFc                 C   s
   t  dS )a  Synchronously invokes the underlying RPC.

    Args:
      request: The request value for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      with_call: Whether or not to include return a Call for the RPC in addition
        to the response.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      The response value for the RPC, and a Call for the RPC if with_call was
        set to True at invocation.

    Raises:
      AbortionError: Indicating that the RPC was aborted.
    Nr0   )r   requesttimeoutmetadata	with_callprotocol_optionsr   r   r   __call__c  s    z UnaryUnaryMultiCallable.__call__c                 C   s
   t  dS )a  Asynchronously invokes the underlying RPC.

    Args:
      request: The request value for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and a future.Future. In the
        event of RPC completion, the return Future's result value will be the
        response value of the RPC. In the event of RPC abortion, the returned
        Future's exception value will be an AbortionError.
    Nr0   r   rB   rC   rD   rF   r   r   r   r     s    zUnaryUnaryMultiCallable.futurec                 C   s
   t  dS )au  Asynchronously invokes the underlying RPC.

    Args:
      request: The request value for the RPC.
      receiver: A ResponseReceiver to be passed the response data of the RPC.
      abortion_callback: A callback to be called and passed an Abortion value
        in the event of RPC abortion.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      A Call for the RPC.
    Nr0   r   rB   receiverr4   rC   rD   rF   r   r   r   event  s    zUnaryUnaryMultiCallable.event)NFN)NN)NN	r   r   r   r   r8   r9   rG   r   rK   r   r   r   r   rA   `  s        rA   c                   @   s0   e Zd ZdZejdddZejdddZdS )	UnaryStreamMultiCallablez6Affords invoking a unary-stream RPC in any call style.Nc                 C   s
   t  dS )aY  Invokes the underlying RPC.

    Args:
      request: The request value for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and an iterator of response
        values. Drawing response values from the returned iterator may raise
        AbortionError indicating abortion of the RPC.
    Nr0   rH   r   r   r   rG     s    z!UnaryStreamMultiCallable.__call__c                 C   s
   t  dS )a|  Asynchronously invokes the underlying RPC.

    Args:
      request: The request value for the RPC.
      receiver: A ResponseReceiver to be passed the response data of the RPC.
      abortion_callback: A callback to be called and passed an Abortion value
        in the event of RPC abortion.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      A Call object for the RPC.
    Nr0   rI   r   r   r   rK     s    zUnaryStreamMultiCallable.event)NN)NNr   r   r   r   r8   r9   rG   rK   r   r   r   r   rM     s     rM   c                   @   s@   e Zd ZdZejd
ddZejdddZejddd	ZdS )StreamUnaryMultiCallablez6Affords invoking a stream-unary RPC in any call style.NFc                 C   s
   t  dS )a  Synchronously invokes the underlying RPC.

    Args:
      request_iterator: An iterator that yields request values for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      with_call: Whether or not to include return a Call for the RPC in addition
        to the response.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      The response value for the RPC, and a Call for the RPC if with_call was
        set to True at invocation.

    Raises:
      AbortionError: Indicating that the RPC was aborted.
    Nr0   )r   request_iteratorrC   rD   rE   rF   r   r   r   rG     s    z!StreamUnaryMultiCallable.__call__c                 C   s
   t  dS )a  Asynchronously invokes the underlying RPC.

    Args:
      request_iterator: An iterator that yields request values for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and a future.Future. In the
        event of RPC completion, the return Future's result value will be the
        response value of the RPC. In the event of RPC abortion, the returned
        Future's exception value will be an AbortionError.
    Nr0   r   rP   rC   rD   rF   r   r   r   r     s    zStreamUnaryMultiCallable.futurec                 C   s
   t  dS a  Asynchronously invokes the underlying RPC.

    Args:
      receiver: A ResponseReceiver to be passed the response data of the RPC.
      abortion_callback: A callback to be called and passed an Abortion value
        in the event of RPC abortion.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      A single object that is both a Call object for the RPC and a
        stream.Consumer to which the request values of the RPC should be passed.
    Nr0   r   rJ   r4   rC   rD   rF   r   r   r   rK     s    zStreamUnaryMultiCallable.event)NFN)NN)NNrL   r   r   r   r   rO     s          rO   c                   @   s0   e Zd ZdZejdddZejdddZdS )	StreamStreamMultiCallablez7Affords invoking a stream-stream RPC in any call style.Nc                 C   s
   t  dS )aw  Invokes the underlying RPC.

    Args:
      request_iterator: An iterator that yields request values for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of
        the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and an iterator of response
        values. Drawing response values from the returned iterator may raise
        AbortionError indicating abortion of the RPC.
    Nr0   rQ   r   r   r   rG   3  s    z"StreamStreamMultiCallable.__call__c                 C   s
   t  dS rR   r0   rS   r   r   r   rK   J  s    zStreamStreamMultiCallable.event)NN)NNrN   r   r   r   r   rT   0  s       rT   c                   @   s   e Zd ZdZdS )MethodImplementationa
  A sum type that describes a method implementation.

  Attributes:
    cardinality: A cardinality.Cardinality value.
    style: A style.Service value.
    unary_unary_inline: The implementation of the method as a callable value
      that takes a request value and a ServicerContext object and returns a
      response value. Only non-None if cardinality is
      cardinality.Cardinality.UNARY_UNARY and style is style.Service.INLINE.
    unary_stream_inline: The implementation of the method as a callable value
      that takes a request value and a ServicerContext object and returns an
      iterator of response values. Only non-None if cardinality is
      cardinality.Cardinality.UNARY_STREAM and style is style.Service.INLINE.
    stream_unary_inline: The implementation of the method as a callable value
      that takes an iterator of request values and a ServicerContext object and
      returns a response value. Only non-None if cardinality is
      cardinality.Cardinality.STREAM_UNARY and style is style.Service.INLINE.
    stream_stream_inline: The implementation of the method as a callable value
      that takes an iterator of request values and a ServicerContext object and
      returns an iterator of response values. Only non-None if cardinality is
      cardinality.Cardinality.STREAM_STREAM and style is style.Service.INLINE.
    unary_unary_event: The implementation of the method as a callable value that
      takes a request value, a response callback to which to pass the response
      value of the RPC, and a ServicerContext. Only non-None if cardinality is
      cardinality.Cardinality.UNARY_UNARY and style is style.Service.EVENT.
    unary_stream_event: The implementation of the method as a callable value
      that takes a request value, a stream.Consumer to which to pass the
      response values of the RPC, and a ServicerContext. Only non-None if
      cardinality is cardinality.Cardinality.UNARY_STREAM and style is
      style.Service.EVENT.
    stream_unary_event: The implementation of the method as a callable value
      that takes a response callback to which to pass the response value of the
      RPC and a ServicerContext and returns a stream.Consumer to which the
      request values of the RPC should be passed. Only non-None if cardinality
      is cardinality.Cardinality.STREAM_UNARY and style is style.Service.EVENT.
    stream_stream_event: The implementation of the method as a callable value
      that takes a stream.Consumer to which to pass the response values of the
      RPC and a ServicerContext and returns a stream.Consumer to which the
      request values of the RPC should be passed. Only non-None if cardinality
      is cardinality.Cardinality.STREAM_STREAM and style is
      style.Service.EVENT.
  Nr(   r   r   r   r   rU   d  s   rU   c                   @   s   e Zd ZdZejdd ZdS )MultiMethodImplementationz,A general type able to service many methods.c                 C   s
   t  dS )a  Services an RPC.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      response_consumer: A stream.Consumer to be called to accept the response
        values of the RPC.
      context: a ServicerContext object.

    Returns:
      A stream.Consumer with which to accept the request values of the RPC. The
        consumer returned from this method may or may not be invoked to
        completion: in the case of RPC abortion, RPC Framework will simply stop
        passing values to this object. Implementations must not assume that this
        object will be called to completion of the request stream or even called
        at all.

    Raises:
      abandonment.Abandoned: May or may not be raised when the RPC has been
        aborted.
      NoSuchMethodError: If this MultiMethod does not recognize the given group
        and name for the RPC and is not able to service the RPC.
    Nr0   )r   r	   r
   Zresponse_consumercontextr   r   r   service  s    z!MultiMethodImplementation.serviceN)r   r   r   r   r8   r9   rX   r   r   r   r   rV     s   rV   c                   @   s   e Zd ZdZejd ddZejd!ddZejd"dd	Zejd#d
dZ	ejd$ddZ
ejd%ddZejd&ddZejd'ddZejd(ddZejd)ddZejdd Zejdd Zejdd Zejdd ZdS )*GenericStubz+Affords RPC invocation via generic methods.NFc                 C   s
   t  dS )a  Invokes a unary-request-unary-response method.

    This method blocks until either returning the response value of the RPC
    (in the event of RPC completion) or raising an exception (in the event of
    RPC abortion).

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request: The request value for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      with_call: Whether or not to include return a Call for the RPC in addition
        to the response.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      The response value for the RPC, and a Call for the RPC if with_call was
        set to True at invocation.

    Raises:
      AbortionError: Indicating that the RPC was aborted.
    Nr0   )r   r	   r
   rB   rC   rD   rE   rF   r   r   r   blocking_unary_unary  s    !z GenericStub.blocking_unary_unaryc                 C   s
   t  dS )a  Invokes a unary-request-unary-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request: The request value for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and a future.Future. In the
        event of RPC completion, the return Future's result value will be the
        response value of the RPC. In the event of RPC abortion, the returned
        Future's exception value will be an AbortionError.
    Nr0   r   r	   r
   rB   rC   rD   rF   r   r   r   future_unary_unary  s    zGenericStub.future_unary_unaryc                 C   s
   t  dS )a  Invokes a unary-request-stream-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request: The request value for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and an iterator of response
        values. Drawing response values from the returned iterator may raise
        AbortionError indicating abortion of the RPC.
    Nr0   r[   r   r   r   inline_unary_stream  s    zGenericStub.inline_unary_streamc                 C   s
   t  dS )a  Invokes a stream-request-unary-response method.

    This method blocks until either returning the response value of the RPC
    (in the event of RPC completion) or raising an exception (in the event of
    RPC abortion).

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request_iterator: An iterator that yields request values for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      with_call: Whether or not to include return a Call for the RPC in addition
        to the response.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      The response value for the RPC, and a Call for the RPC if with_call was
        set to True at invocation.

    Raises:
      AbortionError: Indicating that the RPC was aborted.
    Nr0   )r   r	   r
   rP   rC   rD   rE   rF   r   r   r   blocking_stream_unary  s    !z!GenericStub.blocking_stream_unaryc                 C   s
   t  dS )a5  Invokes a stream-request-unary-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request_iterator: An iterator that yields request values for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and a future.Future. In the
        event of RPC completion, the return Future's result value will be the
        response value of the RPC. In the event of RPC abortion, the returned
        Future's exception value will be an AbortionError.
    Nr0   r   r	   r
   rP   rC   rD   rF   r   r   r   future_stream_unary.  s    zGenericStub.future_stream_unaryc                 C   s
   t  dS )a  Invokes a stream-request-stream-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request_iterator: An iterator that yields request values for the RPC.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      An object that is both a Call for the RPC and an iterator of response
        values. Drawing response values from the returned iterator may raise
        AbortionError indicating abortion of the RPC.
    Nr0   r_   r   r   r   inline_stream_streamI  s    z GenericStub.inline_stream_streamc	           	      C   s
   t  dS )a  Event-driven invocation of a unary-request-unary-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request: The request value for the RPC.
      receiver: A ResponseReceiver to be passed the response data of the RPC.
      abortion_callback: A callback to be called and passed an Abortion value
        in the event of RPC abortion.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      A Call for the RPC.
    Nr0   	r   r	   r
   rB   rJ   r4   rC   rD   rF   r   r   r   event_unary_unaryc  s    zGenericStub.event_unary_unaryc	           	      C   s
   t  dS )a  Event-driven invocation of a unary-request-stream-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      request: The request value for the RPC.
      receiver: A ResponseReceiver to be passed the response data of the RPC.
      abortion_callback: A callback to be called and passed an Abortion value
        in the event of RPC abortion.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      A Call for the RPC.
    Nr0   rb   r   r   r   event_unary_stream  s    zGenericStub.event_unary_streamc                 C   s
   t  dS )a  Event-driven invocation of a unary-request-unary-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      receiver: A ResponseReceiver to be passed the response data of the RPC.
      abortion_callback: A callback to be called and passed an Abortion value
        in the event of RPC abortion.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      A pair of a Call object for the RPC and a stream.Consumer to which the
        request values of the RPC should be passed.
    Nr0   r   r	   r
   rJ   r4   rC   rD   rF   r   r   r   event_stream_unary  s    zGenericStub.event_stream_unaryc                 C   s
   t  dS )a  Event-driven invocation of a unary-request-stream-response method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.
      receiver: A ResponseReceiver to be passed the response data of the RPC.
      abortion_callback: A callback to be called and passed an Abortion value
        in the event of RPC abortion.
      timeout: A duration of time in seconds to allow for the RPC.
      metadata: A metadata value to be passed to the service-side of the RPC.
      protocol_options: A value specified by the provider of a Face interface
        implementation affording custom state and behavior.

    Returns:
      A pair of a Call object for the RPC and a stream.Consumer to which the
        request values of the RPC should be passed.
    Nr0   re   r   r   r   event_stream_stream  s    zGenericStub.event_stream_streamc                 C   s
   t  dS )zCreates a UnaryUnaryMultiCallable for a unary-unary method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.

    Returns:
      A UnaryUnaryMultiCallable value for the named unary-unary method.
    Nr0   r   r   r   r   unary_unary  s    zGenericStub.unary_unaryc                 C   s
   t  dS )a  Creates a UnaryStreamMultiCallable for a unary-stream method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.

    Returns:
      A UnaryStreamMultiCallable value for the name unary-stream method.
    Nr0   r   r   r   r   unary_stream  s    zGenericStub.unary_streamc                 C   s
   t  dS )a  Creates a StreamUnaryMultiCallable for a stream-unary method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.

    Returns:
      A StreamUnaryMultiCallable value for the named stream-unary method.
    Nr0   r   r   r   r   stream_unary  s    zGenericStub.stream_unaryc                 C   s
   t  dS )a  Creates a StreamStreamMultiCallable for a stream-stream method.

    Args:
      group: The group identifier of the RPC.
      method: The method identifier of the RPC.

    Returns:
      A StreamStreamMultiCallable value for the named stream-stream method.
    Nr0   r   r   r   r   stream_stream  s    zGenericStub.stream_stream)NFN)NN)NN)NFN)NN)NN)NN)NN)NN)NN)r   r   r   r   r8   r9   rZ   r\   r]   r^   r`   ra   rc   rd   rf   rg   rh   ri   rj   rk   r   r   r   r   rY     sf      "       "            


rY   c                   @   s   e Zd ZdZdS )DynamicStubav  Affords RPC invocation via attributes corresponding to afforded methods.

  Instances of this type may be scoped to a single group so that attribute
  access is unambiguous.

  Instances of this type respond to attribute access as follows: if the
  requested attribute is the name of a unary-unary method, the value of the
  attribute will be a UnaryUnaryMultiCallable with which to invoke an RPC; if
  the requested attribute is the name of a unary-stream method, the value of the
  attribute will be a UnaryStreamMultiCallable with which to invoke an RPC; if
  the requested attribute is the name of a stream-unary method, the value of the
  attribute will be a StreamUnaryMultiCallable with which to invoke an RPC; and
  if the requested attribute is the name of a stream-stream method, the value of
  the attribute will be a StreamStreamMultiCallable with which to invoke an RPC.
  Nr(   r   r   r   r   rl   
  s   rl   )$r   r8   collectionsr   Zgrpc.framework.commonr   r   Zgrpc.framework.foundationr   r   	Exceptionr   
namedtupler   ABCMetar$   r'   r)   r*   r+   r,   r-   r.   ABCr/   r:   r;   r>   rA   rM   rO   rT   rU   rV   rY   rl   r   r   r   r   <module>   sB   

#08E#N1Q4-  \