a
    ù!f‰  ã                   @   s6   d dl Z d dlZG dd„ deƒZdd„ Zddd„ZdS )	é    Nc                   @   s   e Zd ZdZdS )ÚObsoleteExceptionz0Base class for warnings about obsolete features.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   úU/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/base/obsolete.pyr      s   r   c                    s   t  ˆ ¡‡ fdd„ƒ}|S )zšThis is a decorator which can be used to mark Client classes as
    obsolete. It will result in an error being emitted when the class is
    instantiated.c                     s   t d ˆ j¡ƒ‚d S )Nzi{} has been removed from this version of the library. Please refer to current documentation for guidance.)r   Úformatr   )ÚargsÚkwargs©Úfuncr   r   Únew_func   s
    ÿÿz!obsolete_client.<locals>.new_func©Ú	functoolsÚwraps©r   r   r   r   r   Úobsolete_client	   s    r   c                    s    ‡ fdd„}t ˆ ƒr|ˆ ƒS |S )z²
    This is a decorator which can be used to mark deprecated methods.
    It will report in a DeprecationWarning being emitted to stderr when the deprecated method is used.
    c                    s   t  ˆ ¡‡ ‡fdd„ƒ}|S )Nc                     sB   d  ˆ j¡}|tˆtƒr"d  ˆ¡nd7 }t |t¡ ˆ | i |¤ŽS )Nz#Function method .{}() is deprecatedz in favor of .{}()Ú )r	   r   Ú
isinstanceÚstrÚwarningsÚwarnÚDeprecationWarning)r
   r   Úmsgr   r   r   Úwrapper   s    ÿýzEdeprecated_method.<locals>.deprecated_method_wrapper.<locals>.wrapperr   )r   r   ©r   r   r   Údeprecated_method_wrapper   s    
z4deprecated_method.<locals>.deprecated_method_wrapper)Úcallable)r   r   r   r   r   Údeprecated_method   s    r   )N)r   r   Ú	Exceptionr   r   r   r   r   r   r   Ú<module>   s   