# Path: flask_github/client/messages.py
# class User(msgs.Message):
#   name = msgs.StringField(1)
#   email = msgs.StringField(2)
#   id = msgs.IntegerField(3, default=0)
#   login = msgs.StringField(4)
#   url = msgs.StringField(5)
#   blog = msgs.StringField(6)
#   company = msgs.StringField(7)
#   location = msgs.StringField(8)
#   hireable = msgs.BooleanField(9, default=False)
#   bio = msgs.StringField(10)
#   avatar_url = msgs.StringField(11)
#   gravatar_id = msgs.StringField(12)
#   _links = msgs.MessageField('Link', 13, repeated=True)
#   date = msgs.StringField(14)
#   created_at = msgs.StringField(15)
#   type = msgs.StringField(16)
#   following = msgs.IntegerField(17, default=0)
#   followers = msgs.IntegerField(18, default=0)
#   public_repos = msgs.IntegerField(19, default=0)
#   public_gists = msgs.IntegerField(20, default=0)
#   total_private_repos = msgs.IntegerField(21, default=0)
#   owned_private_repos = msgs.IntegerField(22, default=0)
#   private_gists = msgs.IntegerField(23, default=0)
#   disk_usage = msgs.IntegerField(24, default=0)
#   collaborators = msgs.IntegerField(25, default=0)
#   html_url = msgs.StringField(26)
#   repos_url = msgs.StringField(27)
#   events_url = msgs.StringField(28)
#   members_url = msgs.StringField(29)
#   public_members_url = msgs.StringField(30)
# 
# Path: flask_github/client/requests.py
# class UserResponse(msgs.Message):
#   response = msgs.MessageField('User', 1)


from userskeys import UsersKeys
from usersemails import UsersEmails
from usersfollowers import UsersFollowers
from ..messages import User
from ..requests import UserResponse

from __future__ import unicode_literals

class Users:
  def __init__(self, client):
    self.client = client
    self.keys = UsersKeys(self.client)
    self.emails = UsersEmails(self.client)
    self.followers = UsersFollowers(self.client)

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

  def update(self, name=None, email=None, blog=None, company=None,
      location=None, hireable=False, bio=None):
    msg = User(
      name=name,
      email=email,
      blog=blog,
      company=company,
      location=location,
      hireable=hireable,

# Path: flask_github/client/messages.py
# class User(msgs.Message):
#   name = msgs.StringField(1)
#   email = msgs.StringField(2)
#   id = msgs.IntegerField(3, default=0)
#   login = msgs.StringField(4)
#   url = msgs.StringField(5)
#   blog = msgs.StringField(6)
#   company = msgs.StringField(7)
#   location = msgs.StringField(8)
#   hireable = msgs.BooleanField(9, default=False)
#   bio = msgs.StringField(10)
#   avatar_url = msgs.StringField(11)
#   gravatar_id = msgs.StringField(12)
#   _links = msgs.MessageField('Link', 13, repeated=True)
#   date = msgs.StringField(14)
#   created_at = msgs.StringField(15)
#   type = msgs.StringField(16)
#   following = msgs.IntegerField(17, default=0)
#   followers = msgs.IntegerField(18, default=0)
#   public_repos = msgs.IntegerField(19, default=0)
#   public_gists = msgs.IntegerField(20, default=0)
#   total_private_repos = msgs.IntegerField(21, default=0)
#   owned_private_repos = msgs.IntegerField(22, default=0)
#   private_gists = msgs.IntegerField(23, default=0)
#   disk_usage = msgs.IntegerField(24, default=0)
#   collaborators = msgs.IntegerField(25, default=0)
#   html_url = msgs.StringField(26)
#   repos_url = msgs.StringField(27)
#   events_url = msgs.StringField(28)
#   members_url = msgs.StringField(29)
#   public_members_url = msgs.StringField(30)
# 
# Path: flask_github/client/requests.py
# class UserResponse(msgs.Message):
#   response = msgs.MessageField('User', 1)


# Path: flask_github/client/users/users.py
from userskeys import UsersKeys
from usersemails import UsersEmails
from usersfollowers import UsersFollowers
from ..messages import User
from ..requests import UserResponse

from __future__ import unicode_literals

class Users:
  def __init__(self, client):
    self.client = client
    self.keys = UsersKeys(self.client)
    self.emails = UsersEmails(self.client)
    self.followers = UsersFollowers(self.client)

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

  def update(self, name=None, email=None, blog=None, company=None,
      location=None, hireable=False, bio=None):
    msg = User(
      name=name,
      email=email,
      blog=blog,
      company=company,
      location=location,
      hireable=hireable,

      bio=bio)
