From 79c3e09d3da79fb8d3245cfa7dc8ddeaaeb5de67 Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Fri, 12 Jun 2026 00:02:09 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/ActionWorkflowRun.md | 1 + docs/PullRequestMinimal.md | 10 + docs/PullRequestMinimalHead.md | 8 + docs/PullRequestMinimalHeadRepo.md | 8 + docs/RepositoryApi.md | 114 ++++++++++- .../gitnex/tea4j/v2/apis/RepositoryApi.java | 36 ++++ .../tea4j/v2/models/ActionWorkflowRun.java | 35 ++++ .../tea4j/v2/models/PullRequestMinimal.java | 185 ++++++++++++++++++ .../v2/models/PullRequestMinimalHead.java | 130 ++++++++++++ .../v2/models/PullRequestMinimalHeadRepo.java | 130 ++++++++++++ 10 files changed, 655 insertions(+), 2 deletions(-) create mode 100644 docs/PullRequestMinimal.md create mode 100644 docs/PullRequestMinimalHead.md create mode 100644 docs/PullRequestMinimalHeadRepo.md create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimal.java create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimalHead.java create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimalHeadRepo.java diff --git a/docs/ActionWorkflowRun.md b/docs/ActionWorkflowRun.md index 82369db..f0bb41b 100644 --- a/docs/ActionWorkflowRun.md +++ b/docs/ActionWorkflowRun.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **path** | **String** | | [optional] **previousAttemptUrl** | **String** | PreviousAttemptURL is the API URL of the previous attempt of this run, e.g. \".../actions/runs/{run_id}/attempts/{attempt-1}\". It is set only when the current attempt is > 1 (i.e. a rerun). For the first attempt, or for legacy runs that pre-date ActionRunAttempt, it is null. | [optional] +**pullRequests** | [**List<PullRequestMinimal>**](PullRequestMinimal.md) | | [optional] **repository** | [**Repository**](Repository.md) | | [optional] **repositoryId** | **Long** | | [optional] **runAttempt** | **Long** | RunAttempt is 1-based for runs created after ActionRunAttempt was introduced. A value of 0 is a legacy-only sentinel for runs created before attempts existed and indicates no corresponding /attempts/{n} resource is available. | [optional] diff --git a/docs/PullRequestMinimal.md b/docs/PullRequestMinimal.md new file mode 100644 index 0000000..228f824 --- /dev/null +++ b/docs/PullRequestMinimal.md @@ -0,0 +1,10 @@ +# PullRequestMinimal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**base** | [**PullRequestMinimalHead**](PullRequestMinimalHead.md) | | [optional] +**head** | [**PullRequestMinimalHead**](PullRequestMinimalHead.md) | | [optional] +**id** | **Long** | | [optional] +**number** | **Long** | | [optional] +**url** | **String** | | [optional] diff --git a/docs/PullRequestMinimalHead.md b/docs/PullRequestMinimalHead.md new file mode 100644 index 0000000..6e90bc6 --- /dev/null +++ b/docs/PullRequestMinimalHead.md @@ -0,0 +1,8 @@ +# PullRequestMinimalHead + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ref** | **String** | | [optional] +**repo** | [**PullRequestMinimalHeadRepo**](PullRequestMinimalHeadRepo.md) | | [optional] +**sha** | **String** | | [optional] diff --git a/docs/PullRequestMinimalHeadRepo.md b/docs/PullRequestMinimalHeadRepo.md new file mode 100644 index 0000000..812fb8b --- /dev/null +++ b/docs/PullRequestMinimalHeadRepo.md @@ -0,0 +1,8 @@ +# PullRequestMinimalHeadRepo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] +**url** | **String** | | [optional] diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index d0d8488..43f7f65 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -10,6 +10,7 @@ Method | HTTP request | Description [**actionsEnableWorkflow**](RepositoryApi.md#actionsEnableWorkflow) | **PUT** repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable | Enable a workflow [**actionsGetWorkflow**](RepositoryApi.md#actionsGetWorkflow) | **GET** repos/{owner}/{repo}/actions/workflows/{workflow_id} | Get a workflow [**actionsListRepositoryWorkflows**](RepositoryApi.md#actionsListRepositoryWorkflows) | **GET** repos/{owner}/{repo}/actions/workflows | List repository workflows +[**actionsListWorkflowRuns**](RepositoryApi.md#actionsListWorkflowRuns) | **GET** repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs | List runs for a workflow [**createCurrentUserRepo**](RepositoryApi.md#createCurrentUserRepo) | **POST** user/repos | Create a repository [**createFork**](RepositoryApi.md#createFork) | **POST** repos/{owner}/{repo}/forks | Fork a repository [**createRepoVariable**](RepositoryApi.md#createRepoVariable) | **POST** repos/{owner}/{repo}/actions/variables/{variablename} | Create a repo-level variable @@ -747,6 +748,113 @@ 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 + + +# **actionsListWorkflowRuns** +> ActionWorkflowRunsResponse actionsListWorkflowRuns(owner, repo, workflowId, event, branch, status, actor, headSha, excludePullRequests, page, limit) + +List runs for a workflow + +### 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 workflowId = "workflowId_example"; // String | id of the workflow, must be the workflow file name (e.g. `build.yml`) +String event = "event_example"; // String | workflow event name +String branch = "branch_example"; // String | workflow branch +String status = "status_example"; // String | workflow status (pending, queued, in_progress, failure, success, skipped) +String actor = "actor_example"; // String | triggered by user +String headSha = "headSha_example"; // String | triggering sha of the workflow run +Boolean excludePullRequests = true; // Boolean | if true, the `pull_requests` field on each returned run is emptied +Integer page = 56; // Integer | page number of results to return (1-based) +Integer limit = 56; // Integer | page size of results +try { + ActionWorkflowRunsResponse result = apiInstance.actionsListWorkflowRuns(owner, repo, workflowId, event, branch, status, actor, headSha, excludePullRequests, page, limit); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#actionsListWorkflowRuns"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **workflowId** | **String**| id of the workflow, must be the workflow file name (e.g. `build.yml`) | + **event** | **String**| workflow event name | [optional] + **branch** | **String**| workflow branch | [optional] + **status** | **String**| workflow status (pending, queued, in_progress, failure, success, skipped) | [optional] + **actor** | **String**| triggered by user | [optional] + **headSha** | **String**| triggering sha of the workflow run | [optional] + **excludePullRequests** | **Boolean**| if true, the `pull_requests` field on each returned run is emptied | [optional] + **page** | **Integer**| page number of results to return (1-based) | [optional] + **limit** | **Integer**| page size of results | [optional] + +### Return type + +[**ActionWorkflowRunsResponse**](ActionWorkflowRunsResponse.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 @@ -2948,7 +3056,7 @@ Name | Type | Description | Notes # **getWorkflowRuns** -> ActionWorkflowRunsResponse getWorkflowRuns(owner, repo, event, branch, status, actor, headSha, page, limit) +> ActionWorkflowRunsResponse getWorkflowRuns(owner, repo, event, branch, status, actor, headSha, excludePullRequests, page, limit) Lists all runs for a repository run @@ -3011,10 +3119,11 @@ String branch = "branch_example"; // String | workflow branch String status = "status_example"; // String | workflow status (pending, queued, in_progress, failure, success, skipped) String actor = "actor_example"; // String | triggered by user String headSha = "headSha_example"; // String | triggering sha of the workflow run +Boolean excludePullRequests = true; // Boolean | if true, the `pull_requests` field on each returned run is emptied Integer page = 56; // Integer | page number of results to return (1-based) Integer limit = 56; // Integer | page size of results try { - ActionWorkflowRunsResponse result = apiInstance.getWorkflowRuns(owner, repo, event, branch, status, actor, headSha, page, limit); + ActionWorkflowRunsResponse result = apiInstance.getWorkflowRuns(owner, repo, event, branch, status, actor, headSha, excludePullRequests, page, limit); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoryApi#getWorkflowRuns"); @@ -3033,6 +3142,7 @@ Name | Type | Description | Notes **status** | **String**| workflow status (pending, queued, in_progress, failure, success, skipped) | [optional] **actor** | **String**| triggered by user | [optional] **headSha** | **String**| triggering sha of the workflow run | [optional] + **excludePullRequests** | **Boolean**| if true, the `pull_requests` field on each returned run is emptied | [optional] **page** | **Integer**| page number of results to return (1-based) | [optional] **limit** | **Integer**| page size of results | [optional] 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 c601e6c..f43a950 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -204,6 +204,39 @@ public interface RepositoryApi { Call actionsListRepositoryWorkflows( @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo); + /** + * List runs for a workflow + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param workflowId id of the workflow, must be the workflow file name (e.g. + * `build.yml`) (required) + * @param event workflow event name (optional) + * @param branch workflow branch (optional) + * @param status workflow status (pending, queued, in_progress, failure, success, skipped) + * (optional) + * @param actor triggered by user (optional) + * @param headSha triggering sha of the workflow run (optional) + * @param excludePullRequests if true, the `pull_requests` field on each returned run is + * emptied (optional) + * @param page page number of results to return (1-based) (optional) + * @param limit page size of results (optional) + * @return Call<ActionWorkflowRunsResponse> + */ + @GET("repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs") + Call actionsListWorkflowRuns( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("workflow_id") String workflowId, + @retrofit2.http.Query("event") String event, + @retrofit2.http.Query("branch") String branch, + @retrofit2.http.Query("status") String status, + @retrofit2.http.Query("actor") String actor, + @retrofit2.http.Query("head_sha") String headSha, + @retrofit2.http.Query("exclude_pull_requests") Boolean excludePullRequests, + @retrofit2.http.Query("page") Integer page, + @retrofit2.http.Query("limit") Integer limit); + /** * Create a repository * @@ -566,6 +599,8 @@ public interface RepositoryApi { * (optional) * @param actor triggered by user (optional) * @param headSha triggering sha of the workflow run (optional) + * @param excludePullRequests if true, the `pull_requests` field on each returned run is + * emptied (optional) * @param page page number of results to return (1-based) (optional) * @param limit page size of results (optional) * @return Call<ActionWorkflowRunsResponse> @@ -579,6 +614,7 @@ public interface RepositoryApi { @retrofit2.http.Query("status") String status, @retrofit2.http.Query("actor") String actor, @retrofit2.http.Query("head_sha") String headSha, + @retrofit2.http.Query("exclude_pull_requests") Boolean excludePullRequests, @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/ActionWorkflowRun.java b/src/main/java/org/gitnex/tea4j/v2/models/ActionWorkflowRun.java index a70440e..8e1b9fb 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/ActionWorkflowRun.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/ActionWorkflowRun.java @@ -15,7 +15,9 @@ 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.Date; +import java.util.List; import java.util.Objects; /** ActionWorkflowRun represents a WorkflowRun */ @@ -59,6 +61,9 @@ public class ActionWorkflowRun implements Serializable { @SerializedName("previous_attempt_url") private String previousAttemptUrl = null; + @SerializedName("pull_requests") + private List pullRequests = null; + @SerializedName("repository") private Repository repository = null; @@ -319,6 +324,33 @@ public class ActionWorkflowRun implements Serializable { this.previousAttemptUrl = previousAttemptUrl; } + public ActionWorkflowRun pullRequests(List pullRequests) { + this.pullRequests = pullRequests; + return this; + } + + public ActionWorkflowRun addPullRequestsItem(PullRequestMinimal pullRequestsItem) { + if (this.pullRequests == null) { + this.pullRequests = new ArrayList<>(); + } + this.pullRequests.add(pullRequestsItem); + return this; + } + + /** + * Get pullRequests + * + * @return pullRequests + */ + @Schema(description = "") + public List getPullRequests() { + return pullRequests; + } + + public void setPullRequests(List pullRequests) { + this.pullRequests = pullRequests; + } + public ActionWorkflowRun repository(Repository repository) { this.repository = repository; return this; @@ -498,6 +530,7 @@ public class ActionWorkflowRun implements Serializable { && Objects.equals(this.id, actionWorkflowRun.id) && Objects.equals(this.path, actionWorkflowRun.path) && Objects.equals(this.previousAttemptUrl, actionWorkflowRun.previousAttemptUrl) + && Objects.equals(this.pullRequests, actionWorkflowRun.pullRequests) && Objects.equals(this.repository, actionWorkflowRun.repository) && Objects.equals(this.repositoryId, actionWorkflowRun.repositoryId) && Objects.equals(this.runAttempt, actionWorkflowRun.runAttempt) @@ -523,6 +556,7 @@ public class ActionWorkflowRun implements Serializable { id, path, previousAttemptUrl, + pullRequests, repository, repositoryId, runAttempt, @@ -550,6 +584,7 @@ public class ActionWorkflowRun implements Serializable { sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" path: ").append(toIndentedString(path)).append("\n"); sb.append(" previousAttemptUrl: ").append(toIndentedString(previousAttemptUrl)).append("\n"); + sb.append(" pullRequests: ").append(toIndentedString(pullRequests)).append("\n"); sb.append(" repository: ").append(toIndentedString(repository)).append("\n"); sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).append("\n"); sb.append(" runAttempt: ").append(toIndentedString(runAttempt)).append("\n"); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimal.java b/src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimal.java new file mode 100644 index 0000000..f9fee8b --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimal.java @@ -0,0 +1,185 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{.SwaggerAppVer}} + * + * + * 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; + +/** + * PullRequestMinimal is the minimal information about a pull request, as returned in the + * `pull_requests` field of a workflow run. + */ +@Schema( + description = + "PullRequestMinimal is the minimal information about a pull request, as returned in the" + + " `pull_requests` field of a workflow run.") +public class PullRequestMinimal implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("base") + private PullRequestMinimalHead base = null; + + @SerializedName("head") + private PullRequestMinimalHead head = null; + + @SerializedName("id") + private Long id = null; + + @SerializedName("number") + private Long number = null; + + @SerializedName("url") + private String url = null; + + public PullRequestMinimal base(PullRequestMinimalHead base) { + this.base = base; + return this; + } + + /** + * Get base + * + * @return base + */ + @Schema(description = "") + public PullRequestMinimalHead getBase() { + return base; + } + + public void setBase(PullRequestMinimalHead base) { + this.base = base; + } + + public PullRequestMinimal head(PullRequestMinimalHead head) { + this.head = head; + return this; + } + + /** + * Get head + * + * @return head + */ + @Schema(description = "") + public PullRequestMinimalHead getHead() { + return head; + } + + public void setHead(PullRequestMinimalHead head) { + this.head = head; + } + + public PullRequestMinimal id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @Schema(description = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public PullRequestMinimal number(Long number) { + this.number = number; + return this; + } + + /** + * Get number + * + * @return number + */ + @Schema(description = "") + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public PullRequestMinimal url(String url) { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url + */ + @Schema(description = "") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullRequestMinimal pullRequestMinimal = (PullRequestMinimal) o; + return Objects.equals(this.base, pullRequestMinimal.base) + && Objects.equals(this.head, pullRequestMinimal.head) + && Objects.equals(this.id, pullRequestMinimal.id) + && Objects.equals(this.number, pullRequestMinimal.number) + && Objects.equals(this.url, pullRequestMinimal.url); + } + + @Override + public int hashCode() { + return Objects.hash(base, head, id, number, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestMinimal {\n"); + + sb.append(" base: ").append(toIndentedString(base)).append("\n"); + sb.append(" head: ").append(toIndentedString(head)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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/PullRequestMinimalHead.java b/src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimalHead.java new file mode 100644 index 0000000..49daba1 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimalHead.java @@ -0,0 +1,130 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{.SwaggerAppVer}} + * + * + * 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; + +/** PullRequestMinimalHead */ +public class PullRequestMinimalHead implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("ref") + private String ref = null; + + @SerializedName("repo") + private PullRequestMinimalHeadRepo repo = null; + + @SerializedName("sha") + private String sha = null; + + public PullRequestMinimalHead ref(String ref) { + this.ref = ref; + return this; + } + + /** + * Get ref + * + * @return ref + */ + @Schema(description = "") + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + public PullRequestMinimalHead repo(PullRequestMinimalHeadRepo repo) { + this.repo = repo; + return this; + } + + /** + * Get repo + * + * @return repo + */ + @Schema(description = "") + public PullRequestMinimalHeadRepo getRepo() { + return repo; + } + + public void setRepo(PullRequestMinimalHeadRepo repo) { + this.repo = repo; + } + + public PullRequestMinimalHead sha(String sha) { + this.sha = sha; + return this; + } + + /** + * Get sha + * + * @return sha + */ + @Schema(description = "") + public String getSha() { + return sha; + } + + public void setSha(String sha) { + this.sha = sha; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullRequestMinimalHead pullRequestMinimalHead = (PullRequestMinimalHead) o; + return Objects.equals(this.ref, pullRequestMinimalHead.ref) + && Objects.equals(this.repo, pullRequestMinimalHead.repo) + && Objects.equals(this.sha, pullRequestMinimalHead.sha); + } + + @Override + public int hashCode() { + return Objects.hash(ref, repo, sha); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestMinimalHead {\n"); + + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" repo: ").append(toIndentedString(repo)).append("\n"); + sb.append(" sha: ").append(toIndentedString(sha)).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/PullRequestMinimalHeadRepo.java b/src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimalHeadRepo.java new file mode 100644 index 0000000..4768bfe --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/PullRequestMinimalHeadRepo.java @@ -0,0 +1,130 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{.SwaggerAppVer}} + * + * + * 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; + +/** PullRequestMinimalHeadRepo */ +public class PullRequestMinimalHeadRepo implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("id") + private Long id = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("url") + private String url = null; + + public PullRequestMinimalHeadRepo id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @Schema(description = "") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public PullRequestMinimalHeadRepo name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @Schema(description = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public PullRequestMinimalHeadRepo url(String url) { + this.url = url; + return this; + } + + /** + * Get url + * + * @return url + */ + @Schema(description = "") + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PullRequestMinimalHeadRepo pullRequestMinimalHeadRepo = (PullRequestMinimalHeadRepo) o; + return Objects.equals(this.id, pullRequestMinimalHeadRepo.id) + && Objects.equals(this.name, pullRequestMinimalHeadRepo.name) + && Objects.equals(this.url, pullRequestMinimalHeadRepo.url); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, url); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PullRequestMinimalHeadRepo {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).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 "); + } +}