# Path: flask_github/client/messages.py
# class IssueMilestone(msgs.Message):
#   title = msgs.StringField(1)
#   state = msgs.StringField(2)
#   description = msgs.StringField(3)
#   due_on = msgs.StringField(4)
# 
# Path: flask_github/client/requests.py
# class IssueMilestoneResponse(msgs.Message):
#   response = msgs.MessageField('IssueMilestone', 1)
# 
# Path: flask_github/client/requests.py
# class IssueMilestoneListResponse(msgs.Message):
#   response = msgs.MessageField('IssueMilestone', 1, repeated=True)


from ..messages import IssueMilestone
from ..requests import IssueMilestoneResponse
from ..requests import IssueMilestoneListResponse

    self.client = client

  def list(self, repo, state=None, sort=None, direction=None, user=None):
    query = {
      'state': state,
      'sort': sort,
      'direction': direction}
    return self.client.get('repos/%s/%s/milestones' % (
      self.client.user(user), repo), query=query,
      msg_type=IssueMilestoneListResponse)

  def get(self, repo, number, user=None):
    return self.client.get('repos/%s/%s/milestones/%s' % (
      repo, user, number), msg_type=IssueMilestoneResponse)

  def create(self, repo, title, state=None, description=None,
      due_on=None, user=None):
    msg = IssueMilestone(
      title=title,
      state=state,
      description=description,
      due_on=due_on)
    return self._create(repo=repo, msg=msg, user=user)

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

  def edit(self, repo, number, title, state=None, description=None,
      due_on=None, user=None):

# Path: flask_github/client/messages.py
# class IssueMilestone(msgs.Message):
#   title = msgs.StringField(1)
#   state = msgs.StringField(2)
#   description = msgs.StringField(3)
#   due_on = msgs.StringField(4)
# 
# Path: flask_github/client/requests.py
# class IssueMilestoneResponse(msgs.Message):
#   response = msgs.MessageField('IssueMilestone', 1)
# 
# Path: flask_github/client/requests.py
# class IssueMilestoneListResponse(msgs.Message):
#   response = msgs.MessageField('IssueMilestone', 1, repeated=True)


# Path: flask_github/client/issues/issuesmilestones.py
from ..messages import IssueMilestone
from ..requests import IssueMilestoneResponse
from ..requests import IssueMilestoneListResponse

    self.client = client

  def list(self, repo, state=None, sort=None, direction=None, user=None):
    query = {
      'state': state,
      'sort': sort,
      'direction': direction}
    return self.client.get('repos/%s/%s/milestones' % (
      self.client.user(user), repo), query=query,
      msg_type=IssueMilestoneListResponse)

  def get(self, repo, number, user=None):
    return self.client.get('repos/%s/%s/milestones/%s' % (
      repo, user, number), msg_type=IssueMilestoneResponse)

  def create(self, repo, title, state=None, description=None,
      due_on=None, user=None):
    msg = IssueMilestone(
      title=title,
      state=state,
      description=description,
      due_on=due_on)
    return self._create(repo=repo, msg=msg, user=user)

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

  def edit(self, repo, number, title, state=None, description=None,
      due_on=None, user=None):

    msg = IssueMilestone(
