aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/services/repos/keys.py
blob: 24a7cb3bdd29121971a446ee444aa4bc23367526 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# -*- encoding: utf-8 -*-

from . import Service


class Keys(Service):

    def list(self, user=None, repo=None):
        request = self.make_request('repos.keys.list', user=user, repo=repo)
        return self._get_result(request)

    def get(self, id, user=None, repo=None):
        request = self.make_request('repos.keys.get',
            id=id, user=user, repo=repo)
        return self._get(request)

    def create(self, data, user=None, repo=None):
        request = self.make_request('repos.keys.create',
            body=data, user=user, repo=repo)
        return self._post(request)

    def update(self, id, data, user=None, repo=None):
        request = self.make_request('repos.keys.update',
            id=id, body=data, user=user, repo=repo)
        return self._patch(request)

    def delete(self, id, user=None, repo=None):
        request = self.make_request('repos.keys.delete',
            id=id, user=user, repo=repo)
        self._delete(request)