From 7274c90f2d8fbe0017710b9911b5d61577fbe768 Mon Sep 17 00:00:00 2001 From: RGBCube <78925721+RGBCube@users.noreply.github.com> Date: Mon, 27 Jun 2022 13:23:40 +0300 Subject: [PATCH] Add licenses routes --- github/internals/http.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/github/internals/http.py b/github/internals/http.py index 171534e..8eb96a7 100644 --- a/github/internals/http.py +++ b/github/internals/http.py @@ -64,7 +64,7 @@ class RateLimits(NamedTuple): # Gitignore # Interactions # Issues -# Licenses +# Licenses DONE # Markdown # Meta # Metrics @@ -831,3 +831,14 @@ class HTTPClient: params["page"] = page 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")