提交 2ace5809 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!2 API-spec: add BranchProtectionPutParam object definition

Merge pull request !2 from imjoey/fix_protect_branch
......@@ -182,13 +182,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)"
......@@ -207,6 +200,13 @@ paths:
required: true
type: "string"
x-exportParamName: "Branch"
- in: "body"
name: "body"
description: "设置分支保护参数"
required: true
schema:
$ref: "#/definitions/BranchProtectionPutParam"
x-exportParamName: "Body"
responses:
200:
description: "返回格式"
......@@ -16046,3 +16046,14 @@ definitions:
example:
access_token: "access_token"
body: "body"
BranchProtectionPutParam:
type: "object"
properties:
access_token:
type: "string"
description: "用户授权码"
x-exportParamName: "AccessToken"
x-optionalDataType: "String"
description: "branch protection parameter"
example:
access_token: "access_token"
\ No newline at end of file
# BranchProtectionPutParam
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessToken** | **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)
......@@ -2153,7 +2153,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)
# **PutV5ReposOwnerRepoBranchesBranchProtection**
> CompleteBranch PutV5ReposOwnerRepoBranchesBranchProtection(ctx, owner, repo, branch, optional)
> CompleteBranch PutV5ReposOwnerRepoBranchesBranchProtection(ctx, owner, repo, branch, body)
设置分支保护
设置分支保护
......@@ -2166,17 +2166,7 @@ Name | Type | Description | Notes
**owner** | **string**| 仓库所属空间地址(企业、组织或个人的地址path) |
**repo** | **string**| 仓库路径(path) |
**branch** | **string**| 分支名称 |
**optional** | ***PutV5ReposOwnerRepoBranchesBranchProtectionOpts** | optional parameters | nil if no parameters
### Optional Parameters
Optional parameters are passed through a pointer to a PutV5ReposOwnerRepoBranchesBranchProtectionOpts struct
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accessToken** | **optional.String**| 用户授权码 |
**body** | [**BranchProtectionPutParam**](BranchProtectionPutParam.md)| 设置分支保护参数 |
### Return type
......
......@@ -5349,17 +5349,11 @@ RepositoriesApiService 设置分支保护
* @param owner 仓库所属空间地址(企业、组织或个人的地址path)
* @param repo 仓库路径(path)
* @param branch 分支名称
* @param optional nil or *PutV5ReposOwnerRepoBranchesBranchProtectionOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
* @param body 设置分支保护参数
@return CompleteBranch
*/
type PutV5ReposOwnerRepoBranchesBranchProtectionOpts struct {
AccessToken optional.String
}
func (a *RepositoriesApiService) PutV5ReposOwnerRepoBranchesBranchProtection(ctx context.Context, owner string, repo string, branch string, localVarOptionals *PutV5ReposOwnerRepoBranchesBranchProtectionOpts) (CompleteBranch, *http.Response, error) {
func (a *RepositoriesApiService) PutV5ReposOwnerRepoBranchesBranchProtection(ctx context.Context, owner string, repo string, branch string, body BranchProtectionPutParam) (CompleteBranch, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
......@@ -5395,9 +5389,8 @@ func (a *RepositoriesApiService) PutV5ReposOwnerRepoBranchesBranchProtection(ctx
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.AccessToken.IsSet() {
localVarFormParams.Add("access_token", parameterToString(localVarOptionals.AccessToken.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
// branch protection parameter
type BranchProtectionPutParam struct {
// 用户授权码
AccessToken string `json:"access_token,omitempty"`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册