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