Skip to content

Commit 498d362

Browse files
mcabralrMaxrovr
authored andcommitted
Added - Support for OPSI News Reports - Actionable Insights
1 parent c9a0200 commit 498d362

File tree

6 files changed

+254
-1
lines changed

6 files changed

+254
-1
lines changed

internal/integrationtest/opsi_news_report_test.go

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ var (
6161
"day_of_week": acctest.Representation{RepType: acctest.Optional, Create: `MONDAY`, Update: `TUESDAY`},
6262
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
6363
"freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}},
64+
"match_rule": acctest.Representation{RepType: acctest.Optional, Create: `MATCH_ANY`, Update: `MATCH_ALL`},
6465
"status": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`},
66+
"tag_filters": acctest.Representation{RepType: acctest.Optional, Create: []string{`tagNamespace.tagKey=tagValue`}, Update: []string{`tagNamespace2.tagKey2=tagValue2`}},
6567
"lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangesNewsReportRepresentation},
6668
}
6769

@@ -189,6 +191,26 @@ var (
189191
"sql_insights_top_sql_resources": acctest.Representation{RepType: acctest.Required, Create: []string{`DATABASE`}, Update: []string{`DATABASE`, `EXADATA`}},
190192
}
191193

194+
OpsiNewsReportActionableInsightsRepresentation = map[string]interface{}{
195+
"compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`},
196+
"content_types": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiNewsReportActionableInsightsContentTypesRepresentation},
197+
"description": acctest.Representation{RepType: acctest.Required, Create: `TF_TEST_REPORT_DESCRIPTION`, Update: `TF_TEST_REPORT_DESCRIPTION_2`},
198+
"locale": acctest.Representation{RepType: acctest.Required, Create: `EN`},
199+
"name": acctest.Representation{RepType: acctest.Required, Create: `TF_TEST_REPORT_NAME`, Update: `TF_TEST_REPORT_NAME_2`},
200+
"news_frequency": acctest.Representation{RepType: acctest.Required, Create: `WEEKLY`},
201+
"ons_topic_id": acctest.Representation{RepType: acctest.Required, Create: `${var.topic_id}`},
202+
"are_child_compartments_included": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`},
203+
"day_of_week": acctest.Representation{RepType: acctest.Optional, Create: `MONDAY`, Update: `TUESDAY`},
204+
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
205+
"freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}},
206+
"status": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`},
207+
"lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangesNewsReportRepresentation},
208+
}
209+
210+
OpsiNewsReportActionableInsightsContentTypesRepresentation = map[string]interface{}{
211+
"actionable_insights_resources": acctest.Representation{RepType: acctest.Required, Create: []string{`NEW_HIGHS`}, Update: []string{`BIG_CHANGES`, `CURRENT_INVENTORY`}},
212+
}
213+
192214
ignoreChangesNewsReportRepresentation = map[string]interface{}{
193215
"ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}},
194216
}
@@ -463,6 +485,40 @@ func TestOpsiNewsReportResource_basic(t *testing.T) {
463485
Config: config + compartmentIdVariableStr + OpsiNewsReportResourceDependencies,
464486
},
465487

