提交 b5c14af2 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!19 add api of add/remove/get pr label and do some fix

Merge pull request !19 from zengchen1024/pr1
......@@ -145,6 +145,7 @@ Class | Method | HTTP request | Description
*OrganizationsApi* | [**PostV5UsersOrganization**](docs/OrganizationsApi.md#postv5usersorganization) | **Post** /v5/users/organization | 创建组织
*OrganizationsApi* | [**PutV5OrgsOrgMembershipsUsername**](docs/OrganizationsApi.md#putv5orgsorgmembershipsusername) | **Put** /v5/orgs/{org}/memberships/{username} | 增加或更新授权用户所管理组织的成员
*PullRequestsApi* | [**DeleteV5ReposOwnerRepoPullsCommentsId**](docs/PullRequestsApi.md#deletev5reposownerrepopullscommentsid) | **Delete** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 删除评论
*PullRequestsApi* | [**DeleteV5ReposOwnerRepoPullsLabel**](docs/PullRequestsApi.md#deletev5reposownerrepopullslabel) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/labels/{name} | 删除 Pull Request 标签
*PullRequestsApi* | [**DeleteV5ReposOwnerRepoPullsNumberAssignees**](docs/PullRequestsApi.md#deletev5reposownerrepopullsnumberassignees) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 取消用户审查 Pull Request
*PullRequestsApi* | [**DeleteV5ReposOwnerRepoPullsNumberTesters**](docs/PullRequestsApi.md#deletev5reposownerrepopullsnumbertesters) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 取消用户测试 Pull Request
*PullRequestsApi* | [**GetV5ReposOwnerRepoPulls**](docs/PullRequestsApi.md#getv5reposownerrepopulls) | **Get** /v5/repos/{owner}/{repo}/pulls | 获取Pull Request列表
......@@ -154,6 +155,7 @@ Class | Method | HTTP request | Description
*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberComments**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumbercomments) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 获取某个Pull Request的所有评论
*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberCommits**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumbercommits) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/commits | 获取某Pull Request的所有Commit信息。最多显示250条Commit
*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberFiles**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumberfiles) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/files | Pull Request Commit文件列表。最多显示300条diff
*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberLabels**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumberlabels) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/labels | 获取某个 Pull Request 的所有标签
*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberMerge**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumbermerge) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 判断Pull Request是否已经合并
*PullRequestsApi* | [**GetV5ReposOwnerRepoPullsNumberOperateLogs**](docs/PullRequestsApi.md#getv5reposownerrepopullsnumberoperatelogs) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/operate_logs | 获取某个Pull Request的操作日志
*PullRequestsApi* | [**PatchV5ReposOwnerRepoPullsCommentsId**](docs/PullRequestsApi.md#patchv5reposownerrepopullscommentsid) | **Patch** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 编辑评论
......@@ -161,6 +163,7 @@ Class | Method | HTTP request | Description
*PullRequestsApi* | [**PostV5ReposOwnerRepoPulls**](docs/PullRequestsApi.md#postv5reposownerrepopulls) | **Post** /v5/repos/{owner}/{repo}/pulls | 创建Pull Request
*PullRequestsApi* | [**PostV5ReposOwnerRepoPullsNumberAssignees**](docs/PullRequestsApi.md#postv5reposownerrepopullsnumberassignees) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 指派用户审查 Pull Request
*PullRequestsApi* | [**PostV5ReposOwnerRepoPullsNumberComments**](docs/PullRequestsApi.md#postv5reposownerrepopullsnumbercomments) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 提交Pull Request评论
*PullRequestsApi* | [**PostV5ReposOwnerRepoPullsNumberLabels**](docs/PullRequestsApi.md#postv5reposownerrepopullsnumberlabels) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/labels | 创建 Pull Request 标签
*PullRequestsApi* | [**PostV5ReposOwnerRepoPullsNumberTesters**](docs/PullRequestsApi.md#postv5reposownerrepopullsnumbertesters) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 指派用户测试 Pull Request
*PullRequestsApi* | [**PutV5ReposOwnerRepoPullsNumberMerge**](docs/PullRequestsApi.md#putv5reposownerrepopullsnumbermerge) | **Put** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 合并Pull Request
*RepositoriesApi* | [**DeleteV5ReposOwnerRepo**](docs/RepositoriesApi.md#deletev5reposownerrepo) | **Delete** /v5/repos/{owner}/{repo} | 删除一个仓库
......@@ -253,6 +256,7 @@ Class | Method | HTTP request | Description
- [BasicInfo](docs/BasicInfo.md)
- [Blob](docs/Blob.md)
- [Branch](docs/Branch.md)
- [BranchCommit](docs/BranchCommit.md)
- [BranchProtectionPutParam](docs/BranchProtectionPutParam.md)
- [Code](docs/Code.md)
- [CodeComment](docs/CodeComment.md)
......@@ -295,6 +299,7 @@ Class | Method | HTTP request | Description
- [PullRequestComments](docs/PullRequestComments.md)
- [PullRequestCommits](docs/PullRequestCommits.md)
- [PullRequestFiles](docs/PullRequestFiles.md)
- [PullRequestLabelPostParam](docs/PullRequestLabelPostParam.md)
- [PullRequestMergePutParam](docs/PullRequestMergePutParam.md)
- [PullRequestUpdateParam](docs/PullRequestUpdateParam.md)
- [Release](docs/Release.md)
......
......@@ -168,7 +168,7 @@ paths:
200:
description: "返回格式"
schema:
$ref: "#/definitions/CompleteBranch"
$ref: "#/definitions/Branch"
/v5/repos/{owner}/{repo}/branches/{branch}/protection:
put:
tags:
......@@ -3407,7 +3407,9 @@ paths:
200:
description: "返回格式"
schema:
$ref: "#/definitions/ProjectMember"
type: "array"
items:
$ref: "#/definitions/ProjectMember"
/v5/repos/{owner}/{repo}/collaborators/{username}:
get:
tags:
......@@ -4689,6 +4691,147 @@ paths:
description: "返回格式"
schema:
$ref: "#/definitions/PullRequestComments"
/v5/repos/{owner}/{repo}/pulls/{number}/labels:
parameters:
- name: "owner"
in: "path"
description: "仓库所属空间地址(企业、组织或个人的地址path)"
required: true
type: "string"
x-exportParamName: "Owner"
- name: "repo"
in: "path"
description: "仓库路径(path)"
required: true
type: "string"
x-exportParamName: "Repo"
- name: "number"
in: "path"
description: "第几个PR,即本仓库PR的序数"
required: true
type: "integer"
format: "int32"
x-exportParamName: "Number"
get:
tags:
- "Pull Requests"
summary: "获取某个 Pull Request 的所有标签"
description: "获取某个 Pull Request 的所有标签"
operationId: "getV5ReposOwnerRepoPullsNumberLabels"
consumes:
- "application/json"
- "multipart/form-data"
produces:
- "application/json"
parameters:
- name: "access_token"
in: "query"
description: "用户授权码"
required: false
type: "string"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
- name: "page"
in: "query"
description: "当前的页码"
required: false
type: "integer"
default: 1
format: "int32"
x-exportParamName: "Page"
x-optionalDataType: "Int32"
- name: "per_page"
in: "query"
description: "每页的数量,最大为 100"
required: false
type: "integer"
default: 20
format: "int32"
x-exportParamName: "PerPage"
x-optionalDataType: "Int32"
responses:
200:
description: "返回格式"
schema:
type: "array"
items:
$ref: "#/definitions/Label"
post:
tags:
- "Pull Requests"
summary: "创建 Pull Request 标签"
description: "创建 Pull Request 标签"
operationId: "postV5ReposOwnerRepoPullsNumberLabels"
consumes:
- "application/json"
- "multipart/form-data"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "必选,标签的内容"
required: true
schema:
$ref: "#/definitions/PullRequestLabelPostParam"
x-exportParamName: "Body"
responses:
201:
description: "返回格式"
schema:
$ref: "#/definitions/Label"
/v5/repos/{owner}/{repo}/pulls/{number}/labels/{name}:
parameters:
- name: "owner"
in: "path"
description: "仓库所属空间地址(企业、组织或个人的地址path)"
required: true
type: "string"
x-exportParamName: "Owner"
- name: "repo"
in: "path"
description: "仓库路径(path)"
required: true
type: "string"
x-exportParamName: "Repo"
- name: "number"
in: "path"
description: "第几个PR,即本仓库PR的序数"
required: true
type: "integer"
format: "int32"
x-exportParamName: "Number"
delete:
tags:
- "Pull Requests"
summary: "删除 Pull Request 标签"
description: "删除 Pull Request 标签"
operationId: "deleteV5ReposOwnerRepoPullsLabel"
consumes:
- "application/json"
- "multipart/form-data"
produces:
- "application/json"
parameters:
- name: "access_token"
in: "query"
description: "用户授权码"
required: false
type: "string"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
- name: "name"
in: "path"
description: "标签名称"
required: true
type: "string"
x-exportParamName: "Name"
responses:
204:
description: "删除Pull Request 标签"
/v5/repos/{owner}/{repo}/releases:
get:
tags:
......@@ -13149,9 +13292,9 @@ definitions:
name:
type: "string"
commit:
type: "string"
$ref: "#/definitions/BranchCommit"
protected:
type: "string"
type: "boolean"
protection_url:
type: "string"
description: "获取所有分支"
......@@ -13160,6 +13303,17 @@ definitions:
name: "name"
commit: "commit"
protection_url: "protection_url"
BranchCommit:
type: "object"
properties:
url:
type: "string"
sha:
type: "string"
description: "分支commit info"
example:
sha: "sha"
url: "url"
CompleteBranch:
type: "object"
properties:
......@@ -14360,7 +14514,7 @@ definitions:
url:
type: "string"
id:
type: "string"
type: "integer"
path:
type: "string"
position:
......@@ -15987,6 +16141,26 @@ definitions:
example:
access_token: "access_token"
permission: "push"
PullRequestLabelPostParam:
type: "object"
properties:
access_token:
type: "string"
description: "用户授权码"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
body:
description: "标签名数组,如: [\"feat\", \"bug\"]"
required: true
type: "array"
items:
type: "string"
collectionFormat: "multi"
x-exportParamName: "Body"
description: "create pull request label"
example:
access_token: "access_token"
body: ["feat"]
PullRequestCommentPostParam:
type: "object"
properties:
......
......@@ -4,8 +4,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional] [default to null]
**Commit** | **string** | | [optional] [default to null]
**Protected** | **string** | | [optional] [default to null]
**Commit** | [***BranchCommit**](BranchCommit.md) | | [optional] [default to null]
**Protected** | **bool** | | [optional] [default to null]
**ProtectionUrl** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
......
# BranchCommit
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Url** | **string** | | [optional] [default to null]
**Sha** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
......@@ -4,7 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Url** | **string** | | [optional] [default to null]
**Id** | **string** | | [optional] [default to null]
**Id** | **int32** | | [optional] [default to null]
**Path** | **string** | | [optional] [default to null]
**Position** | **string** | | [optional] [default to null]
**OriginalPosition** | **string** | | [optional] [default to null]
......
# PullRequestLabelPostParam
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessToken** | **string** | 用户授权码 | [optional] [default to null]
**Body** | **[]string** | 标签名数组,如: [\"feat\", \"bug\"] | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
......@@ -5,6 +5,7 @@ All URIs are relative to *https://gitee.com/api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**DeleteV5ReposOwnerRepoPullsCommentsId**](PullRequestsApi.md#DeleteV5ReposOwnerRepoPullsCommentsId) | **Delete** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 删除评论
[**DeleteV5ReposOwnerRepoPullsLabel**](PullRequestsApi.md#DeleteV5ReposOwnerRepoPullsLabel) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/labels/{name} | 删除 Pull Request 标签
[**DeleteV5ReposOwnerRepoPullsNumberAssignees**](PullRequestsApi.md#DeleteV5ReposOwnerRepoPullsNumberAssignees) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 取消用户审查 Pull Request
[**DeleteV5ReposOwnerRepoPullsNumberTesters**](PullRequestsApi.md#DeleteV5ReposOwnerRepoPullsNumberTesters) | **Delete** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 取消用户测试 Pull Request
[**GetV5ReposOwnerRepoPulls**](PullRequestsApi.md#GetV5ReposOwnerRepoPulls) | **Get** /v5/repos/{owner}/{repo}/pulls | 获取Pull Request列表
......@@ -14,6 +15,7 @@ Method | HTTP request | Description
[**GetV5ReposOwnerRepoPullsNumberComments**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberComments) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 获取某个Pull Request的所有评论
[**GetV5ReposOwnerRepoPullsNumberCommits**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberCommits) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/commits | 获取某Pull Request的所有Commit信息。最多显示250条Commit
[**GetV5ReposOwnerRepoPullsNumberFiles**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberFiles) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/files | Pull Request Commit文件列表。最多显示300条diff
[**GetV5ReposOwnerRepoPullsNumberLabels**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberLabels) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/labels | 获取某个 Pull Request 的所有标签
[**GetV5ReposOwnerRepoPullsNumberMerge**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberMerge) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 判断Pull Request是否已经合并
[**GetV5ReposOwnerRepoPullsNumberOperateLogs**](PullRequestsApi.md#GetV5ReposOwnerRepoPullsNumberOperateLogs) | **Get** /v5/repos/{owner}/{repo}/pulls/{number}/operate_logs | 获取某个Pull Request的操作日志
[**PatchV5ReposOwnerRepoPullsCommentsId**](PullRequestsApi.md#PatchV5ReposOwnerRepoPullsCommentsId) | **Patch** /v5/repos/{owner}/{repo}/pulls/comments/{id} | 编辑评论
......@@ -21,6 +23,7 @@ Method | HTTP request | Description
[**PostV5ReposOwnerRepoPulls**](PullRequestsApi.md#PostV5ReposOwnerRepoPulls) | **Post** /v5/repos/{owner}/{repo}/pulls | 创建Pull Request
[**PostV5ReposOwnerRepoPullsNumberAssignees**](PullRequestsApi.md#PostV5ReposOwnerRepoPullsNumberAssignees) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/assignees | 指派用户审查 Pull Request
[**PostV5ReposOwnerRepoPullsNumberComments**](PullRequestsApi.md#PostV5ReposOwnerRepoPullsNumberComments) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/comments | 提交Pull Request评论
[**PostV5ReposOwnerRepoPullsNumberLabels**](PullRequestsApi.md#PostV5ReposOwnerRepoPullsNumberLabels) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/labels | 创建 Pull Request 标签
[**PostV5ReposOwnerRepoPullsNumberTesters**](PullRequestsApi.md#PostV5ReposOwnerRepoPullsNumberTesters) | **Post** /v5/repos/{owner}/{repo}/pulls/{number}/testers | 指派用户测试 Pull Request
[**PutV5ReposOwnerRepoPullsNumberMerge**](PullRequestsApi.md#PutV5ReposOwnerRepoPullsNumberMerge) | **Put** /v5/repos/{owner}/{repo}/pulls/{number}/merge | 合并Pull Request
......@@ -49,6 +52,49 @@ Name | Type | Description | Notes
**accessToken** | **optional.String**| 用户授权码 |
### Return type
(empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json, multipart/form-data
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **DeleteV5ReposOwnerRepoPullsLabel**
> DeleteV5ReposOwnerRepoPullsLabel(ctx, owner, repo, number, name, optional)
删除 Pull Request 标签
删除 Pull Request 标签
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**repo** | **string**| 仓库路径(path) |
**number** | **int32**| 第几个PR,即本仓库PR的序数 |
**name** | **string**| 标签名称 |
**optional** | ***DeleteV5ReposOwnerRepoPullsLabelOpts** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a pointer to a DeleteV5ReposOwnerRepoPullsLabelOpts struct
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessToken** | **optional.String**| 用户授权码 |
### Return type
......@@ -451,6 +497,49 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **GetV5ReposOwnerRepoPullsNumberLabels**
> []Label GetV5ReposOwnerRepoPullsNumberLabels(ctx, owner, repo, number, optional)
获取某个 Pull Request 的所有标签
获取某个 Pull Request 的所有标签
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**repo** | **string**| 仓库路径(path) |
**number** | **int32**| 第几个PR,即本仓库PR的序数 |
**optional** | ***GetV5ReposOwnerRepoPullsNumberLabelsOpts** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a pointer to a GetV5ReposOwnerRepoPullsNumberLabelsOpts struct
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessToken** | **optional.String**| 用户授权码 |
**page** | **optional.Int32**| 当前的页码 | [default to 1]
**perPage** | **optional.Int32**| 每页的数量,最大为 100 | [default to 20]
### Return type
[**[]Label**](Label.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json, multipart/form-data
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **GetV5ReposOwnerRepoPullsNumberMerge**
> GetV5ReposOwnerRepoPullsNumberMerge(ctx, owner, repo, number, optional)
判断Pull Request是否已经合并
......@@ -712,6 +801,37 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **PostV5ReposOwnerRepoPullsNumberLabels**
> Label PostV5ReposOwnerRepoPullsNumberLabels(ctx, owner, repo, number, body)
创建 Pull Request 标签
创建 Pull Request 标签
### Required Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**repo** | **string**| 仓库路径(path) |
**number** | **int32**| 第几个PR,即本仓库PR的序数 |
**body** | [**PullRequestLabelPostParam**](PullRequestLabelPostParam.md)| 必选,标签的内容 |
### Return type
[**Label**](Label.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json, multipart/form-data
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **PostV5ReposOwnerRepoPullsNumberTesters**
> PullRequest PostV5ReposOwnerRepoPullsNumberTesters(ctx, owner, repo, number, testers, optional)
指派用户测试 Pull Request
......
......@@ -556,7 +556,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **GetV5ReposOwnerRepoBranchesBranch**
> CompleteBranch GetV5ReposOwnerRepoBranchesBranch(ctx, owner, repo, branch, optional)
> Branch GetV5ReposOwnerRepoBranchesBranch(ctx, owner, repo, branch, optional)
获取单个分支
获取单个分支
......@@ -583,7 +583,7 @@ Name | Type | Description | Notes
### Return type
[**CompleteBranch**](CompleteBranch.md)
[**Branch**](Branch.md)
### Authorization
......@@ -597,7 +597,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **GetV5ReposOwnerRepoCollaborators**
> ProjectMember GetV5ReposOwnerRepoCollaborators(ctx, owner, repo, optional)
> []ProjectMember GetV5ReposOwnerRepoCollaborators(ctx, owner, repo, optional)
获取仓库的所有成员
获取仓库的所有成员
......@@ -622,7 +622,7 @@ Name | Type | Description | Notes
### Return type
[**ProjectMember**](ProjectMember.md)
[**[]ProjectMember**](ProjectMember.md)
### Authorization
......
......@@ -109,6 +109,91 @@ func (a *PullRequestsApiService) DeleteV5ReposOwnerRepoPullsCommentsId(ctx conte
return localVarHttpResponse, nil
}
/*
PullRequestsApiService 删除 Pull Request 标签
删除 Pull Request 标签
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param owner 仓库所属空间地址(企业、组织或个人的地址path)
* @param repo 仓库路径(path)
* @param number 第几个PR,即本仓库PR的序数
* @param name 标签名称
* @param optional nil or *DeleteV5ReposOwnerRepoPullsLabelOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
*/
type DeleteV5ReposOwnerRepoPullsLabelOpts struct {
AccessToken optional.String
}
func (a *PullRequestsApiService) DeleteV5ReposOwnerRepoPullsLabel(ctx context.Context, owner string, repo string, number int32, name string, localVarOptionals *DeleteV5ReposOwnerRepoPullsLabelOpts) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/labels/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1)
localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1)
localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1)
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() {
localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "multipart/form-data"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
return localVarHttpResponse, newErr
}
return localVarHttpResponse, nil
}
/*
PullRequestsApiService 取消用户审查 Pull Request
取消用户审查 Pull Request
......@@ -1116,6 +1201,119 @@ func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumberFiles(ctx context
return localVarReturnValue, localVarHttpResponse, nil
}
/*
PullRequestsApiService 获取某个 Pull Request 的所有标签
获取某个 Pull Request 的所有标签
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param owner 仓库所属空间地址(企业、组织或个人的地址path)
* @param repo 仓库路径(path)
* @param number 第几个PR,即本仓库PR的序数
* @param optional nil or *GetV5ReposOwnerRepoPullsNumberLabelsOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
* @param "Page" (optional.Int32) - 当前的页码
* @param "PerPage" (optional.Int32) - 每页的数量,最大为 100
@return []Label
*/
type GetV5ReposOwnerRepoPullsNumberLabelsOpts struct {
AccessToken optional.String
Page optional.Int32
PerPage optional.Int32
}
func (a *PullRequestsApiService) GetV5ReposOwnerRepoPullsNumberLabels(ctx context.Context, owner string, repo string, number int32, localVarOptionals *GetV5ReposOwnerRepoPullsNumberLabelsOpts) ([]Label, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Label
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/labels"
localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1)
localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1)
localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() {
localVarQueryParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.PerPage.IsSet() {
localVarQueryParams.Add("per_page", parameterToString(localVarOptionals.PerPage.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "multipart/form-data"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v []Label
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
PullRequestsApiService 判断Pull Request是否已经合并
判断Pull Request是否已经合并
......@@ -1803,6 +2001,102 @@ func (a *PullRequestsApiService) PostV5ReposOwnerRepoPullsNumberComments(ctx con
return localVarReturnValue, localVarHttpResponse, nil
}
/*
PullRequestsApiService 创建 Pull Request 标签
创建 Pull Request 标签
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param owner 仓库所属空间地址(企业、组织或个人的地址path)
* @param repo 仓库路径(path)
* @param number 第几个PR,即本仓库PR的序数
* @param body 必选,标签的内容
@return Label
*/
func (a *PullRequestsApiService) PostV5ReposOwnerRepoPullsNumberLabels(ctx context.Context, owner string, repo string, number int32, body PullRequestLabelPostParam) (Label, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue Label
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v5/repos/{owner}/{repo}/pulls/{number}/labels"
localVarPath = strings.Replace(localVarPath, "{"+"owner"+"}", fmt.Sprintf("%v", owner), -1)
localVarPath = strings.Replace(localVarPath, "{"+"repo"+"}", fmt.Sprintf("%v", repo), -1)
localVarPath = strings.Replace(localVarPath, "{"+"number"+"}", fmt.Sprintf("%v", number), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "multipart/form-data"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body.Body // This shoud be &body because the gitee api is not normalized.
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 201 {
var v Label
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
PullRequestsApiService 指派用户测试 Pull Request
指派用户测试 Pull Request
......
......@@ -1182,20 +1182,20 @@ RepositoriesApiService 获取单个分支
* @param optional nil or *GetV5ReposOwnerRepoBranchesBranchOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
@return CompleteBranch
@return Branch
*/
type GetV5ReposOwnerRepoBranchesBranchOpts struct {
AccessToken optional.String
}
func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranchesBranch(ctx context.Context, owner string, repo string, branch string, localVarOptionals *GetV5ReposOwnerRepoBranchesBranchOpts) (CompleteBranch, *http.Response, error) {
func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranchesBranch(ctx context.Context, owner string, repo string, branch string, localVarOptionals *GetV5ReposOwnerRepoBranchesBranchOpts) (Branch, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CompleteBranch
localVarReturnValue Branch
)
// create path and map variables
......@@ -1259,7 +1259,7 @@ func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranchesBranch(ctx context.C
}
if localVarHttpResponse.StatusCode == 200 {
var v CompleteBranch
var v Branch
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
......@@ -1284,20 +1284,20 @@ RepositoriesApiService 获取仓库的所有成员
* @param optional nil or *GetV5ReposOwnerRepoCollaboratorsOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
@return ProjectMember
@return []ProjectMember
*/
type GetV5ReposOwnerRepoCollaboratorsOpts struct {
AccessToken optional.String
}
func (a *RepositoriesApiService) GetV5ReposOwnerRepoCollaborators(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoCollaboratorsOpts) (ProjectMember, *http.Response, error) {
func (a *RepositoriesApiService) GetV5ReposOwnerRepoCollaborators(ctx context.Context, owner string, repo string, localVarOptionals *GetV5ReposOwnerRepoCollaboratorsOpts) ([]ProjectMember, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue ProjectMember
localVarReturnValue []ProjectMember
)
// create path and map variables
......@@ -1360,7 +1360,7 @@ func (a *RepositoriesApiService) GetV5ReposOwnerRepoCollaborators(ctx context.Co
}
if localVarHttpResponse.StatusCode == 200 {
var v ProjectMember
var v []ProjectMember
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
......
......@@ -11,8 +11,8 @@ package gitee
// 获取所有分支
type Branch struct {
Name string `json:"name,omitempty"`
Commit string `json:"commit,omitempty"`
Protected string `json:"protected,omitempty"`
ProtectionUrl string `json:"protection_url,omitempty"`
Name string `json:"name,omitempty"`
Commit *BranchCommit `json:"commit,omitempty"`
Protected bool `json:"protected,omitempty"`
ProtectionUrl string `json:"protection_url,omitempty"`
}
/*
* 码云 Open API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 5.3.2
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package gitee
// 分支commit info
type BranchCommit struct {
Url string `json:"url,omitempty"`
Sha string `json:"sha,omitempty"`
}
......@@ -12,7 +12,7 @@ package gitee
// 编辑评论
type PullRequestComments struct {
Url string `json:"url,omitempty"`
Id string `json:"id,omitempty"`
Id int32 `json:"id,omitempty"`
Path string `json:"path,omitempty"`
Position string `json:"position,omitempty"`
OriginalPosition string `json:"original_position,omitempty"`
......
/*
* 码云 Open API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 5.3.2
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package gitee
// create pull request label
type PullRequestLabelPostParam struct {
// 用户授权码
AccessToken string `json:"access_token,omitempty"`
// 标签名数组,如: [\"feat\", \"bug\"]
Body []string `json:"body,omitempty"`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册