openapi_github/models/
webhook_sponsorship_pending_cancellation.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 WebhookSponsorshipPendingCancellation {
16    #[serde(rename = "action")]
17    pub action: Action,
18    /// The `pending_cancellation` and `pending_tier_change` event types will include the date the cancellation or tier change will take effect.
19    #[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/// 
50#[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