# Path: flask_github/client/messages.py
# class IssueLabel(msgs.Message):
#   pass
# 
# Path: flask_github/client/requests.py
# class IssueLabelResponse(msgs.Message):
#   response = msgs.MessageField('IssueLabel', 1)
# 
# Path: flask_github/client/requests.py
# class IssueLabelListResponse(msgs.Message):
#   response = msgs.MessageField('IssueLabel', 1, repeated=True)


from ..messages import IssueLabel
from ..requests import IssueLabelResponse
from ..requests import IssueLabelListResponse

from __future__ import unicode_literals

class IssuesLabels:
  def __init__(self, client):
    self.client = client

  def list_repo_labels(self, repo, user=None):
    return self.client.get('repos/%s/%s/labels' % (
      repo, self.client.user(user)), msg_type=IssueLabelListResponse)

  def get(self, repo, id, user=None):
    return self.client.get('repos/%s/%s/labels/%s' % (
      repo, self.client.user(user), id), msg_type=IssueLabelResponse)

  def create(self, repo, name, color, user=None):
    msg = IssueLabel(
      name=name,
      color=color)
    return self._create(repo=repo, msg=msg, user=user)

  def _create(self, repo, msg, user=None):
    return self.client.post('repos/%s/%s/labels' % (
      repo, self.client.user(user)), data=msg, msg_type=IssueLabelResponse)

  def edit(self, repo, id, name, color, user=None):

# Path: flask_github/client/messages.py
# class IssueLabel(msgs.Message):
#   pass
# 
# Path: flask_github/client/requests.py
# class IssueLabelResponse(msgs.Message):
#   response = msgs.MessageField('IssueLabel', 1)
# 
# Path: flask_github/client/requests.py
# class IssueLabelListResponse(msgs.Message):
#   response = msgs.MessageField('IssueLabel', 1, repeated=True)


# Path: flask_github/client/issues/issueslabels.py
from ..messages import IssueLabel
from ..requests import IssueLabelResponse
from ..requests import IssueLabelListResponse

from __future__ import unicode_literals

class IssuesLabels:
  def __init__(self, client):
    self.client = client

  def list_repo_labels(self, repo, user=None):
    return self.client.get('repos/%s/%s/labels' % (
      repo, self.client.user(user)), msg_type=IssueLabelListResponse)

  def get(self, repo, id, user=None):
    return self.client.get('repos/%s/%s/labels/%s' % (
      repo, self.client.user(user), id), msg_type=IssueLabelResponse)

  def create(self, repo, name, color, user=None):
    msg = IssueLabel(
      name=name,
      color=color)
    return self._create(repo=repo, msg=msg, user=user)

  def _create(self, repo, msg, user=None):
    return self.client.post('repos/%s/%s/labels' % (
      repo, self.client.user(user)), data=msg, msg_type=IssueLabelResponse)

  def edit(self, repo, id, name, color, user=None):

    msg = IssueLabel(
