openapi_github/models/
secret_scanning_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SecretScanningAlert {
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 = "state", skip_serializing_if = "Option::is_none")]
35    pub state: Option<models::SecretScanningAlertState>,
36    #[serde(rename = "resolution", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub resolution: Option<Option<models::SecretScanningAlertResolution>>,
38    /// The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
39    #[serde(rename = "resolved_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub resolved_at: Option<Option<String>>,
41    #[serde(rename = "resolved_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub resolved_by: Option<Option<Box<models::NullableSimpleUser>>>,
43    /// An optional comment to resolve an alert.
44    #[serde(rename = "resolution_comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub resolution_comment: Option<Option<String>>,
46    /// The type of secret that secret scanning detected.
47    #[serde(rename = "secret_type", skip_serializing_if = "Option::is_none")]
48    pub secret_type: Option<String>,
49    /// User-friendly name for the detected secret, matching the `secret_type`. For a list of built-in patterns, see \"[Secret scanning patterns](https://docs.github.com/code-security/secret-scanning/secret-scanning-patterns#supported-secrets-for-advanced-security).\"
50    #[serde(rename = "secret_type_display_name", skip_serializing_if = "Option::is_none")]
51    pub secret_type_display_name: Option<String>,
52    /// The secret that was detected.
53    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
54    pub secret: Option<String>,
55    /// Whether push protection was bypassed for the detected secret.
56    #[serde(rename = "push_protection_bypassed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
57    pub push_protection_bypassed: Option<Option<bool>>,
58    #[serde(rename = "push_protection_bypassed_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
59    pub push_protection_bypassed_by: Option<Option<Box<models::NullableSimpleUser>>>,
60    /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
61    #[serde(rename = "push_protection_bypassed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
62    pub push_protection_bypassed_at: Option<Option<String>>,
63    /// The token status as of the latest validity check.
64    #[serde(rename = "validity", skip_serializing_if = "Option::is_none")]
65    pub validity: Option<Validity>,
66}
67
68impl SecretScanningAlert {
69    pub fn new() -> SecretScanningAlert {
70        SecretScanningAlert {
71            number: None,
72            created_at: None,
73            updated_at: None,
74            url: None,
75            html_url: None,
76            locations_url: None,
77            state: None,
78            resolution: None,
79            resolved_at: None,
80            resolved_by: None,
81            resolution_comment: None,
82            secret_type: None,
83            secret_type_display_name: None,
84            secret: None,
85            push_protection_bypassed: None,
86            push_protection_bypassed_by: None,
87            push_protection_bypassed_at: None,
88            validity: None,
89        }
90    }
91}
92/// The token status as of the latest validity check.
93#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
94pub enum Validity {
95    #[serde(rename = "active")]
96    Active,
97    #[serde(rename = "inactive")]
98    Inactive,
99    #[serde(rename = "unknown")]
100    Unknown,
101}
102
103impl Default for Validity {
104    fn default() -> Validity {
105        Self::Active
106    }
107}
108