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

/// IssueComment : The [comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment) itself.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IssueComment {
    /// How the author is associated with the repository.
    #[serde(rename = "author_association")]
    pub author_association: AuthorAssociation,
    /// Contents of the issue comment
    #[serde(rename = "body")]
    pub body: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "html_url")]
    pub html_url: String,
    /// Unique identifier of the issue comment
    #[serde(rename = "id")]
    pub id: i64,
    #[serde(rename = "issue_url")]
    pub issue_url: String,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "performed_via_github_app", deserialize_with = "Option::deserialize")]
    pub performed_via_github_app: Option<Box<models::NullableIntegration>>,
    #[serde(rename = "reactions")]
    pub reactions: Box<models::Reactions>,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// URL for the issue comment
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
    pub user: Option<Box<models::User>>,
}

impl IssueComment {
    /// The [comment](https://docs.github.com/rest/issues/comments#get-an-issue-comment) itself.
    pub fn new(author_association: AuthorAssociation, body: String, created_at: String, html_url: String, id: i64, issue_url: String, node_id: String, performed_via_github_app: Option<models::NullableIntegration>, reactions: models::Reactions, updated_at: String, url: String, user: Option<models::User>) -> IssueComment {
        IssueComment {
            author_association,
            body,
            created_at,
            html_url,
            id,
            issue_url,
            node_id,
            performed_via_github_app: performed_via_github_app.map(Box::new),
            reactions: Box::new(reactions),
            updated_at,
            url,
            user: user.map(Box::new),
        }
    }
}
/// How the author is associated with the repository.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AuthorAssociation {
    #[serde(rename = "COLLABORATOR")]
    Collaborator,
    #[serde(rename = "CONTRIBUTOR")]
    Contributor,
    #[serde(rename = "FIRST_TIMER")]
    FirstTimer,
    #[serde(rename = "FIRST_TIME_CONTRIBUTOR")]
    FirstTimeContributor,
    #[serde(rename = "MANNEQUIN")]
    Mannequin,
    #[serde(rename = "MEMBER")]
    Member,
    #[serde(rename = "NONE")]
    None,
    #[serde(rename = "OWNER")]
    Owner,
}

impl Default for AuthorAssociation {
    fn default() -> AuthorAssociation {
        Self::Collaborator
    }
}