openapi_github/models/
nullable_simple_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/// NullableSimpleCommit : A commit.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NullableSimpleCommit {
17    /// SHA for the commit
18    #[serde(rename = "id")]
19    pub id: String,
20    /// SHA for the commit's tree
21    #[serde(rename = "tree_id")]
22    pub tree_id: String,
23    /// Message describing the purpose of the commit
24    #[serde(rename = "message")]
25    pub message: String,
26    /// Timestamp of the commit
27    #[serde(rename = "timestamp")]
28    pub timestamp: String,
29    #[serde(rename = "author", deserialize_with = "Option::deserialize")]
30    pub author: Option<Box<models::NullableSimpleCommitAuthor>>,
31    #[serde(rename = "committer", deserialize_with = "Option::deserialize")]
32    pub committer: Option<Box<models::NullableSimpleCommitCommitter>>,
33}
34
35impl NullableSimpleCommit {
36    /// A commit.
37    pub fn new(id: String, tree_id: String, message: String, timestamp: String, author: Option<models::NullableSimpleCommitAuthor>, committer: Option<models::NullableSimpleCommitCommitter>) -> NullableSimpleCommit {
38        NullableSimpleCommit {
39            id,
40            tree_id,
41            message,
42            timestamp,
43            author: author.map(Box::new),
44            committer: committer.map(Box::new),
45        }
46    }
47}
48