Skip to content

Commit

Permalink
SUMO-227092: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyttthan99 committed Mar 4, 2024
1 parent 0260f0a commit 09cf2e3
Showing 1 changed file with 10 additions and 30 deletions.
40 changes: 10 additions & 30 deletions sumologic/resource_sumologic_generic_polling_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,6 @@ func resourceToGenericPollingSource(d *schema.ResourceData) (PollingSource, erro
URL: d.Get("url").(string),
}

// if d.Get("paused") != nil {
// pollingSource.Paus = d.Get("scan_interval").(int)
// }
// if d.Get("scan_interval") != nil {
// pollingSource.ScanInterval = d.Get("scan_interval").(int)
// }

// if d.Get("scan_interval") != 0 {
// pollingSource.ScanInterval = d.Get("scan_interval").(int)
// }
if source.ContentType == "AzureEventHubLog" {
pollingSource.ScanInterval = 300000
}
Expand Down Expand Up @@ -384,32 +374,22 @@ func getPollingThirdPartyPathAttributes(pollingResource []PollingResource) []map

for _, t := range pollingResource {
mapping := map[string]interface{}{
"type": t.Path.Type,
"bucket_name": t.Path.BucketName,
"path_expression": t.Path.PathExpression,
// "limit_to_regions": t.Path.LimitToRegions,
// "limit_to_namespaces": t.Path.LimitToNamespaces,
// "limit_to_services": t.Path.LimitToServices,
"use_versioned_api": t.Path.UseVersionedApi,
"custom_services": flattenCustomServices(t.Path.CustomServices),
"tag_filters": flattenPollingTagFilters(t.Path.TagFilters),
//"sns_topic_or_subscription_arn": flattenPollingSnsTopicOrSubscriptionArn(t.Path.SnsTopicOrSubscriptionArn),
"type": t.Path.Type,
"bucket_name": t.Path.BucketName,
"path_expression": t.Path.PathExpression,
"limit_to_regions": t.Path.LimitToRegions,
"limit_to_namespaces": t.Path.LimitToNamespaces,
"limit_to_services": t.Path.LimitToServices,
"use_versioned_api": t.Path.UseVersionedApi,
"custom_services": flattenCustomServices(t.Path.CustomServices),
"tag_filters": flattenPollingTagFilters(t.Path.TagFilters),
// "sns_topic_or_subscription_arn": flattenPollingSnsTopicOrSubscriptionArn(t.Path.SnsTopicOrSubscriptionArn),
"namespace": t.Path.Namespace,
"event_hub_name": t.Path.EventHubName,
"consumer_group": t.Path.ConsumerGroup,
"region": t.Path.Region,
}

if t.Path.LimitToRegions != nil {
mapping["limit_to_regions"] = t.Path.LimitToRegions
}
if t.Path.LimitToNamespaces != nil {
mapping["limit_to_namespaces"] = t.Path.LimitToNamespaces
}
if t.Path.LimitToServices != nil {
mapping["limit_to_services"] = t.Path.LimitToServices
}

if t.Path.SnsTopicOrSubscriptionArn != nil {
mapping["sns_topic_or_subscription_arn"] = flattenPollingSnsTopicOrSubscriptionArn(t.Path.SnsTopicOrSubscriptionArn)
}
Expand Down

0 comments on commit 09cf2e3

Please sign in to comment.