openapi_github/models/
pull_request_review.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// PullRequestReview : Pull Request Reviews are reviews on pull requests.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PullRequestReview {
17    /// Unique identifier of the review
18    #[serde(rename = "id")]
19    pub id: i32,
20    #[serde(rename = "node_id")]
21    pub node_id: String,
22    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
23    pub user: Option<Box<models::NullableSimpleUser>>,
24    /// The text of the review.
25    #[serde(rename = "body")]
26    pub body: String,
27    #[serde(rename = "state")]
28    pub state: String,
29    #[serde(rename = "html_url")]
30    pub html_url: String,
31    #[serde(rename = "pull_request_url")]
32    pub pull_request_url: String,
33    #[serde(rename = "_links")]
34    pub _links: Box<models::TimelineReviewedEventLinks>,
35    #[serde(rename = "submitted_at", skip_serializing_if = "Option::is_none")]
36    pub submitted_at: Option<String>,
37    /// A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`.
38    #[serde(rename = "commit_id", deserialize_with = "Option::deserialize")]
39    pub commit_id: Option<String>,
40    #[serde(rename = "body_html", skip_serializing_if = "Option::is_none")]
41    pub body_html: Option<String>,
42    #[serde(rename = "body_text", skip_serializing_if = "Option::is_none")]
43    pub body_text: Option<String>,
44    #[serde(rename = "author_association")]
45    pub author_association: models::AuthorAssociation,
46}
47
48impl PullRequestReview {
49    /// Pull Request Reviews are reviews on pull requests.
50    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 {
51        PullRequestReview {
52            id,
53            node_id,
54            user: user.map(Box::new),
55            body,
56            state,
57            html_url,
58            pull_request_url,
59            _links: Box::new(_links),
60            submitted_at: None,
61            commit_id,
62            body_html: None,
63            body_text: None,
64            author_association,
65        }
66    }
67}
68