openapi_github/models/
webhook_sponsorship_pending_tier_change.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 WebhookSponsorshipPendingTierChange {
16    #[serde(rename = "action")]
17    pub action: Action,
18    #[serde(rename = "changes")]
19    pub changes: Box<models::WebhooksChanges8>,
20    /// The `pending_cancellation` and `pending_tier_change` event types will include the date the cancellation or tier change will take effect.
21    #[serde(rename = "effective_date", skip_serializing_if = "Option::is_none")]
22    pub effective_date: Option<String>,
23    #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
24    pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
25    #[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
26    pub installation: Option<Box<models::SimpleInstallation>>,
27    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
28    pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
29    #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
30    pub repository: Option<Box<models::RepositoryWebhooks>>,
31    #[serde(rename = "sender")]
32    pub sender: Box<models::SimpleUserWebhooks>,
33    #[serde(rename = "sponsorship")]
34    pub sponsorship: Box<models::WebhooksSponsorship>,
35}
36
37impl WebhookSponsorshipPendingTierChange {
38    pub fn new(action: Action, changes: models::WebhooksChanges8, sender: models::SimpleUserWebhooks, sponsorship: models::WebhooksSponsorship) -> WebhookSponsorshipPendingTierChange {
39        WebhookSponsorshipPendingTierChange {
40            action,
41            changes: Box::new(changes),
42            effective_date: None,
43            enterprise: None,
44            installation: None,
45            organization: None,
46            repository: None,
47            sender: Box::new(sender),
48            sponsorship: Box::new(sponsorship),
49        }
50    }
51}
52/// 
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum Action {
55    #[serde(rename = "pending_tier_change")]
56    PendingTierChange,
57}
58
59impl Default for Action {
60    fn default() -> Action {
61        Self::PendingTierChange
62    }
63}
64