o
    >h%                     @   s   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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dS ))PublicationSubscriptionHandlerRegistrationEndpointPublishRequestSubscribeRequestUnsubscribeRequestCallRequestInvocationRequestRegisterRequestUnregisterRequestc                   @   s$   e Zd ZdZdZdd Zdd ZdS )r   zw
    Object representing a publication (feedback from publishing an event when doing
    an acknowledged publish).
    idwas_encryptedc                 C      || _ || _dS )z

        :param publication_id: The publication ID of the published event.
        :type publication_id: int

        :param was_encrypted: Flag indicating whether the app payload was encrypted.
        :type was_encrypted: bool
        Nr   )selfpublication_idr    r   u/var/www/vedio/testing/chatpythonscript.ninositsolution.com/env/lib/python3.10/site-packages/autobahn/wamp/request.py__init__4      	
zPublication.__init__c                 C      d | j| jS )Nz&Publication(id={0}, was_encrypted={1}))formatr   r   r   r   r   r   __str__@      zPublication.__str__N)__name__
__module____qualname____doc__	__slots__r   r   r   r   r   r   r   ,   s
    r   c                   @   ,   e Zd ZdZdZdd Zdd Zdd Zd	S )
r   z5
    Object representing a handler subscription.
    r   topicactivesessionhandlerc                 C   s"   || _ || _d| _|| _|| _dS )a  

        :param subscription_id: The subscription ID.
        :type subscription_id: int

        :param topic: The subscription URI or URI pattern.
        :type topic: str

        :param session: The ApplicationSession this subscription is living on.
        :type session: instance of ApplicationSession

        :param handler: The user event callback.
        :type handler: callable
        TNr"   )r   subscription_idr#   r%   r&   r   r   r   r   K   
   
