From fb6374b4738a17635f33fc64511418076a9de1b8 Mon Sep 17 00:00:00 2001 From: ChenWanyu <1340863862@qq.com> Date: Sun, 2 Aug 2020 17:29:37 +0800 Subject: [PATCH 1/3] Add api: apps/installations:create_a_content_attavhment --- api/apps/installactions.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/apps/installactions.py b/api/apps/installactions.py index a039858..cf619e0 100644 --- a/api/apps/installactions.py +++ b/api/apps/installactions.py @@ -25,5 +25,12 @@ def add_repository_to_installation(self, installation_id, repository_id, **kwarg https://developer.github.com/v3/apps/installations/#add-repository-to-installation """ headers = {'Accept': 'application/vnd.github.machine-man-preview+json'} - return self.put("/user/installations/{}/repositories/{}".format(installation_id, repository_id), headers = headers, **kwargs) + return self.put("/user/installations/{}/repositories/{}".format(installation_id, repository_id), + headers=headers, **kwargs) + def create_a_content_attavhment(self, content_reference_id, **kwargs): + """ + https://developer.github.com/v3/apps/installations/#create-a-content-attachment + """ + headers = {'Accept': 'application/vnd.github.corsair-preview+json'} + return self.post("/content_references/{}/attachments".format(content_reference_id, headers=headers,**kwargs)) From 2d90ec259c876789d86fe9e75028950290267d84 Mon Sep 17 00:00:00 2001 From: ChenWanyu <1340863862@qq.com> Date: Sun, 2 Aug 2020 17:35:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20api:list=5Freactions?= =?UTF-8?q?=5Ffor=5Fa=5Fcommit=5Fcomment=20=E9=81=97=E6=BC=8Fheaders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/reactions/reactions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/reactions/reactions.py b/api/reactions/reactions.py index d18402c..33e6bc4 100644 --- a/api/reactions/reactions.py +++ b/api/reactions/reactions.py @@ -7,4 +7,5 @@ def list_reactions_for_a_commit_comment(self, owner, repo, comment_id, **kwargs) """ https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment """ - return self.get("/repos/{}/{}/comments/{}/reactions".format(owner, repo, comment_id), **kwargs) + headers = {'Accept': "application/vnd.github.squirrel-girl-preview+json"} + return self.get("/repos/{}/{}/comments/{}/reactions".format(owner, repo, comment_id), headers=headers, **kwargs) From b6e1b4b8fb502040e86bd8fed23b95a4599b94e6 Mon Sep 17 00:00:00 2001 From: ChenWanyu <1340863862@qq.com> Date: Sun, 2 Aug 2020 20:12:25 +0800 Subject: [PATCH 3/3] Add api:create_a_tag_object --- api/git/__init__.py | 0 api/git/tags.py | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 api/git/__init__.py create mode 100644 api/git/tags.py diff --git a/api/git/__init__.py b/api/git/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/api/git/tags.py b/api/git/tags.py new file mode 100644 index 0000000..e7e1885 --- /dev/null +++ b/api/git/tags.py @@ -0,0 +1,10 @@ +from core.rest_client import RestClient + + +class Tags(RestClient): + + def create_a_tag_object(self, owner, repo, **kwargs): + """ + https://developer.github.com/v3/git/tags/#create-a-tag-object + """ + return self.post("/repos/{}/{}/git/tags".format(owner, repo), **kwargs)