diff --git a/docs/CommitApi.md b/docs/CommitApi.md new file mode 100644 index 0000000..8fae1ec --- /dev/null +++ b/docs/CommitApi.md @@ -0,0 +1,99 @@ +# CommitApi + +All URIs are relative to *https://{{AppSubUrl | JSEscape}}/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**information**](CommitApi.md#information) | **GET** repos/{owner}/{repo}/compare/{basehead} | Get commit comparison information + + +# **information** +> Compare information(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.CommitApi; + +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"); + +CommitApi apiInstance = new CommitApi(); +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.information(owner, repo, basehead); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling CommitApi#information"); + 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 + - **Accept**: application/json + diff --git a/docs/Compare.md b/docs/Compare.md new file mode 100644 index 0000000..7673143 --- /dev/null +++ b/docs/Compare.md @@ -0,0 +1,7 @@ +# Compare + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commits** | [**List<Commit>**](Commit.md) | | [optional] +**totalCommits** | **Long** | | [optional] diff --git a/docs/ComparisonApi.md b/docs/ComparisonApi.md new file mode 100644 index 0000000..4bb4d0c --- /dev/null +++ b/docs/ComparisonApi.md @@ -0,0 +1,99 @@ +# ComparisonApi + +All URIs are relative to *https://{{AppSubUrl | JSEscape}}/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**information**](ComparisonApi.md#information) | **GET** repos/{owner}/{repo}/compare/{basehead} | Get commit comparison information + + +# **information** +> Compare information(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.ComparisonApi; + +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"); + +ComparisonApi apiInstance = new ComparisonApi(); +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.information(owner, repo, basehead); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ComparisonApi#information"); + 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 + - **Accept**: application/json + diff --git a/docs/GetApi.md b/docs/GetApi.md new file mode 100644 index 0000000..644f542 --- /dev/null +++ b/docs/GetApi.md @@ -0,0 +1,99 @@ +# GetApi + +All URIs are relative to *https://{{AppSubUrl | JSEscape}}/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**information**](GetApi.md#information) | **GET** repos/{owner}/{repo}/compare/{basehead} | Get commit comparison information + + +# **information** +> Compare information(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.GetApi; + +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"); + +GetApi apiInstance = new GetApi(); +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.information(owner, repo, basehead); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling GetApi#information"); + 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 + - **Accept**: application/json + diff --git a/docs/User.md b/docs/User.md index f57821f..6dfb932 100644 --- a/docs/User.md +++ b/docs/User.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **loginName** | **String** | the user's authentication sign-in name. | [optional] **prohibitLogin** | **Boolean** | Is user login prohibited | [optional] **restricted** | **Boolean** | Is user restricted | [optional] +**sourceId** | **Long** | The ID of the user's Authentication Source | [optional] **starredReposCount** | **Long** | | [optional] **visibility** | **String** | User visibility level option: public, limited, private | [optional] **website** | **String** | the user's website | [optional] diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/CommitApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/CommitApi.java new file mode 100644 index 0000000..b88d653 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/apis/CommitApi.java @@ -0,0 +1,22 @@ +package org.gitnex.tea4j.v2.apis; + +import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.Compare; +import retrofit2.Call; +import retrofit2.http.*; + +public interface CommitApi { + /** + * 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 information( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("basehead") String basehead); +} diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/ComparisonApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/ComparisonApi.java new file mode 100644 index 0000000..601a5fa --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/apis/ComparisonApi.java @@ -0,0 +1,22 @@ +package org.gitnex.tea4j.v2.apis; + +import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.Compare; +import retrofit2.Call; +import retrofit2.http.*; + +public interface ComparisonApi { + /** + * 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 information( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("basehead") String basehead); +} diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/GetApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/GetApi.java new file mode 100644 index 0000000..d881ce2 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/apis/GetApi.java @@ -0,0 +1,22 @@ +package org.gitnex.tea4j.v2.apis; + +import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.Compare; +import retrofit2.Call; +import retrofit2.http.*; + +public interface GetApi { + /** + * 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 information( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("basehead") String basehead); +} diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Compare.java b/src/main/java/org/gitnex/tea4j/v2/models/Compare.java new file mode 100644 index 0000000..f710c37 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/Compare.java @@ -0,0 +1,116 @@ +/* + * 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.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Compare */ +public class Compare implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("commits") + private List commits = null; + + @SerializedName("total_commits") + private Long totalCommits = null; + + public Compare commits(List commits) { + this.commits = commits; + return this; + } + + public Compare addCommitsItem(Commit commitsItem) { + if (this.commits == null) { + this.commits = new ArrayList<>(); + } + this.commits.add(commitsItem); + return this; + } + + /** + * Get commits + * + * @return commits + */ + @Schema(description = "") + public List getCommits() { + return commits; + } + + public void setCommits(List commits) { + this.commits = commits; + } + + public Compare totalCommits(Long totalCommits) { + this.totalCommits = totalCommits; + return this; + } + + /** + * Get totalCommits + * + * @return totalCommits + */ + @Schema(description = "") + public Long getTotalCommits() { + return totalCommits; + } + + public void setTotalCommits(Long totalCommits) { + this.totalCommits = totalCommits; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Compare compare = (Compare) o; + return Objects.equals(this.commits, compare.commits) + && Objects.equals(this.totalCommits, compare.totalCommits); + } + + @Override + public int hashCode() { + return Objects.hash(commits, totalCommits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Compare {\n"); + + sb.append(" commits: ").append(toIndentedString(commits)).append("\n"); + sb.append(" totalCommits: ").append(toIndentedString(totalCommits)).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/User.java b/src/main/java/org/gitnex/tea4j/v2/models/User.java index 47b8fd7..2ff0513 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/User.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/User.java @@ -74,6 +74,9 @@ public class User implements Serializable { @SerializedName("restricted") private Boolean restricted = null; + @SerializedName("source_id") + private Long sourceId = null; + @SerializedName("starred_repos_count") private Long starredReposCount = null; @@ -406,6 +409,25 @@ public class User implements Serializable { this.restricted = restricted; } + public User sourceId(Long sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * The ID of the user's Authentication Source + * + * @return sourceId + */ + @Schema(description = "The ID of the user's Authentication Source") + public Long getSourceId() { + return sourceId; + } + + public void setSourceId(Long sourceId) { + this.sourceId = sourceId; + } + public User starredReposCount(Long starredReposCount) { this.starredReposCount = starredReposCount; return this; @@ -489,6 +511,7 @@ public class User implements Serializable { && Objects.equals(this.loginName, user.loginName) && Objects.equals(this.prohibitLogin, user.prohibitLogin) && Objects.equals(this.restricted, user.restricted) + && Objects.equals(this.sourceId, user.sourceId) && Objects.equals(this.starredReposCount, user.starredReposCount) && Objects.equals(this.visibility, user.visibility) && Objects.equals(this.website, user.website); @@ -514,6 +537,7 @@ public class User implements Serializable { loginName, prohibitLogin, restricted, + sourceId, starredReposCount, visibility, website); @@ -541,6 +565,7 @@ public class User implements Serializable { sb.append(" loginName: ").append(toIndentedString(loginName)).append("\n"); sb.append(" prohibitLogin: ").append(toIndentedString(prohibitLogin)).append("\n"); sb.append(" restricted: ").append(toIndentedString(restricted)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); sb.append(" starredReposCount: ").append(toIndentedString(starredReposCount)).append("\n"); sb.append(" visibility: ").append(toIndentedString(visibility)).append("\n"); sb.append(" website: ").append(toIndentedString(website)).append("\n");