//NewUpdateGroupCommand creates a new group
NewUpdateGroupCommand creates a new group
// NewUpdateGroupCommand creates a new group
func NewUpdateGroupCommand() *cobra.Command {
	var (
		group         api.Group
		namespacesRaw string
	)
	cmd := &cobra.Command{
		Use:   "update",
		Short: "Update a group",
		Example: `
groups update --name MyGroup --description "My test group" --applicationPermissions ViewKafkaConsumers --applicationPermissions ManageKafkaConsumers --applicationPermissions ViewConnectors --connectClustersPermissions dev,prod --dataNamespaces'[{"wildcards":["*"],"permissions":["CreateTopic","DropTopic","ConfigureTopic","QueryTopic","ShowTopic","ViewSchema","InsertData","DeleteData","UpdateSchema"],"system":"Kafka","instance":"Dev"}]'
`,
		TraverseChildren: true,
		SilenceErrors:    true,
		RunE: func(cmd *cobra.Command, args []string) error {
			if err := validateCreateUpdate(cmd, &namespacesRaw, &group); err != nil {
				return err
			}
			if err := config.Client.UpdateGroup(&group); err != nil {
				return fmt.Errorf("Failed to update group [%s]. [%s]", group.Name, err.Error())
			}
			return bite.PrintInfo(cmd, "Group [%s] updated", group.Name)
		},
	}
	addCreateUpdateFlags(cmd, &namespacesRaw, &group)
	return cmd
}
func NewUpdateGroupCommand ( ) * cobra . Command { var ( group api . Group namespacesRaw string ) cmd := & cobra . Command { Use : " " , Short : " " , Example : `
groups update --name MyGroup --description "My test group" --applicationPermissions ViewKafkaConsumers --applicationPermissions ManageKafkaConsumers --applicationPermissions ViewConnectors --connectClustersPermissions dev,prod --dataNamespaces'[{"wildcards":["*"],"permissions":["CreateTopic","DropTopic","ConfigureTopic","QueryTopic","ShowTopic","ViewSchema","InsertData","DeleteData","UpdateSchema"],"system":"Kafka","instance":"Dev"}]'
` , TraverseChildren : true , SilenceErrors : true , RunE : func ( cmd * cobra . Command , args [ ] string ) error { if err := validateCreateUpdate ( cmd , & namespacesRaw , & group ) ; err != nil { return err } if err := config . Client . UpdateGroup ( & group ) ; err != nil { return fmt . Errorf ( " " , group . Name , err . Error ( ) ) } return bite . PrintInfo ( cmd , " " , group . Name ) } , } addCreateUpdateFlags ( cmd , & namespacesRaw , & group ) return cmd }
NewUpdateGroupCommand creates a new group
NewUpdateGroupCommand creates a new group