mirror of
https://codeberg.org/gitnex/tea4j-autodeploy
synced 2026-06-04 16:52:17 +00:00
Synchronizing API and documentation updates
This commit is contained in:
@@ -10,9 +10,11 @@ import org.gitnex.tea4j.v2.models.CreateUserOption;
|
||||
import org.gitnex.tea4j.v2.models.Cron;
|
||||
import org.gitnex.tea4j.v2.models.EditHookOption;
|
||||
import org.gitnex.tea4j.v2.models.EditUserOption;
|
||||
import org.gitnex.tea4j.v2.models.Email;
|
||||
import org.gitnex.tea4j.v2.models.Hook;
|
||||
import org.gitnex.tea4j.v2.models.Organization;
|
||||
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 retrofit2.Call;
|
||||
@@ -173,6 +175,17 @@ public interface AdminApi {
|
||||
Call<User> adminEditUser(
|
||||
@retrofit2.http.Path("username") String username, @retrofit2.http.Body EditUserOption body);
|
||||
|
||||
/**
|
||||
* List all emails
|
||||
*
|
||||
* @param page page number of results to return (1-based) (optional)
|
||||
* @param limit page size of results (optional)
|
||||
* @return Call<List<Email>>
|
||||
*/
|
||||
@GET("admin/emails")
|
||||
Call<List<Email>> adminGetAllEmails(
|
||||
@retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* List all organizations
|
||||
*
|
||||
@@ -215,6 +228,32 @@ public interface AdminApi {
|
||||
Call<List<Hook>> adminListHooks(
|
||||
@retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* Rename a user
|
||||
*
|
||||
* @param body (required)
|
||||
* @param username existing username of user (required)
|
||||
* @return Call<Void>
|
||||
*/
|
||||
@Headers({"Content-Type:application/json"})
|
||||
@POST("admin/users/{username}/rename")
|
||||
Call<Void> adminRenameUser(
|
||||
@retrofit2.http.Body RenameUserOption body, @retrofit2.http.Path("username") String username);
|
||||
|
||||
/**
|
||||
* Search all emails
|
||||
*
|
||||
* @param q keyword (optional)
|
||||
* @param page page number of results to return (1-based) (optional)
|
||||
* @param limit page size of results (optional)
|
||||
* @return Call<List<Email>>
|
||||
*/
|
||||
@GET("admin/emails/search")
|
||||
Call<List<Email>> adminSearchEmails(
|
||||
@retrofit2.http.Query("q") String q,
|
||||
@retrofit2.http.Query("page") Integer page,
|
||||
@retrofit2.http.Query("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* List unadopted repositories
|
||||
*
|
||||
|
||||
@@ -28,6 +28,12 @@ public class Email implements Serializable {
|
||||
@SerializedName("primary")
|
||||
private Boolean primary = null;
|
||||
|
||||
@SerializedName("user_id")
|
||||
private Long userId = null;
|
||||
|
||||
@SerializedName("username")
|
||||
private String username = null;
|
||||
|
||||
@SerializedName("verified")
|
||||
private Boolean verified = null;
|
||||
|
||||
@@ -69,6 +75,44 @@ public class Email implements Serializable {
|
||||
this.primary = primary;
|
||||
}
|
||||
|
||||
public Email userId(Long userId) {
|
||||
this.userId = userId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get userId
|
||||
*
|
||||
* @return userId
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Email username(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username
|
||||
*
|
||||
* @return username
|
||||
*/
|
||||
@Schema(description = "")
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public Email verified(Boolean verified) {
|
||||
this.verified = verified;
|
||||
return this;
|
||||
@@ -99,12 +143,14 @@ public class Email implements Serializable {
|
||||
Email email = (Email) o;
|
||||
return Objects.equals(this.email, email.email)
|
||||
&& Objects.equals(this.primary, email.primary)
|
||||
&& Objects.equals(this.userId, email.userId)
|
||||
&& Objects.equals(this.username, email.username)
|
||||
&& Objects.equals(this.verified, email.verified);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(email, primary, verified);
|
||||
return Objects.hash(email, primary, userId, username, verified);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,6 +160,8 @@ public class Email implements Serializable {
|
||||
|
||||
sb.append(" email: ").append(toIndentedString(email)).append("\n");
|
||||
sb.append(" primary: ").append(toIndentedString(primary)).append("\n");
|
||||
sb.append(" userId: ").append(toIndentedString(userId)).append("\n");
|
||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
||||
sb.append(" verified: ").append(toIndentedString(verified)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* 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.Objects;
|
||||
|
||||
/** RenameUserOption options when renaming a user */
|
||||
@Schema(description = "RenameUserOption options when renaming a user")
|
||||
public class RenameUserOption implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SerializedName("new_username")
|
||||
private String newUsername = null;
|
||||
|
||||
public RenameUserOption newUsername(String newUsername) {
|
||||
this.newUsername = newUsername;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* New username for this user. This name cannot be in use yet by any other user.
|
||||
*
|
||||
* @return newUsername
|
||||
*/
|
||||
@Schema(
|
||||
required = true,
|
||||
description = "New username for this user. This name cannot be in use yet by any other user.")
|
||||
public String getNewUsername() {
|
||||
return newUsername;
|
||||
}
|
||||
|
||||
public void setNewUsername(String newUsername) {
|
||||
this.newUsername = newUsername;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
RenameUserOption renameUserOption = (RenameUserOption) o;
|
||||
return Objects.equals(this.newUsername, renameUserOption.newUsername);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(newUsername);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class RenameUserOption {\n");
|
||||
|
||||
sb.append(" newUsername: ").append(toIndentedString(newUsername)).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