gitea-rs/crates/gitea-client/src/models/generate_repo_option.rs
kjuulh e78d07db33
feat: find another name
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-09-23 22:29:11 +02:00

75 lines
2.7 KiB
Rust

/*
* Gitea API
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.22.1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// GenerateRepoOption : GenerateRepoOption options when creating repository using a template
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GenerateRepoOption {
/// include avatar of the template repo
#[serde(rename = "avatar", skip_serializing_if = "Option::is_none")]
pub avatar: Option<bool>,
/// Default branch of the new repository
#[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")]
pub default_branch: Option<String>,
/// Description of the repository to create
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// include git content of default branch in template repo
#[serde(rename = "git_content", skip_serializing_if = "Option::is_none")]
pub git_content: Option<bool>,
/// include git hooks in template repo
#[serde(rename = "git_hooks", skip_serializing_if = "Option::is_none")]
pub git_hooks: Option<bool>,
/// include labels in template repo
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
pub labels: Option<bool>,
/// Name of the repository to create
#[serde(rename = "name")]
pub name: String,
/// The organization or person who will own the new repository
#[serde(rename = "owner")]
pub owner: String,
/// Whether the repository is private
#[serde(rename = "private", skip_serializing_if = "Option::is_none")]
pub private: Option<bool>,
/// include protected branches in template repo
#[serde(rename = "protected_branch", skip_serializing_if = "Option::is_none")]
pub protected_branch: Option<bool>,
/// include topics in template repo
#[serde(rename = "topics", skip_serializing_if = "Option::is_none")]
pub topics: Option<bool>,
/// include webhooks in template repo
#[serde(rename = "webhooks", skip_serializing_if = "Option::is_none")]
pub webhooks: Option<bool>,
}
impl GenerateRepoOption {
/// GenerateRepoOption options when creating repository using a template
pub fn new(name: String, owner: String) -> GenerateRepoOption {
GenerateRepoOption {
avatar: None,
default_branch: None,
description: None,
git_content: None,
git_hooks: None,
labels: None,
name,
owner,
private: None,
protected_branch: None,
topics: None,
webhooks: None,
}
}
}