openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// TeamFull : Groups of organization members that gives permissions on specified repositories.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TeamFull {
    /// Unique identifier of the team
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    /// URL for the team
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "html_url")]
    pub html_url: String,
    /// Name of the team
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "slug")]
    pub slug: String,
    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
    pub description: Option<String>,
    /// The level of privacy this team should have
    #[serde(rename = "privacy", skip_serializing_if = "Option::is_none")]
    pub privacy: Option<Privacy>,
    /// The notification setting the team has set
    #[serde(rename = "notification_setting", skip_serializing_if = "Option::is_none")]
    pub notification_setting: Option<NotificationSetting>,
    /// Permission that the team will have for its repositories
    #[serde(rename = "permission")]
    pub permission: String,
    #[serde(rename = "members_url")]
    pub members_url: String,
    #[serde(rename = "repositories_url")]
    pub repositories_url: String,
    #[serde(rename = "parent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub parent: Option<Option<Box<models::NullableTeamSimple>>>,
    #[serde(rename = "members_count")]
    pub members_count: i32,
    #[serde(rename = "repos_count")]
    pub repos_count: i32,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "organization")]
    pub organization: Box<models::TeamOrganization>,
    /// Distinguished Name (DN) that team maps to within LDAP environment
    #[serde(rename = "ldap_dn", skip_serializing_if = "Option::is_none")]
    pub ldap_dn: Option<String>,
}

impl TeamFull {
    /// Groups of organization members that gives permissions on specified repositories.
    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 {
        TeamFull {
            id,
            node_id,
            url,
            html_url,
            name,
            slug,
            description,
            privacy: None,
            notification_setting: None,
            permission,
            members_url,
            repositories_url,
            parent: None,
            members_count,
            repos_count,
            created_at,
            updated_at,
            organization: Box::new(organization),
            ldap_dn: None,
        }
    }
}
/// The level of privacy this team should have
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Privacy {
    #[serde(rename = "closed")]
    Closed,
    #[serde(rename = "secret")]
    Secret,
}

impl Default for Privacy {
    fn default() -> Privacy {
        Self::Closed
    }
}
/// The notification setting the team has set
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum NotificationSetting {
    #[serde(rename = "notifications_enabled")]
    Enabled,
    #[serde(rename = "notifications_disabled")]
    Disabled,
}

impl Default for NotificationSetting {
    fn default() -> NotificationSetting {
        Self::Enabled
    }
}