mirror of
https://codeberg.org/gitnex/tea4j-autodeploy
synced 2026-06-06 18:02:16 +00:00
Synchronizing API and documentation updates
This commit is contained in:
@@ -2,6 +2,7 @@ package org.gitnex.tea4j.v2.apis;
|
||||
|
||||
import java.util.List;
|
||||
import org.gitnex.tea4j.v2.CollectionFormats.*;
|
||||
import org.gitnex.tea4j.v2.models.Badge;
|
||||
import org.gitnex.tea4j.v2.models.CreateHookOption;
|
||||
import org.gitnex.tea4j.v2.models.CreateKeyOption;
|
||||
import org.gitnex.tea4j.v2.models.CreateOrgOption;
|
||||
@@ -17,10 +18,23 @@ import org.gitnex.tea4j.v2.models.PublicKey;
|
||||
import org.gitnex.tea4j.v2.models.RenameUserOption;
|
||||
import org.gitnex.tea4j.v2.models.Repository;
|
||||
import org.gitnex.tea4j.v2.models.User;
|
||||
import org.gitnex.tea4j.v2.models.UserBadgeOption;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.*;
|
||||
|
||||
public interface AdminApi {
|
||||
/**
|
||||
* Add a badge to a user
|
||||
*
|
||||
* @param username username of user (required)
|
||||
* @param body (optional)
|
||||
* @return Call<Void>
|
||||
*/
|
||||
@Headers({"Content-Type:application/json"})
|
||||
@POST("admin/users/{username}/badges")
|
||||
Call<Void> adminAddUserBadges(
|
||||
@retrofit2.http.Path("username") String username, @retrofit2.http.Body UserBadgeOption body);
|
||||
|
||||
/**
|
||||
* Adopt unadopted files as a repository
|
||||
*
|
||||
@@ -140,6 +154,18 @@ public interface AdminApi {
|
||||
@retrofit2.http.Path("username") String username,
|
||||
@retrofit2.http.Query("purge") Boolean purge);
|
||||
|
||||
/**
|
||||
* Remove a badge from a user
|
||||
*
|
||||
* @param username username of user (required)
|
||||
* @param body (optional)
|
||||
* @return Call<Void>
|
||||
*/
|
||||
@Headers({"Content-Type:application/json"})
|
||||
@DELETE("admin/users/{username}/badges")
|
||||
Call<Void> adminDeleteUserBadges(
|
||||
@retrofit2.http.Path("username") String username, @retrofit2.http.Body UserBadgeOption body);
|
||||
|
||||
/**
|
||||
* Delete a user's public key
|
||||
*
|
||||
@@ -225,6 +251,15 @@ public interface AdminApi {
|
||||
Call<List<Hook>> adminListHooks(
|
||||
@retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* List a user's badges
|
||||
*
|
||||
* @param username username of user (required)
|
||||
* @return Call<List<Badge>>
|
||||
*/
|
||||
@GET("admin/users/{username}/badges")
|
||||
Call<List<Badge>> adminListUserBadges(@retrofit2.http.Path("username") String username);
|
||||
|
||||
/**
|
||||
* Rename a user
|
||||
*
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* 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.Objects;
|
||||
|
||||
/** Badge represents a user badge */
|
||||
@Schema(description = "Badge represents a user badge")
|
||||
public class Badge implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("description")
|
||||
private String description = null;
|
||||
|
||||
@SerializedName("id")
|
||||
private Long id = null;
|
||||
|
||||
@SerializedName("image_url")
|
||||
private String imageUrl = null;
|
||||
|
||||
@SerializedName("slug")
|
||||
private String slug = null;
|
||||
|
||||
public Badge description(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return description
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Badge 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 Badge imageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get imageUrl
|
||||
*
|
||||
* @return imageUrl
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public Badge slug(String slug) {
|
||||
this.slug = slug;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get slug
|
||||
*
|
||||
* @return slug
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public String getSlug() {
|
||||
return slug;
|
||||
}
|
||||
|
||||
public void setSlug(String slug) {
|
||||
this.slug = slug;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Badge badge = (Badge) o;
|
||||
return Objects.equals(this.description, badge.description)
|
||||
&& Objects.equals(this.id, badge.id)
|
||||
&& Objects.equals(this.imageUrl, badge.imageUrl)
|
||||
&& Objects.equals(this.slug, badge.slug);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(description, id, imageUrl, slug);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Badge {\n");
|
||||
|
||||
sb.append(" description: ").append(toIndentedString(description)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n");
|
||||
sb.append(" slug: ").append(toIndentedString(slug)).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,93 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/** BadgeList */
|
||||
@Schema(description = "BadgeList")
|
||||
public class BadgeList implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("body")
|
||||
private List<Badge> body = null;
|
||||
|
||||
public BadgeList body(List<Badge> body) {
|
||||
this.body = body;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BadgeList addBodyItem(Badge bodyItem) {
|
||||
if (this.body == null) {
|
||||
this.body = new ArrayList<>();
|
||||
}
|
||||
this.body.add(bodyItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* in:body
|
||||
*
|
||||
* @return body
|
||||
*/
|
||||
@Schema(description = "in:body")
|
||||
public List<Badge> getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(List<Badge> body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
BadgeList badgeList = (BadgeList) o;
|
||||
return Objects.equals(this.body, badgeList.body);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(body);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class BadgeList {\n");
|
||||
|
||||
sb.append(" body: ").append(toIndentedString(body)).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,93 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/** UserBadgeOption options for link between users and badges */
|
||||
@Schema(description = "UserBadgeOption options for link between users and badges")
|
||||
public class UserBadgeOption implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("badge_slugs")
|
||||
private List<String> badgeSlugs = null;
|
||||
|
||||
public UserBadgeOption badgeSlugs(List<String> badgeSlugs) {
|
||||
this.badgeSlugs = badgeSlugs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public UserBadgeOption addBadgeSlugsItem(String badgeSlugsItem) {
|
||||
if (this.badgeSlugs == null) {
|
||||
this.badgeSlugs = new ArrayList<>();
|
||||
}
|
||||
this.badgeSlugs.add(badgeSlugsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get badgeSlugs
|
||||
*
|
||||
* @return badgeSlugs
|
||||
*/
|
||||
@Schema(example = "[\"badge1\",\"badge2\"]", description = "")
|
||||
public List<String> getBadgeSlugs() {
|
||||
return badgeSlugs;
|
||||
}
|
||||
|
||||
public void setBadgeSlugs(List<String> badgeSlugs) {
|
||||
this.badgeSlugs = badgeSlugs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
UserBadgeOption userBadgeOption = (UserBadgeOption) o;
|
||||
return Objects.equals(this.badgeSlugs, userBadgeOption.badgeSlugs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(badgeSlugs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class UserBadgeOption {\n");
|
||||
|
||||
sb.append(" badgeSlugs: ").append(toIndentedString(badgeSlugs)).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