Synchronizing API and documentation updates

This commit is contained in:
gitnexbot
2023-03-15 00:17:26 +00:00
parent 409c3c1cbc
commit c1be415ed0
6 changed files with 453 additions and 1 deletions
+272
View File
@@ -18,10 +18,13 @@ Method | HTTP request | Description
[**adminDeleteUserPublicKey**](AdminApi.md#adminDeleteUserPublicKey) | **DELETE** admin/users/{username}/keys/{id} | Delete a user's public key
[**adminEditHook**](AdminApi.md#adminEditHook) | **PATCH** admin/hooks/{id} | Update a hook
[**adminEditUser**](AdminApi.md#adminEditUser) | **PATCH** admin/users/{username} | Edit an existing user
[**adminGetAllEmails**](AdminApi.md#adminGetAllEmails) | **GET** admin/emails | List all emails
[**adminGetAllOrgs**](AdminApi.md#adminGetAllOrgs) | **GET** admin/orgs | List all organizations
[**adminGetAllUsers**](AdminApi.md#adminGetAllUsers) | **GET** admin/users | List all users
[**adminGetHook**](AdminApi.md#adminGetHook) | **GET** admin/hooks/{id} | Get a hook
[**adminListHooks**](AdminApi.md#adminListHooks) | **GET** admin/hooks | List system's webhooks
[**adminRenameUser**](AdminApi.md#adminRenameUser) | **POST** admin/users/{username}/rename | Rename a user
[**adminSearchEmails**](AdminApi.md#adminSearchEmails) | **GET** admin/emails/search | Search all emails
[**adminUnadoptedList**](AdminApi.md#adminUnadoptedList) | **GET** admin/unadopted | List unadopted repositories
<a name="adminAdoptRepository"></a>
@@ -1262,6 +1265,95 @@ Name | Type | Description | Notes
- **Content-Type**: application/json
- **Accept**: application/json
<a name="adminGetAllEmails"></a>
# **adminGetAllEmails**
> List&lt;Email&gt; adminGetAllEmails(page, limit)
List all emails
### Example
```java
// Import classes:
//import org.gitnex.tea4j.v2.ApiClient;
//import org.gitnex.tea4j.v2.ApiException;
//import org.gitnex.tea4j.v2.Configuration;
//import org.gitnex.tea4j.v2.auth.*;
//import org.gitnex.tea4j.v2.apis.AdminApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");
// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");
// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");
// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");
AdminApi apiInstance = new AdminApi();
Integer page = 56; // Integer | page number of results to return (1-based)
Integer limit = 56; // Integer | page size of results
try {
List<Email> result = apiInstance.adminGetAllEmails(page, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#adminGetAllEmails");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**page** | **Integer**| page number of results to return (1-based) | [optional]
**limit** | **Integer**| page size of results | [optional]
### Return type
[**List&lt;Email&gt;**](Email.md)
### Authorization
[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="adminGetAllOrgs"></a>
# **adminGetAllOrgs**
> List&lt;Organization&gt; adminGetAllOrgs(page, limit)
@@ -1611,6 +1703,186 @@ Name | Type | Description | Notes
[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="adminRenameUser"></a>
# **adminRenameUser**
> Void adminRenameUser(body, username)
Rename a user
### Example
```java
// Import classes:
//import org.gitnex.tea4j.v2.ApiClient;
//import org.gitnex.tea4j.v2.ApiException;
//import org.gitnex.tea4j.v2.Configuration;
//import org.gitnex.tea4j.v2.auth.*;
//import org.gitnex.tea4j.v2.apis.AdminApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");
// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");
// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");
// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");
AdminApi apiInstance = new AdminApi();
RenameUserOption body = new RenameUserOption(); // RenameUserOption |
String username = "username_example"; // String | existing username of user
try {
Void result = apiInstance.adminRenameUser(body, username);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#adminRenameUser");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**RenameUserOption**](RenameUserOption.md)| |
**username** | **String**| existing username of user |
### Return type
[**Void**](.md)
### Authorization
[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token)
### HTTP request headers
- **Content-Type**: application/json, text/plain
- **Accept**: Not defined
<a name="adminSearchEmails"></a>
# **adminSearchEmails**
> List&lt;Email&gt; adminSearchEmails(q, page, limit)
Search all emails
### Example
```java
// Import classes:
//import org.gitnex.tea4j.v2.ApiClient;
//import org.gitnex.tea4j.v2.ApiException;
//import org.gitnex.tea4j.v2.Configuration;
//import org.gitnex.tea4j.v2.auth.*;
//import org.gitnex.tea4j.v2.apis.AdminApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: AccessToken
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
AccessToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AccessToken.setApiKeyPrefix("Token");
// Configure API key authorization: AuthorizationHeaderToken
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: BasicAuth
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
BasicAuth.setUsername("YOUR USERNAME");
BasicAuth.setPassword("YOUR PASSWORD");
// Configure API key authorization: SudoHeader
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
SudoHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoHeader.setApiKeyPrefix("Token");
// Configure API key authorization: SudoParam
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
SudoParam.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//SudoParam.setApiKeyPrefix("Token");
// Configure API key authorization: TOTPHeader
ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader");
TOTPHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TOTPHeader.setApiKeyPrefix("Token");
// Configure API key authorization: Token
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
Token.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Token.setApiKeyPrefix("Token");
AdminApi apiInstance = new AdminApi();
String q = "q_example"; // String | keyword
Integer page = 56; // Integer | page number of results to return (1-based)
Integer limit = 56; // Integer | page size of results
try {
List<Email> result = apiInstance.adminSearchEmails(q, page, limit);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#adminSearchEmails");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**q** | **String**| keyword | [optional]
**page** | **Integer**| page number of results to return (1-based) | [optional]
**limit** | **Integer**| page size of results | [optional]
### Return type
[**List&lt;Email&gt;**](Email.md)
### Authorization
[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token)
### HTTP request headers
- **Content-Type**: Not defined
+2
View File
@@ -5,4 +5,6 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | | [optional]
**primary** | **Boolean** | | [optional]
**userId** | **Long** | | [optional]
**username** | **String** | | [optional]
**verified** | **Boolean** | | [optional]
+6
View File
@@ -0,0 +1,6 @@
# RenameUserOption
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**newUsername** | **String** | New username for this user. This name cannot be in use yet by any other user. |
@@ -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&lt;List&lt;Email&gt;&gt;
*/
@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&lt;Void&gt;
*/
@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&lt;List&lt;Email&gt;&gt;
*/
@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 ");
}
}