openapi_github/models/
webhook_meta_deleted.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 WebhookMetaDeleted {
16    #[serde(rename = "action")]
17    pub action: Action,
18    #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
19    pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
20    #[serde(rename = "hook")]
21    pub hook: Box<models::WebhookMetaDeletedHook>,
22    /// The id of the modified webhook.
23    #[serde(rename = "hook_id")]
24    pub hook_id: i32,
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", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub repository: Option<Option<Box<models::NullableRepositoryWebhooks>>>,
31    #[serde(rename = "sender", skip_serializing_if = "Option::is_none")]
32    pub sender: Option<Box<models::SimpleUserWebhooks>>,
33}
34
35impl WebhookMetaDeleted {
36    pub fn new(action: Action, hook: models::WebhookMetaDeletedHook, hook_id: i32) -> WebhookMetaDeleted {
37        WebhookMetaDeleted {
38            action,
39            enterprise: None,
40            hook: Box::new(hook),
41            hook_id,
42            installation: None,
43            organization: None,
44            repository: None,
45            sender: None,
46        }
47    }
48}
49/// 
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Action {
52    #[serde(rename = "deleted")]
53    Deleted,
54}
55
56impl Default for Action {
57    fn default() -> Action {
58        Self::Deleted
59    }
60}
61