From d29a62314fa038eaf57abdfbd801210c24b99d0d Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Fri, 27 Jan 2023 00:10:04 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/RepositoryApi.md | 90 +++++++++++++++++++ .../gitnex/tea4j/v2/apis/RepositoryApi.java | 11 +++ 2 files changed, 101 insertions(+) diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index ae71e89..d4631f9 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -79,6 +79,7 @@ Method | HTTP request | Description [**repoGetIssueTemplates**](RepositoryApi.md#repoGetIssueTemplates) | **GET** repos/{owner}/{repo}/issue_templates | Get available issue templates for a repository [**repoGetKey**](RepositoryApi.md#repoGetKey) | **GET** repos/{owner}/{repo}/keys/{id} | Get a repository's key by id [**repoGetLanguages**](RepositoryApi.md#repoGetLanguages) | **GET** repos/{owner}/{repo}/languages | Get languages and number of bytes of code written +[**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 [**repoGetPullRequestCommits**](RepositoryApi.md#repoGetPullRequestCommits) | **GET** repos/{owner}/{repo}/pulls/{index}/commits | Get commits for a pull request @@ -7009,6 +7010,95 @@ 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 + + +# **repoGetLatestRelease** +> Release repoGetLatestRelease(owner, repo) + +Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at + +### 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 +try { + Release result = apiInstance.repoGetLatestRelease(owner, repo); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoGetLatestRelease"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + +### Return type + +[**Release**](Release.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 68b7c7e..1c8ee16 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -1209,6 +1209,17 @@ public interface RepositoryApi { Call> repoGetLanguages( @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo); + /** + * Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @return Call<Release> + */ + @GET("repos/{owner}/{repo}/releases/latest") + Call repoGetLatestRelease( + @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo); + /** * Get a note corresponding to a single commit from a repository *