openapi_github/models/
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 Commit {
16    /// An array of files added in the commit. A maximum of 3000 changed files will be reported per commit.
17    #[serde(rename = "added", skip_serializing_if = "Option::is_none")]
18    pub added: Option<Vec<String>>,
19    #[serde(rename = "author")]
20    pub author: Box<models::Committer>,
21    #[serde(rename = "committer")]
22    pub committer: Box<models::Committer>,
23    /// Whether this commit is distinct from any that have been pushed before.
24    #[serde(rename = "distinct")]
25    pub distinct: bool,
26    #[serde(rename = "id")]
27    pub id: String,
28    /// The commit message.
29    #[serde(rename = "message")]
30    pub message: String,
31    /// An array of files modified by the commit. A maximum of 3000 changed files will be reported per commit.
32    #[serde(rename = "modified", skip_serializing_if = "Option::is_none")]
33    pub modified: Option<Vec<String>>,
34    /// An array of files removed in the commit. A maximum of 3000 changed files will be reported per commit.
35    #[serde(rename = "removed", skip_serializing_if = "Option::is_none")]
36    pub removed: Option<Vec<String>>,
37    /// The ISO 8601 timestamp of the commit.
38    #[serde(rename = "timestamp")]
39    pub timestamp: String,
40    #[serde(rename = "tree_id")]
41    pub tree_id: String,
42    /// URL that points to the commit API resource.
43    #[serde(rename = "url")]
44    pub url: String,
45}
46
47impl Commit {
48    pub fn new(author: models::Committer, committer: models::Committer, distinct: bool, id: String, message: String, timestamp: String, tree_id: String, url: String) -> Commit {
49        Commit {
50            added: None,
51            author: Box::new(author),
52            committer: Box::new(committer),
53            distinct,
54            id,
55            message,
56            modified: None,
57            removed: None,
58            timestamp,
59            tree_id,
60            url,
61        }
62    }
63}
64