diff --git a/README.md b/README.md index 1aa0a0b163a895840bc4709a0bc4142caa0273a8..73e1cf0fdb0d3ed9c52bd8d8e7ca5702d6e4ad31 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/api/swagger.yaml b/api/swagger.yaml index 8a14ffe5bad32d51ecae9b2cb8b6a4f788a2330a..037fd05bf90b1b2b94fe32fec44268c770fb3664 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -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" diff --git a/docs/ProjectMemberPutParam.md b/docs/ProjectMemberPutParam.md new file mode 100644 index 0000000000000000000000000000000000000000..2b2a134f598b951e4888290d27e3710926538a0a --- /dev/null +++ b/docs/ProjectMemberPutParam.md @@ -0,0 +1,11 @@ +# 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) + + diff --git a/docs/RepositoriesApi.md b/docs/RepositoriesApi.md index f648e8079db22b2429436a8ce4ba88e636ed7940..def8652ec69e477723fdf0a71084957950f76d34 100644 --- a/docs/RepositoriesApi.md +++ b/docs/RepositoriesApi.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 diff --git a/gitee/api_repositories.go b/gitee/api_repositories.go index 77473c2fc7ba26c1713df4aea08ab3fc77e0fff8..31c53cd793db733788d18615bd84271e6e0bb55f 100644 --- a/gitee/api_repositories.go +++ b/gitee/api_repositories.go @@ -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 diff --git a/gitee/model_project_member_put_param.go b/gitee/model_project_member_put_param.go new file mode 100644 index 0000000000000000000000000000000000000000..e31780e38bb20f41e8ed2be6fa964c0bcae4e0c1 --- /dev/null +++ b/gitee/model_project_member_put_param.go @@ -0,0 +1,18 @@ +/* + * 码云 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"` +}