openapi_github/models/
webhooks_team.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/// WebhooksTeam : Groups of organization members that gives permissions on specified repositories.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhooksTeam {
17    #[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
18    pub deleted: Option<bool>,
19    /// Description of the team
20    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub description: Option<Option<String>>,
22    #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
23    pub html_url: Option<String>,
24    /// Unique identifier of the team
25    #[serde(rename = "id")]
26    pub id: i32,
27    #[serde(rename = "members_url", skip_serializing_if = "Option::is_none")]
28    pub members_url: Option<String>,
29    /// Name of the team
30    #[serde(rename = "name")]
31    pub name: String,
32    #[serde(rename = "node_id", skip_serializing_if = "Option::is_none")]
33    pub node_id: Option<String>,
34    #[serde(rename = "parent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub parent: Option<Option<Box<models::WebhooksTeamParent>>>,
36    /// Permission that the team will have for its repositories
37    #[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
38    pub permission: Option<String>,
39    #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")]
40    pub privacy: Option<Privacy>,
41    #[serde(rename = "notification_setting", skip_serializing_if = "Option::is_none")]
42    pub notification_setting: Option<NotificationSetting>,
43    #[serde(rename = "repositories_url", skip_serializing_if = "Option::is_none")]
44    pub repositories_url: Option<String>,
45    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
46    pub slug: Option<String>,
47    /// URL for the team
48    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
49    pub url: Option<String>,
50}
51
52impl WebhooksTeam {
53    /// Groups of organization members that gives permissions on specified repositories.
54    pub fn new(id: i32, name: String) -> WebhooksTeam {
55        WebhooksTeam {
56            deleted: None,
57            description: None,
58            html_url: None,
59            id,
60            members_url: None,
61            name,
62            node_id: None,
63            parent: None,
64            permission: None,
65            privacy: None,
66            notification_setting: None,
67            repositories_url: None,
68            slug: None,
69            url: None,
70        }
71    }
72}
73/// 
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
75pub enum Privacy {
76    #[serde(rename = "open")]
77    Open,
78    #[serde(rename = "closed")]
79    Closed,
80    #[serde(rename = "secret")]
81    Secret,
82}
83
84impl Default for Privacy {
85    fn default() -> Privacy {
86        Self::Open
87    }
88}
89/// 
90#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
91pub enum NotificationSetting {
92    #[serde(rename = "notifications_enabled")]
93    Enabled,
94    #[serde(rename = "notifications_disabled")]
95    Disabled,
96}
97
98impl Default for NotificationSetting {
99    fn default() -> NotificationSetting {
100        Self::Enabled
101    }
102}
103