/// <summary>
        /// Gets the desired information about the specified users. This corresponds to the
        /// users.get Hyves method.
        /// </summary>
        /// <param name="usernames">The list of requested usernames.</param>
        /// <param name="responsefields">Get extra information from the requested user</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <returns>The information about the specified users; null if the call fails.</returns>
        public Collection <User> GetUsersByUserName(Collection <string> usernames, HyvesUserResponsefield responsefields, bool useFancyLayout)
        {
            if ((usernames == null) || (usernames.Count == 0))
            {
                throw new ArgumentNullException("usernames");
            }

            StringBuilder usernameBuilder = new StringBuilder();

            if (usernames != null)
            {
                foreach (string name in usernames)
                {
                    if (usernameBuilder.Length != 0)
                    {
                        usernameBuilder.Append(",");
                    }
                    usernameBuilder.Append(name);
                }
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["username"]          = usernameBuilder.ToString();
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetByUsername, useFancyLayout);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessResponse <User>("user"));
            }

            return(null);
        }
        /// <summary>
        /// Gets the desired information about the user the supplied access token is for. This corresponds to the
        /// users.getLoggedin Hyves method.
        /// </summary>
        /// <param name="responsefields">Get extra information from the requested user</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <returns>The information about the user; null if the call fails.</returns>
        public User GetLoggedinUser(HyvesUserResponsefield responsefields, bool useFancyLayout)
        {
            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetLoggedin, useFancyLayout);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <User>("user"));
            }

            return(null);
        }
        /// <summary>
        /// Search for friends based on basic queries (keywords like city, name).
        /// This corresponds to the users.searchInFriends Hyves method.
        /// </summary>
        /// <param name="searchterms">The searchterms to search for.</param>
        /// <param name="responsefields">Get extra information from the requested user</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <returns>The information about the users; null if the call fails.</returns>
        public Collection <User> SearchInFriends(string searchterms, HyvesUserResponsefield responsefields, bool useFancyLayout)
        {
            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["searchterms"]       = searchterms;
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersSearchInFriends, useFancyLayout);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessResponse <User>("user"));
            }

            return(null);
        }
        private string ConvertResponsefieldsToString(HyvesUserResponsefield responsefields, HyvesUserPrivateResponsefield privateResponseFields)
        {
            StringBuilder responsefieldsBuilder = new StringBuilder();

            if (responsefields == HyvesUserResponsefield.All)
            {
                responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString <HyvesUserResponsefield>());
            }
            else
            {
                var userResponsefields = Enum.GetValues(typeof(HyvesUserResponsefield));
                foreach (HyvesUserResponsefield userResponseField in userResponsefields)
                {
                    if (EnumHelper.HasFlag(responsefields, userResponseField))
                    {
                        responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(userResponseField)));
                    }
                }
            }

            if (privateResponseFields == HyvesUserPrivateResponsefield.All)
            {
                responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString <HyvesUserPrivateResponsefield>());
            }
            else if (privateResponseFields != HyvesUserPrivateResponsefield.None)
            {
                var userPrivateResponsefields = Enum.GetValues(typeof(HyvesUserPrivateResponsefield));
                foreach (HyvesUserPrivateResponsefield userPrivateResponseField in userPrivateResponsefields)
                {
                    if (EnumHelper.HasFlag(privateResponseFields, userPrivateResponseField))
                    {
                        responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(privateResponseFields)));
                    }
                }
            }

            responsefieldsBuilder = responsefieldsBuilder.Replace(
                string.Format("{0},", EnumHelper.GetDescription(HyvesUserResponsefield.All)), string.Empty);
            responsefieldsBuilder = responsefieldsBuilder.Replace(
                string.Format("{0},", EnumHelper.GetDescription(HyvesUserPrivateResponsefield.All)), string.Empty);
            string returnValue = responsefieldsBuilder.ToString();

            return(returnValue.Substring(0, returnValue.Length - 1));
        }
    /// <summary>
    /// Gets the desired information about the specified user. 
    /// </summary>
    /// <param name="userId">The requested user Id</param>
    /// <param name="responsefields">Get extra information from the requested user</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <returns>The information about the specific user; null if the call fails.</returns>
    public User GetUser(string userId, HyvesUserResponsefield responsefields, bool useFancyLayout)
    {
      if (string.IsNullOrEmpty(userId))
      {
        throw new ArgumentException("userId");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["userid"] = userId;
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGet, useFancyLayout);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<User>("user");
      }

      return null;
    }
        /// <summary>
        /// Gets the users from the specified hub. This corresponds to the
        /// users.getByHubLastlogin Hyves method.
        /// </summary>
        /// <param name="hubId">The requested hub Id.</param>
        /// <param name="responsefields">Get extra information from the requested user</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <param name="page">The requested page.</param>
        /// <param name="resultsPerPage">The number of results per page.</param>
        /// <returns>The information about the users sorted by lastlogin; null if the call fails.</returns>
        public Collection <User> GetHub(string hubId, HyvesUserResponsefield responsefields, bool useFancyLayout, int page, int resultsPerPage)
        {
            if (string.IsNullOrEmpty(hubId))
            {
                throw new ArgumentNullException("hubId");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["hubid"]             = hubId;
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetByHubLastlogin, useFancyLayout, page, resultsPerPage);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessResponse <User>("user"));
            }

            return(null);
        }
        /// <summary>
        /// Gets the desired information about the specified user.
        /// </summary>
        /// <param name="userId">The requested user Id</param>
        /// <param name="responsefields">Get extra information from the requested user</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <returns>The information about the specific user; null if the call fails.</returns>
        public User GetUser(string userId, HyvesUserResponsefield responsefields, bool useFancyLayout)
        {
            if (string.IsNullOrEmpty(userId))
            {
                throw new ArgumentException("userId");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["userid"]            = userId;
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGet, useFancyLayout);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessSingleItemResponse <User>("user"));
            }

            return(null);
        }
 /// <summary>
 /// Gets the desired information about the specified users. This corresponds to the
 /// users.get Hyves method.
 /// </summary>
 /// <param name="usernames">The list of requested usernames.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specified users; null if the call fails.</returns>
 public Collection<User> GetUsersByUserName(Collection<string> usernames, HyvesUserResponsefield responsefields)
 {
   return GetUsersByUserName(usernames, responsefields, false);
 }
    /// <summary>
    /// Gets the desired information about the specified users. This corresponds to the
    /// users.get Hyves method.
    /// </summary>
    /// <param name="usernames">The list of requested usernames.</param>
    /// <param name="responsefields">Get extra information from the requested user</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <returns>The information about the specified users; null if the call fails.</returns>
    public Collection<User> GetUsersByUserName(Collection<string> usernames, HyvesUserResponsefield responsefields, bool useFancyLayout)
    {
      if ((usernames == null) || (usernames.Count == 0))
      {
        throw new ArgumentNullException("usernames");
      }

      StringBuilder usernameBuilder = new StringBuilder();
      if (usernames != null)
      {
        foreach (string name in usernames)
        {
          if (usernameBuilder.Length != 0)
          {
            usernameBuilder.Append(",");
          }
          usernameBuilder.Append(name);
        }
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["username"] = usernameBuilder.ToString();
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetByUsername, useFancyLayout);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessResponse<User>("user");
      }

      return null;
    }
 /// <summary>
 /// Gets the desired information about the specified user.
 /// </summary>
 /// <param name="username">The username of the requested user.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specific user; null if the call fails.</returns>
 public User GetUserByUserName(string username, HyvesUserResponsefield responsefields)
 {
     return(GetUserByUserName(username, responsefields, false));
 }
 /// <summary>
 /// Gets the desired information about the specified user. 
 /// </summary>
 /// <param name="username">The username of the requested user.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specific user; null if the call fails.</returns>
 public User GetUserByUserName(string username, HyvesUserResponsefield responsefields)
 {
   return GetUserByUserName(username, responsefields, false);
 }
 /// <summary>
 /// Gets the users from the specified hub. This corresponds to the
 /// users.getByHubLastlogin Hyves method.
 /// </summary>
 /// <param name="hubId">The requested hub Id.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
 /// <returns>The information about the users sorted by lastlogin; null if the call fails.</returns>
 public Collection<User> GetHub(string hubId, HyvesUserResponsefield responsefields, bool useFancyLayout)
 {
   return GetHub(hubId, responsefields, useFancyLayout, -1, -1);
 }
 /// <summary>
 /// Gets the desired information about the user the supplied access token is for. This corresponds to the
 /// users.getLoggedin Hyves method.
 /// </summary>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the user; null if the call fails.</returns>
 public User GetLoggedinUser(HyvesUserResponsefield responsefields)
 {
     return(GetLoggedinUser(responsefields, false));
 }
 /// <summary>
 /// Gets the desired information about the friends. 
 /// </summary>
 /// <param name="userId">The requested user Id</param>
 /// <param name="responsefields">Get extra information from the requested users</param>
 /// <returns>The information about the friends; null if the call fails.</returns>
 public Collection<User> GetByFriendLastlogin(string userId, HyvesUserResponsefield responsefields)
 {
   return GetByFriendLastlogin(userId, responsefields, false, 1, 100);
 }
 /// <summary>
 /// Gets the desired information about the friends for the current loggedin user with different sort-options.
 /// </summary>
 /// <param name="sortType">The sort type.</param>
 /// <param name="responsefields">Get extra information from the requested users</param>
 /// <returns>The information about the friends; null if the call fails.</returns>
 public Collection<User> GetFriendsByLoggedinSorted(HyvesUserSortType sortType, HyvesUserResponsefield responsefields)
 {
   return GetFriendsByLoggedinSorted(sortType, responsefields, false, -1, -1);
 }
 /// <summary>
 /// Gets the users from the specified hub. This corresponds to the
 /// users.getByHubLastlogin Hyves method.
 /// </summary>
 /// <param name="hubId">The requested hub Id.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
 /// <returns>The information about the users sorted by lastlogin; null if the call fails.</returns>
 public Collection <User> GetHub(string hubId, HyvesUserResponsefield responsefields, bool useFancyLayout)
 {
     return(GetHub(hubId, responsefields, useFancyLayout, -1, -1));
 }
 /// <summary>
 /// Gets the desired information about the user the supplied access token is for. This corresponds to the
 /// users.getLoggedin Hyves method.
 /// </summary>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the user; null if the call fails.</returns>
 public User GetLoggedinUser(HyvesUserResponsefield responsefields)
 {
   return GetLoggedinUser(responsefields, false);
 }
        /// <summary>
        /// Gets the desired information about the friends for the current loggedin user with different sort-options.
        /// </summary>
        /// <param name="sortType">The sort type.</param>
        /// <param name="responsefields">Get extra information from the requested users</param>
        /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
        /// <returns>The information about the friends; null if the call fails.</returns>
        public Collection <User> GetFriendsByLoggedinSorted(HyvesUserSortType sortType, HyvesUserResponsefield responsefields, bool useFancyLayout, int page, int resultsPerPage)
        {
            if (sortType == HyvesUserSortType.Unknown)
            {
                throw new ArgumentNullException("sortType");
            }

            HyvesRequest request = new HyvesRequest(this.session);

            request.Parameters["sorttype"]          = EnumHelper.GetDescription(sortType);
            request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

            HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetFriendsByLoggedinSorted, useFancyLayout, page, resultsPerPage);

            if (response.Status == HyvesResponseStatus.Succeeded)
            {
                return(response.ProcessResponse <User>("user"));
            }

            return(null);
        }
 /// <summary>
 /// Gets the desired information about the friends for the current loggedin user with different sort-options.
 /// </summary>
 /// <param name="sortType">The sort type.</param>
 /// <param name="responsefields">Get extra information from the requested users</param>
 /// <returns>The information about the friends; null if the call fails.</returns>
 public Collection <User> GetFriendsByLoggedinSorted(HyvesUserSortType sortType, HyvesUserResponsefield responsefields)
 {
     return(GetFriendsByLoggedinSorted(sortType, responsefields, false, -1, -1));
 }
 /// <summary>
 /// Gets the desired information about the specified user.
 /// </summary>
 /// <param name="userId">The requested user Id</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specific user; null if the call fails.</returns>
 public User GetUser(string userId, HyvesUserResponsefield responsefields)
 {
     return(GetUser(userId, responsefields, false));
 }
 /// <summary>
 /// Gets the desired information about the friends.
 /// </summary>
 /// <param name="userId">The requested user Id</param>
 /// <param name="responsefields">Get extra information from the requested users</param>
 /// <returns>The information about the friends; null if the call fails.</returns>
 public Collection <User> GetByFriendLastlogin(string userId, HyvesUserResponsefield responsefields)
 {
     return(GetByFriendLastlogin(userId, responsefields, false, 1, 100));
 }
 /// <summary>
 /// Gets the desired information about the specified users. This corresponds to the
 /// users.get Hyves method.
 /// </summary>
 /// <param name="userIds">The list of requested user Ids.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
 /// <returns>The information about the specified users; null if the call fails.</returns>
 public Collection <User> GetUsers(Collection <string> userIds, HyvesUserResponsefield responsefields, bool useFancyLayout)
 {
     return(GetUsers(userIds, responsefields, HyvesUserPrivateResponsefield.None, useFancyLayout));
 }
    /// <summary>
    /// Gets the desired information about the user the supplied access token is for. This corresponds to the
    /// users.getLoggedin Hyves method.
    /// </summary>
    /// <param name="responsefields">Get extra information from the requested user</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <returns>The information about the user; null if the call fails.</returns>
    public User GetLoggedinUser(HyvesUserResponsefield responsefields, bool useFancyLayout)
    {
      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetLoggedin, useFancyLayout);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessSingleItemResponse<User>("user");
      }

      return null;
    }
 /// <summary>
 /// Search for friends based on basic queries (keywords like city, name). This corresponds to the
 /// users.searchInFriends Hyves method.
 /// </summary>
 /// <param name="searchterms">The searchterms to search for.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the users; null if the call fails.</returns>
 public Collection <User> SearchInFriends(string searchterms, HyvesUserResponsefield responsefields)
 {
     return(SearchInFriends(searchterms, responsefields, false));
 }
 /// <summary>
 /// Gets the desired information about the specified user. 
 /// </summary>
 /// <param name="userId">The requested user Id</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specific user; null if the call fails.</returns>
 public User GetUser(string userId, HyvesUserResponsefield responsefields)
 {
   return GetUser(userId, responsefields, false);
 }
    /// <summary>
    /// Search for friends based on basic queries (keywords like city, name). 
    /// This corresponds to the users.searchInFriends Hyves method.
    /// </summary>
    /// <param name="searchterms">The searchterms to search for.</param>
    /// <param name="responsefields">Get extra information from the requested user</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <returns>The information about the users; null if the call fails.</returns>
    public Collection<User> SearchInFriends(string searchterms, HyvesUserResponsefield responsefields, bool useFancyLayout)
    {
      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["searchterms"] = searchterms;
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersSearchInFriends, useFancyLayout);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessResponse<User>("user");
      }

      return null;
    }
    /// <summary>
    /// Gets the desired information about the friends for the current loggedin user with different sort-options.
    /// </summary>
    /// <param name="sortType">The sort type.</param>
    /// <param name="responsefields">Get extra information from the requested users</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <returns>The information about the friends; null if the call fails.</returns>
    public Collection<User> GetFriendsByLoggedinSorted(HyvesUserSortType sortType, HyvesUserResponsefield responsefields, bool useFancyLayout, int page, int resultsPerPage)
    {
      if (sortType == HyvesUserSortType.Unknown)
      {
        throw new ArgumentNullException("sortType");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["sorttype"] = EnumHelper.GetDescription(sortType);
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetFriendsByLoggedinSorted, useFancyLayout, page, resultsPerPage);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessResponse<User>("user");
      }

      return null;
    }
 /// <summary>
 /// Gets the desired information about the specified users. This corresponds to the
 /// users.get Hyves method.
 /// </summary>
 /// <param name="userIds">The list of requested user Ids.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specified users; null if the call fails.</returns>
 public Collection <User> GetUsers(Collection <string> userIds, HyvesUserResponsefield responsefields)
 {
     return(GetUsers(userIds, responsefields, false));
 }
    /// <summary>
    /// Gets the users from the specified hub. This corresponds to the
    /// users.getByHubLastlogin Hyves method.
    /// </summary>
    /// <param name="hubId">The requested hub Id.</param>
    /// <param name="responsefields">Get extra information from the requested user</param>
    /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
    /// <param name="page">The requested page.</param>
    /// <param name="resultsPerPage">The number of results per page.</param>
    /// <returns>The information about the users sorted by lastlogin; null if the call fails.</returns>
    public Collection<User> GetHub(string hubId, HyvesUserResponsefield responsefields, bool useFancyLayout, int page, int resultsPerPage)
    {
      if (string.IsNullOrEmpty(hubId))
      {
        throw new ArgumentNullException("hubId");
      }

      HyvesRequest request = new HyvesRequest(this.session);
      request.Parameters["hubid"] = hubId;
      request.Parameters["ha_responsefields"] = ConvertResponsefieldsToString(responsefields, HyvesUserPrivateResponsefield.None);

      HyvesResponse response = request.InvokeMethod(HyvesMethod.UsersGetByHubLastlogin, useFancyLayout, page, resultsPerPage);
      if (response.Status == HyvesResponseStatus.Succeeded)
      {
        return response.ProcessResponse<User>("user");
      }

      return null;
    }
 /// <summary>
 /// Gets the desired information about the specified users. This corresponds to the
 /// users.get Hyves method.
 /// </summary>
 /// <param name="userIds">The list of requested user Ids.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <param name="useFancyLayout">Display information the same way that that is being done on the site, including things like smilies.</param>
 /// <returns>The information about the specified users; null if the call fails.</returns>
 public Collection<User> GetUsers(Collection<string> userIds, HyvesUserResponsefield responsefields, bool useFancyLayout)
 {
   return GetUsers(userIds, responsefields, HyvesUserPrivateResponsefield.None, useFancyLayout);
 }
 /// <summary>
 /// Search for friends based on basic queries (keywords like city, name). This corresponds to the
 /// users.searchInFriends Hyves method.
 /// </summary>
 /// <param name="searchterms">The searchterms to search for.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the users; null if the call fails.</returns>
 public Collection<User> SearchInFriends(string searchterms, HyvesUserResponsefield responsefields)
 {
   return SearchInFriends(searchterms, responsefields, false);
 }
 /// <summary>
 /// Gets the desired information about the specified users. This corresponds to the
 /// users.get Hyves method.
 /// </summary>
 /// <param name="usernames">The list of requested usernames.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specified users; null if the call fails.</returns>
 public Collection <User> GetUsersByUserName(Collection <string> usernames, HyvesUserResponsefield responsefields)
 {
     return(GetUsersByUserName(usernames, responsefields, false));
 }
    private string ConvertResponsefieldsToString(HyvesUserResponsefield responsefields, HyvesUserPrivateResponsefield privateResponseFields)
    {
      StringBuilder responsefieldsBuilder = new StringBuilder();
      if (responsefields == HyvesUserResponsefield.All)
      {
        responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString<HyvesUserResponsefield>());
      }
      else
      {
        var userResponsefields = Enum.GetValues(typeof(HyvesUserResponsefield));
        foreach (HyvesUserResponsefield userResponseField in userResponsefields)
        {
          if (EnumHelper.HasFlag(responsefields, userResponseField))
          {
            responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(userResponseField)));
          }
        }
      }

      if (privateResponseFields == HyvesUserPrivateResponsefield.All)
      {
        responsefieldsBuilder.Append(EnumHelper.GetAllValuesAsString<HyvesUserPrivateResponsefield>());
      }
      else if (privateResponseFields != HyvesUserPrivateResponsefield.None)
      {
        var userPrivateResponsefields = Enum.GetValues(typeof(HyvesUserPrivateResponsefield));
        foreach (HyvesUserPrivateResponsefield userPrivateResponseField in userPrivateResponsefields)
        {
          if (EnumHelper.HasFlag(privateResponseFields, userPrivateResponseField))
          {
            responsefieldsBuilder.Append(string.Format("{0},", EnumHelper.GetDescription(privateResponseFields)));
          }
        }
      }

      responsefieldsBuilder = responsefieldsBuilder.Replace(
        string.Format("{0},", EnumHelper.GetDescription(HyvesUserResponsefield.All)), string.Empty);
      responsefieldsBuilder = responsefieldsBuilder.Replace(
        string.Format("{0},", EnumHelper.GetDescription(HyvesUserPrivateResponsefield.All)), string.Empty);
      string returnValue = responsefieldsBuilder.ToString();
      return returnValue.Substring(0, returnValue.Length - 1);
    }
 /// <summary>
 /// Gets the desired information about the specified users. This corresponds to the
 /// users.get Hyves method.
 /// </summary>
 /// <param name="userIds">The list of requested user Ids.</param>
 /// <param name="responsefields">Get extra information from the requested user</param>
 /// <returns>The information about the specified users; null if the call fails.</returns>
 public Collection<User> GetUsers(Collection<string> userIds, HyvesUserResponsefield responsefields)
 {
   return GetUsers(userIds, responsefields, false);
 }