Exemplo n.º 1
0
        /// <summary>
        /// This method is used to update the existing category on the server.
        /// </summary>
        /// <param name="apiCategoryUpdate">Category details (Category name and category description) to be updated.</param>
        /// <returns>Status of updating the category on the server.</returns>

        public ApiResponse UpdateCategory(ApiCategoryUpdate apiCategoryUpdate)
        {
            var requestUrl = _baseUrl + "/categories";
            var result     = _serverClientV2.Put(apiCategoryUpdate, requestUrl);
            var response   = new ApiResponse();

            if (result != null)
            {
                return(JsonConvert.DeserializeObject <ApiResponse>(result.Content));
            }
            else
            {
                return(response);
            }
        }
        /// <summary>
        /// This method is used to activate or de-activate the user account in the server.
        /// </summary>
        /// <param name="user">Username or email id of the user.</param>
        /// <param name="activationRequest">Status to activate or deactivate the user.</param>
        /// <returns>Status of activate or deactivate the user.</returns>

        public ApiResponse ActivateDeactivateuser([FromUri] string user, [FromBody] ApiUserActivationRequest activationRequest)
        {
            var requestUrl = _baseUrl + "/users/" + user;
            var result     = _serverClientV2.Put(activationRequest, requestUrl);
            var response   = new ApiResponse();

            if (result != null)
            {
                return(JsonConvert.DeserializeObject <ApiResponse>(result.Content));
            }
            else
            {
                return(response);
            }
        }