diff --git a/api/resource_groups.go b/api/resource_groups.go index 423f1dba5..403fa01ba 100644 --- a/api/resource_groups.go +++ b/api/resource_groups.go @@ -24,7 +24,6 @@ import ( "fmt" "time" - "github.com/lacework/go-sdk/lwtime" "github.com/pkg/errors" ) @@ -34,16 +33,6 @@ type ResourceGroupsService struct { client *Client } -type ResourceGroupProps interface { - GetBaseProps() ResourceGroupPropsBase -} - -type ResourceGroupPropsBase struct { - Description string `json:"description"` - UpdatedBy string `json:"updatedBy,omitempty"` - LastUpdated *lwtime.Epoch `json:"lastUpdated,omitempty"` -} - type ResourceGroup interface { ID() string ResourceGroupType() resourceGroupType diff --git a/api/resource_groups_v2.go b/api/resource_groups_v2.go index 26899ad1d..04843917e 100644 --- a/api/resource_groups_v2.go +++ b/api/resource_groups_v2.go @@ -155,27 +155,10 @@ type ResourceGroupDataWithQuery struct { IsOrg *bool `json:"isOrg,omitempty"` } -func (group ResourceGroupDataWithQuery) GetProps() interface{} { - return nil -} - -func (group ResourceGroupDataWithQuery) GetQuery() *RGQuery { - return group.Query -} - -func (group ResourceGroupDataWithQuery) ResourceGroupType() resourceGroupType { - t, _ := FindResourceGroupType(group.Type) - return t -} - func (group ResourceGroupDataWithQuery) ID() string { return group.ResourceGroupGuid } -func (group *ResourceGroupDataWithQuery) ResetResourceGUID() { - group.ResourceGroupGuid = "" -} - func (group ResourceGroupDataWithQuery) IsV2Group() bool { return true } diff --git a/cli/cmd/resource_groups.go b/cli/cmd/resource_groups.go index b10955887..e351d83cc 100644 --- a/cli/cmd/resource_groups.go +++ b/cli/cmd/resource_groups.go @@ -131,24 +131,12 @@ Then navigate to Settings > Resource Groups. var groupCommon [][]string - if group.Props != nil { - groupCommon = append(groupCommon, - []string{group.Id, group.ResType, group.Name, strconv.Itoa(group.Enabled), - strconv.FormatBool(group.IsDefaultBoolean)}, - ) - cli.OutputHuman(renderSimpleTable([]string{"RESOURCE GROUP GUID", "TYPE", "NAME", "ENABLED", - "IS_DEFAULT_BOOLEAN"}, - groupCommon)) - cli.OutputHuman("\n") - //cli.OutputHuman(buildResourceGroupPropsTable(group)) - } else { - groupCommon = append(groupCommon, - []string{group.Id, group.ResType, group.Name, group.Description, strconv.Itoa(group.Enabled), - strconv.FormatBool(group.IsDefaultBoolean), group.UpdatedBy, group.UpdatedTime.UTC().String()}, - ) - cli.OutputHuman(renderSimpleTable([]string{"RESOURCE GROUP ID", "TYPE", "NAME", "DESCRIPTION", "STATE", - "DEFAULT", "UPDATED BY", "UPDATED_TIME"}, groupCommon)) - } + groupCommon = append(groupCommon, + []string{group.Id, group.ResType, group.Name, group.Description, strconv.Itoa(group.Enabled), + strconv.FormatBool(group.IsDefaultBoolean), group.UpdatedBy, group.UpdatedTime.UTC().String()}, + ) + cli.OutputHuman(renderSimpleTable([]string{"RESOURCE GROUP ID", "TYPE", "NAME", "DESCRIPTION", "STATE", + "DEFAULT", "UPDATED BY", "UPDATED_TIME"}, groupCommon)) return nil }, @@ -310,14 +298,13 @@ func IsDefault(isDefault int) string { } type resourceGroup struct { - Id string `json:"resource_guid"` - ResType string `json:"type"` - Name string `json:"name"` - Props api.ResourceGroupProps `json:"props"` - Enabled int `json:"enabled"` - IsDefaultBoolean bool `json:"isDefault"` - Query *api.RGQuery `json:"query"` - Description string `json:"description,omitempty"` - UpdatedTime *time.Time `json:"updatedTime,omitempty"` - UpdatedBy string `json:"updatedBy,omitempty"` + Id string `json:"resourceGroupGuid"` + ResType string `json:"type"` + Name string `json:"name"` + Enabled int `json:"enabled"` + IsDefaultBoolean bool `json:"isDefault"` + Query *api.RGQuery `json:"query"` + Description string `json:"description,omitempty"` + UpdatedTime *time.Time `json:"updatedTime,omitempty"` + UpdatedBy string `json:"updatedBy,omitempty"` }