Skip to content

Commit c59420e

Browse files
slonopotamuszeripath
authored andcommitted
Update API (#1)
* Update to Gitea 1.10.0+dev-427-gf9aba9ba0 * Add swagger-codegen-maven-plugin to automate code generation * Regenerate swagger classes * Fix tests compilation caused by API changes * Drop Java 7 support It is EOL and not supported on Travis anymore. Intead, test against Java 11 * Fix Gradle script using nonexistent 'configurations.compileClasspath' * Update Gradle to 5.6.2 to add support for Java 11 * Add missing javax.annotation-api to build.gradle to fix compilation on Java 11
1 parent 59b3d0f commit c59420e

File tree

188 files changed

+19945
-2201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+19945
-2201
lines changed

.swagger-codegen/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.1
1+
2.4.8

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#
44
language: java
55
jdk:
6-
- oraclejdk8
7-
- oraclejdk7
6+
- openjdk8
7+
- openjdk11
88
before_install:
99
# ensure gradlew has proper permission
1010
- chmod a+x ./gradlew

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ if(hasProperty('target') && target == 'android') {
9393

9494
javadoc {
9595
source = sourceSets.main.allJava
96-
classpath = configurations.compileClasspath
96+
classpath = sourceSets.main.compileClasspath
9797

9898
options
9999
{
@@ -115,5 +115,6 @@ dependencies {
115115
compile 'com.google.code.gson:gson:2.8.1'
116116
compile 'io.gsonfire:gson-fire:1.8.0'
117117
compile 'org.threeten:threetenbp:1.3.5'
118+
compile 'javax.annotation:javax.annotation-api:1.3.2'
118119
testCompile 'junit:junit:4.12'
119120
}

docs/APIError.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# APIError
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**message** | **String** | | [optional]
8+
**url** | **String** | | [optional]
9+
10+
11+

docs/AccessToken.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**id** | **Long** | | [optional]
8-
**name** | **String** | | [optional]
9-
**sha1** | **String** | | [optional]
7+
**name** | **String** | |
108

119

1210

docs/AdminApi.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Method | HTTP request | Description
1111
[**adminDeleteUser**](AdminApi.md#adminDeleteUser) | **DELETE** /admin/users/{username} | Delete a user
1212
[**adminDeleteUserPublicKey**](AdminApi.md#adminDeleteUserPublicKey) | **DELETE** /admin/users/{username}/keys/{id} | Delete a user's public key
1313
[**adminEditUser**](AdminApi.md#adminEditUser) | **PATCH** /admin/users/{username} | Edit an existing user
14+
[**adminGetAllOrgs**](AdminApi.md#adminGetAllOrgs) | **GET** /admin/orgs | List all organizations
15+
[**adminGetAllUsers**](AdminApi.md#adminGetAllUsers) | **GET** /admin/users | List all users
1416

1517

1618
<a name="adminCreateOrg"></a>
@@ -595,3 +597,165 @@ Name | Type | Description | Notes
595597
- **Content-Type**: application/json
596598
- **Accept**: application/json
597599

600+
<a name="adminGetAllOrgs"></a>
601+
# **adminGetAllOrgs**
602+
> List&lt;Organization&gt; adminGetAllOrgs(page, limit)
603+
604+
List all organizations
605+
606+
### Example
607+
```java
608+
// Import classes:
609+
//import io.gitea.ApiClient;
610+
//import io.gitea.ApiException;
611+
//import io.gitea.Configuration;
612+
//import io.gitea.auth.*;
613+
//import io.gitea.api.AdminApi;
614+
615+
ApiClient defaultClient = Configuration.getDefaultApiClient();
616+
617+
// Configure API key authorization: AccessToken
618+
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
619+
AccessToken.setApiKey("YOUR API KEY");
620+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
621+
//AccessToken.setApiKeyPrefix("Token");
622+
623+
// Configure API key authorization: AuthorizationHeaderToken
624+
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
625+
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
626+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
627+
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
628+
629+
// Configure HTTP basic authorization: BasicAuth
630+
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
631+
BasicAuth.setUsername("YOUR USERNAME");
632+
BasicAuth.setPassword("YOUR PASSWORD");
633+
634+
// Configure API key authorization: SudoHeader
635+
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
636+
SudoHeader.setApiKey("YOUR API KEY");
637+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
638+
//SudoHeader.setApiKeyPrefix("Token");
639+
640+
// Configure API key authorization: SudoParam
641+
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
642+
SudoParam.setApiKey("YOUR API KEY");
643+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
644+
//SudoParam.setApiKeyPrefix("Token");
645+
646+
// Configure API key authorization: Token
647+
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
648+
Token.setApiKey("YOUR API KEY");
649+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
650+
//Token.setApiKeyPrefix("Token");
651+
652+
AdminApi apiInstance = new AdminApi();
653+
Integer page = 56; // Integer | page number of results to return (1-based)
654+
Integer limit = 56; // Integer | page size of results, maximum page size is 50
655+
try {
656+
List<Organization> result = apiInstance.adminGetAllOrgs(page, limit);
657+
System.out.println(result);
658+
} catch (ApiException e) {
659+
System.err.println("Exception when calling AdminApi#adminGetAllOrgs");
660+
e.printStackTrace();
661+
}
662+
```
663+
664+
### Parameters
665+
666+
Name | Type | Description | Notes
667+
------------- | ------------- | ------------- | -------------
668+
**page** | **Integer**| page number of results to return (1-based) | [optional]
669+
**limit** | **Integer**| page size of results, maximum page size is 50 | [optional]
670+
671+
### Return type
672+
673+
[**List&lt;Organization&gt;**](Organization.md)
674+
675+
### Authorization
676+
677+
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)
678+
679+
### HTTP request headers
680+
681+
- **Content-Type**: application/json, text/plain
682+
- **Accept**: application/json
683+
684+
<a name="adminGetAllUsers"></a>
685+
# **adminGetAllUsers**
686+
> List&lt;User&gt; adminGetAllUsers()
687+
688+
List all users
689+
690+
### Example
691+
```java
692+
// Import classes:
693+
//import io.gitea.ApiClient;
694+
//import io.gitea.ApiException;
695+
//import io.gitea.Configuration;
696+
//import io.gitea.auth.*;
697+
//import io.gitea.api.AdminApi;
698+
699+
ApiClient defaultClient = Configuration.getDefaultApiClient();
700+
701+
// Configure API key authorization: AccessToken
702+
ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken");
703+
AccessToken.setApiKey("YOUR API KEY");
704+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
705+
//AccessToken.setApiKeyPrefix("Token");
706+
707+
// Configure API key authorization: AuthorizationHeaderToken
708+
ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken");
709+
AuthorizationHeaderToken.setApiKey("YOUR API KEY");
710+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
711+
//AuthorizationHeaderToken.setApiKeyPrefix("Token");
712+
713+
// Configure HTTP basic authorization: BasicAuth
714+
HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
715+
BasicAuth.setUsername("YOUR USERNAME");
716+
BasicAuth.setPassword("YOUR PASSWORD");
717+
718+
// Configure API key authorization: SudoHeader
719+
ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader");
720+
SudoHeader.setApiKey("YOUR API KEY");
721+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
722+
//SudoHeader.setApiKeyPrefix("Token");
723+
724+
// Configure API key authorization: SudoParam
725+
ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam");
726+
SudoParam.setApiKey("YOUR API KEY");
727+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
728+
//SudoParam.setApiKeyPrefix("Token");
729+
730+
// Configure API key authorization: Token
731+
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
732+
Token.setApiKey("YOUR API KEY");
733+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
734+
//Token.setApiKeyPrefix("Token");
735+
736+
AdminApi apiInstance = new AdminApi();
737+
try {
738+
List<User> result = apiInstance.adminGetAllUsers();
739+
System.out.println(result);
740+
} catch (ApiException e) {
741+
System.err.println("Exception when calling AdminApi#adminGetAllUsers");
742+
e.printStackTrace();
743+
}
744+
```
745+
746+
### Parameters
747+
This endpoint does not need any parameter.
748+
749+
### Return type
750+
751+
[**List&lt;User&gt;**](User.md)
752+
753+
### Authorization
754+
755+
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token)
756+
757+
### HTTP request headers
758+
759+
- **Content-Type**: application/json, text/plain
760+
- **Accept**: application/json
761+

docs/AnnotatedTag.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# AnnotatedTag
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**message** | **String** | | [optional]
8+
**object** | [**AnnotatedTagObject**](AnnotatedTagObject.md) | | [optional]
9+
**sha** | **String** | | [optional]
10+
**tag** | **String** | | [optional]
11+
**tagger** | [**CommitUser**](CommitUser.md) | | [optional]
12+
**url** | **String** | | [optional]
13+
**verification** | [**PayloadCommitVerification**](PayloadCommitVerification.md) | | [optional]
14+
15+
16+

docs/AnnotatedTagObject.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# AnnotatedTagObject
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**sha** | **String** | | [optional]
8+
**type** | **String** | | [optional]
9+
**url** | **String** | | [optional]
10+
11+
12+

docs/Comment.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Name | Type | Description | Notes
99
**htmlUrl** | **String** | | [optional]
1010
**id** | **Long** | | [optional]
1111
**issueUrl** | **String** | | [optional]
12+
**originalAuthor** | **String** | | [optional]
13+
**originalAuthorId** | **Long** | | [optional]
1214
**pullRequestUrl** | **String** | | [optional]
1315
**updatedAt** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
1416
**user** | [**User**](User.md) | | [optional]

docs/Commit.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# Commit
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**author** | [**User**](User.md) | | [optional]
8+
**commit** | [**RepoCommit**](RepoCommit.md) | | [optional]
9+
**committer** | [**User**](User.md) | | [optional]
10+
**htmlUrl** | **String** | | [optional]
11+
**parents** | [**List&lt;CommitMeta&gt;**](CommitMeta.md) | | [optional]
12+
**sha** | **String** | | [optional]
13+
**url** | **String** | | [optional]
14+
15+
16+

docs/CommitMeta.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# CommitMeta
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**sha** | **String** | | [optional]
8+
**url** | **String** | | [optional]
9+
10+
11+

docs/CommitUser.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
# CommitUser
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**date** | **String** | | [optional]
8+
**email** | **String** | | [optional]
9+
**name** | **String** | | [optional]
10+
11+
12+

docs/ContentsResponse.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
# ContentsResponse
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**links** | [**FileLinksResponse**](FileLinksResponse.md) | | [optional]
8+
**content** | **String** | &#x60;content&#x60; is populated when &#x60;type&#x60; is &#x60;file&#x60;, otherwise null | [optional]
9+
**downloadUrl** | **String** | | [optional]
10+
**encoding** | **String** | &#x60;encoding&#x60; is populated when &#x60;type&#x60; is &#x60;file&#x60;, otherwise null | [optional]
11+
**gitUrl** | **String** | | [optional]
12+
**htmlUrl** | **String** | | [optional]
13+
**name** | **String** | | [optional]
14+
**path** | **String** | | [optional]
15+
**sha** | **String** | | [optional]
16+
**size** | **Long** | | [optional]
17+
**submoduleGitUrl** | **String** | &#x60;submodule_git_url&#x60; is populated when &#x60;type&#x60; is &#x60;submodule&#x60;, otherwise null | [optional]
18+
**target** | **String** | &#x60;target&#x60; is populated when &#x60;type&#x60; is &#x60;symlink&#x60;, otherwise null | [optional]
19+
**type** | **String** | &#x60;type&#x60; will be &#x60;file&#x60;, &#x60;dir&#x60;, &#x60;symlink&#x60;, or &#x60;submodule&#x60; | [optional]
20+
**url** | **String** | | [optional]
21+
22+
23+

docs/CreateFileOptions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
# CreateFileOptions
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**author** | [**Identity**](Identity.md) | | [optional]
8+
**branch** | **String** | branch (optional) to base this file from. if not given, the default branch is used | [optional]
9+
**committer** | [**Identity**](Identity.md) | | [optional]
10+
**content** | **String** | content must be base64 encoded |
11+
**message** | **String** | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional]
12+
**newBranch** | **String** | new_branch (optional) will make a new branch from &#x60;branch&#x60; before creating the file | [optional]
13+
14+
15+

docs/CreateHookOption.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**active** | **Boolean** | | [optional]
8+
**branchFilter** | **String** | | [optional]
89
**config** | **Map&lt;String, String&gt;** | |
910
**events** | **List&lt;String&gt;** | | [optional]
1011
**type** | [**TypeEnum**](#TypeEnum) | |

docs/CreateLabelOption.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**color** | **String** | |
8+
**description** | **String** | | [optional]
89
**name** | **String** | |
910

1011

docs/CreateOrgOption.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,19 @@ Name | Type | Description | Notes
77
**description** | **String** | | [optional]
88
**fullName** | **String** | | [optional]
99
**location** | **String** | | [optional]
10+
**repoAdminChangeTeamAccess** | **Boolean** | | [optional]
1011
**username** | **String** | |
12+
**visibility** | [**VisibilityEnum**](#VisibilityEnum) | possible values are &#x60;public&#x60; (default), &#x60;limited&#x60; or &#x60;private&#x60; | [optional]
1113
**website** | **String** | | [optional]
1214

1315

16+
<a name="VisibilityEnum"></a>
17+
## Enum: VisibilityEnum
18+
Name | Value
19+
---- | -----
20+
PUBLIC | &quot;public&quot;
21+
LIMITED | &quot;limited&quot;
22+
PRIVATE | &quot;private&quot;
23+
24+
1425

docs/CreateRepoOption.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
77
**autoInit** | **Boolean** | Whether the repository should be auto-intialized? | [optional]
88
**description** | **String** | Description of the repository to create | [optional]
99
**gitignores** | **String** | Gitignores to use | [optional]
10+
**issueLabels** | **String** | Issue Label set to use | [optional]
1011
**license** | **String** | License to use | [optional]
1112
**name** | **String** | Name of the repository to create |
1213
**_private** | **Boolean** | Whether the repository is private | [optional]

0 commit comments

Comments
 (0)