1
Fork 0
mirror of https://github.com/RGBCube/GitHubWrapper synced 2025-07-25 07:27:43 +00:00

Add licenses routes

This commit is contained in:
RGBCube 2022-06-27 13:23:40 +03:00
parent 859803fd72
commit 7274c90f2d

View file

@ -64,7 +64,7 @@ class RateLimits(NamedTuple):
# Gitignore # Gitignore
# Interactions # Interactions
# Issues # Issues
# Licenses # Licenses DONE
# Markdown # Markdown
# Meta # Meta
# Metrics # Metrics
@ -831,3 +831,14 @@ class HTTPClient:
params["page"] = page params["page"] = page
return await self.request("GET", f"/users/{username}/gists", params=params) return await self.request("GET", f"/users/{username}/gists", params=params)
# === LICENSES === #
async def get_commonly_used_licenses(self):
return await self.request("GET", "/licenses")
async def get_license(self, *, license: str):
return await self.request("GET", f"/licenses/{license}")
async def get_license_for_repository(self, *, owner: str, repo: str):
return await self.request("GET", f"/repos/{owner}/{repo}/license")