-
Notifications
You must be signed in to change notification settings - Fork 55
/
groupdelete.go
45 lines (36 loc) · 1.02 KB
/
groupdelete.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package usersmanagement
import (
"github.com/jfrog/jfrog-cli-core/artifactory/utils"
"github.com/jfrog/jfrog-cli-core/utils/config"
)
type GroupDeleteCommand struct {
rtDetails *config.ServerDetails
name string
}
func NewGroupDeleteCommand() *GroupDeleteCommand {
return &GroupDeleteCommand{}
}
func (gdc *GroupDeleteCommand) ServerDetails() (*config.ServerDetails, error) {
return gdc.rtDetails, nil
}
func (gdc *GroupDeleteCommand) SetServerDetails(serverDetails *config.ServerDetails) *GroupDeleteCommand {
gdc.rtDetails = serverDetails
return gdc
}
func (gdc *GroupDeleteCommand) SetName(groupName string) *GroupDeleteCommand {
gdc.name = groupName
return gdc
}
func (gdc *GroupDeleteCommand) Name() string {
return gdc.name
}
func (gcc *GroupDeleteCommand) CommandName() string {
return "rt_group_delete"
}
func (gcc *GroupDeleteCommand) Run() error {
servicesManager, err := utils.CreateServiceManager(gcc.rtDetails, -1, false)
if err != nil {
return err
}
return servicesManager.DeleteGroup(gcc.Name())
}