4 Star 20 Fork 12

还是相信爱过 / gitee-python-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
WebhooksApi.md 13.21 KB
一键复制 编辑 原始数据 按行查看 历史
还是相信爱过 提交于 2017-11-14 22:10 . init

gitee_client.WebhooksApi

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

delete_v5_repos_owner_repo_hooks_id(owner, repo, id, access_token=access_token)

删除一个项目WebHook

删除一个项目WebHook

Example

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)

Parameters

Name Type Description Notes
owner str 用户名(username/login)
repo str 项目路径(path)
id int Webhook的ID
access_token str 用户授权码 [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_v5_repos_owner_repo_hooks

list[Hook] get_v5_repos_owner_repo_hooks(owner, repo, access_token=access_token, page=page, per_page=per_page)

列出项目的WebHooks

列出项目的WebHooks

Example

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)

Parameters

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]

Return type

list[Hook]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_v5_repos_owner_repo_hooks_id

Hook get_v5_repos_owner_repo_hooks_id(owner, repo, id, access_token=access_token)

获取项目单个WebHook

获取项目单个WebHook

Example

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)

Parameters

Name Type Description Notes
owner str 用户名(username/login)
repo str 项目路径(path)
id int Webhook的ID
access_token str 用户授权码 [optional]

Return type

Hook

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_v5_repos_owner_repo_hooks_id

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

Example

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)

Parameters

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]

Return type

Hook

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

post_v5_repos_owner_repo_hooks

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

Example

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)

Parameters

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]

Return type

Hook

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

post_v5_repos_owner_repo_hooks_id_tests

post_v5_repos_owner_repo_hooks_id_tests(owner, repo, id, access_token=access_token)

测试WebHook是否发送成功

测试WebHook是否发送成功

Example

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)

Parameters

Name Type Description Notes
owner str 用户名(username/login)
repo str 项目路径(path)
id int Webhook的ID
access_token str 用户授权码 [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Python
1
https://gitee.com/wuyu15255872976/gitee-python-client.git
git@gitee.com:wuyu15255872976/gitee-python-client.git
wuyu15255872976
gitee-python-client
gitee-python-client
master

搜索帮助