-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathapps.py
More file actions
21 lines (17 loc) · 874 Bytes
/
apps.py
File metadata and controls
21 lines (17 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)