Synchronizing API and documentation updates

This commit is contained in:
gitnexbot
2025-10-10 00:11:28 +00:00
parent a0f4b15ead
commit 795664fe8c
4 changed files with 317 additions and 3 deletions
@@ -19,6 +19,7 @@ import org.gitnex.tea4j.v2.models.ActionWorkflowRunsResponse;
import org.gitnex.tea4j.v2.models.Activity;
import org.gitnex.tea4j.v2.models.AddCollaboratorOption;
import org.gitnex.tea4j.v2.models.AnnotatedTag;
import org.gitnex.tea4j.v2.models.ApplyDiffPatchFileOptions;
import org.gitnex.tea4j.v2.models.Attachment;
import org.gitnex.tea4j.v2.models.Branch;
import org.gitnex.tea4j.v2.models.BranchProtection;
@@ -707,7 +708,7 @@ public interface RepositoryApi {
@Headers({"Content-Type:application/json"})
@POST("repos/{owner}/{repo}/diffpatch")
Call<FileResponse> repoApplyDiffPatch(
@retrofit2.http.Body UpdateFileOptions body,
@retrofit2.http.Body ApplyDiffPatchFileOptions body,
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo);
@@ -0,0 +1,299 @@
/*
* Gitea API
* This documentation describes the Gitea API.
*
* OpenAPI spec version: {{.SwaggerAppVer}}
*
*
* 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.Objects;
/**
* ApplyDiffPatchFileOptions options for applying a diff patch Note: &#x60;author&#x60; and
* &#x60;committer&#x60; are optional (if only one is given, it will be used for the other,
* otherwise the authenticated user will be used)
*/
@Schema(
description =
"ApplyDiffPatchFileOptions options for applying a diff patch 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 ApplyDiffPatchFileOptions 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("content")
private String content = null;
@SerializedName("dates")
private CommitDateOptions dates = null;
@SerializedName("force_push")
private Boolean forcePush = null;
@SerializedName("message")
private String message = null;
@SerializedName("new_branch")
private String newBranch = null;
@SerializedName("signoff")
private Boolean signoff = null;
public ApplyDiffPatchFileOptions 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 ApplyDiffPatchFileOptions branch(String branch) {
this.branch = branch;
return this;
}
/**
* branch (optional) is the base branch for the changes. If not supplied, the default branch is
* used
*
* @return branch
*/
@Schema(
description =
"branch (optional) is the base branch for the changes. If not supplied, the default"
+ " branch is used")
public String getBranch() {
return branch;
}
public void setBranch(String branch) {
this.branch = branch;
}
public ApplyDiffPatchFileOptions 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 ApplyDiffPatchFileOptions content(String content) {
this.content = content;
return this;
}
/**
* Get content
*
* @return content
*/
@Schema(required = true, description = "")
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public ApplyDiffPatchFileOptions 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 ApplyDiffPatchFileOptions forcePush(Boolean forcePush) {
this.forcePush = forcePush;
return this;
}
/**
* force_push (optional) will do a force-push if the new branch already exists
*
* @return forcePush
*/
@Schema(
description = "force_push (optional) will do a force-push if the new branch already exists")
public Boolean isForcePush() {
return forcePush;
}
public void setForcePush(Boolean forcePush) {
this.forcePush = forcePush;
}
public ApplyDiffPatchFileOptions message(String message) {
this.message = message;
return this;
}
/**
* message (optional) is the commit message of the changes. If not supplied, a default message
* will be used
*
* @return message
*/
@Schema(
description =
"message (optional) is the commit message of the changes. If not supplied, a default"
+ " message will be used")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ApplyDiffPatchFileOptions newBranch(String newBranch) {
this.newBranch = newBranch;
return this;
}
/**
* new_branch (optional) will make a new branch from base branch for the changes. If not supplied,
* the changes will be committed to the base branch
*
* @return newBranch
*/
@Schema(
description =
"new_branch (optional) will make a new branch from base branch for the changes. If not"
+ " supplied, the changes will be committed to the base branch")
public String getNewBranch() {
return newBranch;
}
public void setNewBranch(String newBranch) {
this.newBranch = newBranch;
}
public ApplyDiffPatchFileOptions 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;
}
ApplyDiffPatchFileOptions applyDiffPatchFileOptions = (ApplyDiffPatchFileOptions) o;
return Objects.equals(this.author, applyDiffPatchFileOptions.author)
&& Objects.equals(this.branch, applyDiffPatchFileOptions.branch)
&& Objects.equals(this.committer, applyDiffPatchFileOptions.committer)
&& Objects.equals(this.content, applyDiffPatchFileOptions.content)
&& Objects.equals(this.dates, applyDiffPatchFileOptions.dates)
&& Objects.equals(this.forcePush, applyDiffPatchFileOptions.forcePush)
&& Objects.equals(this.message, applyDiffPatchFileOptions.message)
&& Objects.equals(this.newBranch, applyDiffPatchFileOptions.newBranch)
&& Objects.equals(this.signoff, applyDiffPatchFileOptions.signoff);
}
@Override
public int hashCode() {
return Objects.hash(
author, branch, committer, content, dates, forcePush, message, newBranch, signoff);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ApplyDiffPatchFileOptions {\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(" content: ").append(toIndentedString(content)).append("\n");
sb.append(" dates: ").append(toIndentedString(dates)).append("\n");
sb.append(" forcePush: ").append(toIndentedString(forcePush)).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 ");
}
}