diff --git a/docs/CreatePullReviewCommentReplyOptions.md b/docs/CreatePullReviewCommentReplyOptions.md new file mode 100644 index 0000000..6e472e0 --- /dev/null +++ b/docs/CreatePullReviewCommentReplyOptions.md @@ -0,0 +1,6 @@ +# CreatePullReviewCommentReplyOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | [optional] diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index f071e3a..50bb7af 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -58,6 +58,7 @@ Method | HTTP request | Description [**repoCreateKey**](RepositoryApi.md#repoCreateKey) | **POST** repos/{owner}/{repo}/keys | Add a key to a repository [**repoCreatePullRequest**](RepositoryApi.md#repoCreatePullRequest) | **POST** repos/{owner}/{repo}/pulls | Create a pull request [**repoCreatePullReview**](RepositoryApi.md#repoCreatePullReview) | **POST** repos/{owner}/{repo}/pulls/{index}/reviews | Create a review to a pull request +[**repoCreatePullReviewCommentReply**](RepositoryApi.md#repoCreatePullReviewCommentReply) | **POST** repos/{owner}/{repo}/pulls/{index}/comments/{id}/replies | Reply to a pull request review comment [**repoCreatePullReviewRequests**](RepositoryApi.md#repoCreatePullReviewRequests) | **POST** repos/{owner}/{repo}/pulls/{index}/requested_reviewers | create review requests for a pull request [**repoCreateRelease**](RepositoryApi.md#repoCreateRelease) | **POST** repos/{owner}/{repo}/releases | Create a release [**repoCreateReleaseAttachment**](RepositoryApi.md#repoCreateReleaseAttachment) | **POST** repos/{owner}/{repo}/releases/{id}/assets | Create a release attachment @@ -5161,6 +5162,101 @@ 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**: application/json + - **Accept**: application/json + + +# **repoCreatePullReviewCommentReply** +> PullReviewComment repoCreatePullReviewCommentReply(body, owner, repo, index, id) + +Reply to a pull request review comment + +### 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(); +CreatePullReviewCommentReplyOptions body = new CreatePullReviewCommentReplyOptions(); // CreatePullReviewCommentReplyOptions | +String owner = "owner_example"; // String | owner of the repo +String repo = "repo_example"; // String | name of the repo +Long index = 789L; // Long | index of the pull request +Long id = 789L; // Long | id of the review comment to reply to +try { + PullReviewComment result = apiInstance.repoCreatePullReviewCommentReply(body, owner, repo, index, id); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoCreatePullReviewCommentReply"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreatePullReviewCommentReplyOptions**](CreatePullReviewCommentReplyOptions.md)| | + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **index** | **Long**| index of the pull request | + **id** | **Long**| id of the review comment to reply to | + +### Return type + +[**PullReviewComment**](PullReviewComment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) + ### HTTP request headers - **Content-Type**: application/json 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 17cc5d2..a9b7bcc 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -42,6 +42,7 @@ import org.gitnex.tea4j.v2.models.CreateHookOption; import org.gitnex.tea4j.v2.models.CreateKeyOption; import org.gitnex.tea4j.v2.models.CreateOrUpdateSecretOption; import org.gitnex.tea4j.v2.models.CreatePullRequestOption; +import org.gitnex.tea4j.v2.models.CreatePullReviewCommentReplyOptions; import org.gitnex.tea4j.v2.models.CreatePullReviewOptions; import org.gitnex.tea4j.v2.models.CreatePushMirrorOption; import org.gitnex.tea4j.v2.models.CreateReleaseOption; @@ -942,6 +943,25 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("index") Long index); + /** + * Reply to a pull request review comment + * + * @param body (required) + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param index index of the pull request (required) + * @param id id of the review comment to reply to (required) + * @return Call<PullReviewComment> + */ + @Headers({"Content-Type:application/json"}) + @POST("repos/{owner}/{repo}/pulls/{index}/comments/{id}/replies") + Call repoCreatePullReviewCommentReply( + @retrofit2.http.Body CreatePullReviewCommentReplyOptions body, + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("index") Long index, + @retrofit2.http.Path("id") Long id); + /** * create review requests for a pull request * diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreatePullReviewCommentReplyOptions.java b/src/main/java/org/gitnex/tea4j/v2/models/CreatePullReviewCommentReplyOptions.java new file mode 100644 index 0000000..6b61d9b --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/CreatePullReviewCommentReplyOptions.java @@ -0,0 +1,86 @@ +/* + * 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; + +/** CreatePullReviewCommentReplyOptions are options to reply to a pull request review comment */ +@Schema( + description = + "CreatePullReviewCommentReplyOptions are options to reply to a pull request review comment") +public class CreatePullReviewCommentReplyOptions implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("body") + private String body = null; + + public CreatePullReviewCommentReplyOptions body(String body) { + this.body = body; + return this; + } + + /** + * Get body + * + * @return body + */ + @Schema(description = "") + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePullReviewCommentReplyOptions createPullReviewCommentReplyOptions = + (CreatePullReviewCommentReplyOptions) o; + return Objects.equals(this.body, createPullReviewCommentReplyOptions.body); + } + + @Override + public int hashCode() { + return Objects.hash(body); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePullReviewCommentReplyOptions {\n"); + + sb.append(" body: ").append(toIndentedString(body)).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 "); + } +}