use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhooksReview {
#[serde(rename = "_links")]
pub _links: Box<models::WebhooksReviewLinks>,
#[serde(rename = "author_association")]
pub author_association: AuthorAssociation,
#[serde(rename = "body", deserialize_with = "Option::deserialize")]
pub body: Option<String>,
#[serde(rename = "commit_id")]
pub commit_id: String,
#[serde(rename = "html_url")]
pub html_url: String,
#[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 {
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),
}
}
}
#[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
}
}