openapi_github/models/
timeline_reviewed_event.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/// TimelineReviewedEvent : Timeline Reviewed Event
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TimelineReviewedEvent {
17    #[serde(rename = "event")]
18    pub event: String,
19    /// Unique identifier of the review
20    #[serde(rename = "id")]
21    pub id: i32,
22    #[serde(rename = "node_id")]
23    pub node_id: String,
24    #[serde(rename = "user")]
25    pub user: Box<models::SimpleUser>,
26    /// The text of the review.
27    #[serde(rename = "body", deserialize_with = "Option::deserialize")]
28    pub body: Option<String>,
29    #[serde(rename = "state")]
30    pub state: String,
31    #[serde(rename = "html_url")]
32    pub html_url: String,
33    #[serde(rename = "pull_request_url")]
34    pub pull_request_url: String,
35    #[serde(rename = "_links")]
36    pub _links: Box<models::TimelineReviewedEventLinks>,
37    #[serde(rename = "submitted_at", skip_serializing_if = "Option::is_none")]
38    pub submitted_at: Option<String>,
39    /// A commit SHA for the review.
40    #[serde(rename = "commit_id")]
41    pub commit_id: String,
42    #[serde(rename = "body_html", skip_serializing_if = "Option::is_none")]
43    pub body_html: Option<String>,
44    #[serde(rename = "body_text", skip_serializing_if = "Option::is_none")]
45    pub body_text: Option<String>,
46    #[serde(rename = "author_association")]
47    pub author_association: models::AuthorAssociation,
48}
49
50impl TimelineReviewedEvent {
51    /// Timeline Reviewed Event
52    pub fn new(event: String, id: i32, node_id: String, user: models::SimpleUser, body: Option<String>, state: String, html_url: String, pull_request_url: String, _links: models::TimelineReviewedEventLinks, commit_id: String, author_association: models::AuthorAssociation) -> TimelineReviewedEvent {
53        TimelineReviewedEvent {
54            event,
55            id,
56            node_id,
57            user: Box::new(user),
58            body,
59            state,
60            html_url,
61            pull_request_url,
62            _links: Box::new(_links),
63            submitted_at: None,
64            commit_id,
65            body_html: None,
66            body_text: None,
67            author_association,
68        }
69    }
70}
71