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

/// WebhookCommitCommentCreatedComment : The [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment) resource.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookCommitCommentCreatedComment {
    /// How the author is associated with the repository.
    #[serde(rename = "author_association")]
    pub author_association: AuthorAssociation,
    /// The text of the comment.
    #[serde(rename = "body")]
    pub body: String,
    /// The SHA of the commit to which the comment applies.
    #[serde(rename = "commit_id")]
    pub commit_id: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "html_url")]
    pub html_url: String,
    /// The ID of the commit comment.
    #[serde(rename = "id")]
    pub id: i32,
    /// The line of the blob to which the comment applies. The last line of the range for a multi-line comment
    #[serde(rename = "line", deserialize_with = "Option::deserialize")]
    pub line: Option<i32>,
    /// The node ID of the commit comment.
    #[serde(rename = "node_id")]
    pub node_id: String,
    /// The relative path of the file to which the comment applies.
    #[serde(rename = "path", deserialize_with = "Option::deserialize")]
    pub path: Option<String>,
    /// The line index in the diff to which the comment applies.
    #[serde(rename = "position", deserialize_with = "Option::deserialize")]
    pub position: Option<i32>,
    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
    pub reactions: Option<Box<models::Reactions>>,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
    pub user: Option<Box<models::User>>,
}

impl WebhookCommitCommentCreatedComment {
    /// The [commit comment](https://docs.github.com/rest/commits/comments#get-a-commit-comment) resource.
    pub fn new(author_association: AuthorAssociation, body: String, commit_id: String, created_at: String, html_url: String, id: i32, line: Option<i32>, node_id: String, path: Option<String>, position: Option<i32>, updated_at: String, url: String, user: Option<models::User>) -> WebhookCommitCommentCreatedComment {
        WebhookCommitCommentCreatedComment {
            author_association,
            body,
            commit_id,
            created_at,
            html_url,
            id,
            line,
            node_id,
            path,
            position,
            reactions: None,
            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
    }
}