-
Notifications
You must be signed in to change notification settings - Fork 92
Feature testh #763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Feature testh #763
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
8c4a9dc
Teach 005 (#5)
zhangting85 5ded9c1
create the folders
zhangting85 77885c6
Merge pull request #50 from TestUpCommunity/teach_006
zhangting851111 5b9504e
增加statistics接口封装文件
ouyangwuhai b164332
增加statuses接口封装文件
ouyangwuhai 1a10d9c
更新statistics接口封装文件
ouyangwuhai 1dc3fe3
Merge pull request #273 from ouyangwuhai/feature_ouyangalex
ouyangwuhai dae65b8
release.py文件下的接口封装" (#272)
Soniaxia 7945fb7
traffic (#274)
vlonly ed993f3
Teach 007 (#306)
zhangting85 d0cc63f
Feature qinfei55-2019年5月10日第一次评审待修改。 (#311)
qinfei55 07a7d27
branches.py (#307)
NancyHui a2581d7
更新hooks接口封装文件-2019年5月10日第一次评审待修改。 (#310)
bgfNGl35QpGme9mpx0f4b8yE3S d3c537d
add
zhangting85 ccdfb69
Merge pull request #1 from TestUpCommunity/integration_1
vlonly dec226b
#191-#195
vlonly 6802a7d
#206,#207
vlonly fc5de88
#225
vlonly 72b722f
Feature vl (#346)
vlonly 15372ca
new file: teams.py (#345)
xiaoxieaichirou c0f585f
Revert " new file: teams.py (#345)" (#358)
zhangting85 ba75020
Teach 008 (#359)
zhangting85 d4e0547
Merge pull request #2 from TestUpCommunity/integration_1
vlonly ea99e99
update a folder name
zhangting85 5e300f9
更新hooks文件,新增pages文件
bgfNGl35QpGme9mpx0f4b8yE3S 78cc4c2
rename some folder
zhangting85 b408d81
add list_check_runs api (#737)
zhangting85 81d1639
修改pages文件
bgfNGl35QpGme9mpx0f4b8yE3S f022c55
fix the preview api
zhangting85 abf1f72
#166-#170
vlonly 1a3dfae
修改pages文件,新增repositories文件
bgfNGl35QpGme9mpx0f4b8yE3S 1b0585e
-
bgfNGl35QpGme9mpx0f4b8yE3S 12c5a56
新增projects,columns,collaborators,cards接口封装文件
bgfNGl35QpGme9mpx0f4b8yE3S f083499
修改projects文件
bgfNGl35QpGme9mpx0f4b8yE3S 11b8ade
更新hooks文件,新增pages文件-已评审 (#541)
bgfNGl35QpGme9mpx0f4b8yE3S 6e2171b
新增comments.py、commits.py文件
bgfNGl35QpGme9mpx0f4b8yE3S 767a6b7
新增contents.py,invitations.py文件
bgfNGl35QpGme9mpx0f4b8yE3S cb89c0e
修改commit.py
bgfNGl35QpGme9mpx0f4b8yE3S 35a0ce9
已修改代码问题
vlonly 81b46e6
Merge pull request #3 from TestUpCommunity/integration_1
vlonly e761506
新增deployments.py,downloads.py文件
bgfNGl35QpGme9mpx0f4b8yE3S c98df9a
完成8.Interactions接口#543-#549
Gunnine 67b3eb7
新增comments.py,pulls.py,review_requests.py,reviews.py
bgfNGl35QpGme9mpx0f4b8yE3S d7e342d
Merge branch 'integration_1' into feature_lxc
zhangting85 fe0878b
Merge pull request #741 from bgfNGl35QpGme9mpx0f4b8yE3S/feature_lxc
zhangting85 cf690e3
Merge pull request #742 from Gunnine/task_543
zhangting85 ac17561
Merge pull request #739 from vlonly/feature_vl
zhangting85 506cc46
Add reactions_1
ChenWanyu1207 4832523
创建apps和installations
namelaowang ef39a60
修改apps.py文件
namelaowang c8c184a
完成#563需求
namelaowang 5b2f721
完成需求502
namelaowang e00ea43
完成需求#131
namelaowang 2f1217c
Merge pull request #750 from namelaowang/feature_namelaowang
zhangting85 e04ea81
fix #361 reactions's comment_id
9530b7f
add test.txt
751f328
remove test.txt
f44b111
add test.txt
27dcff1
remove test.txt
dcfd8e2
add a func
f88ebc9
reset
64f4aaa
add api/issues/events.py
5742973
delete .idea
7946e82
add api/checks/runs.py
7763a95
modify runs.py
e5d71b8
Merge pull request #753 from ChenWanyu1207/feature_cwy_1
zhangting85 1c6003f
Merge pull request #758 from perfectcolor1/feature_color001
zhangting85 2236d40
Merge pull request #759 from perfectcolor1/feature_color002
zhangting85 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file added
api/__init__.py
Empty file.
Empty file added
api/activity/__init__.py
Empty file.
Empty file added
api/apps/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions
api/apps/apps.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| from core.rest_client import RestClient | ||
| from api.apps.installactions import Installation | ||
|
|
||
|
|
||
| class Apps(RestClient): | ||
| def __init__(self, api_root_url, **kwargs): | ||
| super(Apps, self).__init__(api_root_url, **kwargs) | ||
| self.installaction = Installation(self.api_root_url, **kwargs) | ||
|
|
||
| def create_gitHub_app_from_a_manifest(self, code, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/apps/#create-a-github-app-from-a-manifest | ||
| """ | ||
| return self.post("/app-manifests/{}/conversions".format(code), **kwargs) | ||
|
|
||
| def get_a_user_installation(self, username, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/apps/#get-a-user-installation | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.machine-man-preview+json'} | ||
| return self.get("/users/{}/installation".format(username), headers=headers, **kwargs) |
29 changes: 29 additions & 0 deletions
api/apps/installactions.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
|
|
||
| class Installation(RestClient): | ||
| def list_repositories(self, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/apps/installations/#list-repositories | ||
| :param kwargs: | ||
| :return: | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.machine-man-preview+json'} | ||
| return self.get("/installation/repositories", headers=headers, **kwargs) | ||
|
|
||
| def list_installations_for_a_user(self, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/apps/installations/#list-installations-for-a-user | ||
| :param kwargs: | ||
| :return: | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.machine-man-preview+json'} | ||
| return self.get("/user/installations", headers=headers, **kwargs) | ||
|
|
||
| def add_repository_to_installation(self, installation_id, repository_id, **kwargs): | ||
| """ | ||
| 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) | ||
|
|
Empty file added
api/checks/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions
api/checks/checks.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from core.rest_client import RestClient | ||
| from api.checks.runs import Runs | ||
|
|
||
|
|
||
| class Checks(RestClient): | ||
| def __init__(self, api_root_url, **kwargs): | ||
| super(Checks, self).__init__(api_root_url, **kwargs) | ||
| self.runs = Runs(self.api_root_url, **kwargs) |
49 changes: 49 additions & 0 deletions
api/checks/runs.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
|
|
||
| class Runs(RestClient): | ||
|
|
||
| def list_check_runs(self, owner, repo, ref, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.antiope-preview+json'} | ||
| return self.get("/repos/{}/{}/commits/{}/check-runs".format(owner, repo, ref), headers=headers, **kwargs) | ||
|
|
||
| def create_a_check_runs(self, owner, repo, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/checks/runs/#create-a-check-run | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.antiope-preview+json'} | ||
| return self.post('/repos/{}/{}/check-runs'.format(owner, repo), headers = headers, **kwargs) | ||
|
|
||
| def updata_a_check_runs(self, owner, repo, check_run_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/checks/runs/#update-a-check-run | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.antiope-preview+json'} | ||
| return self.patch('/repos/{}/{}/check-runs/{}'.format(owner, repo, check_run_id), headers = headers, **kwargs) | ||
|
|
||
| def list_check_runs_in_a_check_suite(self, owner, repo, check_suite_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/checks/runs/#list-check-runs-in-a-check-suite | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.antiope-preview+json'} | ||
| return self.get('/repos/{}/{}/check-suites/{}/check-runs'.format(owner, repo, check_suite_id), headers = headers, **kwargs) | ||
|
|
||
| def get_a_single_check_run(self, owner, repo, check_run_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/checks/runs/#get-a-check-run | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.antiope-preview+json'} | ||
| return self.get('/repos/{}/{}/check-runs/{}'.format(owner, repo, check_run_id), headers = headers, **kwargs) | ||
|
|
||
| def list_annotations_for_a_check_run(self, owner, repo, check_run_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/checks/runs/#list-check-run-annotations | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.antiope-preview+json'} | ||
| return self.get('/repos/{}/{}/check-runs/{}/annotations'.format(owner, repo, check_run_id), headers = headers, **kwargs) | ||
|
|
||
|
|
||
|
|
Empty file added
api/gists/__init__.py
Empty file.
Empty file added
api/git_data/__init__.py
Empty file.
Empty file added
api/interactions/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions
api/interactions/interactions.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from core.rest_client import RestClient | ||
| from api.interactions.orgs import Orgs | ||
| from api.interactions.repos import Repos | ||
|
|
||
|
|
||
| class Interactions(RestClient): | ||
| """ | ||
| https://developer.github.com/v3/interactions/#interactions | ||
| """ | ||
|
|
||
| def __init__(self, api_root_url, **kwargs): | ||
| super(Interactions, self).__init__(api_root_url, **kwargs) | ||
| self.orgs = Orgs(self.api_root_url, **kwargs) | ||
| self.repos = Repos(self.api_root_url, **kwargs) |
27 changes: 27 additions & 0 deletions
api/interactions/orgs.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
|
|
||
| class Orgs(RestClient): | ||
| def __init__(self): | ||
| self.headers = {'Accept': 'application/vnd.github.sombra-preview'} | ||
|
|
||
| def get_interactions_limits_for_org(self, org, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/interactions/orgs/#get-interaction-restrictions-for-an-organization | ||
| :param org: organization name | ||
| """ | ||
| return self.get('/orgs/{}/interaction-limits'.format(org), headers=self.headers, **kwargs) | ||
|
|
||
| def update_interactions_limits_for_org(self, org, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/interactions/orgs#add-or-update-interaction-restrictions-for-an-organization | ||
| :param org: organization name | ||
| """ | ||
| return self.put('/orgs/{}/interaction-limits'.format(org), headers=self.headers, **kwargs) | ||
|
|
||
| def remove_interaction_restrictions_for_org(self, org, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/interactions/orgs#remove-interaction-restrictions-for-an-organization | ||
| :param org: organization name | ||
| """ | ||
| return self.delete('/orgs/{}/interaction-limits'.format(org), headers=self.headers, **kwargs) |
29 changes: 29 additions & 0 deletions
api/interactions/repos.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
|
|
||
| class Repos(RestClient): | ||
| def __init__(self): | ||
| self.headers = {'Accept': 'application/vnd.github.sombra-preview'} | ||
|
|
||
| def get_interaction_restrictions_for_repo(self, owner, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/interactions/repos#get-interaction-restrictions-for-a-repository | ||
| :param owner: organization owner | ||
| """ | ||
| return self.get('/repos/{}/:repo/interaction-limits'.format(owner), headers=self.headers, **kwargs) | ||
|
|
||
| def update_interaction_restrictions_for_repo(self, owner, repo, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/interactions/repos/#add-or-update-interaction-restrictions-for-a-repository | ||
| :param owner: organization owner | ||
| :param repo: repository | ||
| """ | ||
| return self.put('/repos/{}/{}/interaction-limits'.format(owner, repo), headers=self.headers, **kwargs) | ||
|
|
||
| def remove_interaction_restrictions_for_repo(self, owner, repo, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/interactions/repos/#remove-interaction-restrictions-for-a-repository | ||
| :param owner: organization owner | ||
| :param repo: repository | ||
| """ | ||
| return self.delete('/repos/{}/{}/interaction-limits'.format(owner, repo), header=self.headers, **kwargs) |
Empty file added
api/issues/__init__.py
Empty file.
30 changes: 30 additions & 0 deletions
api/issues/events.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
|
|
||
| class Events(RestClient): | ||
| def list_events_for_an_issue(self, owner, repo, issue_number, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/issues/events/#list-events-for-an-issue | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.starfox-preview+json,' | ||
| 'application/vnd.github.sailor-v-preview+json'} | ||
| return self.get('/repos/{}/{}/issues/{}/events'.format(owner, repo, issue_number), **kwargs, headers = headers) | ||
|
|
||
|
|
||
| def list_events_for_a_repository(self, owner, repo, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/issues/events/#list-issue-events-for-a-repository | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.starfox-preview+json,' | ||
| 'application/vnd.github.sailor-v-preview+json'} | ||
| return self.get('/repos/{}/{}/issues/events'.format(owner, repo), **kwargs, headers = headers) | ||
|
|
||
| def get_a_single_event(self, owner, repo, event_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/issues/events/#get-an-issue-event | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.starfox-preview+json,' | ||
| 'application/vnd.github.machine-man-preview,' | ||
| 'application/vnd.github.sailor-v-preview+json'} | ||
| return self.get('/repos/{}/{}/issues/events/{}'.format(owner, repo, event_id), **kwargs, headers = headers) | ||
|
|
24 changes: 24 additions & 0 deletions
api/issues/issues.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from core.rest_client import RestClient | ||
| from api.issues.events import Events | ||
|
|
||
|
|
||
| class Issues(RestClient): | ||
|
|
||
| def __init__(self, api_root_url, **kwargs): | ||
| super(Issues, self).__init__(api_root_url, **kwargs) | ||
| self.event = Events(self.api_root_url, **kwargs) | ||
|
|
||
| def create_issue(self, owner, repo, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/issues/#create-an-issue | ||
| """ | ||
| return self.post("/repos/{}/{}/issues".format(owner, repo), **kwargs) | ||
|
|
||
| def list_issue(self, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/issues/#list-issues | ||
| """ | ||
| header = {'Accept': 'application/vnd.github.machine-man-preview'} | ||
| return self.get("/issues", headers=header, **kwargs) | ||
|
|
||
|
|
Empty file added
api/marketplace/__init__.py
Empty file.
Empty file added
api/migrations/__init__.py
Empty file.
Empty file added
api/misc/__init__.py
Empty file.
Empty file added
api/orgs/__init__.py
Empty file.
Empty file added
api/projects/__init__.py
Empty file.
45 changes: 45 additions & 0 deletions
api/projects/cards.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
| class Cards(RestClient): | ||
|
|
||
| def list_project_cards(self, column_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/cards/#list-project-cards | ||
| """ | ||
| hearders = {'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.get('/projects/columns/{}/cards'.format(column_id), hearders = hearders, **kwargs) | ||
|
|
||
| def get_a_project_card(self, card_id): | ||
| """ | ||
| https://developer.github.com/v3/projects/cards/#get-a-project-card | ||
| """ | ||
| hearders = {'Accept': 'application/vnd.github.inertia-preview+json'} | ||
| return self.get('/projects/columns/cards/{}'.format(card_id), hearders = hearders) | ||
|
|
||
| def create_a_project_card(self, column_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/cards/#create-a-project-card | ||
| """ | ||
| hearders = {'Accept': 'application/vnd.github.inertia-preview+json'} | ||
| return self.post('/projects/columns/{}/cards'.format(column_id), hearders = hearders, **kwargs) | ||
|
|
||
| def update_a_project_card(self, card_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/cards/#update-a-project-card | ||
| """ | ||
| hearders = {'Accept': 'application/vnd.github.inertia-preview+json'} | ||
| return self.patch('/projects/columns/cards/{}'.format(card_id), hearders = hearders, **kwargs) | ||
|
|
||
| def delete_a_project_card(self, card_id): | ||
| """ | ||
| https://developer.github.com/v3/projects/cards/#delete-a-project-card | ||
| """ | ||
| hearders = {'Accept': 'application/vnd.github.inertia-preview+json'} | ||
| return self.delete('/projects/columns/cards/{}'.format(card_id), hearders = hearders) | ||
|
|
||
| def move_a_project_card(self, card_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/cards/#move-a-project-card | ||
| """ | ||
| hearders = {'Accept': 'application/vnd.github.inertia-preview+json'} | ||
| return self.post('/projects/columns/cards/{}/moves'.format(card_id),hearders = hearders, **kwargs) |
32 changes: 32 additions & 0 deletions
api/projects/collaborators.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
| class Collaborators(RestClient): | ||
|
|
||
| def add_user_as_a_collaborator(self, project_id, username, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/collaborators/#add-user-as-a-collaborator | ||
| """ | ||
| headers ={'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.put('/projects/{}/collaborators/{}'.format(project_id, username),headers = headers, **kwargs) | ||
|
|
||
| def list_collaborator(self, project_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/collaborators/#list-collaborators | ||
| """ | ||
| headers = {'Accept': 'application/vnd.github.inertia-preview+json'} | ||
| return self.get('/projects/{}/collaborators'.format(project_id), headers = headers, **kwargs) | ||
|
|
||
| def review_a_users_permission_level(self, project_id, username, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/collaborators/#review-a-users-permission-level | ||
| """ | ||
| headers = {'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.get('/projects/{}/collaborators/{}/permission'.format(project_id,username), headers = headers, **kwargs) | ||
|
|
||
| def remove_user_as_a_collaborator(self, project_id, username): | ||
| """ | ||
| https://developer.github.com/v3/projects/collaborators/#remove-user-as-a-collaborator | ||
| """ | ||
| headers = {'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.delete('/projects/{}/collaborators/{}'.format(project_id,username), headers = headers) | ||
|
|
48 changes: 48 additions & 0 deletions
api/projects/columns.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| from core.rest_client import RestClient | ||
|
|
||
| class Columns(RestClient): | ||
|
|
||
| def create_a_project_column(self, project_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/columns/#create-a-project-column | ||
| """ | ||
| headers ={'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.post('/projects/{}/columns'.format(project_id), headers, **kwargs) | ||
|
|
||
| def delete_a_project_column(self, column_id): | ||
| """ | ||
| https://developer.github.com/v3/projects/columns/#delete-a-project-column | ||
| """ | ||
| hearders = {'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.delete('/projects/columns/{}'.format(column_id), hearders = hearders) | ||
|
|
||
| def update_a_project_column(self, column_id): | ||
| """ | ||
| https://developer.github.com/v3/projects/columns/#update-a-project-column | ||
| """ | ||
| hearders = {'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.patch('/projects/columns/{}'.format(column_id), hearders = hearders) | ||
|
|
||
| def move_a_project_column(self, column_id, **kwargs): | ||
| """ | ||
| https://developer.github.com/v3/projects/columns/#move-a-project-column | ||
| """ | ||
| hearders = {'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.post('/projects/columns/{}/moves'.format(column_id), hearders = hearders, **kwargs) | ||
|
|
||
| def get_a_project_column(self, column_id): | ||
| """ | ||
| https://developer.github.com/v3/projects/columns/#get-a-project-column | ||
| """ | ||
| hearders = {'Accept':'application/vnd.github.inertia-preview+json'} | ||
| return self.get('/projects/columns/{}'.format(column_id), hearders = hearders) | ||
|
|
||
| def list_project_columns(self, project_id): | ||
| """ | ||
| https://developer.github.com/v3/projects/columns/#list-project-columns | ||
| """ | ||
| hearders = {'Accept': 'application/vnd.github.inertia-preview+json'} | ||
| return self.get('/projects/{}/columns'.format(project_id), hearders=hearders) | ||
|
|
||
|
|
||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.