gitea_client/models/
create_branch_repo_option.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/// CreateBranchRepoOption : CreateBranchRepoOption options when creating a branch in a repository
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateBranchRepoOption {
17    /// Name of the branch to create
18    #[serde(rename = "new_branch_name")]
19    pub new_branch_name: String,
20    /// Deprecated: true Name of the old branch to create from
21    #[serde(rename = "old_branch_name", skip_serializing_if = "Option::is_none")]
22    pub old_branch_name: Option<String>,
23    /// Name of the old branch/tag/commit to create from
24    #[serde(rename = "old_ref_name", skip_serializing_if = "Option::is_none")]
25    pub old_ref_name: Option<String>,
26}
27
28impl CreateBranchRepoOption {
29    /// CreateBranchRepoOption options when creating a branch in a repository
30    pub fn new(new_branch_name: String) -> CreateBranchRepoOption {
31        CreateBranchRepoOption {
32            new_branch_name,
33            old_branch_name: None,
34            old_ref_name: None,
35        }
36    }
37}
38