1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-14 21:24:59 +00:00

Add gist comment routes

This commit is contained in:
RGBCube 2022-06-27 14:12:12 +03:00
parent 73c1153b8d
commit 8637e408f5

View file

@ -66,7 +66,7 @@ class RateLimits(NamedTuple):
# Deployments
# Emojis DONE
# Enterprise administration
# Gists DONE(1st part)
# Gists DONE
# Git database
# Gitignore DONE
# Interactions
@ -855,6 +855,30 @@ class HTTPClient:
return await self.request("GET", f"/users/{username}/gists", params=params)
async def list_gist_comments(
self, *, gist_id: str, per_page: Optional[int] = None, page: Optional[int] = None
):
params = {}
if per_page:
params["per_page"] = per_page
if page:
params["page"] = page
return await self.request("GET", f"/gists/{gist_id}/comments", params=params)
async def create_gist_comment(self, *, gist_id: str, body: str):
return await self.request("POST", f"/gists/{gist_id}/comments", json={"body": body})
async def get_gist_comment(self, *, gist_id: str, comment_id: str):
return await self.request("GET", f"/gists/{gist_id}/comments/{comment_id}")
async def update_gist_comment(self, *, gist_id: str, comment_id: str, body: str):
return await self.request("PATCH", f"/gists/{gist_id}/comments/{comment_id}", json={"body": body})
async def delete_gist_comment(self, *, gist_id: str, comment_id: str):
return await self.request("DELETE", f"/gists/{gist_id}/comments/{comment_id}")
# === LICENSES === #
async def get_all_commonly_used_licenses(self):