From 224e361420565372950a741f3fd028e2abc7b9f9 Mon Sep 17 00:00:00 2001 From: Dominik Meyer Date: Sun, 18 Feb 2024 13:53:24 +0100 Subject: [PATCH] ADD: added missing methods to set attributes --- include/Redmine/User.hpp | 43 ++++++++++++++++++++++++++++++++++++++++ src/Redmine/User.cpp | 20 +++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/include/Redmine/User.hpp b/include/Redmine/User.hpp index dfad989..96e59c8 100644 --- a/include/Redmine/User.hpp +++ b/include/Redmine/User.hpp @@ -146,7 +146,50 @@ namespace Redmine * @param firstname - the new firstname of the user */ void setFirstName(const std::string &firstname); + + /** + * @brief Set the Last Name of the user object + * + * *Remember:* you are only updating the local object! + * + * To change something on the server to have to call the appropriate API method. + * + * @param lastname - the new lastname of the user + */ + void setLastName(const std::string &lastname); + /** + * @brief Set the login of the user object + * + * *Remember:* you are only updating the local object! + * + * To change something on the server to have to call the appropriate API method. + * + * @param login - the new login of the user + */ + void setLogin(const std::string &login); + + /** + * @brief Set the id of the user object + * + * *Remember:* you are only updating the local object! + * + * To change something on the server to have to call the appropriate API method. + * + * @param id - the new id of the user + */ + void setId(const std::string &id); + + /** + * @brief Set the email of the user object + * + * *Remember:* you are only updating the local object! + * + * To change something on the server to have to call the appropriate API method. + * + * @param email - the new email of the user + */ + void setMail(const std::string &mail); }; // class User diff --git a/src/Redmine/User.cpp b/src/Redmine/User.cpp index a1dad86..cd2dffd 100644 --- a/src/Redmine/User.cpp +++ b/src/Redmine/User.cpp @@ -82,4 +82,24 @@ std::string Redmine::User::getLogin() const void Redmine::User::setFirstName(const std::string &firstname) { data_["user"]["firstname"]=firstname; +} + +void Redmine::User::setLastName(const std::string &lastname) +{ + data_["user"]["lastname"]=lastname; +} + +void Redmine::User::setLogin(const std::string &login) +{ + data_["user"]["login"]=login; +} + +void Redmine::User::setId(const std::string &id) +{ + data_["user"]["id"]=id; +} + +void Redmine::User::setMail(const std::string &mail) +{ + data_["user"]["mail"]=mail; } \ No newline at end of file