mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-09 12:07:52 +02:00
add api types for groups
This commit is contained in:
parent
c84d2277de
commit
01f7c9407b
50
modules/structs/repo_group.go
Normal file
50
modules/structs/repo_group.go
Normal file
@ -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"`
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user