Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattfry committed Jan 17, 2025
1 parent 73a996b commit 099e8d0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion internal/services/servicebus/servicebus_queue_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package servicebus

import (
"fmt"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"time"

"github.com/hashicorp/go-azure-helpers/lang/pointer"
Expand All @@ -18,7 +19,7 @@ import (
)

func dataSourceServiceBusQueue() *pluginsdk.Resource {
return &pluginsdk.Resource{
resource := &pluginsdk.Resource{
Read: dataSourceServiceBusQueueRead,

Timeouts: &pluginsdk.ResourceTimeout{
Expand Down Expand Up @@ -114,6 +115,22 @@ func dataSourceServiceBusQueue() *pluginsdk.Resource {
},
},
}

if !features.FivePointOh() {
for _, name := range []string{"batched_operations", "express", "partitioning"} {
oldName := fmt.Sprintf("enable_%s", name)
newName := fmt.Sprintf("%s_enabled", name)
resource.Schema[oldName] = &pluginsdk.Schema{

Check failure on line 123 in internal/services/servicebus/servicebus_queue_data_source.go

View workflow job for this annotation

GitHub Actions / tflint

S026: schema should not only enable Computed and configure ConflictsWith
Deprecated: fmt.Sprintf("this property has been deprecated in favour of `%s`", newName),
Type: pluginsdk.TypeBool,
Computed: true,
ConflictsWith: []string{newName},
}
resource.Schema[newName].ConflictsWith = []string{oldName}
}
}

return resource
}

func dataSourceServiceBusQueueRead(d *pluginsdk.ResourceData, meta interface{}) error {
Expand Down

0 comments on commit 099e8d0

Please sign in to comment.