# Path: flask_github/client/requests.py
# class UserListResponse(msgs.Message):
#   response = msgs.MessageField('User', 1, repeated=True)


from ..requests import UserListResponse

from __future__ import unicode_literals

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

  def list_followers(self, user=None):
    url = 'users/%s/followers' % user if (
      user is not None and user != self.client._username) else 'user/followers'
    return self.client.get(url, msg_type=UserListResponse)

  def list_following(self, user=None):
    url = 'users/%s/following' % user if (
      user is not None and user != self.client._username) else 'user/following'

# Path: flask_github/client/requests.py
# class UserListResponse(msgs.Message):
#   response = msgs.MessageField('User', 1, repeated=True)


# Path: flask_github/client/users/usersfollowers.py
from ..requests import UserListResponse

from __future__ import unicode_literals

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

  def list_followers(self, user=None):
    url = 'users/%s/followers' % user if (
      user is not None and user != self.client._username) else 'user/followers'
    return self.client.get(url, msg_type=UserListResponse)

  def list_following(self, user=None):
    url = 'users/%s/following' % user if (
      user is not None and user != self.client._username) else 'user/following'

    return self.client.get(url, msg_type=UserListResponse)
