Skip to main content

gitea_client/models/
apply_diff_patch_file_options.rs

1/*
2 * Gitea API
3 *
4 * This documentation describes the Gitea API.
5 *
6 * The version of the OpenAPI document: 1.25.2
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ApplyDiffPatchFileOptions : ApplyDiffPatchFileOptions options for applying a diff patch Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ApplyDiffPatchFileOptions {
17    #[serde(rename = "author", skip_serializing_if = "Option::is_none")]
18    pub author: Option<Box<models::Identity>>,
19    /// branch (optional) to base this file from. if not given, the default branch is used
20    #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
21    pub branch: Option<String>,
22    #[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
23    pub committer: Option<Box<models::Identity>>,
24    #[serde(rename = "content")]
25    pub content: String,
26    #[serde(rename = "dates", skip_serializing_if = "Option::is_none")]
27    pub dates: Option<Box<models::CommitDateOptions>>,
28    /// message (optional) for the commit of this file. if not supplied, a default message will be used
29    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
30    pub message: Option<String>,
31    /// new_branch (optional) will make a new branch from `branch` before creating the file
32    #[serde(rename = "new_branch", skip_serializing_if = "Option::is_none")]
33    pub new_branch: Option<String>,
34    /// Add a Signed-off-by trailer by the committer at the end of the commit log message.
35    #[serde(rename = "signoff", skip_serializing_if = "Option::is_none")]
36    pub signoff: Option<bool>,
37}
38
39impl ApplyDiffPatchFileOptions {
40    /// ApplyDiffPatchFileOptions options for applying a diff patch Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
41    pub fn new(content: String) -> ApplyDiffPatchFileOptions {
42        ApplyDiffPatchFileOptions {
43            author: None,
44            branch: None,
45            committer: None,
46            content,
47            dates: None,
48            message: None,
49            new_branch: None,
50            signoff: None,
51        }
52    }
53}
54