All URIs are relative to https://gitee.com/api
Method | HTTP request | Description |
---|---|---|
delete_v5_repos_owner_repo_hooks_id | DELETE /v5/repos/{owner}/{repo}/hooks/{id} | 删除一个项目WebHook |
get_v5_repos_owner_repo_hooks | GET /v5/repos/{owner}/{repo}/hooks | 列出项目的WebHooks |
get_v5_repos_owner_repo_hooks_id | GET /v5/repos/{owner}/{repo}/hooks/{id} | 获取项目单个WebHook |
patch_v5_repos_owner_repo_hooks_id | PATCH /v5/repos/{owner}/{repo}/hooks/{id} | 更新一个项目WebHook |
post_v5_repos_owner_repo_hooks | POST /v5/repos/{owner}/{repo}/hooks | 创建一个项目WebHook |
post_v5_repos_owner_repo_hooks_id_tests | POST /v5/repos/{owner}/{repo}/hooks/{id}/tests | 测试WebHook是否发送成功 |
delete_v5_repos_owner_repo_hooks_id(owner, repo, id, access_token=access_token)
删除一个项目WebHook
删除一个项目WebHook
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.WebhooksApi()
owner = 'owner_example' # str | 用户名(username/login)
repo = 'repo_example' # str | 项目路径(path)
id = 56 # int | Webhook的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 删除一个项目WebHook
api_instance.delete_v5_repos_owner_repo_hooks_id(owner, repo, id, access_token=access_token)
except ApiException as e:
print("Exception when calling WebhooksApi->delete_v5_repos_owner_repo_hooks_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
owner | str | 用户名(username/login) | |
repo | str | 项目路径(path) | |
id | int | Webhook的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[Hook] get_v5_repos_owner_repo_hooks(owner, repo, access_token=access_token, page=page, per_page=per_page)
列出项目的WebHooks
列出项目的WebHooks
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.WebhooksApi()
owner = 'owner_example' # str | 用户名(username/login)
repo = 'repo_example' # str | 项目路径(path)
access_token = 'access_token_example' # str | 用户授权码 (optional)
page = 1 # int | 当前的页码 (optional) (default to 1)
per_page = 20 # int | 每页的数量 (optional) (default to 20)
try:
# 列出项目的WebHooks
api_response = api_instance.get_v5_repos_owner_repo_hooks(owner, repo, access_token=access_token, page=page, per_page=per_page)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->get_v5_repos_owner_repo_hooks: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
owner | str | 用户名(username/login) | |
repo | str | 项目路径(path) | |
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]
Hook get_v5_repos_owner_repo_hooks_id(owner, repo, id, access_token=access_token)
获取项目单个WebHook
获取项目单个WebHook
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.WebhooksApi()
owner = 'owner_example' # str | 用户名(username/login)
repo = 'repo_example' # str | 项目路径(path)
id = 56 # int | Webhook的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 获取项目单个WebHook
api_response = api_instance.get_v5_repos_owner_repo_hooks_id(owner, repo, id, access_token=access_token)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->get_v5_repos_owner_repo_hooks_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
owner | str | 用户名(username/login) | |
repo | str | 项目路径(path) | |
id | int | Webhook的ID | |
access_token | str | 用户授权码 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Hook patch_v5_repos_owner_repo_hooks_id(owner, repo, id, url, access_token=access_token, password=password, push_events=push_events, tag_push_events=tag_push_events, issues_events=issues_events, note_events=note_events, merge_requests_events=merge_requests_events)
更新一个项目WebHook
更新一个项目WebHook
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.WebhooksApi()
owner = 'owner_example' # str | 用户名(username/login)
repo = 'repo_example' # str | 项目路径(path)
id = 56 # int | Webhook的ID
url = 'url_example' # str | 远程HTTP URL
access_token = 'access_token_example' # str | 用户授权码 (optional)
password = 'password_example' # str | 请求URL时会带上该密码,防止URL被恶意请求 (optional)
push_events = true # bool | Push代码到仓库 (optional) (default to true)
tag_push_events = true # bool | 提交Tag到仓库 (optional)
issues_events = true # bool | 创建/关闭Issue (optional)
note_events = true # bool | 评论了Issue/代码等等 (optional)
merge_requests_events = true # bool | 合并请求和合并后 (optional)
try:
# 更新一个项目WebHook
api_response = api_instance.patch_v5_repos_owner_repo_hooks_id(owner, repo, id, url, access_token=access_token, password=password, push_events=push_events, tag_push_events=tag_push_events, issues_events=issues_events, note_events=note_events, merge_requests_events=merge_requests_events)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->patch_v5_repos_owner_repo_hooks_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
owner | str | 用户名(username/login) | |
repo | str | 项目路径(path) | |
id | int | Webhook的ID | |
url | str | 远程HTTP URL | |
access_token | str | 用户授权码 | [optional] |
password | str | 请求URL时会带上该密码,防止URL被恶意请求 | [optional] |
push_events | bool | Push代码到仓库 | [optional] [default to true] |
tag_push_events | bool | 提交Tag到仓库 | [optional] |
issues_events | bool | 创建/关闭Issue | [optional] |
note_events | bool | 评论了Issue/代码等等 | [optional] |
merge_requests_events | bool | 合并请求和合并后 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Hook post_v5_repos_owner_repo_hooks(owner, repo, url, access_token=access_token, password=password, push_events=push_events, tag_push_events=tag_push_events, issues_events=issues_events, note_events=note_events, merge_requests_events=merge_requests_events)
创建一个项目WebHook
创建一个项目WebHook
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.WebhooksApi()
owner = 'owner_example' # str | 用户名(username/login)
repo = 'repo_example' # str | 项目路径(path)
url = 'url_example' # str | 远程HTTP URL
access_token = 'access_token_example' # str | 用户授权码 (optional)
password = 'password_example' # str | 请求URL时会带上该密码,防止URL被恶意请求 (optional)
push_events = true # bool | Push代码到仓库 (optional) (default to true)
tag_push_events = true # bool | 提交Tag到仓库 (optional)
issues_events = true # bool | 创建/关闭Issue (optional)
note_events = true # bool | 评论了Issue/代码等等 (optional)
merge_requests_events = true # bool | 合并请求和合并后 (optional)
try:
# 创建一个项目WebHook
api_response = api_instance.post_v5_repos_owner_repo_hooks(owner, repo, url, access_token=access_token, password=password, push_events=push_events, tag_push_events=tag_push_events, issues_events=issues_events, note_events=note_events, merge_requests_events=merge_requests_events)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->post_v5_repos_owner_repo_hooks: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
owner | str | 用户名(username/login) | |
repo | str | 项目路径(path) | |
url | str | 远程HTTP URL | |
access_token | str | 用户授权码 | [optional] |
password | str | 请求URL时会带上该密码,防止URL被恶意请求 | [optional] |
push_events | bool | Push代码到仓库 | [optional] [default to true] |
tag_push_events | bool | 提交Tag到仓库 | [optional] |
issues_events | bool | 创建/关闭Issue | [optional] |
note_events | bool | 评论了Issue/代码等等 | [optional] |
merge_requests_events | bool | 合并请求和合并后 | [optional] |
No authorization required
[Back to top] [Back to API list] [Back to Model list] [Back to README]
post_v5_repos_owner_repo_hooks_id_tests(owner, repo, id, access_token=access_token)
测试WebHook是否发送成功
测试WebHook是否发送成功
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.WebhooksApi()
owner = 'owner_example' # str | 用户名(username/login)
repo = 'repo_example' # str | 项目路径(path)
id = 56 # int | Webhook的ID
access_token = 'access_token_example' # str | 用户授权码 (optional)
try:
# 测试WebHook是否发送成功
api_instance.post_v5_repos_owner_repo_hooks_id_tests(owner, repo, id, access_token=access_token)
except ApiException as e:
print("Exception when calling WebhooksApi->post_v5_repos_owner_repo_hooks_id_tests: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
owner | str | 用户名(username/login) | |
repo | str | 项目路径(path) | |
id | int | Webhook的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]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。