
    i0                         d dl mZmZmZ ddlmZ ddlm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dS )    )CallableOptionalUnion   )BaseMetaClass
connectionc                      e Zd Zd Zed             Zedefd            Zedd            Z	ede
fd            Zedefd            Zedefd	            Zedefd
            Zede
fd            Zede
fd            Zede
fd            Zede
fd            Zede
fd            Z	 ddedeeeef                  de
fdZede
fd            ZdS )Subscriptionc                     d| j         dS )Nz<oracledb.Subscription on >r   selfs    _/var/www/html/Pagina-Ingenieria-Requisitos/venv/lib/python3.11/site-packages/oracledb/subscr.py__repr__zSubscription.__repr__'   s    @DO@@@@    c                 >    |                      |           }||_        |S N)__new___impl)clsimplsubscrs      r   
_from_implzSubscription._from_impl*   s    S!!r   returnc                     | j         j        S )z~
        This read-only attribute returns the callback that was registered when
        the subscription was created.
        )r   callbackr   s    r   r   zSubscription.callback0        z""r   connection.Connectionc                     | j         j        S )z
        This read-only attribute returns the connection that was used to
        register the subscription when it was created.
        )r   r	   r   s    r   r	   zSubscription.connection8   s     z$$r   c                     | j         j        S )a  
        This read-only attribute returns the value of REGID found in the
        database view USER_CHANGE_NOTIFICATION_REGS or the value of REG_ID
        found in the database view USER_SUBSCR_REGISTRATIONS. For AQ
        subscriptions, this value is *0*.
        )r   idr   s    r   r"   zSubscription.id@   s     z}r   c                     | j         j        S )z
        This read-only attribute returns the IP address used for callback
        notifications from the database server. If not set during construction,
        this value is *None*.
        )r   
ip_addressr   s    r   r$   zSubscription.ip_addressJ        z$$r   c                     | j         S )z>
        Deprecated. Use property ip_address instead.
        )r$   r   s    r   	ipAddresszSubscription.ipAddressS       
 r   c                     | j         j        S )zz
        This read-only attribute returns the name used to register the
        subscription when it was created.
        )r   namer   s    r   r*   zSubscription.nameZ   s     zr   c                     | j         j        S )z
        This read-only attribute returns the namespace used to register the
        subscription when it was created.
        )r   	namespacer   s    r   r,   zSubscription.namespaceb   s     z##r   c                     | j         j        S )z
        This read-only attribute returns the operations that will send
        notifications for each table or query that is registered using this
        subscription.
        )r   
operationsr   s    r   r.   zSubscription.operationsj   r%   r   c                     | j         j        S )z
        This read-only attribute returns the port used for callback
        notifications from the database server. If not set during
        construction, this value is *0*.
        )r   portr   s    r   r0   zSubscription.ports   s     zr   c                     | j         j        S )z~
        This read-only attribute returns the protocol used to register the
        subscription when it was created.
        )r   protocolr   s    r   r2   zSubscription.protocol|   r   r   c                     | j         j        S )z
        This read-only attribute returns the quality of service flags used to
        register the subscription when it was created.
        )r   qosr   s    r   r4   zSubscription.qos   s     z~r   N	statementargsc                     |+t          |t          t          f          st          d          | j                            ||          S )a	  
        Registers the query for subsequent notification when tables referenced
        by the query are changed. This behaves similarly to
        :meth:`Cursor.execute()` but only queries are permitted and the
        ``args`` parameter, if specified, must be a sequence or dictionary. If
        the ``qos`` parameter included the flag
        :data:`oracledb.SUBSCR_QOS_QUERY` when the subscription was created,
        then the ID for the registered query is returned; otherwise, *None* is
        returned.
        Nz)expecting args to be a dictionary or list)
isinstancelistdict	TypeErrorr   register_query)r   r5   r6   s      r   registerqueryzSubscription.registerquery   sD     JtdD\$B$BGHHHz((D999r   c                     | j         j        S )z
        This read-only attribute returns the timeout (in seconds) that was
        specified when the subscription was created. A value of *0* indicates
        that there is no timeout.
        )r   timeoutr   s    r   r?   zSubscription.timeout   s     z!!r   )r   r   r   )__name__
