From 099e8d0ba31a29c137bae08259b2b136e4a54c01 Mon Sep 17 00:00:00 2001 From: Wyatt Fry Date: Fri, 17 Jan 2025 13:54:11 -0500 Subject: [PATCH] wip --- .../servicebus_queue_data_source.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/internal/services/servicebus/servicebus_queue_data_source.go b/internal/services/servicebus/servicebus_queue_data_source.go index 9f06220fd277..6328afb87f0d 100644 --- a/internal/services/servicebus/servicebus_queue_data_source.go +++ b/internal/services/servicebus/servicebus_queue_data_source.go @@ -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" @@ -18,7 +19,7 @@ import ( ) func dataSourceServiceBusQueue() *pluginsdk.Resource { - return &pluginsdk.Resource{ + resource := &pluginsdk.Resource{ Read: dataSourceServiceBusQueueRead, Timeouts: &pluginsdk.ResourceTimeout{ @@ -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{ + 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 {