
    8'hW%                     2   d dl mZ dZ G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z G d de      Z	 G d de	      Z
 G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d de	      Z G d de	      Zy)    )absolute_import)PublicationSubscriptionHandlerRegistrationEndpointPublishRequestSubscribeRequestUnsubscribeRequestCallRequestInvocationRequestRegisterRequestUnregisterRequestc                        e Zd ZdZdZd Zd Zy)r   zw
    Object representing a publication (feedback from publishing an event when doing
    an acknowledged publish).
    idwas_encryptedc                      || _         || _        y)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   s      Q/var/www/html/trade_iq/venv/lib/python3.12/site-packages/autobahn/wamp/request.py__init__zPublication.__init__6   s     !*    c                 N    dj                  | j                  | j                        S )Nz&Publication(id={0}, was_encrypted={1}))formatr   r   r   s    r   __str__zPublication.__str__B   s    7>>twwHZHZ[[r   N)__name__
__module____qualname____doc__	__slots__r   r    r   r   r   r   .   s    
 (I
+\r   r   c                   &    e Zd ZdZdZd Zd Zd Zy)r   z5
    Object representing a handler subscription.
    r   topicactivesessionhandlerc                 J    || _         || _        d| _        || _        || _        y)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)   s        r   r   zSubscription.__init__M   s'     "
r   c                 f    | j                   r| j                  j                  |       S t        d      )z0
        Unsubscribe this subscription.
        zsubscription no longer active)r'   r(   _unsubscribe	Exceptionr   s    r   unsubscribezSubscription.unsubscribeb   s,     ;;<<,,T22;<<r   c                 N    dj                  | j                  | j                        S )Nz#Subscription(id={0}, is_active={1}))r   r   r'   r   s    r   r   zSubscription.__str__k   s    4;;DGGT[[QQr   N)r   r   r    r!   r"   r   r/   r   r#   r   r   r   r   F   s     @I*=Rr   r   c                       e Zd ZdZdZddZy)r   zJ
    Object representing an event handler attached to a subscription.
    fnobjdetails_argNc                 .    || _         || _        || _        y)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
        Nr2   r   r3   r4   r5   s       r   r   zHandler.__init__v        &r   NNr   r   r    r!   r"   r   r#   r   r   r   r   o        -I'r   r   c                        e Zd ZdZdZd Zd Zy)r   z-
    Object representing a registration.
    r   r'   r(   	procedureendpointc                 J    || _         d| _        || _        || _        || _        y)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
        TNr=   )r   r(   registration_idr>   r?   s        r   r   zRegistration.__init__   s'     "" r   c                 f    | j                   r| j                  j                  |       S t        d      )	
        zregistration no longer active)r'   r(   _unregisterr.   r   s    r   
unregisterzRegistration.unregister   s,     ;;<<++D11;<<r   N)r   r   r    r!   r"   r   rE   r#   r   r   r   r      s     EI!*=r   r   c                       e Zd ZdZdZddZy)r   zO
    Object representing an procedure endpoint attached to a registration.
    r2   Nc                 .    || _         || _        || _        y)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
        Nr2   r7   s       r   r   zEndpoint.__init__   r8   r   r9   r:   r#   r   r   r   r      r;   r   r   c                       e Zd ZdZdZd Zy)Requestz
    Object representing an outstanding request, such as for subscribe/unsubscribe,
    register/unregister or call/publish.
    
request_idon_replyc                      || _         || _        y)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
        NrJ   )r   rK   rL   s      r   r   zRequest.__init__   s     % r   Nr:   r#   r   r   rI   rI      s    
 +I
!r   rI   c                       e Zd ZdZdZd Zy)r	   zX
    Object representing an outstanding request to publish (acknowledged) an event.
    r   c                 @    t         j                  | ||       || _        y)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)rI   r   r   )r   rK   rL   r   s       r   r   zPublishRequest.__init__   s     	z84*r   Nr:   r#   r   r   r	   r	      s     !I+r   r	   c                       e Zd ZdZdZd Zy)r
   zM
    Object representing an outstanding request to subscribe to a topic.
    )r)   r&   c                 N    t         j                  | ||       || _        || _        y)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)rI   r   r&   r)   )r   rK   r&   rL   r)   s        r   r   zSubscribeRequest.__init__   s$     	z84
r   Nr:   r#   r   r   r
   r
      s     %Ir   r
   c                       e Zd ZdZdZd Zy)r   zS
    Object representing an outstanding request to unsubscribe a subscription.
    )r+   c                 @    t         j                  | ||       || _        yrC   N)rI   r   r+   )r   rK   rL   r+   s       r   r   zUnsubscribeRequest.__init__       	z84.r   Nr:   r#   r   r   r   r          %I/r   r   c                       e Zd ZdZdZd Zy)r   zI
    Object representing an outstanding request to call a procedure.
    )r>   optionsc                 N    t         j                  | ||       || _        || _        y)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)rI   r   r>   rX   )r   rK   r>   rL   rX   s        r   r   zCallRequest.__init__   s$     	z84"r   Nr:   r#   r   r   r   r     s     *Ir   r   c                       e Zd ZdZy)r   zK
    Object representing an outstanding request to invoke an endpoint.
    N)r   r   r    r!   r#   r   r   r   r   1  s    r   r   c                       e Zd ZdZdZd Zy)r   zM
    Object representing an outstanding request to register a procedure.
    )r>   r?   c                 N    t         j                  | ||       || _        || _        yrT   )rI   r   r>   r?   )r   rK   rL   r>   r?   s        r   r   zRegisterRequest.__init__>  s$     	z84" r   Nr:   r#   r   r   r   r   7  s     +I!r   r   c                       e Zd ZdZdZd Zy)r   zR
    Object representing an outstanding request to unregister a registration.
    )rA   c                 @    t         j                  | ||       || _        yrT   )rI   r   rA   )r   rK   rL   rA   s       r   r   zUnregisterRequest.__init__M  rU   r   Nr:   r#   r   r   r   r   F  rV   r   r   N)
__future__r   __all__objectr   r   r   r   r   rI   r	   r
   r   r   r   r   r   r#   r   r   <module>rb      s   8 ' \& \0&R6 &RR'f '0"=6 "=J'v '0!f !*+W +.w 6/ /' 0 !g !/ /r   