openapi_github/models/
webhooks_team_1.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/// WebhooksTeam1 : Groups of organization members that gives permissions on specified repositories.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhooksTeam1 {
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    /// Whether team members will receive notifications when their team is @mentioned
42    #[serde(rename = "notification_setting", skip_serializing_if = "Option::is_none")]
43    pub notification_setting: Option<NotificationSetting>,
44    #[serde(rename = "repositories_url", skip_serializing_if = "Option::is_none")]
45    pub repositories_url: Option<String>,
46    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
47    pub slug: Option<String>,
48    /// URL for the team
49    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
50    pub url: Option<String>,
51}
52
53impl WebhooksTeam1 {
54    /// Groups of organization members that gives permissions on specified repositories.
55    pub fn new(id: i32, name: String) -> WebhooksTeam1 {
56        WebhooksTeam1 {
57            deleted: None,
58            description: None,
59            html_url: None,
60            id,
61            members_url: None,
62            name,
63            node_id: None,
64            parent: None,
65            permission: None,
66            privacy: None,
67            notification_setting: None,
68            repositories_url: None,
69            slug: None,
70            url: None,
71        }
72    }
73}
74/// 
75#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
76pub enum Privacy {
77    #[serde(rename = "open")]
78    Open,
79    #[serde(rename = "closed")]
80    Closed,
81    #[serde(rename = "secret")]
82    Secret,
83}
84
85impl Default for Privacy {
86    fn default() -> Privacy {
87        Self::Open
88    }
89}
90/// Whether team members will receive notifications when their team is @mentioned
91#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
92pub enum NotificationSetting {
93    #[serde(rename = "notifications_enabled")]
94    Enabled,
95    #[serde(rename = "notifications_disabled")]
96    Disabled,
97}
98
99impl Default for NotificationSetting {
100    fn default() -> NotificationSetting {
101        Self::Enabled
102    }
103}
104