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