提交 6f21a03b 编写于 作者: E edisonxiang

add project member api

上级 07bc5b7a
......@@ -283,6 +283,7 @@ Class | Method | HTTP request | Description
- [ProjectBasic](docs/ProjectBasic.md)
- [ProjectMember](docs/ProjectMember.md)
- [ProjectMemberPermission](docs/ProjectMemberPermission.md)
- [ProjectMemberPutParam](docs/ProjectMemberPutParam.md)
- [PullRequest](docs/PullRequest.md)
- [PullRequestComments](docs/PullRequestComments.md)
- [PullRequestCommits](docs/PullRequestCommits.md)
......
......@@ -3532,13 +3532,6 @@ paths:
produces:
- "application/json"
parameters:
- name: "access_token"
in: "formData"
description: "用户授权码"
required: false
type: "string"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
- name: "owner"
in: "path"
description: "仓库所属空间地址(企业、组织或个人的地址path)"
......@@ -3557,17 +3550,13 @@ paths:
required: true
type: "string"
x-exportParamName: "Username"
- name: "permission"
in: "formData"
description: "成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push"
- in: "body"
name: "body"
description: "仓库成员内容"
required: true
type: "string"
default: "push"
enum:
- "pull"
- "push"
- "admin"
x-exportParamName: "Permission"
schema:
$ref: "#/definitions/ProjectMemberPutParam"
x-exportParamName: "Body"
responses:
200:
description: "返回格式"
......@@ -15982,3 +15971,24 @@ definitions:
description: "description"
has_issues: true
homepage: "homepage"
ProjectMemberPutParam:
type: "object"
properties:
access_token:
type: "string"
description: "用户授权码"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
permission:
type: "string"
description: "成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push"
enum:
- "pull"
- "push"
- "admin"
default: "push"
x-exportParamName: "Permission"
description: "create project member"
example:
access_token: "access_token"
permission: "push"
# ProjectMemberPutParam
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessToken** | **string** | 用户授权码 | [optional] [default to null]
**Permission** | **string** | 成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push | [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)
......@@ -2233,7 +2233,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)
# **PutV5ReposOwnerRepoCollaboratorsUsername**
> ProjectMember PutV5ReposOwnerRepoCollaboratorsUsername(ctx, owner, repo, username, permission, optional)
> ProjectMember PutV5ReposOwnerRepoCollaboratorsUsername(ctx, owner, repo, username, body)
添加仓库成员
添加仓库成员
......@@ -2246,19 +2246,7 @@ Name | Type | Description | Notes
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**repo** | **string**| 仓库路径(path) |
**username** | **string**| 用户名(username/login) |
**permission** | **string**| 成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push | [default to push]
**optional** | ***PutV5ReposOwnerRepoCollaboratorsUsernameOpts** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoCollaboratorsUsernameOpts struct
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessToken** | **optional.String**| 用户授权码 |
**body** | [**ProjectMemberPutParam**](ProjectMemberPutParam.md)| 仓库成员内容 |
### Return type
......
......@@ -5533,18 +5533,11 @@ RepositoriesApiService 添加仓库成员
* @param owner 仓库所属空间地址(企业、组织或个人的地址path)
* @param repo 仓库路径(path)
* @param username 用户名(username/login)
* @param permission 成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push
* @param optional nil or *PutV5ReposOwnerRepoCollaboratorsUsernameOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
* @param body 仓库成员内容
@return ProjectMember
*/
type PutV5ReposOwnerRepoCollaboratorsUsernameOpts struct {
AccessToken optional.String
}
func (a *RepositoriesApiService) PutV5ReposOwnerRepoCollaboratorsUsername(ctx context.Context, owner string, repo string, username string, permission string, localVarOptionals *PutV5ReposOwnerRepoCollaboratorsUsernameOpts) (ProjectMember, *http.Response, error) {
func (a *RepositoriesApiService) PutV5ReposOwnerRepoCollaboratorsUsername(ctx context.Context, owner string, repo string, username string, body ProjectMemberPutParam) (ProjectMember, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
......@@ -5580,10 +5573,8 @@ func (a *RepositoriesApiService) PutV5ReposOwnerRepoCollaboratorsUsername(ctx co
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() {
localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), ""))
}
localVarFormParams.Add("permission", parameterToString(permission, ""))
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
......
/*
* 码云 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 project member
type ProjectMemberPutParam struct {
// 用户授权码
AccessToken string `json:"access_token,omitempty"`
// 成员权限: 拉代码(pull),推代码(push),管理员(admin)。默认: push
Permission string `json:"permission,omitempty"`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册