openapi_github/models/
gist_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/// GistComment : A comment made to a gist.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GistComment {
17    #[serde(rename = "id")]
18    pub id: i32,
19    #[serde(rename = "node_id")]
20    pub node_id: String,
21    #[serde(rename = "url")]
22    pub url: String,
23    /// The comment text.
24    #[serde(rename = "body")]
25    pub body: String,
26    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
27    pub user: Option<Box<models::NullableSimpleUser>>,
28    #[serde(rename = "created_at")]
29    pub created_at: String,
30    #[serde(rename = "updated_at")]
31    pub updated_at: String,
32    #[serde(rename = "author_association")]
33    pub author_association: models::AuthorAssociation,
34}
35
36impl GistComment {
37    /// A comment made to a gist.
38    pub fn new(id: i32, node_id: String, url: String, body: String, user: Option<models::NullableSimpleUser>, created_at: String, updated_at: String, author_association: models::AuthorAssociation) -> GistComment {
39        GistComment {
40            id,
41            node_id,
42            url,
43            body,
44            user: user.map(Box::new),
45            created_at,
46            updated_at,
47            author_association,
48        }
49    }
50}
51