
    M
                          d dl mZ d dlZddZy)    )absolute_importNc                       d  fd}|S )zAdd wrapped versions of the `api` member's methods to the class.

    Any methods passed in `blacklist` are not added.
    Additionally, any methods explicitly defined on the wrapped class are
    not added.
    c                      t        |t        t        f      r) fd}t         t        j                         |            S  fd} t        j                         |      S )z5Wrap a GAPIC method; preserve its name and docstring.c                       | i |S N )akw
wrapped_fxs     0lib/third_party/google/cloud/pubsub_v1/_gapic.py<lambda>z+add_methods.<locals>.wrap.<locals>.<lambda>%   s    *a"62"6    c                 0     | j                   g|i |S r   )api)selfr	   r
   r   s      r   r   z+add_methods.<locals>.wrap.<locals>.<lambda>(   s    
488(Fa(F2(Fr   )
isinstanceclassmethodstaticmethod	functoolswraps)r   	lookup_fxfxs   `  r   wrapzadd_methods.<locals>.wrap   sP     i+|!<=6B ;	
 ;B ?@@FB.9??:.r22r   c                     t              D ]V  }|j                  d      r|v rt        |      }t        |      s2j                  |   } ||      }t        | ||       X | S )N_)dir
startswithgetattrcallable__dict__setattr)clsnameattrr   r   	blacklistsource_classr   s        r   actual_decoratorz%add_methods.<locals>.actual_decorator+   sy     %Ds# y  <.DD> %--d3IdI&BCr"% &* 
r   r   )r&   r%   r'   r   s   `` @r   add_methodsr(      s    38 r   )r   )
__future__r   r   r(   r   r   r   <module>r*      s    ' 3r   