openapi_github/models/
secret_scanning_alert_webhook.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SecretScanningAlertWebhook {
16    /// The security alert number.
17    #[serde(rename = "number", skip_serializing_if = "Option::is_none")]
18    pub number: Option<i32>,
19    /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
20    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
21    pub created_at: Option<String>,
22    /// The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
23    #[serde(rename = "updated_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub updated_at: Option<Option<String>>,
25    /// The REST API URL of the alert resource.
26    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
27    pub url: Option<String>,
28    /// The GitHub URL of the alert resource.
29    #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
30    pub html_url: Option<String>,
31    /// The REST API URL of the code locations for this alert.
32    #[serde(rename = "locations_url", skip_serializing_if = "Option::is_none")]
33    pub locations_url: Option<String>,
34    #[serde(rename = "resolution", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub resolution: Option<Option<models::SecretScanningAlertResolutionWebhook>>,
36    /// The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
37    #[serde(rename = "resolved_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub resolved_at: Option<Option<String>>,
39    #[serde(rename = "resolved_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub resolved_by: Option<Option<Box<models::NullableSimpleUser>>>,
41    /// An optional comment to resolve an alert.
42    #[serde(rename = "resolution_comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub resolution_comment: Option<Option<String>>,
44    /// The type of secret that secret scanning detected.
45    #[serde(rename = "secret_type", skip_serializing_if = "Option::is_none")]
46    pub secret_type: Option<String>,
47    /// The token status as of the latest validity check.
48    #[serde(rename = "validity", skip_serializing_if = "Option::is_none")]
49    pub validity: Option<Validity>,
50    /// Whether push protection was bypassed for the detected secret.
51    #[serde(rename = "push_protection_bypassed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
52    pub push_protection_bypassed: Option<Option<bool>>,
53    #[serde(rename = "push_protection_bypassed_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
54    pub push_protection_bypassed_by: Option<Option<Box<models::NullableSimpleUser>>>,
55    /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
56    #[serde(rename = "push_protection_bypassed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
57    pub push_protection_bypassed_at: Option<Option<String>>,
58}
59
60impl SecretScanningAlertWebhook {
61    pub fn new() -> SecretScanningAlertWebhook {
62        SecretScanningAlertWebhook {
63            number: None,
64            created_at: None,
65            updated_at: None,
66            url: None,
67            html_url: None,
68            locations_url: None,
69            resolution: None,
70            resolved_at: None,
71            resolved_by: None,
72            resolution_comment: None,
73            secret_type: None,
74            validity: None,
75            push_protection_bypassed: None,
76            push_protection_bypassed_by: None,
77            push_protection_bypassed_at: None,
78        }
79    }
80}
81/// The token status as of the latest validity check.
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum Validity {
84    #[serde(rename = "active")]
85    Active,
86    #[serde(rename = "inactive")]
87    Inactive,
88    #[serde(rename = "unknown")]
89    Unknown,
90}
91
92impl Default for Validity {
93    fn default() -> Validity {
94        Self::Active
95    }
96}
97