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