@@ -3,20 +3,20 @@ package sweepers
33import (
44 "fmt"
55
6- webhostingSDK "github.com/scaleway/scaleway-sdk-go/api/webhosting/v1alpha1 "
6+ webhostingSDK "github.com/scaleway/scaleway-sdk-go/api/webhosting/v1 "
77 "github.com/scaleway/scaleway-sdk-go/scw"
88)
99
1010func SweepWebHosting (scwClient * scw.Client , region scw.Region ) error {
11- webHostingAPI := webhostingSDK .NewAPI (scwClient )
11+ webHostingAPI := webhostingSDK .NewHostingAPI (scwClient )
1212
13- listHostings , err := webHostingAPI .ListHostings (& webhostingSDK.ListHostingsRequest {Region : region }, scw .WithAllPages ())
13+ listHostings , err := webHostingAPI .ListHostings (& webhostingSDK.HostingAPIListHostingsRequest {Region : region }, scw .WithAllPages ())
1414 if err != nil {
1515 return fmt .Errorf ("error listing hostings in (%s) in sweeper: %s" , region , err )
1616 }
1717
1818 for _ , hosting := range listHostings .Hostings {
19- _ , err := webHostingAPI .DeleteHosting (& webhostingSDK.DeleteHostingRequest {
19+ _ , err := webHostingAPI .DeleteHosting (& webhostingSDK.HostingAPIDeleteHostingRequest {
2020 HostingID : hosting .ID ,
2121 Region : region ,
2222 })
@@ -29,7 +29,7 @@ func SweepWebHosting(scwClient *scw.Client, region scw.Region) error {
2929}
3030
3131func SweepAllLocalities (scwClient * scw.Client ) error {
32- for _ , region := range (& webhostingSDK.API {}).Regions () {
32+ for _ , region := range (& webhostingSDK.HostingAPI {}).Regions () {
3333 err := SweepWebHosting (scwClient , region )
3434 if err != nil {
3535 return err
0 commit comments