1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-05-18 06:55:09 +00:00

Add gist comment routes

This commit is contained in:
RGBCube 2022-06-27 14:12:12 +03:00 committed by Automated Linter
parent 8637e408f5
commit 4a687300d7

View file

@ -32,6 +32,7 @@ class RateLimits(NamedTuple):
reset_time: Optional[datetime] reset_time: Optional[datetime]
last_request: Optional[datetime] last_request: Optional[datetime]
# ====== STYLE GUIDE ===== # # ====== STYLE GUIDE ===== #
# All route method names should be # All route method names should be
# The exact same from the GitHub API # The exact same from the GitHub API
@ -257,7 +258,9 @@ class HTTPClient:
self, self,
*, *,
username: str, username: str,
subject_type: Optional[Literal["organization", "repository", "user", "pull_request"]] = None, subject_type: Optional[
Literal["organization", "repository", "user", "pull_request"]
] = None,
subject_id: Optional[int] = None, subject_id: Optional[int] = None,
): ):
params = {} params = {}
@ -874,7 +877,9 @@ class HTTPClient:
return await self.request("GET", f"/gists/{gist_id}/comments/{comment_id}") 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): 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}) 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): async def delete_gist_comment(self, *, gist_id: str, comment_id: str):
return await self.request("DELETE", f"/gists/{gist_id}/comments/{comment_id}") return await self.request("DELETE", f"/gists/{gist_id}/comments/{comment_id}")