use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookSponsorshipPendingCancellation {
#[serde(rename = "action")]
pub action: Action,
#[serde(rename = "effective_date", skip_serializing_if = "Option::is_none")]
pub effective_date: Option<String>,
#[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
#[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
pub installation: Option<Box<models::SimpleInstallation>>,
#[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
#[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
pub repository: Option<Box<models::RepositoryWebhooks>>,
#[serde(rename = "sender")]
pub sender: Box<models::SimpleUserWebhooks>,
#[serde(rename = "sponsorship")]
pub sponsorship: Box<models::WebhooksSponsorship>,
}
impl WebhookSponsorshipPendingCancellation {
pub fn new(action: Action, sender: models::SimpleUserWebhooks, sponsorship: models::WebhooksSponsorship) -> WebhookSponsorshipPendingCancellation {
WebhookSponsorshipPendingCancellation {
action,
effective_date: None,
enterprise: None,
installation: None,
organization: None,
repository: None,
sender: Box::new(sender),
sponsorship: Box::new(sponsorship),
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
#[serde(rename = "pending_cancellation")]
PendingCancellation,
}
impl Default for Action {
fn default() -> Action {
Self::PendingCancellation
}
}