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

fix the return data struct of getting branch

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