aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/swagger/repo.go
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2020-02-13 00:19:35 +0100
committerGitHub <noreply@github.com>2020-02-12 23:19:35 +0000
commit9ff4e1d2d9636ea8aa328427f1d31c962221263e (patch)
treeb0df096e3885a6f05c26959f784cca0ce6a9763c /routers/api/v1/swagger/repo.go
parent908f8952be3ba7a4e4c32b0fd0dab5eb08ca8dd4 (diff)
downloadgitea-9ff4e1d2d9636ea8aa328427f1d31c962221263e.tar.gz
gitea-9ff4e1d2d9636ea8aa328427f1d31c962221263e.zip
Add API branch protection endpoint (#9311)
* add API branch protection endpoint * lint * Change to use team names instead of ids. * Status codes. * fix * Fix * Add new branch protection options (BlockOnRejectedReviews, DismissStaleApprovals, RequireSignedCommits) * Do xorm query directly * fix xorm GetUserNamesByIDs * Add some tests * Improved GetTeamNamesByID * http status created for CreateBranchProtection * Correct status code in integration test Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/swagger/repo.go')
-rw-r--r--routers/api/v1/swagger/repo.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/routers/api/v1/swagger/repo.go b/routers/api/v1/swagger/repo.go
index 4ac5c6d2d5..2a657f3122 100644
--- a/routers/api/v1/swagger/repo.go
+++ b/routers/api/v1/swagger/repo.go
@@ -36,6 +36,20 @@ type swaggerResponseBranchList struct {
Body []api.Branch `json:"body"`
}
+// BranchProtection
+// swagger:response BranchProtection
+type swaggerResponseBranchProtection struct {
+ // in:body
+ Body api.BranchProtection `json:"body"`
+}
+
+// BranchProtectionList
+// swagger:response BranchProtectionList
+type swaggerResponseBranchProtectionList struct {
+ // in:body
+ Body []api.BranchProtection `json:"body"`
+}
+
// TagList
// swagger:response TagList
type swaggerResponseTagList struct {