
    	h                     @    d Z  G d de          Z G d d          ZdS )a  
*******************************************************************
  Copyright (c) 2017, 2019 IBM Corp.

  All rights reserved. This program and the accompanying materials
  are made available under the terms of the Eclipse Public License v2.0
  and Eclipse Distribution License v1.0 which accompany this distribution.

  The Eclipse Public License is available at
     http://www.eclipse.org/legal/epl-v20.html
  and the Eclipse Distribution License is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

  Contributors:
     Ian Craggs - initial implementation and/or documentation
*******************************************************************
c                       e Zd ZdS )MQTTExceptionN)__name__
__module____qualname__     g/var/www/html/web-builder-api.evdpl.com/venv/lib/python3.11/site-packages/paho/mqtt/subscribeoptions.pyr   r      s        Dr   r   c            	       x    e Zd ZdZ edd          \  ZZZdddefdede	de	defd	Z
d
 Zd Zd Zd Zd Zd ZdS )SubscribeOptionsaK  The MQTT v5.0 subscribe options class.

    The options are:
        qos:                As in MQTT v3.1.1.
        noLocal:            True or False. If set to True, the subscriber will not receive its own publications.
        retainAsPublished:  True or False. If set to True, the retain flag on received publications will be as set
                            by the publisher.
        retainHandling:     RETAIN_SEND_ON_SUBSCRIBE, RETAIN_SEND_IF_NEW_SUB or RETAIN_DO_NOT_SEND
                            Controls when the broker should send retained messages:
                                - RETAIN_SEND_ON_SUBSCRIBE: on any successful subscribe request
                                - RETAIN_SEND_IF_NEW_SUB: only if the subscribe request is new
                                - RETAIN_DO_NOT_SEND: never send retained messages
           FqosnoLocalretainAsPublishedretainHandlingc                     t                               | dg d           || _        || _        || _        || _        | j        dvrt          d| j                   | j        dvrt          d| j                   dS )a  
        qos:                0, 1 or 2.  0 is the default.
        noLocal:            True or False. False is the default and corresponds to MQTT v3.1.1 behavior.
        retainAsPublished:  True or False. False is the default and corresponds to MQTT v3.1.1 behavior.
        retainHandling:     RETAIN_SEND_ON_SUBSCRIBE, RETAIN_SEND_IF_NEW_SUB or RETAIN_DO_NOT_SEND
                            RETAIN_SEND_ON_SUBSCRIBE is the default and corresponds to MQTT v3.1.1 behavior.
        namesQoSr   r   r   r         )Retain handling should be 0, 1 or 2, not QoS should be 0, 1 or 2, not N)object__setattr__r   r   r   r   AssertionError)selfr   r   r   r   s        r	   __init__zSubscribeOptions.__init__,   s     	4TTT	V 	V 	V!2,i// !bTM`!b!bccc89$$ !K!K!KLLL %$r   c                     || j         vrt          | d| j                    t                              | ||           d S )Nz Attribute name must be one of )r   r   r   r   )r   namevalues      r	   r   zSubscribeOptions.__setattr__E   sU    tz!!DD
DDF F F4u-----r   c                 
   | j         dvrt          d| j                    | j        dvrt          d| j                   | j        rdnd}| j        rdnd}| j         dz  |dz  z  |dz  z  | j        z  g}t          |          S )	Nr   r   r   r   r      r   r   )r   r   r   r   r   bytes)r   r   r   datas       r	   packzSubscribeOptions.packK   s    i// !bTM`!b!bccc89$$ !K!K!KLLL|*!!!%!7>AAQ$).?1.DEA!%* +T{{r   c                    |d         }|dz	  dz  | _         |dz	  dz  dk    rdnd| _        |dz	  dz  dk    rdnd| _        |dz  | _        | j         dvrt	          d	| j                    | j        dvrt	          d
| j                   dS )Nr   r$   r   r   TFr   r   r   r   )r   r   r   r   r   )r   bufferb0s      r	   unpackzSubscribeOptions.unpackV   s    AY "a4/+-7d*:q)@)@e!#qD 0Q66ttEIi// !bTM`!b!bccc89$$ !K!K!KLLLqr   c                      t          |           S )N)strr   s    r	   __repr__zSubscribeOptions.__repr__b   s    4yyr   c                     dt          | j                  z   dz   t          | j                  z   dz   t          | j                  z   dz   t          | j                  z   dz   S )Nz{QoS=z
, noLocal=z, retainAsPublished=z, retainHandling=})r-   r   r   r   r   r.   s    r	   __str__zSubscribeOptions.__str__e   si    s48}}$\1#dl2C2CC"##&t'=#>#>?  #D$7 8 899<= 	=r   c                 <    | j         | j        | j        | j        d}|S )Nr   r   )r   r&   s     r	   jsonzSubscribeOptions.jsonj   s+    8|!%!7"1	
 
 r   N)r   r   r   __doc__rangeRETAIN_SEND_ON_SUBSCRIBERETAIN_SEND_IF_NEW_SUBRETAIN_DO_NOT_SENDintboolr   r   r'   r+   r/   r2   r4   r   r   r	   r   r      s          LQ5	1L LH46H
 "'6M MM M  	M
 M M M M2. . .	 	 	
 
 
  = = =
    r   r   N)r5   	Exceptionr   r   r   r   r	   <module>r=      su    (	 	 	 	 	I 	 	 	X X X X X X X X X Xr   