From 80d4261bddc8218be109ee72fb01623860daeb31 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 12 Dec 2025 11:46:10 +0000 Subject: [PATCH] feat: update generated APIs --- .../scaleway_async/webhosting/v1/__init__.py | 2 + .../scaleway_async/webhosting/v1/api.py | 50 +++++++++++++++++++ .../webhosting/v1/marshalling.py | 16 ++++++ .../scaleway_async/webhosting/v1/types.py | 23 +++++++++ scaleway/scaleway/webhosting/v1/__init__.py | 2 + scaleway/scaleway/webhosting/v1/api.py | 50 +++++++++++++++++++ .../scaleway/webhosting/v1/marshalling.py | 16 ++++++ scaleway/scaleway/webhosting/v1/types.py | 23 +++++++++ 8 files changed, 182 insertions(+) diff --git a/scaleway-async/scaleway_async/webhosting/v1/__init__.py b/scaleway-async/scaleway_async/webhosting/v1/__init__.py index 0f38f25e0..ec0d64e0c 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/__init__.py +++ b/scaleway-async/scaleway_async/webhosting/v1/__init__.py @@ -100,6 +100,7 @@ from .types import HostingApiGetHostingRequest from .types import HostingApiGetResourceSummaryRequest from .types import HostingApiListHostingsRequest +from .types import HostingApiMigrateControlPanelRequest from .types import HostingApiRemoveCustomDomainRequest from .types import HostingApiResetHostingPasswordRequest from .types import HostingApiUpdateHostingRequest @@ -242,6 +243,7 @@ "HostingApiGetHostingRequest", "HostingApiGetResourceSummaryRequest", "HostingApiListHostingsRequest", + "HostingApiMigrateControlPanelRequest", "HostingApiRemoveCustomDomainRequest", "HostingApiResetHostingPasswordRequest", "HostingApiUpdateHostingRequest", diff --git a/scaleway-async/scaleway_async/webhosting/v1/api.py b/scaleway-async/scaleway_async/webhosting/v1/api.py index 899e2a8f0..de8d0a547 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/api.py +++ b/scaleway-async/scaleway_async/webhosting/v1/api.py @@ -49,6 +49,7 @@ Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, + HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, HostingSummary, @@ -131,6 +132,7 @@ marshal_FtpAccountApiCreateFtpAccountRequest, marshal_HostingApiAddCustomDomainRequest, marshal_HostingApiCreateHostingRequest, + marshal_HostingApiMigrateControlPanelRequest, marshal_HostingApiRemoveCustomDomainRequest, marshal_HostingApiUpdateHostingRequest, marshal_MailAccountApiChangeMailAccountPasswordRequest, @@ -2032,6 +2034,54 @@ async def remove_custom_domain( self._throw_on_error(res) return unmarshal_HostingSummary(res.json()) + async def migrate_control_panel( + self, + *, + hosting_id: str, + control_panel_name: str, + offer_id: str, + region: Optional[ScwRegion] = None, + ) -> HostingSummary: + """ + Migrate a hosting to a new control panel. + :param hosting_id: Hosting ID to migrate to a new control panel. + :param control_panel_name: Control panel will migrate the hosting to a new server. + :param offer_id: Migration. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`HostingSummary ` + + Usage: + :: + + result = await api.migrate_control_panel( + hosting_id="example", + control_panel_name="example", + offer_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_hosting_id = validate_path_param("hosting_id", hosting_id) + + res = self._request( + "POST", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/migrate-control-panel", + body=marshal_HostingApiMigrateControlPanelRequest( + HostingApiMigrateControlPanelRequest( + hosting_id=hosting_id, + control_panel_name=control_panel_name, + offer_id=offer_id, + region=region, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_HostingSummary(res.json()) + class WebhostingV1FreeDomainAPI(API): """ diff --git a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py index 9f41fed49..e7c2b50f3 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py +++ b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py @@ -96,6 +96,7 @@ CreateHostingRequestDomainConfiguration, OfferOptionRequest, HostingApiCreateHostingRequest, + HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, MailAccountApiChangeMailAccountPasswordRequest, @@ -2074,6 +2075,21 @@ def marshal_HostingApiCreateHostingRequest( return output +def marshal_HostingApiMigrateControlPanelRequest( + request: HostingApiMigrateControlPanelRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.control_panel_name is not None: + output["control_panel_name"] = request.control_panel_name + + if request.offer_id is not None: + output["offer_id"] = request.offer_id + + return output + + def marshal_HostingApiRemoveCustomDomainRequest( request: HostingApiRemoveCustomDomainRequest, defaults: ProfileDefaults, diff --git a/scaleway-async/scaleway_async/webhosting/v1/types.py b/scaleway-async/scaleway_async/webhosting/v1/types.py index 279320da0..180a53486 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/types.py +++ b/scaleway-async/scaleway_async/webhosting/v1/types.py @@ -1957,6 +1957,29 @@ class HostingApiListHostingsRequest: """ +@dataclass +class HostingApiMigrateControlPanelRequest: + hosting_id: str + """ + Hosting ID to migrate to a new control panel. + """ + + control_panel_name: str + """ + Control panel will migrate the hosting to a new server. + """ + + offer_id: str + """ + Migration. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class HostingApiRemoveCustomDomainRequest: hosting_id: str diff --git a/scaleway/scaleway/webhosting/v1/__init__.py b/scaleway/scaleway/webhosting/v1/__init__.py index 0f38f25e0..ec0d64e0c 100644 --- a/scaleway/scaleway/webhosting/v1/__init__.py +++ b/scaleway/scaleway/webhosting/v1/__init__.py @@ -100,6 +100,7 @@ from .types import HostingApiGetHostingRequest from .types import HostingApiGetResourceSummaryRequest from .types import HostingApiListHostingsRequest +from .types import HostingApiMigrateControlPanelRequest from .types import HostingApiRemoveCustomDomainRequest from .types import HostingApiResetHostingPasswordRequest from .types import HostingApiUpdateHostingRequest @@ -242,6 +243,7 @@ "HostingApiGetHostingRequest", "HostingApiGetResourceSummaryRequest", "HostingApiListHostingsRequest", + "HostingApiMigrateControlPanelRequest", "HostingApiRemoveCustomDomainRequest", "HostingApiResetHostingPasswordRequest", "HostingApiUpdateHostingRequest", diff --git a/scaleway/scaleway/webhosting/v1/api.py b/scaleway/scaleway/webhosting/v1/api.py index 815e17446..162346688 100644 --- a/scaleway/scaleway/webhosting/v1/api.py +++ b/scaleway/scaleway/webhosting/v1/api.py @@ -49,6 +49,7 @@ Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, + HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, HostingSummary, @@ -131,6 +132,7 @@ marshal_FtpAccountApiCreateFtpAccountRequest, marshal_HostingApiAddCustomDomainRequest, marshal_HostingApiCreateHostingRequest, + marshal_HostingApiMigrateControlPanelRequest, marshal_HostingApiRemoveCustomDomainRequest, marshal_HostingApiUpdateHostingRequest, marshal_MailAccountApiChangeMailAccountPasswordRequest, @@ -2032,6 +2034,54 @@ def remove_custom_domain( self._throw_on_error(res) return unmarshal_HostingSummary(res.json()) + def migrate_control_panel( + self, + *, + hosting_id: str, + control_panel_name: str, + offer_id: str, + region: Optional[ScwRegion] = None, + ) -> HostingSummary: + """ + Migrate a hosting to a new control panel. + :param hosting_id: Hosting ID to migrate to a new control panel. + :param control_panel_name: Control panel will migrate the hosting to a new server. + :param offer_id: Migration. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`HostingSummary ` + + Usage: + :: + + result = api.migrate_control_panel( + hosting_id="example", + control_panel_name="example", + offer_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_hosting_id = validate_path_param("hosting_id", hosting_id) + + res = self._request( + "POST", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/migrate-control-panel", + body=marshal_HostingApiMigrateControlPanelRequest( + HostingApiMigrateControlPanelRequest( + hosting_id=hosting_id, + control_panel_name=control_panel_name, + offer_id=offer_id, + region=region, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_HostingSummary(res.json()) + class WebhostingV1FreeDomainAPI(API): """ diff --git a/scaleway/scaleway/webhosting/v1/marshalling.py b/scaleway/scaleway/webhosting/v1/marshalling.py index 9f41fed49..e7c2b50f3 100644 --- a/scaleway/scaleway/webhosting/v1/marshalling.py +++ b/scaleway/scaleway/webhosting/v1/marshalling.py @@ -96,6 +96,7 @@ CreateHostingRequestDomainConfiguration, OfferOptionRequest, HostingApiCreateHostingRequest, + HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, MailAccountApiChangeMailAccountPasswordRequest, @@ -2074,6 +2075,21 @@ def marshal_HostingApiCreateHostingRequest( return output +def marshal_HostingApiMigrateControlPanelRequest( + request: HostingApiMigrateControlPanelRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.control_panel_name is not None: + output["control_panel_name"] = request.control_panel_name + + if request.offer_id is not None: + output["offer_id"] = request.offer_id + + return output + + def marshal_HostingApiRemoveCustomDomainRequest( request: HostingApiRemoveCustomDomainRequest, defaults: ProfileDefaults, diff --git a/scaleway/scaleway/webhosting/v1/types.py b/scaleway/scaleway/webhosting/v1/types.py index 279320da0..180a53486 100644 --- a/scaleway/scaleway/webhosting/v1/types.py +++ b/scaleway/scaleway/webhosting/v1/types.py @@ -1957,6 +1957,29 @@ class HostingApiListHostingsRequest: """ +@dataclass +class HostingApiMigrateControlPanelRequest: + hosting_id: str + """ + Hosting ID to migrate to a new control panel. + """ + + control_panel_name: str + """ + Control panel will migrate the hosting to a new server. + """ + + offer_id: str + """ + Migration. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class HostingApiRemoveCustomDomainRequest: hosting_id: str