zSubscription.__init__c                 C      | j r	| j| S td)z0
        Unsubscribe this subscription.
        zsubscription no longer active)r$   r%   _unsubscribe	Exceptionr   r   r   r   unsubscribe`   s   zSubscription.unsubscribec                 C   r   )Nz#Subscription(id={0}, is_active={1}))r   r   r$   r   r   r   r   r   i   r   zSubscription.__str__N)r   r   r   r   r    r   r,   r   r   r   r   r   r   D   s    	r   c                   @      e Zd ZdZdZdddZdS )r   zJ
    Object representing an event handler attached to a subscription.
    fnobjdetails_argNc                 C      || _ || _|| _dS )aS  

        :param fn: The event handler function to be called.
        :type fn: callable

        :param obj: The (optional) object upon which to call the function.
        :type obj: obj or None

        :param details_arg: The keyword argument under which event details should be provided.
        :type details_arg: str or None
        Nr.   r   r/   r0   r1   r   r   r   r   t      
zHandler.__init__NNr   r   r   r   r    r   r   r   r   r   r   m       r   c                   @   r!   )
r   z-
    Object representing a registration.
    r   r$   r%   	procedureendpointc                 C   s"   || _ d| _|| _|| _|| _dS )a]  

        :param id: The registration ID.
        :type id: int

        :param active: Flag indicating whether this registration is active.
        :type active: bool

        :param procedure: The procedure URI or URI pattern.
        :type procedure: callable

        :param endpoint: The user callback.
        :type endpoint: callable
        TNr8   )r   r%   registration_idr9   r:   r   r   r   r      r(   zRegistration.__init__c                 C   r)   )	
        zregistration no longer active)r$   r%   _unregisterr+   r   r   r   r   
unregister   s   zRegistration.unregisterc                 C   s   d | j| j| jS )Nz4Registration(id={0}, is_active={1}, procedure="{2}"))r   r   r$   r9   r   r   r   r   r      s   zRegistration.__str__N)r   r   r   r   r    r   r>   r   r   r   r   r   r      s    r   c                   @   r-   )r   zO
    Object representing an procedure endpoint attached to a registration.
    r.   Nc                 C   r2   )aN  

        :param fn: The endpoint procedure to be called.
        :type fn: callable

        :param obj: The (optional) object upon which to call the function.
        :type obj: obj or None

        :param details_arg: The keyword argument under which call details should be provided.
        :type details_arg: str or None
        Nr.   r3   r   r   r   r      r4   zEndpoint.__init__r5   r6   r   r   r   r   r      r7   r   c                   @      e Zd ZdZdZdd ZdS )Requestz
    Object representing an outstanding request, such as for subscribe/unsubscribe,
    register/unregister or call/publish.
    
request_idon_replyc                 C   r   )z

        :param request_id: The WAMP request ID.
        :type request_id: int

        :param on_reply: The Deferred/Future to be fired when the request returns.
        :type on_reply: Deferred/Future
        NrA   )r   rB   rC   r   r   r   r      r   zRequest.__init__Nr6   r   r   r   r   r@      s    r@   c                   @   r?   )r   zX
    Object representing an outstanding request to publish (acknowledged) an event.
    r   c                 C      t | || || _dS )aL  

        :param request_id: The WAMP request ID.
        :type request_id: int

        :param on_reply: The Deferred/Future to be fired when the request returns.
        :type on_reply: Deferred/Future

        :param was_encrypted: Flag indicating whether the app payload was encrypted.
        :type was_encrypted: bool
        N)r@   r   r   )r   rB   rC   r   r   r   r   r      s   
zPublishRequest.__init__Nr6   r   r   r   r   r          r   c                   @   r?   )r   zM
    Object representing an outstanding request to subscribe to a topic.
    )r&   r#   c                 C      t | || || _|| _dS )a  

        :param request_id: The WAMP request ID.
        :type request_id: int

        :param topic: The topic URI being subscribed to.
        :type topic: unicode

        :param on_reply: The Deferred/Future to be fired when the request returns.
        :type on_reply: Deferred/Future

        :param handler: WAMP call options that are in use for this call.
        :type handler: callable
        N)r@   r   r#   r&   )r   rB   r#   rC   r&   r   r   r   r      s   
zSubscribeRequest.__init__Nr6   r   r   r   r   r      rE   r   c                   @   r?   )r   zS
    Object representing an outstanding request to unsubscribe a subscription.
    )r'   c                 C   rD   r<   N)r@   r   r'   )r   rB   rC   r'   r   r   r   r        
zUnsubscribeRequest.__init__Nr6   r   r   r   r   r     rE   r   c                   @   r?   )r	   zI
    Object representing an outstanding request to call a procedure.
    )r9   optionsc                 C   rF   )a:  

        :param request_id: The WAMP request ID.
        :type request_id: int

        :param on_reply: The Deferred/Future to be fired when the request returns.
        :type on_reply: Deferred/Future

        :param options: WAMP call options that are in use for this call.
        :type options: dict
        N)r@   r   r9   rI   )r   rB   r9   rC   rI   r   r   r   r   !  s   
zCallRequest.__init__Nr6   r   r   r   r   r	     rE   r	   c                   @   s   e Zd ZdZdS )r
   zK
    Object representing an outstanding request to invoke an endpoint.
    N)r   r   r   r   r   r   r   r   r
   2  s    r
   c                   @   r?   )r   zM
    Object representing an outstanding request to register a procedure.
    )r9   r:   c                 C   s   t | || || _|| _dS rG   )r@   r   r9   r:   )r   rB   rC   r9   r:   r   r   r   r   ?  s   
zRegisterRequest.__init__Nr6   r   r   r   r   r   8  rE   r   c                   @   r?   )r   zR
    Object representing an outstanding request to unregister a registration.
    )r;   c                 C   rD   rG   )r@   r   r;   )r   rB   rC   r;   r   r   r   r   N  rH   zUnregisterRequest.__init__Nr6   r   r   r   r   r   G  rE   r   N)__all__objectr   r   r   r   r   r@   r   r   r   r	   r
   r   r   r   r   r   r   <module>   s   )(