# Path: flask_github/client/messages.py
# class Team(msgs.Message):
#   name = msgs.StringField(1)
#   repo_names = msgs.StringField(2, repeated=True)
#   permission = msgs.StringField(3)
# 
# Path: flask_github/client/requests.py
# class TeamResponse(msgs.Message):
#   response = msgs.MessageField('Team', 1)
# 
# Path: flask_github/client/requests.py
# class TeamListResponse(msgs.Message):
#   response = msgs.MessageField('Team', 1, repeated=True)
# 
# 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 UserResponse(msgs.Message):
#   response = msgs.MessageField('User', 1)
# 
# Path: flask_github/client/requests.py
# class UserListResponse(msgs.Message):
#   response = msgs.MessageField('User', 1, repeated=True)


from ..messages import Team
from ..requests import TeamResponse
from ..requests import TeamListResponse
from ..requests import RepoResponse
from ..requests import RepoListResponse
from ..requests import UserResponse
from ..requests import UserListResponse

from __future__ import unicode_literals

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

  def list(self, org):
    return self.client.get('orgs/%s/teams' % org, msg_type=TeamListResponse)

  def get(self, id):
    return self.client.get('teams/%s' % id, msg_type=TeamResponse)

  def create(self, org, name, repo_names=None, permission=None):
    msg = Team(
      name=name,
      repo_names=repo_names,
      permission=permission)
    return self._create(org=org, msg=msg)

  def _create(self, org, msg):
    return self.client.post('orgs/%s/teams' % org, data=msg)

  def edit(self, id, name, permission=None):

# Path: flask_github/client/messages.py
# class Team(msgs.Message):
#   name = msgs.StringField(1)
#   repo_names = msgs.StringField(2, repeated=True)
#   permission = msgs.StringField(3)
# 
# Path: flask_github/client/requests.py
# class TeamResponse(msgs.Message):
#   response = msgs.MessageField('Team', 1)
# 
# Path: flask_github/client/requests.py
# class TeamListResponse(msgs.Message):
#   response = msgs.MessageField('Team', 1, repeated=True)
# 
# 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 UserResponse(msgs.Message):
#   response = msgs.MessageField('User', 1)
# 
# Path: flask_github/client/requests.py
# class UserListResponse(msgs.Message):
#   response = msgs.MessageField('User', 1, repeated=True)


# Path: flask_github/client/orgs/orgteams.py
from ..messages import Team
from ..requests import TeamResponse
from ..requests import TeamListResponse
from ..requests import RepoResponse
from ..requests import RepoListResponse
from ..requests import UserResponse
from ..requests import UserListResponse

from __future__ import unicode_literals

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

  def list(self, org):
    return self.client.get('orgs/%s/teams' % org, msg_type=TeamListResponse)

  def get(self, id):
    return self.client.get('teams/%s' % id, msg_type=TeamResponse)

  def create(self, org, name, repo_names=None, permission=None):
    msg = Team(
      name=name,
      repo_names=repo_names,
      permission=permission)
    return self._create(org=org, msg=msg)

  def _create(self, org, msg):
    return self.client.post('orgs/%s/teams' % org, data=msg)

  def edit(self, id, name, permission=None):

    msg = Team(
