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