summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2024-05-14 17:41:07 +0200
committerCyborus <cyborus@noreply.codeberg.org>2024-05-14 17:41:07 +0200
commit716192d4d4768f35e0556853e752254efaa61768 (patch)
tree1284706589df100fa3d64de0da5f574dfc3cc57d /src
parentMerge pull request 'improve ssh url deserialization tests' (#54) from improve... (diff)
parentmake issue and pr state an enum (diff)
downloadforgejo-api-716192d4d4768f35e0556853e752254efaa61768.tar.xz
forgejo-api-716192d4d4768f35e0556853e752254efaa61768.zip
Merge pull request 'make issue and pr state an enum' (#55) from issue-state-enum into main
Diffstat (limited to 'src')
-rw-r--r--src/generated/structs.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/generated/structs.rs b/src/generated/structs.rs
index e727b5d..f7b8ce8 100644
--- a/src/generated/structs.rs
+++ b/src/generated/structs.rs
@@ -1445,7 +1445,7 @@ pub struct Issue {
#[serde(rename = "ref")]
pub r#ref: Option<String>,
pub repository: Option<RepositoryMeta>,
- pub state: Option<String>,
+ pub state: Option<StateType>,
pub title: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
@@ -1738,7 +1738,7 @@ pub struct Milestone {
pub due_on: Option<time::OffsetDateTime>,
pub id: Option<u64>,
pub open_issues: Option<u64>,
- pub state: Option<String>,
+ pub state: Option<StateType>,
pub title: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
@@ -1822,7 +1822,7 @@ pub struct NotificationSubject {
pub latest_comment_html_url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub latest_comment_url: Option<url::Url>,
- pub state: Option<String>,
+ pub state: Option<StateType>,
pub title: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
@@ -2035,7 +2035,7 @@ pub struct PullRequest {
pub patch_url: Option<url::Url>,
pub pin_order: Option<u64>,
pub requested_reviewers: Option<Vec<User>>,
- pub state: Option<String>,
+ pub state: Option<StateType>,
pub title: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
@@ -2327,9 +2327,14 @@ pub struct ServerVersion {
}
/// StateType issue state type
-#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
-pub struct StateType {}
+#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
+pub enum StateType {
+ #[serde(rename = "open")]
+ Open,
+ #[serde(rename = "closed")]
+ Closed,
+}
/// StopWatch represent a running stopwatch
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct StopWatch {