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

!16 Fix request parameter issue on LabelPost API

Merge pull request !16 from TommyLike/bug/fix_post_label_issue
......@@ -22,3 +22,4 @@ _testmain.go
*.exe
*.test
*.prof
.idea
......@@ -277,6 +277,7 @@ Class | Method | HTTP request | Description
- [IssueCommentPostParam](docs/IssueCommentPostParam.md)
- [IssueUpdateParam](docs/IssueUpdateParam.md)
- [Label](docs/Label.md)
- [LabelPostParam](docs/LabelPostParam.md)
- [Milestone](docs/Milestone.md)
- [Namespace](docs/Namespace.md)
- [NamespaceMini](docs/NamespaceMini.md)
......
......@@ -1678,13 +1678,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)"
......@@ -1697,18 +1690,13 @@ paths:
required: true
type: "string"
x-exportParamName: "Repo"
- name: "name"
in: "formData"
description: "标签名称"
required: true
type: "string"
x-exportParamName: "Name"
- name: "color"
in: "formData"
description: "标签颜色。为6位的数字,如: 000000"
- in: "body"
name: "body"
description: "必选,标签的内容"
required: true
type: "string"
x-exportParamName: "Color"
schema:
$ref: "#/definitions/LabelPostParam"
x-exportParamName: "Body"
responses:
201:
description: "返回格式"
......@@ -16035,6 +16023,28 @@ definitions:
position: 0
body: "body"
commit_id: "commit_id"
LabelPostParam:
type: "object"
properties:
access_token:
type: "string"
description: "用户授权码"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
name:
type: "string"
description: "标签的名称,必选。"
x-exportParamName: "Name"
x-optionalDataType: "String"
color:
type: "string"
description: "标签的颜色,为6位的数字,如: 000000,必选。"
x-exportParamName: "Color"
x-optionalDataType: "String"
example:
access_token: "access_token"
name: "lgtm"
color: "#ffffff"
PullRequestMergePutParam:
type: "object"
properties:
......
# LabelPostParam
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessToken** | **string** | 用户授权码 | [optional] [default to null]
**Name** | **string** | 标签的名称,必选。 | [optional] [default to null]
**Color** | **string** | 标签的颜色,为6位的数字,如: 000000,必选。 | [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)
\ No newline at end of file
......@@ -426,7 +426,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)
# **PostV5ReposOwnerRepoLabels**
> Label PostV5ReposOwnerRepoLabels(ctx, owner, repo, name, color, optional)
> Label PostV5ReposOwnerRepoLabels(ctx, owner, repo, body)
创建仓库任务标签
创建仓库任务标签
......@@ -436,22 +436,9 @@ No authorization required
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**repo** | **string**| 仓库路径(path) |
**name** | **string**| 标签名称 |
**color** | **string**| 标签颜色。为6位的数字,如: 000000 |
**optional** | ***PostV5ReposOwnerRepoLabelsOpts** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a pointer to a PostV5ReposOwnerRepoLabelsOpts struct
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessToken** | **optional.String**| 用户授权码 |
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**repo** | **string**| 仓库路径(path) |
**body** | [**LabelPostParam**](LabelPostParam.md)| 必选,标签的内容 |
### Return type
......
......@@ -1012,19 +1012,11 @@ LabelsApiService 创建仓库任务标签
* @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 name 标签名称
* @param color 标签颜色。为6位的数字,如: 000000
* @param optional nil or *PostV5ReposOwnerRepoLabelsOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
* @param body 必选,标签的内容
@return Label
*/
type PostV5ReposOwnerRepoLabelsOpts struct {
AccessToken optional.String
}
func (a *LabelsApiService) PostV5ReposOwnerRepoLabels(ctx context.Context, owner string, repo string, name string, color string, localVarOptionals *PostV5ReposOwnerRepoLabelsOpts) (Label, *http.Response, error) {
func (a *LabelsApiService) PostV5ReposOwnerRepoLabels(ctx context.Context, owner string, repo string, body LabelPostParam) (Label, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
......@@ -1059,11 +1051,8 @@ func (a *LabelsApiService) PostV5ReposOwnerRepoLabels(ctx context.Context, owner
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() {
localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.Value(), ""))
}
localVarFormParams.Add("name", parameterToString(name, ""))
localVarFormParams.Add("color", parameterToString(color, ""))
// 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
type LabelPostParam struct {
// 用户授权码
AccessToken string `json:"access_token,omitempty"`
// 标签的名称,必选。
Name string `json:"name,omitempty"`
// 标签的颜色,为6位的数字,如: 000000,必选。
Color string `json:"color,omitempty"`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册