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"` +}