2022-10-26 09:15:14 -05:00
|
|
|
package folder
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Service interface {
|
2022-12-19 02:52:04 -06:00
|
|
|
// GetChildren returns an array containing all child folders.
|
|
|
|
GetChildren(ctx context.Context, cmd *GetChildrenQuery) ([]*Folder, error)
|
2022-11-10 03:41:03 -06:00
|
|
|
Create(ctx context.Context, cmd *CreateFolderCommand) (*Folder, error)
|
2022-11-11 07:28:24 -06:00
|
|
|
|
|
|
|
// GetFolder takes a GetFolderCommand and returns a folder matching the
|
|
|
|
// request. One of ID, UID, or Title must be included. If multiple values
|
|
|
|
// are included in the request, Grafana will select one in order of
|
|
|
|
// specificity (ID, UID, Title).
|
|
|
|
Get(ctx context.Context, cmd *GetFolderQuery) (*Folder, error)
|
|
|
|
|
2022-11-10 07:28:55 -06:00
|
|
|
// Update is used to update a folder's UID, Title and Description. To change
|
|
|
|
// a folder's parent folder, use Move.
|
2022-12-20 07:00:33 -06:00
|
|
|
Update(ctx context.Context, cmd *UpdateFolderCommand) (*Folder, error)
|
2022-12-20 09:38:09 -06:00
|
|
|
Delete(ctx context.Context, cmd *DeleteFolderCommand) error
|
2022-10-26 09:15:14 -05:00
|
|
|
MakeUserAdmin(ctx context.Context, orgID int64, userID, folderID int64, setViewAndEditPermissions bool) error
|
2022-11-10 08:06:52 -06:00
|
|
|
// Move changes a folder's parent folder to the requested new parent.
|
|
|
|
Move(ctx context.Context, cmd *MoveFolderCommand) (*Folder, error)
|
2022-10-26 09:15:14 -05:00
|
|
|
}
|