All URIs are relative to https://gitee.com/api/v5
Method | HTTP request | Description |
---|---|---|
deleteUserFollowingUsername | DELETE /user/following/{username} | 取消关注一个用户 |
deleteUserKeysId | DELETE /user/keys/{id} | 删除一个公钥 |
getUser | GET /user | 获取授权用户的资料 |
getUserFollowers | GET /user/followers | 列出授权用户的关注者 |
getUserFollowing | GET /user/following | 列出授权用户正关注的用户 |
getUserFollowingUsername | GET /user/following/{username} | 检查授权用户是否关注了一个用户 |
getUserKeys | GET /user/keys | 列出授权用户的所有公钥 |
getUserKeysId | GET /user/keys/{id} | 获取一个公钥 |
getUserNamespace | GET /user/namespace | 获取授权用户的一个 Namespace |
getUserNamespaces | GET /user/namespaces | 列出授权用户所有的 Namespace |
getUsersUsername | GET /users/{username} | 获取一个用户 |
getUsersUsernameFollowers | GET /users/{username}/followers | 列出指定用户的关注者 |
getUsersUsernameFollowing | GET /users/{username}/following | 列出指定用户正在关注的用户 |
getUsersUsernameFollowingTargetUser | GET /users/{username}/following/{target_user} | 检查指定用户是否关注目标用户 |
getUsersUsernameKeys | GET /users/{username}/keys | 列出指定用户的所有公钥 |
patchUser | PATCH /user | 更新授权用户的资料 |
postUserKeys | POST /user/keys | 添加一个公钥 |
putUserFollowingUsername | PUT /user/following/{username} | 关注一个用户 |
deleteUserFollowingUsername(username)
取消关注一个用户
取消关注一个用户
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
try {
apiInstance.deleteUserFollowingUsername(username);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#deleteUserFollowingUsername");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) |
null (empty response body)
deleteUserKeysId(id)
删除一个公钥
删除一个公钥
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
Integer id = 56; // Integer | 公钥 ID
try {
apiInstance.deleteUserKeysId(id);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#deleteUserKeysId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | Integer | 公钥 ID |
null (empty response body)
UserDetail getUser()
获取授权用户的资料
获取授权用户的资料
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
try {
UserDetail result = apiInstance.getUser();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUser");
e.printStackTrace();
}
This endpoint does not need any parameter.
List<UserBasic> getUserFollowers(page, perPage)
列出授权用户的关注者
列出授权用户的关注者
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<UserBasic> result = apiInstance.getUserFollowers(page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserFollowers");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
List<UserBasic> getUserFollowing(page, perPage)
列出授权用户正关注的用户
列出授权用户正关注的用户
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<UserBasic> result = apiInstance.getUserFollowing(page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserFollowing");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
getUserFollowingUsername(username)
检查授权用户是否关注了一个用户
检查授权用户是否关注了一个用户
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
try {
apiInstance.getUserFollowingUsername(username);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserFollowingUsername");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) |
null (empty response body)
List<SSHKey> getUserKeys(page, perPage)
列出授权用户的所有公钥
列出授权用户的所有公钥
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<SSHKey> result = apiInstance.getUserKeys(page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserKeys");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
SSHKey getUserKeysId(id)
获取一个公钥
获取一个公钥
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
Integer id = 56; // Integer | 公钥 ID
try {
SSHKey result = apiInstance.getUserKeysId(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserKeysId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | Integer | 公钥 ID |
Namespace getUserNamespace(path)
获取授权用户的一个 Namespace
获取授权用户的一个 Namespace
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String path = "path_example"; // String | Namespace path
try {
Namespace result = apiInstance.getUserNamespace(path);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserNamespace");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
path | String | Namespace path |
List<Namespace> getUserNamespaces(mode)
列出授权用户所有的 Namespace
列出授权用户所有的 Namespace
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String mode = "mode_example"; // String | 参与方式: project(所有参与仓库的namepsce)、intrant(所加入的namespace)、all(包含前两者),默认(intrant)
try {
List<Namespace> result = apiInstance.getUserNamespaces(mode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUserNamespaces");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
mode | String | 参与方式: project(所有参与仓库的namepsce)、intrant(所加入的namespace)、all(包含前两者),默认(intrant) | [optional] [enum: project, intrant, all] |
UserInfo getUsersUsername(username)
获取一个用户
获取一个用户
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
try {
UserInfo result = apiInstance.getUsersUsername(username);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUsersUsername");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) |
List<UserBasic> getUsersUsernameFollowers(username, page, perPage)
列出指定用户的关注者
列出指定用户的关注者
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<UserBasic> result = apiInstance.getUsersUsernameFollowers(username, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUsersUsernameFollowers");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) | |
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
List<UserBasic> getUsersUsernameFollowing(username, page, perPage)
列出指定用户正在关注的用户
列出指定用户正在关注的用户
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<UserBasic> result = apiInstance.getUsersUsernameFollowing(username, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUsersUsernameFollowing");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) | |
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
getUsersUsernameFollowingTargetUser(username, targetUser)
检查指定用户是否关注目标用户
检查指定用户是否关注目标用户
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
String targetUser = "targetUser_example"; // String | 目标用户的用户名(username/login)
try {
apiInstance.getUsersUsernameFollowingTargetUser(username, targetUser);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUsersUsernameFollowingTargetUser");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) | |
targetUser | String | 目标用户的用户名(username/login) |
null (empty response body)
List<SSHKeyBasic> getUsersUsernameKeys(username, page, perPage)
列出指定用户的所有公钥
列出指定用户的所有公钥
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<SSHKeyBasic> result = apiInstance.getUsersUsernameKeys(username, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#getUsersUsernameKeys");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) | |
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
User patchUser(body)
更新授权用户的资料
更新授权用户的资料
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
UserBody body = new UserBody(); // UserBody |
try {
User result = apiInstance.patchUser(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#patchUser");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | UserBody | [optional] |
SSHKey postUserKeys(body)
添加一个公钥
添加一个公钥
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
UserKeysBody body = new UserKeysBody(); // UserKeysBody |
try {
SSHKey result = apiInstance.postUserKeys(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#postUserKeys");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | UserKeysBody | [optional] |
putUserFollowingUsername(username)
关注一个用户
关注一个用户
// Import classes:
//import com.gitee.sdk.gitee5j.ApiClient;
//import com.gitee.sdk.gitee5j.ApiException;
//import com.gitee.sdk.gitee5j.Configuration;
//import com.gitee.sdk.gitee5j.auth.*;
//import com.gitee.sdk.gitee5j.api.UsersApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
UsersApi apiInstance = new UsersApi();
String username = "username_example"; // String | 用户名(username/login)
try {
apiInstance.putUserFollowingUsername(username);
} catch (ApiException e) {
System.err.println("Exception when calling UsersApi#putUserFollowingUsername");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
username | String | 用户名(username/login) |
null (empty response body)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。