openapi_github/models/
git_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/// GitCommit : Low-level Git commit operations within a repository
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GitCommit {
17    /// SHA for the commit
18    #[serde(rename = "sha")]
19    pub sha: String,
20    #[serde(rename = "node_id")]
21    pub node_id: String,
22    #[serde(rename = "url")]
23    pub url: String,
24    #[serde(rename = "author")]
25    pub author: Box<models::GitCommitAuthor>,
26    #[serde(rename = "committer")]
27    pub committer: Box<models::GitCommitAuthor>,
28    /// Message describing the purpose of the commit
29    #[serde(rename = "message")]
30    pub message: String,
31    #[serde(rename = "tree")]
32    pub tree: Box<models::GitCommitTree>,
33    #[serde(rename = "parents")]
34    pub parents: Vec<models::GitCommitParentsInner>,
35    #[serde(rename = "verification")]
36    pub verification: Box<models::GitCommitVerification>,
37    #[serde(rename = "html_url")]
38    pub html_url: String,
39}
40
41impl GitCommit {
42    /// Low-level Git commit operations within a repository
43    pub fn new(sha: String, node_id: String, url: String, author: models::GitCommitAuthor, committer: models::GitCommitAuthor, message: String, tree: models::GitCommitTree, parents: Vec<models::GitCommitParentsInner>, verification: models::GitCommitVerification, html_url: String) -> GitCommit {
44        GitCommit {
45            sha,
46            node_id,
47            url,
48            author: Box::new(author),
49            committer: Box::new(committer),
50            message,
51            tree: Box::new(tree),
52            parents,
53            verification: Box::new(verification),
54            html_url,
55        }
56    }
57}
58