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};

/// TeamMembership : Team Membership
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TeamMembership {
    #[serde(rename = "url")]
    pub url: String,
    /// The role of the user in the team.
    #[serde(rename = "role")]
    pub role: Role,
    /// The state of the user's membership in the team.
    #[serde(rename = "state")]
    pub state: State,
}

impl TeamMembership {
    /// Team Membership
    pub fn new(url: String, role: Role, state: State) -> TeamMembership {
        TeamMembership {
            url,
            role,
            state,
        }
    }
}
/// The role of the user in the team.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Role {
    #[serde(rename = "member")]
    Member,
    #[serde(rename = "maintainer")]
    Maintainer,
}

impl Default for Role {
    fn default() -> Role {
        Self::Member
    }
}
/// The state of the user's membership in the team.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum State {
    #[serde(rename = "active")]
    Active,
    #[serde(rename = "pending")]
    Pending,
}

impl Default for State {
    fn default() -> State {
        Self::Active
    }
}