openapi_github/models/
commit_search_result_item_commit.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CommitSearchResultItemCommit {
16 #[serde(rename = "author")]
17 pub author: Box<models::CommitSearchResultItemCommitAuthor>,
18 #[serde(rename = "committer", deserialize_with = "Option::deserialize")]
19 pub committer: Option<Box<models::NullableGitUser>>,
20 #[serde(rename = "comment_count")]
21 pub comment_count: i32,
22 #[serde(rename = "message")]
23 pub message: String,
24 #[serde(rename = "tree")]
25 pub tree: Box<models::ShortBranchCommit>,
26 #[serde(rename = "url")]
27 pub url: String,
28 #[serde(rename = "verification", skip_serializing_if = "Option::is_none")]
29 pub verification: Option<Box<models::Verification>>,
30}
31
32impl CommitSearchResultItemCommit {
33 pub fn new(author: models::CommitSearchResultItemCommitAuthor, committer: Option<models::NullableGitUser>, comment_count: i32, message: String, tree: models::ShortBranchCommit, url: String) -> CommitSearchResultItemCommit {
34 CommitSearchResultItemCommit {
35 author: Box::new(author),
36 committer: committer.map(Box::new),
37 comment_count,
38 message,
39 tree: Box::new(tree),
40 url,
41 verification: None,
42 }
43 }
44}
45