openapi_github/models/
teams_update_legacy_request.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 TeamsUpdateLegacyRequest {
16    /// The name of the team.
17    #[serde(rename = "name")]
18    pub name: String,
19    /// The description of the team.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are:   **For a non-nested team:**    * `secret` - only visible to organization owners and members of this team.    * `closed` - visible to all members of this organization.   **For a parent or child team:**    * `closed` - visible to all members of this organization.
23    #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")]
24    pub privacy: Option<Privacy>,
25    /// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are:   * `notifications_enabled` - team members receive notifications when the team is @mentioned.    * `notifications_disabled` - no one receives notifications.
26    #[serde(rename = "notification_setting", skip_serializing_if = "Option::is_none")]
27    pub notification_setting: Option<NotificationSetting>,
28    /// **Deprecated**. The permission that new repositories will be added to the team with when none is specified.
29    #[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
30    pub permission: Option<Permission>,
31    /// The ID of a team to set as the parent team.
32    #[serde(rename = "parent_team_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub parent_team_id: Option<Option<i32>>,
34}
35
36impl TeamsUpdateLegacyRequest {
37    pub fn new(name: String) -> TeamsUpdateLegacyRequest {
38        TeamsUpdateLegacyRequest {
39            name,
40            description: None,
41            privacy: None,
42            notification_setting: None,
43            permission: None,
44            parent_team_id: None,
45        }
46    }
47}
48/// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are:   **For a non-nested team:**    * `secret` - only visible to organization owners and members of this team.    * `closed` - visible to all members of this organization.   **For a parent or child team:**    * `closed` - visible to all members of this organization.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Privacy {
51    #[serde(rename = "secret")]
52    Secret,
53    #[serde(rename = "closed")]
54    Closed,
55}
56
57impl Default for Privacy {
58    fn default() -> Privacy {
59        Self::Secret
60    }
61}
62/// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are:   * `notifications_enabled` - team members receive notifications when the team is @mentioned.    * `notifications_disabled` - no one receives notifications.
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum NotificationSetting {
65    #[serde(rename = "notifications_enabled")]
66    Enabled,
67    #[serde(rename = "notifications_disabled")]
68    Disabled,
69}
70
71impl Default for NotificationSetting {
72    fn default() -> NotificationSetting {
73        Self::Enabled
74    }
75}
76/// **Deprecated**. The permission that new repositories will be added to the team with when none is specified.
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
78pub enum Permission {
79    #[serde(rename = "pull")]
80    Pull,
81    #[serde(rename = "push")]
82    Push,
83    #[serde(rename = "admin")]
84    Admin,
85}
86
87impl Default for Permission {
88    fn default() -> Permission {
89        Self::Pull
90    }
91}
92