# Path: flask_github/client/messages.py
# class Issue(msgs.Message):
#   title = msgs.StringField(1)
#   body = msgs.StringField(2)
#   state = msgs.StringField(3)
#   labels = msgs.StringField(4, repeated=True)
#   assignee = msgs.StringField(5)
#   milestone = msgs.StringField(6)
# 
# Path: flask_github/client/requests.py
# class IssueResponse(msgs.Message):
#   response = msgs.MessageField('Issue', 1)
# 
# Path: flask_github/client/requests.py
# class IssueListResponse(msgs.Message):
#   response = msgs.MessageField('Issue', 1, repeated=True)


from issuesevents import IssuesEvents
from issueslabels import IssuesLabels
from issuescomments import IssuesComments
from issuesmilestones import IssuesMilestones
from ..messages import Issue
from ..requests import IssueResponse
from ..requests import IssueListResponse

    self.events = IssuesEvents(self.client)
    self.labels = IssuesLabels(self.client)
    self.milestones = IssuesMilestones(self.client)

  def list_issues(self, filter='assigned', state='open', labels=None,
      sort='created', direction='desc', since=None):
    query = {
      'filter': filter,
      'state': state,
      'labels': labels,
      'sort': sort,
      'direction': direction,
      'since': since
    }
    return self.client.get('issues', query=query, msg_type=IssueListResponse)

  def list_repo_issues(self, repo, milestone=None, assignee=None,
    mentioned=None, state='open', labels=None, sort='created', direction='desc',
    since=None, user=None):
    query = {
      'state': state,
      'assignee': assignee,
      'mentioned': mentioned,
      'labels': labels,
      'sort': sort,
      'direction': direction,
      'since': since,
      'milestone': milestone
    }
    return self.client.get('repos/%s/%s/issues' % (

# Path: flask_github/client/messages.py
# class Issue(msgs.Message):
#   title = msgs.StringField(1)
#   body = msgs.StringField(2)
#   state = msgs.StringField(3)
#   labels = msgs.StringField(4, repeated=True)
#   assignee = msgs.StringField(5)
#   milestone = msgs.StringField(6)
# 
# Path: flask_github/client/requests.py
# class IssueResponse(msgs.Message):
#   response = msgs.MessageField('Issue', 1)
# 
# Path: flask_github/client/requests.py
# class IssueListResponse(msgs.Message):
#   response = msgs.MessageField('Issue', 1, repeated=True)


# Path: flask_github/client/issues/issues.py
from issuesevents import IssuesEvents
from issueslabels import IssuesLabels
from issuescomments import IssuesComments
from issuesmilestones import IssuesMilestones
from ..messages import Issue
from ..requests import IssueResponse
from ..requests import IssueListResponse

    self.events = IssuesEvents(self.client)
    self.labels = IssuesLabels(self.client)
    self.milestones = IssuesMilestones(self.client)

  def list_issues(self, filter='assigned', state='open', labels=None,
      sort='created', direction='desc', since=None):
    query = {
      'filter': filter,
      'state': state,
      'labels': labels,
      'sort': sort,
      'direction': direction,
      'since': since
    }
    return self.client.get('issues', query=query, msg_type=IssueListResponse)

  def list_repo_issues(self, repo, milestone=None, assignee=None,
    mentioned=None, state='open', labels=None, sort='created', direction='desc',
    since=None, user=None):
    query = {
      'state': state,
      'assignee': assignee,
      'mentioned': mentioned,
      'labels': labels,
      'sort': sort,
      'direction': direction,
      'since': since,
      'milestone': milestone
    }
    return self.client.get('repos/%s/%s/issues' % (

      self.client.user(user), repo), query=query, msg_type=IssueListResponse)
