use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PullRequestReview {
#[serde(rename = "id")]
pub id: i32,
#[serde(rename = "node_id")]
pub node_id: String,
#[serde(rename = "user", deserialize_with = "Option::deserialize")]
pub user: Option<Box<models::NullableSimpleUser>>,
#[serde(rename = "body")]
pub body: String,
#[serde(rename = "state")]
pub state: String,
#[serde(rename = "html_url")]
pub html_url: String,
#[serde(rename = "pull_request_url")]
pub pull_request_url: String,
#[serde(rename = "_links")]
pub _links: Box<models::TimelineReviewedEventLinks>,
#[serde(rename = "submitted_at", skip_serializing_if = "Option::is_none")]
pub submitted_at: Option<String>,
#[serde(rename = "commit_id", deserialize_with = "Option::deserialize")]
pub commit_id: Option<String>,
#[serde(rename = "body_html", skip_serializing_if = "Option::is_none")]
pub body_html: Option<String>,
#[serde(rename = "body_text", skip_serializing_if = "Option::is_none")]
pub body_text: Option<String>,
#[serde(rename = "author_association")]
pub author_association: models::AuthorAssociation,
}
impl PullRequestReview {
pub fn new(id: i32, node_id: String, user: Option<models::NullableSimpleUser>, body: String, state: String, html_url: String, pull_request_url: String, _links: models::TimelineReviewedEventLinks, commit_id: Option<String>, author_association: models::AuthorAssociation) -> PullRequestReview {
PullRequestReview {
id,
node_id,
user: user.map(Box::new),
body,
state,
html_url,
pull_request_url,
_links: Box::new(_links),
submitted_at: None,
commit_id,
body_html: None,
body_text: None,
author_association,
}
}
}