openapi_github/models/
webhook_security_advisory_updated.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhookSecurityAdvisoryUpdated {
16 #[serde(rename = "action")]
17 pub action: Action,
18 #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
19 pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
20 #[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
21 pub installation: Option<Box<models::SimpleInstallation>>,
22 #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
23 pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
24 #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
25 pub repository: Option<Box<models::RepositoryWebhooks>>,
26 #[serde(rename = "security_advisory")]
27 pub security_advisory: Box<models::WebhooksSecurityAdvisory>,
28 #[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
29 pub sender: Option<Box<models::SimpleUserWebhooks>>,
30}
31
32impl WebhookSecurityAdvisoryUpdated {
33 pub fn new(action: Action, security_advisory: models::WebhooksSecurityAdvisory) -> WebhookSecurityAdvisoryUpdated {
34 WebhookSecurityAdvisoryUpdated {
35 action,
36 enterprise: None,
37 installation: None,
38 organization: None,
39 repository: None,
40 security_advisory: Box::new(security_advisory),
41 sender: None,
42 }
43 }
44}
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum Action {
48 #[serde(rename = "updated")]
49 Updated,
50}
51
52impl Default for Action {
53 fn default() -> Action {
54 Self::Updated
55 }
56}
57