コード例 #1
0
        /// <summary>
        /// Updates the user password.
        /// </summary>
        /// <param name="accountId">Account ID.</param>
        /// <param name="id">User ID.</param>
        /// <param name="updatePassword">Update password.</param>
        /// <param name="client">REST client.</param>
        /// <returns></returns>
        private static bool UpdatePassword(int accountId, int id, UpdatePassword updatePassword, IVcRestClient client = null)
        {
            client = client ?? VcClient.GetRestClient();
            Request  request  = new Request(Method.Put, BuildUpdatePasswordUrl(accountId, id), updatePassword);
            Response response = client.Request(request);

            return(response.StatusCode == HttpStatusCode.OK);
        }
コード例 #2
0
        /// <summary>
        /// Updates the user password.
        /// </summary>
        /// <param name="accountId">Account ID.</param>
        /// <param name="id">User ID.</param>
        /// <param name="oldPassword">Old password.</param>
        /// <param name="newPassword">New password.</param>
        /// <param name="client">REST client.</param>
        /// <returns></returns>
        private static bool UpdatePassword(int accountId, int id, string oldPassword, string newPassword, IVcRestClient client = null)
        {
            UpdatePassword updatePassword = new UpdatePassword {
                OldPassword = oldPassword, NewPassword = newPassword
            };

            return(UpdatePassword(accountId, id, updatePassword, client));
        }