mirror of
https://codeberg.org/gitnex/tea4j-autodeploy
synced 2026-06-04 08:42:18 +00:00
Synchronizing API and documentation updates
This commit is contained in:
@@ -11,6 +11,7 @@ import org.gitnex.tea4j.v2.models.AnnotatedTag;
|
||||
import org.gitnex.tea4j.v2.models.Attachment;
|
||||
import org.gitnex.tea4j.v2.models.Branch;
|
||||
import org.gitnex.tea4j.v2.models.BranchProtection;
|
||||
import org.gitnex.tea4j.v2.models.ChangeFilesOptions;
|
||||
import org.gitnex.tea4j.v2.models.ChangedFile;
|
||||
import org.gitnex.tea4j.v2.models.CombinedStatus;
|
||||
import org.gitnex.tea4j.v2.models.Commit;
|
||||
@@ -42,6 +43,7 @@ import org.gitnex.tea4j.v2.models.EditReleaseOption;
|
||||
import org.gitnex.tea4j.v2.models.EditRepoOption;
|
||||
import org.gitnex.tea4j.v2.models.FileDeleteResponse;
|
||||
import org.gitnex.tea4j.v2.models.FileResponse;
|
||||
import org.gitnex.tea4j.v2.models.FilesResponse;
|
||||
import org.gitnex.tea4j.v2.models.GenerateRepoOption;
|
||||
import org.gitnex.tea4j.v2.models.GitBlobResponse;
|
||||
import org.gitnex.tea4j.v2.models.GitHook;
|
||||
@@ -300,6 +302,21 @@ public interface RepositoryApi {
|
||||
@retrofit2.http.Path("repo") String repo,
|
||||
@retrofit2.http.Path("index") Long index);
|
||||
|
||||
/**
|
||||
* Create or update multiple files in a repository
|
||||
*
|
||||
* @param body (required)
|
||||
* @param owner owner of the repo (required)
|
||||
* @param repo name of the repo (required)
|
||||
* @return Call<FilesResponse>
|
||||
*/
|
||||
@Headers({"Content-Type:application/json"})
|
||||
@POST("repos/{owner}/{repo}/contents")
|
||||
Call<FilesResponse> repoChangeFiles(
|
||||
@retrofit2.http.Body ChangeFilesOptions body,
|
||||
@retrofit2.http.Path("owner") String owner,
|
||||
@retrofit2.http.Path("repo") String repo);
|
||||
|
||||
/**
|
||||
* Check if a user is a collaborator of a repository
|
||||
*
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* Gitea API.
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* OpenAPI spec version: {{AppVer | JSEscape | Safe}}
|
||||
*
|
||||
*
|
||||
* 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.TypeAdapter;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/** ChangeFileOperation for creating, updating or deleting a file */
|
||||
@Schema(description = "ChangeFileOperation for creating, updating or deleting a file")
|
||||
public class ChangeFileOperation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("content")
|
||||
private String content = null;
|
||||
|
||||
@SerializedName("from_path")
|
||||
private String fromPath = null;
|
||||
|
||||
/** indicates what to do with the file */
|
||||
@JsonAdapter(OperationEnum.Adapter.class)
|
||||
public enum OperationEnum {
|
||||
CREATE("create"),
|
||||
UPDATE("update"),
|
||||
DELETE("delete");
|
||||
|
||||
private String value;
|
||||
|
||||
OperationEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
public static OperationEnum fromValue(String input) {
|
||||
for (OperationEnum b : OperationEnum.values()) {
|
||||
if (b.value.equals(input)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class Adapter extends TypeAdapter<OperationEnum> {
|
||||
@Override
|
||||
public void write(final JsonWriter jsonWriter, final OperationEnum enumeration)
|
||||
throws IOException {
|
||||
jsonWriter.value(String.valueOf(enumeration.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperationEnum read(final JsonReader jsonReader) throws IOException {
|
||||
Object value = jsonReader.nextString();
|
||||
return OperationEnum.fromValue((String) (value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("operation")
|
||||
private OperationEnum operation = null;
|
||||
|
||||
@SerializedName("path")
|
||||
private String path = null;
|
||||
|
||||
@SerializedName("sha")
|
||||
private String sha = null;
|
||||
|
||||
public ChangeFileOperation content(String content) {
|
||||
this.content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* content must be base64 encoded
|
||||
*
|
||||
* @return content
|
||||
*/
|
||||
@Schema(required = true, description = "content must be base64 encoded")
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public ChangeFileOperation fromPath(String fromPath) {
|
||||
this.fromPath = fromPath;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* old path of the file to move
|
||||
*
|
||||
* @return fromPath
|
||||
*/
|
||||
@Schema(description = "old path of the file to move")
|
||||
public String getFromPath() {
|
||||
return fromPath;
|
||||
}
|
||||
|
||||
public void setFromPath(String fromPath) {
|
||||
this.fromPath = fromPath;
|
||||
}
|
||||
|
||||
public ChangeFileOperation operation(OperationEnum operation) {
|
||||
this.operation = operation;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* indicates what to do with the file
|
||||
*
|
||||
* @return operation
|
||||
*/
|
||||
@Schema(required = true, description = "indicates what to do with the file")
|
||||
public OperationEnum getOperation() {
|
||||
return operation;
|
||||
}
|
||||
|
||||
public void setOperation(OperationEnum operation) {
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
public ChangeFileOperation path(String path) {
|
||||
this.path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* path to the existing or new file
|
||||
*
|
||||
* @return path
|
||||
*/
|
||||
@Schema(description = "path to the existing or new file")
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public ChangeFileOperation sha(String sha) {
|
||||
this.sha = sha;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* sha is the SHA for the file that already exists, required for update, delete
|
||||
*
|
||||
* @return sha
|
||||
*/
|
||||
@Schema(
|
||||
description = "sha is the SHA for the file that already exists, required for update, delete")
|
||||
public String getSha() {
|
||||
return sha;
|
||||
}
|
||||
|
||||
public void setSha(String sha) {
|
||||
this.sha = sha;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ChangeFileOperation changeFileOperation = (ChangeFileOperation) o;
|
||||
return Objects.equals(this.content, changeFileOperation.content)
|
||||
&& Objects.equals(this.fromPath, changeFileOperation.fromPath)
|
||||
&& Objects.equals(this.operation, changeFileOperation.operation)
|
||||
&& Objects.equals(this.path, changeFileOperation.path)
|
||||
&& Objects.equals(this.sha, changeFileOperation.sha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(content, fromPath, operation, path, sha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ChangeFileOperation {\n");
|
||||
|
||||
sb.append(" content: ").append(toIndentedString(content)).append("\n");
|
||||
sb.append(" fromPath: ").append(toIndentedString(fromPath)).append("\n");
|
||||
sb.append(" operation: ").append(toIndentedString(operation)).append("\n");
|
||||
sb.append(" path: ").append(toIndentedString(path)).append("\n");
|
||||
sb.append(" sha: ").append(toIndentedString(sha)).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 ");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
/*
|
||||
* Gitea API.
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* OpenAPI spec version: {{AppVer | JSEscape | Safe}}
|
||||
*
|
||||
*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* ChangeFilesOptions options for creating, updating or deleting multiple files Note:
|
||||
* `author` and `committer` are optional (if only one is given, it will be used
|
||||
* for the other, otherwise the authenticated user will be used)
|
||||
*/
|
||||
@Schema(
|
||||
description =
|
||||
"ChangeFilesOptions options for creating, updating or deleting multiple files Note:"
|
||||
+ " `author` and `committer` are optional (if only one is given, it will be used for"
|
||||
+ " the other, otherwise the authenticated user will be used)")
|
||||
public class ChangeFilesOptions implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("author")
|
||||
private Identity author = null;
|
||||
|
||||
@SerializedName("branch")
|
||||
private String branch = null;
|
||||
|
||||
@SerializedName("committer")
|
||||
private Identity committer = null;
|
||||
|
||||
@SerializedName("dates")
|
||||
private CommitDateOptions dates = null;
|
||||
|
||||
@SerializedName("files")
|
||||
private List<ChangeFileOperation> files = null;
|
||||
|
||||
@SerializedName("message")
|
||||
private String message = null;
|
||||
|
||||
@SerializedName("new_branch")
|
||||
private String newBranch = null;
|
||||
|
||||
@SerializedName("signoff")
|
||||
private Boolean signoff = null;
|
||||
|
||||
public ChangeFilesOptions author(Identity author) {
|
||||
this.author = author;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get author
|
||||
*
|
||||
* @return author
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public Identity getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(Identity author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions branch(String branch) {
|
||||
this.branch = branch;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* branch (optional) to base this file from. if not given, the default branch is used
|
||||
*
|
||||
* @return branch
|
||||
*/
|
||||
@Schema(
|
||||
description =
|
||||
"branch (optional) to base this file from. if not given, the default branch is used")
|
||||
public String getBranch() {
|
||||
return branch;
|
||||
}
|
||||
|
||||
public void setBranch(String branch) {
|
||||
this.branch = branch;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions committer(Identity committer) {
|
||||
this.committer = committer;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get committer
|
||||
*
|
||||
* @return committer
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public Identity getCommitter() {
|
||||
return committer;
|
||||
}
|
||||
|
||||
public void setCommitter(Identity committer) {
|
||||
this.committer = committer;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions dates(CommitDateOptions dates) {
|
||||
this.dates = dates;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dates
|
||||
*
|
||||
* @return dates
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public CommitDateOptions getDates() {
|
||||
return dates;
|
||||
}
|
||||
|
||||
public void setDates(CommitDateOptions dates) {
|
||||
this.dates = dates;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions files(List<ChangeFileOperation> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions addFilesItem(ChangeFileOperation filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
*
|
||||
* @return files
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public List<ChangeFileOperation> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<ChangeFileOperation> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* message (optional) for the commit of this file. if not supplied, a default message will be used
|
||||
*
|
||||
* @return message
|
||||
*/
|
||||
@Schema(
|
||||
description =
|
||||
"message (optional) for the commit of this file. if not supplied, a default message will"
|
||||
+ " be used")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions newBranch(String newBranch) {
|
||||
this.newBranch = newBranch;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* new_branch (optional) will make a new branch from `branch` before creating the file
|
||||
*
|
||||
* @return newBranch
|
||||
*/
|
||||
@Schema(
|
||||
description =
|
||||
"new_branch (optional) will make a new branch from `branch` before creating the file")
|
||||
public String getNewBranch() {
|
||||
return newBranch;
|
||||
}
|
||||
|
||||
public void setNewBranch(String newBranch) {
|
||||
this.newBranch = newBranch;
|
||||
}
|
||||
|
||||
public ChangeFilesOptions signoff(Boolean signoff) {
|
||||
this.signoff = signoff;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Signed-off-by trailer by the committer at the end of the commit log message.
|
||||
*
|
||||
* @return signoff
|
||||
*/
|
||||
@Schema(
|
||||
description =
|
||||
"Add a Signed-off-by trailer by the committer at the end of the commit log message.")
|
||||
public Boolean isSignoff() {
|
||||
return signoff;
|
||||
}
|
||||
|
||||
public void setSignoff(Boolean signoff) {
|
||||
this.signoff = signoff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ChangeFilesOptions changeFilesOptions = (ChangeFilesOptions) o;
|
||||
return Objects.equals(this.author, changeFilesOptions.author)
|
||||
&& Objects.equals(this.branch, changeFilesOptions.branch)
|
||||
&& Objects.equals(this.committer, changeFilesOptions.committer)
|
||||
&& Objects.equals(this.dates, changeFilesOptions.dates)
|
||||
&& Objects.equals(this.files, changeFilesOptions.files)
|
||||
&& Objects.equals(this.message, changeFilesOptions.message)
|
||||
&& Objects.equals(this.newBranch, changeFilesOptions.newBranch)
|
||||
&& Objects.equals(this.signoff, changeFilesOptions.signoff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(author, branch, committer, dates, files, message, newBranch, signoff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ChangeFilesOptions {\n");
|
||||
|
||||
sb.append(" author: ").append(toIndentedString(author)).append("\n");
|
||||
sb.append(" branch: ").append(toIndentedString(branch)).append("\n");
|
||||
sb.append(" committer: ").append(toIndentedString(committer)).append("\n");
|
||||
sb.append(" dates: ").append(toIndentedString(dates)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).append("\n");
|
||||
sb.append(" newBranch: ").append(toIndentedString(newBranch)).append("\n");
|
||||
sb.append(" signoff: ").append(toIndentedString(signoff)).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 ");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Gitea API.
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* OpenAPI spec version: {{AppVer | JSEscape | Safe}}
|
||||
*
|
||||
*
|
||||
* 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;
|
||||
|
||||
/** FilesResponse contains information about multiple files from a repo */
|
||||
@Schema(description = "FilesResponse contains information about multiple files from a repo")
|
||||
public class FilesResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("commit")
|
||||
private FileCommitResponse commit = null;
|
||||
|
||||
@SerializedName("files")
|
||||
private List<ContentsResponse> files = null;
|
||||
|
||||
@SerializedName("verification")
|
||||
private PayloadCommitVerification verification = null;
|
||||
|
||||
public FilesResponse commit(FileCommitResponse commit) {
|
||||
this.commit = commit;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get commit
|
||||
*
|
||||
* @return commit
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public FileCommitResponse getCommit() {
|
||||
return commit;
|
||||
}
|
||||
|
||||
public void setCommit(FileCommitResponse commit) {
|
||||
this.commit = commit;
|
||||
}
|
||||
|
||||
public FilesResponse files(List<ContentsResponse> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FilesResponse addFilesItem(ContentsResponse filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
*
|
||||
* @return files
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public List<ContentsResponse> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<ContentsResponse> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
public FilesResponse verification(PayloadCommitVerification verification) {
|
||||
this.verification = verification;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get verification
|
||||
*
|
||||
* @return verification
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public PayloadCommitVerification getVerification() {
|
||||
return verification;
|
||||
}
|
||||
|
||||
public void setVerification(PayloadCommitVerification verification) {
|
||||
this.verification = verification;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FilesResponse filesResponse = (FilesResponse) o;
|
||||
return Objects.equals(this.commit, filesResponse.commit)
|
||||
&& Objects.equals(this.files, filesResponse.files)
|
||||
&& Objects.equals(this.verification, filesResponse.verification);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(commit, files, verification);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FilesResponse {\n");
|
||||
|
||||
sb.append(" commit: ").append(toIndentedString(commit)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append(" verification: ").append(toIndentedString(verification)).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 ");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user