def _attach_endpoints(self):
        """Dynamically attaches endpoint callables to this client"""
        for name, value in inspect.getmembers(self):
            if inspect.isclass(value) and issubclass(value, self._Endpoint) and (value is not self._Endpoint):
                endpoint_instance = value(self.requester)
                setattr(self, endpoint_instance.endpoint_base, endpoint_instance)
                if not hasattr(endpoint_instance, 'get_endpoints'):
                    endpoint_instance.get_endpoints = ()
                if not hasattr(endpoint_instance, 'post_endpoints'):
                    endpoint_instance.post_endpoints = ()
                if not hasattr(endpoint_instance, 'is_callable'):
                    endpoint_instance.is_callable = False
                for endpoint in (endpoint_instance.get_endpoints + endpoint_instance.post_endpoints):
                    function = endpoint_instance.create_endpoint_function(endpoint)
                    function_name = endpoint.replace('/', '_')
                    setattr(endpoint_instance, function_name, function)
                    function.__name__ = str(function_name)
                    function.__doc__ = 'Tells the object to make a request to the {0} endpoint'.format(endpoint)
def _attach_endpoints ( self ) : for name , value in inspect . getmembers ( self ) : if inspect . isclass ( value ) and issubclass ( value , self . _Endpoint ) and ( value is not self . _Endpoint ) : endpoint_instance = value ( self . requester ) setattr ( self , endpoint_instance . endpoint_base , endpoint_instance ) if not hasattr ( endpoint_instance , 'get_endpoints' ) : endpoint_instance . get_endpoints = ( ) if not hasattr ( endpoint_instance , 'post_endpoints' ) : endpoint_instance . post_endpoints = ( ) if not hasattr ( endpoint_instance , 'is_callable' ) : endpoint_instance . is_callable = False for endpoint in ( endpoint_instance . get_endpoints + endpoint_instance . post_endpoints ) : function = endpoint_instance . create_endpoint_function ( endpoint ) function_name = endpoint . replace ( '/' , '_' ) setattr ( endpoint_instance , function_name , function ) function . __name__ = str ( function_name ) function . __doc__ = 'Tells the object to make a request to the {0} endpoint' . format ( endpoint )
Dynamically attaches endpoint callables to this client