Skip to content

Commit

Permalink
Remove fourpointoh flag from service/apimanagement
Browse files Browse the repository at this point in the history
  • Loading branch information
sreallymatt committed Dec 18, 2024
1 parent 4a6054e commit ad9be62
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions internal/services/apimanagement/api_management_api_tag_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/apimanagement/2022-08-01/tag"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
)
Expand Down Expand Up @@ -69,11 +68,6 @@ func resourceApiManagementApiTagCreate(d *pluginsdk.ResourceData, meta interface

id := apitag.NewApiTagID(subscriptionId, apiId.ResourceGroupName, apiId.ServiceName, apiId.ApiId, d.Get("name").(string))

if !features.FourPointOh() {
apiName := getApiName(apiId.ApiId)
id = apitag.NewApiTagID(subscriptionId, apiId.ResourceGroupName, apiId.ServiceName, apiName, d.Get("name").(string))
}

tagExists, err := tagClient.Get(ctx, tagId)
if err != nil {
if !response.WasNotFound(tagExists.HttpResponse) {
Expand Down Expand Up @@ -115,12 +109,6 @@ func resourceApiManagementApiTagRead(d *pluginsdk.ResourceData, meta interface{}
apiId := api.NewApiID(subscriptionId, id.ResourceGroupName, id.ServiceName, id.ApiId)
tagId := apitag.NewApiTagID(subscriptionId, id.ResourceGroupName, id.ServiceName, id.ApiId, id.TagId)

if !features.FourPointOh() {
apiName := getApiName(id.ApiId)
apiId = api.NewApiID(subscriptionId, id.ResourceGroupName, id.ServiceName, apiName)
tagId = apitag.NewApiTagID(subscriptionId, id.ResourceGroupName, id.ServiceName, apiName, id.TagId)
}

resp, err := client.TagGetByApi(ctx, tagId)
if err != nil {
if response.WasNotFound(resp.HttpResponse) {
Expand Down Expand Up @@ -150,11 +138,6 @@ func resourceApiManagementApiTagDelete(d *pluginsdk.ResourceData, meta interface

newId := apitag.NewApiTagID(id.SubscriptionId, id.ResourceGroupName, id.ServiceName, id.ApiId, id.TagId)

if !features.FourPointOh() {
name := getApiName(id.ApiId)
newId = apitag.NewApiTagID(id.SubscriptionId, id.ResourceGroupName, id.ServiceName, name, id.TagId)
}

if _, err = client.TagDetachFromApi(ctx, newId); err != nil {
return fmt.Errorf("detaching api tag %q: %+v", newId, err)
}
Expand Down

0 comments on commit ad9be62

Please sign in to comment.