Skip to content

Commit

Permalink
feat: resolve_object endpoint (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 authored Nov 22, 2023
1 parent 4e99191 commit a6a1741
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pythorhead/lemmy.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,20 @@ def search(
type_ = type_.value
params: dict[str, Any] = {key: value for key, value in locals().items() if value is not None and key != "self"}
return self._requestor.api(Request.GET, "/search", params=params)

def resolve_object(
self,
q: str,
) -> Optional[dict]:
"""
Resolve a remove URL to the local URL
Args:
q (str)
Returns:
Optional[dict]: search result
"""
params: dict[str, Any] = {key: value for key, value in locals().items() if value is not None and key != "self"}
return self._requestor.api(Request.GET, "/resolve_object", params=params)

0 comments on commit a6a1741

Please sign in to comment.