openapi_github/models/
webhook_code_scanning_alert_reopened_by_user.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 WebhookCodeScanningAlertReopenedByUser {
16    #[serde(rename = "action")]
17    pub action: Action,
18    #[serde(rename = "alert")]
19    pub alert: Box<models::WebhookCodeScanningAlertReopenedByUserAlert>,
20    /// The commit SHA of the code scanning alert. When the action is `reopened_by_user` or `closed_by_user`, the event was triggered by the `sender` and this value will be empty.
21    #[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    /// The Git reference of the code scanning alert. When the action is `reopened_by_user` or `closed_by_user`, the event was triggered by the `sender` and this value will be empty.
30    #[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/// 
54#[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