openapi_github/models/
organization_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 OrganizationSecretScanningAlert {
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    /// The type of secret that secret scanning detected.
44    #[serde(rename = "secret_type", skip_serializing_if = "Option::is_none")]
45    pub secret_type: Option<String>,
46    /// 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).\"
47    #[serde(rename = "secret_type_display_name", skip_serializing_if = "Option::is_none")]
48    pub secret_type_display_name: Option<String>,
49    /// The secret that was detected.
50    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
51    pub secret: Option<String>,
52    #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
53    pub repository: Option<Box<models::SimpleRepository>>,
54    /// Whether push protection was bypassed for the detected secret.
55    #[serde(rename = "push_protection_bypassed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
56    pub push_protection_bypassed: Option<Option<bool>>,
57    #[serde(rename = "push_protection_bypassed_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
58    pub push_protection_bypassed_by: Option<Option<Box<models::NullableSimpleUser>>>,
59    /// The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
60    #[serde(rename = "push_protection_bypassed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
61    pub push_protection_bypassed_at: Option<Option<String>>,
62    /// The comment that was optionally added when this alert was closed
63    #[serde(rename = "resolution_comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
64    pub resolution_comment: Option<Option<String>>,
65    /// The token status as of the latest validity check.
66    #[serde(rename = "validity", skip_serializing_if = "Option::is_none")]
67    pub validity: Option<Validity>,
68}
69
70impl OrganizationSecretScanningAlert {
71    pub fn new() -> OrganizationSecretScanningAlert {
72        OrganizationSecretScanningAlert {
73            number: None,
74            created_at: None,
75            updated_at: None,
76            url: None,
77            html_url: None,
78            locations_url: None,
79            state: None,
80            resolution: None,
81            resolved_at: None,
82            resolved_by: None,
83            secret_type: None,
84            secret_type_display_name: None,
85            secret: None,
86            repository: None,
87            push_protection_bypassed: None,
88            push_protection_bypassed_by: None,
89            push_protection_bypassed_at: None,
90            resolution_comment: None,
91            validity: None,
92        }
93    }
94}
95/// The token status as of the latest validity check.
96#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
97pub enum Validity {
98    #[serde(rename = "active")]
99    Active,
100    #[serde(rename = "inactive")]
101    Inactive,
102    #[serde(rename = "unknown")]
103    Unknown,
104}
105
106impl Default for Validity {
107    fn default() -> Validity {
108        Self::Active
109    }
110}
111