Files
octopush/crates/gitea_raw_client/src/models/update_file_options.rs
Kasper Juul Hermansen 991861db99
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Rewrite rust (#38)
Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: https://git.front.kjuulh.io/kjuulh/octopush/pulls/38
2022-11-27 11:21:35 +00:00

65 lines
2.7 KiB
Rust

/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// UpdateFileOptions : UpdateFileOptions options for updating 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)
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct UpdateFileOptions {
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<Box<crate::models::Identity>>,
/// branch (optional) to base this file from. if not given, the default branch is used
#[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
pub branch: Option<String>,
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
pub committer: Option<Box<crate::models::Identity>>,
/// content must be base64 encoded
#[serde(rename = "content")]
pub content: String,
#[serde(rename = "dates", skip_serializing_if = "Option::is_none")]
pub dates: Option<Box<crate::models::CommitDateOptions>>,
/// from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL
#[serde(rename = "from_path", skip_serializing_if = "Option::is_none")]
pub from_path: Option<String>,
/// message (optional) for the commit of this file. if not supplied, a default message will be used
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
/// new_branch (optional) will make a new branch from `branch` before creating the file
#[serde(rename = "new_branch", skip_serializing_if = "Option::is_none")]
pub new_branch: Option<String>,
/// sha is the SHA for the file that already exists
#[serde(rename = "sha")]
pub sha: String,
/// Add a Signed-off-by trailer by the committer at the end of the commit log message.
#[serde(rename = "signoff", skip_serializing_if = "Option::is_none")]
pub signoff: Option<bool>,
}
impl UpdateFileOptions {
/// UpdateFileOptions options for updating 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)
pub fn new(content: String, sha: String) -> UpdateFileOptions {
UpdateFileOptions {
author: None,
branch: None,
committer: None,
content,
dates: None,
from_path: None,
message: None,
new_branch: None,
sha,
signoff: None,
}
}
}