# 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 ..requests import UserResponse
from ..requests import UserListResponse

from __future__ import unicode_literals

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

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

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

  def add(self, repo, collaborator, owner=None):
    return self.client.put(
      'repos/%s/%s/collaborators/%s' % (

# 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/repos/reposcollaborators.py
from ..requests import UserResponse
from ..requests import UserListResponse

from __future__ import unicode_literals

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

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

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

  def add(self, repo, collaborator, owner=None):
    return self.client.put(
      'repos/%s/%s/collaborators/%s' % (

        self.client.user(owner), repo, collaborator), msg_type=UserResponse)
