All URIs are relative to https://gitee.com/api/v5
Method | HTTP request | Description |
---|---|---|
deleteGistsGistIdCommentsId | DELETE /gists/{gist_id}/comments/{id} | 删除代码片段的评论 |
deleteGistsId | DELETE /gists/{id} | 删除指定代码片段 |
deleteGistsIdStar | DELETE /gists/{id}/star | 取消Star代码片段 |
getGists | GET /gists | 获取代码片段 |
getGistsGistIdComments | GET /gists/{gist_id}/comments | 获取代码片段的评论 |
getGistsGistIdCommentsId | GET /gists/{gist_id}/comments/{id} | 获取单条代码片段的评论 |
getGistsId | GET /gists/{id} | 获取单条代码片段 |
getGistsIdCommits | GET /gists/{id}/commits | 获取代码片段的commit |
getGistsIdForks | GET /gists/{id}/forks | 获取 Fork 了指定代码片段的列表 |
getGistsIdStar | GET /gists/{id}/star | 判断代码片段是否已Star |
getGistsStarred | GET /gists/starred | 获取用户Star的代码片段 |
patchGistsGistIdCommentsId | PATCH /gists/{gist_id}/comments/{id} | 修改代码片段的评论 |
patchGistsId | PATCH /gists/{id} | 修改代码片段 |
postGists | POST /gists | 创建代码片段 |
postGistsGistIdComments | POST /gists/{gist_id}/comments | 增加代码片段的评论 |
postGistsIdForks | POST /gists/{id}/forks | Fork代码片段 |
putGistsIdStar | PUT /gists/{id}/star | Star代码片段 |
deleteGistsGistIdCommentsId(gistId, 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String gistId = "gistId_example"; // String | 代码片段的ID
Integer id = 56; // Integer | 评论的ID
try {
apiInstance.deleteGistsGistIdCommentsId(gistId, id);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#deleteGistsGistIdCommentsId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
gistId | String | 代码片段的ID | |
id | Integer | 评论的ID |
null (empty response body)
deleteGistsId(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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
try {
apiInstance.deleteGistsId(id);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#deleteGistsId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID |
null (empty response body)
deleteGistsIdStar(id)
取消Star代码片段
取消Star代码片段
// 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
try {
apiInstance.deleteGistsIdStar(id);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#deleteGistsIdStar");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID |
null (empty response body)
List<Code> getGists(since, 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String since = "since_example"; // String | 起始的更新时间,要求时间格式为 ISO 8601
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<Code> result = apiInstance.getGists(since, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGists");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
since | String | 起始的更新时间,要求时间格式为 ISO 8601 | [optional] |
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
List<CodeComment> getGistsGistIdComments(gistId, 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String gistId = "gistId_example"; // String | 代码片段的ID
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<CodeComment> result = apiInstance.getGistsGistIdComments(gistId, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGistsGistIdComments");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
gistId | String | 代码片段的ID | |
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
CodeComment getGistsGistIdCommentsId(gistId, 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String gistId = "gistId_example"; // String | 代码片段的ID
Integer id = 56; // Integer | 评论的ID
try {
CodeComment result = apiInstance.getGistsGistIdCommentsId(gistId, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGistsGistIdCommentsId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
gistId | String | 代码片段的ID | |
id | Integer | 评论的ID |
CodeForksHistory getGistsId(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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
try {
CodeForksHistory result = apiInstance.getGistsId(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGistsId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID |
CodeForksHistory getGistsIdCommits(id)
获取代码片段的commit
获取代码片段的commit
// 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
try {
CodeForksHistory result = apiInstance.getGistsIdCommits(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGistsIdCommits");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID |
CodeForks getGistsIdForks(id, page, perPage)
获取 Fork 了指定代码片段的列表
获取 Fork 了指定代码片段的列表
// 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
CodeForks result = apiInstance.getGistsIdForks(id, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGistsIdForks");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID | |
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
getGistsIdStar(id)
判断代码片段是否已Star
判断代码片段是否已Star
// 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
try {
apiInstance.getGistsIdStar(id);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGistsIdStar");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID |
null (empty response body)
List<Code> getGistsStarred(since, page, perPage)
获取用户Star的代码片段
获取用户Star的代码片段
// 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String since = "since_example"; // String | 起始的更新时间,要求时间格式为 ISO 8601
Integer page = 1; // Integer | 当前的页码
Integer perPage = 20; // Integer | 每页的数量,最大为 100
try {
List<Code> result = apiInstance.getGistsStarred(since, page, perPage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#getGistsStarred");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
since | String | 起始的更新时间,要求时间格式为 ISO 8601 | [optional] |
page | Integer | 当前的页码 | [optional] [default to 1] |
perPage | Integer | 每页的数量,最大为 100 | [optional] [default to 20] [enum: 1, 100] |
CodeComment patchGistsGistIdCommentsId(gistId, id, 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String gistId = "gistId_example"; // String | 代码片段的ID
Integer id = 56; // Integer | 评论的ID
CommentBody body = new CommentBody(); // CommentBody |
try {
CodeComment result = apiInstance.patchGistsGistIdCommentsId(gistId, id, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#patchGistsGistIdCommentsId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
gistId | String | 代码片段的ID | |
id | Integer | 评论的ID | |
body | CommentBody | [optional] |
CodeForksHistory patchGistsId(id, 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
GistsIdBody body = new GistsIdBody(); // GistsIdBody |
try {
CodeForksHistory result = apiInstance.patchGistsId(id, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#patchGistsId");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID | |
body | GistsIdBody | [optional] |
List<CodeForksHistory> postGists(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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
GistsBody body = new GistsBody(); // GistsBody |
try {
List<CodeForksHistory> result = apiInstance.postGists(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#postGists");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | GistsBody | [optional] |
CodeComment postGistsGistIdComments(gistId, 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String gistId = "gistId_example"; // String | 代码片段的ID
GistIdCommentsBody body = new GistIdCommentsBody(); // GistIdCommentsBody |
try {
CodeComment result = apiInstance.postGistsGistIdComments(gistId, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#postGistsGistIdComments");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
gistId | String | 代码片段的ID | |
body | GistIdCommentsBody | [optional] |
postGistsIdForks(id)
Fork代码片段
Fork代码片段
// 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
try {
apiInstance.postGistsIdForks(id);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#postGistsIdForks");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID |
null (empty response body)
putGistsIdStar(id)
Star代码片段
Star代码片段
// 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.GistsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
GistsApi apiInstance = new GistsApi();
String id = "id_example"; // String | 代码片段的ID
try {
apiInstance.putGistsIdStar(id);
} catch (ApiException e) {
System.err.println("Exception when calling GistsApi#putGistsIdStar");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
id | String | 代码片段的ID |
null (empty response body)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。