From 507349d624fe236cd961f55d05985d8ffd3b7bf6 Mon Sep 17 00:00:00 2001 From: zengchen1024 Date: Wed, 6 May 2020 11:41:08 +0800 Subject: [PATCH] update the param of update pr comment --- README.md | 1 + api/swagger.yaml | 29 +++++++++++++------ docs/PullRequestCommentPatchParam.md | 11 +++++++ docs/PullRequestsApi.md | 16 ++-------- gitee/api_pull_requests.go | 15 ++-------- .../model_pull_request_comment_patch_param.go | 18 ++++++++++++ 6 files changed, 55 insertions(+), 35 deletions(-) create mode 100644 docs/PullRequestCommentPatchParam.md create mode 100644 gitee/model_pull_request_comment_patch_param.go diff --git a/README.md b/README.md index b0a646a..429f70f 100644 --- a/README.md +++ b/README.md @@ -298,6 +298,7 @@ Class | Method | HTTP request | Description - [ProjectMemberPutParam](docs/ProjectMemberPutParam.md) - [PullRequest](docs/PullRequest.md) - [PullRequestAssigneePostParam](docs/PullRequestAssigneePostParam.md) + - [PullRequestCommentPatchParam](docs/PullRequestCommentPatchParam.md) - [PullRequestCommentPostParam](docs/PullRequestCommentPostParam.md) - [PullRequestComments](docs/PullRequestComments.md) - [PullRequestCommits](docs/PullRequestCommits.md) diff --git a/api/swagger.yaml b/api/swagger.yaml index 4f219ea..529d824 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -4601,13 +4601,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)" @@ -4628,10 +4621,11 @@ paths: format: "int32" x-exportParamName: "Id" - name: "body" - in: "formData" + in: "body" description: "必填。评论内容" required: true - type: "string" + schema: + $ref: "#/definitions/PullRequestCommentPatchParam" x-exportParamName: "Body" responses: 200: @@ -16169,6 +16163,23 @@ definitions: example: access_token: "access_token" body: ["feat"] + PullRequestCommentPatchParam: + type: "object" + properties: + access_token: + type: "string" + description: "用户授权码" + x-exportParamName: "AccessToken" + x-optionalDataType: "String" + body: + type: "string" + description: "必填。评论内容" + x-exportParamName: "Body" + required: true + description: "edit pull request comment" + example: + access_token: "access_token" + body: "body" PullRequestCommentPostParam: type: "object" properties: diff --git a/docs/PullRequestCommentPatchParam.md b/docs/PullRequestCommentPatchParam.md new file mode 100644 index 0000000..f84440c --- /dev/null +++ b/docs/PullRequestCommentPatchParam.md @@ -0,0 +1,11 @@ +# PullRequestCommentPatchParam + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessToken** | **string** | 用户授权码 | [optional] [default to null] +**Body** | **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) + + diff --git a/docs/PullRequestsApi.md b/docs/PullRequestsApi.md index d7b8b35..4c85ea9 100644 --- a/docs/PullRequestsApi.md +++ b/docs/PullRequestsApi.md @@ -624,7 +624,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) # **PatchV5ReposOwnerRepoPullsCommentsId** -> PullRequestComments PatchV5ReposOwnerRepoPullsCommentsId(ctx, owner, repo, id, body, optional) +> PullRequestComments PatchV5ReposOwnerRepoPullsCommentsId(ctx, owner, repo, id, body) 编辑评论 编辑评论 @@ -637,19 +637,7 @@ Name | Type | Description | Notes **owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) | **repo** | **string**| 仓库路径(path) | **id** | **int32**| 评论的ID | - **body** | **string**| 必填。评论内容 | - **optional** | ***PatchV5ReposOwnerRepoPullsCommentsIdOpts** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a pointer to a PatchV5ReposOwnerRepoPullsCommentsIdOpts struct - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - - **accessToken** | **optional.String**| 用户授权码 | + **body** | [**PullRequestCommentPatchParam**](PullRequestCommentPatchParam.md)| 必填。评论内容 | ### Return type diff --git a/gitee/api_pull_requests.go b/gitee/api_pull_requests.go index 01845a8..30fedb8 100644 --- a/gitee/api_pull_requests.go +++ b/gitee/api_pull_requests.go @@ -1513,17 +1513,10 @@ PullRequestsApiService 编辑评论 * @param repo 仓库路径(path) * @param id 评论的ID * @param body 必填。评论内容 - * @param optional nil or *PatchV5ReposOwnerRepoPullsCommentsIdOpts - Optional Parameters: - * @param "AccessToken" (optional.String) - 用户授权码 @return PullRequestComments */ - -type PatchV5ReposOwnerRepoPullsCommentsIdOpts struct { - AccessToken optional.String -} - -func (a *PullRequestsApiService) PatchV5ReposOwnerRepoPullsCommentsId(ctx context.Context, owner string, repo string, id int32, body string, localVarOptionals *PatchV5ReposOwnerRepoPullsCommentsIdOpts) (PullRequestComments, *http.Response, error) { +func (a *PullRequestsApiService) PatchV5ReposOwnerRepoPullsCommentsId(ctx context.Context, owner string, repo string, id int32, body PullRequestCommentPatchParam) (PullRequestComments, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") localVarPostBody interface{} @@ -1559,10 +1552,8 @@ func (a *PullRequestsApiService) PatchV5ReposOwnerRepoPullsCommentsId(ctx contex if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() { - localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), "")) - } - localVarFormParams.Add("body", parameterToString(body, "")) + // 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_pull_request_comment_patch_param.go b/gitee/model_pull_request_comment_patch_param.go new file mode 100644 index 0000000..2695cb3 --- /dev/null +++ b/gitee/model_pull_request_comment_patch_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 + +// edit pull request comment +type PullRequestCommentPatchParam struct { + // 用户授权码 + AccessToken string `json:"access_token,omitempty"` + // 必填。评论内容 + Body string `json:"body,omitempty"` +} -- GitLab