Rewrite rust (#38)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: https://git.front.kjuulh.io/kjuulh/octopush/pulls/38
This commit is contained in:
2022-11-27 11:21:35 +00:00
parent 0d6e8bc4a0
commit 991861db99
445 changed files with 53358 additions and 2568 deletions

View File

@@ -0,0 +1,3 @@
/target/
**/*.rs.bk
Cargo.lock

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -0,0 +1,336 @@
.gitignore
.openapi-generator-ignore
.travis.yml
Cargo.toml
README.md
docs/AccessToken.md
docs/AddCollaboratorOption.md
docs/AddTimeOption.md
docs/AdminApi.md
docs/AnnotatedTag.md
docs/AnnotatedTagObject.md
docs/ApiError.md
docs/Attachment.md
docs/Branch.md
docs/BranchProtection.md
docs/CombinedStatus.md
docs/Comment.md
docs/Commit.md
docs/CommitAffectedFiles.md
docs/CommitDateOptions.md
docs/CommitMeta.md
docs/CommitStats.md
docs/CommitStatus.md
docs/CommitUser.md
docs/ContentsResponse.md
docs/CreateAccessTokenOption.md
docs/CreateBranchProtectionOption.md
docs/CreateBranchRepoOption.md
docs/CreateEmailOption.md
docs/CreateFileOptions.md
docs/CreateForkOption.md
docs/CreateGpgKeyOption.md
docs/CreateHookOption.md
docs/CreateIssueCommentOption.md
docs/CreateIssueOption.md
docs/CreateKeyOption.md
docs/CreateLabelOption.md
docs/CreateMilestoneOption.md
docs/CreateOAuth2ApplicationOptions.md
docs/CreateOrgOption.md
docs/CreatePullRequestOption.md
docs/CreatePullReviewComment.md
docs/CreatePullReviewOptions.md
docs/CreateReleaseOption.md
docs/CreateRepoOption.md
docs/CreateStatusOption.md
docs/CreateTagOption.md
docs/CreateTeamOption.md
docs/CreateUserOption.md
docs/CreateWikiPageOptions.md
docs/Cron.md
docs/DeleteEmailOption.md
docs/DeleteFileOptions.md
docs/DeployKey.md
docs/DismissPullReviewOptions.md
docs/EditAttachmentOptions.md
docs/EditBranchProtectionOption.md
docs/EditDeadlineOption.md
docs/EditGitHookOption.md
docs/EditHookOption.md
docs/EditIssueCommentOption.md
docs/EditIssueOption.md
docs/EditLabelOption.md
docs/EditMilestoneOption.md
docs/EditOrgOption.md
docs/EditPullRequestOption.md
docs/EditReactionOption.md
docs/EditReleaseOption.md
docs/EditRepoOption.md
docs/EditTeamOption.md
docs/EditUserOption.md
docs/Email.md
docs/ExternalTracker.md
docs/ExternalWiki.md
docs/FileCommitResponse.md
docs/FileDeleteResponse.md
docs/FileLinksResponse.md
docs/FileResponse.md
docs/GeneralApiSettings.md
docs/GeneralAttachmentSettings.md
docs/GeneralRepoSettings.md
docs/GeneralUiSettings.md
docs/GenerateRepoOption.md
docs/GitBlobResponse.md
docs/GitEntry.md
docs/GitHook.md
docs/GitObject.md
docs/GitTreeResponse.md
docs/GpgKey.md
docs/GpgKeyEmail.md
docs/Hook.md
docs/Identity.md
docs/InternalTracker.md
docs/Issue.md
docs/IssueApi.md
docs/IssueDeadline.md
docs/IssueLabelsOption.md
docs/IssueTemplate.md
docs/Label.md
docs/MarkdownOption.md
docs/MergePullRequestOption.md
docs/MigrateRepoForm.md
docs/MigrateRepoOptions.md
docs/Milestone.md
docs/MiscellaneousApi.md
docs/NodeInfo.md
docs/NodeInfoServices.md
docs/NodeInfoSoftware.md
docs/NodeInfoUsage.md
docs/NodeInfoUsageUsers.md
docs/Note.md
docs/NotificationApi.md
docs/NotificationCount.md
docs/NotificationSubject.md
docs/NotificationThread.md
docs/OAuth2Application.md
docs/Organization.md
docs/OrganizationApi.md
docs/OrganizationPermissions.md
docs/Package.md
docs/PackageApi.md
docs/PackageFile.md
docs/PayloadCommit.md
docs/PayloadCommitVerification.md
docs/PayloadUser.md
docs/Permission.md
docs/PrBranchInfo.md
docs/PublicKey.md
docs/PullRequest.md
docs/PullRequestMeta.md
docs/PullReview.md
docs/PullReviewComment.md
docs/PullReviewRequestOptions.md
docs/Reaction.md
docs/Reference.md
docs/Release.md
docs/RepoCollaboratorPermission.md
docs/RepoCommit.md
docs/RepoTopicOptions.md
docs/RepoTransfer.md
docs/Repository.md
docs/RepositoryApi.md
docs/RepositoryMeta.md
docs/SearchResults.md
docs/ServerVersion.md
docs/SettingsApi.md
docs/StopWatch.md
docs/SubmitPullReviewOptions.md
docs/Tag.md
docs/Team.md
docs/TeamSearch200Response.md
docs/TimelineComment.md
docs/TopicName.md
docs/TopicResponse.md
docs/TrackedTime.md
docs/TransferRepoOption.md
docs/UpdateFileOptions.md
docs/User.md
docs/UserApi.md
docs/UserHeatmapData.md
docs/UserSearch200Response.md
docs/UserSettings.md
docs/UserSettingsOptions.md
docs/WatchInfo.md
docs/WikiCommit.md
docs/WikiCommitList.md
docs/WikiPage.md
docs/WikiPageMetaData.md
git_push.sh
src/apis/admin_api.rs
src/apis/configuration.rs
src/apis/issue_api.rs
src/apis/miscellaneous_api.rs
src/apis/mod.rs
src/apis/notification_api.rs
src/apis/organization_api.rs
src/apis/package_api.rs
src/apis/repository_api.rs
src/apis/settings_api.rs
src/apis/user_api.rs
src/lib.rs
src/models/access_token.rs
src/models/add_collaborator_option.rs
src/models/add_time_option.rs
src/models/annotated_tag.rs
src/models/annotated_tag_object.rs
src/models/api_error.rs
src/models/attachment.rs
src/models/branch.rs
src/models/branch_protection.rs
src/models/combined_status.rs
src/models/comment.rs
src/models/commit.rs
src/models/commit_affected_files.rs
src/models/commit_date_options.rs
src/models/commit_meta.rs
src/models/commit_stats.rs
src/models/commit_status.rs
src/models/commit_user.rs
src/models/contents_response.rs
src/models/create_access_token_option.rs
src/models/create_branch_protection_option.rs
src/models/create_branch_repo_option.rs
src/models/create_email_option.rs
src/models/create_file_options.rs
src/models/create_fork_option.rs
src/models/create_gpg_key_option.rs
src/models/create_hook_option.rs
src/models/create_issue_comment_option.rs
src/models/create_issue_option.rs
src/models/create_key_option.rs
src/models/create_label_option.rs
src/models/create_milestone_option.rs
src/models/create_o_auth2_application_options.rs
src/models/create_org_option.rs
src/models/create_pull_request_option.rs
src/models/create_pull_review_comment.rs
src/models/create_pull_review_options.rs
src/models/create_release_option.rs
src/models/create_repo_option.rs
src/models/create_status_option.rs
src/models/create_tag_option.rs
src/models/create_team_option.rs
src/models/create_user_option.rs
src/models/create_wiki_page_options.rs
src/models/cron.rs
src/models/delete_email_option.rs
src/models/delete_file_options.rs
src/models/deploy_key.rs
src/models/dismiss_pull_review_options.rs
src/models/edit_attachment_options.rs
src/models/edit_branch_protection_option.rs
src/models/edit_deadline_option.rs
src/models/edit_git_hook_option.rs
src/models/edit_hook_option.rs
src/models/edit_issue_comment_option.rs
src/models/edit_issue_option.rs
src/models/edit_label_option.rs
src/models/edit_milestone_option.rs
src/models/edit_org_option.rs
src/models/edit_pull_request_option.rs
src/models/edit_reaction_option.rs
src/models/edit_release_option.rs
src/models/edit_repo_option.rs
src/models/edit_team_option.rs
src/models/edit_user_option.rs
src/models/email.rs
src/models/external_tracker.rs
src/models/external_wiki.rs
src/models/file_commit_response.rs
src/models/file_delete_response.rs
src/models/file_links_response.rs
src/models/file_response.rs
src/models/general_api_settings.rs
src/models/general_attachment_settings.rs
src/models/general_repo_settings.rs
src/models/general_ui_settings.rs
src/models/generate_repo_option.rs
src/models/git_blob_response.rs
src/models/git_entry.rs
src/models/git_hook.rs
src/models/git_object.rs
src/models/git_tree_response.rs
src/models/gpg_key.rs
src/models/gpg_key_email.rs
src/models/hook.rs
src/models/identity.rs
src/models/internal_tracker.rs
src/models/issue.rs
src/models/issue_deadline.rs
src/models/issue_labels_option.rs
src/models/issue_template.rs
src/models/label.rs
src/models/markdown_option.rs
src/models/merge_pull_request_option.rs
src/models/migrate_repo_form.rs
src/models/migrate_repo_options.rs
src/models/milestone.rs
src/models/mod.rs
src/models/node_info.rs
src/models/node_info_services.rs
src/models/node_info_software.rs
src/models/node_info_usage.rs
src/models/node_info_usage_users.rs
src/models/note.rs
src/models/notification_count.rs
src/models/notification_subject.rs
src/models/notification_thread.rs
src/models/o_auth2_application.rs
src/models/organization.rs
src/models/organization_permissions.rs
src/models/package.rs
src/models/package_file.rs
src/models/payload_commit.rs
src/models/payload_commit_verification.rs
src/models/payload_user.rs
src/models/permission.rs
src/models/pr_branch_info.rs
src/models/public_key.rs
src/models/pull_request.rs
src/models/pull_request_meta.rs
src/models/pull_review.rs
src/models/pull_review_comment.rs
src/models/pull_review_request_options.rs
src/models/reaction.rs
src/models/reference.rs
src/models/release.rs
src/models/repo_collaborator_permission.rs
src/models/repo_commit.rs
src/models/repo_topic_options.rs
src/models/repo_transfer.rs
src/models/repository.rs
src/models/repository_meta.rs
src/models/search_results.rs
src/models/server_version.rs
src/models/stop_watch.rs
src/models/submit_pull_review_options.rs
src/models/tag.rs
src/models/team.rs
src/models/team_search_200_response.rs
src/models/timeline_comment.rs
src/models/topic_name.rs
src/models/topic_response.rs
src/models/tracked_time.rs
src/models/transfer_repo_option.rs
src/models/update_file_options.rs
src/models/user.rs
src/models/user_heatmap_data.rs
src/models/user_search_200_response.rs
src/models/user_settings.rs
src/models/user_settings_options.rs
src/models/watch_info.rs
src/models/wiki_commit.rs
src/models/wiki_commit_list.rs
src/models/wiki_page.rs
src/models/wiki_page_meta_data.rs

View File

@@ -0,0 +1 @@
6.3.0-SNAPSHOT

View File

@@ -0,0 +1 @@
language: rust

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* 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.17.3/rust".to_owned()),
client: reqwest::Client::new(),
basic_auth: None,
oauth_access_token: None,
bearer_access_token: None,
api_key: None,
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,447 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use crate::apis::ResponseContent;
use super::{Error, configuration};
/// struct for typed errors of method [`get_node_info`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetNodeInfoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_signing_key`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSigningKeyError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_version`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetVersionError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`render_markdown`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RenderMarkdownError {
Status422(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`render_markdown_raw`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RenderMarkdownRawError {
Status422(),
UnknownValue(serde_json::Value),
}
pub async fn get_node_info(configuration: &configuration::Configuration, ) -> Result<crate::models::NodeInfo, Error<GetNodeInfoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/nodeinfo", 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("Authorization", 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());
};
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_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);
};
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<GetNodeInfoError> = 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_signing_key(configuration: &configuration::Configuration, ) -> Result<String, Error<GetSigningKeyError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/signing-key.gpg", 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("Authorization", 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());
};
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_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);
};
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<GetSigningKeyError> = 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_version(configuration: &configuration::Configuration, ) -> Result<crate::models::ServerVersion, Error<GetVersionError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/version", 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("Authorization", 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());
};
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_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);
};
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<GetVersionError> = 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 render_markdown(configuration: &configuration::Configuration, body: Option<crate::models::MarkdownOption>) -> Result<String, Error<RenderMarkdownError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/markdown", local_var_configuration.base_path);
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("Authorization", 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());
};
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_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);
};
local_var_req_builder = local_var_req_builder.json(&body);
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<RenderMarkdownError> = 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 render_markdown_raw(configuration: &configuration::Configuration, body: &str) -> Result<String, Error<RenderMarkdownRawError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/markdown/raw", local_var_configuration.base_path);
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("Authorization", 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());
};
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_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);
};
local_var_req_builder = local_var_req_builder.json(&body);
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<RenderMarkdownRawError> = 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))
}
}

View File

@@ -0,0 +1,74 @@
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 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;

View File

@@ -0,0 +1,704 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use crate::apis::ResponseContent;
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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))
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,373 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use crate::apis::ResponseContent;
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 {
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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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))
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,358 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use crate::apis::ResponseContent;
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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<crate::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("Authorization", 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());
};
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_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);
};
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))
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_json;
extern crate url;
extern crate reqwest;
pub mod apis;
pub mod models;

View File

@@ -0,0 +1,37 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, 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 = "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,
sha1: None,
token_last_eight: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// AddCollaboratorOption : AddCollaboratorOption options when adding a user as a collaborator of a repository
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,38 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// AddTimeOption : AddTimeOption options for adding time to an issue
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,48 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// AnnotatedTag : AnnotatedTag represents an annotated tag
#[derive(Clone, Debug, PartialEq, Default, 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<crate::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<crate::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<crate::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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// AnnotatedTagObject : AnnotatedTagObject contains meta information of the tag object
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// ApiError : APIError is an api error with a message
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,48 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// Attachment : Attachment a generic attachment
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,54 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// Branch : Branch represents a repository branch
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Branch {
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
pub commit: Option<Box<crate::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,
}
}
}

View File

@@ -0,0 +1,99 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// BranchProtection : BranchProtection represents a branch protection for a repository
#[derive(Clone, Debug, PartialEq, Default, 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>,
#[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 = "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>,
#[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,
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,
updated_at: None,
}
}
}

View File

@@ -0,0 +1,49 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CombinedStatus : CombinedStatus holds the combined state of several statuses for a single commit
#[derive(Clone, Debug, PartialEq, Default, 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<crate::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\", \"failure\", and \"warning\"
#[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<crate::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,
}
}
}

View File

@@ -0,0 +1,57 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// Comment : Comment represents a comment on a commit or issue
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Comment {
#[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<crate::models::User>>,
}
impl Comment {
/// Comment represents a comment on a commit or issue
pub fn new() -> Comment {
Comment {
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,
}
}
}

View File

@@ -0,0 +1,55 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Commit {
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<Box<crate::models::User>>,
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
pub commit: Option<Box<crate::models::RepoCommit>>,
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
pub committer: Option<Box<crate::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<crate::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<crate::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<crate::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,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CommitAffectedFiles : CommitAffectedFiles store information about files affected by the commit
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CommitAffectedFiles {
#[serde(rename = "filename", skip_serializing_if = "Option::is_none")]
pub filename: Option<String>,
}
impl CommitAffectedFiles {
/// CommitAffectedFiles store information about files affected by the commit
pub fn new() -> CommitAffectedFiles {
CommitAffectedFiles {
filename: None,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CommitDateOptions : CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CommitStats : CommitStats is statistics for a RepoCommit
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,55 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CommitStatus : CommitStatus holds a single status of a single Commit
#[derive(Clone, Debug, PartialEq, Default, 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<crate::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\", \"failure\", and \"warning\"
#[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,
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,74 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// ContentsResponse : ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ContentsResponse {
#[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
pub _links: Option<Box<crate::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 = "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,
name: None,
path: None,
sha: None,
size: None,
submodule_git_url: None,
target: None,
r#type: None,
url: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateAccessTokenOption : CreateAccessTokenOption options when create access token
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateAccessTokenOption {
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
impl CreateAccessTokenOption {
/// CreateAccessTokenOption options when create access token
pub fn new() -> CreateAccessTokenOption {
CreateAccessTokenOption {
name: None,
}
}
}

View File

@@ -0,0 +1,93 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateBranchProtectionOption : CreateBranchProtectionOption options for creating a branch protection
#[derive(Clone, Debug, PartialEq, Default, 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>,
#[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 = "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 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,
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,
}
}
}

View File

@@ -0,0 +1,35 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateBranchRepoOption : CreateBranchRepoOption options when creating a branch in a repository
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateBranchRepoOption {
/// Name of the branch to create
#[serde(rename = "new_branch_name")]
pub new_branch_name: String,
/// 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>,
}
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,
}
}
}

View File

@@ -0,0 +1,31 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateEmailOption : CreateEmailOption options when creating email addresses
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,56 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// 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, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateFileOptions {
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<Box<crate::models::Identity>>,
/// branch (optional) to base this file from. if not given, the default branch is used
#[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
pub branch: Option<String>,
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
pub committer: Option<Box<crate::models::Identity>>,
/// content must be base64 encoded
#[serde(rename = "content")]
pub content: String,
#[serde(rename = "dates", skip_serializing_if = "Option::is_none")]
pub dates: Option<Box<crate::models::CommitDateOptions>>,
/// 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,
}
}
}

View File

@@ -0,0 +1,35 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateForkOption : CreateForkOption options for creating a fork
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateGpgKeyOption : CreateGPGKeyOption options create user GPG key
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,73 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateHookOption : CreateHookOption options when create a hook
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateHookOption {
#[serde(rename = "active", skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[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: RHashType,
}
impl CreateHookOption {
/// CreateHookOption options when create a hook
pub fn new(config: ::std::collections::HashMap<String, String>, r#type: RHashType) -> CreateHookOption {
CreateHookOption {
active: None,
branch_filter: None,
config,
events: None,
r#type,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RHashType {
#[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 RHashType {
fn default() -> RHashType {
Self::Dingtalk
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateIssueCommentOption : CreateIssueCommentOption options for creating a comment on an issue
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,57 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateIssueOption : CreateIssueOption options to create one issue
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateKeyOption : CreateKeyOption options when creating a key
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateLabelOption : CreateLabelOption options for creating a label
#[derive(Clone, Debug, PartialEq, Default, 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 = "name")]
pub name: String,
}
impl CreateLabelOption {
/// CreateLabelOption options for creating a label
pub fn new(color: String, name: String) -> CreateLabelOption {
CreateLabelOption {
color,
description: None,
name,
}
}
}

View File

@@ -0,0 +1,53 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateMilestoneOption : CreateMilestoneOption options for creating a milestone
#[derive(Clone, Debug, PartialEq, Default, 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
}
}

View File

@@ -0,0 +1,33 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateOAuth2ApplicationOptions : CreateOAuth2ApplicationOptions holds options to create an oauth2 application
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateOAuth2ApplicationOptions {
#[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 {
name: None,
redirect_uris: None,
}
}
}

View File

@@ -0,0 +1,65 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateOrgOption : CreateOrgOption options for creating an organization
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateOrgOption {
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: 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,
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
}
}

View File

@@ -0,0 +1,54 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreatePullRequestOption : CreatePullRequestOption options when creating a pull request
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,42 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreatePullReviewComment : CreatePullReviewComment represent a review comment for creation api
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,40 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreatePullReviewOptions : CreatePullReviewOptions are options to create a pull review
#[derive(Clone, Debug, PartialEq, Default, 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<crate::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,
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateReleaseOption : CreateReleaseOption options when creating a release
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,89 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateRepoOption : CreateRepoOption options when creating repository
#[derive(Clone, Debug, PartialEq, Default, 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,
/// 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,
private: None,
readme: None,
template: None,
trust_model: None,
}
}
}
/// 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
}
}

View File

@@ -0,0 +1,40 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateStatusOption : CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
#[derive(Clone, Debug, PartialEq, Default, 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\", \"failure\", and \"warning\"
#[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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateTagOption : CreateTagOption options when creating a tag
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,64 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateTeamOption : CreateTeamOption options for creating a team
#[derive(Clone, Debug, PartialEq, Default, 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
}
}

View File

@@ -0,0 +1,57 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateUserOption : CreateUserOption create user options
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct CreateUserOption {
#[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")]
pub password: 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, password: String, username: String) -> CreateUserOption {
CreateUserOption {
email,
full_name: None,
login_name: None,
must_change_password: None,
password,
restricted: None,
send_notify: None,
source_id: None,
username,
visibility: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// CreateWikiPageOptions : CreateWikiPageOptions form for creating wiki
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,42 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// Cron : Cron represents a Cron task
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,31 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// DeleteEmailOption : DeleteEmailOption options when deleting email addresses
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,56 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// 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, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct DeleteFileOptions {
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<Box<crate::models::Identity>>,
/// branch (optional) to base this file from. if not given, the default branch is used
#[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
pub branch: Option<String>,
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
pub committer: Option<Box<crate::models::Identity>>,
#[serde(rename = "dates", skip_serializing_if = "Option::is_none")]
pub dates: Option<Box<crate::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,
}
}
}

View File

@@ -0,0 +1,54 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// DeployKey : DeployKey a deploy key
#[derive(Clone, Debug, PartialEq, Default, 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<crate::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,
}
}
}

View File

@@ -0,0 +1,33 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// DismissPullReviewOptions : DismissPullReviewOptions are options to dismiss a pull review
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditAttachmentOptions : EditAttachmentOptions options for editing attachments
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,90 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditBranchProtectionOption : EditBranchProtectionOption options for editing a branch protection
#[derive(Clone, Debug, PartialEq, Default, 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 = "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,
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,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditDeadlineOption : EditDeadlineOption options for creating a deadline
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditGitHookOption : EditGitHookOption options when modifying one Git hook
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditHookOption : EditHookOption options when modify one hook
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct EditHookOption {
#[serde(rename = "active", skip_serializing_if = "Option::is_none")]
pub active: Option<bool>,
#[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,
branch_filter: None,
config: None,
events: None,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditIssueCommentOption : EditIssueCommentOption options for editing a comment
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,55 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditIssueOption : EditIssueOption options for editing an issue
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditLabelOption : EditLabelOption options for editing a label
#[derive(Clone, Debug, PartialEq, Default, 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 = "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,
name: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditMilestoneOption : EditMilestoneOption options for editing a milestone
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,62 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditOrgOption : EditOrgOption options for editing an organization
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct EditOrgOption {
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: 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,
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
}
}

View File

@@ -0,0 +1,60 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditPullRequestOption : EditPullRequestOption options when modify pull request
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,30 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditReactionOption : EditReactionOption contain the reaction type
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditReleaseOption : EditReleaseOption options when editing a release
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,128 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditRepoOption : EditRepoOption options when editing a repository's properties
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct EditRepoOption {
/// either `true` to allow mark pr as merged manually, or `false` to prevent it. `has_pull_requests` must be `true`.
#[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. `has_pull_requests` must be `true`.
#[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. `has_pull_requests` must be `true`.
#[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. `has_pull_requests` must be `true`.
#[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. `has_pull_requests` must be `true`.
#[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. `has_pull_requests` must be `true`.
#[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. `has_pull_requests` must be `true`, 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>,
/// 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\", or \"squash\". `has_pull_requests` must be `true`.
#[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
#[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<crate::models::ExternalTracker>>,
#[serde(rename = "external_wiki", skip_serializing_if = "Option::is_none")]
pub external_wiki: Option<Box<crate::models::ExternalWiki>>,
/// 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 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 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. `has_pull_requests` must be `true`.
#[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<crate::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>,
/// 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_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_branch: None,
default_delete_branch_after_merge: None,
default_merge_style: None,
description: None,
enable_prune: None,
external_tracker: None,
external_wiki: None,
has_issues: None,
has_projects: None,
has_pull_requests: None,
has_wiki: None,
ignore_whitespace_conflicts: None,
internal_tracker: None,
mirror_interval: None,
name: None,
private: None,
template: None,
website: None,
}
}
}

View File

@@ -0,0 +1,64 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditTeamOption : EditTeamOption options for editing a team
#[derive(Clone, Debug, PartialEq, Default, 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
}
}

View File

@@ -0,0 +1,81 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// EditUserOption : EditUserOption edit user options
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// Email : Email an email address belonging to a user
#[derive(Clone, Debug, PartialEq, Default, 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 = "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,
verified: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// ExternalTracker : ExternalTracker represents settings for external tracker
#[derive(Clone, Debug, PartialEq, Default, 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 Number Format, either `numeric` or `alphanumeric`
#[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_style: None,
external_tracker_url: None,
}
}
}

View File

@@ -0,0 +1,31 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// ExternalWiki : ExternalWiki represents setting for external wiki
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,52 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct FileCommitResponse {
#[serde(rename = "author", skip_serializing_if = "Option::is_none")]
pub author: Option<Box<crate::models::CommitUser>>,
#[serde(rename = "committer", skip_serializing_if = "Option::is_none")]
pub committer: Option<Box<crate::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<crate::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<crate::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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// FileDeleteResponse : FileDeleteResponse contains information about a repo's file that was deleted
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct FileDeleteResponse {
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
pub commit: Option<Box<crate::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<crate::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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// FileLinksResponse : FileLinksResponse contains the links for a repo's file
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// FileResponse : FileResponse contains information about a repo's file
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct FileResponse {
#[serde(rename = "commit", skip_serializing_if = "Option::is_none")]
pub commit: Option<Box<crate::models::FileCommitResponse>>,
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<Box<crate::models::ContentsResponse>>,
#[serde(rename = "verification", skip_serializing_if = "Option::is_none")]
pub verification: Option<Box<crate::models::PayloadCommitVerification>>,
}
impl FileResponse {
/// FileResponse contains information about a repo's file
pub fn new() -> FileResponse {
FileResponse {
commit: None,
content: None,
verification: None,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GeneralApiSettings : GeneralAPISettings contains global api settings exposed by it
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,39 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GeneralAttachmentSettings : GeneralAttachmentSettings contains global Attachment settings exposed by API
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GeneralRepoSettings : GeneralRepoSettings contains global repository settings exposed by API
#[derive(Clone, Debug, PartialEq, Default, 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,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GeneralUiSettings : GeneralUISettings contains global ui settings exposed by API
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GeneralUiSettings {
#[serde(rename = "allowed_reactions", skip_serializing_if = "Option::is_none")]
pub allowed_reactions: Option<Vec<String>>,
#[serde(rename = "custom_emojis", skip_serializing_if = "Option::is_none")]
pub custom_emojis: Option<Vec<String>>,
#[serde(rename = "default_theme", skip_serializing_if = "Option::is_none")]
pub default_theme: Option<String>,
}
impl GeneralUiSettings {
/// GeneralUISettings contains global ui settings exposed by API
pub fn new() -> GeneralUiSettings {
GeneralUiSettings {
allowed_reactions: None,
custom_emojis: None,
default_theme: None,
}
}
}

View File

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

View File

@@ -0,0 +1,42 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GitBlobResponse : GitBlobResponse represents a git blob
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GitBlobResponse {
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(rename = "encoding", skip_serializing_if = "Option::is_none")]
pub encoding: 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>,
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
impl GitBlobResponse {
/// GitBlobResponse represents a git blob
pub fn new() -> GitBlobResponse {
GitBlobResponse {
content: None,
encoding: None,
sha: None,
size: None,
url: None,
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GitEntry : GitEntry represents a git tree
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GitEntry {
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: 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>,
#[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 GitEntry {
/// GitEntry represents a git tree
pub fn new() -> GitEntry {
GitEntry {
mode: None,
path: None,
sha: None,
size: None,
r#type: None,
url: None,
}
}
}

View File

@@ -0,0 +1,36 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GitHook : GitHook represents a Git repository hook
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GitHook {
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(rename = "is_active", skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
impl GitHook {
/// GitHook represents a Git repository hook
pub fn new() -> GitHook {
GitHook {
content: None,
is_active: None,
name: None,
}
}
}

View File

@@ -0,0 +1,34 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GitObject {
#[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 GitObject {
pub fn new() -> GitObject {
GitObject {
sha: None,
r#type: None,
url: None,
}
}
}

View File

@@ -0,0 +1,45 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GitTreeResponse : GitTreeResponse returns a git tree
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GitTreeResponse {
#[serde(rename = "page", skip_serializing_if = "Option::is_none")]
pub page: Option<i64>,
#[serde(rename = "sha", skip_serializing_if = "Option::is_none")]
pub sha: Option<String>,
#[serde(rename = "total_count", skip_serializing_if = "Option::is_none")]
pub total_count: Option<i64>,
#[serde(rename = "tree", skip_serializing_if = "Option::is_none")]
pub tree: Option<Vec<crate::models::GitEntry>>,
#[serde(rename = "truncated", skip_serializing_if = "Option::is_none")]
pub truncated: Option<bool>,
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
impl GitTreeResponse {
/// GitTreeResponse returns a git tree
pub fn new() -> GitTreeResponse {
GitTreeResponse {
page: None,
sha: None,
total_count: None,
tree: None,
truncated: None,
url: None,
}
}
}

View File

@@ -0,0 +1,66 @@
/*
* Gitea API.
*
* This documentation describes the Gitea API.
*
* The version of the OpenAPI document: 1.17.3
*
* Generated by: https://openapi-generator.tech
*/
/// GpgKey : GPGKey a user GPG key to sign commit and tag in repository
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GpgKey {
#[serde(rename = "can_certify", skip_serializing_if = "Option::is_none")]
pub can_certify: Option<bool>,
#[serde(rename = "can_encrypt_comms", skip_serializing_if = "Option::is_none")]
pub can_encrypt_comms: Option<bool>,
#[serde(rename = "can_encrypt_storage", skip_serializing_if = "Option::is_none")]
pub can_encrypt_storage: Option<bool>,
#[serde(rename = "can_sign", skip_serializing_if = "Option::is_none")]
pub can_sign: Option<bool>,
#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "emails", skip_serializing_if = "Option::is_none")]
pub emails: Option<Vec<crate::models::GpgKeyEmail>>,
#[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
pub expires_at: Option<String>,
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<i64>,
#[serde(rename = "key_id", skip_serializing_if = "Option::is_none")]
pub key_id: Option<String>,
#[serde(rename = "primary_key_id", skip_serializing_if = "Option::is_none")]
pub primary_key_id: Option<String>,
#[serde(rename = "public_key", skip_serializing_if = "Option::is_none")]
pub public_key: Option<String>,
#[serde(rename = "subkeys", skip_serializing_if = "Option::is_none")]
pub subkeys: Option<Vec<crate::models::GpgKey>>,
#[serde(rename = "verified", skip_serializing_if = "Option::is_none")]
pub verified: Option<bool>,
}
impl GpgKey {
/// GPGKey a user GPG key to sign commit and tag in repository
pub fn new() -> GpgKey {
GpgKey {
can_certify: None,
can_encrypt_comms: None,
can_encrypt_storage: None,
can_sign: None,
created_at: None,
emails: None,
expires_at: None,
id: None,
key_id: None,
primary_key_id: None,
public_key: None,
subkeys: None,
verified: None,
}
}
}

Some files were not shown because too many files have changed in this diff Show More