From 4294999428a2854bb5958302b59374b32dbbab6d Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Wed, 24 Apr 2024 00:04:44 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/RepositoryApi.md | 92 +++++++++++++++++++ .../gitnex/tea4j/v2/apis/RepositoryApi.java | 15 +++ 2 files changed, 107 insertions(+) diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index 0b655dd..8d3f422 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -27,6 +27,7 @@ Method | HTTP request | Description [**repoChangeFiles**](RepositoryApi.md#repoChangeFiles) | **POST** repos/{owner}/{repo}/contents | Modify multiple files in a repository [**repoCheckCollaborator**](RepositoryApi.md#repoCheckCollaborator) | **GET** repos/{owner}/{repo}/collaborators/{collaborator} | Check if a user is a collaborator of a repository [**repoCheckTeam**](RepositoryApi.md#repoCheckTeam) | **GET** repos/{owner}/{repo}/teams/{team} | Check if a team is assigned to a repository +[**repoCompareDiff**](RepositoryApi.md#repoCompareDiff) | **GET** repos/{owner}/{repo}/compare/{basehead} | Get commit comparison information [**repoCreateBranch**](RepositoryApi.md#repoCreateBranch) | **POST** repos/{owner}/{repo}/branches | Create a branch [**repoCreateBranchProtection**](RepositoryApi.md#repoCreateBranchProtection) | **POST** repos/{owner}/{repo}/branch_protections | Create a branch protections for a repository [**repoCreateFile**](RepositoryApi.md#repoCreateFile) | **POST** repos/{owner}/{repo}/contents/{filepath} | Create a file in a repository @@ -2253,6 +2254,97 @@ 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 + + +# **repoCompareDiff** +> Compare repoCompareDiff(owner, repo, basehead) + +Get commit comparison information + +### 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 basehead = "basehead_example"; // String | compare two branches or commits +try { + Compare result = apiInstance.repoCompareDiff(owner, repo, basehead); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoCompareDiff"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **basehead** | **String**| compare two branches or commits | + +### Return type + +[**Compare**](Compare.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/RepositoryApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java index c83bd47..a3558ca 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -17,6 +17,7 @@ import org.gitnex.tea4j.v2.models.ChangedFile; import org.gitnex.tea4j.v2.models.CombinedStatus; import org.gitnex.tea4j.v2.models.Commit; import org.gitnex.tea4j.v2.models.CommitStatus; +import org.gitnex.tea4j.v2.models.Compare; import org.gitnex.tea4j.v2.models.ContentsResponse; import org.gitnex.tea4j.v2.models.CreateBranchProtectionOption; import org.gitnex.tea4j.v2.models.CreateBranchRepoOption; @@ -426,6 +427,20 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("team") String team); + /** + * Get commit comparison information + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param basehead compare two branches or commits (required) + * @return Call<Compare> + */ + @GET("repos/{owner}/{repo}/compare/{basehead}") + Call repoCompareDiff( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("basehead") String basehead); + /** * Create a branch *