@@ -21,8 +21,9 @@ import (
2121 "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
2222 "github.com/hashicorp/terraform-plugin-testing/helper/resource"
2323 "github.com/hashicorp/terraform-plugin-testing/terraform"
24- "github.com/stackitcloud/stackit-sdk-go/services/cdn"
25- "github.com/stackitcloud/stackit-sdk-go/services/cdn/wait"
24+ cdnSdk "github.com/stackitcloud/stackit-sdk-go/services/cdn/v1api"
25+ "github.com/stackitcloud/stackit-sdk-go/services/cdn/v1api/wait"
26+
2627 "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/core"
2728 "github.com/stackitcloud/terraform-provider-stackit/stackit/internal/testutil"
2829)
@@ -463,7 +464,7 @@ func TestAccCDNDistributionBucket(t *testing.T) {
463464
464465func testAccCheckCDNDistributionDestroy (s * terraform.State ) error {
465466 ctx := context .Background ()
466- client , err := cdn .NewAPIClient (testutil .NewConfigBuilder ().BuildClientOptions (testutil .CdnCustomEndpoint , false )... )
467+ client , err := cdnSdk .NewAPIClient (testutil .NewConfigBuilder ().BuildClientOptions (testutil .CdnCustomEndpoint , false )... )
467468 if err != nil {
468469 return fmt .Errorf ("creating client: %w" , err )
469470 }
@@ -478,11 +479,11 @@ func testAccCheckCDNDistributionDestroy(s *terraform.State) error {
478479 }
479480
480481 for _ , dist := range distributionsToDestroy {
481- _ , err := client .DeleteDistribution (ctx , testutil .ProjectId , dist ).Execute ()
482+ _ , err := client .DefaultAPI . DeleteDistribution (ctx , testutil .ProjectId , dist ).Execute ()
482483 if err != nil {
483484 return fmt .Errorf ("destroying CDN distribution %s during CheckDestroy: %w" , dist , err )
484485 }
485- _ , err = wait .DeleteDistributionWaitHandler (ctx , client , testutil .ProjectId , dist ).WaitWithContext (ctx )
486+ _ , err = wait .DeleteDistributionWaitHandler (ctx , client . DefaultAPI , testutil .ProjectId , dist ).WaitWithContext (ctx )
486487 if err != nil {
487488 return fmt .Errorf ("destroying CDN distribution %s during CheckDestroy: waiting for deletion %w" , dist , err )
488489 }
0 commit comments