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.

151 lines
3.1KB

  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. /// WatchInfo : WatchInfo represents an API watch status of one repository
  11. #[allow(unused_imports)]
  12. use serde_json::Value;
  13. #[derive(Debug, Serialize, Deserialize)]
  14. pub struct WatchInfo {
  15. #[serde(rename = "created_at")]
  16. created_at: Option<String>,
  17. #[serde(rename = "ignored")]
  18. ignored: Option<bool>,
  19. #[serde(rename = "reason")]
  20. reason: Option<Value>,
  21. #[serde(rename = "repository_url")]
  22. repository_url: Option<String>,
  23. #[serde(rename = "subscribed")]
  24. subscribed: Option<bool>,
  25. #[serde(rename = "url")]
  26. url: Option<String>
  27. }
  28. impl WatchInfo {
  29. /// WatchInfo represents an API watch status of one repository
  30. pub fn new() -> WatchInfo {
  31. WatchInfo {
  32. created_at: None,
  33. ignored: None,
  34. reason: None,
  35. repository_url: None,
  36. subscribed: None,
  37. url: None
  38. }
  39. }
  40. pub fn set_created_at(&mut self, created_at: String) {
  41. self.created_at = Some(created_at);
  42. }
  43. pub fn with_created_at(mut self, created_at: String) -> WatchInfo {
  44. self.created_at = Some(created_at);
  45. self
  46. }
  47. pub fn created_at(&self) -> Option<&String> {
  48. self.created_at.as_ref()
  49. }
  50. pub fn reset_created_at(&mut self) {
  51. self.created_at = None;
  52. }
  53. pub fn set_ignored(&mut self, ignored: bool) {
  54. self.ignored = Some(ignored);
  55. }
  56. pub fn with_ignored(mut self, ignored: bool) -> WatchInfo {
  57. self.ignored = Some(ignored);
  58. self
  59. }
  60. pub fn ignored(&self) -> Option<&bool> {
  61. self.ignored.as_ref()
  62. }
  63. pub fn reset_ignored(&mut self) {
  64. self.ignored = None;
  65. }
  66. pub fn set_reason(&mut self, reason: Value) {
  67. self.reason = Some(reason);
  68. }
  69. pub fn with_reason(mut self, reason: Value) -> WatchInfo {
  70. self.reason = Some(reason);
  71. self
  72. }
  73. pub fn reason(&self) -> Option<&Value> {
  74. self.reason.as_ref()
  75. }
  76. pub fn reset_reason(&mut self) {
  77. self.reason = None;
  78. }
  79. pub fn set_repository_url(&mut self, repository_url: String) {
  80. self.repository_url = Some(repository_url);
  81. }
  82. pub fn with_repository_url(mut self, repository_url: String) -> WatchInfo {
  83. self.repository_url = Some(repository_url);
  84. self
  85. }
  86. pub fn repository_url(&self) -> Option<&String> {
  87. self.repository_url.as_ref()
  88. }
  89. pub fn reset_repository_url(&mut self) {
  90. self.repository_url = None;
  91. }
  92. pub fn set_subscribed(&mut self, subscribed: bool) {
  93. self.subscribed = Some(subscribed);
  94. }
  95. pub fn with_subscribed(mut self, subscribed: bool) -> WatchInfo {
  96. self.subscribed = Some(subscribed);
  97. self
  98. }
  99. pub fn subscribed(&self) -> Option<&bool> {
  100. self.subscribed.as_ref()
  101. }
  102. pub fn reset_subscribed(&mut self) {
  103. self.subscribed = None;
  104. }
  105. pub fn set_url(&mut self, url: String) {
  106. self.url = Some(url);
  107. }
  108. pub fn with_url(mut self, url: String) -> WatchInfo {
  109. self.url = Some(url);
  110. self
  111. }
  112. pub fn url(&self) -> Option<&String> {
  113. self.url.as_ref()
  114. }
  115. pub fn reset_url(&mut self) {
  116. self.url = None;
  117. }
  118. }