summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2024-04-26 17:36:30 +0200
committerCyborus <cyborus@noreply.codeberg.org>2024-04-26 17:36:30 +0200
commitc8251debb6985d0addbcc9de828cd02a8d009467 (patch)
tree39ec0ed1f1ddbc78535be49fd23fa721eb712a7d
parentMerge pull request 'format swagger file' (#45) from format-swagger into main (diff)
parentupdate ci api token (diff)
downloadforgejo-api-c8251debb6985d0addbcc9de828cd02a8d009467.tar.xz
forgejo-api-c8251debb6985d0addbcc9de828cd02a8d009467.zip
Merge pull request 'update to Forgejo 7.0's API' (#46) from v7.0 into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-api/pulls/46
-rw-r--r--.woodpecker/integration.yml4
-rw-r--r--src/generated/methods.rs305
-rw-r--r--src/generated/structs.rs112
-rw-r--r--swagger.v1.json821
4 files changed, 1211 insertions, 31 deletions
diff --git a/.woodpecker/integration.yml b/.woodpecker/integration.yml
index 025fa7d..e6a34f9 100644
--- a/.woodpecker/integration.yml
+++ b/.woodpecker/integration.yml
@@ -5,10 +5,10 @@ steps:
image: rust
environment:
- "FORGEJO_API_CI_INSTANCE_URL=http://forgejo-testing:3000/"
- - FORGEJO_API_CI_TOKEN=3226a46b52e29804bfb9b8ba21a5f91291fb86eb
+ - FORGEJO_API_CI_TOKEN=6c340bf9ed25adf28701f618fda5f82c934db1f3
commands:
- cargo test
services:
forgejo-testing:
- image: code.cartoon-aa.xyz/cyborus/ci-forgejo:1.21.2-0
+ image: code.cartoon-aa.xyz/cyborus/ci-forgejo:7.0.0
diff --git a/src/generated/methods.rs b/src/generated/methods.rs
index efbdb64..9cc914f 100644
--- a/src/generated/methods.rs
+++ b/src/generated/methods.rs
@@ -169,6 +169,18 @@ impl crate::Forgejo {
}
}
+ /// Get an global actions runner registration token
+ pub async fn admin_get_runner_registration_token(
+ &self,
+ ) -> Result<RegistrationTokenHeaders, ForgejoError> {
+ let request = self.get("admin/runners/registration-token").build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.headers().try_into()?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// List unadopted repositories
///
pub async fn admin_unadopted_list(
@@ -664,6 +676,23 @@ impl crate::Forgejo {
}
}
+ /// Get an organization's actions runner registration token
+ ///
+ /// - `org`: name of the organization
+ pub async fn org_get_runner_registration_token(
+ &self,
+ org: &str,
+ ) -> Result<RegistrationTokenHeaders, ForgejoError> {
+ let request = self
+ .get(&format!("orgs/{org}/actions/runners/registration-token"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.headers().try_into()?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// List an organization's actions secrets
///
/// - `org`: name of the organization
@@ -1884,6 +1913,27 @@ impl crate::Forgejo {
}
}
+ /// Get the pull request of the commit
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `sha`: SHA of the commit to get
+ pub async fn repo_get_commit_pull_request(
+ &self,
+ owner: &str,
+ repo: &str,
+ sha: &str,
+ ) -> Result<PullRequest, ForgejoError> {
+ let request = self
+ .get(&format!("repos/{owner}/{repo}/commits/{sha}/pull"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.json().await?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// Gets the metadata of all the entries of the root dir
///
/// - `owner`: owner of the repo
@@ -2066,6 +2116,123 @@ impl crate::Forgejo {
}
}
+ /// List a repository's flags
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ pub async fn repo_list_flags(
+ &self,
+ owner: &str,
+ repo: &str,
+ ) -> Result<Vec<String>, ForgejoError> {
+ let request = self.get(&format!("repos/{owner}/{repo}/flags")).build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.json().await?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
+ /// Replace all flags of a repository
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `body`: See [`ReplaceFlagsOption`]
+ pub async fn repo_replace_all_flags(
+ &self,
+ owner: &str,
+ repo: &str,
+ body: ReplaceFlagsOption,
+ ) -> Result<(), ForgejoError> {
+ let request = self
+ .put(&format!("repos/{owner}/{repo}/flags"))
+ .json(&body)
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 204 => Ok(()),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
+ /// Remove all flags from a repository
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ pub async fn repo_delete_all_flags(&self, owner: &str, repo: &str) -> Result<(), ForgejoError> {
+ let request = self
+ .delete(&format!("repos/{owner}/{repo}/flags"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 204 => Ok(()),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
+ /// Check if a repository has a given flag
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `flag`: name of the flag
+ pub async fn repo_check_flag(
+ &self,
+ owner: &str,
+ repo: &str,
+ flag: &str,
+ ) -> Result<(), ForgejoError> {
+ let request = self
+ .get(&format!("repos/{owner}/{repo}/flags/{flag}"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 204 => Ok(()),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
+ /// Add a flag to a repository
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `flag`: name of the flag
+ pub async fn repo_add_flag(
+ &self,
+ owner: &str,
+ repo: &str,
+ flag: &str,
+ ) -> Result<(), ForgejoError> {
+ let request = self
+ .put(&format!("repos/{owner}/{repo}/flags/{flag}"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 204 => Ok(()),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
+ /// Remove a flag from a repository
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `flag`: name of the flag
+ pub async fn repo_delete_flag(
+ &self,
+ owner: &str,
+ repo: &str,
+ flag: &str,
+ ) -> Result<(), ForgejoError> {
+ let request = self
+ .delete(&format!("repos/{owner}/{repo}/flags/{flag}"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 204 => Ok(()),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// List a repository's forks
///
/// - `owner`: owner of the repo
@@ -4396,6 +4563,29 @@ impl crate::Forgejo {
}
}
+ /// Get a pull request by base and head
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `base`: base of the pull request to get
+ /// - `head`: head of the pull request to get
+ pub async fn repo_get_pull_request_by_base_head(
+ &self,
+ owner: &str,
+ repo: &str,
+ base: &str,
+ head: &str,
+ ) -> Result<PullRequest, ForgejoError> {
+ let request = self
+ .get(&format!("repos/{owner}/{repo}/pulls/{base}/{head}"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.json().await?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// Get a pull request
///
/// - `owner`: owner of the repo
@@ -4776,6 +4966,88 @@ impl crate::Forgejo {
}
}
+ /// Add a new comment to a pull request review
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `index`: index of the pull request
+ /// - `id`: id of the review
+ /// - `body`: See [`serde_json::Value`]
+ pub async fn repo_create_pull_review_comment(
+ &self,
+ owner: &str,
+ repo: &str,
+ index: u64,
+ id: u64,
+ body: serde_json::Value,
+ ) -> Result<PullReviewComment, ForgejoError> {
+ let request = self
+ .post(&format!(
+ "repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments"
+ ))
+ .json(&body)
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.json().await?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
+ /// Get a pull review comment
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `index`: index of the pull request
+ /// - `id`: id of the review
+ /// - `comment`: id of the comment
+ pub async fn repo_get_pull_review_comment(
+ &self,
+ owner: &str,
+ repo: &str,
+ index: u64,
+ id: u64,
+ comment: u64,
+ ) -> Result<PullReviewComment, ForgejoError> {
+ let request = self
+ .get(&format!(
+ "repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}"
+ ))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.json().await?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
+ /// Delete a pull review comment
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ /// - `index`: index of the pull request
+ /// - `id`: id of the review
+ /// - `comment`: id of the comment
+ pub async fn repo_delete_pull_review_comment(
+ &self,
+ owner: &str,
+ repo: &str,
+ index: u64,
+ id: u64,
+ comment: u64,
+ ) -> Result<(), ForgejoError> {
+ let request = self
+ .delete(&format!(
+ "repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}"
+ ))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 204 => Ok(()),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// Dismiss a review for a pull request
///
/// - `owner`: owner of the repo
@@ -5296,6 +5568,25 @@ impl crate::Forgejo {
}
}
+ /// Get a repository's actions runner registration token
+ ///
+ /// - `owner`: owner of the repo
+ /// - `repo`: name of the repo
+ pub async fn repo_get_runner_registration_token(
+ &self,
+ owner: &str,
+ repo: &str,
+ ) -> Result<RegistrationTokenHeaders, ForgejoError> {
+ let request = self
+ .get(&format!("repos/{owner}/{repo}/runners/registration-token"))
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.headers().try_into()?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// Get signing-key.gpg for given repository
///
/// - `owner`: owner of the repo
@@ -6252,6 +6543,20 @@ impl crate::Forgejo {
}
}
+ /// Get an user's actions runner registration token
+ pub async fn user_get_runner_registration_token(
+ &self,
+ ) -> Result<RegistrationTokenHeaders, ForgejoError> {
+ let request = self
+ .get("user/actions/runners/registration-token")
+ .build()?;
+ let response = self.execute(request).await?;
+ match response.status().as_u16() {
+ 200 => Ok(response.headers().try_into()?),
+ _ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
+ }
+ }
+
/// Create or Update a secret value in a user scope
///
/// - `secretname`: name of the secret
diff --git a/src/generated/structs.rs b/src/generated/structs.rs
index 1a0dee8..a4d920c 100644
--- a/src/generated/structs.rs
+++ b/src/generated/structs.rs
@@ -120,6 +120,7 @@ pub struct Branch {
/// BranchProtection represents a branch protection for a repository
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BranchProtection {
+ pub apply_to_admins: Option<bool>,
pub approvals_whitelist_teams: Option<Vec<String>>,
pub approvals_whitelist_username: Option<Vec<String>>,
pub block_on_official_review_requests: Option<bool>,
@@ -135,6 +136,7 @@ pub struct BranchProtection {
pub enable_push: Option<bool>,
pub enable_push_whitelist: Option<bool>,
pub enable_status_check: Option<bool>,
+ pub ignore_stale_approvals: Option<bool>,
pub merge_whitelist_teams: Option<Vec<String>>,
pub merge_whitelist_usernames: Option<Vec<String>>,
pub protected_file_patterns: Option<String>,
@@ -371,6 +373,7 @@ pub struct CreateAccessTokenOption {
/// CreateBranchProtectionOption options for creating a branch protection
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateBranchProtectionOption {
+ pub apply_to_admins: Option<bool>,
pub approvals_whitelist_teams: Option<Vec<String>>,
pub approvals_whitelist_username: Option<Vec<String>>,
pub block_on_official_review_requests: Option<bool>,
@@ -384,6 +387,7 @@ pub struct CreateBranchProtectionOption {
pub enable_push: Option<bool>,
pub enable_push_whitelist: Option<bool>,
pub enable_status_check: Option<bool>,
+ pub ignore_stale_approvals: Option<bool>,
pub merge_whitelist_teams: Option<Vec<String>>,
pub merge_whitelist_usernames: Option<Vec<String>>,
pub protected_file_patterns: Option<String>,
@@ -632,6 +636,10 @@ pub struct CreatePullReviewComment {
pub path: Option<String>,
}
+/// CreatePullReviewCommentOptions are options to create a pull review comment
+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
+pub struct CreatePullReviewCommentOptions {}
+
/// CreatePullReviewOptions are options to create a pull review
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreatePullReviewOptions {
@@ -851,6 +859,7 @@ pub struct EditAttachmentOptions {
/// EditBranchProtectionOption options for editing a branch protection
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditBranchProtectionOption {
+ pub apply_to_admins: Option<bool>,
pub approvals_whitelist_teams: Option<Vec<String>>,
pub approvals_whitelist_username: Option<Vec<String>>,
pub block_on_official_review_requests: Option<bool>,
@@ -862,6 +871,7 @@ pub struct EditBranchProtectionOption {
pub enable_push: Option<bool>,
pub enable_push_whitelist: Option<bool>,
pub enable_status_check: Option<bool>,
+ pub ignore_stale_approvals: Option<bool>,
pub merge_whitelist_teams: Option<Vec<String>>,
pub merge_whitelist_usernames: Option<Vec<String>>,
pub protected_file_patterns: Option<String>,
@@ -1005,6 +1015,8 @@ pub struct EditReleaseOption {
/// EditRepoOption options when editing a repository's properties
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditRepoOption {
+ /// either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging.
+ pub allow_fast_forward_only_merge: Option<bool>,
/// either `true` to allow mark pr as merged manually, or `false` to prevent it.
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.
@@ -1027,7 +1039,7 @@ pub struct EditRepoOption {
pub default_branch: Option<String>,
/// set to `true` to delete pr branch after merge by default
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".
+ /// set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", "squash", or "fast-forward-only".
pub default_merge_style: Option<String>,
/// a short description of the repository.
pub description: Option<String>,
@@ -1066,6 +1078,8 @@ pub struct EditRepoOption {
pub template: Option<bool>,
/// a URL with more information about the repository.
pub website: Option<String>,
+ /// sets the branch used for this repository's wiki.
+ pub wiki_branch: Option<String>,
}
/// EditTeamOption options for editing a team
@@ -1106,6 +1120,7 @@ pub struct EditUserOption {
pub must_change_password: Option<bool>,
pub password: Option<String>,
pub prohibit_login: Option<bool>,
+ pub pronouns: Option<String>,
pub restricted: Option<bool>,
pub source_id: u64,
pub visibility: Option<String>,
@@ -1241,6 +1256,7 @@ pub struct GeneralAttachmentSettings {
/// GeneralRepoSettings contains global repository settings exposed by API
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GeneralRepoSettings {
+ pub forks_disabled: Option<bool>,
pub http_git_disabled: Option<bool>,
pub lfs_disabled: Option<bool>,
pub migrations_disabled: Option<bool>,
@@ -1352,15 +1368,20 @@ pub struct Hook {
pub active: Option<bool>,
pub authorization_header: Option<String>,
pub branch_filter: Option<String>,
+ /// Deprecated: use Metadata instead
pub config: Option<BTreeMap<String, String>>,
+ pub content_type: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub events: Option<Vec<String>>,
pub id: Option<u64>,
+ pub metadata: Option<serde_json::Value>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
+ #[serde(deserialize_with = "crate::none_if_blank_url")]
+ pub url: Option<url::Url>,
}
/// Identity for a person's identity like an author or committer
@@ -1453,11 +1474,16 @@ pub struct IssueFormField {
#[serde(rename = "type")]
pub r#type: Option<String>,
pub validations: Option<BTreeMap<String, serde_json::Value>>,
+ pub visible: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueFormFieldType {}
+/// IssueFormFieldVisible defines issue form field visible
+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
+pub struct IssueFormFieldVisible {}
+
/// IssueLabelsOption a collection of labels
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueLabelsOption {
@@ -1631,6 +1657,8 @@ pub enum MergePullRequestOptionDo {
RebaseMerge,
#[serde(rename = "squash")]
Squash,
+ #[serde(rename = "fast-forward-only")]
+ FastForwardOnly,
#[serde(rename = "manually-merged")]
ManuallyMerged,
}
@@ -1995,6 +2023,7 @@ pub struct PullRequest {
/// PullRequestMeta PR info if an issue is a PR
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PullRequestMeta {
+ pub draft: Option<bool>,
pub merged: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub merged_at: Option<time::OffsetDateTime>,
@@ -2057,10 +2086,12 @@ pub struct PullReviewRequestOptions {
/// PushMirror represents information of a push mirror
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PushMirror {
- pub created: Option<String>,
+ #[serde(with = "time::serde::rfc3339::option")]
+ pub created: Option<time::OffsetDateTime>,
pub interval: Option<String>,
pub last_error: Option<String>,
- pub last_update: Option<String>,
+ #[serde(with = "time::serde::rfc3339::option")]
+ pub last_update: Option<time::OffsetDateTime>,
pub remote_address: Option<String>,
pub remote_name: Option<String>,
pub repo_name: Option<String>,
@@ -2120,6 +2151,12 @@ pub struct RenameUserOption {
pub new_username: String,
}
+/// ReplaceFlagsOption options when replacing the flags of a repository
+#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
+pub struct ReplaceFlagsOption {
+ pub flags: Option<Vec<String>>,
+}
+
/// RepoCollaboratorPermission to get repository permission for a collaborator
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RepoCollaboratorPermission {
@@ -2157,6 +2194,7 @@ pub struct RepoTransfer {
/// Repository represents a repository
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Repository {
+ pub allow_fast_forward_only_merge: Option<bool>,
pub allow_merge_commits: Option<bool>,
pub allow_rebase: Option<bool>,
pub allow_rebase_explicit: Option<bool>,
@@ -2224,6 +2262,7 @@ pub struct Repository {
pub url: Option<url::Url>,
pub watchers_count: Option<u64>,
pub website: Option<String>,
+ pub wiki_branch: Option<String>,
}
/// RepositoryMeta basic repository information
@@ -2485,6 +2524,8 @@ pub struct User {
pub login_name: Option<String>,
/// Is user login prohibited
pub prohibit_login: Option<bool>,
+ /// the user's pronouns
+ pub pronouns: Option<String>,
/// Is user restricted
pub restricted: Option<bool>,
pub starred_repos_count: Option<u64>,
@@ -2506,12 +2547,14 @@ pub struct UserHeatmapData {
pub struct UserSettings {
pub description: Option<String>,
pub diff_view_style: Option<String>,
+ pub enable_repo_unit_hints: Option<bool>,
pub full_name: Option<String>,
pub hide_activity: Option<bool>,
/// Privacy
pub hide_email: Option<bool>,
pub language: Option<String>,
pub location: Option<String>,
+ pub pronouns: Option<String>,
pub theme: Option<String>,
pub website: Option<String>,
}
@@ -2521,12 +2564,14 @@ pub struct UserSettings {
pub struct UserSettingsOptions {
pub description: Option<String>,
pub diff_view_style: Option<String>,
+ pub enable_repo_unit_hints: Option<bool>,
pub full_name: Option<String>,
pub hide_activity: Option<bool>,
/// Privacy
pub hide_email: Option<bool>,
pub language: Option<String>,
pub location: Option<String>,
+ pub pronouns: Option<String>,
pub theme: Option<String>,
pub website: Option<String>,
}
@@ -2593,7 +2638,7 @@ pub struct ChangedFileListHeaders {
pub x_page: Option<u64>,
pub x_page_count: Option<u64>,
pub x_per_page: Option<u64>,
- pub x_total: Option<u64>,
+ pub x_total_count: Option<u64>,
}
impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders {
@@ -2632,8 +2677,8 @@ impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders {
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
- let x_total = map
- .get("X-Total")
+ let x_total_count = map
+ .get("X-Total-Count")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
@@ -2645,7 +2690,7 @@ impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders {
x_page,
x_page_count,
x_per_page,
- x_total,
+ x_total_count,
})
}
}
@@ -2712,6 +2757,25 @@ impl TryFrom<&reqwest::header::HeaderMap> for CommitListHeaders {
}
}
+pub struct RegistrationTokenHeaders {
+ pub token: Option<String>,
+}
+
+impl TryFrom<&reqwest::header::HeaderMap> for RegistrationTokenHeaders {
+ type Error = StructureError;
+
+ fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
+ let token = map
+ .get("token")
+ .map(|s| -> Result<_, _> {
+ let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
+ Ok(s.to_string())
+ })
+ .transpose()?;
+ Ok(Self { token })
+ }
+}
+
pub struct ErrorHeaders {
pub message: Option<String>,
pub url: Option<String>,
@@ -2796,6 +2860,33 @@ impl TryFrom<&reqwest::header::HeaderMap> for InvalidTopicsErrorHeaders {
}
}
+pub struct RepoArchivedErrorHeaders {
+ pub message: Option<String>,
+ pub url: Option<String>,
+}
+
+impl TryFrom<&reqwest::header::HeaderMap> for RepoArchivedErrorHeaders {
+ type Error = StructureError;
+
+ fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
+ let message = map
+ .get("message")
+ .map(|s| -> Result<_, _> {
+ let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
+ Ok(s.to_string())
+ })
+ .transpose()?;
+ let url = map
+ .get("url")
+ .map(|s| -> Result<_, _> {
+ let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
+ Ok(s.to_string())
+ })
+ .transpose()?;
+ Ok(Self { message, url })
+ }
+}
+
pub struct ValidationErrorHeaders {
pub message: Option<String>,
pub url: Option<String>,
@@ -4145,7 +4236,7 @@ pub struct IssueListIssuesQuery {
pub since: Option<time::OffsetDateTime>,
/// Only show items updated before the given time. This is a timestamp in RFC 3339 format
pub before: Option<time::OffsetDateTime>,
- /// Only show items which were created by the the given user
+ /// Only show items which were created by the given user
pub created_by: Option<String>,
/// Only show items for which the given user is assigned
pub assigned_by: Option<String>,
@@ -5078,8 +5169,6 @@ pub struct RepoListReleasesQuery {
pub draft: Option<bool>,
/// filter (exclude / include) pre-releases
pub pre_release: Option<bool>,
- /// page size of results, deprecated - use limit
- pub per_page: Option<u32>,
/// page number of results to return (1-based)
pub page: Option<u32>,
/// page size of results
@@ -5094,9 +5183,6 @@ impl std::fmt::Display for RepoListReleasesQuery {
if let Some(pre_release) = &self.pre_release {
write!(f, "pre-release={pre_release}&")?;
}
- if let Some(per_page) = &self.per_page {
- write!(f, "per_page={per_page}&")?;
- }
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
diff --git a/swagger.v1.json b/swagger.v1.json
index 576623c..36592ad 100644
--- a/swagger.v1.json
+++ b/swagger.v1.json
@@ -10,7 +10,7 @@
"name": "MIT",
"url": "http://opensource.org/licenses/MIT"
},
- "version": "1.21.2+1-73-gfedce17"
+ "version": "7.0.0+gitea-1.22.0"
},
"basePath": "/api/v1",
"paths": {
@@ -331,6 +331,19 @@
}
}
},
+ "/admin/runners/registration-token": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["admin"],
+ "summary": "Get an global actions runner registration token",
+ "operationId": "adminGetRunnerRegistrationToken",
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
"/admin/unadopted": {
"get": {
"produces": ["application/json"],
@@ -567,6 +580,9 @@
"200": {
"$ref": "#/responses/User"
},
+ "400": {
+ "$ref": "#/responses/error"
+ },
"403": {
"$ref": "#/responses/forbidden"
},
@@ -994,7 +1010,7 @@
"type": "string"
},
"collectionFormat": "multi",
- "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned.",
+ "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.",
"name": "status-types",
"in": "query"
},
@@ -1336,6 +1352,28 @@
}
}
},
+ "/orgs/{org}/actions/runners/registration-token": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["organization"],
+ "summary": "Get an organization's actions runner registration token",
+ "operationId": "orgGetRunnerRegistrationToken",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
"/orgs/{org}/actions/secrets": {
"get": {
"produces": ["application/json"],
@@ -3188,7 +3226,7 @@
"get": {
"produces": [
"application/octet-stream",
- "application/zip,",
+ "application/zip",
"application/gzip"
],
"tags": ["repository"],
@@ -3397,6 +3435,9 @@
},
"422": {
"$ref": "#/responses/validationError"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -3521,6 +3562,9 @@
},
"422": {
"$ref": "#/responses/validationError"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -3606,6 +3650,9 @@
},
"409": {
"description": "The branch with the same name already exists."
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -3685,6 +3732,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -4118,6 +4168,45 @@
}
}
},
+ "/repos/{owner}/{repo}/commits/{sha}/pull": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Get the pull request of the commit",
+ "operationId": "repoGetCommitPullRequest",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "SHA of the commit to get",
+ "name": "sha",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PullRequest"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/contents": {
"get": {
"produces": ["application/json"],
@@ -4197,6 +4286,9 @@
},
"422": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -4294,6 +4386,9 @@
},
"422": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
},
@@ -4346,6 +4441,9 @@
},
"422": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
},
@@ -4398,6 +4496,9 @@
},
"404": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -4439,6 +4540,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -4488,6 +4592,236 @@
}
}
},
+ "/repos/{owner}/{repo}/flags": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "List a repository's flags",
+ "operationId": "repoListFlags",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/StringSlice"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "put": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Replace all flags of a repository",
+ "operationId": "repoReplaceAllFlags",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/ReplaceFlagsOption"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Remove all flags from a repository",
+ "operationId": "repoDeleteAllFlags",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/flags/{flag}": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Check if a repository has a given flag",
+ "operationId": "repoCheckFlag",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the flag",
+ "name": "flag",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "put": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Add a flag to a repository",
+ "operationId": "repoAddFlag",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the flag",
+ "name": "flag",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Remove a flag from a repository",
+ "operationId": "repoDeleteFlag",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the flag",
+ "name": "flag",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/forks": {
"get": {
"produces": ["application/json"],
@@ -5522,7 +5856,7 @@
},
{
"type": "string",
- "description": "Only show items which were created by the the given user",
+ "description": "Only show items which were created by the given user",
"name": "created_by",
"in": "query"
},
@@ -5604,6 +5938,9 @@
},
"422": {
"$ref": "#/responses/validationError"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -5801,6 +6138,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -5903,6 +6243,9 @@
},
"404": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -5997,6 +6340,9 @@
},
"404": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
},
@@ -6051,6 +6397,9 @@
},
"404": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -6462,6 +6811,9 @@
},
"404": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -6556,6 +6908,9 @@
},
"404": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
},
@@ -6610,6 +6965,9 @@
},
"404": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -6852,6 +7210,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -7108,6 +7469,9 @@
},
"404": {
"description": "the issue does not exist"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
},
@@ -7152,6 +7516,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -9102,7 +9469,7 @@
"type": "string"
},
"collectionFormat": "multi",
- "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread \u0026 pinned",
+ "description": "Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned",
"name": "status-types",
"in": "query"
},
@@ -9331,6 +9698,9 @@
},
"422": {
"$ref": "#/responses/validationError"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -9367,6 +9737,52 @@
}
}
},
+ "/repos/{owner}/{repo}/pulls/{base}/{head}": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Get a pull request by base and head",
+ "operationId": "repoGetPullRequestByBaseHead",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "base of the pull request to get",
+ "name": "base",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "head of the pull request to get",
+ "name": "head",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PullRequest"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/pulls/{index}": {
"get": {
"produces": ["application/json"],
@@ -9735,6 +10151,9 @@
},
"409": {
"$ref": "#/responses/error"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
},
@@ -9776,6 +10195,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -9871,6 +10293,9 @@
"204": {
"$ref": "#/responses/empty"
},
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
"404": {
"$ref": "#/responses/notFound"
},
@@ -10181,6 +10606,179 @@
"$ref": "#/responses/notFound"
}
}
+ },
+ "post": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Add a new comment to a pull request review",
+ "operationId": "repoCreatePullReviewComment",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "index of the pull request",
+ "name": "index",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "id of the review",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/CreatePullReviewCommentOptions"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PullReviewComment"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ },
+ "422": {
+ "$ref": "#/responses/validationError"
+ }
+ }
+ }
+ },
+ "/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Get a pull review comment",
+ "operationId": "repoGetPullReviewComment",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "index of the pull request",
+ "name": "index",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "id of the review",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "id of the comment",
+ "name": "comment",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/PullReviewComment"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
+ },
+ "delete": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Delete a pull review comment",
+ "operationId": "repoDeletePullReviewComment",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "index of the pull request",
+ "name": "index",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "id of the review",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "integer",
+ "format": "int64",
+ "description": "id of the comment",
+ "name": "comment",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "$ref": "#/responses/empty"
+ },
+ "403": {
+ "$ref": "#/responses/forbidden"
+ },
+ "404": {
+ "$ref": "#/responses/notFound"
+ }
+ }
}
},
"/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals": {
@@ -10652,12 +11250,6 @@
},
{
"type": "integer",
- "description": "page size of results, deprecated - use limit",
- "name": "per_page",
- "in": "query"
- },
- {
- "type": "integer",
"description": "page number of results to return (1-based)",
"name": "page",
"in": "query"
@@ -10996,7 +11588,7 @@
}
},
"post": {
- "consumes": ["multipart/form-data"],
+ "consumes": ["multipart/form-data", "application/octet-stream"],
"produces": ["application/json"],
"tags": ["repository"],
"summary": "Create a release attachment",
@@ -11034,8 +11626,7 @@
"type": "file",
"description": "attachment to upload",
"name": "attachment",
- "in": "formData",
- "required": true
+ "in": "formData"
}
],
"responses": {
@@ -11231,6 +11822,35 @@
}
}
},
+ "/repos/{owner}/{repo}/runners/registration-token": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["repository"],
+ "summary": "Get a repository's actions runner registration token",
+ "operationId": "repoGetRunnerRegistrationToken",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "owner of the repo",
+ "name": "owner",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "name of the repo",
+ "name": "repo",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/signing-key.gpg": {
"get": {
"produces": ["text/plain"],
@@ -11644,6 +12264,9 @@
},
"409": {
"$ref": "#/responses/conflict"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -11726,6 +12349,9 @@
},
"409": {
"$ref": "#/responses/conflict"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -12330,6 +12956,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -12408,6 +13037,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
},
@@ -12458,6 +13090,9 @@
},
"404": {
"$ref": "#/responses/notFound"
+ },
+ "423": {
+ "$ref": "#/responses/repoArchivedError"
}
}
}
@@ -13166,6 +13801,19 @@
}
}
},
+ "/user/actions/runners/registration-token": {
+ "get": {
+ "produces": ["application/json"],
+ "tags": ["user"],
+ "summary": "Get an user's actions runner registration token",
+ "operationId": "userGetRunnerRegistrationToken",
+ "responses": {
+ "200": {
+ "$ref": "#/responses/RegistrationToken"
+ }
+ }
+ }
+ },
"/user/actions/secrets/{secretname}": {
"put": {
"consumes": ["application/json"],
@@ -15355,6 +16003,10 @@
"description": "BranchProtection represents a branch protection for a repository",
"type": "object",
"properties": {
+ "apply_to_admins": {
+ "type": "boolean",
+ "x-go-name": "ApplyToAdmins"
+ },
"approvals_whitelist_teams": {
"type": "array",
"items": {
@@ -15415,6 +16067,10 @@
"type": "boolean",
"x-go-name": "EnableStatusCheck"
},
+ "ignore_stale_approvals": {
+ "type": "boolean",
+ "x-go-name": "IgnoreStaleApprovals"
+ },
"merge_whitelist_teams": {
"type": "array",
"items": {
@@ -15990,6 +16646,10 @@
"description": "CreateBranchProtectionOption options for creating a branch protection",
"type": "object",
"properties": {
+ "apply_to_admins": {
+ "type": "boolean",
+ "x-go-name": "ApplyToAdmins"
+ },
"approvals_whitelist_teams": {
"type": "array",
"items": {
@@ -16045,6 +16705,10 @@
"type": "boolean",
"x-go-name": "EnableStatusCheck"
},
+ "ignore_stale_approvals": {
+ "type": "boolean",
+ "x-go-name": "IgnoreStaleApprovals"
+ },
"merge_whitelist_teams": {
"type": "array",
"items": {
@@ -16593,6 +17257,10 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "CreatePullReviewCommentOptions": {
+ "description": "CreatePullReviewCommentOptions are options to create a pull review comment",
+ "$ref": "#/definitions/CreatePullReviewComment"
+ },
"CreatePullReviewOptions": {
"description": "CreatePullReviewOptions are options to create a pull review",
"type": "object",
@@ -17097,6 +17765,10 @@
"description": "EditBranchProtectionOption options for editing a branch protection",
"type": "object",
"properties": {
+ "apply_to_admins": {
+ "type": "boolean",
+ "x-go-name": "ApplyToAdmins"
+ },
"approvals_whitelist_teams": {
"type": "array",
"items": {
@@ -17147,6 +17819,10 @@
"type": "boolean",
"x-go-name": "EnableStatusCheck"
},
+ "ignore_stale_approvals": {
+ "type": "boolean",
+ "x-go-name": "IgnoreStaleApprovals"
+ },
"merge_whitelist_teams": {
"type": "array",
"items": {
@@ -17531,6 +18207,11 @@
"description": "EditRepoOption options when editing a repository's properties",
"type": "object",
"properties": {
+ "allow_fast_forward_only_merge": {
+ "description": "either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging.",
+ "type": "boolean",
+ "x-go-name": "AllowFastForwardOnly"
+ },
"allow_manual_merge": {
"description": "either `true` to allow mark pr as merged manually, or `false` to prevent it.",
"type": "boolean",
@@ -17587,7 +18268,7 @@
"x-go-name": "DefaultDeleteBranchAfterMerge"
},
"default_merge_style": {
- "description": "set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", or \"squash\".",
+ "description": "set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", \"squash\", or \"fast-forward-only\".",
"type": "string",
"x-go-name": "DefaultMergeStyle"
},
@@ -17675,6 +18356,11 @@
"description": "a URL with more information about the repository.",
"type": "string",
"x-go-name": "Website"
+ },
+ "wiki_branch": {
+ "description": "sets the branch used for this repository's wiki.",
+ "type": "string",
+ "x-go-name": "WikiBranch"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -17805,6 +18491,10 @@
"type": "boolean",
"x-go-name": "ProhibitLogin"
},
+ "pronouns": {
+ "type": "string",
+ "x-go-name": "Pronouns"
+ },
"restricted": {
"type": "boolean",
"x-go-name": "Restricted"
@@ -18147,6 +18837,10 @@
"description": "GeneralRepoSettings contains global repository settings exposed by API",
"type": "object",
"properties": {
+ "forks_disabled": {
+ "type": "boolean",
+ "x-go-name": "ForksDisabled"
+ },
"http_git_disabled": {
"type": "boolean",
"x-go-name": "HTTPGitDisabled"
@@ -18434,12 +19128,17 @@
"x-go-name": "BranchFilter"
},
"config": {
+ "description": "Deprecated: use Metadata instead",
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-go-name": "Config"
},
+ "content_type": {
+ "type": "string",
+ "x-go-name": "ContentType"
+ },
"created_at": {
"type": "string",
"format": "date-time",
@@ -18457,6 +19156,9 @@
"format": "int64",
"x-go-name": "ID"
},
+ "metadata": {
+ "x-go-name": "Metadata"
+ },
"type": {
"type": "string",
"x-go-name": "Type"
@@ -18465,6 +19167,10 @@
"type": "string",
"format": "date-time",
"x-go-name": "Updated"
+ },
+ "url": {
+ "type": "string",
+ "x-go-name": "URL"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -18707,6 +19413,13 @@
"type": "object",
"additionalProperties": {},
"x-go-name": "Validations"
+ },
+ "visible": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/IssueFormFieldVisible"
+ },
+ "x-go-name": "Visible"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -18716,6 +19429,11 @@
"title": "IssueFormFieldType defines issue form field type, can be \"markdown\", \"textarea\", \"input\", \"dropdown\" or \"checkboxes\"",
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "IssueFormFieldVisible": {
+ "description": "IssueFormFieldVisible defines issue form field visible",
+ "type": "string",
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"IssueLabelsOption": {
"description": "IssueLabelsOption a collection of labels",
"type": "object",
@@ -18977,6 +19695,7 @@
"rebase",
"rebase-merge",
"squash",
+ "fast-forward-only",
"manually-merged"
]
},
@@ -19934,6 +20653,10 @@
"description": "PullRequestMeta PR info if an issue is a PR",
"type": "object",
"properties": {
+ "draft": {
+ "type": "boolean",
+ "x-go-name": "IsWorkInProgress"
+ },
"merged": {
"type": "boolean",
"x-go-name": "HasMerged"
@@ -20108,6 +20831,7 @@
"properties": {
"created": {
"type": "string",
+ "format": "date-time",
"x-go-name": "CreatedUnix"
},
"interval": {
@@ -20120,6 +20844,7 @@
},
"last_update": {
"type": "string",
+ "format": "date-time",
"x-go-name": "LastUpdateUnix"
},
"remote_address": {
@@ -20268,6 +20993,20 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ReplaceFlagsOption": {
+ "description": "ReplaceFlagsOption options when replacing the flags of a repository",
+ "type": "object",
+ "properties": {
+ "flags": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "x-go-name": "Flags"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"RepoCollaboratorPermission": {
"description": "RepoCollaboratorPermission to get repository permission for a collaborator",
"type": "object",
@@ -20352,6 +21091,10 @@
"description": "Repository represents a repository",
"type": "object",
"properties": {
+ "allow_fast_forward_only_merge": {
+ "type": "boolean",
+ "x-go-name": "AllowFastForwardOnly"
+ },
"allow_merge_commits": {
"type": "boolean",
"x-go-name": "AllowMerge"
@@ -20584,6 +21327,10 @@
"website": {
"type": "string",
"x-go-name": "Website"
+ },
+ "wiki_branch": {
+ "type": "string",
+ "x-go-name": "WikiBranch"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -21217,6 +21964,11 @@
"type": "boolean",
"x-go-name": "ProhibitLogin"
},
+ "pronouns": {
+ "description": "the user's pronouns",
+ "type": "string",
+ "x-go-name": "Pronouns"
+ },
"restricted": {
"description": "Is user restricted",
"type": "boolean",
@@ -21267,6 +22019,10 @@
"type": "string",
"x-go-name": "DiffViewStyle"
},
+ "enable_repo_unit_hints": {
+ "type": "boolean",
+ "x-go-name": "EnableRepoUnitHints"
+ },
"full_name": {
"type": "string",
"x-go-name": "FullName"
@@ -21288,6 +22044,10 @@
"type": "string",
"x-go-name": "Location"
},
+ "pronouns": {
+ "type": "string",
+ "x-go-name": "Pronouns"
+ },
"theme": {
"type": "string",
"x-go-name": "Theme"
@@ -21311,6 +22071,10 @@
"type": "string",
"x-go-name": "DiffViewStyle"
},
+ "enable_repo_unit_hints": {
+ "type": "boolean",
+ "x-go-name": "EnableRepoUnitHints"
+ },
"full_name": {
"type": "string",
"x-go-name": "FullName"
@@ -21332,6 +22096,10 @@
"type": "string",
"x-go-name": "Location"
},
+ "pronouns": {
+ "type": "string",
+ "x-go-name": "Pronouns"
+ },
"theme": {
"type": "string",
"x-go-name": "Theme"
@@ -21596,7 +22364,7 @@
"format": "int64",
"description": "Commits per page"
},
- "X-Total": {
+ "X-Total-Count": {
"type": "integer",
"format": "int64",
"description": "Total commit count"
@@ -22161,6 +22929,14 @@
}
}
},
+ "RegistrationToken": {
+ "description": "RegistrationToken is a string used to register a runner with a server",
+ "headers": {
+ "token": {
+ "type": "string"
+ }
+ }
+ },
"Release": {
"description": "Release",
"schema": {
@@ -22449,6 +23225,17 @@
"redirect": {
"description": "APIRedirect is a redirect response"
},
+ "repoArchivedError": {
+ "description": "APIRepoArchivedError is an error that is raised when an archived repo should be modified",
+ "headers": {
+ "message": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
"string": {
"description": "APIString is a string response",
"schema": {
@@ -22469,6 +23256,7 @@
},
"securityDefinitions": {
"AccessToken": {
+ "description": "This authentication option is deprecated for removal in Gitea 1.23. Please use AuthorizationHeaderToken instead.",
"type": "apiKey",
"name": "access_token",
"in": "query"
@@ -22501,6 +23289,7 @@
"in": "header"
},
"Token": {
+ "description": "This authentication option is deprecated for removal in Gitea 1.23. Please use AuthorizationHeaderToken instead.",
"type": "apiKey",
"name": "token",
"in": "query"