diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index a345603..a706f0d 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -87,6 +87,7 @@ Method | HTTP request | Description [**repoGetLatestRelease**](RepositoryApi.md#repoGetLatestRelease) | **GET** repos/{owner}/{repo}/releases/latest | Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at [**repoGetNote**](RepositoryApi.md#repoGetNote) | **GET** repos/{owner}/{repo}/git/notes/{sha} | Get a note corresponding to a single commit from a repository [**repoGetPullRequest**](RepositoryApi.md#repoGetPullRequest) | **GET** repos/{owner}/{repo}/pulls/{index} | Get a pull request +[**repoGetPullRequestByBaseHead**](RepositoryApi.md#repoGetPullRequestByBaseHead) | **GET** repos/{owner}/{repo}/pulls/{base}/{head} | Get a pull request by base and head [**repoGetPullRequestCommits**](RepositoryApi.md#repoGetPullRequestCommits) | **GET** repos/{owner}/{repo}/pulls/{index}/commits | Get commits for a pull request [**repoGetPullRequestFiles**](RepositoryApi.md#repoGetPullRequestFiles) | **GET** repos/{owner}/{repo}/pulls/{index}/files | Get changed files for a pull request [**repoGetPullReview**](RepositoryApi.md#repoGetPullReview) | **GET** repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Get a specific review for a pull request @@ -7755,6 +7756,99 @@ 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 + + +# **repoGetPullRequestByBaseHead** +> PullRequest repoGetPullRequestByBaseHead(owner, repo, base, head) + +Get a pull request by base and head + +### 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 base = "base_example"; // String | base of the pull request to get +String head = "head_example"; // String | head of the pull request to get +try { + PullRequest result = apiInstance.repoGetPullRequestByBaseHead(owner, repo, base, head); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoGetPullRequestByBaseHead"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **base** | **String**| base of the pull request to get | + **head** | **String**| head of the pull request to get | + +### Return type + +[**PullRequest**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) + ### HTTP request headers - **Content-Type**: Not defined diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java index dad33af..30c46b5 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -1336,6 +1336,22 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("index") Long index); + /** + * Get a pull request by base and head + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param base base of the pull request to get (required) + * @param head head of the pull request to get (required) + * @return Call<PullRequest> + */ + @GET("repos/{owner}/{repo}/pulls/{base}/{head}") + Call repoGetPullRequestByBaseHead( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("base") String base, + @retrofit2.http.Path("head") String head); + /** * Get commits for a pull request *