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