openapi_github/models/
team_discussion_comment.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/// TeamDiscussionComment : A reply to a discussion within a team.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TeamDiscussionComment {
17    #[serde(rename = "author", deserialize_with = "Option::deserialize")]
18    pub author: Option<Box<models::NullableSimpleUser>>,
19    /// The main text of the comment.
20    #[serde(rename = "body")]
21    pub body: String,
22    #[serde(rename = "body_html")]
23    pub body_html: String,
24    /// The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server.
25    #[serde(rename = "body_version")]
26    pub body_version: String,
27    #[serde(rename = "created_at")]
28    pub created_at: String,
29    #[serde(rename = "last_edited_at", deserialize_with = "Option::deserialize")]
30    pub last_edited_at: Option<String>,
31    #[serde(rename = "discussion_url")]
32    pub discussion_url: String,
33    #[serde(rename = "html_url")]
34    pub html_url: String,
35    #[serde(rename = "node_id")]
36    pub node_id: String,
37    /// The unique sequence number of a team discussion comment.
38    #[serde(rename = "number")]
39    pub number: i32,
40    #[serde(rename = "updated_at")]
41    pub updated_at: String,
42    #[serde(rename = "url")]
43    pub url: String,
44    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
45    pub reactions: Option<Box<models::ReactionRollup>>,
46}
47
48impl TeamDiscussionComment {
49    /// A reply to a discussion within a team.
50    pub fn new(author: Option<models::NullableSimpleUser>, body: String, body_html: String, body_version: String, created_at: String, last_edited_at: Option<String>, discussion_url: String, html_url: String, node_id: String, number: i32, updated_at: String, url: String) -> TeamDiscussionComment {
51        TeamDiscussionComment {
52            author: author.map(Box::new),
53            body,
54            body_html,
55            body_version,
56            created_at,
57            last_edited_at,
58            discussion_url,
59            html_url,
60            node_id,
61            number,
62            updated_at,
63            url,
64            reactions: None,
65        }
66    }
67}
68