Ejemplo n.º 1
0
        /// <summary>
        /// Gets the details of the current user.
        /// </summary>
        /// <returns>User object.</returns>
        public User GetCurrentUser()
        {
            string url      = baseAddress + "/me";
            var    response = ZohoHttpClient.get(url, getQueryParameters());

            return(ProjectParser.getUser(response));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Get details of a user in a project.
        /// </summary>
        /// <param name="project_id">The project_id is the identifier of the project.</param>
        /// <param name="user_id">The user_id is the identifier of the user who is associated with the specified project.</param>
        /// <returns>User object.</returns>
        public User GetAUser(string project_id, string user_id)
        {
            var url      = baseAddress + "/" + project_id + "/users/" + user_id;
            var responce = ZohoHttpClient.get(url, getQueryParameters());

            return(ProjectParser.getUser(responce));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a user for the organization.
        /// </summary>
        /// <param name="user_info">The user_info is the user object with name and email as mandatory attributes.</param>
        /// <returns>User object.</returns>
        public User Create(User user_info)
        {
            string url        = baseAddress;
            var    json       = JsonConvert.SerializeObject(user_info);
            var    jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var response = ZohoHttpClient.post(url, getQueryParameters(jsonstring));

            return(ProjectParser.getUser(response));
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Updates the details of a user.
        /// </summary>
        /// <param name="project_id">The project_id is the identifier of the project.</param>
        /// <param name="user_id">The user_id is the identifier of the user who is associated with the specified project.</param>
        /// <param name="update_info">The update_info is the User object which contains the updation information.</param>
        /// <returns>User object.</returns>
        public User UpdateUser(string project_id, string user_id, User update_info)
        {
            var url        = baseAddress + "/" + project_id + "/users/" + user_id;
            var json       = JsonConvert.SerializeObject(update_info);
            var jsonstring = new Dictionary <object, object>();

            jsonstring.Add("JSONString", json);
            var responce = ZohoHttpClient.put(url, getQueryParameters(jsonstring));

            return(ProjectParser.getUser(responce));
        }