diff --git a/docs/AdminApi.md b/docs/AdminApi.md index fc080b8..b1147f2 100644 --- a/docs/AdminApi.md +++ b/docs/AdminApi.md @@ -2244,7 +2244,7 @@ Name | Type | Description | Notes # **adminSearchUsers** -> List<User> adminSearchUsers(sourceId, loginName, page, limit) +> List<User> adminSearchUsers(sourceId, loginName, page, limit, sort, order, q, visibility, isActive, isAdmin, isRestricted, is2faEnabled, isProhibitLogin) Search users according filter conditions @@ -2304,8 +2304,17 @@ Long sourceId = 789L; // Long | ID of the user's login source to search for String loginName = "loginName_example"; // String | identifier of the user, provided by the external authenticator Integer page = 56; // Integer | page number of results to return (1-based) Integer limit = 56; // Integer | page size of results +String sort = "sort_example"; // String | sort users by attribute. Supported values are \"name\", \"created\", \"updated\" and \"id\". Default is \"name\" +String order = "order_example"; // String | sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified. +String q = "q_example"; // String | search term (username, full name, email) +String visibility = "visibility_example"; // String | visibility filter. Supported values are \"public\", \"limited\" and \"private\". +Boolean isActive = true; // Boolean | filter active users +Boolean isAdmin = true; // Boolean | filter admin users +Boolean isRestricted = true; // Boolean | filter restricted users +Boolean is2faEnabled = true; // Boolean | filter 2FA enabled users +Boolean isProhibitLogin = true; // Boolean | filter login prohibited users try { - List result = apiInstance.adminSearchUsers(sourceId, loginName, page, limit); + List result = apiInstance.adminSearchUsers(sourceId, loginName, page, limit, sort, order, q, visibility, isActive, isAdmin, isRestricted, is2faEnabled, isProhibitLogin); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdminApi#adminSearchUsers"); @@ -2321,6 +2330,15 @@ Name | Type | Description | Notes **loginName** | **String**| identifier of the user, provided by the external authenticator | [optional] **page** | **Integer**| page number of results to return (1-based) | [optional] **limit** | **Integer**| page size of results | [optional] + **sort** | **String**| sort users by attribute. Supported values are \"name\", \"created\", \"updated\" and \"id\". Default is \"name\" | [optional] + **order** | **String**| sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified. | [optional] + **q** | **String**| search term (username, full name, email) | [optional] + **visibility** | **String**| visibility filter. Supported values are \"public\", \"limited\" and \"private\". | [optional] + **isActive** | **Boolean**| filter active users | [optional] + **isAdmin** | **Boolean**| filter admin users | [optional] + **isRestricted** | **Boolean**| filter restricted users | [optional] + **is2faEnabled** | **Boolean**| filter 2FA enabled users | [optional] + **isProhibitLogin** | **Boolean**| filter login prohibited users | [optional] ### Return type diff --git a/docs/IssueApi.md b/docs/IssueApi.md index 7e83abb..cd4deda 100644 --- a/docs/IssueApi.md +++ b/docs/IssueApi.md @@ -5670,7 +5670,7 @@ Name | Type | Description | Notes # **issueSearchIssues** -> List<Issue> issueSearchIssues(state, labels, milestones, q, priorityRepoId, type, since, before, assigned, created, mentioned, reviewRequested, reviewed, owner, team, page, limit) +> List<Issue> issueSearchIssues(state, labels, milestones, q, type, since, before, assigned, created, mentioned, reviewRequested, reviewed, owner, team, page, limit) Search for issues across the repositories that the user has access to @@ -5730,7 +5730,6 @@ String state = "open"; // String | State of the issue String labels = "labels_example"; // String | Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded. String milestones = "milestones_example"; // String | Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded. String q = "q_example"; // String | Search string -Long priorityRepoId = 789L; // Long | Repository ID to prioritize in the results String type = "type_example"; // String | Filter by issue type Date since = new Date(); // Date | Only show issues updated after the given time (RFC 3339 format) Date before = new Date(); // Date | Only show issues updated before the given time (RFC 3339 format) @@ -5744,7 +5743,7 @@ String team = "team_example"; // String | Filter by team (requires organization Integer page = 1; // Integer | Page number of results to return (1-based) Integer limit = 56; // Integer | Number of items per page try { - List result = apiInstance.issueSearchIssues(state, labels, milestones, q, priorityRepoId, type, since, before, assigned, created, mentioned, reviewRequested, reviewed, owner, team, page, limit); + List result = apiInstance.issueSearchIssues(state, labels, milestones, q, type, since, before, assigned, created, mentioned, reviewRequested, reviewed, owner, team, page, limit); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling IssueApi#issueSearchIssues"); @@ -5760,7 +5759,6 @@ Name | Type | Description | Notes **labels** | **String**| Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded. | [optional] **milestones** | **String**| Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded. | [optional] **q** | **String**| Search string | [optional] - **priorityRepoId** | **Long**| Repository ID to prioritize in the results | [optional] **type** | **String**| Filter by issue type | [optional] [enum: issues, pulls] **since** | **Date**| Only show issues updated after the given time (RFC 3339 format) | [optional] **before** | **Date**| Only show issues updated before the given time (RFC 3339 format) | [optional] diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index d1209dc..508f5af 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -183,6 +183,7 @@ Method | HTTP request | Description [**repoTransfer**](RepositoryApi.md#repoTransfer) | **POST** repos/{owner}/{repo}/transfer | Transfer a repo ownership [**repoUnDismissPullReview**](RepositoryApi.md#repoUnDismissPullReview) | **POST** repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals | Cancel to dismiss a review for a pull request [**repoUpdateAvatar**](RepositoryApi.md#repoUpdateAvatar) | **POST** repos/{owner}/{repo}/avatar | Update avatar +[**repoUpdateBranch**](RepositoryApi.md#repoUpdateBranch) | **PUT** repos/{owner}/{repo}/branches/{branch} | Update a branch reference to a new commit [**repoUpdateBranchProtectionPriories**](RepositoryApi.md#repoUpdateBranchProtectionPriories) | **POST** repos/{owner}/{repo}/branch_protections/priority | Update the priorities of branch protections for a repository. [**repoUpdateFile**](RepositoryApi.md#repoUpdateFile) | **PUT** repos/{owner}/{repo}/contents/{filepath} | Update a file in a repository if SHA is set, or create the file if SHA is not set [**repoUpdatePullRequest**](RepositoryApi.md#repoUpdatePullRequest) | **POST** repos/{owner}/{repo}/pulls/{index}/update | Merge PR's baseBranch into headBranch @@ -16804,6 +16805,99 @@ Name | Type | Description | Notes - **Content-Type**: application/json, text/plain - **Accept**: Not defined + +# **repoUpdateBranch** +> Void repoUpdateBranch(owner, repo, branch, body) + +Update a branch reference to a new commit + +### 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.RepositoryApi; + +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"); + +RepositoryApi apiInstance = new RepositoryApi(); +String owner = "owner_example"; // String | owner of the repo +String repo = "repo_example"; // String | name of the repo +String branch = "branch_example"; // String | name of the branch +UpdateBranchRepoOption body = new UpdateBranchRepoOption(); // UpdateBranchRepoOption | +try { + Void result = apiInstance.repoUpdateBranch(owner, repo, branch, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoUpdateBranch"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **branch** | **String**| name of the branch | + **body** | [**UpdateBranchRepoOption**](UpdateBranchRepoOption.md)| | [optional] + +### 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 + - **Accept**: Not defined + # **repoUpdateBranchProtectionPriories** > Void repoUpdateBranchProtectionPriories(owner, repo, body) diff --git a/docs/UpdateBranchRepoOption.md b/docs/UpdateBranchRepoOption.md index 8e586e9..267889b 100644 --- a/docs/UpdateBranchRepoOption.md +++ b/docs/UpdateBranchRepoOption.md @@ -3,4 +3,6 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **String** | New branch name | +**force** | **Boolean** | Force update even if the change is not a fast-forward | [optional] +**newCommitId** | **String** | New commit SHA (or any ref) the branch should point to | +**oldCommitId** | **String** | Expected old commit SHA of the branch; if provided it must match the current tip | [optional] 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 4770e36..c14f069 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java @@ -306,6 +306,20 @@ public interface AdminApi { * @param loginName identifier of the user, provided by the external authenticator (optional) * @param page page number of results to return (1-based) (optional) * @param limit page size of results (optional) + * @param sort sort users by attribute. Supported values are \"name\", + * \"created\", \"updated\" and \"id\". Default is + * \"name\" (optional) + * @param order sort order, either \"asc\" (ascending) or \"desc\" + * (descending). Default is \"asc\", ignored if \"sort\" is not specified. + * (optional) + * @param q search term (username, full name, email) (optional) + * @param visibility visibility filter. Supported values are \"public\", + * \"limited\" and \"private\". (optional) + * @param isActive filter active users (optional) + * @param isAdmin filter admin users (optional) + * @param isRestricted filter restricted users (optional) + * @param is2faEnabled filter 2FA enabled users (optional) + * @param isProhibitLogin filter login prohibited users (optional) * @return Call<List<User>> */ @GET("admin/users") @@ -313,7 +327,16 @@ public interface AdminApi { @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); + @retrofit2.http.Query("limit") Integer limit, + @retrofit2.http.Query("sort") String sort, + @retrofit2.http.Query("order") String order, + @retrofit2.http.Query("q") String q, + @retrofit2.http.Query("visibility") String visibility, + @retrofit2.http.Query("is_active") Boolean isActive, + @retrofit2.http.Query("is_admin") Boolean isAdmin, + @retrofit2.http.Query("is_restricted") Boolean isRestricted, + @retrofit2.http.Query("is_2fa_enabled") Boolean is2faEnabled, + @retrofit2.http.Query("is_prohibit_login") Boolean isProhibitLogin); /** * List unadopted repositories diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/IssueApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/IssueApi.java index c0e4861..fd11a48 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/IssueApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/IssueApi.java @@ -1058,7 +1058,6 @@ public interface IssueApi { * @param milestones Comma-separated list of milestone names. Fetch only issues that have any of * these milestones. Non existent milestones are discarded. (optional) * @param q Search string (optional) - * @param priorityRepoId Repository ID to prioritize in the results (optional) * @param type Filter by issue type (optional) * @param since Only show issues updated after the given time (RFC 3339 format) (optional) * @param before Only show issues updated before the given time (RFC 3339 format) (optional) @@ -1084,7 +1083,6 @@ public interface IssueApi { @retrofit2.http.Query("labels") String labels, @retrofit2.http.Query("milestones") String milestones, @retrofit2.http.Query("q") String q, - @retrofit2.http.Query("priority_repo_id") Long priorityRepoId, @retrofit2.http.Query("type") String type, @retrofit2.http.Query("since") Date since, @retrofit2.http.Query("before") Date before, diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java index f117999..efb69ae 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -102,6 +102,7 @@ import org.gitnex.tea4j.v2.models.TopicResponse; import org.gitnex.tea4j.v2.models.TrackedTime; import org.gitnex.tea4j.v2.models.TransferRepoOption; import org.gitnex.tea4j.v2.models.UpdateBranchProtectionPriories; +import org.gitnex.tea4j.v2.models.UpdateBranchRepoOption; import org.gitnex.tea4j.v2.models.UpdateFileOptions; import org.gitnex.tea4j.v2.models.UpdateRepoAvatarOption; import org.gitnex.tea4j.v2.models.UpdateVariableOption; @@ -2930,6 +2931,23 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Body UpdateRepoAvatarOption body); + /** + * Update a branch reference to a new commit + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param branch name of the branch (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @PUT("repos/{owner}/{repo}/branches/{branch}") + Call repoUpdateBranch( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("branch") String branch, + @retrofit2.http.Body UpdateBranchRepoOption body); + /** * Update the priorities of branch protections for a repository. * diff --git a/src/main/java/org/gitnex/tea4j/v2/models/UpdateBranchRepoOption.java b/src/main/java/org/gitnex/tea4j/v2/models/UpdateBranchRepoOption.java index 5655d73..01b83a2 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/UpdateBranchRepoOption.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/UpdateBranchRepoOption.java @@ -17,31 +17,78 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serializable; import java.util.Objects; -/** UpdateBranchRepoOption options when updating a branch in a repository */ -@Schema(description = "UpdateBranchRepoOption options when updating a branch in a repository") +/** UpdateBranchRepoOption options when updating a branch reference in a repository */ +@Schema( + description = "UpdateBranchRepoOption options when updating a branch reference in a repository") public class UpdateBranchRepoOption implements Serializable { private static final long serialVersionUID = 1L; - @SerializedName("name") - private String name = null; + @SerializedName("force") + private Boolean force = null; - public UpdateBranchRepoOption name(String name) { - this.name = name; + @SerializedName("new_commit_id") + private String newCommitId = null; + + @SerializedName("old_commit_id") + private String oldCommitId = null; + + public UpdateBranchRepoOption force(Boolean force) { + this.force = force; return this; } /** - * New branch name + * Force update even if the change is not a fast-forward * - * @return name + * @return force */ - @Schema(required = true, description = "New branch name") - public String getName() { - return name; + @Schema(description = "Force update even if the change is not a fast-forward") + public Boolean isForce() { + return force; } - public void setName(String name) { - this.name = name; + public void setForce(Boolean force) { + this.force = force; + } + + public UpdateBranchRepoOption newCommitId(String newCommitId) { + this.newCommitId = newCommitId; + return this; + } + + /** + * New commit SHA (or any ref) the branch should point to + * + * @return newCommitId + */ + @Schema(required = true, description = "New commit SHA (or any ref) the branch should point to") + public String getNewCommitId() { + return newCommitId; + } + + public void setNewCommitId(String newCommitId) { + this.newCommitId = newCommitId; + } + + public UpdateBranchRepoOption oldCommitId(String oldCommitId) { + this.oldCommitId = oldCommitId; + return this; + } + + /** + * Expected old commit SHA of the branch; if provided it must match the current tip + * + * @return oldCommitId + */ + @Schema( + description = + "Expected old commit SHA of the branch; if provided it must match the current tip") + public String getOldCommitId() { + return oldCommitId; + } + + public void setOldCommitId(String oldCommitId) { + this.oldCommitId = oldCommitId; } @Override @@ -53,12 +100,14 @@ public class UpdateBranchRepoOption implements Serializable { return false; } UpdateBranchRepoOption updateBranchRepoOption = (UpdateBranchRepoOption) o; - return Objects.equals(this.name, updateBranchRepoOption.name); + return Objects.equals(this.force, updateBranchRepoOption.force) + && Objects.equals(this.newCommitId, updateBranchRepoOption.newCommitId) + && Objects.equals(this.oldCommitId, updateBranchRepoOption.oldCommitId); } @Override public int hashCode() { - return Objects.hash(name); + return Objects.hash(force, newCommitId, oldCommitId); } @Override @@ -66,7 +115,9 @@ public class UpdateBranchRepoOption implements Serializable { StringBuilder sb = new StringBuilder(); sb.append("class UpdateBranchRepoOption {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" force: ").append(toIndentedString(force)).append("\n"); + sb.append(" newCommitId: ").append(toIndentedString(newCommitId)).append("\n"); + sb.append(" oldCommitId: ").append(toIndentedString(oldCommitId)).append("\n"); sb.append("}"); return sb.toString(); }