def METHOD_NAME(obj: Entity, obj_type: str, obj_id: int, **kwargs: Any) -> str:
    kw = {}
    kw.update(kwargs)
    if self.id_attr is not None:
        # some objects have url with GET parameters only
        kw[self.id_attr] = obj_id
    if self.kw_func:
        kw = self.kw_func(kw, obj, obj_type, obj_id, **kwargs)
    return url_for(endpoint, **kw)