Synchronizing API and documentation updates

This commit is contained in:
gitnexbot
2024-06-15 00:08:48 +00:00
parent 55caeecf64
commit f950e94f46
8 changed files with 1081 additions and 0 deletions
@@ -34,6 +34,7 @@ import org.gitnex.tea4j.v2.models.CreateReleaseOption;
import org.gitnex.tea4j.v2.models.CreateRepoOption;
import org.gitnex.tea4j.v2.models.CreateStatusOption;
import org.gitnex.tea4j.v2.models.CreateTagOption;
import org.gitnex.tea4j.v2.models.CreateTagProtectionOption;
import org.gitnex.tea4j.v2.models.CreateVariableOption;
import org.gitnex.tea4j.v2.models.CreateWikiPageOptions;
import org.gitnex.tea4j.v2.models.DeleteFileOptions;
@@ -46,6 +47,7 @@ import org.gitnex.tea4j.v2.models.EditHookOption;
import org.gitnex.tea4j.v2.models.EditPullRequestOption;
import org.gitnex.tea4j.v2.models.EditReleaseOption;
import org.gitnex.tea4j.v2.models.EditRepoOption;
import org.gitnex.tea4j.v2.models.EditTagProtectionOption;
import org.gitnex.tea4j.v2.models.FileDeleteResponse;
import org.gitnex.tea4j.v2.models.FileResponse;
import org.gitnex.tea4j.v2.models.FilesResponse;
@@ -77,6 +79,7 @@ import org.gitnex.tea4j.v2.models.SearchResults;
import org.gitnex.tea4j.v2.models.Secret;
import org.gitnex.tea4j.v2.models.SubmitPullReviewOptions;
import org.gitnex.tea4j.v2.models.Tag;
import org.gitnex.tea4j.v2.models.TagProtection;
import org.gitnex.tea4j.v2.models.Team;
import org.gitnex.tea4j.v2.models.TopicName;
import org.gitnex.tea4j.v2.models.TopicResponse;
@@ -670,6 +673,21 @@ public interface RepositoryApi {
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Body CreateTagOption body);
/**
* Create a tag protections for a repository
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @param body (optional)
* @return Call<TagProtection>
*/
@Headers({"Content-Type:application/json"})
@POST("repos/{owner}/{repo}/tag_protections")
Call<TagProtection> repoCreateTagProtection(
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Body CreateTagProtectionOption body);
/**
* Create a wiki page
*
@@ -913,6 +931,20 @@ public interface RepositoryApi {
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("tag") String tag);
/**
* Delete a specific tag protection for the repository
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @param id id of protected tag (required)
* @return Call&lt;Void&gt;
*/
@DELETE("repos/{owner}/{repo}/tag_protections/{id}")
Call<Void> repoDeleteTagProtection(
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("id") Integer id);
/**
* Delete a team from a repository
*
@@ -1129,6 +1161,23 @@ public interface RepositoryApi {
@retrofit2.http.Path("attachment_id") Long attachmentId,
@retrofit2.http.Body EditAttachmentOptions body);
/**
* Edit a tag protections for a repository. Only fields that are set will be changed
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @param id id of protected tag (required)
* @param body (optional)
* @return Call&lt;TagProtection&gt;
*/
@Headers({"Content-Type:application/json"})
@PATCH("repos/{owner}/{repo}/tag_protections/{id}")
Call<TagProtection> repoEditTagProtection(
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("id") Integer id,
@retrofit2.http.Body EditTagProtectionOption body);
/**
* Edit a wiki page
*
@@ -1712,6 +1761,20 @@ public interface RepositoryApi {
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("tag") String tag);
/**
* Get a specific tag protection for the repository
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @param id id of the tag protect to get (required)
* @return Call&lt;TagProtection&gt;
*/
@GET("repos/{owner}/{repo}/tag_protections/{id}")
Call<TagProtection> repoGetTagProtection(
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("id") Integer id);
/**
* Get a wiki page
*
@@ -2098,6 +2161,17 @@ public interface RepositoryApi {
@retrofit2.http.Query("page") Integer page,
@retrofit2.http.Query("limit") Integer limit);
/**
* List tag protections for a repository
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @return Call&lt;List&lt;TagProtection&gt;&gt;
*/
@GET("repos/{owner}/{repo}/tag_protections")
Call<List<TagProtection>> repoListTagProtection(
@retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo);
/**
* List a repository&#x27;s tags
*
@@ -0,0 +1,149 @@
/*
* 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;
/** CreateTagProtectionOption options for creating a tag protection */
@Schema(description = "CreateTagProtectionOption options for creating a tag protection")
public class CreateTagProtectionOption implements Serializable {
private static final long serialVersionUID = 1L;
@SerializedName("name_pattern")
private String namePattern = null;
@SerializedName("whitelist_teams")
private List<String> whitelistTeams = null;
@SerializedName("whitelist_usernames")
private List<String> whitelistUsernames = null;
public CreateTagProtectionOption namePattern(String namePattern) {
this.namePattern = namePattern;
return this;
}
/**
* Get namePattern
*
* @return namePattern
*/
@Schema(description = "")
public String getNamePattern() {
return namePattern;
}
public void setNamePattern(String namePattern) {
this.namePattern = namePattern;
}
public CreateTagProtectionOption whitelistTeams(List<String> whitelistTeams) {
this.whitelistTeams = whitelistTeams;
return this;
}
public CreateTagProtectionOption addWhitelistTeamsItem(String whitelistTeamsItem) {
if (this.whitelistTeams == null) {
this.whitelistTeams = new ArrayList<>();
}
this.whitelistTeams.add(whitelistTeamsItem);
return this;
}
/**
* Get whitelistTeams
*
* @return whitelistTeams
*/
@Schema(description = "")
public List<String> getWhitelistTeams() {
return whitelistTeams;
}
public void setWhitelistTeams(List<String> whitelistTeams) {
this.whitelistTeams = whitelistTeams;
}
public CreateTagProtectionOption whitelistUsernames(List<String> whitelistUsernames) {
this.whitelistUsernames = whitelistUsernames;
return this;
}
public CreateTagProtectionOption addWhitelistUsernamesItem(String whitelistUsernamesItem) {
if (this.whitelistUsernames == null) {
this.whitelistUsernames = new ArrayList<>();
}
this.whitelistUsernames.add(whitelistUsernamesItem);
return this;
}
/**
* Get whitelistUsernames
*
* @return whitelistUsernames
*/
@Schema(description = "")
public List<String> getWhitelistUsernames() {
return whitelistUsernames;
}
public void setWhitelistUsernames(List<String> whitelistUsernames) {
this.whitelistUsernames = whitelistUsernames;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateTagProtectionOption createTagProtectionOption = (CreateTagProtectionOption) o;
return Objects.equals(this.namePattern, createTagProtectionOption.namePattern)
&& Objects.equals(this.whitelistTeams, createTagProtectionOption.whitelistTeams)
&& Objects.equals(this.whitelistUsernames, createTagProtectionOption.whitelistUsernames);
}
@Override
public int hashCode() {
return Objects.hash(namePattern, whitelistTeams, whitelistUsernames);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateTagProtectionOption {\n");
sb.append(" namePattern: ").append(toIndentedString(namePattern)).append("\n");
sb.append(" whitelistTeams: ").append(toIndentedString(whitelistTeams)).append("\n");
sb.append(" whitelistUsernames: ").append(toIndentedString(whitelistUsernames)).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,149 @@
/*
* 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;
/** EditTagProtectionOption options for editing a tag protection */
@Schema(description = "EditTagProtectionOption options for editing a tag protection")
public class EditTagProtectionOption implements Serializable {
private static final long serialVersionUID = 1L;
@SerializedName("name_pattern")
private String namePattern = null;
@SerializedName("whitelist_teams")
private List<String> whitelistTeams = null;
@SerializedName("whitelist_usernames")
private List<String> whitelistUsernames = null;
public EditTagProtectionOption namePattern(String namePattern) {
this.namePattern = namePattern;
return this;
}
/**
* Get namePattern
*
* @return namePattern
*/
@Schema(description = "")
public String getNamePattern() {
return namePattern;
}
public void setNamePattern(String namePattern) {
this.namePattern = namePattern;
}
public EditTagProtectionOption whitelistTeams(List<String> whitelistTeams) {
this.whitelistTeams = whitelistTeams;
return this;
}
public EditTagProtectionOption addWhitelistTeamsItem(String whitelistTeamsItem) {
if (this.whitelistTeams == null) {
this.whitelistTeams = new ArrayList<>();
}
this.whitelistTeams.add(whitelistTeamsItem);
return this;
}
/**
* Get whitelistTeams
*
* @return whitelistTeams
*/
@Schema(description = "")
public List<String> getWhitelistTeams() {
return whitelistTeams;
}
public void setWhitelistTeams(List<String> whitelistTeams) {
this.whitelistTeams = whitelistTeams;
}
public EditTagProtectionOption whitelistUsernames(List<String> whitelistUsernames) {
this.whitelistUsernames = whitelistUsernames;
return this;
}
public EditTagProtectionOption addWhitelistUsernamesItem(String whitelistUsernamesItem) {
if (this.whitelistUsernames == null) {
this.whitelistUsernames = new ArrayList<>();
}
this.whitelistUsernames.add(whitelistUsernamesItem);
return this;
}
/**
* Get whitelistUsernames
*
* @return whitelistUsernames
*/
@Schema(description = "")
public List<String> getWhitelistUsernames() {
return whitelistUsernames;
}
public void setWhitelistUsernames(List<String> whitelistUsernames) {
this.whitelistUsernames = whitelistUsernames;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EditTagProtectionOption editTagProtectionOption = (EditTagProtectionOption) o;
return Objects.equals(this.namePattern, editTagProtectionOption.namePattern)
&& Objects.equals(this.whitelistTeams, editTagProtectionOption.whitelistTeams)
&& Objects.equals(this.whitelistUsernames, editTagProtectionOption.whitelistUsernames);
}
@Override
public int hashCode() {
return Objects.hash(namePattern, whitelistTeams, whitelistUsernames);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class EditTagProtectionOption {\n");
sb.append(" namePattern: ").append(toIndentedString(namePattern)).append("\n");
sb.append(" whitelistTeams: ").append(toIndentedString(whitelistTeams)).append("\n");
sb.append(" whitelistUsernames: ").append(toIndentedString(whitelistUsernames)).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,222 @@
/*
* 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.Date;
import java.util.List;
import java.util.Objects;
/** TagProtection represents a tag protection */
@Schema(description = "TagProtection represents a tag protection")
public class TagProtection implements Serializable {
private static final long serialVersionUID = 1L;
@SerializedName("created_at")
private Date createdAt = null;
@SerializedName("id")
private Long id = null;
@SerializedName("name_pattern")
private String namePattern = null;
@SerializedName("updated_at")
private Date updatedAt = null;
@SerializedName("whitelist_teams")
private List<String> whitelistTeams = null;
@SerializedName("whitelist_usernames")
private List<String> whitelistUsernames = null;
public TagProtection createdAt(Date createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Get createdAt
*
* @return createdAt
*/
@Schema(description = "")
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public TagProtection id(Long id) {
this.id = id;
return this;
}
/**
* Get id
*
* @return id
*/
@Schema(description = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public TagProtection namePattern(String namePattern) {
this.namePattern = namePattern;
return this;
}
/**
* Get namePattern
*
* @return namePattern
*/
@Schema(description = "")
public String getNamePattern() {
return namePattern;
}
public void setNamePattern(String namePattern) {
this.namePattern = namePattern;
}
public TagProtection updatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Get updatedAt
*
* @return updatedAt
*/
@Schema(description = "")
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public TagProtection whitelistTeams(List<String> whitelistTeams) {
this.whitelistTeams = whitelistTeams;
return this;
}
public TagProtection addWhitelistTeamsItem(String whitelistTeamsItem) {
if (this.whitelistTeams == null) {
this.whitelistTeams = new ArrayList<>();
}
this.whitelistTeams.add(whitelistTeamsItem);
return this;
}
/**
* Get whitelistTeams
*
* @return whitelistTeams
*/
@Schema(description = "")
public List<String> getWhitelistTeams() {
return whitelistTeams;
}
public void setWhitelistTeams(List<String> whitelistTeams) {
this.whitelistTeams = whitelistTeams;
}
public TagProtection whitelistUsernames(List<String> whitelistUsernames) {
this.whitelistUsernames = whitelistUsernames;
return this;
}
public TagProtection addWhitelistUsernamesItem(String whitelistUsernamesItem) {
if (this.whitelistUsernames == null) {
this.whitelistUsernames = new ArrayList<>();
}
this.whitelistUsernames.add(whitelistUsernamesItem);
return this;
}
/**
* Get whitelistUsernames
*
* @return whitelistUsernames
*/
@Schema(description = "")
public List<String> getWhitelistUsernames() {
return whitelistUsernames;
}
public void setWhitelistUsernames(List<String> whitelistUsernames) {
this.whitelistUsernames = whitelistUsernames;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TagProtection tagProtection = (TagProtection) o;
return Objects.equals(this.createdAt, tagProtection.createdAt)
&& Objects.equals(this.id, tagProtection.id)
&& Objects.equals(this.namePattern, tagProtection.namePattern)
&& Objects.equals(this.updatedAt, tagProtection.updatedAt)
&& Objects.equals(this.whitelistTeams, tagProtection.whitelistTeams)
&& Objects.equals(this.whitelistUsernames, tagProtection.whitelistUsernames);
}
@Override
public int hashCode() {
return Objects.hash(createdAt, id, namePattern, updatedAt, whitelistTeams, whitelistUsernames);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TagProtection {\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" namePattern: ").append(toIndentedString(namePattern)).append("\n");
sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
sb.append(" whitelistTeams: ").append(toIndentedString(whitelistTeams)).append("\n");
sb.append(" whitelistUsernames: ").append(toIndentedString(whitelistUsernames)).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 ");
}
}