188
crates/gitea-client/src/apis/activitypub_api.rs
Normal file
188
crates/gitea-client/src/apis/activitypub_api.rs
Normal file
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Gitea API
|
||||
*
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.22.1
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
use reqwest;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::{apis::ResponseContent, models};
|
||||
use super::{Error, configuration};
|
||||
|
||||
|
||||
/// struct for typed errors of method [`activitypub_person`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum ActivitypubPersonError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`activitypub_person_inbox`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum ActivitypubPersonInboxError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
|
||||
pub async fn activitypub_person(configuration: &configuration::Configuration, user_id: i32) -> Result<models::ActivityPub, Error<ActivitypubPersonError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/activitypub/user-id/{user_id}", local_var_configuration.base_path, user_id=user_id);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<ActivitypubPersonError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn activitypub_person_inbox(configuration: &configuration::Configuration, user_id: i32) -> Result<(), Error<ActivitypubPersonInboxError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/activitypub/user-id/{user_id}/inbox", local_var_configuration.base_path, user_id=user_id);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
Ok(())
|
||||
} else {
|
||||
let local_var_entity: Option<ActivitypubPersonInboxError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
2331
crates/gitea-client/src/apis/admin_api.rs
Normal file
2331
crates/gitea-client/src/apis/admin_api.rs
Normal file
File diff suppressed because it is too large
Load Diff
53
crates/gitea-client/src/apis/configuration.rs
Normal file
53
crates/gitea-client/src/apis/configuration.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Gitea API
|
||||
*
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.22.1
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Configuration {
|
||||
pub base_path: String,
|
||||
pub user_agent: Option<String>,
|
||||
pub client: reqwest::Client,
|
||||
pub basic_auth: Option<BasicAuth>,
|
||||
pub oauth_access_token: Option<String>,
|
||||
pub bearer_access_token: Option<String>,
|
||||
pub api_key: Option<ApiKey>,
|
||||
// TODO: take an oauth2 token source, similar to the go one
|
||||
}
|
||||
|
||||
pub type BasicAuth = (String, Option<String>);
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ApiKey {
|
||||
pub prefix: Option<String>,
|
||||
pub key: String,
|
||||
}
|
||||
|
||||
|
||||
impl Configuration {
|
||||
pub fn new() -> Configuration {
|
||||
Configuration::default()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Configuration {
|
||||
fn default() -> Self {
|
||||
Configuration {
|
||||
base_path: "/api/v1".to_owned(),
|
||||
user_agent: Some("OpenAPI-Generator/1.22.1/rust".to_owned()),
|
||||
client: reqwest::Client::new(),
|
||||
basic_auth: None,
|
||||
oauth_access_token: None,
|
||||
bearer_access_token: None,
|
||||
api_key: None,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
6045
crates/gitea-client/src/apis/issue_api.rs
Normal file
6045
crates/gitea-client/src/apis/issue_api.rs
Normal file
File diff suppressed because it is too large
Load Diff
1047
crates/gitea-client/src/apis/miscellaneous_api.rs
Normal file
1047
crates/gitea-client/src/apis/miscellaneous_api.rs
Normal file
File diff suppressed because it is too large
Load Diff
104
crates/gitea-client/src/apis/mod.rs
Normal file
104
crates/gitea-client/src/apis/mod.rs
Normal file
@@ -0,0 +1,104 @@
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ResponseContent<T> {
|
||||
pub status: reqwest::StatusCode,
|
||||
pub content: String,
|
||||
pub entity: Option<T>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error<T> {
|
||||
Reqwest(reqwest::Error),
|
||||
Serde(serde_json::Error),
|
||||
Io(std::io::Error),
|
||||
ResponseError(ResponseContent<T>),
|
||||
}
|
||||
|
||||
impl <T> fmt::Display for Error<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let (module, e) = match self {
|
||||
Error::Reqwest(e) => ("reqwest", e.to_string()),
|
||||
Error::Serde(e) => ("serde", e.to_string()),
|
||||
Error::Io(e) => ("IO", e.to_string()),
|
||||
Error::ResponseError(e) => ("response", format!("status code {}", e.status)),
|
||||
};
|
||||
write!(f, "error in {}: {}", module, e)
|
||||
}
|
||||
}
|
||||
|
||||
impl <T: fmt::Debug> error::Error for Error<T> {
|
||||
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
|
||||
Some(match self {
|
||||
Error::Reqwest(e) => e,
|
||||
Error::Serde(e) => e,
|
||||
Error::Io(e) => e,
|
||||
Error::ResponseError(_) => return None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl <T> From<reqwest::Error> for Error<T> {
|
||||
fn from(e: reqwest::Error) -> Self {
|
||||
Error::Reqwest(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl <T> From<serde_json::Error> for Error<T> {
|
||||
fn from(e: serde_json::Error) -> Self {
|
||||
Error::Serde(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl <T> From<std::io::Error> for Error<T> {
|
||||
fn from(e: std::io::Error) -> Self {
|
||||
Error::Io(e)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn urlencode<T: AsRef<str>>(s: T) -> String {
|
||||
::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect()
|
||||
}
|
||||
|
||||
pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> {
|
||||
if let serde_json::Value::Object(object) = value {
|
||||
let mut params = vec![];
|
||||
|
||||
for (key, value) in object {
|
||||
match value {
|
||||
serde_json::Value::Object(_) => params.append(&mut parse_deep_object(
|
||||
&format!("{}[{}]", prefix, key),
|
||||
value,
|
||||
)),
|
||||
serde_json::Value::Array(array) => {
|
||||
for (i, value) in array.iter().enumerate() {
|
||||
params.append(&mut parse_deep_object(
|
||||
&format!("{}[{}][{}]", prefix, key, i),
|
||||
value,
|
||||
));
|
||||
}
|
||||
},
|
||||
serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())),
|
||||
_ => params.push((format!("{}[{}]", prefix, key), value.to_string())),
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
unimplemented!("Only objects are supported with style=deepObject")
|
||||
}
|
||||
|
||||
pub mod activitypub_api;
|
||||
pub mod admin_api;
|
||||
pub mod issue_api;
|
||||
pub mod miscellaneous_api;
|
||||
pub mod notification_api;
|
||||
pub mod organization_api;
|
||||
pub mod package_api;
|
||||
pub mod repository_api;
|
||||
pub mod settings_api;
|
||||
pub mod user_api;
|
||||
|
||||
pub mod configuration;
|
704
crates/gitea-client/src/apis/notification_api.rs
Normal file
704
crates/gitea-client/src/apis/notification_api.rs
Normal file
@@ -0,0 +1,704 @@
|
||||
/*
|
||||
* Gitea API
|
||||
*
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.22.1
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
use reqwest;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::{apis::ResponseContent, models};
|
||||
use super::{Error, configuration};
|
||||
|
||||
|
||||
/// struct for typed errors of method [`notify_get_list`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum NotifyGetListError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`notify_get_repo_list`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum NotifyGetRepoListError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`notify_get_thread`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum NotifyGetThreadError {
|
||||
Status403(),
|
||||
Status404(),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`notify_new_available`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum NotifyNewAvailableError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`notify_read_list`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum NotifyReadListError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`notify_read_repo_list`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum NotifyReadRepoListError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`notify_read_thread`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum NotifyReadThreadError {
|
||||
Status403(),
|
||||
Status404(),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
|
||||
pub async fn notify_get_list(configuration: &configuration::Configuration, all: Option<bool>, status_types: Option<Vec<String>>, subject_type: Option<Vec<String>>, since: Option<String>, before: Option<String>, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::NotificationThread>, Error<NotifyGetListError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/notifications", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_str) = all {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = status_types {
|
||||
local_var_req_builder = match "multi" {
|
||||
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||
_ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||
};
|
||||
}
|
||||
if let Some(ref local_var_str) = subject_type {
|
||||
local_var_req_builder = match "multi" {
|
||||
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("subject-type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||
_ => local_var_req_builder.query(&[("subject-type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||
};
|
||||
}
|
||||
if let Some(ref local_var_str) = since {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = before {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = page {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = limit {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<NotifyGetListError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn notify_get_repo_list(configuration: &configuration::Configuration, owner: &str, repo: &str, all: Option<bool>, status_types: Option<Vec<String>>, subject_type: Option<Vec<String>>, since: Option<String>, before: Option<String>, page: Option<i32>, limit: Option<i32>) -> Result<Vec<models::NotificationThread>, Error<NotifyGetRepoListError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/notifications", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_str) = all {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = status_types {
|
||||
local_var_req_builder = match "multi" {
|
||||
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||
_ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||
};
|
||||
}
|
||||
if let Some(ref local_var_str) = subject_type {
|
||||
local_var_req_builder = match "multi" {
|
||||
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("subject-type".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||
_ => local_var_req_builder.query(&[("subject-type", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||
};
|
||||
}
|
||||
if let Some(ref local_var_str) = since {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = before {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = page {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = limit {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<NotifyGetRepoListError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn notify_get_thread(configuration: &configuration::Configuration, id: &str) -> Result<models::NotificationThread, Error<NotifyGetThreadError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/notifications/threads/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<NotifyGetThreadError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn notify_new_available(configuration: &configuration::Configuration, ) -> Result<models::NotificationCount, Error<NotifyNewAvailableError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/notifications/new", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<NotifyNewAvailableError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn notify_read_list(configuration: &configuration::Configuration, last_read_at: Option<String>, all: Option<&str>, status_types: Option<Vec<String>>, to_status: Option<&str>) -> Result<Vec<models::NotificationThread>, Error<NotifyReadListError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/notifications", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_str) = last_read_at {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("last_read_at", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = all {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = status_types {
|
||||
local_var_req_builder = match "multi" {
|
||||
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||
_ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||
};
|
||||
}
|
||||
if let Some(ref local_var_str) = to_status {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("to-status", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<NotifyReadListError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn notify_read_repo_list(configuration: &configuration::Configuration, owner: &str, repo: &str, all: Option<&str>, status_types: Option<Vec<String>>, to_status: Option<&str>, last_read_at: Option<String>) -> Result<Vec<models::NotificationThread>, Error<NotifyReadRepoListError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/notifications", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_str) = all {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = status_types {
|
||||
local_var_req_builder = match "multi" {
|
||||
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
|
||||
_ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
|
||||
};
|
||||
}
|
||||
if let Some(ref local_var_str) = to_status {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("to-status", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = last_read_at {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("last_read_at", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<NotifyReadRepoListError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn notify_read_thread(configuration: &configuration::Configuration, id: &str, to_status: Option<&str>) -> Result<models::NotificationThread, Error<NotifyReadThreadError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/notifications/threads/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_str) = to_status {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("to-status", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<NotifyReadThreadError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
5244
crates/gitea-client/src/apis/organization_api.rs
Normal file
5244
crates/gitea-client/src/apis/organization_api.rs
Normal file
File diff suppressed because it is too large
Load Diff
374
crates/gitea-client/src/apis/package_api.rs
Normal file
374
crates/gitea-client/src/apis/package_api.rs
Normal file
@@ -0,0 +1,374 @@
|
||||
/*
|
||||
* Gitea API
|
||||
*
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.22.1
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
use reqwest;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::{apis::ResponseContent, models};
|
||||
use super::{Error, configuration};
|
||||
|
||||
|
||||
/// struct for typed errors of method [`delete_package`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum DeletePackageError {
|
||||
Status404(),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_package`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetPackageError {
|
||||
Status404(),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`list_package_files`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum ListPackageFilesError {
|
||||
Status404(),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`list_packages`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum ListPackagesError {
|
||||
Status404(),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
|
||||
pub async fn delete_package(configuration: &configuration::Configuration, owner: &str, r#type: &str, name: &str, version: &str) -> Result<(), Error<DeletePackageError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), type=crate::apis::urlencode(r#type), name=crate::apis::urlencode(name), version=crate::apis::urlencode(version));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
Ok(())
|
||||
} else {
|
||||
let local_var_entity: Option<DeletePackageError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_package(configuration: &configuration::Configuration, owner: &str, r#type: &str, name: &str, version: &str) -> Result<models::Package, Error<GetPackageError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), type=crate::apis::urlencode(r#type), name=crate::apis::urlencode(name), version=crate::apis::urlencode(version));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetPackageError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn list_package_files(configuration: &configuration::Configuration, owner: &str, r#type: &str, name: &str, version: &str) -> Result<Vec<models::PackageFile>, Error<ListPackageFilesError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}/files", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), type=crate::apis::urlencode(r#type), name=crate::apis::urlencode(name), version=crate::apis::urlencode(version));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<ListPackageFilesError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn list_packages(configuration: &configuration::Configuration, owner: &str, page: Option<i32>, limit: Option<i32>, r#type: Option<&str>, q: Option<&str>) -> Result<Vec<models::Package>, Error<ListPackagesError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/packages/{owner}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_str) = page {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = limit {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = r#type {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_str) = q {
|
||||
local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<ListPackagesError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
13945
crates/gitea-client/src/apis/repository_api.rs
Normal file
13945
crates/gitea-client/src/apis/repository_api.rs
Normal file
File diff suppressed because it is too large
Load Diff
358
crates/gitea-client/src/apis/settings_api.rs
Normal file
358
crates/gitea-client/src/apis/settings_api.rs
Normal file
@@ -0,0 +1,358 @@
|
||||
/*
|
||||
* Gitea API
|
||||
*
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.22.1
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
use reqwest;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use crate::{apis::ResponseContent, models};
|
||||
use super::{Error, configuration};
|
||||
|
||||
|
||||
/// struct for typed errors of method [`get_general_api_settings`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetGeneralApiSettingsError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_general_attachment_settings`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetGeneralAttachmentSettingsError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_general_repository_settings`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetGeneralRepositorySettingsError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_general_ui_settings`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetGeneralUiSettingsError {
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
|
||||
pub async fn get_general_api_settings(configuration: &configuration::Configuration, ) -> Result<models::GeneralApiSettings, Error<GetGeneralApiSettingsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/settings/api", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetGeneralApiSettingsError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_general_attachment_settings(configuration: &configuration::Configuration, ) -> Result<models::GeneralAttachmentSettings, Error<GetGeneralAttachmentSettingsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/settings/attachment", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetGeneralAttachmentSettingsError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_general_repository_settings(configuration: &configuration::Configuration, ) -> Result<models::GeneralRepoSettings, Error<GetGeneralRepositorySettingsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/settings/repository", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetGeneralRepositorySettingsError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_general_ui_settings(configuration: &configuration::Configuration, ) -> Result<models::GeneralUiSettings, Error<GetGeneralUiSettingsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/settings/ui", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]);
|
||||
}
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
|
||||
let local_var_key = local_var_apikey.key.clone();
|
||||
let local_var_value = match local_var_apikey.prefix {
|
||||
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
|
||||
None => local_var_key,
|
||||
};
|
||||
local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value);
|
||||
};
|
||||
if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth {
|
||||
local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned());
|
||||
};
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let local_var_resp = local_var_client.execute(local_var_req).await?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text().await?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetGeneralUiSettingsError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
6219
crates/gitea-client/src/apis/user_api.rs
Normal file
6219
crates/gitea-client/src/apis/user_api.rs
Normal file
File diff suppressed because it is too large
Load Diff
11
crates/gitea-client/src/lib.rs
Normal file
11
crates/gitea-client/src/lib.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
#![allow(unused_imports)]
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
|
||||
extern crate serde_repr;
|
||||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
extern crate url;
|
||||
extern crate reqwest;
|
||||
|
||||
pub mod apis;
|
||||
pub mod models;
|
39
crates/gitea-client/src/models/access_token.rs
Normal file
39
crates/gitea-client/src/models/access_token.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AccessToken {
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
|
||||
pub scopes: Option<Vec<String>>,
|
||||
#[serde(rename = "sha1", skip_serializing_if = "Option::is_none")]
|
||||
pub sha1: Option<String>,
|
||||
#[serde(rename = "token_last_eight", skip_serializing_if = "Option::is_none")]
|
||||
pub token_last_eight: Option<String>,
|
||||
}
|
||||
|
||||
impl AccessToken {
|
||||
pub fn new() -> AccessToken {
|
||||
AccessToken {
|
||||
id: None,
|
||||
name: None,
|
||||
scopes: None,
|
||||
sha1: None,
|
||||
token_last_eight: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
42
crates/gitea-client/src/models/action_variable.rs
Normal file
42
crates/gitea-client/src/models/action_variable.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ActionVariable : ActionVariable return value of the query API
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ActionVariable {
|
||||
/// the value of the variable
|
||||
#[serde(rename = "data", skip_serializing_if = "Option::is_none")]
|
||||
pub data: Option<String>,
|
||||
/// the name of the variable
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
/// the owner to which the variable belongs
|
||||
#[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
|
||||
pub owner_id: Option<i64>,
|
||||
/// the repository to which the variable belongs
|
||||
#[serde(rename = "repo_id", skip_serializing_if = "Option::is_none")]
|
||||
pub repo_id: Option<i64>,
|
||||
}
|
||||
|
||||
impl ActionVariable {
|
||||
/// ActionVariable return value of the query API
|
||||
pub fn new() -> ActionVariable {
|
||||
ActionVariable {
|
||||
data: None,
|
||||
name: None,
|
||||
owner_id: None,
|
||||
repo_id: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
63
crates/gitea-client/src/models/activity.rs
Normal file
63
crates/gitea-client/src/models/activity.rs
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Activity {
|
||||
#[serde(rename = "act_user", skip_serializing_if = "Option::is_none")]
|
||||
pub act_user: Option<Box<models::User>>,
|
||||
#[serde(rename = "act_user_id", skip_serializing_if = "Option::is_none")]
|
||||
pub act_user_id: Option<i64>,
|
||||
#[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
|
||||
pub comment: Option<Box<models::Comment>>,
|
||||
#[serde(rename = "comment_id", skip_serializing_if = "Option::is_none")]
|
||||
pub comment_id: Option<i64>,
|
||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<String>,
|
||||
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
|
||||
pub created: Option<String>,
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
#[serde(rename = "is_private", skip_serializing_if = "Option::is_none")]
|
||||
pub is_private: Option<bool>,
|
||||
#[serde(rename = "op_type", skip_serializing_if = "Option::is_none")]
|
||||
pub op_type: Option<String>,
|
||||
#[serde(rename = "ref_name", skip_serializing_if = "Option::is_none")]
|
||||
pub ref_name: Option<String>,
|
||||
#[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
|
||||
pub repo: Option<Box<models::Repository>>,
|
||||
#[serde(rename = "repo_id", skip_serializing_if = "Option::is_none")]
|
||||
pub repo_id: Option<i64>,
|
||||
#[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
|
||||
pub user_id: Option<i64>,
|
||||
}
|
||||
|
||||
impl Activity {
|
||||
pub fn new() -> Activity {
|
||||
Activity {
|
||||
act_user: None,
|
||||
act_user_id: None,
|
||||
comment: None,
|
||||
comment_id: None,
|
||||
content: None,
|
||||
created: None,
|
||||
id: None,
|
||||
is_private: None,
|
||||
op_type: None,
|
||||
ref_name: None,
|
||||
repo: None,
|
||||
repo_id: None,
|
||||
user_id: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
crates/gitea-client/src/models/activity_pub.rs
Normal file
29
crates/gitea-client/src/models/activity_pub.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ActivityPub : ActivityPub type
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ActivityPub {
|
||||
#[serde(rename = "@context", skip_serializing_if = "Option::is_none")]
|
||||
pub at_context: Option<String>,
|
||||
}
|
||||
|
||||
impl ActivityPub {
|
||||
/// ActivityPub type
|
||||
pub fn new() -> ActivityPub {
|
||||
ActivityPub {
|
||||
at_context: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
crates/gitea-client/src/models/add_collaborator_option.rs
Normal file
29
crates/gitea-client/src/models/add_collaborator_option.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// AddCollaboratorOption : AddCollaboratorOption options when adding a user as a collaborator of a repository
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AddCollaboratorOption {
|
||||
#[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
|
||||
pub permission: Option<String>,
|
||||
}
|
||||
|
||||
impl AddCollaboratorOption {
|
||||
/// AddCollaboratorOption options when adding a user as a collaborator of a repository
|
||||
pub fn new() -> AddCollaboratorOption {
|
||||
AddCollaboratorOption {
|
||||
permission: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
37
crates/gitea-client/src/models/add_time_option.rs
Normal file
37
crates/gitea-client/src/models/add_time_option.rs
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// AddTimeOption : AddTimeOption options for adding time to an issue
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AddTimeOption {
|
||||
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
|
||||
pub created: Option<String>,
|
||||
/// time in seconds
|
||||
#[serde(rename = "time")]
|
||||
pub time: i64,
|
||||
/// User who spent the time (optional)
|
||||
#[serde(rename = "user_name", skip_serializing_if = "Option::is_none")]
|
||||
pub user_name: Option<String>,
|
||||
}
|
||||
|
||||
impl AddTimeOption {
|
||||
/// AddTimeOption options for adding time to an issue
|
||||
pub fn new(time: i64) -> AddTimeOption {
|
||||
AddTimeOption {
|
||||
created: None,
|
||||
time,
|
||||
user_name: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
47
crates/gitea-client/src/models/annotated_tag.rs
Normal file
47
crates/gitea-client/src/models/annotated_tag.rs
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// AnnotatedTag : AnnotatedTag represents an annotated tag
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnnotatedTag {
|
||||
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
|
||||
pub message: Option<String>,
|
||||
#[serde(rename = "object", skip_serializing_if = "Option::is_none")]
|
||||
pub object: Option<Box<models::AnnotatedTagObject>>,
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
#[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
|
||||
pub tag: Option<String>,
|
||||
#[serde(rename = "tagger", skip_serializing_if = "Option::is_none")]
|
||||
pub tagger: Option<Box<models::CommitUser>>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
#[serde(rename = "verification", skip_serializing_if = "Option::is_none")]
|
||||
pub verification: Option<Box<models::PayloadCommitVerification>>,
|
||||
}
|
||||
|
||||
impl AnnotatedTag {
|
||||
/// AnnotatedTag represents an annotated tag
|
||||
pub fn new() -> AnnotatedTag {
|
||||
AnnotatedTag {
|
||||
message: None,
|
||||
object: None,
|
||||
sha: None,
|
||||
tag: None,
|
||||
tagger: None,
|
||||
url: None,
|
||||
verification: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
crates/gitea-client/src/models/annotated_tag_object.rs
Normal file
35
crates/gitea-client/src/models/annotated_tag_object.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// AnnotatedTagObject : AnnotatedTagObject contains meta information of the tag object
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AnnotatedTagObject {
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
|
||||
pub r#type: Option<String>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl AnnotatedTagObject {
|
||||
/// AnnotatedTagObject contains meta information of the tag object
|
||||
pub fn new() -> AnnotatedTagObject {
|
||||
AnnotatedTagObject {
|
||||
sha: None,
|
||||
r#type: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
32
crates/gitea-client/src/models/api_error.rs
Normal file
32
crates/gitea-client/src/models/api_error.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ApiError : APIError is an api error with a message
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ApiError {
|
||||
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
|
||||
pub message: Option<String>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl ApiError {
|
||||
/// APIError is an api error with a message
|
||||
pub fn new() -> ApiError {
|
||||
ApiError {
|
||||
message: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
47
crates/gitea-client/src/models/attachment.rs
Normal file
47
crates/gitea-client/src/models/attachment.rs
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// Attachment : Attachment a generic attachment
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Attachment {
|
||||
#[serde(rename = "browser_download_url", skip_serializing_if = "Option::is_none")]
|
||||
pub browser_download_url: Option<String>,
|
||||
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
|
||||
pub created_at: Option<String>,
|
||||
#[serde(rename = "download_count", skip_serializing_if = "Option::is_none")]
|
||||
pub download_count: Option<i64>,
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "size", skip_serializing_if = "Option::is_none")]
|
||||
pub size: Option<i64>,
|
||||
#[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
|
||||
pub uuid: Option<String>,
|
||||
}
|
||||
|
||||
impl Attachment {
|
||||
/// Attachment a generic attachment
|
||||
pub fn new() -> Attachment {
|
||||
Attachment {
|
||||
browser_download_url: None,
|
||||
created_at: None,
|
||||
download_count: None,
|
||||
id: None,
|
||||
name: None,
|
||||
size: None,
|
||||
uuid: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
crates/gitea-client/src/models/badge.rs
Normal file
38
crates/gitea-client/src/models/badge.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// Badge : Badge represents a user badge
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Badge {
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
#[serde(rename = "image_url", skip_serializing_if = "Option::is_none")]
|
||||
pub image_url: Option<String>,
|
||||
#[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
|
||||
pub slug: Option<String>,
|
||||
}
|
||||
|
||||
impl Badge {
|
||||
/// Badge represents a user badge
|
||||
pub fn new() -> Badge {
|
||||
Badge {
|
||||
description: None,
|
||||
id: None,
|
||||
image_url: None,
|
||||
slug: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
53
crates/gitea-client/src/models/branch.rs
Normal file
53
crates/gitea-client/src/models/branch.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// Branch : Branch represents a repository branch
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Branch {
|
||||
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
|
||||
pub commit: Option<Box<models::PayloadCommit>>,
|
||||
#[serde(rename = "effective_branch_protection_name", skip_serializing_if = "Option::is_none")]
|
||||
pub effective_branch_protection_name: Option<String>,
|
||||
#[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_status_check: Option<bool>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "protected", skip_serializing_if = "Option::is_none")]
|
||||
pub protected: Option<bool>,
|
||||
#[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub required_approvals: Option<i64>,
|
||||
#[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")]
|
||||
pub status_check_contexts: Option<Vec<String>>,
|
||||
#[serde(rename = "user_can_merge", skip_serializing_if = "Option::is_none")]
|
||||
pub user_can_merge: Option<bool>,
|
||||
#[serde(rename = "user_can_push", skip_serializing_if = "Option::is_none")]
|
||||
pub user_can_push: Option<bool>,
|
||||
}
|
||||
|
||||
impl Branch {
|
||||
/// Branch represents a repository branch
|
||||
pub fn new() -> Branch {
|
||||
Branch {
|
||||
commit: None,
|
||||
effective_branch_protection_name: None,
|
||||
enable_status_check: None,
|
||||
name: None,
|
||||
protected: None,
|
||||
required_approvals: None,
|
||||
status_check_contexts: None,
|
||||
user_can_merge: None,
|
||||
user_can_push: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
105
crates/gitea-client/src/models/branch_protection.rs
Normal file
105
crates/gitea-client/src/models/branch_protection.rs
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// BranchProtection : BranchProtection represents a branch protection for a repository
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct BranchProtection {
|
||||
#[serde(rename = "approvals_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub approvals_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "approvals_whitelist_username", skip_serializing_if = "Option::is_none")]
|
||||
pub approvals_whitelist_username: Option<Vec<String>>,
|
||||
#[serde(rename = "block_on_official_review_requests", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_official_review_requests: Option<bool>,
|
||||
#[serde(rename = "block_on_outdated_branch", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_outdated_branch: Option<bool>,
|
||||
#[serde(rename = "block_on_rejected_reviews", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_rejected_reviews: Option<bool>,
|
||||
/// Deprecated: true
|
||||
#[serde(rename = "branch_name", skip_serializing_if = "Option::is_none")]
|
||||
pub branch_name: Option<String>,
|
||||
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
|
||||
pub created_at: Option<String>,
|
||||
#[serde(rename = "dismiss_stale_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub dismiss_stale_approvals: Option<bool>,
|
||||
#[serde(rename = "enable_approvals_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_approvals_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_merge_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_merge_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_push", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_push: Option<bool>,
|
||||
#[serde(rename = "enable_push_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_push_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_status_check: Option<bool>,
|
||||
#[serde(rename = "ignore_stale_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub ignore_stale_approvals: Option<bool>,
|
||||
#[serde(rename = "merge_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub merge_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "merge_whitelist_usernames", skip_serializing_if = "Option::is_none")]
|
||||
pub merge_whitelist_usernames: Option<Vec<String>>,
|
||||
#[serde(rename = "protected_file_patterns", skip_serializing_if = "Option::is_none")]
|
||||
pub protected_file_patterns: Option<String>,
|
||||
#[serde(rename = "push_whitelist_deploy_keys", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_deploy_keys: Option<bool>,
|
||||
#[serde(rename = "push_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "push_whitelist_usernames", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_usernames: Option<Vec<String>>,
|
||||
#[serde(rename = "require_signed_commits", skip_serializing_if = "Option::is_none")]
|
||||
pub require_signed_commits: Option<bool>,
|
||||
#[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub required_approvals: Option<i64>,
|
||||
#[serde(rename = "rule_name", skip_serializing_if = "Option::is_none")]
|
||||
pub rule_name: Option<String>,
|
||||
#[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")]
|
||||
pub status_check_contexts: Option<Vec<String>>,
|
||||
#[serde(rename = "unprotected_file_patterns", skip_serializing_if = "Option::is_none")]
|
||||
pub unprotected_file_patterns: Option<String>,
|
||||
#[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
|
||||
pub updated_at: Option<String>,
|
||||
}
|
||||
|
||||
impl BranchProtection {
|
||||
/// BranchProtection represents a branch protection for a repository
|
||||
pub fn new() -> BranchProtection {
|
||||
BranchProtection {
|
||||
approvals_whitelist_teams: None,
|
||||
approvals_whitelist_username: None,
|
||||
block_on_official_review_requests: None,
|
||||
block_on_outdated_branch: None,
|
||||
block_on_rejected_reviews: None,
|
||||
branch_name: None,
|
||||
created_at: None,
|
||||
dismiss_stale_approvals: None,
|
||||
enable_approvals_whitelist: None,
|
||||
enable_merge_whitelist: None,
|
||||
enable_push: None,
|
||||
enable_push_whitelist: None,
|
||||
enable_status_check: None,
|
||||
ignore_stale_approvals: None,
|
||||
merge_whitelist_teams: None,
|
||||
merge_whitelist_usernames: None,
|
||||
protected_file_patterns: None,
|
||||
push_whitelist_deploy_keys: None,
|
||||
push_whitelist_teams: None,
|
||||
push_whitelist_usernames: None,
|
||||
require_signed_commits: None,
|
||||
required_approvals: None,
|
||||
rule_name: None,
|
||||
status_check_contexts: None,
|
||||
unprotected_file_patterns: None,
|
||||
updated_at: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
62
crates/gitea-client/src/models/change_file_operation.rs
Normal file
62
crates/gitea-client/src/models/change_file_operation.rs
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ChangeFileOperation : ChangeFileOperation for creating, updating or deleting a file
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ChangeFileOperation {
|
||||
/// new or updated file content, must be base64 encoded
|
||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<String>,
|
||||
/// old path of the file to move
|
||||
#[serde(rename = "from_path", skip_serializing_if = "Option::is_none")]
|
||||
pub from_path: Option<String>,
|
||||
/// indicates what to do with the file
|
||||
#[serde(rename = "operation")]
|
||||
pub operation: Operation,
|
||||
/// path to the existing or new file
|
||||
#[serde(rename = "path")]
|
||||
pub path: String,
|
||||
/// sha is the SHA for the file that already exists, required for update or delete
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
}
|
||||
|
||||
impl ChangeFileOperation {
|
||||
/// ChangeFileOperation for creating, updating or deleting a file
|
||||
pub fn new(operation: Operation, path: String) -> ChangeFileOperation {
|
||||
ChangeFileOperation {
|
||||
content: None,
|
||||
from_path: None,
|
||||
operation,
|
||||
path,
|
||||
sha: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
/// indicates what to do with the file
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum Operation {
|
||||
#[serde(rename = "create")]
|
||||
Create,
|
||||
#[serde(rename = "update")]
|
||||
Update,
|
||||
#[serde(rename = "delete")]
|
||||
Delete,
|
||||
}
|
||||
|
||||
impl Default for Operation {
|
||||
fn default() -> Operation {
|
||||
Self::Create
|
||||
}
|
||||
}
|
||||
|
55
crates/gitea-client/src/models/change_files_options.rs
Normal file
55
crates/gitea-client/src/models/change_files_options.rs
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// 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)
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ChangeFilesOptions {
|
||||
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
|
||||
pub author: Option<Box<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<models::Identity>>,
|
||||
#[serde(rename = "dates", skip_serializing_if = "Option::is_none")]
|
||||
pub dates: Option<Box<models::CommitDateOptions>>,
|
||||
/// list of file operations
|
||||
#[serde(rename = "files")]
|
||||
pub files: Vec<models::ChangeFileOperation>,
|
||||
/// 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>,
|
||||
/// 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 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)
|
||||
pub fn new(files: Vec<models::ChangeFileOperation>) -> ChangeFilesOptions {
|
||||
ChangeFilesOptions {
|
||||
author: None,
|
||||
branch: None,
|
||||
committer: None,
|
||||
dates: None,
|
||||
files,
|
||||
message: None,
|
||||
new_branch: None,
|
||||
signoff: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
53
crates/gitea-client/src/models/changed_file.rs
Normal file
53
crates/gitea-client/src/models/changed_file.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ChangedFile : ChangedFile store information about files affected by the pull request
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ChangedFile {
|
||||
#[serde(rename = "additions", skip_serializing_if = "Option::is_none")]
|
||||
pub additions: Option<i64>,
|
||||
#[serde(rename = "changes", skip_serializing_if = "Option::is_none")]
|
||||
pub changes: Option<i64>,
|
||||
#[serde(rename = "contents_url", skip_serializing_if = "Option::is_none")]
|
||||
pub contents_url: Option<String>,
|
||||
#[serde(rename = "deletions", skip_serializing_if = "Option::is_none")]
|
||||
pub deletions: Option<i64>,
|
||||
#[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
|
||||
pub filename: Option<String>,
|
||||
#[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
|
||||
pub html_url: Option<String>,
|
||||
#[serde(rename = "previous_filename", skip_serializing_if = "Option::is_none")]
|
||||
pub previous_filename: Option<String>,
|
||||
#[serde(rename = "raw_url", skip_serializing_if = "Option::is_none")]
|
||||
pub raw_url: Option<String>,
|
||||
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
|
||||
pub status: Option<String>,
|
||||
}
|
||||
|
||||
impl ChangedFile {
|
||||
/// ChangedFile store information about files affected by the pull request
|
||||
pub fn new() -> ChangedFile {
|
||||
ChangedFile {
|
||||
additions: None,
|
||||
changes: None,
|
||||
contents_url: None,
|
||||
deletions: None,
|
||||
filename: None,
|
||||
html_url: None,
|
||||
previous_filename: None,
|
||||
raw_url: None,
|
||||
status: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
48
crates/gitea-client/src/models/combined_status.rs
Normal file
48
crates/gitea-client/src/models/combined_status.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CombinedStatus : CombinedStatus holds the combined state of several statuses for a single commit
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CombinedStatus {
|
||||
#[serde(rename = "commit_url", skip_serializing_if = "Option::is_none")]
|
||||
pub commit_url: Option<String>,
|
||||
#[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
|
||||
pub repository: Option<Box<models::Repository>>,
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
/// CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\" and \"failure\"
|
||||
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
|
||||
pub state: Option<String>,
|
||||
#[serde(rename = "statuses", skip_serializing_if = "Option::is_none")]
|
||||
pub statuses: Option<Vec<models::CommitStatus>>,
|
||||
#[serde(rename = "total_count", skip_serializing_if = "Option::is_none")]
|
||||
pub total_count: Option<i64>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl CombinedStatus {
|
||||
/// CombinedStatus holds the combined state of several statuses for a single commit
|
||||
pub fn new() -> CombinedStatus {
|
||||
CombinedStatus {
|
||||
commit_url: None,
|
||||
repository: None,
|
||||
sha: None,
|
||||
state: None,
|
||||
statuses: None,
|
||||
total_count: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
59
crates/gitea-client/src/models/comment.rs
Normal file
59
crates/gitea-client/src/models/comment.rs
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// Comment : Comment represents a comment on a commit or issue
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Comment {
|
||||
#[serde(rename = "assets", skip_serializing_if = "Option::is_none")]
|
||||
pub assets: Option<Vec<models::Attachment>>,
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
|
||||
pub created_at: Option<String>,
|
||||
#[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
|
||||
pub html_url: Option<String>,
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
#[serde(rename = "issue_url", skip_serializing_if = "Option::is_none")]
|
||||
pub issue_url: Option<String>,
|
||||
#[serde(rename = "original_author", skip_serializing_if = "Option::is_none")]
|
||||
pub original_author: Option<String>,
|
||||
#[serde(rename = "original_author_id", skip_serializing_if = "Option::is_none")]
|
||||
pub original_author_id: Option<i64>,
|
||||
#[serde(rename = "pull_request_url", skip_serializing_if = "Option::is_none")]
|
||||
pub pull_request_url: Option<String>,
|
||||
#[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
|
||||
pub updated_at: Option<String>,
|
||||
#[serde(rename = "user", skip_serializing_if = "Option::is_none")]
|
||||
pub user: Option<Box<models::User>>,
|
||||
}
|
||||
|
||||
impl Comment {
|
||||
/// Comment represents a comment on a commit or issue
|
||||
pub fn new() -> Comment {
|
||||
Comment {
|
||||
assets: None,
|
||||
body: None,
|
||||
created_at: None,
|
||||
html_url: None,
|
||||
id: None,
|
||||
issue_url: None,
|
||||
original_author: None,
|
||||
original_author_id: None,
|
||||
pull_request_url: None,
|
||||
updated_at: None,
|
||||
user: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
54
crates/gitea-client/src/models/commit.rs
Normal file
54
crates/gitea-client/src/models/commit.rs
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Commit {
|
||||
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
|
||||
pub author: Option<Box<models::User>>,
|
||||
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
|
||||
pub commit: Option<Box<models::RepoCommit>>,
|
||||
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
|
||||
pub committer: Option<Box<models::User>>,
|
||||
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
|
||||
pub created: Option<String>,
|
||||
#[serde(rename = "files", skip_serializing_if = "Option::is_none")]
|
||||
pub files: Option<Vec<models::CommitAffectedFiles>>,
|
||||
#[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
|
||||
pub html_url: Option<String>,
|
||||
#[serde(rename = "parents", skip_serializing_if = "Option::is_none")]
|
||||
pub parents: Option<Vec<models::CommitMeta>>,
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
#[serde(rename = "stats", skip_serializing_if = "Option::is_none")]
|
||||
pub stats: Option<Box<models::CommitStats>>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl Commit {
|
||||
pub fn new() -> Commit {
|
||||
Commit {
|
||||
author: None,
|
||||
commit: None,
|
||||
committer: None,
|
||||
created: None,
|
||||
files: None,
|
||||
html_url: None,
|
||||
parents: None,
|
||||
sha: None,
|
||||
stats: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
32
crates/gitea-client/src/models/commit_affected_files.rs
Normal file
32
crates/gitea-client/src/models/commit_affected_files.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CommitAffectedFiles : CommitAffectedFiles store information about files affected by the commit
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommitAffectedFiles {
|
||||
#[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
|
||||
pub filename: Option<String>,
|
||||
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
|
||||
pub status: Option<String>,
|
||||
}
|
||||
|
||||
impl CommitAffectedFiles {
|
||||
/// CommitAffectedFiles store information about files affected by the commit
|
||||
pub fn new() -> CommitAffectedFiles {
|
||||
CommitAffectedFiles {
|
||||
filename: None,
|
||||
status: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
32
crates/gitea-client/src/models/commit_date_options.rs
Normal file
32
crates/gitea-client/src/models/commit_date_options.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CommitDateOptions : CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommitDateOptions {
|
||||
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
|
||||
pub author: Option<String>,
|
||||
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
|
||||
pub committer: Option<String>,
|
||||
}
|
||||
|
||||
impl CommitDateOptions {
|
||||
/// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
|
||||
pub fn new() -> CommitDateOptions {
|
||||
CommitDateOptions {
|
||||
author: None,
|
||||
committer: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
33
crates/gitea-client/src/models/commit_meta.rs
Normal file
33
crates/gitea-client/src/models/commit_meta.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommitMeta {
|
||||
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
|
||||
pub created: Option<String>,
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl CommitMeta {
|
||||
pub fn new() -> CommitMeta {
|
||||
CommitMeta {
|
||||
created: None,
|
||||
sha: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
crates/gitea-client/src/models/commit_stats.rs
Normal file
35
crates/gitea-client/src/models/commit_stats.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CommitStats : CommitStats is statistics for a RepoCommit
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommitStats {
|
||||
#[serde(rename = "additions", skip_serializing_if = "Option::is_none")]
|
||||
pub additions: Option<i64>,
|
||||
#[serde(rename = "deletions", skip_serializing_if = "Option::is_none")]
|
||||
pub deletions: Option<i64>,
|
||||
#[serde(rename = "total", skip_serializing_if = "Option::is_none")]
|
||||
pub total: Option<i64>,
|
||||
}
|
||||
|
||||
impl CommitStats {
|
||||
/// CommitStats is statistics for a RepoCommit
|
||||
pub fn new() -> CommitStats {
|
||||
CommitStats {
|
||||
additions: None,
|
||||
deletions: None,
|
||||
total: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
54
crates/gitea-client/src/models/commit_status.rs
Normal file
54
crates/gitea-client/src/models/commit_status.rs
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CommitStatus : CommitStatus holds a single status of a single Commit
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommitStatus {
|
||||
#[serde(rename = "context", skip_serializing_if = "Option::is_none")]
|
||||
pub context: Option<String>,
|
||||
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
|
||||
pub created_at: Option<String>,
|
||||
#[serde(rename = "creator", skip_serializing_if = "Option::is_none")]
|
||||
pub creator: Option<Box<models::User>>,
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
/// CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\" and \"failure\"
|
||||
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
|
||||
pub status: Option<String>,
|
||||
#[serde(rename = "target_url", skip_serializing_if = "Option::is_none")]
|
||||
pub target_url: Option<String>,
|
||||
#[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
|
||||
pub updated_at: Option<String>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl CommitStatus {
|
||||
/// CommitStatus holds a single status of a single Commit
|
||||
pub fn new() -> CommitStatus {
|
||||
CommitStatus {
|
||||
context: None,
|
||||
created_at: None,
|
||||
creator: None,
|
||||
description: None,
|
||||
id: None,
|
||||
status: None,
|
||||
target_url: None,
|
||||
updated_at: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
33
crates/gitea-client/src/models/commit_user.rs
Normal file
33
crates/gitea-client/src/models/commit_user.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommitUser {
|
||||
#[serde(rename = "date", skip_serializing_if = "Option::is_none")]
|
||||
pub date: Option<String>,
|
||||
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
|
||||
pub email: Option<String>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
impl CommitUser {
|
||||
pub fn new() -> CommitUser {
|
||||
CommitUser {
|
||||
date: None,
|
||||
email: None,
|
||||
name: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
30
crates/gitea-client/src/models/compare.rs
Normal file
30
crates/gitea-client/src/models/compare.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Compare {
|
||||
#[serde(rename = "commits", skip_serializing_if = "Option::is_none")]
|
||||
pub commits: Option<Vec<models::Commit>>,
|
||||
#[serde(rename = "total_commits", skip_serializing_if = "Option::is_none")]
|
||||
pub total_commits: Option<i64>,
|
||||
}
|
||||
|
||||
impl Compare {
|
||||
pub fn new() -> Compare {
|
||||
Compare {
|
||||
commits: None,
|
||||
total_commits: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
76
crates/gitea-client/src/models/contents_response.rs
Normal file
76
crates/gitea-client/src/models/contents_response.rs
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ContentsResponse : ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ContentsResponse {
|
||||
#[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
|
||||
pub _links: Option<Box<models::FileLinksResponse>>,
|
||||
/// `content` is populated when `type` is `file`, otherwise null
|
||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<String>,
|
||||
#[serde(rename = "download_url", skip_serializing_if = "Option::is_none")]
|
||||
pub download_url: Option<String>,
|
||||
/// `encoding` is populated when `type` is `file`, otherwise null
|
||||
#[serde(rename = "encoding", skip_serializing_if = "Option::is_none")]
|
||||
pub encoding: Option<String>,
|
||||
#[serde(rename = "git_url", skip_serializing_if = "Option::is_none")]
|
||||
pub git_url: Option<String>,
|
||||
#[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
|
||||
pub html_url: Option<String>,
|
||||
#[serde(rename = "last_commit_sha", skip_serializing_if = "Option::is_none")]
|
||||
pub last_commit_sha: Option<String>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "path", skip_serializing_if = "Option::is_none")]
|
||||
pub path: Option<String>,
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
#[serde(rename = "size", skip_serializing_if = "Option::is_none")]
|
||||
pub size: Option<i64>,
|
||||
/// `submodule_git_url` is populated when `type` is `submodule`, otherwise null
|
||||
#[serde(rename = "submodule_git_url", skip_serializing_if = "Option::is_none")]
|
||||
pub submodule_git_url: Option<String>,
|
||||
/// `target` is populated when `type` is `symlink`, otherwise null
|
||||
#[serde(rename = "target", skip_serializing_if = "Option::is_none")]
|
||||
pub target: Option<String>,
|
||||
/// `type` will be `file`, `dir`, `symlink`, or `submodule`
|
||||
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
|
||||
pub r#type: Option<String>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl ContentsResponse {
|
||||
/// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
|
||||
pub fn new() -> ContentsResponse {
|
||||
ContentsResponse {
|
||||
_links: None,
|
||||
content: None,
|
||||
download_url: None,
|
||||
encoding: None,
|
||||
git_url: None,
|
||||
html_url: None,
|
||||
last_commit_sha: None,
|
||||
name: None,
|
||||
path: None,
|
||||
sha: None,
|
||||
size: None,
|
||||
submodule_git_url: None,
|
||||
target: None,
|
||||
r#type: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
32
crates/gitea-client/src/models/create_access_token_option.rs
Normal file
32
crates/gitea-client/src/models/create_access_token_option.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateAccessTokenOption : CreateAccessTokenOption options when create access token
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateAccessTokenOption {
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
#[serde(rename = "scopes", skip_serializing_if = "Option::is_none")]
|
||||
pub scopes: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl CreateAccessTokenOption {
|
||||
/// CreateAccessTokenOption options when create access token
|
||||
pub fn new(name: String) -> CreateAccessTokenOption {
|
||||
CreateAccessTokenOption {
|
||||
name,
|
||||
scopes: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateBranchProtectionOption : CreateBranchProtectionOption options for creating a branch protection
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateBranchProtectionOption {
|
||||
#[serde(rename = "approvals_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub approvals_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "approvals_whitelist_username", skip_serializing_if = "Option::is_none")]
|
||||
pub approvals_whitelist_username: Option<Vec<String>>,
|
||||
#[serde(rename = "block_on_official_review_requests", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_official_review_requests: Option<bool>,
|
||||
#[serde(rename = "block_on_outdated_branch", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_outdated_branch: Option<bool>,
|
||||
#[serde(rename = "block_on_rejected_reviews", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_rejected_reviews: Option<bool>,
|
||||
/// Deprecated: true
|
||||
#[serde(rename = "branch_name", skip_serializing_if = "Option::is_none")]
|
||||
pub branch_name: Option<String>,
|
||||
#[serde(rename = "dismiss_stale_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub dismiss_stale_approvals: Option<bool>,
|
||||
#[serde(rename = "enable_approvals_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_approvals_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_merge_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_merge_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_push", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_push: Option<bool>,
|
||||
#[serde(rename = "enable_push_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_push_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_status_check: Option<bool>,
|
||||
#[serde(rename = "ignore_stale_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub ignore_stale_approvals: Option<bool>,
|
||||
#[serde(rename = "merge_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub merge_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "merge_whitelist_usernames", skip_serializing_if = "Option::is_none")]
|
||||
pub merge_whitelist_usernames: Option<Vec<String>>,
|
||||
#[serde(rename = "protected_file_patterns", skip_serializing_if = "Option::is_none")]
|
||||
pub protected_file_patterns: Option<String>,
|
||||
#[serde(rename = "push_whitelist_deploy_keys", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_deploy_keys: Option<bool>,
|
||||
#[serde(rename = "push_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "push_whitelist_usernames", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_usernames: Option<Vec<String>>,
|
||||
#[serde(rename = "require_signed_commits", skip_serializing_if = "Option::is_none")]
|
||||
pub require_signed_commits: Option<bool>,
|
||||
#[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub required_approvals: Option<i64>,
|
||||
#[serde(rename = "rule_name", skip_serializing_if = "Option::is_none")]
|
||||
pub rule_name: Option<String>,
|
||||
#[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")]
|
||||
pub status_check_contexts: Option<Vec<String>>,
|
||||
#[serde(rename = "unprotected_file_patterns", skip_serializing_if = "Option::is_none")]
|
||||
pub unprotected_file_patterns: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateBranchProtectionOption {
|
||||
/// CreateBranchProtectionOption options for creating a branch protection
|
||||
pub fn new() -> CreateBranchProtectionOption {
|
||||
CreateBranchProtectionOption {
|
||||
approvals_whitelist_teams: None,
|
||||
approvals_whitelist_username: None,
|
||||
block_on_official_review_requests: None,
|
||||
block_on_outdated_branch: None,
|
||||
block_on_rejected_reviews: None,
|
||||
branch_name: None,
|
||||
dismiss_stale_approvals: None,
|
||||
enable_approvals_whitelist: None,
|
||||
enable_merge_whitelist: None,
|
||||
enable_push: None,
|
||||
enable_push_whitelist: None,
|
||||
enable_status_check: None,
|
||||
ignore_stale_approvals: None,
|
||||
merge_whitelist_teams: None,
|
||||
merge_whitelist_usernames: None,
|
||||
protected_file_patterns: None,
|
||||
push_whitelist_deploy_keys: None,
|
||||
push_whitelist_teams: None,
|
||||
push_whitelist_usernames: None,
|
||||
require_signed_commits: None,
|
||||
required_approvals: None,
|
||||
rule_name: None,
|
||||
status_check_contexts: None,
|
||||
unprotected_file_patterns: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
crates/gitea-client/src/models/create_branch_repo_option.rs
Normal file
38
crates/gitea-client/src/models/create_branch_repo_option.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateBranchRepoOption : CreateBranchRepoOption options when creating a branch in a repository
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateBranchRepoOption {
|
||||
/// Name of the branch to create
|
||||
#[serde(rename = "new_branch_name")]
|
||||
pub new_branch_name: String,
|
||||
/// Deprecated: true Name of the old branch to create from
|
||||
#[serde(rename = "old_branch_name", skip_serializing_if = "Option::is_none")]
|
||||
pub old_branch_name: Option<String>,
|
||||
/// Name of the old branch/tag/commit to create from
|
||||
#[serde(rename = "old_ref_name", skip_serializing_if = "Option::is_none")]
|
||||
pub old_ref_name: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateBranchRepoOption {
|
||||
/// CreateBranchRepoOption options when creating a branch in a repository
|
||||
pub fn new(new_branch_name: String) -> CreateBranchRepoOption {
|
||||
CreateBranchRepoOption {
|
||||
new_branch_name,
|
||||
old_branch_name: None,
|
||||
old_ref_name: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
30
crates/gitea-client/src/models/create_email_option.rs
Normal file
30
crates/gitea-client/src/models/create_email_option.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateEmailOption : CreateEmailOption options when creating email addresses
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateEmailOption {
|
||||
/// email addresses to add
|
||||
#[serde(rename = "emails", skip_serializing_if = "Option::is_none")]
|
||||
pub emails: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl CreateEmailOption {
|
||||
/// CreateEmailOption options when creating email addresses
|
||||
pub fn new() -> CreateEmailOption {
|
||||
CreateEmailOption {
|
||||
emails: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
55
crates/gitea-client/src/models/create_file_options.rs
Normal file
55
crates/gitea-client/src/models/create_file_options.rs
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateFileOptions : CreateFileOptions options for creating 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, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateFileOptions {
|
||||
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
|
||||
pub author: Option<Box<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<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<models::CommitDateOptions>>,
|
||||
/// 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>,
|
||||
/// 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 CreateFileOptions {
|
||||
/// CreateFileOptions options for creating 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) -> CreateFileOptions {
|
||||
CreateFileOptions {
|
||||
author: None,
|
||||
branch: None,
|
||||
committer: None,
|
||||
content,
|
||||
dates: None,
|
||||
message: None,
|
||||
new_branch: None,
|
||||
signoff: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
34
crates/gitea-client/src/models/create_fork_option.rs
Normal file
34
crates/gitea-client/src/models/create_fork_option.rs
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateForkOption : CreateForkOption options for creating a fork
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateForkOption {
|
||||
/// name of the forked repository
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
/// organization name, if forking into an organization
|
||||
#[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
|
||||
pub organization: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateForkOption {
|
||||
/// CreateForkOption options for creating a fork
|
||||
pub fn new() -> CreateForkOption {
|
||||
CreateForkOption {
|
||||
name: None,
|
||||
organization: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
33
crates/gitea-client/src/models/create_gpg_key_option.rs
Normal file
33
crates/gitea-client/src/models/create_gpg_key_option.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateGpgKeyOption : CreateGPGKeyOption options create user GPG key
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateGpgKeyOption {
|
||||
/// An armored GPG key to add
|
||||
#[serde(rename = "armored_public_key")]
|
||||
pub armored_public_key: String,
|
||||
#[serde(rename = "armored_signature", skip_serializing_if = "Option::is_none")]
|
||||
pub armored_signature: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateGpgKeyOption {
|
||||
/// CreateGPGKeyOption options create user GPG key
|
||||
pub fn new(armored_public_key: String) -> CreateGpgKeyOption {
|
||||
CreateGpgKeyOption {
|
||||
armored_public_key,
|
||||
armored_signature: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
75
crates/gitea-client/src/models/create_hook_option.rs
Normal file
75
crates/gitea-client/src/models/create_hook_option.rs
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateHookOption : CreateHookOption options when create a hook
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateHookOption {
|
||||
#[serde(rename = "active", skip_serializing_if = "Option::is_none")]
|
||||
pub active: Option<bool>,
|
||||
#[serde(rename = "authorization_header", skip_serializing_if = "Option::is_none")]
|
||||
pub authorization_header: Option<String>,
|
||||
#[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")]
|
||||
pub branch_filter: Option<String>,
|
||||
/// CreateHookOptionConfig has all config options in it required are \"content_type\" and \"url\" Required
|
||||
#[serde(rename = "config")]
|
||||
pub config: std::collections::HashMap<String, String>,
|
||||
#[serde(rename = "events", skip_serializing_if = "Option::is_none")]
|
||||
pub events: Option<Vec<String>>,
|
||||
#[serde(rename = "type")]
|
||||
pub r#type: Type,
|
||||
}
|
||||
|
||||
impl CreateHookOption {
|
||||
/// CreateHookOption options when create a hook
|
||||
pub fn new(config: std::collections::HashMap<String, String>, r#type: Type) -> CreateHookOption {
|
||||
CreateHookOption {
|
||||
active: None,
|
||||
authorization_header: None,
|
||||
branch_filter: None,
|
||||
config,
|
||||
events: None,
|
||||
r#type,
|
||||
}
|
||||
}
|
||||
}
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum Type {
|
||||
#[serde(rename = "dingtalk")]
|
||||
Dingtalk,
|
||||
#[serde(rename = "discord")]
|
||||
Discord,
|
||||
#[serde(rename = "gitea")]
|
||||
Gitea,
|
||||
#[serde(rename = "gogs")]
|
||||
Gogs,
|
||||
#[serde(rename = "msteams")]
|
||||
Msteams,
|
||||
#[serde(rename = "slack")]
|
||||
Slack,
|
||||
#[serde(rename = "telegram")]
|
||||
Telegram,
|
||||
#[serde(rename = "feishu")]
|
||||
Feishu,
|
||||
#[serde(rename = "wechatwork")]
|
||||
Wechatwork,
|
||||
#[serde(rename = "packagist")]
|
||||
Packagist,
|
||||
}
|
||||
|
||||
impl Default for Type {
|
||||
fn default() -> Type {
|
||||
Self::Dingtalk
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateIssueCommentOption : CreateIssueCommentOption options for creating a comment on an issue
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateIssueCommentOption {
|
||||
#[serde(rename = "body")]
|
||||
pub body: String,
|
||||
}
|
||||
|
||||
impl CreateIssueCommentOption {
|
||||
/// CreateIssueCommentOption options for creating a comment on an issue
|
||||
pub fn new(body: String) -> CreateIssueCommentOption {
|
||||
CreateIssueCommentOption {
|
||||
body,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
56
crates/gitea-client/src/models/create_issue_option.rs
Normal file
56
crates/gitea-client/src/models/create_issue_option.rs
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateIssueOption : CreateIssueOption options to create one issue
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateIssueOption {
|
||||
/// deprecated
|
||||
#[serde(rename = "assignee", skip_serializing_if = "Option::is_none")]
|
||||
pub assignee: Option<String>,
|
||||
#[serde(rename = "assignees", skip_serializing_if = "Option::is_none")]
|
||||
pub assignees: Option<Vec<String>>,
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "closed", skip_serializing_if = "Option::is_none")]
|
||||
pub closed: Option<bool>,
|
||||
#[serde(rename = "due_date", skip_serializing_if = "Option::is_none")]
|
||||
pub due_date: Option<String>,
|
||||
/// list of label ids
|
||||
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
|
||||
pub labels: Option<Vec<i64>>,
|
||||
/// milestone id
|
||||
#[serde(rename = "milestone", skip_serializing_if = "Option::is_none")]
|
||||
pub milestone: Option<i64>,
|
||||
#[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
|
||||
pub r#ref: Option<String>,
|
||||
#[serde(rename = "title")]
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
impl CreateIssueOption {
|
||||
/// CreateIssueOption options to create one issue
|
||||
pub fn new(title: String) -> CreateIssueOption {
|
||||
CreateIssueOption {
|
||||
assignee: None,
|
||||
assignees: None,
|
||||
body: None,
|
||||
closed: None,
|
||||
due_date: None,
|
||||
labels: None,
|
||||
milestone: None,
|
||||
r#ref: None,
|
||||
title,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
crates/gitea-client/src/models/create_key_option.rs
Normal file
38
crates/gitea-client/src/models/create_key_option.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateKeyOption : CreateKeyOption options when creating a key
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateKeyOption {
|
||||
/// An armored SSH key to add
|
||||
#[serde(rename = "key")]
|
||||
pub key: String,
|
||||
/// Describe if the key has only read access or read/write
|
||||
#[serde(rename = "read_only", skip_serializing_if = "Option::is_none")]
|
||||
pub read_only: Option<bool>,
|
||||
/// Title of the key to add
|
||||
#[serde(rename = "title")]
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
impl CreateKeyOption {
|
||||
/// CreateKeyOption options when creating a key
|
||||
pub fn new(key: String, title: String) -> CreateKeyOption {
|
||||
CreateKeyOption {
|
||||
key,
|
||||
read_only: None,
|
||||
title,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
crates/gitea-client/src/models/create_label_option.rs
Normal file
41
crates/gitea-client/src/models/create_label_option.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateLabelOption : CreateLabelOption options for creating a label
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateLabelOption {
|
||||
#[serde(rename = "color")]
|
||||
pub color: String,
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "exclusive", skip_serializing_if = "Option::is_none")]
|
||||
pub exclusive: Option<bool>,
|
||||
#[serde(rename = "is_archived", skip_serializing_if = "Option::is_none")]
|
||||
pub is_archived: Option<bool>,
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
impl CreateLabelOption {
|
||||
/// CreateLabelOption options for creating a label
|
||||
pub fn new(color: String, name: String) -> CreateLabelOption {
|
||||
CreateLabelOption {
|
||||
color,
|
||||
description: None,
|
||||
exclusive: None,
|
||||
is_archived: None,
|
||||
name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
52
crates/gitea-client/src/models/create_milestone_option.rs
Normal file
52
crates/gitea-client/src/models/create_milestone_option.rs
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateMilestoneOption : CreateMilestoneOption options for creating a milestone
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateMilestoneOption {
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "due_on", skip_serializing_if = "Option::is_none")]
|
||||
pub due_on: Option<String>,
|
||||
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
|
||||
pub state: Option<State>,
|
||||
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateMilestoneOption {
|
||||
/// CreateMilestoneOption options for creating a milestone
|
||||
pub fn new() -> CreateMilestoneOption {
|
||||
CreateMilestoneOption {
|
||||
description: None,
|
||||
due_on: None,
|
||||
state: None,
|
||||
title: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum State {
|
||||
#[serde(rename = "open")]
|
||||
Open,
|
||||
#[serde(rename = "closed")]
|
||||
Closed,
|
||||
}
|
||||
|
||||
impl Default for State {
|
||||
fn default() -> State {
|
||||
Self::Open
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateOAuth2ApplicationOptions : CreateOAuth2ApplicationOptions holds options to create an oauth2 application
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateOAuth2ApplicationOptions {
|
||||
#[serde(rename = "confidential_client", skip_serializing_if = "Option::is_none")]
|
||||
pub confidential_client: Option<bool>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "redirect_uris", skip_serializing_if = "Option::is_none")]
|
||||
pub redirect_uris: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl CreateOAuth2ApplicationOptions {
|
||||
/// CreateOAuth2ApplicationOptions holds options to create an oauth2 application
|
||||
pub fn new() -> CreateOAuth2ApplicationOptions {
|
||||
CreateOAuth2ApplicationOptions {
|
||||
confidential_client: None,
|
||||
name: None,
|
||||
redirect_uris: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateOrUpdateSecretOption : CreateOrUpdateSecretOption options when creating or updating secret
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateOrUpdateSecretOption {
|
||||
/// Data of the secret to update
|
||||
#[serde(rename = "data")]
|
||||
pub data: String,
|
||||
}
|
||||
|
||||
impl CreateOrUpdateSecretOption {
|
||||
/// CreateOrUpdateSecretOption options when creating or updating secret
|
||||
pub fn new(data: String) -> CreateOrUpdateSecretOption {
|
||||
CreateOrUpdateSecretOption {
|
||||
data,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
67
crates/gitea-client/src/models/create_org_option.rs
Normal file
67
crates/gitea-client/src/models/create_org_option.rs
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateOrgOption : CreateOrgOption options for creating an organization
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateOrgOption {
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
|
||||
pub email: Option<String>,
|
||||
#[serde(rename = "full_name", skip_serializing_if = "Option::is_none")]
|
||||
pub full_name: Option<String>,
|
||||
#[serde(rename = "location", skip_serializing_if = "Option::is_none")]
|
||||
pub location: Option<String>,
|
||||
#[serde(rename = "repo_admin_change_team_access", skip_serializing_if = "Option::is_none")]
|
||||
pub repo_admin_change_team_access: Option<bool>,
|
||||
#[serde(rename = "username")]
|
||||
pub username: String,
|
||||
/// possible values are `public` (default), `limited` or `private`
|
||||
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
|
||||
pub visibility: Option<Visibility>,
|
||||
#[serde(rename = "website", skip_serializing_if = "Option::is_none")]
|
||||
pub website: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateOrgOption {
|
||||
/// CreateOrgOption options for creating an organization
|
||||
pub fn new(username: String) -> CreateOrgOption {
|
||||
CreateOrgOption {
|
||||
description: None,
|
||||
email: None,
|
||||
full_name: None,
|
||||
location: None,
|
||||
repo_admin_change_team_access: None,
|
||||
username,
|
||||
visibility: None,
|
||||
website: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
/// possible values are `public` (default), `limited` or `private`
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum Visibility {
|
||||
#[serde(rename = "public")]
|
||||
Public,
|
||||
#[serde(rename = "limited")]
|
||||
Limited,
|
||||
#[serde(rename = "private")]
|
||||
Private,
|
||||
}
|
||||
|
||||
impl Default for Visibility {
|
||||
fn default() -> Visibility {
|
||||
Self::Public
|
||||
}
|
||||
}
|
||||
|
53
crates/gitea-client/src/models/create_pull_request_option.rs
Normal file
53
crates/gitea-client/src/models/create_pull_request_option.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreatePullRequestOption : CreatePullRequestOption options when creating a pull request
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreatePullRequestOption {
|
||||
#[serde(rename = "assignee", skip_serializing_if = "Option::is_none")]
|
||||
pub assignee: Option<String>,
|
||||
#[serde(rename = "assignees", skip_serializing_if = "Option::is_none")]
|
||||
pub assignees: Option<Vec<String>>,
|
||||
#[serde(rename = "base", skip_serializing_if = "Option::is_none")]
|
||||
pub base: Option<String>,
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "due_date", skip_serializing_if = "Option::is_none")]
|
||||
pub due_date: Option<String>,
|
||||
#[serde(rename = "head", skip_serializing_if = "Option::is_none")]
|
||||
pub head: Option<String>,
|
||||
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
|
||||
pub labels: Option<Vec<i64>>,
|
||||
#[serde(rename = "milestone", skip_serializing_if = "Option::is_none")]
|
||||
pub milestone: Option<i64>,
|
||||
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl CreatePullRequestOption {
|
||||
/// CreatePullRequestOption options when creating a pull request
|
||||
pub fn new() -> CreatePullRequestOption {
|
||||
CreatePullRequestOption {
|
||||
assignee: None,
|
||||
assignees: None,
|
||||
base: None,
|
||||
body: None,
|
||||
due_date: None,
|
||||
head: None,
|
||||
labels: None,
|
||||
milestone: None,
|
||||
title: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
crates/gitea-client/src/models/create_pull_review_comment.rs
Normal file
41
crates/gitea-client/src/models/create_pull_review_comment.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreatePullReviewComment : CreatePullReviewComment represent a review comment for creation api
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreatePullReviewComment {
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
/// if comment to new file line or 0
|
||||
#[serde(rename = "new_position", skip_serializing_if = "Option::is_none")]
|
||||
pub new_position: Option<i64>,
|
||||
/// if comment to old file line or 0
|
||||
#[serde(rename = "old_position", skip_serializing_if = "Option::is_none")]
|
||||
pub old_position: Option<i64>,
|
||||
/// the tree path
|
||||
#[serde(rename = "path", skip_serializing_if = "Option::is_none")]
|
||||
pub path: Option<String>,
|
||||
}
|
||||
|
||||
impl CreatePullReviewComment {
|
||||
/// CreatePullReviewComment represent a review comment for creation api
|
||||
pub fn new() -> CreatePullReviewComment {
|
||||
CreatePullReviewComment {
|
||||
body: None,
|
||||
new_position: None,
|
||||
old_position: None,
|
||||
path: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
39
crates/gitea-client/src/models/create_pull_review_options.rs
Normal file
39
crates/gitea-client/src/models/create_pull_review_options.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreatePullReviewOptions : CreatePullReviewOptions are options to create a pull review
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreatePullReviewOptions {
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
|
||||
pub comments: Option<Vec<models::CreatePullReviewComment>>,
|
||||
#[serde(rename = "commit_id", skip_serializing_if = "Option::is_none")]
|
||||
pub commit_id: Option<String>,
|
||||
/// ReviewStateType review state type
|
||||
#[serde(rename = "event", skip_serializing_if = "Option::is_none")]
|
||||
pub event: Option<String>,
|
||||
}
|
||||
|
||||
impl CreatePullReviewOptions {
|
||||
/// CreatePullReviewOptions are options to create a pull review
|
||||
pub fn new() -> CreatePullReviewOptions {
|
||||
CreatePullReviewOptions {
|
||||
body: None,
|
||||
comments: None,
|
||||
commit_id: None,
|
||||
event: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
39
crates/gitea-client/src/models/create_push_mirror_option.rs
Normal file
39
crates/gitea-client/src/models/create_push_mirror_option.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreatePushMirrorOption {
|
||||
#[serde(rename = "interval", skip_serializing_if = "Option::is_none")]
|
||||
pub interval: Option<String>,
|
||||
#[serde(rename = "remote_address", skip_serializing_if = "Option::is_none")]
|
||||
pub remote_address: Option<String>,
|
||||
#[serde(rename = "remote_password", skip_serializing_if = "Option::is_none")]
|
||||
pub remote_password: Option<String>,
|
||||
#[serde(rename = "remote_username", skip_serializing_if = "Option::is_none")]
|
||||
pub remote_username: Option<String>,
|
||||
#[serde(rename = "sync_on_commit", skip_serializing_if = "Option::is_none")]
|
||||
pub sync_on_commit: Option<bool>,
|
||||
}
|
||||
|
||||
impl CreatePushMirrorOption {
|
||||
pub fn new() -> CreatePushMirrorOption {
|
||||
CreatePushMirrorOption {
|
||||
interval: None,
|
||||
remote_address: None,
|
||||
remote_password: None,
|
||||
remote_username: None,
|
||||
sync_on_commit: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
44
crates/gitea-client/src/models/create_release_option.rs
Normal file
44
crates/gitea-client/src/models/create_release_option.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateReleaseOption : CreateReleaseOption options when creating a release
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateReleaseOption {
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
|
||||
pub draft: Option<bool>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "prerelease", skip_serializing_if = "Option::is_none")]
|
||||
pub prerelease: Option<bool>,
|
||||
#[serde(rename = "tag_name")]
|
||||
pub tag_name: String,
|
||||
#[serde(rename = "target_commitish", skip_serializing_if = "Option::is_none")]
|
||||
pub target_commitish: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateReleaseOption {
|
||||
/// CreateReleaseOption options when creating a release
|
||||
pub fn new(tag_name: String) -> CreateReleaseOption {
|
||||
CreateReleaseOption {
|
||||
body: None,
|
||||
draft: None,
|
||||
name: None,
|
||||
prerelease: None,
|
||||
tag_name,
|
||||
target_commitish: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
106
crates/gitea-client/src/models/create_repo_option.rs
Normal file
106
crates/gitea-client/src/models/create_repo_option.rs
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateRepoOption : CreateRepoOption options when creating repository
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateRepoOption {
|
||||
/// Whether the repository should be auto-initialized?
|
||||
#[serde(rename = "auto_init", skip_serializing_if = "Option::is_none")]
|
||||
pub auto_init: Option<bool>,
|
||||
/// DefaultBranch of the repository (used when initializes and in template)
|
||||
#[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>,
|
||||
/// Gitignores to use
|
||||
#[serde(rename = "gitignores", skip_serializing_if = "Option::is_none")]
|
||||
pub gitignores: Option<String>,
|
||||
/// Label-Set to use
|
||||
#[serde(rename = "issue_labels", skip_serializing_if = "Option::is_none")]
|
||||
pub issue_labels: Option<String>,
|
||||
/// License to use
|
||||
#[serde(rename = "license", skip_serializing_if = "Option::is_none")]
|
||||
pub license: Option<String>,
|
||||
/// Name of the repository to create
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
/// ObjectFormatName of the underlying git repository
|
||||
#[serde(rename = "object_format_name", skip_serializing_if = "Option::is_none")]
|
||||
pub object_format_name: Option<ObjectFormatName>,
|
||||
/// Whether the repository is private
|
||||
#[serde(rename = "private", skip_serializing_if = "Option::is_none")]
|
||||
pub private: Option<bool>,
|
||||
/// Readme of the repository to create
|
||||
#[serde(rename = "readme", skip_serializing_if = "Option::is_none")]
|
||||
pub readme: Option<String>,
|
||||
/// Whether the repository is template
|
||||
#[serde(rename = "template", skip_serializing_if = "Option::is_none")]
|
||||
pub template: Option<bool>,
|
||||
/// TrustModel of the repository
|
||||
#[serde(rename = "trust_model", skip_serializing_if = "Option::is_none")]
|
||||
pub trust_model: Option<TrustModel>,
|
||||
}
|
||||
|
||||
impl CreateRepoOption {
|
||||
/// CreateRepoOption options when creating repository
|
||||
pub fn new(name: String) -> CreateRepoOption {
|
||||
CreateRepoOption {
|
||||
auto_init: None,
|
||||
default_branch: None,
|
||||
description: None,
|
||||
gitignores: None,
|
||||
issue_labels: None,
|
||||
license: None,
|
||||
name,
|
||||
object_format_name: None,
|
||||
private: None,
|
||||
readme: None,
|
||||
template: None,
|
||||
trust_model: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
/// ObjectFormatName of the underlying git repository
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum ObjectFormatName {
|
||||
#[serde(rename = "sha1")]
|
||||
Sha1,
|
||||
#[serde(rename = "sha256")]
|
||||
Sha256,
|
||||
}
|
||||
|
||||
impl Default for ObjectFormatName {
|
||||
fn default() -> ObjectFormatName {
|
||||
Self::Sha1
|
||||
}
|
||||
}
|
||||
/// TrustModel of the repository
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum TrustModel {
|
||||
#[serde(rename = "default")]
|
||||
Default,
|
||||
#[serde(rename = "collaborator")]
|
||||
Collaborator,
|
||||
#[serde(rename = "committer")]
|
||||
Committer,
|
||||
#[serde(rename = "collaboratorcommitter")]
|
||||
Collaboratorcommitter,
|
||||
}
|
||||
|
||||
impl Default for TrustModel {
|
||||
fn default() -> TrustModel {
|
||||
Self::Default
|
||||
}
|
||||
}
|
||||
|
39
crates/gitea-client/src/models/create_status_option.rs
Normal file
39
crates/gitea-client/src/models/create_status_option.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateStatusOption : CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateStatusOption {
|
||||
#[serde(rename = "context", skip_serializing_if = "Option::is_none")]
|
||||
pub context: Option<String>,
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
/// CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\" and \"failure\"
|
||||
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
|
||||
pub state: Option<String>,
|
||||
#[serde(rename = "target_url", skip_serializing_if = "Option::is_none")]
|
||||
pub target_url: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateStatusOption {
|
||||
/// CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
|
||||
pub fn new() -> CreateStatusOption {
|
||||
CreateStatusOption {
|
||||
context: None,
|
||||
description: None,
|
||||
state: None,
|
||||
target_url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
crates/gitea-client/src/models/create_tag_option.rs
Normal file
35
crates/gitea-client/src/models/create_tag_option.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateTagOption : CreateTagOption options when creating a tag
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateTagOption {
|
||||
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
|
||||
pub message: Option<String>,
|
||||
#[serde(rename = "tag_name")]
|
||||
pub tag_name: String,
|
||||
#[serde(rename = "target", skip_serializing_if = "Option::is_none")]
|
||||
pub target: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateTagOption {
|
||||
/// CreateTagOption options when creating a tag
|
||||
pub fn new(tag_name: String) -> CreateTagOption {
|
||||
CreateTagOption {
|
||||
message: None,
|
||||
tag_name,
|
||||
target: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
63
crates/gitea-client/src/models/create_team_option.rs
Normal file
63
crates/gitea-client/src/models/create_team_option.rs
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateTeamOption : CreateTeamOption options for creating a team
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateTeamOption {
|
||||
#[serde(rename = "can_create_org_repo", skip_serializing_if = "Option::is_none")]
|
||||
pub can_create_org_repo: Option<bool>,
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "includes_all_repositories", skip_serializing_if = "Option::is_none")]
|
||||
pub includes_all_repositories: Option<bool>,
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
#[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
|
||||
pub permission: Option<Permission>,
|
||||
#[serde(rename = "units", skip_serializing_if = "Option::is_none")]
|
||||
pub units: Option<Vec<String>>,
|
||||
#[serde(rename = "units_map", skip_serializing_if = "Option::is_none")]
|
||||
pub units_map: Option<std::collections::HashMap<String, String>>,
|
||||
}
|
||||
|
||||
impl CreateTeamOption {
|
||||
/// CreateTeamOption options for creating a team
|
||||
pub fn new(name: String) -> CreateTeamOption {
|
||||
CreateTeamOption {
|
||||
can_create_org_repo: None,
|
||||
description: None,
|
||||
includes_all_repositories: None,
|
||||
name,
|
||||
permission: None,
|
||||
units: None,
|
||||
units_map: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum Permission {
|
||||
#[serde(rename = "read")]
|
||||
Read,
|
||||
#[serde(rename = "write")]
|
||||
Write,
|
||||
#[serde(rename = "admin")]
|
||||
Admin,
|
||||
}
|
||||
|
||||
impl Default for Permission {
|
||||
fn default() -> Permission {
|
||||
Self::Read
|
||||
}
|
||||
}
|
||||
|
60
crates/gitea-client/src/models/create_user_option.rs
Normal file
60
crates/gitea-client/src/models/create_user_option.rs
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateUserOption : CreateUserOption create user options
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateUserOption {
|
||||
/// For explicitly setting the user creation timestamp. Useful when users are migrated from other systems. When omitted, the user's creation timestamp will be set to \"now\".
|
||||
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
|
||||
pub created_at: Option<String>,
|
||||
#[serde(rename = "email")]
|
||||
pub email: String,
|
||||
#[serde(rename = "full_name", skip_serializing_if = "Option::is_none")]
|
||||
pub full_name: Option<String>,
|
||||
#[serde(rename = "login_name", skip_serializing_if = "Option::is_none")]
|
||||
pub login_name: Option<String>,
|
||||
#[serde(rename = "must_change_password", skip_serializing_if = "Option::is_none")]
|
||||
pub must_change_password: Option<bool>,
|
||||
#[serde(rename = "password", skip_serializing_if = "Option::is_none")]
|
||||
pub password: Option<String>,
|
||||
#[serde(rename = "restricted", skip_serializing_if = "Option::is_none")]
|
||||
pub restricted: Option<bool>,
|
||||
#[serde(rename = "send_notify", skip_serializing_if = "Option::is_none")]
|
||||
pub send_notify: Option<bool>,
|
||||
#[serde(rename = "source_id", skip_serializing_if = "Option::is_none")]
|
||||
pub source_id: Option<i64>,
|
||||
#[serde(rename = "username")]
|
||||
pub username: String,
|
||||
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
|
||||
pub visibility: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateUserOption {
|
||||
/// CreateUserOption create user options
|
||||
pub fn new(email: String, username: String) -> CreateUserOption {
|
||||
CreateUserOption {
|
||||
created_at: None,
|
||||
email,
|
||||
full_name: None,
|
||||
login_name: None,
|
||||
must_change_password: None,
|
||||
password: None,
|
||||
restricted: None,
|
||||
send_notify: None,
|
||||
source_id: None,
|
||||
username,
|
||||
visibility: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
30
crates/gitea-client/src/models/create_variable_option.rs
Normal file
30
crates/gitea-client/src/models/create_variable_option.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateVariableOption : CreateVariableOption the option when creating variable
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateVariableOption {
|
||||
/// Value of the variable to create
|
||||
#[serde(rename = "value")]
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
impl CreateVariableOption {
|
||||
/// CreateVariableOption the option when creating variable
|
||||
pub fn new(value: String) -> CreateVariableOption {
|
||||
CreateVariableOption {
|
||||
value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
crates/gitea-client/src/models/create_wiki_page_options.rs
Normal file
38
crates/gitea-client/src/models/create_wiki_page_options.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// CreateWikiPageOptions : CreateWikiPageOptions form for creating wiki
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateWikiPageOptions {
|
||||
/// content must be base64 encoded
|
||||
#[serde(rename = "content_base64", skip_serializing_if = "Option::is_none")]
|
||||
pub content_base64: Option<String>,
|
||||
/// optional commit message summarizing the change
|
||||
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
|
||||
pub message: Option<String>,
|
||||
/// page title. leave empty to keep unchanged
|
||||
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl CreateWikiPageOptions {
|
||||
/// CreateWikiPageOptions form for creating wiki
|
||||
pub fn new() -> CreateWikiPageOptions {
|
||||
CreateWikiPageOptions {
|
||||
content_base64: None,
|
||||
message: None,
|
||||
title: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
crates/gitea-client/src/models/cron.rs
Normal file
41
crates/gitea-client/src/models/cron.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// Cron : Cron represents a Cron task
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Cron {
|
||||
#[serde(rename = "exec_times", skip_serializing_if = "Option::is_none")]
|
||||
pub exec_times: Option<i64>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "next", skip_serializing_if = "Option::is_none")]
|
||||
pub next: Option<String>,
|
||||
#[serde(rename = "prev", skip_serializing_if = "Option::is_none")]
|
||||
pub prev: Option<String>,
|
||||
#[serde(rename = "schedule", skip_serializing_if = "Option::is_none")]
|
||||
pub schedule: Option<String>,
|
||||
}
|
||||
|
||||
impl Cron {
|
||||
/// Cron represents a Cron task
|
||||
pub fn new() -> Cron {
|
||||
Cron {
|
||||
exec_times: None,
|
||||
name: None,
|
||||
next: None,
|
||||
prev: None,
|
||||
schedule: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
30
crates/gitea-client/src/models/delete_email_option.rs
Normal file
30
crates/gitea-client/src/models/delete_email_option.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// DeleteEmailOption : DeleteEmailOption options when deleting email addresses
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct DeleteEmailOption {
|
||||
/// email addresses to delete
|
||||
#[serde(rename = "emails", skip_serializing_if = "Option::is_none")]
|
||||
pub emails: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl DeleteEmailOption {
|
||||
/// DeleteEmailOption options when deleting email addresses
|
||||
pub fn new() -> DeleteEmailOption {
|
||||
DeleteEmailOption {
|
||||
emails: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
55
crates/gitea-client/src/models/delete_file_options.rs
Normal file
55
crates/gitea-client/src/models/delete_file_options.rs
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// 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)
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct DeleteFileOptions {
|
||||
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
|
||||
pub author: Option<Box<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<models::Identity>>,
|
||||
#[serde(rename = "dates", skip_serializing_if = "Option::is_none")]
|
||||
pub dates: Option<Box<models::CommitDateOptions>>,
|
||||
/// 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 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)
|
||||
pub fn new(sha: String) -> DeleteFileOptions {
|
||||
DeleteFileOptions {
|
||||
author: None,
|
||||
branch: None,
|
||||
committer: None,
|
||||
dates: None,
|
||||
message: None,
|
||||
new_branch: None,
|
||||
sha,
|
||||
signoff: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
53
crates/gitea-client/src/models/deploy_key.rs
Normal file
53
crates/gitea-client/src/models/deploy_key.rs
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// DeployKey : DeployKey a deploy key
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct DeployKey {
|
||||
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
|
||||
pub created_at: Option<String>,
|
||||
#[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
|
||||
pub fingerprint: Option<String>,
|
||||
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
|
||||
pub id: Option<i64>,
|
||||
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
|
||||
pub key: Option<String>,
|
||||
#[serde(rename = "key_id", skip_serializing_if = "Option::is_none")]
|
||||
pub key_id: Option<i64>,
|
||||
#[serde(rename = "read_only", skip_serializing_if = "Option::is_none")]
|
||||
pub read_only: Option<bool>,
|
||||
#[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
|
||||
pub repository: Option<Box<models::Repository>>,
|
||||
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl DeployKey {
|
||||
/// DeployKey a deploy key
|
||||
pub fn new() -> DeployKey {
|
||||
DeployKey {
|
||||
created_at: None,
|
||||
fingerprint: None,
|
||||
id: None,
|
||||
key: None,
|
||||
key_id: None,
|
||||
read_only: None,
|
||||
repository: None,
|
||||
title: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// DismissPullReviewOptions : DismissPullReviewOptions are options to dismiss a pull review
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct DismissPullReviewOptions {
|
||||
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
|
||||
pub message: Option<String>,
|
||||
#[serde(rename = "priors", skip_serializing_if = "Option::is_none")]
|
||||
pub priors: Option<bool>,
|
||||
}
|
||||
|
||||
impl DismissPullReviewOptions {
|
||||
/// DismissPullReviewOptions are options to dismiss a pull review
|
||||
pub fn new() -> DismissPullReviewOptions {
|
||||
DismissPullReviewOptions {
|
||||
message: None,
|
||||
priors: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
crates/gitea-client/src/models/edit_attachment_options.rs
Normal file
29
crates/gitea-client/src/models/edit_attachment_options.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditAttachmentOptions : EditAttachmentOptions options for editing attachments
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditAttachmentOptions {
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
impl EditAttachmentOptions {
|
||||
/// EditAttachmentOptions options for editing attachments
|
||||
pub fn new() -> EditAttachmentOptions {
|
||||
EditAttachmentOptions {
|
||||
name: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditBranchProtectionOption : EditBranchProtectionOption options for editing a branch protection
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditBranchProtectionOption {
|
||||
#[serde(rename = "approvals_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub approvals_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "approvals_whitelist_username", skip_serializing_if = "Option::is_none")]
|
||||
pub approvals_whitelist_username: Option<Vec<String>>,
|
||||
#[serde(rename = "block_on_official_review_requests", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_official_review_requests: Option<bool>,
|
||||
#[serde(rename = "block_on_outdated_branch", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_outdated_branch: Option<bool>,
|
||||
#[serde(rename = "block_on_rejected_reviews", skip_serializing_if = "Option::is_none")]
|
||||
pub block_on_rejected_reviews: Option<bool>,
|
||||
#[serde(rename = "dismiss_stale_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub dismiss_stale_approvals: Option<bool>,
|
||||
#[serde(rename = "enable_approvals_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_approvals_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_merge_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_merge_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_push", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_push: Option<bool>,
|
||||
#[serde(rename = "enable_push_whitelist", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_push_whitelist: Option<bool>,
|
||||
#[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_status_check: Option<bool>,
|
||||
#[serde(rename = "ignore_stale_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub ignore_stale_approvals: Option<bool>,
|
||||
#[serde(rename = "merge_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub merge_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "merge_whitelist_usernames", skip_serializing_if = "Option::is_none")]
|
||||
pub merge_whitelist_usernames: Option<Vec<String>>,
|
||||
#[serde(rename = "protected_file_patterns", skip_serializing_if = "Option::is_none")]
|
||||
pub protected_file_patterns: Option<String>,
|
||||
#[serde(rename = "push_whitelist_deploy_keys", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_deploy_keys: Option<bool>,
|
||||
#[serde(rename = "push_whitelist_teams", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_teams: Option<Vec<String>>,
|
||||
#[serde(rename = "push_whitelist_usernames", skip_serializing_if = "Option::is_none")]
|
||||
pub push_whitelist_usernames: Option<Vec<String>>,
|
||||
#[serde(rename = "require_signed_commits", skip_serializing_if = "Option::is_none")]
|
||||
pub require_signed_commits: Option<bool>,
|
||||
#[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")]
|
||||
pub required_approvals: Option<i64>,
|
||||
#[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")]
|
||||
pub status_check_contexts: Option<Vec<String>>,
|
||||
#[serde(rename = "unprotected_file_patterns", skip_serializing_if = "Option::is_none")]
|
||||
pub unprotected_file_patterns: Option<String>,
|
||||
}
|
||||
|
||||
impl EditBranchProtectionOption {
|
||||
/// EditBranchProtectionOption options for editing a branch protection
|
||||
pub fn new() -> EditBranchProtectionOption {
|
||||
EditBranchProtectionOption {
|
||||
approvals_whitelist_teams: None,
|
||||
approvals_whitelist_username: None,
|
||||
block_on_official_review_requests: None,
|
||||
block_on_outdated_branch: None,
|
||||
block_on_rejected_reviews: None,
|
||||
dismiss_stale_approvals: None,
|
||||
enable_approvals_whitelist: None,
|
||||
enable_merge_whitelist: None,
|
||||
enable_push: None,
|
||||
enable_push_whitelist: None,
|
||||
enable_status_check: None,
|
||||
ignore_stale_approvals: None,
|
||||
merge_whitelist_teams: None,
|
||||
merge_whitelist_usernames: None,
|
||||
protected_file_patterns: None,
|
||||
push_whitelist_deploy_keys: None,
|
||||
push_whitelist_teams: None,
|
||||
push_whitelist_usernames: None,
|
||||
require_signed_commits: None,
|
||||
required_approvals: None,
|
||||
status_check_contexts: None,
|
||||
unprotected_file_patterns: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
crates/gitea-client/src/models/edit_deadline_option.rs
Normal file
29
crates/gitea-client/src/models/edit_deadline_option.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditDeadlineOption : EditDeadlineOption options for creating a deadline
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditDeadlineOption {
|
||||
#[serde(rename = "due_date")]
|
||||
pub due_date: String,
|
||||
}
|
||||
|
||||
impl EditDeadlineOption {
|
||||
/// EditDeadlineOption options for creating a deadline
|
||||
pub fn new(due_date: String) -> EditDeadlineOption {
|
||||
EditDeadlineOption {
|
||||
due_date,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
crates/gitea-client/src/models/edit_git_hook_option.rs
Normal file
29
crates/gitea-client/src/models/edit_git_hook_option.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditGitHookOption : EditGitHookOption options when modifying one Git hook
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditGitHookOption {
|
||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<String>,
|
||||
}
|
||||
|
||||
impl EditGitHookOption {
|
||||
/// EditGitHookOption options when modifying one Git hook
|
||||
pub fn new() -> EditGitHookOption {
|
||||
EditGitHookOption {
|
||||
content: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
crates/gitea-client/src/models/edit_hook_option.rs
Normal file
41
crates/gitea-client/src/models/edit_hook_option.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditHookOption : EditHookOption options when modify one hook
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditHookOption {
|
||||
#[serde(rename = "active", skip_serializing_if = "Option::is_none")]
|
||||
pub active: Option<bool>,
|
||||
#[serde(rename = "authorization_header", skip_serializing_if = "Option::is_none")]
|
||||
pub authorization_header: Option<String>,
|
||||
#[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")]
|
||||
pub branch_filter: Option<String>,
|
||||
#[serde(rename = "config", skip_serializing_if = "Option::is_none")]
|
||||
pub config: Option<std::collections::HashMap<String, String>>,
|
||||
#[serde(rename = "events", skip_serializing_if = "Option::is_none")]
|
||||
pub events: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl EditHookOption {
|
||||
/// EditHookOption options when modify one hook
|
||||
pub fn new() -> EditHookOption {
|
||||
EditHookOption {
|
||||
active: None,
|
||||
authorization_header: None,
|
||||
branch_filter: None,
|
||||
config: None,
|
||||
events: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
crates/gitea-client/src/models/edit_issue_comment_option.rs
Normal file
29
crates/gitea-client/src/models/edit_issue_comment_option.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditIssueCommentOption : EditIssueCommentOption options for editing a comment
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditIssueCommentOption {
|
||||
#[serde(rename = "body")]
|
||||
pub body: String,
|
||||
}
|
||||
|
||||
impl EditIssueCommentOption {
|
||||
/// EditIssueCommentOption options for editing a comment
|
||||
pub fn new(body: String) -> EditIssueCommentOption {
|
||||
EditIssueCommentOption {
|
||||
body,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
54
crates/gitea-client/src/models/edit_issue_option.rs
Normal file
54
crates/gitea-client/src/models/edit_issue_option.rs
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditIssueOption : EditIssueOption options for editing an issue
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditIssueOption {
|
||||
/// deprecated
|
||||
#[serde(rename = "assignee", skip_serializing_if = "Option::is_none")]
|
||||
pub assignee: Option<String>,
|
||||
#[serde(rename = "assignees", skip_serializing_if = "Option::is_none")]
|
||||
pub assignees: Option<Vec<String>>,
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "due_date", skip_serializing_if = "Option::is_none")]
|
||||
pub due_date: Option<String>,
|
||||
#[serde(rename = "milestone", skip_serializing_if = "Option::is_none")]
|
||||
pub milestone: Option<i64>,
|
||||
#[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
|
||||
pub r#ref: Option<String>,
|
||||
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
|
||||
pub state: Option<String>,
|
||||
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
#[serde(rename = "unset_due_date", skip_serializing_if = "Option::is_none")]
|
||||
pub unset_due_date: Option<bool>,
|
||||
}
|
||||
|
||||
impl EditIssueOption {
|
||||
/// EditIssueOption options for editing an issue
|
||||
pub fn new() -> EditIssueOption {
|
||||
EditIssueOption {
|
||||
assignee: None,
|
||||
assignees: None,
|
||||
body: None,
|
||||
due_date: None,
|
||||
milestone: None,
|
||||
r#ref: None,
|
||||
state: None,
|
||||
title: None,
|
||||
unset_due_date: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
crates/gitea-client/src/models/edit_label_option.rs
Normal file
41
crates/gitea-client/src/models/edit_label_option.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditLabelOption : EditLabelOption options for editing a label
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditLabelOption {
|
||||
#[serde(rename = "color", skip_serializing_if = "Option::is_none")]
|
||||
pub color: Option<String>,
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "exclusive", skip_serializing_if = "Option::is_none")]
|
||||
pub exclusive: Option<bool>,
|
||||
#[serde(rename = "is_archived", skip_serializing_if = "Option::is_none")]
|
||||
pub is_archived: Option<bool>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
impl EditLabelOption {
|
||||
/// EditLabelOption options for editing a label
|
||||
pub fn new() -> EditLabelOption {
|
||||
EditLabelOption {
|
||||
color: None,
|
||||
description: None,
|
||||
exclusive: None,
|
||||
is_archived: None,
|
||||
name: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
crates/gitea-client/src/models/edit_milestone_option.rs
Normal file
38
crates/gitea-client/src/models/edit_milestone_option.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditMilestoneOption : EditMilestoneOption options for editing a milestone
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditMilestoneOption {
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "due_on", skip_serializing_if = "Option::is_none")]
|
||||
pub due_on: Option<String>,
|
||||
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
|
||||
pub state: Option<String>,
|
||||
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl EditMilestoneOption {
|
||||
/// EditMilestoneOption options for editing a milestone
|
||||
pub fn new() -> EditMilestoneOption {
|
||||
EditMilestoneOption {
|
||||
description: None,
|
||||
due_on: None,
|
||||
state: None,
|
||||
title: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
64
crates/gitea-client/src/models/edit_org_option.rs
Normal file
64
crates/gitea-client/src/models/edit_org_option.rs
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditOrgOption : EditOrgOption options for editing an organization
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditOrgOption {
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
|
||||
pub email: Option<String>,
|
||||
#[serde(rename = "full_name", skip_serializing_if = "Option::is_none")]
|
||||
pub full_name: Option<String>,
|
||||
#[serde(rename = "location", skip_serializing_if = "Option::is_none")]
|
||||
pub location: Option<String>,
|
||||
#[serde(rename = "repo_admin_change_team_access", skip_serializing_if = "Option::is_none")]
|
||||
pub repo_admin_change_team_access: Option<bool>,
|
||||
/// possible values are `public`, `limited` or `private`
|
||||
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
|
||||
pub visibility: Option<Visibility>,
|
||||
#[serde(rename = "website", skip_serializing_if = "Option::is_none")]
|
||||
pub website: Option<String>,
|
||||
}
|
||||
|
||||
impl EditOrgOption {
|
||||
/// EditOrgOption options for editing an organization
|
||||
pub fn new() -> EditOrgOption {
|
||||
EditOrgOption {
|
||||
description: None,
|
||||
email: None,
|
||||
full_name: None,
|
||||
location: None,
|
||||
repo_admin_change_team_access: None,
|
||||
visibility: None,
|
||||
website: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
/// possible values are `public`, `limited` or `private`
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum Visibility {
|
||||
#[serde(rename = "public")]
|
||||
Public,
|
||||
#[serde(rename = "limited")]
|
||||
Limited,
|
||||
#[serde(rename = "private")]
|
||||
Private,
|
||||
}
|
||||
|
||||
impl Default for Visibility {
|
||||
fn default() -> Visibility {
|
||||
Self::Public
|
||||
}
|
||||
}
|
||||
|
59
crates/gitea-client/src/models/edit_pull_request_option.rs
Normal file
59
crates/gitea-client/src/models/edit_pull_request_option.rs
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditPullRequestOption : EditPullRequestOption options when modify pull request
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditPullRequestOption {
|
||||
#[serde(rename = "allow_maintainer_edit", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_maintainer_edit: Option<bool>,
|
||||
#[serde(rename = "assignee", skip_serializing_if = "Option::is_none")]
|
||||
pub assignee: Option<String>,
|
||||
#[serde(rename = "assignees", skip_serializing_if = "Option::is_none")]
|
||||
pub assignees: Option<Vec<String>>,
|
||||
#[serde(rename = "base", skip_serializing_if = "Option::is_none")]
|
||||
pub base: Option<String>,
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "due_date", skip_serializing_if = "Option::is_none")]
|
||||
pub due_date: Option<String>,
|
||||
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
|
||||
pub labels: Option<Vec<i64>>,
|
||||
#[serde(rename = "milestone", skip_serializing_if = "Option::is_none")]
|
||||
pub milestone: Option<i64>,
|
||||
#[serde(rename = "state", skip_serializing_if = "Option::is_none")]
|
||||
pub state: Option<String>,
|
||||
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
|
||||
pub title: Option<String>,
|
||||
#[serde(rename = "unset_due_date", skip_serializing_if = "Option::is_none")]
|
||||
pub unset_due_date: Option<bool>,
|
||||
}
|
||||
|
||||
impl EditPullRequestOption {
|
||||
/// EditPullRequestOption options when modify pull request
|
||||
pub fn new() -> EditPullRequestOption {
|
||||
EditPullRequestOption {
|
||||
allow_maintainer_edit: None,
|
||||
assignee: None,
|
||||
assignees: None,
|
||||
base: None,
|
||||
body: None,
|
||||
due_date: None,
|
||||
labels: None,
|
||||
milestone: None,
|
||||
state: None,
|
||||
title: None,
|
||||
unset_due_date: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
29
crates/gitea-client/src/models/edit_reaction_option.rs
Normal file
29
crates/gitea-client/src/models/edit_reaction_option.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditReactionOption : EditReactionOption contain the reaction type
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditReactionOption {
|
||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<String>,
|
||||
}
|
||||
|
||||
impl EditReactionOption {
|
||||
/// EditReactionOption contain the reaction type
|
||||
pub fn new() -> EditReactionOption {
|
||||
EditReactionOption {
|
||||
content: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
44
crates/gitea-client/src/models/edit_release_option.rs
Normal file
44
crates/gitea-client/src/models/edit_release_option.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditReleaseOption : EditReleaseOption options when editing a release
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditReleaseOption {
|
||||
#[serde(rename = "body", skip_serializing_if = "Option::is_none")]
|
||||
pub body: Option<String>,
|
||||
#[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
|
||||
pub draft: Option<bool>,
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
#[serde(rename = "prerelease", skip_serializing_if = "Option::is_none")]
|
||||
pub prerelease: Option<bool>,
|
||||
#[serde(rename = "tag_name", skip_serializing_if = "Option::is_none")]
|
||||
pub tag_name: Option<String>,
|
||||
#[serde(rename = "target_commitish", skip_serializing_if = "Option::is_none")]
|
||||
pub target_commitish: Option<String>,
|
||||
}
|
||||
|
||||
impl EditReleaseOption {
|
||||
/// EditReleaseOption options when editing a release
|
||||
pub fn new() -> EditReleaseOption {
|
||||
EditReleaseOption {
|
||||
body: None,
|
||||
draft: None,
|
||||
name: None,
|
||||
prerelease: None,
|
||||
tag_name: None,
|
||||
target_commitish: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
151
crates/gitea-client/src/models/edit_repo_option.rs
Normal file
151
crates/gitea-client/src/models/edit_repo_option.rs
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditRepoOption : EditRepoOption options when editing a repository's properties
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditRepoOption {
|
||||
/// either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging.
|
||||
#[serde(rename = "allow_fast_forward_only_merge", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_fast_forward_only_merge: Option<bool>,
|
||||
/// either `true` to allow mark pr as merged manually, or `false` to prevent it.
|
||||
#[serde(rename = "allow_manual_merge", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_manual_merge: Option<bool>,
|
||||
/// either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits.
|
||||
#[serde(rename = "allow_merge_commits", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_merge_commits: Option<bool>,
|
||||
/// either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging.
|
||||
#[serde(rename = "allow_rebase", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_rebase: Option<bool>,
|
||||
/// either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits.
|
||||
#[serde(rename = "allow_rebase_explicit", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_rebase_explicit: Option<bool>,
|
||||
/// either `true` to allow updating pull request branch by rebase, or `false` to prevent it.
|
||||
#[serde(rename = "allow_rebase_update", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_rebase_update: Option<bool>,
|
||||
/// either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging.
|
||||
#[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_squash_merge: Option<bool>,
|
||||
/// set to `true` to archive this repository.
|
||||
#[serde(rename = "archived", skip_serializing_if = "Option::is_none")]
|
||||
pub archived: Option<bool>,
|
||||
/// either `true` to enable AutodetectManualMerge, or `false` to prevent it. Note: In some special cases, misjudgments can occur.
|
||||
#[serde(rename = "autodetect_manual_merge", skip_serializing_if = "Option::is_none")]
|
||||
pub autodetect_manual_merge: Option<bool>,
|
||||
/// set to `true` to allow edits from maintainers by default
|
||||
#[serde(rename = "default_allow_maintainer_edit", skip_serializing_if = "Option::is_none")]
|
||||
pub default_allow_maintainer_edit: Option<bool>,
|
||||
/// sets the default branch for this repository.
|
||||
#[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")]
|
||||
pub default_branch: Option<String>,
|
||||
/// set to `true` to delete pr branch after merge by default
|
||||
#[serde(rename = "default_delete_branch_after_merge", skip_serializing_if = "Option::is_none")]
|
||||
pub default_delete_branch_after_merge: Option<bool>,
|
||||
/// set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", \"squash\", or \"fast-forward-only\".
|
||||
#[serde(rename = "default_merge_style", skip_serializing_if = "Option::is_none")]
|
||||
pub default_merge_style: Option<String>,
|
||||
/// a short description of the repository.
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
/// enable prune - remove obsolete remote-tracking references when mirroring
|
||||
#[serde(rename = "enable_prune", skip_serializing_if = "Option::is_none")]
|
||||
pub enable_prune: Option<bool>,
|
||||
#[serde(rename = "external_tracker", skip_serializing_if = "Option::is_none")]
|
||||
pub external_tracker: Option<Box<models::ExternalTracker>>,
|
||||
#[serde(rename = "external_wiki", skip_serializing_if = "Option::is_none")]
|
||||
pub external_wiki: Option<Box<models::ExternalWiki>>,
|
||||
/// either `true` to enable actions unit, or `false` to disable them.
|
||||
#[serde(rename = "has_actions", skip_serializing_if = "Option::is_none")]
|
||||
pub has_actions: Option<bool>,
|
||||
/// either `true` to enable issues for this repository or `false` to disable them.
|
||||
#[serde(rename = "has_issues", skip_serializing_if = "Option::is_none")]
|
||||
pub has_issues: Option<bool>,
|
||||
/// either `true` to enable packages unit, or `false` to disable them.
|
||||
#[serde(rename = "has_packages", skip_serializing_if = "Option::is_none")]
|
||||
pub has_packages: Option<bool>,
|
||||
/// either `true` to enable project unit, or `false` to disable them.
|
||||
#[serde(rename = "has_projects", skip_serializing_if = "Option::is_none")]
|
||||
pub has_projects: Option<bool>,
|
||||
/// either `true` to allow pull requests, or `false` to prevent pull request.
|
||||
#[serde(rename = "has_pull_requests", skip_serializing_if = "Option::is_none")]
|
||||
pub has_pull_requests: Option<bool>,
|
||||
/// either `true` to enable releases unit, or `false` to disable them.
|
||||
#[serde(rename = "has_releases", skip_serializing_if = "Option::is_none")]
|
||||
pub has_releases: Option<bool>,
|
||||
/// either `true` to enable the wiki for this repository or `false` to disable it.
|
||||
#[serde(rename = "has_wiki", skip_serializing_if = "Option::is_none")]
|
||||
pub has_wiki: Option<bool>,
|
||||
/// either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace.
|
||||
#[serde(rename = "ignore_whitespace_conflicts", skip_serializing_if = "Option::is_none")]
|
||||
pub ignore_whitespace_conflicts: Option<bool>,
|
||||
#[serde(rename = "internal_tracker", skip_serializing_if = "Option::is_none")]
|
||||
pub internal_tracker: Option<Box<models::InternalTracker>>,
|
||||
/// set to a string like `8h30m0s` to set the mirror interval time
|
||||
#[serde(rename = "mirror_interval", skip_serializing_if = "Option::is_none")]
|
||||
pub mirror_interval: Option<String>,
|
||||
/// name of the repository
|
||||
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
|
||||
pub name: Option<String>,
|
||||
/// either `true` to make the repository private or `false` to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private.
|
||||
#[serde(rename = "private", skip_serializing_if = "Option::is_none")]
|
||||
pub private: Option<bool>,
|
||||
/// `repo` to only allow repo-level projects, `owner` to only allow owner projects, `all` to allow both.
|
||||
#[serde(rename = "projects_mode", skip_serializing_if = "Option::is_none")]
|
||||
pub projects_mode: Option<String>,
|
||||
/// either `true` to make this repository a template or `false` to make it a normal repository
|
||||
#[serde(rename = "template", skip_serializing_if = "Option::is_none")]
|
||||
pub template: Option<bool>,
|
||||
/// a URL with more information about the repository.
|
||||
#[serde(rename = "website", skip_serializing_if = "Option::is_none")]
|
||||
pub website: Option<String>,
|
||||
}
|
||||
|
||||
impl EditRepoOption {
|
||||
/// EditRepoOption options when editing a repository's properties
|
||||
pub fn new() -> EditRepoOption {
|
||||
EditRepoOption {
|
||||
allow_fast_forward_only_merge: None,
|
||||
allow_manual_merge: None,
|
||||
allow_merge_commits: None,
|
||||
allow_rebase: None,
|
||||
allow_rebase_explicit: None,
|
||||
allow_rebase_update: None,
|
||||
allow_squash_merge: None,
|
||||
archived: None,
|
||||
autodetect_manual_merge: None,
|
||||
default_allow_maintainer_edit: None,
|
||||
default_branch: None,
|
||||
default_delete_branch_after_merge: None,
|
||||
default_merge_style: None,
|
||||
description: None,
|
||||
enable_prune: None,
|
||||
external_tracker: None,
|
||||
external_wiki: None,
|
||||
has_actions: None,
|
||||
has_issues: None,
|
||||
has_packages: None,
|
||||
has_projects: None,
|
||||
has_pull_requests: None,
|
||||
has_releases: None,
|
||||
has_wiki: None,
|
||||
ignore_whitespace_conflicts: None,
|
||||
internal_tracker: None,
|
||||
mirror_interval: None,
|
||||
name: None,
|
||||
private: None,
|
||||
projects_mode: None,
|
||||
template: None,
|
||||
website: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
63
crates/gitea-client/src/models/edit_team_option.rs
Normal file
63
crates/gitea-client/src/models/edit_team_option.rs
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditTeamOption : EditTeamOption options for editing a team
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditTeamOption {
|
||||
#[serde(rename = "can_create_org_repo", skip_serializing_if = "Option::is_none")]
|
||||
pub can_create_org_repo: Option<bool>,
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "includes_all_repositories", skip_serializing_if = "Option::is_none")]
|
||||
pub includes_all_repositories: Option<bool>,
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
#[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
|
||||
pub permission: Option<Permission>,
|
||||
#[serde(rename = "units", skip_serializing_if = "Option::is_none")]
|
||||
pub units: Option<Vec<String>>,
|
||||
#[serde(rename = "units_map", skip_serializing_if = "Option::is_none")]
|
||||
pub units_map: Option<std::collections::HashMap<String, String>>,
|
||||
}
|
||||
|
||||
impl EditTeamOption {
|
||||
/// EditTeamOption options for editing a team
|
||||
pub fn new(name: String) -> EditTeamOption {
|
||||
EditTeamOption {
|
||||
can_create_org_repo: None,
|
||||
description: None,
|
||||
includes_all_repositories: None,
|
||||
name,
|
||||
permission: None,
|
||||
units: None,
|
||||
units_map: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum Permission {
|
||||
#[serde(rename = "read")]
|
||||
Read,
|
||||
#[serde(rename = "write")]
|
||||
Write,
|
||||
#[serde(rename = "admin")]
|
||||
Admin,
|
||||
}
|
||||
|
||||
impl Default for Permission {
|
||||
fn default() -> Permission {
|
||||
Self::Read
|
||||
}
|
||||
}
|
||||
|
80
crates/gitea-client/src/models/edit_user_option.rs
Normal file
80
crates/gitea-client/src/models/edit_user_option.rs
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// EditUserOption : EditUserOption edit user options
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditUserOption {
|
||||
#[serde(rename = "active", skip_serializing_if = "Option::is_none")]
|
||||
pub active: Option<bool>,
|
||||
#[serde(rename = "admin", skip_serializing_if = "Option::is_none")]
|
||||
pub admin: Option<bool>,
|
||||
#[serde(rename = "allow_create_organization", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_create_organization: Option<bool>,
|
||||
#[serde(rename = "allow_git_hook", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_git_hook: Option<bool>,
|
||||
#[serde(rename = "allow_import_local", skip_serializing_if = "Option::is_none")]
|
||||
pub allow_import_local: Option<bool>,
|
||||
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
|
||||
pub description: Option<String>,
|
||||
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
|
||||
pub email: Option<String>,
|
||||
#[serde(rename = "full_name", skip_serializing_if = "Option::is_none")]
|
||||
pub full_name: Option<String>,
|
||||
#[serde(rename = "location", skip_serializing_if = "Option::is_none")]
|
||||
pub location: Option<String>,
|
||||
#[serde(rename = "login_name")]
|
||||
pub login_name: String,
|
||||
#[serde(rename = "max_repo_creation", skip_serializing_if = "Option::is_none")]
|
||||
pub max_repo_creation: Option<i64>,
|
||||
#[serde(rename = "must_change_password", skip_serializing_if = "Option::is_none")]
|
||||
pub must_change_password: Option<bool>,
|
||||
#[serde(rename = "password", skip_serializing_if = "Option::is_none")]
|
||||
pub password: Option<String>,
|
||||
#[serde(rename = "prohibit_login", skip_serializing_if = "Option::is_none")]
|
||||
pub prohibit_login: Option<bool>,
|
||||
#[serde(rename = "restricted", skip_serializing_if = "Option::is_none")]
|
||||
pub restricted: Option<bool>,
|
||||
#[serde(rename = "source_id")]
|
||||
pub source_id: i64,
|
||||
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
|
||||
pub visibility: Option<String>,
|
||||
#[serde(rename = "website", skip_serializing_if = "Option::is_none")]
|
||||
pub website: Option<String>,
|
||||
}
|
||||
|
||||
impl EditUserOption {
|
||||
/// EditUserOption edit user options
|
||||
pub fn new(login_name: String, source_id: i64) -> EditUserOption {
|
||||
EditUserOption {
|
||||
active: None,
|
||||
admin: None,
|
||||
allow_create_organization: None,
|
||||
allow_git_hook: None,
|
||||
allow_import_local: None,
|
||||
description: None,
|
||||
email: None,
|
||||
full_name: None,
|
||||
location: None,
|
||||
login_name,
|
||||
max_repo_creation: None,
|
||||
must_change_password: None,
|
||||
password: None,
|
||||
prohibit_login: None,
|
||||
restricted: None,
|
||||
source_id,
|
||||
visibility: None,
|
||||
website: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
41
crates/gitea-client/src/models/email.rs
Normal file
41
crates/gitea-client/src/models/email.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// Email : Email an email address belonging to a user
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Email {
|
||||
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
|
||||
pub email: Option<String>,
|
||||
#[serde(rename = "primary", skip_serializing_if = "Option::is_none")]
|
||||
pub primary: Option<bool>,
|
||||
#[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
|
||||
pub user_id: Option<i64>,
|
||||
#[serde(rename = "username", skip_serializing_if = "Option::is_none")]
|
||||
pub username: Option<String>,
|
||||
#[serde(rename = "verified", skip_serializing_if = "Option::is_none")]
|
||||
pub verified: Option<bool>,
|
||||
}
|
||||
|
||||
impl Email {
|
||||
/// Email an email address belonging to a user
|
||||
pub fn new() -> Email {
|
||||
Email {
|
||||
email: None,
|
||||
primary: None,
|
||||
user_id: None,
|
||||
username: None,
|
||||
verified: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
42
crates/gitea-client/src/models/external_tracker.rs
Normal file
42
crates/gitea-client/src/models/external_tracker.rs
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ExternalTracker : ExternalTracker represents settings for external tracker
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ExternalTracker {
|
||||
/// External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.
|
||||
#[serde(rename = "external_tracker_format", skip_serializing_if = "Option::is_none")]
|
||||
pub external_tracker_format: Option<String>,
|
||||
/// External Issue Tracker issue regular expression
|
||||
#[serde(rename = "external_tracker_regexp_pattern", skip_serializing_if = "Option::is_none")]
|
||||
pub external_tracker_regexp_pattern: Option<String>,
|
||||
/// External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp`
|
||||
#[serde(rename = "external_tracker_style", skip_serializing_if = "Option::is_none")]
|
||||
pub external_tracker_style: Option<String>,
|
||||
/// URL of external issue tracker.
|
||||
#[serde(rename = "external_tracker_url", skip_serializing_if = "Option::is_none")]
|
||||
pub external_tracker_url: Option<String>,
|
||||
}
|
||||
|
||||
impl ExternalTracker {
|
||||
/// ExternalTracker represents settings for external tracker
|
||||
pub fn new() -> ExternalTracker {
|
||||
ExternalTracker {
|
||||
external_tracker_format: None,
|
||||
external_tracker_regexp_pattern: None,
|
||||
external_tracker_style: None,
|
||||
external_tracker_url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
30
crates/gitea-client/src/models/external_wiki.rs
Normal file
30
crates/gitea-client/src/models/external_wiki.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// ExternalWiki : ExternalWiki represents setting for external wiki
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ExternalWiki {
|
||||
/// URL of external wiki.
|
||||
#[serde(rename = "external_wiki_url", skip_serializing_if = "Option::is_none")]
|
||||
pub external_wiki_url: Option<String>,
|
||||
}
|
||||
|
||||
impl ExternalWiki {
|
||||
/// ExternalWiki represents setting for external wiki
|
||||
pub fn new() -> ExternalWiki {
|
||||
ExternalWiki {
|
||||
external_wiki_url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
51
crates/gitea-client/src/models/file_commit_response.rs
Normal file
51
crates/gitea-client/src/models/file_commit_response.rs
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FileCommitResponse {
|
||||
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
|
||||
pub author: Option<Box<models::CommitUser>>,
|
||||
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
|
||||
pub committer: Option<Box<models::CommitUser>>,
|
||||
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
|
||||
pub created: Option<String>,
|
||||
#[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
|
||||
pub html_url: Option<String>,
|
||||
#[serde(rename = "message", skip_serializing_if = "Option::is_none")]
|
||||
pub message: Option<String>,
|
||||
#[serde(rename = "parents", skip_serializing_if = "Option::is_none")]
|
||||
pub parents: Option<Vec<models::CommitMeta>>,
|
||||
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
|
||||
pub sha: Option<String>,
|
||||
#[serde(rename = "tree", skip_serializing_if = "Option::is_none")]
|
||||
pub tree: Option<Box<models::CommitMeta>>,
|
||||
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
|
||||
pub url: Option<String>,
|
||||
}
|
||||
|
||||
impl FileCommitResponse {
|
||||
pub fn new() -> FileCommitResponse {
|
||||
FileCommitResponse {
|
||||
author: None,
|
||||
committer: None,
|
||||
created: None,
|
||||
html_url: None,
|
||||
message: None,
|
||||
parents: None,
|
||||
sha: None,
|
||||
tree: None,
|
||||
url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
crates/gitea-client/src/models/file_delete_response.rs
Normal file
35
crates/gitea-client/src/models/file_delete_response.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// FileDeleteResponse : FileDeleteResponse contains information about a repo's file that was deleted
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FileDeleteResponse {
|
||||
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
|
||||
pub commit: Option<Box<models::FileCommitResponse>>,
|
||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<serde_json::Value>,
|
||||
#[serde(rename = "verification", skip_serializing_if = "Option::is_none")]
|
||||
pub verification: Option<Box<models::PayloadCommitVerification>>,
|
||||
}
|
||||
|
||||
impl FileDeleteResponse {
|
||||
/// FileDeleteResponse contains information about a repo's file that was deleted
|
||||
pub fn new() -> FileDeleteResponse {
|
||||
FileDeleteResponse {
|
||||
commit: None,
|
||||
content: None,
|
||||
verification: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
crates/gitea-client/src/models/file_links_response.rs
Normal file
35
crates/gitea-client/src/models/file_links_response.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// FileLinksResponse : FileLinksResponse contains the links for a repo's file
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FileLinksResponse {
|
||||
#[serde(rename = "git", skip_serializing_if = "Option::is_none")]
|
||||
pub git: Option<String>,
|
||||
#[serde(rename = "html", skip_serializing_if = "Option::is_none")]
|
||||
pub html: Option<String>,
|
||||
#[serde(rename = "self", skip_serializing_if = "Option::is_none")]
|
||||
pub param_self: Option<String>,
|
||||
}
|
||||
|
||||
impl FileLinksResponse {
|
||||
/// FileLinksResponse contains the links for a repo's file
|
||||
pub fn new() -> FileLinksResponse {
|
||||
FileLinksResponse {
|
||||
git: None,
|
||||
html: None,
|
||||
param_self: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
crates/gitea-client/src/models/file_response.rs
Normal file
35
crates/gitea-client/src/models/file_response.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// FileResponse : FileResponse contains information about a repo's file
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FileResponse {
|
||||
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
|
||||
pub commit: Option<Box<models::FileCommitResponse>>,
|
||||
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
|
||||
pub content: Option<Box<models::ContentsResponse>>,
|
||||
#[serde(rename = "verification", skip_serializing_if = "Option::is_none")]
|
||||
pub verification: Option<Box<models::PayloadCommitVerification>>,
|
||||
}
|
||||
|
||||
impl FileResponse {
|
||||
/// FileResponse contains information about a repo's file
|
||||
pub fn new() -> FileResponse {
|
||||
FileResponse {
|
||||
commit: None,
|
||||
content: None,
|
||||
verification: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
35
crates/gitea-client/src/models/files_response.rs
Normal file
35
crates/gitea-client/src/models/files_response.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// FilesResponse : FilesResponse contains information about multiple files from a repo
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FilesResponse {
|
||||
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
|
||||
pub commit: Option<Box<models::FileCommitResponse>>,
|
||||
#[serde(rename = "files", skip_serializing_if = "Option::is_none")]
|
||||
pub files: Option<Vec<models::ContentsResponse>>,
|
||||
#[serde(rename = "verification", skip_serializing_if = "Option::is_none")]
|
||||
pub verification: Option<Box<models::PayloadCommitVerification>>,
|
||||
}
|
||||
|
||||
impl FilesResponse {
|
||||
/// FilesResponse contains information about multiple files from a repo
|
||||
pub fn new() -> FilesResponse {
|
||||
FilesResponse {
|
||||
commit: None,
|
||||
files: None,
|
||||
verification: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
38
crates/gitea-client/src/models/general_api_settings.rs
Normal file
38
crates/gitea-client/src/models/general_api_settings.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// GeneralApiSettings : GeneralAPISettings contains global api settings exposed by it
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct GeneralApiSettings {
|
||||
#[serde(rename = "default_git_trees_per_page", skip_serializing_if = "Option::is_none")]
|
||||
pub default_git_trees_per_page: Option<i64>,
|
||||
#[serde(rename = "default_max_blob_size", skip_serializing_if = "Option::is_none")]
|
||||
pub default_max_blob_size: Option<i64>,
|
||||
#[serde(rename = "default_paging_num", skip_serializing_if = "Option::is_none")]
|
||||
pub default_paging_num: Option<i64>,
|
||||
#[serde(rename = "max_response_items", skip_serializing_if = "Option::is_none")]
|
||||
pub max_response_items: Option<i64>,
|
||||
}
|
||||
|
||||
impl GeneralApiSettings {
|
||||
/// GeneralAPISettings contains global api settings exposed by it
|
||||
pub fn new() -> GeneralApiSettings {
|
||||
GeneralApiSettings {
|
||||
default_git_trees_per_page: None,
|
||||
default_max_blob_size: None,
|
||||
default_paging_num: None,
|
||||
max_response_items: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// GeneralAttachmentSettings : GeneralAttachmentSettings contains global Attachment settings exposed by API
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct GeneralAttachmentSettings {
|
||||
#[serde(rename = "allowed_types", skip_serializing_if = "Option::is_none")]
|
||||
pub allowed_types: Option<String>,
|
||||
#[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(rename = "max_files", skip_serializing_if = "Option::is_none")]
|
||||
pub max_files: Option<i64>,
|
||||
#[serde(rename = "max_size", skip_serializing_if = "Option::is_none")]
|
||||
pub max_size: Option<i64>,
|
||||
}
|
||||
|
||||
impl GeneralAttachmentSettings {
|
||||
/// GeneralAttachmentSettings contains global Attachment settings exposed by API
|
||||
pub fn new() -> GeneralAttachmentSettings {
|
||||
GeneralAttachmentSettings {
|
||||
allowed_types: None,
|
||||
enabled: None,
|
||||
max_files: None,
|
||||
max_size: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
44
crates/gitea-client/src/models/general_repo_settings.rs
Normal file
44
crates/gitea-client/src/models/general_repo_settings.rs
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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};
|
||||
|
||||
/// GeneralRepoSettings : GeneralRepoSettings contains global repository settings exposed by API
|
||||
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct GeneralRepoSettings {
|
||||
#[serde(rename = "http_git_disabled", skip_serializing_if = "Option::is_none")]
|
||||
pub http_git_disabled: Option<bool>,
|
||||
#[serde(rename = "lfs_disabled", skip_serializing_if = "Option::is_none")]
|
||||
pub lfs_disabled: Option<bool>,
|
||||
#[serde(rename = "migrations_disabled", skip_serializing_if = "Option::is_none")]
|
||||
pub migrations_disabled: Option<bool>,
|
||||
#[serde(rename = "mirrors_disabled", skip_serializing_if = "Option::is_none")]
|
||||
pub mirrors_disabled: Option<bool>,
|
||||
#[serde(rename = "stars_disabled", skip_serializing_if = "Option::is_none")]
|
||||
pub stars_disabled: Option<bool>,
|
||||
#[serde(rename = "time_tracking_disabled", skip_serializing_if = "Option::is_none")]
|
||||
pub time_tracking_disabled: Option<bool>,
|
||||
}
|
||||
|
||||
impl GeneralRepoSettings {
|
||||
/// GeneralRepoSettings contains global repository settings exposed by API
|
||||
pub fn new() -> GeneralRepoSettings {
|
||||
GeneralRepoSettings {
|
||||
http_git_disabled: None,
|
||||
lfs_disabled: None,
|
||||
migrations_disabled: None,
|
||||
mirrors_disabled: None,
|
||||
stars_disabled: None,
|
||||
time_tracking_disabled: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user