
    h%                     &   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))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/Befach/backend/env/lib/python3.12/site-packages/autobahn/wamp/request.py__init__zPublication.__init__4   s     !*    c                 N    dj                  | j                  | j                        S )Nz&Publication(id={0}, was_encrypted={1}))formatr   r   r   s    r   __str__zPublication.__str__@   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__K   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.unsubscribe`   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__i   s    4;;DGGT[[QQr   N)r   r   r   r   r    r   r-   r   r!   r   r   r   r   D   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
        Nr0   r   r1   r2   r3   s       r   r   zHandler.__init__t        &r   NNr   r   r   r   r    r   r!   r   r   r   r   m        -I'r   r   c                   &    e Zd 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   c                 d    dj                  | j                  | j                  | j                        S )Nz4Registration(id={0}, is_active={1}, procedure="{2}"))r   r   r%   r<   r   s    r   r   zRegistration.__str__   s)    ELLTWWVZVaVacgcqcqrrr   N)r   r   r   r   r    r   rC   r   r!   r   r   r   r      s     EI!*=s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.
    r0   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
        Nr0   r5   s       r   r   zEndpoint.__init__   r6   r   r7   r8   r!   r   r   r   r      r9   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
        NrI   )r   rJ   rK   s      r   r   zRequest.__init__   s     % r   Nr8   r!   r   r   rH   rH      s    
 +I
!r   rH   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)rH   r   r   )r   rJ   rK   r   s       r   r   zPublishRequest.__init__   s     	z84*r   Nr8   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)rH   r   r$   r'   )r   rJ   r$   rK   r'   s        r   r   zSubscribeRequest.__init__   s$     	z84
r   Nr8   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rA   N)rH   r   r)   )r   rJ   rK   r)   s       r   r   zUnsubscribeRequest.__init__       	z84.r   Nr8   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)rH   r   r<   rW   )r   rJ   r<   rK   rW   s        r   r   zCallRequest.__init__!  s$     	z84"r   Nr8   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   2  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rS   )rH   r   r<   r=   )r   rJ   rK   r<   r=   s        r   r   zRegisterRequest.__init__?  s$     	z84" r   Nr8   r!   r   r   r   r   8  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.
    )r?   c                 @    t         j                  | ||       || _        yrS   )rH   r   r?   )r   rJ   rK   r?   s       r   r   zUnregisterRequest.__init__N  rT   r   Nr8   r!   r   r   r   r   G  rU   r   r   N)__all__objectr   r   r   r   r   rH   r   r   r	   r
   r   r   r   r!   r   r   <module>r`      s   8 \& \0&R6 &RR'f '0%s6 %sP'v '0!f !*+W +.w 6/ /' 0 !g !/ /r   