From 1b7ea6dff8559decfc4b6ec344c6b68338e1a50b Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Thu, 16 Mar 2023 00:04:15 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/AdminApi.md | 184 +++++++++--------- .../org/gitnex/tea4j/v2/apis/AdminApi.java | 27 +-- 2 files changed, 110 insertions(+), 101 deletions(-) diff --git a/docs/AdminApi.md b/docs/AdminApi.md index 2811aa2..0e34423 100644 --- a/docs/AdminApi.md +++ b/docs/AdminApi.md @@ -20,11 +20,11 @@ Method | HTTP request | Description [**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 +[**adminSearchUsers**](AdminApi.md#adminSearchUsers) | **GET** admin/users | Search users according filter conditions [**adminUnadoptedList**](AdminApi.md#adminUnadoptedList) | **GET** admin/unadopted | List unadopted repositories @@ -1438,95 +1438,6 @@ 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 - - -# **adminGetAllUsers** -> List<User> adminGetAllUsers(page, limit) - -List all users - -### 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 result = apiInstance.adminGetAllUsers(page, limit); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AdminApi#adminGetAllUsers"); - 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<User>**](User.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 @@ -1883,6 +1794,99 @@ 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 + + +# **adminSearchUsers** +> List<User> adminSearchUsers(sourceId, loginName, page, limit) + +Search users according filter conditions + +### 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(); +Long sourceId = 789L; // Long | ID of the user's login source to search for +String loginName = "loginName_example"; // String | user's login name to search for +Integer page = 56; // Integer | page number of results to return (1-based) +Integer limit = 56; // Integer | page size of results +try { + List result = apiInstance.adminSearchUsers(sourceId, loginName, page, limit); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling AdminApi#adminSearchUsers"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sourceId** | **Long**| ID of the user's login source to search for | [optional] + **loginName** | **String**| user's login name to search for | [optional] + **page** | **Integer**| page number of results to return (1-based) | [optional] + **limit** | **Integer**| page size of results | [optional] + +### Return type + +[**List<User>**](User.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 diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java index bc11735..d54cc75 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java @@ -197,17 +197,6 @@ public interface AdminApi { Call> adminGetAllOrgs( @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit); - /** - * List all users - * - * @param page page number of results to return (1-based) (optional) - * @param limit page size of results (optional) - * @return Call<List<User>> - */ - @GET("admin/users") - Call> adminGetAllUsers( - @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit); - /** * Get a hook * @@ -254,6 +243,22 @@ public interface AdminApi { @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit); + /** + * Search users according filter conditions + * + * @param sourceId ID of the user's login source to search for (optional) + * @param loginName user's login name to search for (optional) + * @param page page number of results to return (1-based) (optional) + * @param limit page size of results (optional) + * @return Call<List<User>> + */ + @GET("admin/users") + Call> adminSearchUsers( + @retrofit2.http.Query("source_id") Long sourceId, + @retrofit2.http.Query("login_name") String loginName, + @retrofit2.http.Query("page") Integer page, + @retrofit2.http.Query("limit") Integer limit); + /** * List unadopted repositories *