openapi_github/models/
webhook_code_scanning_alert_reopened_by_user.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhookCodeScanningAlertReopenedByUser {
16 #[serde(rename = "action")]
17 pub action: Action,
18 #[serde(rename = "alert")]
19 pub alert: Box<models::WebhookCodeScanningAlertReopenedByUserAlert>,
20 #[serde(rename = "commit_oid")]
22 pub commit_oid: String,
23 #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
24 pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
25 #[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
26 pub installation: Option<Box<models::SimpleInstallation>>,
27 #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
28 pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
29 #[serde(rename = "ref")]
31 pub r#ref: String,
32 #[serde(rename = "repository")]
33 pub repository: Box<models::RepositoryWebhooks>,
34 #[serde(rename = "sender")]
35 pub sender: Box<models::SimpleUserWebhooks>,
36}
37
38impl WebhookCodeScanningAlertReopenedByUser {
39 pub fn new(action: Action, alert: models::WebhookCodeScanningAlertReopenedByUserAlert, commit_oid: String, r#ref: String, repository: models::RepositoryWebhooks, sender: models::SimpleUserWebhooks) -> WebhookCodeScanningAlertReopenedByUser {
40 WebhookCodeScanningAlertReopenedByUser {
41 action,
42 alert: Box::new(alert),
43 commit_oid,
44 enterprise: None,
45 installation: None,
46 organization: None,
47 r#ref,
48 repository: Box::new(repository),
49 sender: Box::new(sender),
50 }
51 }
52}
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum Action {
56 #[serde(rename = "reopened_by_user")]
57 ReopenedByUser,
58}
59
60impl Default for Action {
61 fn default() -> Action {
62 Self::ReopenedByUser
63 }
64}
65