All URIs are relative to https://gitee.com/api
Method | HTTP request | Description |
---|---|---|
delete_v5_gists_gist_id_comments_id | DELETE /v5/gists/{gist_id}/comments/{id} | 删除代码片段的评论 |
delete_v5_gists_id | DELETE /v5/gists/{id} | 删除该条代码片段 |
delete_v5_gists_id_star | DELETE /v5/gists/{id}/star | 取消Star代码片段 |
get_v5_gists | GET /v5/gists | 获取代码片段 |
get_v5_gists_gist_id_comments | GET /v5/gists/{gist_id}/comments | 获取代码片段的评论 |
get_v5_gists_gist_id_comments_id | GET /v5/gists/{gist_id}/comments/{id} | 获取单条代码片段的评论 |
get_v5_gists_id | GET /v5/gists/{id} | 获取单条代码片段 |
get_v5_gists_id_commits | GET /v5/gists/{id}/commits | 获取代码片段的commit |
get_v5_gists_id_forks | GET /v5/gists/{id}/forks | 获取Fork该条代码片段的列表 |
get_v5_gists_id_star | GET /v5/gists/{id}/star | 判断代码片段是否已Star |
get_v5_gists_public | GET /v5/gists/public | 获取公开的代码片段 |
get_v5_gists_starred | GET /v5/gists/starred | 获取用户Star的代码片段 |
get_v5_users_username_gists | GET /v5/users/{username}/gists | 获取指定用户的公开代码片段 |
patch_v5_gists_gist_id_comments_id | PATCH /v5/gists/{gist_id}/comments/{id} | 修改代码片段的评论 |
patch_v5_gists_id | PATCH /v5/gists/{id} | 修改代码片段 |
post_v5_gists | POST /v5/gists | 创建代码片段 |
post_v5_gists_gist_id_comments | POST /v5/gists/{gist_id}/comments | 增加代码片段的评论 |
post_v5_gists_id_forks | POST /v5/gists/{id}/forks | Fork代码片段 |
put_v5_gists_id_star | PUT /v5/gists/{id}/star | Star代码片段 |
delete_v5_gists_gist_id_comments_id(gist_id, id, access_token=access_token)
删除代码片段的评论
删除代码片段的评论
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
gist_id = 'gist_id_example' # str | 代码片段的ID
id = 56 # int | 评论的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 删除代码片段的评论
api_instance.delete_v5_gists_gist_id_comments_id(gist_id, id, access_token=access_token)
except ApiException as e:
print("Exception when calling GistsApi->delete_v5_gists_gist_id_comments_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gist_id | str | 代码片段的ID | |
id | int | 评论的ID | |
access_token | str | 用户授权码 | [optional] |
void (empty response body)
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_v5_gists_id(id, access_token=access_token)
删除该条代码片段
删除该条代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 删除该条代码片段
api_instance.delete_v5_gists_id(id, access_token=access_token)
except ApiException as e:
print("Exception when calling GistsApi->delete_v5_gists_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
void (empty response body)
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_v5_gists_id_star(id, access_token=access_token)
取消Star代码片段
取消Star代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 取消Star代码片段
api_instance.delete_v5_gists_id_star(id, access_token=access_token)
except ApiException as e:
print("Exception when calling GistsApi->delete_v5_gists_id_star: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
void (empty response body)
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Code] get_v5_gists(access_token=access_token, since=since, page=page, per_page=per_page)
获取代码片段
获取代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
access_token = 'access_token_example' # str | 用户授权码 (optional)
since = 'since_example' # str | 起始的更新时间,要求时间格式为 ISO 8601 (optional)
page = 1 # int | 当前的页码 (optional) (default to 1)
per_page = 20 # int | 每页的数量 (optional) (default to 20)
try:
# 获取代码片段
api_response = api_instance.get_v5_gists(access_token=access_token, since=since, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
access_token | str | 用户授权码 | [optional] |
since | str | 起始的更新时间,要求时间格式为 ISO 8601 | [optional] |
page | int | 当前的页码 | [optional] [default to 1] |
per_page | int | 每页的数量 | [optional] [default to 20] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[CodeComment] get_v5_gists_gist_id_comments(gist_id, access_token=access_token, page=page, per_page=per_page)
获取代码片段的评论
获取代码片段的评论
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
gist_id = 'gist_id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
page = 1 # int | 当前的页码 (optional) (default to 1)
per_page = 20 # int | 每页的数量 (optional) (default to 20)
try:
# 获取代码片段的评论
api_response = api_instance.get_v5_gists_gist_id_comments(gist_id, access_token=access_token, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_gist_id_comments: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gist_id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
page | int | 当前的页码 | [optional] [default to 1] |
per_page | int | 每页的数量 | [optional] [default to 20] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CodeComment get_v5_gists_gist_id_comments_id(gist_id, id, access_token=access_token)
获取单条代码片段的评论
获取单条代码片段的评论
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
gist_id = 'gist_id_example' # str | 代码片段的ID
id = 56 # int | 评论的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 获取单条代码片段的评论
api_response = api_instance.get_v5_gists_gist_id_comments_id(gist_id, id, access_token=access_token)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_gist_id_comments_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gist_id | str | 代码片段的ID | |
id | int | 评论的ID | |
access_token | str | 用户授权码 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CodeForksHistory get_v5_gists_id(id, access_token=access_token)
获取单条代码片段
获取单条代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 获取单条代码片段
api_response = api_instance.get_v5_gists_id(id, access_token=access_token)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CodeForksHistory get_v5_gists_id_commits(id, access_token=access_token)
获取代码片段的commit
获取代码片段的commit
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 获取代码片段的commit
api_response = api_instance.get_v5_gists_id_commits(id, access_token=access_token)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_id_commits: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CodeForks get_v5_gists_id_forks(id, access_token=access_token, page=page, per_page=per_page)
获取Fork该条代码片段的列表
获取Fork该条代码片段的列表
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
page = 1 # int | 当前的页码 (optional) (default to 1)
per_page = 20 # int | 每页的数量 (optional) (default to 20)
try:
# 获取Fork该条代码片段的列表
api_response = api_instance.get_v5_gists_id_forks(id, access_token=access_token, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_id_forks: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
page | int | 当前的页码 | [optional] [default to 1] |
per_page | int | 每页的数量 | [optional] [default to 20] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_v5_gists_id_star(id, access_token=access_token)
判断代码片段是否已Star
判断代码片段是否已Star
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 判断代码片段是否已Star
api_instance.get_v5_gists_id_star(id, access_token=access_token)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_id_star: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
void (empty response body)
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Code] get_v5_gists_public(access_token=access_token, since=since, page=page, per_page=per_page)
获取公开的代码片段
获取公开的代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
access_token = 'access_token_example' # str | 用户授权码 (optional)
since = 'since_example' # str | 起始的更新时间,要求时间格式为 ISO 8601 (optional)
page = 1 # int | 当前的页码 (optional) (default to 1)
per_page = 20 # int | 每页的数量 (optional) (default to 20)
try:
# 获取公开的代码片段
api_response = api_instance.get_v5_gists_public(access_token=access_token, since=since, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_public: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
access_token | str | 用户授权码 | [optional] |
since | str | 起始的更新时间,要求时间格式为 ISO 8601 | [optional] |
page | int | 当前的页码 | [optional] [default to 1] |
per_page | int | 每页的数量 | [optional] [default to 20] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Code] get_v5_gists_starred(access_token=access_token, since=since, page=page, per_page=per_page)
获取用户Star的代码片段
获取用户Star的代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
access_token = 'access_token_example' # str | 用户授权码 (optional)
since = 'since_example' # str | 起始的更新时间,要求时间格式为 ISO 8601 (optional)
page = 1 # int | 当前的页码 (optional) (default to 1)
per_page = 20 # int | 每页的数量 (optional) (default to 20)
try:
# 获取用户Star的代码片段
api_response = api_instance.get_v5_gists_starred(access_token=access_token, since=since, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_gists_starred: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
access_token | str | 用户授权码 | [optional] |
since | str | 起始的更新时间,要求时间格式为 ISO 8601 | [optional] |
page | int | 当前的页码 | [optional] [default to 1] |
per_page | int | 每页的数量 | [optional] [default to 20] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Code] get_v5_users_username_gists(username, access_token=access_token, page=page, per_page=per_page)
获取指定用户的公开代码片段
获取指定用户的公开代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
username = 'username_example' # str | 用户名(username/login)
access_token = 'access_token_example' # str | 用户授权码 (optional)
page = 1 # int | 当前的页码 (optional) (default to 1)
per_page = 20 # int | 每页的数量 (optional) (default to 20)
try:
# 获取指定用户的公开代码片段
api_response = api_instance.get_v5_users_username_gists(username, access_token=access_token, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->get_v5_users_username_gists: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
username | str | 用户名(username/login) | |
access_token | str | 用户授权码 | [optional] |
page | int | 当前的页码 | [optional] [default to 1] |
per_page | int | 每页的数量 | [optional] [default to 20] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CodeComment patch_v5_gists_gist_id_comments_id(gist_id, id, body, access_token=access_token)
修改代码片段的评论
修改代码片段的评论
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
gist_id = 'gist_id_example' # str | 代码片段的ID
id = 56 # int | 评论的ID
body = 'body_example' # str | 评论内容
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 修改代码片段的评论
api_response = api_instance.patch_v5_gists_gist_id_comments_id(gist_id, id, body, access_token=access_token)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->patch_v5_gists_gist_id_comments_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gist_id | str | 代码片段的ID | |
id | int | 评论的ID | |
body | str | 评论内容 | |
access_token | str | 用户授权码 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CodeForksHistory patch_v5_gists_id(id, files, description, access_token=access_token, public=public)
修改代码片段
修改代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
files = {'key': 'files_example'} # dict(str, str) | Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } }
description = 'description_example' # str | 代码片段描述,1~30个字符
access_token = 'access_token_example' # str | 用户授权码 (optional)
public = true # bool | 公开/私有,默认: 私有 (optional)
try:
# 修改代码片段
api_response = api_instance.patch_v5_gists_id(id, files, description, access_token=access_token, public=public)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->patch_v5_gists_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
files | dict(str, str) | Hash形式的代码片段文件名以及文件内容。如: { "file1.txt": { "content": "String file contents" } } | |
description | str | 代码片段描述,1~30个字符 | |
access_token | str | 用户授权码 | [optional] |
public | bool | 公开/私有,默认: 私有 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[CodeForksHistory] post_v5_gists(files, description, access_token=access_token, public=public)
创建代码片段
创建代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
files = {'key': 'files_example'} # dict(str, str) | Hash形式的代码片段文件名以及文件内容。如: { \"file1.txt\": { \"content\": \"String file contents\" } }
description = 'description_example' # str | 代码片段描述,1~30个字符
access_token = 'access_token_example' # str | 用户授权码 (optional)
public = true # bool | 公开/私有,默认: 私有 (optional)
try:
# 创建代码片段
api_response = api_instance.post_v5_gists(files, description, access_token=access_token, public=public)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->post_v5_gists: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
files | dict(str, str) | Hash形式的代码片段文件名以及文件内容。如: { "file1.txt": { "content": "String file contents" } } | |
description | str | 代码片段描述,1~30个字符 | |
access_token | str | 用户授权码 | [optional] |
public | bool | 公开/私有,默认: 私有 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CodeComment post_v5_gists_gist_id_comments(gist_id, body, access_token=access_token)
增加代码片段的评论
增加代码片段的评论
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
gist_id = 'gist_id_example' # str | 代码片段的ID
body = 'body_example' # str | 评论内容
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 增加代码片段的评论
api_response = api_instance.post_v5_gists_gist_id_comments(gist_id, body, access_token=access_token)
pprint(api_response)
except ApiException as e:
print("Exception when calling GistsApi->post_v5_gists_gist_id_comments: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gist_id | str | 代码片段的ID | |
body | str | 评论内容 | |
access_token | str | 用户授权码 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
post_v5_gists_id_forks(id, access_token=access_token)
Fork代码片段
Fork代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# Fork代码片段
api_instance.post_v5_gists_id_forks(id, access_token=access_token)
except ApiException as e:
print("Exception when calling GistsApi->post_v5_gists_id_forks: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
void (empty response body)
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
put_v5_gists_id_star(id, access_token=access_token)
Star代码片段
Star代码片段
from __future__ import print_function
import time
import gitee_client
from gitee_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = gitee_client.GistsApi()
id = 'id_example' # str | 代码片段的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# Star代码片段
api_instance.put_v5_gists_id_star(id, access_token=access_token)
except ApiException as e:
print("Exception when calling GistsApi->put_v5_gists_id_star: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | 代码片段的ID | |
access_token | str | 用户授权码 | [optional] |
void (empty response body)
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。