gitea_client/models/delete_file_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/// DeleteFileOptions : DeleteFileOptions options for deleting files (used for other File structs below) 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 DeleteFileOptions {
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 /// message (optional) for the commit of this file. if not supplied, a default message will be used
27 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
28 pub message: Option<String>,
29 /// new_branch (optional) will make a new branch from `branch` before creating the file
30 #[serde(rename = "new_branch", skip_serializing_if = "Option::is_none")]
31 pub new_branch: Option<String>,
32 /// sha is the SHA for the file that already exists
33 #[serde(rename = "sha")]
34 pub sha: 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 DeleteFileOptions {
41 /// DeleteFileOptions options for deleting files (used for other File structs below) 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(sha: String) -> DeleteFileOptions {
43 DeleteFileOptions {
44 author: None,
45 branch: None,
46 committer: None,
47 dates: None,
48 message: None,
49 new_branch: None,
50 sha,
51 signoff: None,
52 }
53 }
54}
55