提交 f7eb5cf3 编写于 作者: E edisonxiang

modify the issue patch

上级 7dc6d865
......@@ -271,6 +271,7 @@ Class | Method | HTTP request | Description
- [GroupMember](docs/GroupMember.md)
- [Hook](docs/Hook.md)
- [Issue](docs/Issue.md)
- [IssueUpdateParam](docs/IssueUpdateParam.md)
- [Label](docs/Label.md)
- [Milestone](docs/Milestone.md)
- [Namespace](docs/Namespace.md)
......
......@@ -1549,86 +1549,25 @@ 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)"
required: true
type: "string"
x-exportParamName: "Owner"
- name: "repo"
in: "formData"
description: "仓库路径(path)"
required: false
type: "string"
x-exportParamName: "Repo"
x-optionalDataType: "String"
- name: "title"
in: "formData"
description: "Issue标题"
required: false
type: "string"
x-exportParamName: "Title"
x-optionalDataType: "String"
- name: "number"
in: "path"
description: "Issue 编号(区分大小写,无需添加 # 号)"
required: true
type: "string"
x-exportParamName: "Number"
- name: "state"
in: "formData"
description: "Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的)"
required: false
type: "string"
enum:
- "open"
- "progressing"
- "closed"
x-exportParamName: "State"
x-optionalDataType: "String"
- name: "body"
in: "formData"
description: "Issue描述"
required: false
type: "string"
- in: "body"
name: "body"
description: "可选。Issue 内容"
required: true
schema:
$ref: "#/definitions/IssueUpdateParam"
x-exportParamName: "Body"
x-optionalDataType: "String"
- name: "assignee"
in: "formData"
description: "Issue负责人的username"
required: false
type: "string"
x-exportParamName: "Assignee"
x-optionalDataType: "String"
- name: "milestone"
in: "formData"
description: "里程碑序号"
required: false
type: "integer"
format: "int32"
x-exportParamName: "Milestone"
x-optionalDataType: "Int32"
- name: "labels"
in: "formData"
description: "用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance"
required: false
type: "string"
x-exportParamName: "Labels"
x-optionalDataType: "String"
- name: "program"
in: "formData"
description: "项目ID"
required: false
type: "string"
x-exportParamName: "Program"
x-optionalDataType: "String"
responses:
200:
description: "返回格式"
......@@ -15978,3 +15917,67 @@ definitions:
title: "title"
body: "body"
labels: "labels"
IssueUpdateParam:
type: "object"
properties:
access_token:
type: "string"
description: "用户授权码"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
repo:
type: "string"
description: "仓库路径(path)"
x-exportParamName: "Repo"
x-optionalDataType: "String"
title:
type: "string"
description: "Issue标题"
x-exportParamName: "Title"
x-optionalDataType: "String"
state:
type: "string"
description: "Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的)"
enum:
- "open"
- "progressing"
- "closed"
x-exportParamName: "State"
x-optionalDataType: "String"
body:
type: "string"
description: "Issue描述"
x-exportParamName: "Body"
x-optionalDataType: "String"
assignee:
type: "string"
description: "Issue负责人的username"
x-exportParamName: "Assignee"
x-optionalDataType: "String"
milestone:
type: "integer"
format: "int32"
description: "里程碑序号"
x-exportParamName: "Milestone"
x-optionalDataType: "Int32"
labels:
type: "string"
description: "用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance"
x-exportParamName: "Labels"
x-optionalDataType: "String"
program:
type: "string"
description: "项目ID"
x-exportParamName: "Program"
x-optionalDataType: "String"
description: "update issue information"
example:
access_token: "access_token"
milestone: 0
repo: "repo"
state: "open"
assignee: "assignee"
program: "program"
title: "title"
body: "body"
labels: "labels"
# IssueUpdateParam
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessToken** | **string** | 用户授权码 | [optional] [default to null]
**Repo** | **string** | 仓库路径(path) | [optional] [default to null]
**Title** | **string** | Issue标题 | [optional] [default to null]
**State** | **string** | Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的) | [optional] [default to null]
**Body** | **string** | Issue描述 | [optional] [default to null]
**Assignee** | **string** | Issue负责人的username | [optional] [default to null]
**Milestone** | **int32** | 里程碑序号 | [optional] [default to null]
**Labels** | **string** | 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance | [optional] [default to null]
**Program** | **string** | 项目ID | [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)
......@@ -647,7 +647,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)
# **PatchV5ReposOwnerIssuesNumber**
> Issue PatchV5ReposOwnerIssuesNumber(ctx, owner, number, optional)
> Issue PatchV5ReposOwnerIssuesNumber(ctx, owner, number, body)
更新Issue
更新Issue
......@@ -659,24 +659,7 @@ Name | Type | Description | Notes
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**number** | **string**| Issue 编号(区分大小写,无需添加 # 号) |
**optional** | ***PatchV5ReposOwnerIssuesNumberOpts** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a pointer to a PatchV5ReposOwnerIssuesNumberOpts struct
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessToken** | **optional.String**| 用户授权码 |
**repo** | **optional.String**| 仓库路径(path) |
**title** | **optional.String**| Issue标题 |
**state** | **optional.String**| Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的) |
**body** | **optional.String**| Issue描述 |
**assignee** | **optional.String**| Issue负责人的username |
**milestone** | **optional.Int32**| 里程碑序号 |
**labels** | **optional.String**| 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance |
**program** | **optional.String**| 项目ID |
**body** | [**IssueUpdateParam**](IssueUpdateParam.md)| 可选。Issue 内容 |
### Return type
......
......@@ -12,12 +12,11 @@ package gitee
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
"github.com/antihax/optional"
)
// Linger please
......@@ -1823,33 +1822,11 @@ IssuesApiService 更新Issue
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param owner 仓库所属空间地址(企业、组织或个人的地址path)
* @param number Issue 编号(区分大小写,无需添加 # 号)
* @param optional nil or *PatchV5ReposOwnerIssuesNumberOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
* @param "Repo" (optional.String) - 仓库路径(path)
* @param "Title" (optional.String) - Issue标题
* @param "State" (optional.String) - Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的)
* @param "Body" (optional.String) - Issue描述
* @param "Assignee" (optional.String) - Issue负责人的username
* @param "Milestone" (optional.Int32) - 里程碑序号
* @param "Labels" (optional.String) - 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance
* @param "Program" (optional.String) - 项目ID
* @param body 可选。Issue 内容
@return Issue
*/
type PatchV5ReposOwnerIssuesNumberOpts struct {
AccessToken optional.String
Repo optional.String
Title optional.String
State optional.String
Body optional.String
Assignee optional.String
Milestone optional.Int32
Labels optional.String
Program optional.String
}
func (a *IssuesApiService) PatchV5ReposOwnerIssuesNumber(ctx context.Context, owner string, number string, localVarOptionals *PatchV5ReposOwnerIssuesNumberOpts) (Issue, *http.Response, error) {
func (a *IssuesApiService) PatchV5ReposOwnerIssuesNumber(ctx context.Context, owner string, number string, body IssueUpdateParam) (Issue, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Patch")
localVarPostBody interface{}
......@@ -1884,33 +1861,8 @@ func (a *IssuesApiService) PatchV5ReposOwnerIssuesNumber(ctx context.Context, ow
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() {
localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Repo.IsSet() {
localVarFormParams.Add("repo", parameterToString(localVarOptionals.Repo.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Title.IsSet() {
localVarFormParams.Add("title", parameterToString(localVarOptionals.Title.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.State.IsSet() {
localVarFormParams.Add("state", parameterToString(localVarOptionals.State.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
localVarFormParams.Add("body", parameterToString(localVarOptionals.Body.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Assignee.IsSet() {
localVarFormParams.Add("assignee", parameterToString(localVarOptionals.Assignee.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Milestone.IsSet() {
localVarFormParams.Add("milestone", parameterToString(localVarOptionals.Milestone.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Labels.IsSet() {
localVarFormParams.Add("labels", parameterToString(localVarOptionals.Labels.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Program.IsSet() {
localVarFormParams.Add("program", parameterToString(localVarOptionals.Program.Value(), ""))
}
// 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
// update issue information
type IssueUpdateParam struct {
// 用户授权码
AccessToken string `json:"access_token,omitempty"`
// 仓库路径(path)
Repo string `json:"repo,omitempty"`
// Issue标题
Title string `json:"title,omitempty"`
// Issue 状态,open(开启的)、progressing(进行中)、closed(关闭的)
State string `json:"state,omitempty"`
// Issue描述
Body string `json:"body,omitempty"`
// Issue负责人的username
Assignee string `json:"assignee,omitempty"`
// 里程碑序号
Milestone int32 `json:"milestone,omitempty"`
// 用逗号分开的标签,名称要求长度在 2-20 之间且非特殊字符。如: bug,performance
Labels string `json:"labels,omitempty"`
// 项目ID
Program string `json:"program,omitempty"`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册