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 */
1011use crate::models;
12use serde::{Deserialize, Serialize};
1314/// TeamDiscussion : A team discussion is a persistent record of a free-form conversation within a team.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TeamDiscussion {
17#[serde(rename = "author", deserialize_with = "Option::deserialize")]
18pub author: Option<Box<models::NullableSimpleUser>>,
19/// The main text of the discussion.
20#[serde(rename = "body")]
21pub body: String,
22#[serde(rename = "body_html")]
23pub 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")]
26pub body_version: String,
27#[serde(rename = "comments_count")]
28pub comments_count: i32,
29#[serde(rename = "comments_url")]
30pub comments_url: String,
31#[serde(rename = "created_at")]
32pub created_at: String,
33#[serde(rename = "last_edited_at", deserialize_with = "Option::deserialize")]
34pub last_edited_at: Option<String>,
35#[serde(rename = "html_url")]
36pub html_url: String,
37#[serde(rename = "node_id")]
38pub node_id: String,
39/// The unique sequence number of a team discussion.
40#[serde(rename = "number")]
41pub number: i32,
42/// Whether or not this discussion should be pinned for easy retrieval.
43#[serde(rename = "pinned")]
44pub pinned: bool,
45/// Whether or not this discussion should be restricted to team members and organization owners.
46#[serde(rename = "private")]
47pub private: bool,
48#[serde(rename = "team_url")]
49pub team_url: String,
50/// The title of the discussion.
51#[serde(rename = "title")]
52pub title: String,
53#[serde(rename = "updated_at")]
54pub updated_at: String,
55#[serde(rename = "url")]
56pub url: String,
57#[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
58pub reactions: Option<Box<models::ReactionRollup>>,
59}
6061impl TeamDiscussion {
62/// A team discussion is a persistent record of a free-form conversation within a team.
63pub fn new(author: Option<models::NullableSimpleUser>, body: String, body_html: String, body_version: String, comments_count: i32, comments_url: String, created_at: String, last_edited_at: Option<String>, html_url: String, node_id: String, number: i32, pinned: bool, private: bool, team_url: String, title: String, updated_at: String, url: String) -> TeamDiscussion {
64 TeamDiscussion {
65 author: author.map(Box::new),
66 body,
67 body_html,
68 body_version,
69 comments_count,
70 comments_url,
71 created_at,
72 last_edited_at,
73 html_url,
74 node_id,
75 number,
76 pinned,
77 private,
78 team_url,
79 title,
80 updated_at,
81 url,
82 reactions: None,
83 }
84 }
85}
86