__module____qualname__r   classmethodr   propertyr   r   r	   intr"   strr$   r'   r*   r,   r.   r0   r2   r4   r   r   r9   r:   r=   r?    r   r   r   r   &   sT       A A A   [
 #( # # # X# % % % X% C    X %C % % % X% 3    X c    X $3 $ $ $ X$ %C % % % X% c    X ## # # # X# S    X CG: ::$,U4:->$?:	: : : :" " " " " X" " "r   r   )	metaclassc                      e Zd ZdeddfdZedeedf         fd            Zedeedf         fd            Z	edeedf         fd            Z
edeedf         fd            Zeded	         fd
            Zedeedf         fd            Zedeedf         fd            Zedefd            Zedefd            Zeded         fd            Zedeedf         fd            Zedefd            ZdS )Messagesubscriptionr   Nc                     || _         d | _        d | _        g | _        d | _        d| _        g | _        d | _        d| _        d | _	        d S )NFr   )
_subscription_consumer_name_dbname_queries_queue_name_registered_tables_txid_type_msgid)r   rK   s     r   __init__zMessage.__init__   sP    )" 

r   c                     | j         S )a&  
        This read-only attribute returns the name of the consumer which
        generated the notification. It will be populated if the
        subscription was created with the namespace
        :data:`oracledb.SUBSCR_NAMESPACE_AQ` and the queue is a multiple
        consumer queue.
        )rN   r   s    r   consumer_namezMessage.consumer_name   s     ""r   c                     | j         S )zA
        Deprecated. Use property consumer_name instead.
        )rY   r   s    r   consumerNamezMessage.consumerName   s    
 !!r   c                     | j         S )zt
        This read-only attribute returns the name of the database that
        generated the notification.
        )rO   r   s    r   dbnamezMessage.dbname   s     |r   c                     | j         S )z
        This read-only attribute returns the message id of the AQ message that
        generated the notification. It will only be populated if the
        subscription was created with the namespace
        :data:`oracledb.SUBSCR_NAMESPACE_AQ`.
        )rV   r   s    r   msgidzMessage.msgid   s     {r   MessageQueryc                     | j         S )a\  
        This read-only attribute returns a list of message query objects that
        give information about query result sets changed for this notification.
        This attribute will be an empty list if the ``qos`` parameter did not
        include the flag :data:`~oracledb.SUBSCR_QOS_QUERY` when the
        subscription was created.
        )rP   r   s    r   querieszMessage.queries   s     }r   c                     | j         S )z
        This read-only attribute returns the name of the queue which generated
        the notification. It will only be populated if the subscription was
        created with the namespace :data:`oracledb.SUBSCR_NAMESPACE_AQ`.
        )rQ   r   s    r   
queue_namezMessage.queue_name   s     r   c                     | j         S )z>
        Deprecated. Use property queue_name instead.
        )rd   r   s    r   	queueNamezMessage.queueName   r(   r   c                     | j         S )a  
        This read-only attribute returns whether the subscription which
        generated this notification is still registered with the database. The
        subscription is automatically deregistered with the database when the
        subscription timeout value is reached or when the first notification is
        sent (when the quality of service flag
        :data:`oracledb.SUBSCR_QOS_DEREG_NFY` is used).
        )rR   r   s    r   
registeredzMessage.registered   s     r   c                     | j         S )z}
        This read-only attribute returns the subscription object for which this
        notification was generated.
        )rM   r   s    r   rK   zMessage.subscription   s     !!r   MessageTablec                     | j         S )aN  
        This read-only attribute returns a list of message table objects that
        give information about the tables changed for this notification. This
        attribute will be an empty list if the ``qos`` parameter included the
        flag :data:`~oracledb.SUBSCR_QOS_QUERY` when the subscription was
        created.
        rS   r   s    r   tableszMessage.tables  s     |r   c                     | j         S )zu
        This read-only attribute returns the id of the transaction that
        generated the notification.
        )rT   r   s    r   txidzMessage.txid       zr   c                     | j         S )zb
        This read-only attribute returns the type of message that has been
        sent.
        )rU   r   s    r   typezMessage.type  rp   r   )r@   rA   rB   r   rW   rD   r   rF   rY   r[   r]   bytesr_   r9   rb   rd   rf   boolrh   rK   rm   ro   rE   rr   rG   r   r   rJ   rJ      sS       
