Skip to content

Commit 542e23f

Browse files
committed
feat: update generated APIs
1 parent 44f4a1d commit 542e23f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

api/webhosting/v1/webhosting_sdk.go

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,21 @@ type HostingAPIListHostingsRequest struct {
23172317
Subdomain *string `json:"-"`
23182318
}
23192319

2320+
// HostingAPIMigrateControlPanelRequest: hosting api migrate control panel request.
2321+
type HostingAPIMigrateControlPanelRequest struct {
2322+
// Region: region to target. If none is passed will use default region from the config.
2323+
Region scw.Region `json:"-"`
2324+
2325+
// HostingID: hosting ID to migrate to a new control panel.
2326+
HostingID string `json:"-"`
2327+
2328+
// ControlPanelName: control panel will migrate the hosting to a new server.
2329+
ControlPanelName string `json:"control_panel_name"`
2330+
2331+
// OfferID: migration.
2332+
OfferID string `json:"offer_id"`
2333+
}
2334+
23202335
// HostingAPIRemoveCustomDomainRequest: hosting api remove custom domain request.
23212336
type HostingAPIRemoveCustomDomainRequest struct {
23222337
// Region: region to target. If none is passed will use default region from the config.
@@ -4409,6 +4424,42 @@ func (s *HostingAPI) RemoveCustomDomain(req *HostingAPIRemoveCustomDomainRequest
44094424
return &resp, nil
44104425
}
44114426

4427+
// MigrateControlPanel: Migrate a hosting to a new control panel.
4428+
func (s *HostingAPI) MigrateControlPanel(req *HostingAPIMigrateControlPanelRequest, opts ...scw.RequestOption) (*HostingSummary, error) {
4429+
var err error
4430+
4431+
if req.Region == "" {
4432+
defaultRegion, _ := s.client.GetDefaultRegion()
4433+
req.Region = defaultRegion
4434+
}
4435+
4436+
if fmt.Sprint(req.Region) == "" {
4437+
return nil, errors.New("field Region cannot be empty in request")
4438+
}
4439+
4440+
if fmt.Sprint(req.HostingID) == "" {
4441+
return nil, errors.New("field HostingID cannot be empty in request")
4442+
}
4443+
4444+
scwReq := &scw.ScalewayRequest{
4445+
Method: "POST",
4446+
Path: "/webhosting/v1/regions/" + fmt.Sprint(req.Region) + "/hostings/" + fmt.Sprint(req.HostingID) + "/migrate-control-panel",
4447+
}
4448+
4449+
err = scwReq.SetBody(req)
4450+
if err != nil {
4451+
return nil, err
4452+
}
4453+
4454+
var resp HostingSummary
4455+
4456+
err = s.client.Do(scwReq, &resp, opts...)
4457+
if err != nil {
4458+
return nil, err
4459+
}
4460+
return &resp, nil
4461+
}
4462+
44124463
// This API allows you to list and check a free domain's validity.
44134464
type FreeDomainAPI struct {
44144465
client *scw.Client

0 commit comments

Comments
 (0)