diff --git a/api/swagger.yaml b/api/swagger.yaml index ad9a52ffa250603b8dfec63357085aefafc80f76..3bf3a789a99cdcc0e4a670d0a4d750fa261881cc 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -14530,6 +14530,30 @@ definitions: position: "position" commit_id: "commit_id" user: "user" + GitUser: + type: "object" + properties: + name: + type: "string" + email: + type: "string" + date: + type: "string" + format: "date-time" + GitCommit: + type: "object" + properties: + url: + type: "string" + author: + $ref: "#/definitions/GitUser" + committer: + $ref: "#/definitions/GitUser" + message: + type: "string" + comment_count: + type: integer + format: int32 PullRequestCommits: type: "object" properties: @@ -14542,13 +14566,13 @@ definitions: comments_url: type: "string" commit: - type: "string" + $ref: "#/definitions/GitCommit" author: - type: "string" + $ref: "#/definitions/UserBasic" committer: - type: "string" + $ref: "#/definitions/UserBasic" parents: - type: "string" + $ref: "#/definitions/CommitTree" description: "获取某Pull Request的所有Commit信息。最多显示250条Commit" example: committer: "committer" diff --git a/gitee/api_emails.go b/gitee/api_emails.go index 57500fbf1716ceb84a9bc8a488246eba2493f1c5..40878e1dd7807ec75a0c89a734ac179a3c02a484 100644 --- a/gitee/api_emails.go +++ b/gitee/api_emails.go @@ -11,11 +11,12 @@ package gitee import ( "context" - "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/antihax/optional" ) // Linger please diff --git a/gitee/api_issues.go b/gitee/api_issues.go index ddf7b4d501ad903272a51c13ec429627374f93a7..71be47f1949a604faccf0296fd397be994e98712 100644 --- a/gitee/api_issues.go +++ b/gitee/api_issues.go @@ -12,11 +12,12 @@ package gitee import ( "context" "fmt" - "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/antihax/optional" ) // Linger please diff --git a/gitee/api_pull_requests.go b/gitee/api_pull_requests.go index 30fedb81129948873ec8a3933fb9ea025f23d611..166ffc14695af33738e6ad0a4310808c09c12d61 100644 --- a/gitee/api_pull_requests.go +++ b/gitee/api_pull_requests.go @@ -12,11 +12,12 @@ package gitee import ( "context" "fmt" - "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/antihax/optional" ) // Linger please diff --git a/gitee/api_repositories.go b/gitee/api_repositories.go index aaad8fcb26ccb05c3b2021e4614f01f44d59a31f..26ed36707775c629a3c946d5a504e51d71f8e7ee 100644 --- a/gitee/api_repositories.go +++ b/gitee/api_repositories.go @@ -12,11 +12,12 @@ package gitee import ( "context" "fmt" - "github.com/antihax/optional" "io/ioutil" "net/http" "net/url" "strings" + + "github.com/antihax/optional" ) // Linger please @@ -5772,7 +5773,6 @@ func (a *RepositoriesApiService) PutV5ReposOwnerRepoReviewer(ctx context.Context localVarPostBody interface{} localVarFileName string localVarFileBytes []byte - ) // create path and map variables @@ -5819,10 +5819,9 @@ func (a *RepositoriesApiService) PutV5ReposOwnerRepoReviewer(ctx context.Context return localVarHttpResponse, err } - if localVarHttpResponse.StatusCode >= 300 { newErr := GenericSwaggerError{ - body: localVarBody, + body: localVarBody, error: localVarHttpResponse.Status, } @@ -5831,4 +5830,3 @@ func (a *RepositoriesApiService) PutV5ReposOwnerRepoReviewer(ctx context.Context return localVarHttpResponse, nil } - diff --git a/gitee/model_complete_branch.go b/gitee/model_complete_branch.go index bbe31f047423d208080ba564ec372634bbfbe0fc..30b111c870a32db818e5d8c1a86f67e1a1a85746 100644 --- a/gitee/model_complete_branch.go +++ b/gitee/model_complete_branch.go @@ -11,9 +11,9 @@ package gitee // 创建分支 type CompleteBranch struct { - Name string `json:"name,omitempty"` - Commit *BranchCommit `json:"commit,omitempty"` - Links string `json:"_links,omitempty"` - Protected string `json:"protected,omitempty"` - ProtectionUrl string `json:"protection_url,omitempty"` + Name string `json:"name,omitempty"` + Commit *BranchCommit `json:"commit,omitempty"` + Links string `json:"_links,omitempty"` + Protected string `json:"protected,omitempty"` + ProtectionUrl string `json:"protection_url,omitempty"` } diff --git a/gitee/model_git_commit.go b/gitee/model_git_commit.go new file mode 100644 index 0000000000000000000000000000000000000000..7da5de28dcdef2e522c6d52a74aeccf570a8d5da --- /dev/null +++ b/gitee/model_git_commit.go @@ -0,0 +1,18 @@ +/* + * 码云 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 GitCommit struct { + Url string `json:"url,omitempty"` + Author *GitUser `json:"author,omitempty"` + Committer *GitUser `json:"committer,omitempty"` + Message string `json:"message,omitempty"` + CommentCount int32 `json:"comment_count,omitempty"` +} diff --git a/gitee/model_git_user.go b/gitee/model_git_user.go new file mode 100644 index 0000000000000000000000000000000000000000..6e7d2f5f38b9e4aed09e43ad4078cf6c6211c7ec --- /dev/null +++ b/gitee/model_git_user.go @@ -0,0 +1,20 @@ +/* + * 码云 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 + +import ( + "time" +) + +type GitUser struct { + Name string `json:"name,omitempty"` + Email string `json:"email,omitempty"` + Date time.Time `json:"date,omitempty"` +} diff --git a/gitee/model_pull_request_commits.go b/gitee/model_pull_request_commits.go index d83684cb69aedb533845dc76354361161c0bccae..891f083316e9e25b7c2af2e2a0432c51dc93336e 100644 --- a/gitee/model_pull_request_commits.go +++ b/gitee/model_pull_request_commits.go @@ -11,12 +11,12 @@ package gitee // 获取某Pull Request的所有Commit信息。最多显示250条Commit type PullRequestCommits struct { - Url string `json:"url,omitempty"` - Sha string `json:"sha,omitempty"` - HtmlUrl string `json:"html_url,omitempty"` - CommentsUrl string `json:"comments_url,omitempty"` - Commit Commit `json:"commit,omitempty"` - Author UserBasic `json:"author,omitempty"` - Committer UserBasic `json:"committer,omitempty"` - Parents CommitTree `json:"parents,omitempty"` + Url string `json:"url,omitempty"` + Sha string `json:"sha,omitempty"` + HtmlUrl string `json:"html_url,omitempty"` + CommentsUrl string `json:"comments_url,omitempty"` + Commit *GitCommit `json:"commit,omitempty"` + Author *UserBasic `json:"author,omitempty"` + Committer *UserBasic `json:"committer,omitempty"` + Parents *CommitTree `json:"parents,omitempty"` } diff --git a/gitee/model_pull_request_file_path.go b/gitee/model_pull_request_file_path.go index 33b69265079597ae66c8c0988b84923ee6174238..05d554ea9775c48f54138dd36006bca98497f8f1 100644 --- a/gitee/model_pull_request_file_path.go +++ b/gitee/model_pull_request_file_path.go @@ -11,13 +11,13 @@ package gitee // 单个文件的patch信息 type PullRequestFilePath struct { - Diff string `json:"diff,omitempty"` - NewPath string `json:"new_path,omitempty"` - OldPath string `json:"old_path,omitempty"` - AMode string `json:"a_mode,omitempty"` - BMode string `json:"b_mode,omitempty"` - NewFile bool `json:"new_file,omitempty"` - RenamedFile bool `json:"renamed_file,omitempty"` - DeletedFile bool `json:"deleted_file,omitempty"` - TooLarge bool `json:"too_large,omitempty"` + Diff string `json:"diff,omitempty"` + NewPath string `json:"new_path,omitempty"` + OldPath string `json:"old_path,omitempty"` + AMode string `json:"a_mode,omitempty"` + BMode string `json:"b_mode,omitempty"` + NewFile bool `json:"new_file,omitempty"` + RenamedFile bool `json:"renamed_file,omitempty"` + DeletedFile bool `json:"deleted_file,omitempty"` + TooLarge bool `json:"too_large,omitempty"` } diff --git a/gitee/model_pull_request_files.go b/gitee/model_pull_request_files.go index bff3c4e22a956b5b865b34b43725af0d9b8b5a80..03d28919a2de173be407db0294f0d3c8552f26c7 100644 --- a/gitee/model_pull_request_files.go +++ b/gitee/model_pull_request_files.go @@ -11,12 +11,12 @@ package gitee // Pull Request Commit文件列表。最多显示300条diff type PullRequestFiles struct { - Sha string `json:"sha,omitempty"` - Filename string `json:"filename,omitempty"` - Status string `json:"status,omitempty"` - Additions string `json:"additions,omitempty"` - Deletions string `json:"deletions,omitempty"` - BlobUrl string `json:"blob_url,omitempty"` - RawUrl string `json:"raw_url,omitempty"` - Patch *PullRequestFilePath `json:"patch,omitempty"` + Sha string `json:"sha,omitempty"` + Filename string `json:"filename,omitempty"` + Status string `json:"status,omitempty"` + Additions string `json:"additions,omitempty"` + Deletions string `json:"deletions,omitempty"` + BlobUrl string `json:"blob_url,omitempty"` + RawUrl string `json:"raw_url,omitempty"` + Patch *PullRequestFilePath `json:"patch,omitempty"` }