use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhooksIssueComment {
#[serde(rename = "author_association")]
pub author_association: AuthorAssociation,
#[serde(rename = "body")]
pub body: String,
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "html_url")]
pub html_url: String,
#[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::Integration>>,
#[serde(rename = "reactions")]
pub reactions: 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::User1>>,
}
impl WebhooksIssueComment {
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::Integration>, reactions: models::Reactions, updated_at: String, url: String, user: Option<models::User1>) -> WebhooksIssueComment {
WebhooksIssueComment {
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),
}
}
}
#[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
}
}