提交 5269ccb3 编写于 作者: Z zengchen1024

fix the return data struct of getting branch

上级 bec79e88
......@@ -253,6 +253,7 @@ Class | Method | HTTP request | Description
- [BasicInfo](docs/BasicInfo.md)
- [Blob](docs/Blob.md)
- [Branch](docs/Branch.md)
- [BranchCommit](docs/BranchCommit.md)
- [BranchProtectionPutParam](docs/BranchProtectionPutParam.md)
- [Code](docs/Code.md)
- [CodeComment](docs/CodeComment.md)
......
......@@ -168,7 +168,7 @@ paths:
200:
description: "返回格式"
schema:
$ref: "#/definitions/CompleteBranch"
$ref: "#/definitions/Branch"
/v5/repos/{owner}/{repo}/branches/{branch}/protection:
put:
tags:
......@@ -13151,9 +13151,9 @@ definitions:
name:
type: "string"
commit:
type: "string"
$ref: "#/definitions/BranchCommit"
protected:
type: "string"
type: "boolean"
protection_url:
type: "string"
description: "获取所有分支"
......@@ -13162,6 +13162,17 @@ definitions:
name: "name"
commit: "commit"
protection_url: "protection_url"
BranchCommit:
type: "object"
properties:
url:
type: "string"
sha:
type: "string"
description: "分支commit info"
example:
sha: "sha"
url: "url"
CompleteBranch:
type: "object"
properties:
......
......@@ -4,8 +4,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional] [default to null]
**Commit** | **string** | | [optional] [default to null]
**Protected** | **string** | | [optional] [default to null]
**Commit** | [***BranchCommit**](BranchCommit.md) | | [optional] [default to null]
**Protected** | **bool** | | [optional] [default to null]
**ProtectionUrl** | **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)
......
# BranchCommit
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Url** | **string** | | [optional] [default to null]
**Sha** | **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)
......@@ -556,7 +556,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)
# **GetV5ReposOwnerRepoBranchesBranch**
> CompleteBranch GetV5ReposOwnerRepoBranchesBranch(ctx, owner, repo, branch, optional)
> Branch GetV5ReposOwnerRepoBranchesBranch(ctx, owner, repo, branch, optional)
获取单个分支
获取单个分支
......@@ -583,7 +583,7 @@ Name | Type | Description | Notes
### Return type
[**CompleteBranch**](CompleteBranch.md)
[**Branch**](Branch.md)
### Authorization
......
......@@ -1182,20 +1182,20 @@ RepositoriesApiService 获取单个分支
* @param optional nil or *GetV5ReposOwnerRepoBranchesBranchOpts - Optional Parameters:
* @param "AccessToken" (optional.String) - 用户授权码
@return CompleteBranch
@return Branch
*/
type GetV5ReposOwnerRepoBranchesBranchOpts struct {
AccessToken optional.String
}
func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranchesBranch(ctx context.Context, owner string, repo string, branch string, localVarOptionals *GetV5ReposOwnerRepoBranchesBranchOpts) (CompleteBranch, *http.Response, error) {
func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranchesBranch(ctx context.Context, owner string, repo string, branch string, localVarOptionals *GetV5ReposOwnerRepoBranchesBranchOpts) (Branch, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CompleteBranch
localVarReturnValue Branch
)
// create path and map variables
......@@ -1259,7 +1259,7 @@ func (a *RepositoriesApiService) GetV5ReposOwnerRepoBranchesBranch(ctx context.C
}
if localVarHttpResponse.StatusCode == 200 {
var v CompleteBranch
var v Branch
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
......
......@@ -11,8 +11,8 @@ package gitee
// 获取所有分支
type Branch struct {
Name string `json:"name,omitempty"`
Commit string `json:"commit,omitempty"`
Protected string `json:"protected,omitempty"`
ProtectionUrl string `json:"protection_url,omitempty"`
Name string `json:"name,omitempty"`
Commit *BranchCommit `json:"commit,omitempty"`
Protected bool `json:"protected,omitempty"`
ProtectionUrl string `json:"protection_url,omitempty"`
}
/*
* 码云 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
// 分支commit info
type BranchCommit struct {
Url string `json:"url,omitempty"`
Sha string `json:"sha,omitempty"`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册