'Return a list of all available API endpoints by inspecting the URL conf.'

def get_api_endpoints(self, patterns=None, prefix=''):

    if (patterns is None):
        patterns = self.patterns
    api_endpoints = []
    for pattern in patterns:
        path_regex = (prefix + pattern.regex.pattern)
        if isinstance(pattern, RegexURLPattern):
            path = self.get_path_from_regex(path_regex)
            callback = pattern.callback
            if self.should_include_endpoint(path, callback):
                for method in self.get_allowed_methods(callback):
                    endpoint = (path, method, callback)
                    api_endpoints.append(endpoint)
        elif isinstance(pattern, RegexURLResolver):
            nested_endpoints = self.get_api_endpoints(patterns=pattern.url_patterns, prefix=path_regex)
            api_endpoints.extend(nested_endpoints)
    api_endpoints = sorted(api_endpoints, key=endpoint_ordering)
    return api_endpoints
