Rust API for Gitea, automatically generated https://git.exmods.org/swagger.v1.json
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

328 lines
7.6KB

  1. /*
  2. * Gitea API.
  3. *
  4. * This documentation describes the Gitea API.
  5. *
  6. * OpenAPI spec version: 1.1.1
  7. *
  8. * Generated by: https://github.com/swagger-api/swagger-codegen.git
  9. */
  10. /// EditUserOption : EditUserOption edit user options
  11. #[allow(unused_imports)]
  12. use serde_json::Value;
  13. #[derive(Debug, Serialize, Deserialize)]
  14. pub struct EditUserOption {
  15. #[serde(rename = "active")]
  16. active: Option<bool>,
  17. #[serde(rename = "admin")]
  18. admin: Option<bool>,
  19. #[serde(rename = "allow_create_organization")]
  20. allow_create_organization: Option<bool>,
  21. #[serde(rename = "allow_git_hook")]
  22. allow_git_hook: Option<bool>,
  23. #[serde(rename = "allow_import_local")]
  24. allow_import_local: Option<bool>,
  25. #[serde(rename = "email")]
  26. email: String,
  27. #[serde(rename = "full_name")]
  28. full_name: Option<String>,
  29. #[serde(rename = "location")]
  30. location: Option<String>,
  31. #[serde(rename = "login_name")]
  32. login_name: Option<String>,
  33. #[serde(rename = "max_repo_creation")]
  34. max_repo_creation: Option<i64>,
  35. #[serde(rename = "must_change_password")]
  36. must_change_password: Option<bool>,
  37. #[serde(rename = "password")]
  38. password: Option<String>,
  39. #[serde(rename = "prohibit_login")]
  40. prohibit_login: Option<bool>,
  41. #[serde(rename = "source_id")]
  42. source_id: Option<i64>,
  43. #[serde(rename = "website")]
  44. website: Option<String>
  45. }
  46. impl EditUserOption {
  47. /// EditUserOption edit user options
  48. pub fn new(email: String) -> EditUserOption {
  49. EditUserOption {
  50. active: None,
  51. admin: None,
  52. allow_create_organization: None,
  53. allow_git_hook: None,
  54. allow_import_local: None,
  55. email: email,
  56. full_name: None,
  57. location: None,
  58. login_name: None,
  59. max_repo_creation: None,
  60. must_change_password: None,
  61. password: None,
  62. prohibit_login: None,
  63. source_id: None,
  64. website: None
  65. }
  66. }
  67. pub fn set_active(&mut self, active: bool) {
  68. self.active = Some(active);
  69. }
  70. pub fn with_active(mut self, active: bool) -> EditUserOption {
  71. self.active = Some(active);
  72. self
  73. }
  74. pub fn active(&self) -> Option<&bool> {
  75. self.active.as_ref()
  76. }
  77. pub fn reset_active(&mut self) {
  78. self.active = None;
  79. }
  80. pub fn set_admin(&mut self, admin: bool) {
  81. self.admin = Some(admin);
  82. }
  83. pub fn with_admin(mut self, admin: bool) -> EditUserOption {
  84. self.admin = Some(admin);
  85. self
  86. }
  87. pub fn admin(&self) -> Option<&bool> {
  88. self.admin.as_ref()
  89. }
  90. pub fn reset_admin(&mut self) {
  91. self.admin = None;
  92. }
  93. pub fn set_allow_create_organization(&mut self, allow_create_organization: bool) {
  94. self.allow_create_organization = Some(allow_create_organization);
  95. }
  96. pub fn with_allow_create_organization(mut self, allow_create_organization: bool) -> EditUserOption {
  97. self.allow_create_organization = Some(allow_create_organization);
  98. self
  99. }
  100. pub fn allow_create_organization(&self) -> Option<&bool> {
  101. self.allow_create_organization.as_ref()
  102. }
  103. pub fn reset_allow_create_organization(&mut self) {
  104. self.allow_create_organization = None;
  105. }
  106. pub fn set_allow_git_hook(&mut self, allow_git_hook: bool) {
  107. self.allow_git_hook = Some(allow_git_hook);
  108. }
  109. pub fn with_allow_git_hook(mut self, allow_git_hook: bool) -> EditUserOption {
  110. self.allow_git_hook = Some(allow_git_hook);
  111. self
  112. }
  113. pub fn allow_git_hook(&self) -> Option<&bool> {
  114. self.allow_git_hook.as_ref()
  115. }
  116. pub fn reset_allow_git_hook(&mut self) {
  117. self.allow_git_hook = None;
  118. }
  119. pub fn set_allow_import_local(&mut self, allow_import_local: bool) {
  120. self.allow_import_local = Some(allow_import_local);
  121. }
  122. pub fn with_allow_import_local(mut self, allow_import_local: bool) -> EditUserOption {
  123. self.allow_import_local = Some(allow_import_local);
  124. self
  125. }
  126. pub fn allow_import_local(&self) -> Option<&bool> {
  127. self.allow_import_local.as_ref()
  128. }
  129. pub fn reset_allow_import_local(&mut self) {
  130. self.allow_import_local = None;
  131. }
  132. pub fn set_email(&mut self, email: String) {
  133. self.email = email;
  134. }
  135. pub fn with_email(mut self, email: String) -> EditUserOption {
  136. self.email = email;
  137. self
  138. }
  139. pub fn email(&self) -> &String {
  140. &self.email
  141. }
  142. pub fn set_full_name(&mut self, full_name: String) {
  143. self.full_name = Some(full_name);
  144. }
  145. pub fn with_full_name(mut self, full_name: String) -> EditUserOption {
  146. self.full_name = Some(full_name);
  147. self
  148. }
  149. pub fn full_name(&self) -> Option<&String> {
  150. self.full_name.as_ref()
  151. }
  152. pub fn reset_full_name(&mut self) {
  153. self.full_name = None;
  154. }
  155. pub fn set_location(&mut self, location: String) {
  156. self.location = Some(location);
  157. }
  158. pub fn with_location(mut self, location: String) -> EditUserOption {
  159. self.location = Some(location);
  160. self
  161. }
  162. pub fn location(&self) -> Option<&String> {
  163. self.location.as_ref()
  164. }
  165. pub fn reset_location(&mut self) {
  166. self.location = None;
  167. }
  168. pub fn set_login_name(&mut self, login_name: String) {
  169. self.login_name = Some(login_name);
  170. }
  171. pub fn with_login_name(mut self, login_name: String) -> EditUserOption {
  172. self.login_name = Some(login_name);
  173. self
  174. }
  175. pub fn login_name(&self) -> Option<&String> {
  176. self.login_name.as_ref()
  177. }
  178. pub fn reset_login_name(&mut self) {
  179. self.login_name = None;
  180. }
  181. pub fn set_max_repo_creation(&mut self, max_repo_creation: i64) {
  182. self.max_repo_creation = Some(max_repo_creation);
  183. }
  184. pub fn with_max_repo_creation(mut self, max_repo_creation: i64) -> EditUserOption {
  185. self.max_repo_creation = Some(max_repo_creation);
  186. self
  187. }
  188. pub fn max_repo_creation(&self) -> Option<&i64> {
  189. self.max_repo_creation.as_ref()
  190. }
  191. pub fn reset_max_repo_creation(&mut self) {
  192. self.max_repo_creation = None;
  193. }
  194. pub fn set_must_change_password(&mut self, must_change_password: bool) {
  195. self.must_change_password = Some(must_change_password);
  196. }
  197. pub fn with_must_change_password(mut self, must_change_password: bool) -> EditUserOption {
  198. self.must_change_password = Some(must_change_password);
  199. self
  200. }
  201. pub fn must_change_password(&self) -> Option<&bool> {
  202. self.must_change_password.as_ref()
  203. }
  204. pub fn reset_must_change_password(&mut self) {
  205. self.must_change_password = None;
  206. }
  207. pub fn set_password(&mut self, password: String) {
  208. self.password = Some(password);
  209. }
  210. pub fn with_password(mut self, password: String) -> EditUserOption {
  211. self.password = Some(password);
  212. self
  213. }
  214. pub fn password(&self) -> Option<&String> {
  215. self.password.as_ref()
  216. }
  217. pub fn reset_password(&mut self) {
  218. self.password = None;
  219. }
  220. pub fn set_prohibit_login(&mut self, prohibit_login: bool) {
  221. self.prohibit_login = Some(prohibit_login);
  222. }
  223. pub fn with_prohibit_login(mut self, prohibit_login: bool) -> EditUserOption {
  224. self.prohibit_login = Some(prohibit_login);
  225. self
  226. }
  227. pub fn prohibit_login(&self) -> Option<&bool> {
  228. self.prohibit_login.as_ref()
  229. }
  230. pub fn reset_prohibit_login(&mut self) {
  231. self.prohibit_login = None;
  232. }
  233. pub fn set_source_id(&mut self, source_id: i64) {
  234. self.source_id = Some(source_id);
  235. }
  236. pub fn with_source_id(mut self, source_id: i64) -> EditUserOption {
  237. self.source_id = Some(source_id);
  238. self
  239. }
  240. pub fn source_id(&self) -> Option<&i64> {
  241. self.source_id.as_ref()
  242. }
  243. pub fn reset_source_id(&mut self) {
  244. self.source_id = None;
  245. }
  246. pub fn set_website(&mut self, website: String) {
  247. self.website = Some(website);
  248. }
  249. pub fn with_website(mut self, website: String) -> EditUserOption {
  250. self.website = Some(website);
  251. self
  252. }
  253. pub fn website(&self) -> Option<&String> {
  254. self.website.as_ref()
  255. }
  256. pub fn reset_website(&mut self) {
  257. self.website = None;
  258. }
  259. }