From ed310f70015cc2a9d634aca6a8787b9a865fe0eb Mon Sep 17 00:00:00 2001 From: Cyborus Date: Tue, 14 May 2024 11:36:44 -0400 Subject: make issue and pr state an enum --- src/generated/structs.rs | 17 +++++++++++------ swagger.v1.json | 4 ++++ 2 files changed, 15 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, pub repository: Option, - pub state: Option, + pub state: Option, pub title: Option, #[serde(with = "time::serde::rfc3339::option")] pub updated_at: Option, @@ -1738,7 +1738,7 @@ pub struct Milestone { pub due_on: Option, pub id: Option, pub open_issues: Option, - pub state: Option, + pub state: Option, pub title: Option, #[serde(with = "time::serde::rfc3339::option")] pub updated_at: Option, @@ -1822,7 +1822,7 @@ pub struct NotificationSubject { pub latest_comment_html_url: Option, #[serde(deserialize_with = "crate::none_if_blank_url")] pub latest_comment_url: Option, - pub state: Option, + pub state: Option, pub title: Option, #[serde(rename = "type")] pub r#type: Option, @@ -2035,7 +2035,7 @@ pub struct PullRequest { pub patch_url: Option, pub pin_order: Option, pub requested_reviewers: Option>, - pub state: Option, + pub state: Option, pub title: Option, #[serde(with = "time::serde::rfc3339::option")] pub updated_at: Option, @@ -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 { diff --git a/swagger.v1.json b/swagger.v1.json index dcc3709..0de864a 100644 --- a/swagger.v1.json +++ b/swagger.v1.json @@ -21435,6 +21435,10 @@ "StateType": { "description": "StateType issue state type", "type": "string", + "enum": [ + "open", + "closed" + ], "x-go-package": "code.gitea.io/gitea/modules/structs" }, "StopWatch": { -- cgit v1.2.3