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


from ..messages import IssueEvent
from ..requests import IssueEventResponse
from ..requests import IssueEventListResponse

from __future__ import unicode_literals

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

  def list(self, repo, issue_id=None, user=None):
    'repos/%s/%s/issues/events' % (self.client.user(user), repo)
    if issue_id:
      url = 'repos/%s/%s/issues/%s/events' % (
        self.client.user(user), repo, issue_id)
    return self.client.get(url, msg_type=IssueEventListResponse)

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

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


# Path: flask_github/client/issues/issuesevents.py
from ..messages import IssueEvent
from ..requests import IssueEventResponse
from ..requests import IssueEventListResponse

from __future__ import unicode_literals

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

  def list(self, repo, issue_id=None, user=None):
    'repos/%s/%s/issues/events' % (self.client.user(user), repo)
    if issue_id:
      url = 'repos/%s/%s/issues/%s/events' % (
        self.client.user(user), repo, issue_id)
    return self.client.get(url, msg_type=IssueEventListResponse)

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

      self.client.user(user), repo, id), msg_type=IssueEventResponse)
