diff --git a/docs/AdminApi.md b/docs/AdminApi.md index de03fc8..45f3565 100644 --- a/docs/AdminApi.md +++ b/docs/AdminApi.md @@ -1266,7 +1266,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -2065,7 +2065,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -2450,7 +2450,7 @@ Name | Type | Description | Notes # **getAdminRunner** -> Void getAdminRunner(runnerId) +> ActionRunner getAdminRunner(runnerId) Get a global runner @@ -2508,7 +2508,7 @@ Token.setApiKey("YOUR API KEY"); AdminApi apiInstance = new AdminApi(); String runnerId = "runnerId_example"; // String | id of the runner try { - Void result = apiInstance.getAdminRunner(runnerId); + ActionRunner result = apiInstance.getAdminRunner(runnerId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdminApi#getAdminRunner"); @@ -2524,7 +2524,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -2533,11 +2533,11 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **getAdminRunners** -> Void getAdminRunners(disabled) +> ActionRunnersResponse getAdminRunners(disabled) Get all runners @@ -2595,7 +2595,7 @@ Token.setApiKey("YOUR API KEY"); AdminApi apiInstance = new AdminApi(); Boolean disabled = true; // Boolean | filter by disabled status (true or false) try { - Void result = apiInstance.getAdminRunners(disabled); + ActionRunnersResponse result = apiInstance.getAdminRunners(disabled); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdminApi#getAdminRunners"); @@ -2611,7 +2611,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunnersResponse**](ActionRunnersResponse.md) ### Authorization @@ -2620,7 +2620,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **listAdminWorkflowJobs** @@ -2814,7 +2814,7 @@ Name | Type | Description | Notes # **updateAdminRunner** -> Void updateAdminRunner(runnerId, body) +> ActionRunner updateAdminRunner(runnerId, body) Update a global runner @@ -2873,7 +2873,7 @@ AdminApi apiInstance = new AdminApi(); String runnerId = "runnerId_example"; // String | id of the runner EditActionRunnerOption body = new EditActionRunnerOption(); // EditActionRunnerOption | try { - Void result = apiInstance.updateAdminRunner(runnerId, body); + ActionRunner result = apiInstance.updateAdminRunner(runnerId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AdminApi#updateAdminRunner"); @@ -2890,7 +2890,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -2899,5 +2899,5 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/json diff --git a/docs/CreatePullReviewOptions.md b/docs/CreatePullReviewOptions.md index 263ec9c..a11bcbd 100644 --- a/docs/CreatePullReviewOptions.md +++ b/docs/CreatePullReviewOptions.md @@ -6,4 +6,14 @@ Name | Type | Description | Notes **body** | **String** | | [optional] **comments** | [**List<CreatePullReviewComment>**](CreatePullReviewComment.md) | | [optional] **commitId** | **String** | | [optional] -**event** | **String** | | [optional] +**event** | [**EventEnum**](#EventEnum) | | [optional] + + +## Enum: EventEnum +Name | Value +---- | ----- +APPROVED | "APPROVED" +PENDING | "PENDING" +COMMENT | "COMMENT" +REQUEST_CHANGES | "REQUEST_CHANGES" +REQUEST_REVIEW | "REQUEST_REVIEW" diff --git a/docs/EditIssueOption.md b/docs/EditIssueOption.md index cd03e79..9bb3a4b 100644 --- a/docs/EditIssueOption.md +++ b/docs/EditIssueOption.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes **assignee** | **String** | deprecated | [optional] **assignees** | **List<String>** | | [optional] **body** | **String** | | [optional] +**contentVersion** | **Long** | The current version of the issue content to detect conflicts during editing | [optional] **dueDate** | [**Date**](Date.md) | | [optional] **milestone** | **Long** | | [optional] **ref** | **String** | | [optional] diff --git a/docs/EditMilestoneOption.md b/docs/EditMilestoneOption.md index c5f34a1..73f0a17 100644 --- a/docs/EditMilestoneOption.md +++ b/docs/EditMilestoneOption.md @@ -5,5 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **description** | **String** | Description provides updated details about the milestone | [optional] **dueOn** | [**Date**](Date.md) | Deadline is the updated due date for the milestone | [optional] -**state** | **String** | State indicates the updated state of the milestone | [optional] +**state** | [**StateEnum**](#StateEnum) | State indicates the updated state of the milestone | [optional] **title** | **String** | Title is the updated title of the milestone | [optional] + + +## Enum: StateEnum +Name | Value +---- | ----- +OPEN | "open" +CLOSED | "closed" diff --git a/docs/EditPullRequestOption.md b/docs/EditPullRequestOption.md index ddd5bec..96f6c7e 100644 --- a/docs/EditPullRequestOption.md +++ b/docs/EditPullRequestOption.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **assignees** | **List<String>** | The new list of assignee usernames | [optional] **base** | **String** | The new base branch for the pull request | [optional] **body** | **String** | The new description body for the pull request | [optional] +**contentVersion** | **Long** | The current version of the pull request content to detect conflicts during editing | [optional] **dueDate** | [**Date**](Date.md) | | [optional] **labels** | **List<Long>** | The new list of label IDs for the pull request | [optional] **milestone** | **Long** | The new milestone ID for the pull request | [optional] diff --git a/docs/Issue.md b/docs/Issue.md index cd73feb..4d1d03f 100644 --- a/docs/Issue.md +++ b/docs/Issue.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **body** | **String** | | [optional] **closedAt** | [**Date**](Date.md) | | [optional] **comments** | **Long** | | [optional] +**contentVersion** | **Long** | The version of the issue content for optimistic locking | [optional] **createdAt** | [**Date**](Date.md) | | [optional] **dueDate** | [**Date**](Date.md) | | [optional] **htmlUrl** | **String** | | [optional] @@ -23,9 +24,16 @@ Name | Type | Description | Notes **pullRequest** | [**PullRequestMeta**](PullRequestMeta.md) | | [optional] **ref** | **String** | | [optional] **repository** | [**RepositoryMeta**](RepositoryMeta.md) | | [optional] -**state** | **String** | | [optional] +**state** | [**StateEnum**](#StateEnum) | | [optional] **timeEstimate** | **Long** | | [optional] **title** | **String** | | [optional] **updatedAt** | [**Date**](Date.md) | | [optional] **url** | **String** | | [optional] **user** | [**User**](User.md) | | [optional] + + +## Enum: StateEnum +Name | Value +---- | ----- +OPEN | "open" +CLOSED | "closed" diff --git a/docs/IssueApi.md b/docs/IssueApi.md index 01572a0..778a417 100644 --- a/docs/IssueApi.md +++ b/docs/IssueApi.md @@ -904,7 +904,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -1092,7 +1092,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -2577,6 +2577,8 @@ Name | Type | Description | Notes Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. +Pass `content_version` to enable optimistic locking on body edits. If the version doesn't match the current value, the request fails with 409 Conflict. + ### Example ```java // Import classes: @@ -5295,7 +5297,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -5388,7 +5390,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json diff --git a/docs/IssueFormField.md b/docs/IssueFormField.md index 4d7e0d7..5102b62 100644 --- a/docs/IssueFormField.md +++ b/docs/IssueFormField.md @@ -5,6 +5,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | **Map<String, Object>** | | [optional] **id** | **String** | | [optional] -**type** | **String** | | [optional] +**type** | [**TypeEnum**](#TypeEnum) | | [optional] **validations** | **Map<String, Object>** | | [optional] -**visible** | **List<String>** | | [optional] +**visible** | [**List<VisibleEnum>**](#List<VisibleEnum>) | | [optional] + + +## Enum: TypeEnum +Name | Value +---- | ----- +MARKDOWN | "markdown" +TEXTAREA | "textarea" +INPUT | "input" +DROPDOWN | "dropdown" +CHECKBOXES | "checkboxes" + + +## Enum: List<VisibleEnum> +Name | Value +---- | ----- +FORM | "form" +CONTENT | "content" diff --git a/docs/Milestone.md b/docs/Milestone.md index 327373b..0486664 100644 --- a/docs/Milestone.md +++ b/docs/Milestone.md @@ -10,6 +10,13 @@ Name | Type | Description | Notes **dueOn** | [**Date**](Date.md) | | [optional] **id** | **Long** | ID is the unique identifier for the milestone | [optional] **openIssues** | **Long** | OpenIssues is the number of open issues in this milestone | [optional] -**state** | **String** | | [optional] +**state** | [**StateEnum**](#StateEnum) | State indicates if the milestone is open or closed open StateOpen StateOpen pr is opened closed StateClosed StateClosed pr is closed | [optional] **title** | **String** | Title is the title of the milestone | [optional] **updatedAt** | [**Date**](Date.md) | | [optional] + + +## Enum: StateEnum +Name | Value +---- | ----- +OPEN | "open" +CLOSED | "closed" diff --git a/docs/NotificationApi.md b/docs/NotificationApi.md index 968147f..a4008f4 100644 --- a/docs/NotificationApi.md +++ b/docs/NotificationApi.md @@ -382,7 +382,7 @@ This endpoint does not need any parameter. ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, text/html + - **Accept**: application/json # **notifyReadList** diff --git a/docs/NotificationSubject.md b/docs/NotificationSubject.md index 2784974..7a23228 100644 --- a/docs/NotificationSubject.md +++ b/docs/NotificationSubject.md @@ -6,7 +6,24 @@ Name | Type | Description | Notes **htmlUrl** | **String** | HTMLURL is the web URL for the notification subject | [optional] **latestCommentHtmlUrl** | **String** | LatestCommentHTMLURL is the web URL for the latest comment | [optional] **latestCommentUrl** | **String** | LatestCommentURL is the API URL for the latest comment | [optional] -**state** | **String** | | [optional] +**state** | [**StateEnum**](#StateEnum) | State indicates the current state of the notification subject open NotifySubjectStateOpen NotifySubjectStateOpen is an open subject closed NotifySubjectStateClosed NotifySubjectStateClosed is a closed subject merged NotifySubjectStateMerged NotifySubjectStateMerged is a merged pull request | [optional] **title** | **String** | Title is the title of the notification subject | [optional] -**type** | **String** | | [optional] +**type** | [**TypeEnum**](#TypeEnum) | Type indicates the type of the notification subject Issue NotifySubjectIssue NotifySubjectIssue an issue is subject of an notification Pull NotifySubjectPull NotifySubjectPull an pull is subject of an notification Commit NotifySubjectCommit NotifySubjectCommit an commit is subject of an notification Repository NotifySubjectRepository NotifySubjectRepository an repository is subject of an notification | [optional] **url** | **String** | URL is the API URL for the notification subject | [optional] + + +## Enum: StateEnum +Name | Value +---- | ----- +OPEN | "open" +CLOSED | "closed" +MERGED | "merged" + + +## Enum: TypeEnum +Name | Value +---- | ----- +ISSUE | "Issue" +PULL | "Pull" +COMMIT | "Commit" +REPOSITORY | "Repository" diff --git a/docs/OrganizationApi.md b/docs/OrganizationApi.md index 8505c1d..d35faac 100644 --- a/docs/OrganizationApi.md +++ b/docs/OrganizationApi.md @@ -609,7 +609,7 @@ Name | Type | Description | Notes # **getOrgRunner** -> Void getOrgRunner(org, runnerId) +> ActionRunner getOrgRunner(org, runnerId) Get an org-level runner @@ -668,7 +668,7 @@ OrganizationApi apiInstance = new OrganizationApi(); String org = "org_example"; // String | name of the organization String runnerId = "runnerId_example"; // String | id of the runner try { - Void result = apiInstance.getOrgRunner(org, runnerId); + ActionRunner result = apiInstance.getOrgRunner(org, runnerId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling OrganizationApi#getOrgRunner"); @@ -685,7 +685,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -694,11 +694,11 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **getOrgRunners** -> Void getOrgRunners(org, disabled) +> ActionRunnersResponse getOrgRunners(org, disabled) Get org-level runners @@ -757,7 +757,7 @@ OrganizationApi apiInstance = new OrganizationApi(); String org = "org_example"; // String | name of the organization Boolean disabled = true; // Boolean | filter by disabled status (true or false) try { - Void result = apiInstance.getOrgRunners(org, disabled); + ActionRunnersResponse result = apiInstance.getOrgRunners(org, disabled); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling OrganizationApi#getOrgRunners"); @@ -774,7 +774,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunnersResponse**](ActionRunnersResponse.md) ### Authorization @@ -783,7 +783,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **getOrgVariable** @@ -5187,7 +5187,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -5636,7 +5636,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -5736,7 +5736,7 @@ Name | Type | Description | Notes # **updateOrgRunner** -> Void updateOrgRunner(org, runnerId, body) +> ActionRunner updateOrgRunner(org, runnerId, body) Update an org-level runner @@ -5796,7 +5796,7 @@ String org = "org_example"; // String | name of the organization String runnerId = "runnerId_example"; // String | id of the runner EditActionRunnerOption body = new EditActionRunnerOption(); // EditActionRunnerOption | try { - Void result = apiInstance.updateOrgRunner(org, runnerId, body); + ActionRunner result = apiInstance.updateOrgRunner(org, runnerId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling OrganizationApi#updateOrgRunner"); @@ -5814,7 +5814,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -5823,7 +5823,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/json # **updateOrgSecret** diff --git a/docs/PullRequest.md b/docs/PullRequest.md index 99dcba7..6edf321 100644 --- a/docs/PullRequest.md +++ b/docs/PullRequest.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **changedFiles** | **Long** | The number of files changed in the pull request | [optional] **closedAt** | [**Date**](Date.md) | | [optional] **comments** | **Long** | The number of comments on the pull request | [optional] +**contentVersion** | **Long** | The version of the pull request content for optimistic locking | [optional] **createdAt** | [**Date**](Date.md) | | [optional] **deletions** | **Long** | The number of lines deleted in the pull request | [optional] **diffUrl** | **String** | The URL to download the diff patch | [optional] @@ -35,8 +36,15 @@ Name | Type | Description | Notes **requestedReviewers** | [**List<User>**](User.md) | The users requested to review the pull request | [optional] **requestedReviewersTeams** | [**List<Team>**](Team.md) | The teams requested to review the pull request | [optional] **reviewComments** | **Long** | number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR) | [optional] -**state** | **String** | | [optional] +**state** | [**StateEnum**](#StateEnum) | The current state of the pull request open StateOpen StateOpen pr is opened closed StateClosed StateClosed pr is closed | [optional] **title** | **String** | The title of the pull request | [optional] **updatedAt** | [**Date**](Date.md) | | [optional] **url** | **String** | The API URL of the pull request | [optional] **user** | [**User**](User.md) | | [optional] + + +## Enum: StateEnum +Name | Value +---- | ----- +OPEN | "open" +CLOSED | "closed" diff --git a/docs/PullReview.md b/docs/PullReview.md index e507e40..14e88ba 100644 --- a/docs/PullReview.md +++ b/docs/PullReview.md @@ -12,8 +12,18 @@ Name | Type | Description | Notes **official** | **Boolean** | | [optional] **pullRequestUrl** | **String** | HTMLPullURL is the web URL for the pull request | [optional] **stale** | **Boolean** | | [optional] -**state** | **String** | | [optional] +**state** | [**StateEnum**](#StateEnum) | | [optional] **submittedAt** | [**Date**](Date.md) | | [optional] **team** | [**Team**](Team.md) | | [optional] **updatedAt** | [**Date**](Date.md) | | [optional] **user** | [**User**](User.md) | | [optional] + + +## Enum: StateEnum +Name | Value +---- | ----- +APPROVED | "APPROVED" +PENDING | "PENDING" +COMMENT | "COMMENT" +REQUEST_CHANGES | "REQUEST_CHANGES" +REQUEST_REVIEW | "REQUEST_REVIEW" diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index efd9e28..671a013 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -474,7 +474,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -923,7 +923,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -1016,7 +1016,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -2206,7 +2206,7 @@ Name | Type | Description | Notes # **getRepoRunner** -> Void getRepoRunner(owner, repo, runnerId) +> ActionRunner getRepoRunner(owner, repo, runnerId) Get a repo-level runner @@ -2266,7 +2266,7 @@ String owner = "owner_example"; // String | owner of the repo String repo = "repo_example"; // String | name of the repo String runnerId = "runnerId_example"; // String | id of the runner try { - Void result = apiInstance.getRepoRunner(owner, repo, runnerId); + ActionRunner result = apiInstance.getRepoRunner(owner, repo, runnerId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoryApi#getRepoRunner"); @@ -2284,7 +2284,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -2293,11 +2293,11 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **getRepoRunners** -> Void getRepoRunners(owner, repo, disabled) +> ActionRunnersResponse getRepoRunners(owner, repo, disabled) Get repo-level runners @@ -2357,7 +2357,7 @@ String owner = "owner_example"; // String | owner of the repo String repo = "repo_example"; // String | name of the repo Boolean disabled = true; // Boolean | filter by disabled status (true or false) try { - Void result = apiInstance.getRepoRunners(owner, repo, disabled); + ActionRunnersResponse result = apiInstance.getRepoRunners(owner, repo, disabled); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoryApi#getRepoRunners"); @@ -2375,7 +2375,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunnersResponse**](ActionRunnersResponse.md) ### Authorization @@ -2384,7 +2384,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **getRepoVariable** @@ -2818,7 +2818,7 @@ Token.setApiKey("YOUR API KEY"); RepositoryApi apiInstance = new RepositoryApi(); String owner = "owner_example"; // String | owner of the repo String repo = "repo_example"; // String | name of the repository -String run = "run_example"; // String | id of the run +Integer run = 56; // Integer | id of the run try { ActionWorkflowRun result = apiInstance.getWorkflowRun(owner, repo, run); System.out.println(result); @@ -2834,7 +2834,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **owner** | **String**| owner of the repo | **repo** | **String**| name of the repository | - **run** | **String**| id of the run | + **run** | **Integer**| id of the run | ### Return type @@ -3509,7 +3509,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -4969,7 +4969,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -5062,7 +5062,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -5525,7 +5525,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -5616,7 +5616,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -5799,7 +5799,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json, text/html + - **Accept**: application/json # **repoDelete** @@ -6801,7 +6801,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -7717,7 +7717,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -7996,7 +7996,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -8182,7 +8182,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -8275,7 +8275,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -8743,7 +8743,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json, text/html + - **Accept**: application/json # **repoGet** @@ -10145,7 +10145,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -15236,7 +15236,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -15327,7 +15327,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -16348,7 +16348,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -16631,7 +16631,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -16906,7 +16906,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -17367,7 +17367,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -17827,7 +17827,7 @@ Name | Type | Description | Notes # **updateRepoRunner** -> Void updateRepoRunner(owner, repo, runnerId, body) +> ActionRunner updateRepoRunner(owner, repo, runnerId, body) Update a repo-level runner @@ -17888,7 +17888,7 @@ String repo = "repo_example"; // String | name of the repo String runnerId = "runnerId_example"; // String | id of the runner EditActionRunnerOption body = new EditActionRunnerOption(); // EditActionRunnerOption | try { - Void result = apiInstance.updateRepoRunner(owner, repo, runnerId, body); + ActionRunner result = apiInstance.updateRepoRunner(owner, repo, runnerId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling RepositoryApi#updateRepoRunner"); @@ -17907,7 +17907,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -17916,7 +17916,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/json # **updateRepoSecret** @@ -18101,7 +18101,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -18191,7 +18191,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, text/html + - **Accept**: application/json # **userCurrentDeleteSubscription** @@ -18369,7 +18369,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, text/html + - **Accept**: application/json # **userTrackedTimes** diff --git a/docs/SubmitPullReviewOptions.md b/docs/SubmitPullReviewOptions.md index 9c586be..6f1dc9a 100644 --- a/docs/SubmitPullReviewOptions.md +++ b/docs/SubmitPullReviewOptions.md @@ -4,4 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **body** | **String** | | [optional] -**event** | **String** | | [optional] +**event** | [**EventEnum**](#EventEnum) | | [optional] + + +## Enum: EventEnum +Name | Value +---- | ----- +APPROVED | "APPROVED" +PENDING | "PENDING" +COMMENT | "COMMENT" +REQUEST_CHANGES | "REQUEST_CHANGES" +REQUEST_REVIEW | "REQUEST_REVIEW" diff --git a/docs/UserApi.md b/docs/UserApi.md index 9816a72..52770ea 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -520,7 +520,7 @@ Name | Type | Description | Notes # **getUserRunner** -> Void getUserRunner(runnerId) +> ActionRunner getUserRunner(runnerId) Get a user-level runner @@ -578,7 +578,7 @@ Token.setApiKey("YOUR API KEY"); UserApi apiInstance = new UserApi(); String runnerId = "runnerId_example"; // String | id of the runner try { - Void result = apiInstance.getUserRunner(runnerId); + ActionRunner result = apiInstance.getUserRunner(runnerId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#getUserRunner"); @@ -594,7 +594,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -603,11 +603,11 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **getUserRunners** -> Void getUserRunners(disabled) +> ActionRunnersResponse getUserRunners(disabled) Get user-level runners @@ -665,7 +665,7 @@ Token.setApiKey("YOUR API KEY"); UserApi apiInstance = new UserApi(); Boolean disabled = true; // Boolean | filter by disabled status (true or false) try { - Void result = apiInstance.getUserRunners(disabled); + ActionRunnersResponse result = apiInstance.getUserRunners(disabled); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#getUserRunners"); @@ -681,7 +681,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunnersResponse**](ActionRunnersResponse.md) ### Authorization @@ -690,7 +690,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json # **getUserSettings** @@ -1226,7 +1226,7 @@ This endpoint does not need any parameter. # **updateUserRunner** -> Void updateUserRunner(runnerId, body) +> ActionRunner updateUserRunner(runnerId, body) Update a user-level runner @@ -1285,7 +1285,7 @@ UserApi apiInstance = new UserApi(); String runnerId = "runnerId_example"; // String | id of the runner EditActionRunnerOption body = new EditActionRunnerOption(); // EditActionRunnerOption | try { - Void result = apiInstance.updateUserRunner(runnerId, body); + ActionRunner result = apiInstance.updateUserRunner(runnerId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUserRunner"); @@ -1302,7 +1302,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +[**ActionRunner**](ActionRunner.md) ### Authorization @@ -1311,7 +1311,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/json # **updateUserSecret** @@ -1486,7 +1486,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -1662,7 +1662,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -2101,7 +2101,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json @@ -4300,7 +4300,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -6614,7 +6614,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: Not defined @@ -6703,7 +6703,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json, text/plain + - **Content-Type**: application/json - **Accept**: application/json 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 ff0fbc8..b66daa1 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/AdminApi.java @@ -2,6 +2,8 @@ package org.gitnex.tea4j.v2.apis; import java.util.List; import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.ActionRunner; +import org.gitnex.tea4j.v2.models.ActionRunnersResponse; import org.gitnex.tea4j.v2.models.ActionWorkflowJobsResponse; import org.gitnex.tea4j.v2.models.ActionWorkflowRunsResponse; import org.gitnex.tea4j.v2.models.Badge; @@ -358,19 +360,19 @@ public interface AdminApi { * Get a global runner * * @param runnerId id of the runner (required) - * @return Call<Void> + * @return Call<ActionRunner> */ @GET("admin/actions/runners/{runner_id}") - Call getAdminRunner(@retrofit2.http.Path("runner_id") String runnerId); + Call getAdminRunner(@retrofit2.http.Path("runner_id") String runnerId); /** * Get all runners * * @param disabled filter by disabled status (true or false) (optional) - * @return Call<Void> + * @return Call<ActionRunnersResponse> */ @GET("admin/actions/runners") - Call getAdminRunners(@retrofit2.http.Query("disabled") Boolean disabled); + Call getAdminRunners(@retrofit2.http.Query("disabled") Boolean disabled); /** * Lists all jobs @@ -415,11 +417,11 @@ public interface AdminApi { * * @param runnerId id of the runner (required) * @param body (optional) - * @return Call<Void> + * @return Call<ActionRunner> */ @Headers({"Content-Type:application/json"}) @PATCH("admin/actions/runners/{runner_id}") - Call updateAdminRunner( + Call updateAdminRunner( @retrofit2.http.Path("runner_id") String runnerId, @retrofit2.http.Body EditActionRunnerOption body); } 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 ba4e3d1..f0a691d 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/IssueApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/IssueApi.java @@ -469,7 +469,8 @@ public interface IssueApi { /** * Edit an issue. If using deadline only the date will be taken into account, and time of day - * ignored. + * ignored. Pass `content_version` to enable optimistic locking on body edits. If the + * version doesn't match the current value, the request fails with 409 Conflict. * * @param owner owner of the repo (required) * @param repo name of the repo (required) diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java index 1dcbf5c..aa2c4d6 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java @@ -3,6 +3,8 @@ package org.gitnex.tea4j.v2.apis; import java.util.Date; import java.util.List; import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.ActionRunner; +import org.gitnex.tea4j.v2.models.ActionRunnersResponse; import org.gitnex.tea4j.v2.models.ActionVariable; import org.gitnex.tea4j.v2.models.ActionWorkflowJobsResponse; import org.gitnex.tea4j.v2.models.ActionWorkflowRunsResponse; @@ -113,10 +115,10 @@ public interface OrganizationApi { * * @param org name of the organization (required) * @param runnerId id of the runner (required) - * @return Call<Void> + * @return Call<ActionRunner> */ @GET("orgs/{org}/actions/runners/{runner_id}") - Call getOrgRunner( + Call getOrgRunner( @retrofit2.http.Path("org") String org, @retrofit2.http.Path("runner_id") String runnerId); /** @@ -124,10 +126,10 @@ public interface OrganizationApi { * * @param org name of the organization (required) * @param disabled filter by disabled status (true or false) (optional) - * @return Call<Void> + * @return Call<ActionRunnersResponse> */ @GET("orgs/{org}/actions/runners") - Call getOrgRunners( + Call getOrgRunners( @retrofit2.http.Path("org") String org, @retrofit2.http.Query("disabled") Boolean disabled); /** @@ -829,11 +831,11 @@ public interface OrganizationApi { * @param org name of the organization (required) * @param runnerId id of the runner (required) * @param body (optional) - * @return Call<Void> + * @return Call<ActionRunner> */ @Headers({"Content-Type:application/json"}) @PATCH("orgs/{org}/actions/runners/{runner_id}") - Call updateOrgRunner( + Call updateOrgRunner( @retrofit2.http.Path("org") String org, @retrofit2.http.Path("runner_id") String runnerId, @retrofit2.http.Body EditActionRunnerOption 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 1b01181..34a6fb3 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -8,6 +8,8 @@ import okhttp3.RequestBody; import org.gitnex.tea4j.v2.CollectionFormats.*; import org.gitnex.tea4j.v2.models.ActionArtifact; import org.gitnex.tea4j.v2.models.ActionArtifactsResponse; +import org.gitnex.tea4j.v2.models.ActionRunner; +import org.gitnex.tea4j.v2.models.ActionRunnersResponse; import org.gitnex.tea4j.v2.models.ActionTaskResponse; import org.gitnex.tea4j.v2.models.ActionVariable; import org.gitnex.tea4j.v2.models.ActionWorkflow; @@ -435,10 +437,10 @@ public interface RepositoryApi { * @param owner owner of the repo (required) * @param repo name of the repo (required) * @param runnerId id of the runner (required) - * @return Call<Void> + * @return Call<ActionRunner> */ @GET("repos/{owner}/{repo}/actions/runners/{runner_id}") - Call getRepoRunner( + Call getRepoRunner( @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("runner_id") String runnerId); @@ -449,10 +451,10 @@ public interface RepositoryApi { * @param owner owner of the repo (required) * @param repo name of the repo (required) * @param disabled filter by disabled status (true or false) (optional) - * @return Call<Void> + * @return Call<ActionRunnersResponse> */ @GET("repos/{owner}/{repo}/actions/runners") - Call getRepoRunners( + Call getRepoRunners( @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo, @retrofit2.http.Query("disabled") Boolean disabled); @@ -534,7 +536,7 @@ public interface RepositoryApi { Call getWorkflowRun( @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo, - @retrofit2.http.Path("run") String run); + @retrofit2.http.Path("run") Integer run); /** * Lists all runs for a repository run @@ -3114,11 +3116,11 @@ public interface RepositoryApi { * @param repo name of the repo (required) * @param runnerId id of the runner (required) * @param body (optional) - * @return Call<Void> + * @return Call<ActionRunner> */ @Headers({"Content-Type:application/json"}) @PATCH("repos/{owner}/{repo}/actions/runners/{runner_id}") - Call updateRepoRunner( + Call updateRepoRunner( @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("runner_id") String runnerId, diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java index 0a34ccd..97c1a95 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java @@ -4,6 +4,8 @@ import java.util.Date; import java.util.List; import org.gitnex.tea4j.v2.CollectionFormats.*; import org.gitnex.tea4j.v2.models.AccessToken; +import org.gitnex.tea4j.v2.models.ActionRunner; +import org.gitnex.tea4j.v2.models.ActionRunnersResponse; import org.gitnex.tea4j.v2.models.ActionVariable; import org.gitnex.tea4j.v2.models.ActionWorkflowJobsResponse; import org.gitnex.tea4j.v2.models.ActionWorkflowRunsResponse; @@ -94,19 +96,19 @@ public interface UserApi { * Get a user-level runner * * @param runnerId id of the runner (required) - * @return Call<Void> + * @return Call<ActionRunner> */ @GET("user/actions/runners/{runner_id}") - Call getUserRunner(@retrofit2.http.Path("runner_id") String runnerId); + Call getUserRunner(@retrofit2.http.Path("runner_id") String runnerId); /** * Get user-level runners * * @param disabled filter by disabled status (true or false) (optional) - * @return Call<Void> + * @return Call<ActionRunnersResponse> */ @GET("user/actions/runners") - Call getUserRunners(@retrofit2.http.Query("disabled") Boolean disabled); + Call getUserRunners(@retrofit2.http.Query("disabled") Boolean disabled); /** * Get user settings @@ -187,11 +189,11 @@ public interface UserApi { * * @param runnerId id of the runner (required) * @param body (optional) - * @return Call<Void> + * @return Call<ActionRunner> */ @Headers({"Content-Type:application/json"}) @PATCH("user/actions/runners/{runner_id}") - Call updateUserRunner( + Call updateUserRunner( @retrofit2.http.Path("runner_id") String runnerId, @retrofit2.http.Body EditActionRunnerOption body); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreatePullReviewOptions.java b/src/main/java/org/gitnex/tea4j/v2/models/CreatePullReviewOptions.java index 244e7dc..94a949f 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/CreatePullReviewOptions.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/CreatePullReviewOptions.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -33,8 +38,56 @@ public class CreatePullReviewOptions implements Serializable { @SerializedName("commit_id") private String commitId = null; + /** Gets or Sets event */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + APPROVED("APPROVED"), + PENDING("PENDING"), + COMMENT("COMMENT"), + REQUEST_CHANGES("REQUEST_CHANGES"), + REQUEST_REVIEW("REQUEST_REVIEW"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EventEnum fromValue(String input) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EventEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public EventEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return EventEnum.fromValue((String) (value)); + } + } + } + @SerializedName("event") - private String event = null; + private EventEnum event = null; public CreatePullReviewOptions body(String body) { this.body = body; @@ -101,7 +154,7 @@ public class CreatePullReviewOptions implements Serializable { this.commitId = commitId; } - public CreatePullReviewOptions event(String event) { + public CreatePullReviewOptions event(EventEnum event) { this.event = event; return this; } @@ -112,11 +165,11 @@ public class CreatePullReviewOptions implements Serializable { * @return event */ @Schema(description = "") - public String getEvent() { + public EventEnum getEvent() { return event; } - public void setEvent(String event) { + public void setEvent(EventEnum event) { this.event = event; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java b/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java index b9c03af..1ed2463 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/EditIssueOption.java @@ -34,6 +34,9 @@ public class EditIssueOption implements Serializable { @SerializedName("body") private String body = null; + @SerializedName("content_version") + private Long contentVersion = null; + @SerializedName("due_date") private Date dueDate = null; @@ -117,6 +120,26 @@ public class EditIssueOption implements Serializable { this.body = body; } + public EditIssueOption contentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * The current version of the issue content to detect conflicts during editing + * + * @return contentVersion + */ + @Schema( + description = "The current version of the issue content to detect conflicts during editing") + public Long getContentVersion() { + return contentVersion; + } + + public void setContentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + } + public EditIssueOption dueDate(Date dueDate) { this.dueDate = dueDate; return this; @@ -243,6 +266,7 @@ public class EditIssueOption implements Serializable { return Objects.equals(this.assignee, editIssueOption.assignee) && Objects.equals(this.assignees, editIssueOption.assignees) && Objects.equals(this.body, editIssueOption.body) + && Objects.equals(this.contentVersion, editIssueOption.contentVersion) && Objects.equals(this.dueDate, editIssueOption.dueDate) && Objects.equals(this.milestone, editIssueOption.milestone) && Objects.equals(this.ref, editIssueOption.ref) @@ -254,7 +278,16 @@ public class EditIssueOption implements Serializable { @Override public int hashCode() { return Objects.hash( - assignee, assignees, body, dueDate, milestone, ref, state, title, unsetDueDate); + assignee, + assignees, + body, + contentVersion, + dueDate, + milestone, + ref, + state, + title, + unsetDueDate); } @Override @@ -265,6 +298,7 @@ public class EditIssueOption implements Serializable { sb.append(" assignee: ").append(toIndentedString(assignee)).append("\n"); sb.append(" assignees: ").append(toIndentedString(assignees)).append("\n"); sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" contentVersion: ").append(toIndentedString(contentVersion)).append("\n"); sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); sb.append(" milestone: ").append(toIndentedString(milestone)).append("\n"); sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/EditMilestoneOption.java b/src/main/java/org/gitnex/tea4j/v2/models/EditMilestoneOption.java index e55e222..4b85b24 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/EditMilestoneOption.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/EditMilestoneOption.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.Date; import java.util.Objects; @@ -29,8 +34,53 @@ public class EditMilestoneOption implements Serializable { @SerializedName("due_on") private Date dueOn = null; + /** State indicates the updated state of the milestone */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + OPEN("open"), + CLOSED("closed"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String input) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return StateEnum.fromValue((String) (value)); + } + } + } + @SerializedName("state") - private String state = null; + private StateEnum state = null; @SerializedName("title") private String title = null; @@ -73,7 +123,7 @@ public class EditMilestoneOption implements Serializable { this.dueOn = dueOn; } - public EditMilestoneOption state(String state) { + public EditMilestoneOption state(StateEnum state) { this.state = state; return this; } @@ -84,11 +134,11 @@ public class EditMilestoneOption implements Serializable { * @return state */ @Schema(description = "State indicates the updated state of the milestone") - public String getState() { + public StateEnum getState() { return state; } - public void setState(String state) { + public void setState(StateEnum state) { this.state = state; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/EditPullRequestOption.java b/src/main/java/org/gitnex/tea4j/v2/models/EditPullRequestOption.java index 650a766..ab0d3b8 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/EditPullRequestOption.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/EditPullRequestOption.java @@ -40,6 +40,9 @@ public class EditPullRequestOption implements Serializable { @SerializedName("body") private String body = null; + @SerializedName("content_version") + private Long contentVersion = null; + @SerializedName("due_date") private Date dueDate = null; @@ -161,6 +164,27 @@ public class EditPullRequestOption implements Serializable { this.body = body; } + public EditPullRequestOption contentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * The current version of the pull request content to detect conflicts during editing + * + * @return contentVersion + */ + @Schema( + description = + "The current version of the pull request content to detect conflicts during editing") + public Long getContentVersion() { + return contentVersion; + } + + public void setContentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + } + public EditPullRequestOption dueDate(Date dueDate) { this.dueDate = dueDate; return this; @@ -297,6 +321,7 @@ public class EditPullRequestOption implements Serializable { && Objects.equals(this.assignees, editPullRequestOption.assignees) && Objects.equals(this.base, editPullRequestOption.base) && Objects.equals(this.body, editPullRequestOption.body) + && Objects.equals(this.contentVersion, editPullRequestOption.contentVersion) && Objects.equals(this.dueDate, editPullRequestOption.dueDate) && Objects.equals(this.labels, editPullRequestOption.labels) && Objects.equals(this.milestone, editPullRequestOption.milestone) @@ -313,6 +338,7 @@ public class EditPullRequestOption implements Serializable { assignees, base, body, + contentVersion, dueDate, labels, milestone, @@ -333,6 +359,7 @@ public class EditPullRequestOption implements Serializable { sb.append(" assignees: ").append(toIndentedString(assignees)).append("\n"); sb.append(" base: ").append(toIndentedString(base)).append("\n"); sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" contentVersion: ").append(toIndentedString(contentVersion)).append("\n"); sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" milestone: ").append(toIndentedString(milestone)).append("\n"); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Issue.java b/src/main/java/org/gitnex/tea4j/v2/models/Issue.java index 4f21a4e..08b9544 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/Issue.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/Issue.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @@ -43,6 +48,9 @@ public class Issue implements Serializable { @SerializedName("comments") private Long comments = null; + @SerializedName("content_version") + private Long contentVersion = null; + @SerializedName("created_at") private Date createdAt = null; @@ -85,8 +93,53 @@ public class Issue implements Serializable { @SerializedName("repository") private RepositoryMeta repository = null; + /** Gets or Sets state */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + OPEN("open"), + CLOSED("closed"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String input) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return StateEnum.fromValue((String) (value)); + } + } + } + @SerializedName("state") - private String state = null; + private StateEnum state = null; @SerializedName("time_estimate") private Long timeEstimate = null; @@ -233,6 +286,25 @@ public class Issue implements Serializable { this.comments = comments; } + public Issue contentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * The version of the issue content for optimistic locking + * + * @return contentVersion + */ + @Schema(description = "The version of the issue content for optimistic locking") + public Long getContentVersion() { + return contentVersion; + } + + public void setContentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + } + public Issue createdAt(Date createdAt) { this.createdAt = createdAt; return this; @@ -507,7 +579,7 @@ public class Issue implements Serializable { this.repository = repository; } - public Issue state(String state) { + public Issue state(StateEnum state) { this.state = state; return this; } @@ -518,11 +590,11 @@ public class Issue implements Serializable { * @return state */ @Schema(description = "") - public String getState() { + public StateEnum getState() { return state; } - public void setState(String state) { + public void setState(StateEnum state) { this.state = state; } @@ -636,6 +708,7 @@ public class Issue implements Serializable { && Objects.equals(this.body, issue.body) && Objects.equals(this.closedAt, issue.closedAt) && Objects.equals(this.comments, issue.comments) + && Objects.equals(this.contentVersion, issue.contentVersion) && Objects.equals(this.createdAt, issue.createdAt) && Objects.equals(this.dueDate, issue.dueDate) && Objects.equals(this.htmlUrl, issue.htmlUrl) @@ -667,6 +740,7 @@ public class Issue implements Serializable { body, closedAt, comments, + contentVersion, createdAt, dueDate, htmlUrl, @@ -700,6 +774,7 @@ public class Issue implements Serializable { sb.append(" body: ").append(toIndentedString(body)).append("\n"); sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n"); sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); + sb.append(" contentVersion: ").append(toIndentedString(contentVersion)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); sb.append(" htmlUrl: ").append(toIndentedString(htmlUrl)).append("\n"); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/IssueFormField.java b/src/main/java/org/gitnex/tea4j/v2/models/IssueFormField.java index 36e6f9c..3a22c16 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/IssueFormField.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/IssueFormField.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; @@ -32,14 +37,107 @@ public class IssueFormField implements Serializable { @SerializedName("id") private String id = null; + /** Gets or Sets type */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + MARKDOWN("markdown"), + TEXTAREA("textarea"), + INPUT("input"), + DROPDOWN("dropdown"), + CHECKBOXES("checkboxes"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String input) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return TypeEnum.fromValue((String) (value)); + } + } + } + @SerializedName("type") - private String type = null; + private TypeEnum type = null; @SerializedName("validations") private Map validations = null; + /** Gets or Sets visible */ + @JsonAdapter(VisibleEnum.Adapter.class) + public enum VisibleEnum { + FORM("form"), + CONTENT("content"); + + private String value; + + VisibleEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VisibleEnum fromValue(String input) { + for (VisibleEnum b : VisibleEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final VisibleEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public VisibleEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return VisibleEnum.fromValue((String) (value)); + } + } + } + @SerializedName("visible") - private List visible = null; + private List visible = null; public IssueFormField attributes(Map attributes) { this.attributes = attributes; @@ -87,7 +185,7 @@ public class IssueFormField implements Serializable { this.id = id; } - public IssueFormField type(String type) { + public IssueFormField type(TypeEnum type) { this.type = type; return this; } @@ -98,11 +196,11 @@ public class IssueFormField implements Serializable { * @return type */ @Schema(description = "") - public String getType() { + public TypeEnum getType() { return type; } - public void setType(String type) { + public void setType(TypeEnum type) { this.type = type; } @@ -133,12 +231,12 @@ public class IssueFormField implements Serializable { this.validations = validations; } - public IssueFormField visible(List visible) { + public IssueFormField visible(List visible) { this.visible = visible; return this; } - public IssueFormField addVisibleItem(String visibleItem) { + public IssueFormField addVisibleItem(VisibleEnum visibleItem) { if (this.visible == null) { this.visible = new ArrayList<>(); } @@ -152,11 +250,11 @@ public class IssueFormField implements Serializable { * @return visible */ @Schema(description = "") - public List getVisible() { + public List getVisible() { return visible; } - public void setVisible(List visible) { + public void setVisible(List visible) { this.visible = visible; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/Milestone.java b/src/main/java/org/gitnex/tea4j/v2/models/Milestone.java index 3689444..6f2d859 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/Milestone.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/Milestone.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.Date; import java.util.Objects; @@ -44,8 +49,56 @@ public class Milestone implements Serializable { @SerializedName("open_issues") private Long openIssues = null; + /** + * State indicates if the milestone is open or closed open StateOpen StateOpen pr is opened closed + * StateClosed StateClosed pr is closed + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + OPEN("open"), + CLOSED("closed"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String input) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return StateEnum.fromValue((String) (value)); + } + } + } + @SerializedName("state") - private String state = null; + private StateEnum state = null; @SerializedName("title") private String title = null; @@ -186,22 +239,26 @@ public class Milestone implements Serializable { this.openIssues = openIssues; } - public Milestone state(String state) { + public Milestone state(StateEnum state) { this.state = state; return this; } /** - * Get state + * State indicates if the milestone is open or closed open StateOpen StateOpen pr is opened closed + * StateClosed StateClosed pr is closed * * @return state */ - @Schema(description = "") - public String getState() { + @Schema( + description = + "State indicates if the milestone is open or closed open StateOpen StateOpen pr is" + + " opened closed StateClosed StateClosed pr is closed") + public StateEnum getState() { return state; } - public void setState(String state) { + public void setState(StateEnum state) { this.state = state; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/NotificationSubject.java b/src/main/java/org/gitnex/tea4j/v2/models/NotificationSubject.java index db22cd1..27856b1 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/NotificationSubject.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/NotificationSubject.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.Objects; @@ -31,14 +36,118 @@ public class NotificationSubject implements Serializable { @SerializedName("latest_comment_url") private String latestCommentUrl = null; + /** + * State indicates the current state of the notification subject open NotifySubjectStateOpen + * NotifySubjectStateOpen is an open subject closed NotifySubjectStateClosed + * NotifySubjectStateClosed is a closed subject merged NotifySubjectStateMerged + * NotifySubjectStateMerged is a merged pull request + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + OPEN("open"), + CLOSED("closed"), + MERGED("merged"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String input) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return StateEnum.fromValue((String) (value)); + } + } + } + @SerializedName("state") - private String state = null; + private StateEnum state = null; @SerializedName("title") private String title = null; + /** + * Type indicates the type of the notification subject Issue NotifySubjectIssue NotifySubjectIssue + * an issue is subject of an notification Pull NotifySubjectPull NotifySubjectPull an pull is + * subject of an notification Commit NotifySubjectCommit NotifySubjectCommit an commit is subject + * of an notification Repository NotifySubjectRepository NotifySubjectRepository an repository is + * subject of an notification + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ISSUE("Issue"), + PULL("Pull"), + COMMIT("Commit"), + REPOSITORY("Repository"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String input) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return TypeEnum.fromValue((String) (value)); + } + } + } + @SerializedName("type") - private String type = null; + private TypeEnum type = null; @SerializedName("url") private String url = null; @@ -100,22 +209,30 @@ public class NotificationSubject implements Serializable { this.latestCommentUrl = latestCommentUrl; } - public NotificationSubject state(String state) { + public NotificationSubject state(StateEnum state) { this.state = state; return this; } /** - * Get state + * State indicates the current state of the notification subject open NotifySubjectStateOpen + * NotifySubjectStateOpen is an open subject closed NotifySubjectStateClosed + * NotifySubjectStateClosed is a closed subject merged NotifySubjectStateMerged + * NotifySubjectStateMerged is a merged pull request * * @return state */ - @Schema(description = "") - public String getState() { + @Schema( + description = + "State indicates the current state of the notification subject open" + + " NotifySubjectStateOpen NotifySubjectStateOpen is an open subject closed" + + " NotifySubjectStateClosed NotifySubjectStateClosed is a closed subject merged" + + " NotifySubjectStateMerged NotifySubjectStateMerged is a merged pull request") + public StateEnum getState() { return state; } - public void setState(String state) { + public void setState(StateEnum state) { this.state = state; } @@ -138,22 +255,33 @@ public class NotificationSubject implements Serializable { this.title = title; } - public NotificationSubject type(String type) { + public NotificationSubject type(TypeEnum type) { this.type = type; return this; } /** - * Get type + * Type indicates the type of the notification subject Issue NotifySubjectIssue NotifySubjectIssue + * an issue is subject of an notification Pull NotifySubjectPull NotifySubjectPull an pull is + * subject of an notification Commit NotifySubjectCommit NotifySubjectCommit an commit is subject + * of an notification Repository NotifySubjectRepository NotifySubjectRepository an repository is + * subject of an notification * * @return type */ - @Schema(description = "") - public String getType() { + @Schema( + description = + "Type indicates the type of the notification subject Issue NotifySubjectIssue " + + " NotifySubjectIssue an issue is subject of an notification Pull NotifySubjectPull " + + " NotifySubjectPull an pull is subject of an notification Commit" + + " NotifySubjectCommit NotifySubjectCommit an commit is subject of an notification" + + " Repository NotifySubjectRepository NotifySubjectRepository an repository is" + + " subject of an notification") + public TypeEnum getType() { return type; } - public void setType(String type) { + public void setType(TypeEnum type) { this.type = type; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/PullRequest.java b/src/main/java/org/gitnex/tea4j/v2/models/PullRequest.java index 237246b..62cb513 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/PullRequest.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/PullRequest.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @@ -52,6 +57,9 @@ public class PullRequest implements Serializable { @SerializedName("comments") private Long comments = null; + @SerializedName("content_version") + private Long contentVersion = null; + @SerializedName("created_at") private Date createdAt = null; @@ -121,8 +129,56 @@ public class PullRequest implements Serializable { @SerializedName("review_comments") private Long reviewComments = null; + /** + * The current state of the pull request open StateOpen StateOpen pr is opened closed StateClosed + * StateClosed pr is closed + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + OPEN("open"), + CLOSED("closed"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String input) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return StateEnum.fromValue((String) (value)); + } + } + } + @SerializedName("state") - private String state = null; + private StateEnum state = null; @SerializedName("title") private String title = null; @@ -315,6 +371,25 @@ public class PullRequest implements Serializable { this.comments = comments; } + public PullRequest contentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + /** + * The version of the pull request content for optimistic locking + * + * @return contentVersion + */ + @Schema(description = "The version of the pull request content for optimistic locking") + public Long getContentVersion() { + return contentVersion; + } + + public void setContentVersion(Long contentVersion) { + this.contentVersion = contentVersion; + } + public PullRequest createdAt(Date createdAt) { this.createdAt = createdAt; return this; @@ -780,22 +855,26 @@ public class PullRequest implements Serializable { this.reviewComments = reviewComments; } - public PullRequest state(String state) { + public PullRequest state(StateEnum state) { this.state = state; return this; } /** - * Get state + * The current state of the pull request open StateOpen StateOpen pr is opened closed StateClosed + * StateClosed pr is closed * * @return state */ - @Schema(description = "") - public String getState() { + @Schema( + description = + "The current state of the pull request open StateOpen StateOpen pr is opened closed" + + " StateClosed StateClosed pr is closed") + public StateEnum getState() { return state; } - public void setState(String state) { + public void setState(StateEnum state) { this.state = state; } @@ -893,6 +972,7 @@ public class PullRequest implements Serializable { && Objects.equals(this.changedFiles, pullRequest.changedFiles) && Objects.equals(this.closedAt, pullRequest.closedAt) && Objects.equals(this.comments, pullRequest.comments) + && Objects.equals(this.contentVersion, pullRequest.contentVersion) && Objects.equals(this.createdAt, pullRequest.createdAt) && Objects.equals(this.deletions, pullRequest.deletions) && Objects.equals(this.diffUrl, pullRequest.diffUrl) @@ -935,6 +1015,7 @@ public class PullRequest implements Serializable { changedFiles, closedAt, comments, + contentVersion, createdAt, deletions, diffUrl, @@ -981,6 +1062,7 @@ public class PullRequest implements Serializable { sb.append(" changedFiles: ").append(toIndentedString(changedFiles)).append("\n"); sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n"); sb.append(" comments: ").append(toIndentedString(comments)).append("\n"); + sb.append(" contentVersion: ").append(toIndentedString(contentVersion)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" deletions: ").append(toIndentedString(deletions)).append("\n"); sb.append(" diffUrl: ").append(toIndentedString(diffUrl)).append("\n"); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/PullReview.java b/src/main/java/org/gitnex/tea4j/v2/models/PullReview.java index 6a69c5a..61ec199 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/PullReview.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/PullReview.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.Date; import java.util.Objects; @@ -50,8 +55,56 @@ public class PullReview implements Serializable { @SerializedName("stale") private Boolean stale = null; + /** Gets or Sets state */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + APPROVED("APPROVED"), + PENDING("PENDING"), + COMMENT("COMMENT"), + REQUEST_CHANGES("REQUEST_CHANGES"), + REQUEST_REVIEW("REQUEST_REVIEW"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String input) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return StateEnum.fromValue((String) (value)); + } + } + } + @SerializedName("state") - private String state = null; + private StateEnum state = null; @SerializedName("submitted_at") private Date submittedAt = null; @@ -236,7 +289,7 @@ public class PullReview implements Serializable { this.stale = stale; } - public PullReview state(String state) { + public PullReview state(StateEnum state) { this.state = state; return this; } @@ -247,11 +300,11 @@ public class PullReview implements Serializable { * @return state */ @Schema(description = "") - public String getState() { + public StateEnum getState() { return state; } - public void setState(String state) { + public void setState(StateEnum state) { this.state = state; } diff --git a/src/main/java/org/gitnex/tea4j/v2/models/SubmitPullReviewOptions.java b/src/main/java/org/gitnex/tea4j/v2/models/SubmitPullReviewOptions.java index a9bd10c..b056797 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/SubmitPullReviewOptions.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/SubmitPullReviewOptions.java @@ -12,8 +12,13 @@ package org.gitnex.tea4j.v2.models; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; import java.io.Serializable; import java.util.Objects; @@ -25,8 +30,56 @@ public class SubmitPullReviewOptions implements Serializable { @SerializedName("body") private String body = null; + /** Gets or Sets event */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + APPROVED("APPROVED"), + PENDING("PENDING"), + COMMENT("COMMENT"), + REQUEST_CHANGES("REQUEST_CHANGES"), + REQUEST_REVIEW("REQUEST_REVIEW"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EventEnum fromValue(String input) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(input)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EventEnum enumeration) + throws IOException { + jsonWriter.value(String.valueOf(enumeration.getValue())); + } + + @Override + public EventEnum read(final JsonReader jsonReader) throws IOException { + Object value = jsonReader.nextString(); + return EventEnum.fromValue((String) (value)); + } + } + } + @SerializedName("event") - private String event = null; + private EventEnum event = null; public SubmitPullReviewOptions body(String body) { this.body = body; @@ -47,7 +100,7 @@ public class SubmitPullReviewOptions implements Serializable { this.body = body; } - public SubmitPullReviewOptions event(String event) { + public SubmitPullReviewOptions event(EventEnum event) { this.event = event; return this; } @@ -58,11 +111,11 @@ public class SubmitPullReviewOptions implements Serializable { * @return event */ @Schema(description = "") - public String getEvent() { + public EventEnum getEvent() { return event; } - public void setEvent(String event) { + public void setEvent(EventEnum event) { this.event = event; }