From 01f7c9407b0ef58da37faddd146d1c5491d52110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Wed, 13 Aug 2025 03:16:40 -0400 Subject: [PATCH] add api types for groups --- modules/structs/repo_group.go | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 modules/structs/repo_group.go diff --git a/modules/structs/repo_group.go b/modules/structs/repo_group.go new file mode 100644 index 0000000000..c4d4904e9a --- /dev/null +++ b/modules/structs/repo_group.go @@ -0,0 +1,50 @@ +package structs + +// Group represents a group of repositories and subgroups in an organization +// swagger:model +type Group struct { + ID int64 `json:"id"` + Owner *User `json:"owner"` + Name string `json:"name"` + Description string `json:"description"` + ParentGroupID int64 `json:"parentGroupID"` + NumRepos int64 `json:"num_repos"` + NumSubgroups int64 `json:"num_subgroups"` + Link string `json:"link"` + SortOrder int `json:"sort_order"` +} + +// NewGroupOption - options for creating a new group in an organization +// swagger:model +type NewGroupOption struct { + // the name for the newly created group + // + // required: true + Name string `json:"name" binding:"Required"` + // the description of the newly created group + Description string `json:"description"` + // the visibility of the newly created group + Visibility VisibleType `json:"visibility"` +} + +// MoveGroupOption - options for changing a group's parent and sort order +// swagger:model +type MoveGroupOption struct { + // the new parent group. can be 0 to specify no parent + // + // required: true + NewParent int64 `json:"newParent" binding:"Required"` + // the position of this group in its new parent + NewPos *int `json:"newPos,omitempty"` +} + +// EditGroupOption - options for editing a repository group +// swagger:model +type EditGroupOption struct { + // the new name of the group + Name *string `json:"name,omitempty"` + // the new description of the group + Description *string `json:"description,omitempty"` + // the new visibility of the group + Visibility *VisibleType `json:"visibility,omitempty"` +}