aboutsummaryrefslogtreecommitdiffstats
path: root/pygithub3/services/git_data/blobs.py
blob: d5baa2d4a44299fc4678e15409e72c88f0ce64ac (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
#!/usr/bin/env python
# -*- encoding: utf-8 -*-

from pygithub3.services.base import Service


class Blobs(Service):
    """Consume `Blobs API <http://developer.github.com/v3/git/blobs/>`_"""

    def get(self, sha, user=None, repo=None):
        """Get a particular blob

        :param str sha: The sha of the blob to get

        """
        request = self.make_request('git_data.blobs.get', sha=sha,
                                       user=user, repo=repo)
        return self._get(request)

    def create(self, data, user=None, repo=None):
        """Create a blob"""
        request = self.make_request('git_data.blobs.create', body=data,
                                    user=user, repo=repo)
        return self._post(request)