summaryrefslogtreecommitdiffstats
path: root/modules/structs
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2021-07-05 23:29:08 +0800
committerGitHub <noreply@github.com>2021-07-05 17:29:08 +0200
commit5bb97a12d79309e799e9826badf3527f03815dd2 (patch)
tree35e6a708ca49a01684ea97512055c0611552e7f4 /modules/structs
parent64122fe105686502d4d5606425875a6b16fa6203 (diff)
downloadgitea-5bb97a12d79309e799e9826badf3527f03815dd2.tar.gz
gitea-5bb97a12d79309e799e9826badf3527f03815dd2.zip
Creating a repo from a template repo via API (#15958)
* Creating a repo from a template repo via API fix #15934 ref: https://docs.github.com/en/rest/reference/repos#create-a-repository-using-a-template Signed-off-by: a1012112796 <1012112796@qq.com>
Diffstat (limited to 'modules/structs')
-rw-r--r--modules/structs/repo.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/structs/repo.go b/modules/structs/repo.go
index 4fdc1e54cb..cef864c020 100644
--- a/modules/structs/repo.go
+++ b/modules/structs/repo.go
@@ -180,6 +180,36 @@ type EditRepoOption struct {
MirrorInterval *string `json:"mirror_interval,omitempty"`
}
+// GenerateRepoOption options when creating repository using a template
+// swagger:model
+type GenerateRepoOption struct {
+ // The organization or person who will own the new repository
+ //
+ // required: true
+ Owner string `json:"owner"`
+ // Name of the repository to create
+ //
+ // required: true
+ // unique: true
+ Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
+ // Description of the repository to create
+ Description string `json:"description" binding:"MaxSize(255)"`
+ // Whether the repository is private
+ Private bool `json:"private"`
+ // include git content of default branch in template repo
+ GitContent bool `json:"git_content"`
+ // include topics in template repo
+ Topics bool `json:"topics"`
+ // include git hooks in template repo
+ GitHooks bool `json:"git_hooks"`
+ // include webhooks in template repo
+ Webhooks bool `json:"webhooks"`
+ // include avatar of the template repo
+ Avatar bool `json:"avatar"`
+ // include labels in template repo
+ Labels bool `json:"labels"`
+}
+
// CreateBranchRepoOption options when creating a branch in a repository
// swagger:model
type CreateBranchRepoOption struct {