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