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

/// WebhooksReview : The review that was affected.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhooksReview {
    #[serde(rename = "_links")]
    pub _links: Box<models::WebhooksReviewLinks>,
    /// How the author is associated with the repository.
    #[serde(rename = "author_association")]
    pub author_association: AuthorAssociation,
    /// The text of the review.
    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
    pub body: Option<String>,
    /// A commit SHA for the review.
    #[serde(rename = "commit_id")]
    pub commit_id: String,
    #[serde(rename = "html_url")]
    pub html_url: String,
    /// Unique identifier of the review
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "pull_request_url")]
    pub pull_request_url: String,
    #[serde(rename = "state")]
    pub state: String,
    #[serde(rename = "submitted_at", deserialize_with = "Option::deserialize")]
    pub submitted_at: Option<String>,
    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
    pub user: Option<Box<models::User>>,
}

impl WebhooksReview {
    /// The review that was affected.
    pub fn new(_links: models::WebhooksReviewLinks, author_association: AuthorAssociation, body: Option<String>, commit_id: String, html_url: String, id: i32, node_id: String, pull_request_url: String, state: String, submitted_at: Option<String>, user: Option<models::User>) -> WebhooksReview {
        WebhooksReview {
            _links: Box::new(_links),
            author_association,
            body,
            commit_id,
            html_url,
            id,
            node_id,
            pull_request_url,
            state,
            submitted_at,
            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
    }
}