openapi_github/models/
commit_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/// CommitComment : Commit Comment
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CommitComment {
17    #[serde(rename = "html_url")]
18    pub html_url: String,
19    #[serde(rename = "url")]
20    pub url: String,
21    #[serde(rename = "id")]
22    pub id: i32,
23    #[serde(rename = "node_id")]
24    pub node_id: String,
25    #[serde(rename = "body")]
26    pub body: String,
27    #[serde(rename = "path", deserialize_with = "Option::deserialize")]
28    pub path: Option<String>,
29    #[serde(rename = "position", deserialize_with = "Option::deserialize")]
30    pub position: Option<i32>,
31    #[serde(rename = "line", deserialize_with = "Option::deserialize")]
32    pub line: Option<i32>,
33    #[serde(rename = "commit_id")]
34    pub commit_id: String,
35    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
36    pub user: Option<Box<models::NullableSimpleUser>>,
37    #[serde(rename = "created_at")]
38    pub created_at: String,
39    #[serde(rename = "updated_at")]
40    pub updated_at: String,
41    #[serde(rename = "author_association")]
42    pub author_association: models::AuthorAssociation,
43    #[serde(rename = "reactions", skip_serializing_if = "Option::is_none")]
44    pub reactions: Option<Box<models::ReactionRollup>>,
45}
46
47impl CommitComment {
48    /// Commit Comment
49    pub fn new(html_url: String, url: String, id: i32, node_id: String, body: String, path: Option<String>, position: Option<i32>, line: Option<i32>, commit_id: String, user: Option<models::NullableSimpleUser>, created_at: String, updated_at: String, author_association: models::AuthorAssociation) -> CommitComment {
50        CommitComment {
51            html_url,
52            url,
53            id,
54            node_id,
55            body,
56            path,
57            position,
58            line,
59            commit_id,
60            user: user.map(Box::new),
61            created_at,
62            updated_at,
63            author_association,
64            reactions: None,
65        }
66    }
67}
68