Synchronizing API and documentation updates

This commit is contained in:
gitnexbot
2025-06-26 00:10:47 +00:00
parent bb15c76872
commit 7174da2f95
14 changed files with 414 additions and 31 deletions
@@ -26,6 +26,7 @@ import org.gitnex.tea4j.v2.models.CombinedStatus;
import org.gitnex.tea4j.v2.models.Commit;
import org.gitnex.tea4j.v2.models.CommitStatus;
import org.gitnex.tea4j.v2.models.Compare;
import org.gitnex.tea4j.v2.models.ContentsExtResponse;
import org.gitnex.tea4j.v2.models.ContentsResponse;
import org.gitnex.tea4j.v2.models.CreateActionWorkflowDispatch;
import org.gitnex.tea4j.v2.models.CreateBranchProtectionOption;
@@ -1666,7 +1667,8 @@ public interface RepositoryApi {
/**
* Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if
* a dir
* a dir. This API follows GitHub's design, and it is not easy to use. Recommend users to use
* the \"contents-ext\" API instead.
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
@@ -1683,7 +1685,35 @@ public interface RepositoryApi {
@retrofit2.http.Query("ref") String ref);
/**
* Gets the metadata of all the entries of the root dir
* The extended \"contents\" API, to get file metadata and/or content, or list a
* directory. It guarantees that only one of the response fields is set if the request succeeds.
* Users can pass \"includes=file_content\" or
* \"includes=lfs_metadata\" to retrieve more fields.
* \"includes=file_content\" only works for single file, if you need to retrieve
* file contents in batch, use \"file-contents\" API after listing the directory.
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @param filepath path of the dir, file, symlink or submodule in the repo (required)
* @param ref the name of the commit/branch/tag, default to the repositorys default branch.
* (optional)
* @param includes By default this API's response only contains file's metadata. Use
* comma-separated \"includes\" options to retrieve more fields. Option
* \"file_content\" will try to retrieve the file content, option
* \"lfs_metadata\" will try to retrieve LFS metadata. (optional)
* @return Call<ContentsExtResponse>
*/
@GET("repos/{owner}/{repo}/contents-ext/{filepath}")
Call<ContentsExtResponse> repoGetContentsExt(
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("filepath") String filepath,
@retrofit2.http.Query("ref") String ref,
@retrofit2.http.Query("includes") String includes);
/**
* Gets the metadata of all the entries of the root dir. This API follows GitHub&#x27;s design,
* and it is not easy to use. Recommend users to use our \&quot;contents-ext\&quot; API instead.
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
@@ -1716,7 +1746,7 @@ public interface RepositoryApi {
/**
* Get the metadata and contents of requested files See the POST method. This GET method supports
* to use JSON encoded request body in query parameter.
* using JSON encoded request body in query parameter.
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
@@ -2001,7 +2031,7 @@ public interface RepositoryApi {
* @param repo name of the repo (required)
* @param filepath path of the file to get, it should be \&quot;{ref}/{filepath}\&quot;. If there
* is no ref could be inferred, it will be treated as the default branch (required)
* @param ref The name of the commit/branch/tag. Default the repositorys default branch
* @param ref The name of the commit/branch/tag. Default to the repositorys default branch
* (optional)
* @return Call&lt;File&gt;
*/
@@ -2019,7 +2049,7 @@ public interface RepositoryApi {
* @param repo name of the repo (required)
* @param filepath path of the file to get, it should be \&quot;{ref}/{filepath}\&quot;. If there
* is no ref could be inferred, it will be treated as the default branch (required)
* @param ref The name of the commit/branch/tag. Default the repositorys default branch
* @param ref The name of the commit/branch/tag. Default to the repositorys default branch
* (optional)
* @return Call&lt;File&gt;
*/
@@ -33,11 +33,18 @@ public class ChangeFileOperation implements Serializable {
@SerializedName("from_path")
private String fromPath = null;
/** indicates what to do with the file */
/**
* indicates what to do with the file: \&quot;create\&quot; for creating a new file,
* \&quot;update\&quot; for updating an existing file, \&quot;upload\&quot; for creating or
* updating a file, \&quot;rename\&quot; for renaming a file, and \&quot;delete\&quot; for
* deleting an existing file.
*/
@JsonAdapter(OperationEnum.Adapter.class)
public enum OperationEnum {
CREATE("create"),
UPDATE("update"),
UPLOAD("upload"),
RENAME("rename"),
DELETE("delete");
private String value;
@@ -94,11 +101,11 @@ public class ChangeFileOperation implements Serializable {
}
/**
* new or updated file content, must be base64 encoded
* new or updated file content, it must be base64 encoded
*
* @return content
*/
@Schema(description = "new or updated file content, must be base64 encoded")
@Schema(description = "new or updated file content, it must be base64 encoded")
public String getContent() {
return content;
}
@@ -132,11 +139,19 @@ public class ChangeFileOperation implements Serializable {
}
/**
* indicates what to do with the file
* indicates what to do with the file: \&quot;create\&quot; for creating a new file,
* \&quot;update\&quot; for updating an existing file, \&quot;upload\&quot; for creating or
* updating a file, \&quot;rename\&quot; for renaming a file, and \&quot;delete\&quot; for
* deleting an existing file.
*
* @return operation
*/
@Schema(required = true, description = "indicates what to do with the file")
@Schema(
required = true,
description =
"indicates what to do with the file: \"create\" for creating a new file, \"update\" for"
+ " updating an existing file, \"upload\" for creating or updating a file, \"rename\""
+ " for renaming a file, and \"delete\" for deleting an existing file.")
public OperationEnum getOperation() {
return operation;
}
@@ -170,13 +185,14 @@ public class ChangeFileOperation implements Serializable {
}
/**
* sha is the SHA for the file that already exists, required for update or delete
* the blob ID (SHA) for the file that already exists, required for changing existing files
*
* @return sha
*/
@Schema(
description =
"sha is the SHA for the file that already exists, required for update or delete")
"the blob ID (SHA) for the file that already exists, required for changing existing"
+ " files")
public String getSha() {
return sha;
}
@@ -0,0 +1,116 @@
/*
* Gitea API
* This documentation describes the Gitea API.
*
* OpenAPI spec version: {{AppVer | JSEscape}}
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package org.gitnex.tea4j.v2.models;
import com.google.gson.annotations.SerializedName;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/** ContentsExtResponse */
public class ContentsExtResponse implements Serializable {
private static final long serialVersionUID = 1L;
@SerializedName("dir_contents")
private List<ContentsResponse> dirContents = null;
@SerializedName("file_contents")
private ContentsResponse fileContents = null;
public ContentsExtResponse dirContents(List<ContentsResponse> dirContents) {
this.dirContents = dirContents;
return this;
}
public ContentsExtResponse addDirContentsItem(ContentsResponse dirContentsItem) {
if (this.dirContents == null) {
this.dirContents = new ArrayList<>();
}
this.dirContents.add(dirContentsItem);
return this;
}
/**
* Get dirContents
*
* @return dirContents
*/
@Schema(description = "")
public List<ContentsResponse> getDirContents() {
return dirContents;
}
public void setDirContents(List<ContentsResponse> dirContents) {
this.dirContents = dirContents;
}
public ContentsExtResponse fileContents(ContentsResponse fileContents) {
this.fileContents = fileContents;
return this;
}
/**
* Get fileContents
*
* @return fileContents
*/
@Schema(description = "")
public ContentsResponse getFileContents() {
return fileContents;
}
public void setFileContents(ContentsResponse fileContents) {
this.fileContents = fileContents;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContentsExtResponse contentsExtResponse = (ContentsExtResponse) o;
return Objects.equals(this.dirContents, contentsExtResponse.dirContents)
&& Objects.equals(this.fileContents, contentsExtResponse.fileContents);
}
@Override
public int hashCode() {
return Objects.hash(dirContents, fileContents);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContentsExtResponse {\n");
sb.append(" dirContents: ").append(toIndentedString(dirContents)).append("\n");
sb.append(" fileContents: ").append(toIndentedString(fileContents)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
@@ -56,6 +56,12 @@ public class ContentsResponse implements Serializable {
@SerializedName("last_committer_date")
private Date lastCommitterDate = null;
@SerializedName("lfs_oid")
private String lfsOid = null;
@SerializedName("lfs_size")
private Long lfsSize = null;
@SerializedName("name")
private String name = null;
@@ -251,6 +257,44 @@ public class ContentsResponse implements Serializable {
this.lastCommitterDate = lastCommitterDate;
}
public ContentsResponse lfsOid(String lfsOid) {
this.lfsOid = lfsOid;
return this;
}
/**
* Get lfsOid
*
* @return lfsOid
*/
@Schema(description = "")
public String getLfsOid() {
return lfsOid;
}
public void setLfsOid(String lfsOid) {
this.lfsOid = lfsOid;
}
public ContentsResponse lfsSize(Long lfsSize) {
this.lfsSize = lfsSize;
return this;
}
/**
* Get lfsSize
*
* @return lfsSize
*/
@Schema(description = "")
public Long getLfsSize() {
return lfsSize;
}
public void setLfsSize(Long lfsSize) {
this.lfsSize = lfsSize;
}
public ContentsResponse name(String name) {
this.name = name;
return this;
@@ -424,6 +468,8 @@ public class ContentsResponse implements Serializable {
&& Objects.equals(this.lastAuthorDate, contentsResponse.lastAuthorDate)
&& Objects.equals(this.lastCommitSha, contentsResponse.lastCommitSha)
&& Objects.equals(this.lastCommitterDate, contentsResponse.lastCommitterDate)
&& Objects.equals(this.lfsOid, contentsResponse.lfsOid)
&& Objects.equals(this.lfsSize, contentsResponse.lfsSize)
&& Objects.equals(this.name, contentsResponse.name)
&& Objects.equals(this.path, contentsResponse.path)
&& Objects.equals(this.sha, contentsResponse.sha)
@@ -446,6 +492,8 @@ public class ContentsResponse implements Serializable {
lastAuthorDate,
lastCommitSha,
lastCommitterDate,
lfsOid,
lfsSize,
name,
path,
sha,
@@ -470,6 +518,8 @@ public class ContentsResponse implements Serializable {
sb.append(" lastAuthorDate: ").append(toIndentedString(lastAuthorDate)).append("\n");
sb.append(" lastCommitSha: ").append(toIndentedString(lastCommitSha)).append("\n");
sb.append(" lastCommitterDate: ").append(toIndentedString(lastCommitterDate)).append("\n");
sb.append(" lfsOid: ").append(toIndentedString(lfsOid)).append("\n");
sb.append(" lfsSize: ").append(toIndentedString(lfsSize)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" path: ").append(toIndentedString(path)).append("\n");
sb.append(" sha: ").append(toIndentedString(sha)).append("\n");
@@ -181,11 +181,15 @@ public class DeleteFileOptions implements Serializable {
}
/**
* sha is the SHA for the file that already exists
* the blob ID (SHA) for the file that already exists, it is required for changing existing files
*
* @return sha
*/
@Schema(required = true, description = "sha is the SHA for the file that already exists")
@Schema(
required = true,
description =
"the blob ID (SHA) for the file that already exists, it is required for changing existing"
+ " files")
public String getSha() {
return sha;
}
@@ -28,6 +28,12 @@ public class GitBlobResponse implements Serializable {
@SerializedName("encoding")
private String encoding = null;
@SerializedName("lfs_oid")
private String lfsOid = null;
@SerializedName("lfs_size")
private Long lfsSize = null;
@SerializedName("sha")
private String sha = null;
@@ -75,6 +81,44 @@ public class GitBlobResponse implements Serializable {
this.encoding = encoding;
}
public GitBlobResponse lfsOid(String lfsOid) {
this.lfsOid = lfsOid;
return this;
}
/**
* Get lfsOid
*
* @return lfsOid
*/
@Schema(description = "")
public String getLfsOid() {
return lfsOid;
}
public void setLfsOid(String lfsOid) {
this.lfsOid = lfsOid;
}
public GitBlobResponse lfsSize(Long lfsSize) {
this.lfsSize = lfsSize;
return this;
}
/**
* Get lfsSize
*
* @return lfsSize
*/
@Schema(description = "")
public Long getLfsSize() {
return lfsSize;
}
public void setLfsSize(Long lfsSize) {
this.lfsSize = lfsSize;
}
public GitBlobResponse sha(String sha) {
this.sha = sha;
return this;
@@ -143,6 +187,8 @@ public class GitBlobResponse implements Serializable {
GitBlobResponse gitBlobResponse = (GitBlobResponse) o;
return Objects.equals(this.content, gitBlobResponse.content)
&& Objects.equals(this.encoding, gitBlobResponse.encoding)
&& Objects.equals(this.lfsOid, gitBlobResponse.lfsOid)
&& Objects.equals(this.lfsSize, gitBlobResponse.lfsSize)
&& Objects.equals(this.sha, gitBlobResponse.sha)
&& Objects.equals(this.size, gitBlobResponse.size)
&& Objects.equals(this.url, gitBlobResponse.url);
@@ -150,7 +196,7 @@ public class GitBlobResponse implements Serializable {
@Override
public int hashCode() {
return Objects.hash(content, encoding, sha, size, url);
return Objects.hash(content, encoding, lfsOid, lfsSize, sha, size, url);
}
@Override
@@ -160,6 +206,8 @@ public class GitBlobResponse implements Serializable {
sb.append(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n");
sb.append(" lfsOid: ").append(toIndentedString(lfsOid)).append("\n");
sb.append(" lfsSize: ").append(toIndentedString(lfsSize)).append("\n");
sb.append(" sha: ").append(toIndentedString(sha)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
@@ -229,11 +229,15 @@ public class UpdateFileOptions implements Serializable {
}
/**
* sha is the SHA for the file that already exists
* the blob ID (SHA) for the file that already exists, it is required for changing existing files
*
* @return sha
*/
@Schema(required = true, description = "sha is the SHA for the file that already exists")
@Schema(
required = true,
description =
"the blob ID (SHA) for the file that already exists, it is required for changing existing"
+ " files")
public String getSha() {
return sha;
}