
    3fi                     `    d dl Z d dlmZ  e j                  e      Zd Zd Zd Zd Z	d Z
d Zy)	    N)wrapsc                       fd}|S )z Decorator to mark a specified function as deprecated

    :param version: version in which it is deprecated
    :param replacement: replacement functions to use
    c                 h    dj                  dj                  D cg c]  }dj                  t        |             c}            }dj                  t               |      t               }g }D ]c  }|t        |      k(  r*|j	                  dj                  t        |                   ;|j	                  dj                  t        |                   e dj                  dj                  |       j                  r j                  nd       _        t                fd       }|S c c}w )	NzUse {} insteadz, z'{}'z'{}' is deprecated, {}z
:func:`{}`zm
            .. deprecated:: {}
               Use {} instead
               
               {} 
             c                  >    t         j                          | i |S N)logwarning)argskwargsfunclog_messages     S/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/O365/utils/decorators.pywrapperz7deprecated.<locals>.deprecated_wrapper.<locals>.wrapper(   s    KK$(((    )formatjoin_get_func_fq_name_get_func_pathappend
_func_name__doc__r   )	r   xreplacement_message	func_pathdoc_replacementr   r   replacementversions	   `     @r   deprecated_wrapperz&deprecated.<locals>.deprecated_wrapper   s&   .55dii!# ]],Q/0 #7$ % &!24!8:MN 	 #4(	 	?AN1--&&|':'::a='IJ&& ''(9!(<=?		?
 wyy1'+||t||= 	 
t	) 
	) ;#s   !D/ )r   r   r   s   `` r   
deprecatedr!      s    B r   c                 R    t        | t              r| j                  } | j                  S r   )
isinstancepropertyfget__name__)r   s    r   r   r   2   s    $!yy==r   c                    t        | t              r| j                  } dj                  | j                        }t        |       rI	 | j                  j                  dd      d   j                  dd      d   }|dj                  |      z  }|S |S # t        $ rC}	 | j                  }|dj                  |      z  }n# t        $ r
}Y d }~nd }~ww xY wY d }~|S d }~ww xY w)Nz{}.z	.<locals>   r   .)r#   r$   r%   r   
__module__callable__qualname__splitrsplitAttributeErrorim_class)r   	full_pathtemp_s       r   r   r   8   s    $!yyT__-I~		$$**;:1=DDS!LQODd++I 9  	}}U\\$//	!  	s7   AB 	C B98C9	CCCCCc                 r    t        | t              r| j                  } t        |       }|| j                  z  }|S r   )r#   r$   r%   r   r&   )r   r1   s     r   r   r   K   s3    $!yyt$IIr   c                      dj                   j                  r j                  nd       _        t                fd       }|S )NzN{}
        .. note:: This method is part of fluent api and can be chained
    r   c                      | g|i |S r   r    )selfr   r   r   s      r   innerzfluent.<locals>.innerX   s    D*4*6**r   r   r   r   r   r8   s   ` r   fluentr;   S   sD    t||t||4 	L 4[+ + Lr   c                      dj                   j                  r j                  nd       _        t                fd       }|S )Na  {}
        .. note:: The success/failure of this action can be obtained 
         from **success** and **error_message** attributes after 
         executing this function
         
         Example:
            .. code-block:: python
                
                my_obj.one().two().finish()
                if not my_obj.is_success:
                    print(my_obj.error_message) 
                    
            this will return success/failure of **finish** action
    r   c                     | j                   j                  | j                         }| j                  j                         |_         |g|i | |S r   )	__class____new____dict__copy)r7   r   r   objr   s       r   r8   zaction.<locals>.innero   sF    nn$$T^^4}}))+S"4"6"
r   r9   r:   s   ` r   actionrC   _   sF     	t||t||4 	L 4[  Lr   )logging	functoolsr   	getLoggerr&   r	   r!   r   r   r   r;   rC   r    r   r   <module>rG      s<     g!(V&	r   