diff --git a/docs/MergeUpstreamRequest.md b/docs/MergeUpstreamRequest.md new file mode 100644 index 0000000..b21d3d5 --- /dev/null +++ b/docs/MergeUpstreamRequest.md @@ -0,0 +1,6 @@ +# MergeUpstreamRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branch** | **String** | | [optional] diff --git a/docs/MergeUpstreamResponse.md b/docs/MergeUpstreamResponse.md new file mode 100644 index 0000000..c9b9fe0 --- /dev/null +++ b/docs/MergeUpstreamResponse.md @@ -0,0 +1,6 @@ +# MergeUpstreamResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mergeType** | **String** | | [optional] diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index afe2509..5bc52ef 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -143,6 +143,7 @@ Method | HTTP request | Description [**repoListTeams**](RepositoryApi.md#repoListTeams) | **GET** repos/{owner}/{repo}/teams | List a repository's teams [**repoListTopics**](RepositoryApi.md#repoListTopics) | **GET** repos/{owner}/{repo}/topics | Get list of topics that a repository has [**repoMergePullRequest**](RepositoryApi.md#repoMergePullRequest) | **POST** repos/{owner}/{repo}/pulls/{index}/merge | Merge a pull request +[**repoMergeUpstream**](RepositoryApi.md#repoMergeUpstream) | **POST** repos/{owner}/{repo}/merge-upstream | Merge a branch from upstream [**repoMigrate**](RepositoryApi.md#repoMigrate) | **POST** repos/migrate | Migrate a remote git repository [**repoMirrorSync**](RepositoryApi.md#repoMirrorSync) | **POST** repos/{owner}/{repo}/mirror-sync | Sync a mirrored repository [**repoNewPinAllowed**](RepositoryApi.md#repoNewPinAllowed) | **GET** repos/{owner}/{repo}/new_pin_allowed | Returns if new Issue Pins are allowed @@ -13062,6 +13063,97 @@ Name | Type | Description | Notes - **Content-Type**: application/json, text/plain - **Accept**: Not defined + +# **repoMergeUpstream** +> MergeUpstreamResponse repoMergeUpstream(owner, repo, body) + +Merge a branch from upstream + +### 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 +MergeUpstreamRequest body = new MergeUpstreamRequest(); // MergeUpstreamRequest | +try { + MergeUpstreamResponse result = apiInstance.repoMergeUpstream(owner, repo, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoMergeUpstream"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**MergeUpstreamRequest**](MergeUpstreamRequest.md)| | [optional] + +### Return type + +[**MergeUpstreamResponse**](MergeUpstreamResponse.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**: application/json + # **repoMigrate** > Repository repoMigrate(body) 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 ee18a5b..6e8fa05 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -63,6 +63,8 @@ import org.gitnex.tea4j.v2.models.IssueConfig; import org.gitnex.tea4j.v2.models.IssueConfigValidation; import org.gitnex.tea4j.v2.models.IssueTemplate; import org.gitnex.tea4j.v2.models.MergePullRequestOption; +import org.gitnex.tea4j.v2.models.MergeUpstreamRequest; +import org.gitnex.tea4j.v2.models.MergeUpstreamResponse; import org.gitnex.tea4j.v2.models.MigrateRepoOptions; import org.gitnex.tea4j.v2.models.NewIssuePinsAllowed; import org.gitnex.tea4j.v2.models.Note; @@ -2250,6 +2252,21 @@ public interface RepositoryApi { @retrofit2.http.Path("index") Long index, @retrofit2.http.Body MergePullRequestOption body); + /** + * Merge a branch from upstream + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param body (optional) + * @return Call<MergeUpstreamResponse> + */ + @Headers({"Content-Type:application/json"}) + @POST("repos/{owner}/{repo}/merge-upstream") + Call repoMergeUpstream( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Body MergeUpstreamRequest body); + /** * Migrate a remote git repository * diff --git a/src/main/java/org/gitnex/tea4j/v2/models/MergeUpstreamRequest.java b/src/main/java/org/gitnex/tea4j/v2/models/MergeUpstreamRequest.java new file mode 100644 index 0000000..c84cc5f --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/MergeUpstreamRequest.java @@ -0,0 +1,82 @@ +/* + * 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; + +/** MergeUpstreamRequest */ +public class MergeUpstreamRequest implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("branch") + private String branch = null; + + public MergeUpstreamRequest branch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get branch + * + * @return branch + */ + @Schema(description = "") + public String getBranch() { + return branch; + } + + public void setBranch(String branch) { + this.branch = branch; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeUpstreamRequest mergeUpstreamRequest = (MergeUpstreamRequest) o; + return Objects.equals(this.branch, mergeUpstreamRequest.branch); + } + + @Override + public int hashCode() { + return Objects.hash(branch); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MergeUpstreamRequest {\n"); + + sb.append(" branch: ").append(toIndentedString(branch)).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 "); + } +} diff --git a/src/main/java/org/gitnex/tea4j/v2/models/MergeUpstreamResponse.java b/src/main/java/org/gitnex/tea4j/v2/models/MergeUpstreamResponse.java new file mode 100644 index 0000000..2e335f9 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/MergeUpstreamResponse.java @@ -0,0 +1,82 @@ +/* + * 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; + +/** MergeUpstreamResponse */ +public class MergeUpstreamResponse implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("merge_type") + private String mergeType = null; + + public MergeUpstreamResponse mergeType(String mergeType) { + this.mergeType = mergeType; + return this; + } + + /** + * Get mergeType + * + * @return mergeType + */ + @Schema(description = "") + public String getMergeType() { + return mergeType; + } + + public void setMergeType(String mergeType) { + this.mergeType = mergeType; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MergeUpstreamResponse mergeUpstreamResponse = (MergeUpstreamResponse) o; + return Objects.equals(this.mergeType, mergeUpstreamResponse.mergeType); + } + + @Override + public int hashCode() { + return Objects.hash(mergeType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MergeUpstreamResponse {\n"); + + sb.append(" mergeType: ").append(toIndentedString(mergeType)).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 "); + } +}