gitea_client/models/
change_files_options.rs

1/*
2 * Gitea API
3 *
4 * This documentation describes the Gitea API.
5 *
6 * The version of the OpenAPI document: 1.22.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ChangeFilesOptions : ChangeFilesOptions options for creating, updating or deleting multiple files 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 ChangeFilesOptions {
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 = "dates", skip_serializing_if = "Option::is_none")]
25    pub dates: Option<Box<models::CommitDateOptions>>,
26    /// list of file operations
27    #[serde(rename = "files")]
28    pub files: Vec<models::ChangeFileOperation>,
29    /// message (optional) for the commit of this file. if not supplied, a default message will be used
30    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
31    pub message: Option<String>,
32    /// new_branch (optional) will make a new branch from `branch` before creating the file
33    #[serde(rename = "new_branch", skip_serializing_if = "Option::is_none")]
34    pub new_branch: Option<String>,
35    /// Add a Signed-off-by trailer by the committer at the end of the commit log message.
36    #[serde(rename = "signoff", skip_serializing_if = "Option::is_none")]
37    pub signoff: Option<bool>,
38}
39
40impl ChangeFilesOptions {
41    /// ChangeFilesOptions options for creating, updating or deleting multiple files 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)
42    pub fn new(files: Vec<models::ChangeFileOperation>) -> ChangeFilesOptions {
43        ChangeFilesOptions {
44            author: None,
45            branch: None,
46            committer: None,
47            dates: None,
48            files,
49            message: None,
50            new_branch: None,
51            signoff: None,
52        }
53    }
54}
55