\ 
d 
 
 
 
 #uS$Y/ # # # X# "eCI. " " " X" c4i(    X uUD[)    X n-    X  E#t),       X  5d+    X 	 D 	  	  	  X	  "l " " " X" ^,    X eE4K(    X c    X  r   rJ   c                   v    e Zd ZddZedefd            Zedefd            Zeded         fd            Z	dS )	r`   r   Nc                 0    d| _         d| _        g | _        d S Nr   )_id
_operationrS   r   s    r   rW   zMessageQuery.__init__$  s    r   c                     | j         S )z
        This read-only attribute returns the query id of the query for which
        the result set changed. The value will match the value returned by
        :meth:`Subscription.registerquery()` when the related query was
        registered.
        )rx   r   s    r   r"   zMessageQuery.id)  s     xr   c                     | j         S )z
        This read-only attribute returns the operation that took place on the
        query result set that was changed. Valid values for this attribute are
        :data:`~oracledb.EVENT_DEREG` and :data:`~oracledb.EVENT_QUERYCHANGE`.
        ry   r   s    r   	operationzMessageQuery.operation3  s     r   rj   c                     | j         S )z
        This read-only attribute returns a list of message table objects that
        give information about the table changes that caused the query result
        set to change for this notification.
        rl   r   s    r   rm   zMessageQuery.tables<  s     |r   r   N)
r@   rA   rB   rW   rD   rE   r"   r}   r9   rm   rG   r   r   r`   r`   #  s           
 C    X 3    X ^,    X  r   r`   c                   ^    e Zd ZddZedefd            Zedeedf         fd            Z	dS )
MessageRowr   Nc                 "    d| _         d | _        d S rw   )ry   _rowidr   s    r   rW   zMessageRow.__init__G  s    r   c                     | j         S )zu
        This read-only attribute returns the operation that took place on the
        row that was changed.
        r|   r   s    r   r}   zMessageRow.operationK       r   c                     | j         S )zY
        This read-only attribute returns the rowid of the row that was changed.
        )r   r   s    r   rowidzMessageRow.rowidS  s    
 {r   r   )
r@   rA   rB   rW   rD   rE   r}   r   rF   r   rG   r   r   r   r   F  s            3    X uS$Y'    X  r   r   c                       e Zd ZddZedeedf         fd            Zedefd            Z	ede
d         fd            ZdS )	rj   r   Nc                 0    d | _         d| _        g | _        d S rw   )_namery   _rowsr   s    r   rW   zMessageTable.__init__\  s    



r   c                     | j         S )zb
        This read-only attribute returns the name of the table that was
        changed.
        )r   r   s    r   r*   zMessageTable.namea  rp   r   c                     | j         S )zw
        This read-only attribute returns the operation that took place on the
        table that was changed.
        r|   r   s    r   r}   zMessageTable.operationi  r   r   r   c                     | j         S )aE  
        This read-only attribute returns a list of message row objects that
        give information about the rows changed on the table. This value is
        only filled in if the ``qos`` parameter to the
        :meth:`Connection.subscribe()` method included the flag
        :data:`~oracledb.SUBSCR_QOS_ROWIDS`.
        )r   r   s    r   rowszMessageTable.rowsq  s     zr   r   )r@   rA   rB   rW   rD   r   rF   r*   rE   r}   r9   r   rG   r   r   rj   rj   [  s           
 eCI&    X 3    X d<(    X  r   rj   N)typingr   r   r   baser    r	   r   rJ   r`   r   rj   rG   r   r   <module>r      sT  B - , , , , , , , , ,            ~" ~" ~" ~" ~"] ~" ~" ~" ~"By y y y y y y y yx         ]        F    =    *    ]      r   