openapi_github/models/
webhook_marketplace_purchase_cancelled.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 WebhookMarketplacePurchaseCancelled {
16    #[serde(rename = "action")]
17    pub action: Action,
18    #[serde(rename = "effective_date")]
19    pub effective_date: String,
20    #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
21    pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
22    #[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
23    pub installation: Option<Box<models::SimpleInstallation>>,
24    #[serde(rename = "marketplace_purchase")]
25    pub marketplace_purchase: Box<models::WebhooksMarketplacePurchase>,
26    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
27    pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
28    #[serde(rename = "previous_marketplace_purchase", skip_serializing_if = "Option::is_none")]
29    pub previous_marketplace_purchase: Option<Box<models::WebhooksPreviousMarketplacePurchase>>,
30    #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
31    pub repository: Option<Box<models::RepositoryWebhooks>>,
32    #[serde(rename = "sender")]
33    pub sender: Box<models::SimpleUserWebhooks>,
34}
35
36impl WebhookMarketplacePurchaseCancelled {
37    pub fn new(action: Action, effective_date: String, marketplace_purchase: models::WebhooksMarketplacePurchase, sender: models::SimpleUserWebhooks) -> WebhookMarketplacePurchaseCancelled {
38        WebhookMarketplacePurchaseCancelled {
39            action,
40            effective_date,
41            enterprise: None,
42            installation: None,
43            marketplace_purchase: Box::new(marketplace_purchase),
44            organization: None,
45            previous_marketplace_purchase: None,
46            repository: None,
47            sender: Box::new(sender),
48        }
49    }
50}
51/// 
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum Action {
54    #[serde(rename = "cancelled")]
55    Cancelled,
56}
57
58impl Default for Action {
59    fn default() -> Action {
60        Self::Cancelled
61    }
62}
63