@@ -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 {
630689func (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+
823993func 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