488+
//Step - Verify Create with Required for SqlInsightsTopSqlByInsights
489+
{
490+
Config: config + compartmentIdVariableStr + topicIdVariableStr + OpsiNewsReportResourceDependencies +
491+
acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Required, acctest.Create, OpsiNewsReportActionableInsightsRepresentation),
492+
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
493+
resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId),
494+
resource.TestCheckResourceAttr(resourceName, "content_types.#", "1"),
495+
resource.TestCheckResourceAttr(resourceName, "content_types.0.actionable_insights_resources.#", "1"),
496+
resource.TestCheckResourceAttr(resourceName, "description", "TF_TEST_REPORT_DESCRIPTION"),
497+
//resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"),
498+
resource.TestCheckResourceAttrSet(resourceName, "id"),
499+
resource.TestCheckResourceAttr(resourceName, "locale", "EN"),
500+
resource.TestCheckResourceAttr(resourceName, "name", "TF_TEST_REPORT_NAME"),
501+
resource.TestCheckResourceAttr(resourceName, "news_frequency", "WEEKLY"),
502+
resource.TestCheckResourceAttrSet(resourceName, "ons_topic_id"),
503+
//resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"),
504+
505+
func(s *terraform.State) (err error) {
506+
resId, err = acctest.FromInstanceState(s, resourceName, "id")
507+
if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment {
508+
if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil {
509+
return errExport
510+
}
511+
}
512+
return err
513+
},
514+
),
515+
},
516+
517+
// delete before next Create
518+
{
519+
Config: config + compartmentIdVariableStr + OpsiNewsReportResourceDependencies,
520+
},
521+
466522
//Step - Verify Create with Optionals
467523
{
468524
Config: config + compartmentIdVariableStr + topicIdVariableStr + OpsiNewsReportResourceDependencies +
@@ -481,6 +537,8 @@ func TestOpsiNewsReportResource_basic(t *testing.T) {
481537
resource.TestCheckResourceAttr(resourceName, "news_frequency", "WEEKLY"),
482538
resource.TestCheckResourceAttrSet(resourceName, "ons_topic_id"),
483539
resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"),
540+
resource.TestCheckResourceAttr(resourceName, "match_rule", "MATCH_ANY"),
541+
resource.TestCheckResourceAttr(resourceName, "tag_filters.#", "1"),
484542

485543
func(s *terraform.State) (err error) {
486544
resId, err = acctest.FromInstanceState(s, resourceName, "id")
@@ -515,6 +573,8 @@ func TestOpsiNewsReportResource_basic(t *testing.T) {
515573
resource.TestCheckResourceAttr(resourceName, "news_frequency", "WEEKLY"),
516574
resource.TestCheckResourceAttrSet(resourceName, "ons_topic_id"),
517575
resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"),
576+
resource.TestCheckResourceAttr(resourceName, "match_rule", "MATCH_ANY"),
577+
resource.TestCheckResourceAttr(resourceName, "tag_filters.#", "1"),
518578

519579
func(s *terraform.State) (err error) {
520580
resId2, err = acctest.FromInstanceState(s, resourceName, "id")

internal/service/opsi/opsi_news_report_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ func (s *OpsiNewsReportDataSourceCrud) SetData() error {
9898

9999
s.D.Set("locale", s.Res.Locale)
100100

101+
s.D.Set("match_rule", s.Res.MatchRule)
102+
101103
if s.Res.Name != nil {
102104
s.D.Set("name", *s.Res.Name)
103105
}
@@ -116,6 +118,8 @@ func (s *OpsiNewsReportDataSourceCrud) SetData() error {
116118
s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags))
117119
}
118120

121+
s.D.Set("tag_filters", s.Res.TagFilters)
122+
119123
if s.Res.TimeCreated != nil {
120124
s.D.Set("time_created", s.Res.TimeCreated.String())
121125
}

internal/service/opsi/opsi_news_report_resource.go

Lines changed: 175 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ func OpsiNewsReportResource() *schema.Resource {
4343
Elem: &schema.Resource{
4444
Schema: map[string]*schema.Schema{
4545
// Optional
46+
"actionable_insights_resources": {
47+
Type: schema.TypeList,
48+
Optional: true,
49+
Computed: true,
50+
Elem: &schema.Schema{
51+
Type: schema.TypeString,
52+
},
53+
},
4654
"capacity_planning_resources": {
4755
Type: schema.TypeList,
4856
Optional: true,
@@ -149,11 +157,24 @@ func OpsiNewsReportResource() *schema.Resource {
149157
Computed: true,
150158
Elem: schema.TypeString,
151159
},
160+
"match_rule": {
161+
Type: schema.TypeString,
162+
Optional: true,
163+
Computed: true,
164+
},
152165
"status": {
153166
Type: schema.TypeString,
154167
Optional: true,
155168
Computed: true,
156169
},
170+
"tag_filters": {
171+
Type: schema.TypeList,
172+
Optional: true,
173+
Computed: true,
174+
Elem: &schema.Schema{
175+
Type: schema.TypeString,
176+
},
177+
},
157178

158179
// Computed
159180
"lifecycle_details": {
@@ -299,6 +320,10 @@ func (s *OpsiNewsReportResourceCrud) Create() error {
299320
request.Locale = oci_opsi.NewsLocaleEnum(locale.(string))
300321
}
301322

323+
if matchRule, ok := s.D.GetOkExists("match_rule"); ok {
324+
request.MatchRule = oci_opsi.MatchRuleEnum(matchRule.(string))
325+
}
326+
302327
if name, ok := s.D.GetOkExists("name"); ok {
303328
tmp := name.(string)
304329
request.Name = &tmp
@@ -317,6 +342,19 @@ func (s *OpsiNewsReportResourceCrud) Create() error {
317342
request.Status = oci_opsi.ResourceStatusEnum(status.(string))
318343
}
319344

345+
if tagFilters, ok := s.D.GetOkExists("tag_filters"); ok {
346+
interfaces := tagFilters.([]interface{})
347+
tmp := make([]string, len(interfaces))
348+
for i := range interfaces {
349+
if interfaces[i] != nil {
350+
tmp[i] = interfaces[i].(string)
351+
}
352+
}
353+
if len(tmp) != 0 || s.D.HasChange("tag_filters") {
354+
request.TagFilters = tmp
355+
}
356+
}
357+
320358
request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi")
321359

322360
response, err := s.Client.CreateNewsReport(context.Background(), request)
@@ -513,6 +551,10 @@ func (s *OpsiNewsReportResourceCrud) Update() error {
513551
request.Locale = oci_opsi.NewsLocaleEnum(locale.(string))
514552
}
515553

554+
if matchRule, ok := s.D.GetOkExists("match_rule"); ok {
555+
request.MatchRule = oci_opsi.MatchRuleEnum(matchRule.(string))
556+
}
557+
516558
if name, ok := s.D.GetOkExists("name"); ok {
517559
tmp := name.(string)
518560
request.Name = &tmp
@@ -534,6 +576,19 @@ func (s *OpsiNewsReportResourceCrud) Update() error {
534576
request.Status = oci_opsi.ResourceStatusEnum(status.(string))
535577
}
536578

579+
if tagFilters, ok := s.D.GetOkExists("tag_filters"); ok {
580+
interfaces := tagFilters.([]interface{})
581+
tmp := make([]string, len(interfaces))
582+
for i := range interfaces {
583+
if interfaces[i] != nil {
584+
tmp[i] = interfaces[i].(string)
585+
}
586+
}
587+
if len(tmp) != 0 || s.D.HasChange("tag_filters") {
588+
request.TagFilters = tmp
589+
}
590+
}
591+
537592
request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi")
538593

539594
response, err := s.Client.UpdateNewsReport(context.Background(), request)
@@ -598,6 +653,8 @@ func (s *OpsiNewsReportResourceCrud) SetData() error {
598653

599654
s.D.Set("locale", s.Res.Locale)
600655

656+
s.D.Set("match_rule", s.Res.MatchRule)
657+
601658
if s.Res.Name != nil {
602659
s.D.Set("name", *s.Res.Name)
603660
}
@@ -616,6 +673,8 @@ func (s *OpsiNewsReportResourceCrud) SetData() error {
616673
s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags))
617674
}
618675

676+
s.D.Set("tag_filters", s.Res.TagFilters)
677+
619678
if s.Res.TimeCreated != nil {
620679
s.D.Set("time_created", s.Res.TimeCreated.String())
621680
}
@@ -630,6 +689,19 @@ func (s *OpsiNewsReportResourceCrud) SetData() error {
630689
func (s *OpsiNewsReportResourceCrud) mapToNewsContentTypes(fieldKeyFormat string) (oci_opsi.NewsContentTypes, error) {
631690
result := oci_opsi.NewsContentTypes{}
632691

692+
if actionableInsightsResources, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "actionable_insights_resources")); ok {
693+
interfaces := actionableInsightsResources.([]interface{})
694+
tmp := make([]oci_opsi.ActionableInsightsContentTypesResourceEnum, len(interfaces))
695+
for i := range interfaces {
696+
if interfaces[i] != nil {
697+
tmp[i] = oci_opsi.ActionableInsightsContentTypesResourceEnum(interfaces[i].(string))
698+
}
699+
}
700+
if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "actionable_insights_resources")) {
701+
result.ActionableInsightsResources = tmp
702+
}
703+
}
704+
633705
if capacityPlanningResources, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "capacity_planning_resources")); ok {
634706
strArray := capacityPlanningResources.([]interface{})
635707
tmp := make([]oci_opsi.NewsContentTypesResourceEnum, len(strArray))
@@ -779,14 +851,22 @@ func NewsContentTypesToMap(obj *oci_opsi.NewsContentTypes) map[string]interface{
779851
}
780852
result["sql_insights_top_sql_by_insights_resources"] = sqlInsightsTopSqlByInsightsResources
781853
return result
782-
} else {
854+
} else if obj.SqlInsightsTopSqlResources != nil && len(obj.SqlInsightsTopSqlResources) != 0 {
783855
sqlInsightsTopSqlResources := []interface{}{}
784856

785857
for _, item := range obj.SqlInsightsTopSqlResources {
786858
sqlInsightsTopSqlResources = append(sqlInsightsTopSqlResources, NewsSqlInsightsContentTypesResourceToMap(item))
787859
}
788860
result["sql_insights_top_sql_resources"] = sqlInsightsTopSqlResources
789861
return result
862+
} else {
863+
actionableInsightsResources := []interface{}{}
864+
865+
for _, item := range obj.ActionableInsightsResources {
866+
actionableInsightsResources = append(actionableInsightsResources, NewsActionableInsightsContentTypesResourceToMap(item))
867+
}
868+
result["actionable_insights_resources"] = obj.ActionableInsightsResources
869+
return result
790870
}
791871
}
792872

@@ -820,6 +900,96 @@ func NewsSqlInsightsContentTypesResourceToMap(obj oci_opsi.NewsSqlInsightsConten
820900
return result
821901
}
822902

903+
func NewsActionableInsightsContentTypesResourceToMap(obj oci_opsi.ActionableInsightsContentTypesResourceEnum) string {
904+
var result string
905+
906+
switch obj {
907+
case oci_opsi.ActionableInsightsContentTypesResourceNewHighs:
908+
result = "NEW_HIGHS"
909+
case oci_opsi.ActionableInsightsContentTypesResourceBigChanges:
910+
result = "BIG_CHANGES"
911+
case oci_opsi.ActionableInsightsContentTypesResourceCurrentInventory:
912+
result = "CURRENT_INVENTORY"
913+
case oci_opsi.ActionableInsightsContentTypesResourceInventoryChanges:
914+
result = "INVENTORY_CHANGES"
915+
case oci_opsi.ActionableInsightsContentTypesResourceFleetStatistics:
916+
result = "FLEET_STATISTICS"
917+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisSummaryDbCount:
918+
result = "FLEET_ANALYSIS_SUMMARY_DB_COUNT"
919+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisSummarySqlAnalyzedCount:
920+
result = "FLEET_ANALYSIS_SUMMARY_SQL_ANALYZED_COUNT"
921+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisSummaryNewSqlCount:
922+
result = "FLEET_ANALYSIS_SUMMARY_NEW_SQL_COUNT"
923+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisSummaryBusiestDb:
924+
result = "FLEET_ANALYSIS_SUMMARY_BUSIEST_DB"
925+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisDegradingSqlCount:
926+
result = "FLEET_ANALYSIS_DEGRADING_SQL_COUNT"
927+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisDegradingSqlByDb:
928+
result = "FLEET_ANALYSIS_DEGRADING_SQL_BY_DB"
929+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisDegradingSqlBySqlId:
930+
result = "FLEET_ANALYSIS_DEGRADING_SQL_BY_SQL_ID"
931+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisPlanChangesCount:
932+
result = "FLEET_ANALYSIS_PLAN_CHANGES_COUNT"
933+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisPlanChangesDbMostChanges:
934+
result = "FLEET_ANALYSIS_PLAN_CHANGES_DB_MOST_CHANGES"
935+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisPlanChangesBySqlIdImproved:
936+
result = "FLEET_ANALYSIS_PLAN_CHANGES_BY_SQL_ID_IMPROVED"
937+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisPlanChangesBySqlIdDegraded:
938+
result = "FLEET_ANALYSIS_PLAN_CHANGES_BY_SQL_ID_DEGRADED"
939+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisInvalidationStormsCount:
940+
result = "FLEET_ANALYSIS_INVALIDATION_STORMS_COUNT"
941+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisInvalidationStormsHighest:
942+
result = "FLEET_ANALYSIS_INVALIDATION_STORMS_HIGHEST"
943+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisCursorSharingIssuesCount:
944+
result = "FLEET_ANALYSIS_CURSOR_SHARING_ISSUES_COUNT"
945+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisCursorSharingIssuesByDb:
946+
result = "FLEET_ANALYSIS_CURSOR_SHARING_ISSUES_BY_DB"
947+
case oci_opsi.ActionableInsightsContentTypesResourceFleetAnalysisCursorSharingIssuesBySql:
948+
result = "FLEET_ANALYSIS_CURSOR_SHARING_ISSUES_BY_SQL"
949+
case oci_opsi.ActionableInsightsContentTypesResourcePerformanceDegradationSummaryDbCount:
950+
result = "PERFORMANCE_DEGRADATION_SUMMARY_DB_COUNT"
951+
case oci_opsi.ActionableInsightsContentTypesResourcePerformanceDegradationSummarySqlAnalyzedCount:
952+
result = "PERFORMANCE_DEGRADATION_SUMMARY_SQL_ANALYZED_COUNT"
953+
case oci_opsi.ActionableInsightsContentTypesResourcePerformanceDegradationSummarySqlPerformanceTrendsCount:
954+
result = "PERFORMANCE_DEGRADATION_SUMMARY_SQL_PERFORMANCE_TRENDS_COUNT"
955+
case oci_opsi.ActionableInsightsContentTypesResourcePerformanceDegradationSummaryDegradedSqlCount:
956+
result = "PERFORMANCE_DEGRADATION_SUMMARY_DEGRADED_SQL_COUNT"
957+
case oci_opsi.ActionableInsightsContentTypesResourcePerformanceDegradationSummaryImprovedSqlCount:
958+
result = "PERFORMANCE_DEGRADATION_SUMMARY_IMPROVED_SQL_COUNT"
959+
case oci_opsi.ActionableInsightsContentTypesResourcePerformanceDegradationDbDegradedCount:
960+
result = "PERFORMANCE_DEGRADATION_DB_DEGRADED_COUNT"
961+
case oci_opsi.ActionableInsightsContentTypesResourcePerformanceDegradationSqlDegradedTable:
962+
result = "PERFORMANCE_DEGRADATION_SQL_DEGRADED_TABLE"
963+
case oci_opsi.ActionableInsightsContentTypesResourcePlanChangesSummaryDbCount:
964+
result = "PLAN_CHANGES_SUMMARY_DB_COUNT"
965+
case oci_opsi.ActionableInsightsContentTypesResourcePlanChangesSummarySqlAnalyzedCount:
966+
result = "PLAN_CHANGES_SUMMARY_SQL_ANALYZED_COUNT"
967+
case oci_opsi.ActionableInsightsContentTypesResourcePlanChangesSummaryPlanChangesCount:
968+
result = "PLAN_CHANGES_SUMMARY_PLAN_CHANGES_COUNT"
969+
case oci_opsi.ActionableInsightsContentTypesResourcePlanChangesSummaryImprovementsCount:
970+
result = "PLAN_CHANGES_SUMMARY_IMPROVEMENTS_COUNT"
971+
case oci_opsi.ActionableInsightsContentTypesResourcePlanChangesSummaryDegradationCount:
972+
result = "PLAN_CHANGES_SUMMARY_DEGRADATION_COUNT"
973+
case oci_opsi.ActionableInsightsContentTypesResourcePlanChangesTopPlanChangesTable:
974+
result = "PLAN_CHANGES_TOP_PLAN_CHANGES_TABLE"
975+
case oci_opsi.ActionableInsightsContentTypesResourceTopDbSummaryDbCount:
976+
result = "TOP_DB_SUMMARY_DB_COUNT"
977+
case oci_opsi.ActionableInsightsContentTypesResourceTopDbSummarySqlAnalyzedCount:
978+
result = "TOP_DB_SUMMARY_SQL_ANALYZED_COUNT"
979+
case oci_opsi.ActionableInsightsContentTypesResourceTopDbSummaryBusiestDb:
980+
result = "TOP_DB_SUMMARY_BUSIEST_DB"
981+
case oci_opsi.ActionableInsightsContentTypesResourceTopTable:
982+
result = "TOP_TABLE"
983+
case oci_opsi.ActionableInsightsContentTypesResourceCollectionDelayCount:
984+
result = "COLLECTION_DELAY_COUNT"
985+
case oci_opsi.ActionableInsightsContentTypesResourceCollectionDelayPreviousWeekCount:
986+
result = "COLLECTION_DELAY_PREVIOUS_WEEK_COUNT"
987+
default:
988+
fmt.Println("ERROR, Nota a valid resource")
989+
}
990+
return result
991+
}
992+
823993
func NewsReportSummaryToMap(obj oci_opsi.NewsReportSummary) map[string]interface{} {
824994
result := map[string]interface{}{}
825995

@@ -857,6 +1027,8 @@ func NewsReportSummaryToMap(obj oci_opsi.NewsReportSummary) map[string]interface
8571027

8581028
result["locale"] = string(obj.Locale)
8591029

1030+
result["match_rule"] = string(obj.MatchRule)
1031+
8601032
if obj.Name != nil {
8611033
result["name"] = string(*obj.Name)
8621034
}
@@ -875,6 +1047,8 @@ func NewsReportSummaryToMap(obj oci_opsi.NewsReportSummary) map[string]interface
8751047
result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags)
8761048
}
8771049

1050+
result["tag_filters"] = obj.TagFilters
1051+
8781052
if obj.TimeCreated != nil {
8791053
result["time_created"] = obj.TimeCreated.String()
8801054
}

0 commit comments

Comments
 (0)