openapi_github/models/
webhook_code_scanning_alert_reopened_alert.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// WebhookCodeScanningAlertReopenedAlert : The code scanning alert involved in the event.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhookCodeScanningAlertReopenedAlert {
17    /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ.`
18    #[serde(rename = "created_at")]
19    pub created_at: String,
20    /// The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
21    #[serde(rename = "dismissed_at", deserialize_with = "Option::deserialize")]
22    pub dismissed_at: Option<String>,
23    #[serde(rename = "dismissed_by", deserialize_with = "Option::deserialize")]
24    pub dismissed_by: Option<serde_json::Value>,
25    /// The reason for dismissing or closing the alert. Can be one of: `false positive`, `won't fix`, and `used in tests`.
26    #[serde(rename = "dismissed_reason", deserialize_with = "Option::deserialize")]
27    pub dismissed_reason: Option<String>,
28    /// The GitHub URL of the alert resource.
29    #[serde(rename = "html_url")]
30    pub html_url: String,
31    #[serde(rename = "most_recent_instance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub most_recent_instance: Option<Option<Box<models::AlertInstance>>>,
33    /// The code scanning alert number.
34    #[serde(rename = "number")]
35    pub number: i32,
36    #[serde(rename = "rule")]
37    pub rule: Box<models::WebhookCodeScanningAlertClosedByUserAlertRule>,
38    /// State of a code scanning alert.
39    #[serde(rename = "state")]
40    pub state: State,
41    #[serde(rename = "tool")]
42    pub tool: Box<models::WebhookCodeScanningAlertClosedByUserAlertTool>,
43    #[serde(rename = "url")]
44    pub url: String,
45}
46
47impl WebhookCodeScanningAlertReopenedAlert {
48    /// The code scanning alert involved in the event.
49    pub fn new(created_at: String, dismissed_at: Option<String>, dismissed_by: Option<serde_json::Value>, dismissed_reason: Option<String>, html_url: String, number: i32, rule: models::WebhookCodeScanningAlertClosedByUserAlertRule, state: State, tool: models::WebhookCodeScanningAlertClosedByUserAlertTool, url: String) -> WebhookCodeScanningAlertReopenedAlert {
50        WebhookCodeScanningAlertReopenedAlert {
51            created_at,
52            dismissed_at,
53            dismissed_by,
54            dismissed_reason,
55            html_url,
56            most_recent_instance: None,
57            number,
58            rule: Box::new(rule),
59            state,
60            tool: Box::new(tool),
61            url,
62        }
63    }
64}
65/// State of a code scanning alert.
66#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
67pub enum State {
68    #[serde(rename = "open")]
69    Open,
70    #[serde(rename = "dismissed")]
71    Dismissed,
72    #[serde(rename = "fixed")]
73    Fixed,
74}
75
76impl Default for State {
77    fn default() -> State {
78        Self::Open
79    }
80}
81