# Path: flask_github/client/messages.py
# class Repo(msgs.Message):
#   id = msgs.IntegerField(1, default=0)
#   name = msgs.StringField(2)
#   full_name = msgs.StringField(3)
#   description = msgs.StringField(4)
#   owner = msgs.MessageField('User', 5)
#   created_at = msgs.StringField(6)
#   pushed_at = msgs.StringField(7)
#   updated_at = msgs.StringField(8)
#   has_wiki = msgs.BooleanField(9, default=False)
#   has_issues = msgs.BooleanField(10, default=False)
#   has_downloads = msgs.BooleanField(11, default=False)
#   private = msgs.BooleanField(12, default=False)
#   size = msgs.IntegerField(13, default=0)
#   forks = msgs.IntegerField(14, default=0)
#   forks_count = msgs.IntegerField(15, default=0)
#   watchers = msgs.IntegerField(16, default=0)
#   watchers_count = msgs.IntegerField(17, default=0)
#   open_issues_count = msgs.IntegerField(18, default=0)
#   open_issues = msgs.IntegerField(19, default=0)
#   language = msgs.StringField(20)
#   fork = msgs.BooleanField(21, default=False)
#   permissions = msgs.MessageField('RepoPermission', 22, repeated=True)
#   url = msgs.StringField(23)
#   git_url = msgs.StringField(24)
#   svn_url = msgs.StringField(25)
#   ssh_url = msgs.StringField(26)
#   html_url = msgs.StringField(27)
#   clone_url = msgs.StringField(28)
#   mirror_url = msgs.StringField(29)
#   homepage = msgs.StringField(30)
#   ref = msgs.StringField(31)
#   master_branch = msgs.StringField(32)
# 
# Path: flask_github/client/requests.py
# class RepoResponse(msgs.Message):
#   response = msgs.MessageField('Repo', 1)
# 
# Path: flask_github/client/requests.py
# class RepoListResponse(msgs.Message):
#   response = msgs.MessageField('Repo', 1, repeated=True)
# 
# Path: flask_github/client/requests.py
# class TagListResponse(msgs.Message):
#   response = msgs.MessageField('Tag', 1, repeated=True)
# 
# Path: flask_github/client/requests.py
# class UserListResponse(msgs.Message):
#   response = msgs.MessageField('User', 1, repeated=True)
# 
# Path: flask_github/client/requests.py
# class TeamListResponse(msgs.Message):
#   response = msgs.MessageField('Team', 1, repeated=True)


from reposkeys import ReposKeys
from reposhooks import ReposHooks
from reposforks import ReposForks
from reposcommits import ReposCommits
from reposwatching import ReposWatching
from reposstarring import ReposStarring
from reposdownloads import ReposDownloads
from reposcollaborators import ReposCollaborators
from ..messages import Repo
from ..requests import RepoResponse
from ..requests import RepoListResponse
from ..requests import TagListResponse
from ..requests import UserListResponse
from ..requests import TeamListResponse

      if user and user != self.client._username:
        url = 'users/%s/repos' % self.client.user(user)
    return self.client.get(url, msg_type=RepoListResponse)

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

  def create(self, name, org=None, description=None, homepage=None,
       private=False, has_issues=True, has_wiki=True, has_downloads=True):
    msg = Repo(
      name=name,
      private=private,
      has_issues=has_issues,
      has_wiki=has_wiki,
      has_downloads=has_downloads,
      description=description,
      homepage=homepage)
    return self._create(org=org, msg=msg)

  def _create(self, msg, org=None):
    url = 'user/repos'
    if org:
      url = 'orgs/%s/repos' % org
    return self.client.post(
      url, data=msg, msg_type=RepoResponse)

  def edit(self, repo, name, description=None, homepage=None, private=False,
      has_issues=True, has_wiki=True, has_downloads=True, user=None):

# Path: flask_github/client/messages.py
# class Repo(msgs.Message):
#   id = msgs.IntegerField(1, default=0)
#   name = msgs.StringField(2)
#   full_name = msgs.StringField(3)
#   description = msgs.StringField(4)
#   owner = msgs.MessageField('User', 5)
#   created_at = msgs.StringField(6)
#   pushed_at = msgs.StringField(7)
#   updated_at = msgs.StringField(8)
#   has_wiki = msgs.BooleanField(9, default=False)
#   has_issues = msgs.BooleanField(10, default=False)
#   has_downloads = msgs.BooleanField(11, default=False)
#   private = msgs.BooleanField(12, default=False)
#   size = msgs.IntegerField(13, default=0)
#   forks = msgs.IntegerField(14, default=0)
#   forks_count = msgs.IntegerField(15, default=0)
#   watchers = msgs.IntegerField(16, default=0)
#   watchers_count = msgs.IntegerField(17, default=0)
#   open_issues_count = msgs.IntegerField(18, default=0)
#   open_issues = msgs.IntegerField(19, default=0)
#   language = msgs.StringField(20)
#   fork = msgs.BooleanField(21, default=False)
#   permissions = msgs.MessageField('RepoPermission', 22, repeated=True)
#   url = msgs.StringField(23)
#   git_url = msgs.StringField(24)
#   svn_url = msgs.StringField(25)
#   ssh_url = msgs.StringField(26)
#   html_url = msgs.StringField(27)
#   clone_url = msgs.StringField(28)
#   mirror_url = msgs.StringField(29)
#   homepage = msgs.StringField(30)
#   ref = msgs.StringField(31)
#   master_branch = msgs.StringField(32)
# 
# Path: flask_github/client/requests.py
# class RepoResponse(msgs.Message):
#   response = msgs.MessageField('Repo', 1)
# 
# Path: flask_github/client/requests.py
# class RepoListResponse(msgs.Message):
#   response = msgs.MessageField('Repo', 1, repeated=True)
# 
# Path: flask_github/client/requests.py
# class TagListResponse(msgs.Message):
#   response = msgs.MessageField('Tag', 1, repeated=True)
# 
# Path: flask_github/client/requests.py
# class UserListResponse(msgs.Message):
#   response = msgs.MessageField('User', 1, repeated=True)
# 
# Path: flask_github/client/requests.py
# class TeamListResponse(msgs.Message):
#   response = msgs.MessageField('Team', 1, repeated=True)


# Path: flask_github/client/repos/repos.py
from reposkeys import ReposKeys
from reposhooks import ReposHooks
from reposforks import ReposForks
from reposcommits import ReposCommits
from reposwatching import ReposWatching
from reposstarring import ReposStarring
from reposdownloads import ReposDownloads
from reposcollaborators import ReposCollaborators
from ..messages import Repo
from ..requests import RepoResponse
from ..requests import RepoListResponse
from ..requests import TagListResponse
from ..requests import UserListResponse
from ..requests import TeamListResponse

      if user and user != self.client._username:
        url = 'users/%s/repos' % self.client.user(user)
    return self.client.get(url, msg_type=RepoListResponse)

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

  def create(self, name, org=None, description=None, homepage=None,
       private=False, has_issues=True, has_wiki=True, has_downloads=True):
    msg = Repo(
      name=name,
      private=private,
      has_issues=has_issues,
      has_wiki=has_wiki,
      has_downloads=has_downloads,
      description=description,
      homepage=homepage)
    return self._create(org=org, msg=msg)

  def _create(self, msg, org=None):
    url = 'user/repos'
    if org:
      url = 'orgs/%s/repos' % org
    return self.client.post(
      url, data=msg, msg_type=RepoResponse)

  def edit(self, repo, name, description=None, homepage=None, private=False,
      has_issues=True, has_wiki=True, has_downloads=True, user=None):

    msg = Repo(
