'Return a `coreapi.Link` instance for the given endpoint.'

def get_link(self, path, method, view):

    fields = self.get_path_fields(path, method, view)
    fields += self.get_serializer_fields(path, method, view)
    fields += self.get_pagination_fields(path, method, view)
    fields += self.get_filter_fields(path, method, view)
    if (fields and any([(field.location in ('form', 'body')) for field in fields])):
        encoding = self.get_encoding(path, method, view)
    else:
        encoding = None
    description = self.get_description(path, method, view)
    if (self.url and path.startswith('/')):
        path = path[1:]
    return coreapi.Link(url=urlparse.urljoin(self.url, path), action=method.lower(), encoding=encoding, fields=fields, description=description)
