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