openapi_github/models/
team_full.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/// TeamFull : Groups of organization members that gives permissions on specified repositories.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TeamFull {
17    /// Unique identifier of the team
18    #[serde(rename = "id")]
19    pub id: i32,
20    #[serde(rename = "node_id")]
21    pub node_id: String,
22    /// URL for the team
23    #[serde(rename = "url")]
24    pub url: String,
25    #[serde(rename = "html_url")]
26    pub html_url: String,
27    /// Name of the team
28    #[serde(rename = "name")]
29    pub name: String,
30    #[serde(rename = "slug")]
31    pub slug: String,
32    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
33    pub description: Option<String>,
34    /// The level of privacy this team should have
35    #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")]
36    pub privacy: Option<Privacy>,
37    /// The notification setting the team has set
38    #[serde(rename = "notification_setting", skip_serializing_if = "Option::is_none")]
39    pub notification_setting: Option<NotificationSetting>,
40    /// Permission that the team will have for its repositories
41    #[serde(rename = "permission")]
42    pub permission: String,
43    #[serde(rename = "members_url")]
44    pub members_url: String,
45    #[serde(rename = "repositories_url")]
46    pub repositories_url: String,
47    #[serde(rename = "parent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub parent: Option<Option<Box<models::NullableTeamSimple>>>,
49    #[serde(rename = "members_count")]
50    pub members_count: i32,
51    #[serde(rename = "repos_count")]
52    pub repos_count: i32,
53    #[serde(rename = "created_at")]
54    pub created_at: String,
55    #[serde(rename = "updated_at")]
56    pub updated_at: String,
57    #[serde(rename = "organization")]
58    pub organization: Box<models::TeamOrganization>,
59    /// Distinguished Name (DN) that team maps to within LDAP environment
60    #[serde(rename = "ldap_dn", skip_serializing_if = "Option::is_none")]
61    pub ldap_dn: Option<String>,
62}
63
64impl TeamFull {
65    /// Groups of organization members that gives permissions on specified repositories.
66    pub fn new(id: i32, node_id: String, url: String, html_url: String, name: String, slug: String, description: Option<String>, permission: String, members_url: String, repositories_url: String, members_count: i32, repos_count: i32, created_at: String, updated_at: String, organization: models::TeamOrganization) -> TeamFull {
67        TeamFull {
68            id,
69            node_id,
70            url,
71            html_url,
72            name,
73            slug,
74            description,
75            privacy: None,
76            notification_setting: None,
77            permission,
78            members_url,
79            repositories_url,
80            parent: None,
81            members_count,
82            repos_count,
83            created_at,
84            updated_at,
85            organization: Box::new(organization),
86            ldap_dn: None,
87        }
88    }
89}
90/// The level of privacy this team should have
91#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
92pub enum Privacy {
93    #[serde(rename = "closed")]
94    Closed,
95    #[serde(rename = "secret")]
96    Secret,
97}
98
99impl Default for Privacy {
100    fn default() -> Privacy {
101        Self::Closed
102    }
103}
104/// The notification setting the team has set
105#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
106pub enum NotificationSetting {
107    #[serde(rename = "notifications_enabled")]
108    Enabled,
109    #[serde(rename = "notifications_disabled")]
110    Disabled,
111}
112
113impl Default for NotificationSetting {
114    fn default() -> NotificationSetting {
115        Self::Enabled
116    }
117}
118