From 372df0cdd311c73286ab46d19d1556499e898107 Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Sat, 30 Jul 2022 22:01:32 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/ContentsResponse.md | 1 + docs/CreatePushMirrorOption.md | 9 + docs/PushMirror.md | 12 + docs/RepositoryApi.md | 460 ++++++++++++++++++ .../gitnex/tea4j/v2/apis/RepositoryApi.java | 72 +++ .../tea4j/v2/models/ContentsResponse.java | 25 + .../v2/models/CreatePushMirrorOption.java | 154 ++++++ .../gitnex/tea4j/v2/models/PushMirror.java | 228 +++++++++ 8 files changed, 961 insertions(+) create mode 100644 docs/CreatePushMirrorOption.md create mode 100644 docs/PushMirror.md create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/CreatePushMirrorOption.java create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/PushMirror.java diff --git a/docs/ContentsResponse.md b/docs/ContentsResponse.md index 5e88755..5639c4e 100644 --- a/docs/ContentsResponse.md +++ b/docs/ContentsResponse.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **encoding** | **String** | `encoding` is populated when `type` is `file`, otherwise null | [optional] **gitUrl** | **String** | | [optional] **htmlUrl** | **String** | | [optional] +**lastCommitSha** | **String** | | [optional] **name** | **String** | | [optional] **path** | **String** | | [optional] **sha** | **String** | | [optional] diff --git a/docs/CreatePushMirrorOption.md b/docs/CreatePushMirrorOption.md new file mode 100644 index 0000000..61090ec --- /dev/null +++ b/docs/CreatePushMirrorOption.md @@ -0,0 +1,9 @@ +# CreatePushMirrorOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | **String** | | [optional] +**remoteAddress** | **String** | | [optional] +**remotePassword** | **String** | | [optional] +**remoteUsername** | **String** | | [optional] diff --git a/docs/PushMirror.md b/docs/PushMirror.md new file mode 100644 index 0000000..4535c1b --- /dev/null +++ b/docs/PushMirror.md @@ -0,0 +1,12 @@ +# PushMirror + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | **String** | | [optional] +**interval** | **String** | | [optional] +**lastError** | **String** | | [optional] +**lastUpdate** | **String** | | [optional] +**remoteAddress** | **String** | | [optional] +**remoteName** | **String** | | [optional] +**repoName** | **String** | | [optional] diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index 06a8ef2..72ec1eb 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -14,6 +14,7 @@ Method | HTTP request | Description [**listForks**](RepositoryApi.md#listForks) | **GET** repos/{owner}/{repo}/forks | List a repository's forks [**rejectRepoTransfer**](RepositoryApi.md#rejectRepoTransfer) | **POST** repos/{owner}/{repo}/transfer/reject | Reject a repo transfer [**repoAddCollaborator**](RepositoryApi.md#repoAddCollaborator) | **PUT** repos/{owner}/{repo}/collaborators/{collaborator} | Add a collaborator to a repository +[**repoAddPushMirror**](RepositoryApi.md#repoAddPushMirror) | **POST** repos/{owner}/{repo}/push_mirrors | add a push mirror to the repository [**repoAddTeam**](RepositoryApi.md#repoAddTeam) | **PUT** repos/{owner}/{repo}/teams/{team} | Add a team to a repository [**repoAddTopic**](RepositoryApi.md#repoAddTopic) | **PUT** repos/{owner}/{repo}/topics/{topic} | Add a topic to a repository [**repoApplyDiffPatch**](RepositoryApi.md#repoApplyDiffPatch) | **POST** repos/{owner}/{repo}/diffpatch | Apply diff patch to repository @@ -43,6 +44,7 @@ Method | HTTP request | Description [**repoDeleteKey**](RepositoryApi.md#repoDeleteKey) | **DELETE** repos/{owner}/{repo}/keys/{id} | Delete a key from a repository [**repoDeletePullReview**](RepositoryApi.md#repoDeletePullReview) | **DELETE** repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Delete a specific review from a pull request [**repoDeletePullReviewRequests**](RepositoryApi.md#repoDeletePullReviewRequests) | **DELETE** repos/{owner}/{repo}/pulls/{index}/requested_reviewers | cancel review requests for a pull request +[**repoDeletePushMirror**](RepositoryApi.md#repoDeletePushMirror) | **DELETE** repos/{owner}/{repo}/push_mirrors/{name} | deletes a push mirror from a repository by remoteName [**repoDeleteRelease**](RepositoryApi.md#repoDeleteRelease) | **DELETE** repos/{owner}/{repo}/releases/{id} | Delete a release [**repoDeleteReleaseAttachment**](RepositoryApi.md#repoDeleteReleaseAttachment) | **DELETE** repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Delete a release attachment [**repoDeleteReleaseByTag**](RepositoryApi.md#repoDeleteReleaseByTag) | **DELETE** repos/{owner}/{repo}/releases/tags/{tag} | Delete a release by tag name @@ -82,6 +84,7 @@ Method | HTTP request | Description [**repoGetPullRequestCommits**](RepositoryApi.md#repoGetPullRequestCommits) | **GET** repos/{owner}/{repo}/pulls/{index}/commits | Get commits for a pull request [**repoGetPullReview**](RepositoryApi.md#repoGetPullReview) | **GET** repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Get a specific review for a pull request [**repoGetPullReviewComments**](RepositoryApi.md#repoGetPullReviewComments) | **GET** repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments | Get a specific review for a pull request +[**repoGetPushMirrorByRemoteName**](RepositoryApi.md#repoGetPushMirrorByRemoteName) | **GET** repos/{owner}/{repo}/push_mirrors/{name} | Get push mirror of the repository by remoteName [**repoGetRawFile**](RepositoryApi.md#repoGetRawFile) | **GET** repos/{owner}/{repo}/raw/{filepath} | Get a file from a repository [**repoGetRawFileOrLFS**](RepositoryApi.md#repoGetRawFileOrLFS) | **GET** repos/{owner}/{repo}/media/{filepath} | Get a file or it's LFS object from a repository [**repoGetRelease**](RepositoryApi.md#repoGetRelease) | **GET** repos/{owner}/{repo}/releases/{id} | Get a release @@ -104,6 +107,7 @@ Method | HTTP request | Description [**repoListKeys**](RepositoryApi.md#repoListKeys) | **GET** repos/{owner}/{repo}/keys | List a repository's keys [**repoListPullRequests**](RepositoryApi.md#repoListPullRequests) | **GET** repos/{owner}/{repo}/pulls | List a repo's pull requests [**repoListPullReviews**](RepositoryApi.md#repoListPullReviews) | **GET** repos/{owner}/{repo}/pulls/{index}/reviews | List all reviews for a pull request +[**repoListPushMirrors**](RepositoryApi.md#repoListPushMirrors) | **GET** repos/{owner}/{repo}/push_mirrors | Get all push mirrors of the repository [**repoListReleaseAttachments**](RepositoryApi.md#repoListReleaseAttachments) | **GET** repos/{owner}/{repo}/releases/{id}/assets | List release's attachments [**repoListReleases**](RepositoryApi.md#repoListReleases) | **GET** repos/{owner}/{repo}/releases | List a repo's releases [**repoListStargazers**](RepositoryApi.md#repoListStargazers) | **GET** repos/{owner}/{repo}/stargazers | List a repo's stargazers @@ -117,6 +121,7 @@ Method | HTTP request | Description [**repoMigrate**](RepositoryApi.md#repoMigrate) | **POST** repos/migrate | Migrate a remote git repository [**repoMirrorSync**](RepositoryApi.md#repoMirrorSync) | **POST** repos/{owner}/{repo}/mirror-sync | Sync a mirrored repository [**repoPullRequestIsMerged**](RepositoryApi.md#repoPullRequestIsMerged) | **GET** repos/{owner}/{repo}/pulls/{index}/merge | Check if a pull request has been merged +[**repoPushMirrorSync**](RepositoryApi.md#repoPushMirrorSync) | **POST** repos/{owner}/{repo}/push_mirrors-sync | Sync all push mirrored repository [**repoSearch**](RepositoryApi.md#repoSearch) | **GET** repos/search | Search for repositories [**repoSigningKey**](RepositoryApi.md#repoSigningKey) | **GET** repos/{owner}/{repo}/signing-key.gpg | Get signing-key.gpg for given repository [**repoSubmitPullReview**](RepositoryApi.md#repoSubmitPullReview) | **POST** repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Submit a pending review to an pull request @@ -1045,6 +1050,97 @@ Name | Type | Description | Notes - **Content-Type**: application/json, text/plain - **Accept**: Not defined + +# **repoAddPushMirror** +> PushMirror repoAddPushMirror(owner, repo, body) + +add a push mirror to the repository + +### 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 +CreatePushMirrorOption body = new CreatePushMirrorOption(); // CreatePushMirrorOption | +try { + PushMirror result = apiInstance.repoAddPushMirror(owner, repo, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoAddPushMirror"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **body** | [**CreatePushMirrorOption**](CreatePushMirrorOption.md)| | [optional] + +### Return type + +[**PushMirror**](PushMirror.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 + - **Accept**: application/json + # **repoAddTeam** > Void repoAddTeam(owner, repo, team) @@ -3700,6 +3796,97 @@ Name | Type | Description | Notes - **Content-Type**: application/json, text/plain - **Accept**: Not defined + +# **repoDeletePushMirror** +> Void repoDeletePushMirror(owner, repo, name) + +deletes a push mirror from a repository by remoteName + +### 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 name = "name_example"; // String | remote name of the pushMirror +try { + Void result = apiInstance.repoDeletePushMirror(owner, repo, name); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoDeletePushMirror"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **name** | **String**| remote name of the pushMirror | + +### Return type + +[**Void**](.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 + - **Accept**: Not defined + # **repoDeleteRelease** > Void repoDeleteRelease(owner, repo, id) @@ -7282,6 +7469,97 @@ 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 + + +# **repoGetPushMirrorByRemoteName** +> PushMirror repoGetPushMirrorByRemoteName(owner, repo, name) + +Get push mirror of the repository by remoteName + +### 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 name = "name_example"; // String | remote name of push mirror +try { + PushMirror result = apiInstance.repoGetPushMirrorByRemoteName(owner, repo, name); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoGetPushMirrorByRemoteName"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **name** | **String**| remote name of push mirror | + +### Return type + +[**PushMirror**](PushMirror.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 @@ -9312,6 +9590,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 + + +# **repoListPushMirrors** +> List<PushMirror> repoListPushMirrors(owner, repo, page, limit) + +Get all push mirrors of the repository + +### 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 +Integer page = 56; // Integer | page number of results to return (1-based) +Integer limit = 56; // Integer | page size of results +try { + List result = apiInstance.repoListPushMirrors(owner, repo, page, limit); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoListPushMirrors"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo | + **repo** | **String**| name of the repo | + **page** | **Integer**| page number of results to return (1-based) | [optional] + **limit** | **Integer**| page size of results | [optional] + +### Return type + +[**List<PushMirror>**](PushMirror.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 @@ -10521,6 +10892,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**: Not defined + + +# **repoPushMirrorSync** +> Void repoPushMirrorSync(owner, repo) + +Sync all push mirrored repository + +### 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 to sync +String repo = "repo_example"; // String | name of the repo to sync +try { + Void result = apiInstance.repoPushMirrorSync(owner, repo); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#repoPushMirrorSync"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| owner of the repo to sync | + **repo** | **String**| name of the repo to sync | + +### Return type + +[**Void**](.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 26fcadf..25607b1 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -22,6 +22,7 @@ import org.gitnex.tea4j.v2.models.CreateHookOption; import org.gitnex.tea4j.v2.models.CreateKeyOption; import org.gitnex.tea4j.v2.models.CreatePullRequestOption; import org.gitnex.tea4j.v2.models.CreatePullReviewOptions; +import org.gitnex.tea4j.v2.models.CreatePushMirrorOption; import org.gitnex.tea4j.v2.models.CreateReleaseOption; import org.gitnex.tea4j.v2.models.CreateRepoOption; import org.gitnex.tea4j.v2.models.CreateStatusOption; @@ -52,6 +53,7 @@ import org.gitnex.tea4j.v2.models.PullRequest; import org.gitnex.tea4j.v2.models.PullReview; import org.gitnex.tea4j.v2.models.PullReviewComment; import org.gitnex.tea4j.v2.models.PullReviewRequestOptions; +import org.gitnex.tea4j.v2.models.PushMirror; import org.gitnex.tea4j.v2.models.Reference; import org.gitnex.tea4j.v2.models.Release; import org.gitnex.tea4j.v2.models.RepoCollaboratorPermission; @@ -220,6 +222,21 @@ public interface RepositoryApi { @retrofit2.http.Path("collaborator") String collaborator, @retrofit2.http.Body AddCollaboratorOption body); + /** + * add a push mirror to the repository + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param body (optional) + * @return Call<PushMirror> + */ + @Headers({"Content-Type:application/json"}) + @POST("repos/{owner}/{repo}/push_mirrors") + Call repoAddPushMirror( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Body CreatePushMirrorOption body); + /** * Add a team to a repository * @@ -657,6 +674,20 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("index") Long index); + /** + * deletes a push mirror from a repository by remoteName + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param name remote name of the pushMirror (required) + * @return Call<Void> + */ + @DELETE("repos/{owner}/{repo}/push_mirrors/{name}") + Call repoDeletePushMirror( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("name") String name); + /** * Delete a release * @@ -1252,6 +1283,20 @@ public interface RepositoryApi { @retrofit2.http.Path("index") Long index, @retrofit2.http.Path("id") Long id); + /** + * Get push mirror of the repository by remoteName + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param name remote name of push mirror (required) + * @return Call<PushMirror> + */ + @GET("repos/{owner}/{repo}/push_mirrors/{name}") + Call repoGetPushMirrorByRemoteName( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("name") String name); + /** * Get a file from a repository * @@ -1586,6 +1631,22 @@ public interface RepositoryApi { @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit); + /** + * Get all push mirrors of the repository + * + * @param owner owner of the repo (required) + * @param repo name of the repo (required) + * @param page page number of results to return (1-based) (optional) + * @param limit page size of results (optional) + * @return Call<List<PushMirror>> + */ + @GET("repos/{owner}/{repo}/push_mirrors") + Call> repoListPushMirrors( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Query("page") Integer page, + @retrofit2.http.Query("limit") Integer limit); + /** * List release's attachments * @@ -1794,6 +1855,17 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("index") Long index); + /** + * Sync all push mirrored repository + * + * @param owner owner of the repo to sync (required) + * @param repo name of the repo to sync (required) + * @return Call<Void> + */ + @POST("repos/{owner}/{repo}/push_mirrors-sync") + Call repoPushMirrorSync( + @retrofit2.http.Path("owner") String owner, @retrofit2.http.Path("repo") String repo); + /** * Search for repositories * diff --git a/src/main/java/org/gitnex/tea4j/v2/models/ContentsResponse.java b/src/main/java/org/gitnex/tea4j/v2/models/ContentsResponse.java index a3ede12..1ed83d5 100644 --- a/src/main/java/org/gitnex/tea4j/v2/models/ContentsResponse.java +++ b/src/main/java/org/gitnex/tea4j/v2/models/ContentsResponse.java @@ -46,6 +46,9 @@ public class ContentsResponse implements Serializable { @SerializedName("html_url") private String htmlUrl = null; + @SerializedName("last_commit_sha") + private String lastCommitSha = null; + @SerializedName("name") private String name = null; @@ -184,6 +187,25 @@ public class ContentsResponse implements Serializable { this.htmlUrl = htmlUrl; } + public ContentsResponse lastCommitSha(String lastCommitSha) { + this.lastCommitSha = lastCommitSha; + return this; + } + + /** + * Get lastCommitSha + * + * @return lastCommitSha + */ + @Schema(description = "") + public String getLastCommitSha() { + return lastCommitSha; + } + + public void setLastCommitSha(String lastCommitSha) { + this.lastCommitSha = lastCommitSha; + } + public ContentsResponse name(String name) { this.name = name; return this; @@ -354,6 +376,7 @@ public class ContentsResponse implements Serializable { && Objects.equals(this.encoding, contentsResponse.encoding) && Objects.equals(this.gitUrl, contentsResponse.gitUrl) && Objects.equals(this.htmlUrl, contentsResponse.htmlUrl) + && Objects.equals(this.lastCommitSha, contentsResponse.lastCommitSha) && Objects.equals(this.name, contentsResponse.name) && Objects.equals(this.path, contentsResponse.path) && Objects.equals(this.sha, contentsResponse.sha) @@ -373,6 +396,7 @@ public class ContentsResponse implements Serializable { encoding, gitUrl, htmlUrl, + lastCommitSha, name, path, sha, @@ -394,6 +418,7 @@ public class ContentsResponse implements Serializable { sb.append(" encoding: ").append(toIndentedString(encoding)).append("\n"); sb.append(" gitUrl: ").append(toIndentedString(gitUrl)).append("\n"); sb.append(" htmlUrl: ").append(toIndentedString(htmlUrl)).append("\n"); + sb.append(" lastCommitSha: ").append(toIndentedString(lastCommitSha)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" path: ").append(toIndentedString(path)).append("\n"); sb.append(" sha: ").append(toIndentedString(sha)).append("\n"); diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreatePushMirrorOption.java b/src/main/java/org/gitnex/tea4j/v2/models/CreatePushMirrorOption.java new file mode 100644 index 0000000..a7e0619 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/CreatePushMirrorOption.java @@ -0,0 +1,154 @@ +/* + * Gitea API. + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape | Safe}} + * + * + * 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; + +/** CreatePushMirrorOption */ +public class CreatePushMirrorOption implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("interval") + private String interval = null; + + @SerializedName("remote_address") + private String remoteAddress = null; + + @SerializedName("remote_password") + private String remotePassword = null; + + @SerializedName("remote_username") + private String remoteUsername = null; + + public CreatePushMirrorOption interval(String interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * + * @return interval + */ + @Schema(description = "") + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + public CreatePushMirrorOption remoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + return this; + } + + /** + * Get remoteAddress + * + * @return remoteAddress + */ + @Schema(description = "") + public String getRemoteAddress() { + return remoteAddress; + } + + public void setRemoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + } + + public CreatePushMirrorOption remotePassword(String remotePassword) { + this.remotePassword = remotePassword; + return this; + } + + /** + * Get remotePassword + * + * @return remotePassword + */ + @Schema(description = "") + public String getRemotePassword() { + return remotePassword; + } + + public void setRemotePassword(String remotePassword) { + this.remotePassword = remotePassword; + } + + public CreatePushMirrorOption remoteUsername(String remoteUsername) { + this.remoteUsername = remoteUsername; + return this; + } + + /** + * Get remoteUsername + * + * @return remoteUsername + */ + @Schema(description = "") + public String getRemoteUsername() { + return remoteUsername; + } + + public void setRemoteUsername(String remoteUsername) { + this.remoteUsername = remoteUsername; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePushMirrorOption createPushMirrorOption = (CreatePushMirrorOption) o; + return Objects.equals(this.interval, createPushMirrorOption.interval) + && Objects.equals(this.remoteAddress, createPushMirrorOption.remoteAddress) + && Objects.equals(this.remotePassword, createPushMirrorOption.remotePassword) + && Objects.equals(this.remoteUsername, createPushMirrorOption.remoteUsername); + } + + @Override + public int hashCode() { + return Objects.hash(interval, remoteAddress, remotePassword, remoteUsername); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePushMirrorOption {\n"); + + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); + sb.append(" remotePassword: ").append(toIndentedString(remotePassword)).append("\n"); + sb.append(" remoteUsername: ").append(toIndentedString(remoteUsername)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/org/gitnex/tea4j/v2/models/PushMirror.java b/src/main/java/org/gitnex/tea4j/v2/models/PushMirror.java new file mode 100644 index 0000000..f2dda45 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/PushMirror.java @@ -0,0 +1,228 @@ +/* + * Gitea API. + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape | Safe}} + * + * + * 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; + +/** PushMirror represents information of a push mirror */ +@Schema(description = "PushMirror represents information of a push mirror") +public class PushMirror implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("created") + private String created = null; + + @SerializedName("interval") + private String interval = null; + + @SerializedName("last_error") + private String lastError = null; + + @SerializedName("last_update") + private String lastUpdate = null; + + @SerializedName("remote_address") + private String remoteAddress = null; + + @SerializedName("remote_name") + private String remoteName = null; + + @SerializedName("repo_name") + private String repoName = null; + + public PushMirror created(String created) { + this.created = created; + return this; + } + + /** + * Get created + * + * @return created + */ + @Schema(description = "") + public String getCreated() { + return created; + } + + public void setCreated(String created) { + this.created = created; + } + + public PushMirror interval(String interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * + * @return interval + */ + @Schema(description = "") + public String getInterval() { + return interval; + } + + public void setInterval(String interval) { + this.interval = interval; + } + + public PushMirror lastError(String lastError) { + this.lastError = lastError; + return this; + } + + /** + * Get lastError + * + * @return lastError + */ + @Schema(description = "") + public String getLastError() { + return lastError; + } + + public void setLastError(String lastError) { + this.lastError = lastError; + } + + public PushMirror lastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; + return this; + } + + /** + * Get lastUpdate + * + * @return lastUpdate + */ + @Schema(description = "") + public String getLastUpdate() { + return lastUpdate; + } + + public void setLastUpdate(String lastUpdate) { + this.lastUpdate = lastUpdate; + } + + public PushMirror remoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + return this; + } + + /** + * Get remoteAddress + * + * @return remoteAddress + */ + @Schema(description = "") + public String getRemoteAddress() { + return remoteAddress; + } + + public void setRemoteAddress(String remoteAddress) { + this.remoteAddress = remoteAddress; + } + + public PushMirror remoteName(String remoteName) { + this.remoteName = remoteName; + return this; + } + + /** + * Get remoteName + * + * @return remoteName + */ + @Schema(description = "") + public String getRemoteName() { + return remoteName; + } + + public void setRemoteName(String remoteName) { + this.remoteName = remoteName; + } + + public PushMirror repoName(String repoName) { + this.repoName = repoName; + return this; + } + + /** + * Get repoName + * + * @return repoName + */ + @Schema(description = "") + public String getRepoName() { + return repoName; + } + + public void setRepoName(String repoName) { + this.repoName = repoName; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushMirror pushMirror = (PushMirror) o; + return Objects.equals(this.created, pushMirror.created) + && Objects.equals(this.interval, pushMirror.interval) + && Objects.equals(this.lastError, pushMirror.lastError) + && Objects.equals(this.lastUpdate, pushMirror.lastUpdate) + && Objects.equals(this.remoteAddress, pushMirror.remoteAddress) + && Objects.equals(this.remoteName, pushMirror.remoteName) + && Objects.equals(this.repoName, pushMirror.repoName); + } + + @Override + public int hashCode() { + return Objects.hash( + created, interval, lastError, lastUpdate, remoteAddress, remoteName, repoName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PushMirror {\n"); + + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" lastError: ").append(toIndentedString(lastError)).append("\n"); + sb.append(" lastUpdate: ").append(toIndentedString(lastUpdate)).append("\n"); + sb.append(" remoteAddress: ").append(toIndentedString(remoteAddress)).append("\n"); + sb.append(" remoteName: ").append(toIndentedString(remoteName)).append("\n"); + sb.append(" repoName: ").append(toIndentedString(repoName)).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 "); + } +}