openapi_github/models/
timeline_comment_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/// TimelineCommentEvent : Timeline Comment Event
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TimelineCommentEvent {
17    #[serde(rename = "event")]
18    pub event: String,
19    #[serde(rename = "actor")]
20    pub actor: Box<models::SimpleUser>,
21    /// Unique identifier of the issue comment
22    #[serde(rename = "id")]
23    pub id: i32,
24    #[serde(rename = "node_id")]
25    pub node_id: String,
26    /// URL for the issue comment
27    #[serde(rename = "url")]
28    pub url: String,
29    /// Contents of the issue comment
30    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
31    pub body: Option<String>,
32    #[serde(rename = "body_text", skip_serializing_if = "Option::is_none")]
33    pub body_text: Option<String>,
34    #[serde(rename = "body_html", skip_serializing_if = "Option::is_none")]
35    pub body_html: Option<String>,
36    #[serde(rename = "html_url")]
37    pub html_url: String,
38    #[serde(rename = "user")]
39    pub user: Box<models::SimpleUser>,
40    #[serde(rename = "created_at")]
41    pub created_at: String,
42    #[serde(rename = "updated_at")]
43    pub updated_at: String,
44    #[serde(rename = "issue_url")]
45    pub issue_url: String,
46    #[serde(rename = "author_association")]
47    pub author_association: models::AuthorAssociation,
48    #[serde(rename = "performed_via_github_app", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub performed_via_github_app: Option<Option<Box<models::NullableIntegration>>>,
50    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
51    pub reactions: Option<Box<models::ReactionRollup>>,
52}
53
54impl TimelineCommentEvent {
55    /// Timeline Comment Event
56    pub fn new(event: String, actor: models::SimpleUser, id: i32, node_id: String, url: String, html_url: String, user: models::SimpleUser, created_at: String, updated_at: String, issue_url: String, author_association: models::AuthorAssociation) -> TimelineCommentEvent {
57        TimelineCommentEvent {
58            event,
59            actor: Box::new(actor),
60            id,
61            node_id,
62            url,
63            body: None,
64            body_text: None,
65            body_html: None,
66            html_url,
67            user: Box::new(user),
68            created_at,
69            updated_at,
70            issue_url,
71            author_association,
72            performed_via_github_app: None,
73            reactions: None,
74        }
75    }
76}
77