openapi_github/models/git_create_commit_request.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 GitCreateCommitRequest {
16 /// The commit message
17 #[serde(rename = "message")]
18 pub message: String,
19 /// The SHA of the tree object this commit points to
20 #[serde(rename = "tree")]
21 pub tree: String,
22 /// The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided.
23 #[serde(rename = "parents", skip_serializing_if = "Option::is_none")]
24 pub parents: Option<Vec<String>>,
25 #[serde(rename = "author", skip_serializing_if = "Option::is_none")]
26 pub author: Option<Box<models::GitCreateCommitRequestAuthor>>,
27 #[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
28 pub committer: Option<Box<models::GitCreateCommitRequestCommitter>>,
29 /// The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits.
30 #[serde(rename = "signature", skip_serializing_if = "Option::is_none")]
31 pub signature: Option<String>,
32}
33
34impl GitCreateCommitRequest {
35 pub fn new(message: String, tree: String) -> GitCreateCommitRequest {
36 GitCreateCommitRequest {
37 message,
38 tree,
39 parents: None,
40 author: None,
41 committer: None,
42 signature: None,
43 }
44 }
45}
46