o
    i                     @  s  d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
mZmZmZ d dlmZmZ eddG d	d
 d
eZeddG dd deZeddG dd deZeddG dd deZeddG dd deZeddG dd de
e ZeddG dd dZdS )    )annotations)ABC)	dataclassfield)	timedelta)GenericMappingOptionalSequence)LinkOutputTT)frozenc                      s>   e Zd ZU dZ fddZded< 	 ded< 	 ded<   ZS )	OperationContextzhContext for the execution of the requested operation method.

    Includes information from the request.c                   s   | t u rtdt | S )NzIOperationContext is an abstract class and cannot be instantiated directly)r   	TypeErrorsuper__new__)clsargskwargs	__class__ ^/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/nexusrpc/handler/_common.pyr      s
   zOperationContext.__new__strservice	operationMapping[str, str]headers)__name__
__module____qualname____doc__r   __annotations____classcell__r   r   r   r   r      s   
 r   c                   @  sd   e Zd ZU dZded< 	 dZded< 	 eedZded	< 	 ee	dZ
d
ed< 	 ee	dZded< dS )StartOperationContextzIContext for the start method.

    Includes information from the request.r   
request_idNzOptional[str]callback_url)default_factoryr   callback_headerszSequence[Link]inbound_linksz
list[Link]outbound_links)r   r   r    r!   r"   r&   r   dictr(   listr)   r*   r   r   r   r   r$   -   s   
 r$   c                   @     e Zd ZdZdS )CancelOperationContextzJContext for the cancel method.

    Includes information from the request.Nr   r   r    r!   r   r   r   r   r.   T       r.   c                   @  r-   )FetchOperationInfoContextzNContext for the fetch_info method.

    Includes information from the request.Nr/   r   r   r   r   r1   [   r0   r1   c                   @  s   e Zd ZU dZdZded< dS )FetchOperationResultContextzPContext for the fetch_result method.

    Includes information from the request.NzOptional[timedelta]wait)r   r   r    r!   r3   r"   r   r   r   r   r2   b   s   
 r2   c                   @     e Zd ZU dZded< dS )StartOperationResultSyncz[
    A result returned synchronously by the start method of a nexus operation handler.
    r   valueNr   r   r    r!   r"   r   r   r   r   r5   p   s   
 r5   c                   @  r4   )StartOperationResultAsyncz
    A value returned by the start method of a nexus operation handler indicating that
    the operation is responding asynchronously.
    r   tokenNr7   r   r   r   r   r8   |   s   
 r8   N)
__future__r   abcr   dataclassesr   r   datetimer   typingr   r   r	   r
   nexusrpc._commonr   r   r   r$   r.   r1   r2   r5   r8   r   r   r   r   <module>   s(    &