diff --git a/README.md b/README.md index 6d07beac83ba6a36509cd556e416b49a06e4c50d..bb68b90dffb444a71ba1c15483d58f9e4c707563 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/api/swagger.yaml b/api/swagger.yaml index b63a796a099b0f3eef7059c641cf4c1fd6e0d9dd..5c012bf88953e58850c3cd673973d16199e7ea16 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -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: diff --git a/docs/Branch.md b/docs/Branch.md index 7b5414c60caefb2126a8522f76c0ad1b54ac33be..e6561bf8719d199f193a1d993e8c3a779f278678 100644 --- a/docs/Branch.md +++ b/docs/Branch.md @@ -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) diff --git a/docs/BranchCommit.md b/docs/BranchCommit.md new file mode 100644 index 0000000000000000000000000000000000000000..375e2a9d9adceb160c0500750b94edadc374f553 --- /dev/null +++ b/docs/BranchCommit.md @@ -0,0 +1,11 @@ +# 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) + + diff --git a/docs/RepositoriesApi.md b/docs/RepositoriesApi.md index bbe22db34af2ad51b2e3db945ca903fe7db38dfd..24049a0387f2da14e4a58e1e78ae002350665051 100644 --- a/docs/RepositoriesApi.md +++ b/docs/RepositoriesApi.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 diff --git a/gitee/api_repositories.go b/gitee/api_repositories.go index d6cd3c8ee149448fe8a5dbbcdea1a1ca8508d8b8..eda8523f97e07d8841eba25022589aa68dbc8244 100644 --- a/gitee/api_repositories.go +++ b/gitee/api_repositories.go @@ -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() diff --git a/gitee/model_branch.go b/gitee/model_branch.go index 98b8e66aa1db0db826632d540d57b885545ebaea..926af4d01cf8b634323f9e566fdcbb5363cdf87d 100644 --- a/gitee/model_branch.go +++ b/gitee/model_branch.go @@ -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"` } diff --git a/gitee/model_branch_commit.go b/gitee/model_branch_commit.go new file mode 100644 index 0000000000000000000000000000000000000000..247a83600896128be9a80b44bea1c560841f7465 --- /dev/null +++ b/gitee/model_branch_commit.go @@ -0,0 +1,16 @@ +/* + * 码云 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"` +}