From 31aaeeea155ffad78449bcb6a40c83bee6869ab6 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 12 Feb 2026 15:30:01 +0000 Subject: [PATCH] feat: update generated APIs --- .../scaleway_async/webhosting/v1/__init__.py | 6 + .../scaleway_async/webhosting/v1/api.py | 128 ++++++++++++++++++ .../webhosting/v1/marshalling.py | 26 ++++ .../scaleway_async/webhosting/v1/types.py | 49 +++++++ scaleway/scaleway/webhosting/v1/__init__.py | 6 + scaleway/scaleway/webhosting/v1/api.py | 128 ++++++++++++++++++ .../scaleway/webhosting/v1/marshalling.py | 26 ++++ scaleway/scaleway/webhosting/v1/types.py | 49 +++++++ 8 files changed, 418 insertions(+) diff --git a/scaleway-async/scaleway_async/webhosting/v1/__init__.py b/scaleway-async/scaleway_async/webhosting/v1/__init__.py index ec0d64e0c..c71c26a66 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/__init__.py +++ b/scaleway-async/scaleway_async/webhosting/v1/__init__.py @@ -96,6 +96,7 @@ from .types import HostingApiAddCustomDomainRequest from .types import HostingApiCreateHostingRequest from .types import HostingApiCreateSessionRequest +from .types import HostingApiDeleteHostingDomainsRequest from .types import HostingApiDeleteHostingRequest from .types import HostingApiGetHostingRequest from .types import HostingApiGetResourceSummaryRequest @@ -103,6 +104,8 @@ from .types import HostingApiMigrateControlPanelRequest from .types import HostingApiRemoveCustomDomainRequest from .types import HostingApiResetHostingPasswordRequest +from .types import HostingApiResetHostingRequest +from .types import HostingApiUpdateHostingFreeDomainRequest from .types import HostingApiUpdateHostingRequest from .types import ListBackupItemsResponse from .types import ListBackupsResponse @@ -239,6 +242,7 @@ "HostingApiAddCustomDomainRequest", "HostingApiCreateHostingRequest", "HostingApiCreateSessionRequest", + "HostingApiDeleteHostingDomainsRequest", "HostingApiDeleteHostingRequest", "HostingApiGetHostingRequest", "HostingApiGetResourceSummaryRequest", @@ -246,6 +250,8 @@ "HostingApiMigrateControlPanelRequest", "HostingApiRemoveCustomDomainRequest", "HostingApiResetHostingPasswordRequest", + "HostingApiResetHostingRequest", + "HostingApiUpdateHostingFreeDomainRequest", "HostingApiUpdateHostingRequest", "ListBackupItemsResponse", "ListBackupsResponse", diff --git a/scaleway-async/scaleway_async/webhosting/v1/api.py b/scaleway-async/scaleway_async/webhosting/v1/api.py index de8d0a547..6d6305bfc 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/api.py +++ b/scaleway-async/scaleway_async/webhosting/v1/api.py @@ -49,8 +49,10 @@ Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, + HostingApiDeleteHostingDomainsRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, + HostingApiUpdateHostingFreeDomainRequest, HostingApiUpdateHostingRequest, HostingSummary, ListBackupItemsResponse, @@ -132,8 +134,10 @@ marshal_FtpAccountApiCreateFtpAccountRequest, marshal_HostingApiAddCustomDomainRequest, marshal_HostingApiCreateHostingRequest, + marshal_HostingApiDeleteHostingDomainsRequest, marshal_HostingApiMigrateControlPanelRequest, marshal_HostingApiRemoveCustomDomainRequest, + marshal_HostingApiUpdateHostingFreeDomainRequest, marshal_HostingApiUpdateHostingRequest, marshal_MailAccountApiChangeMailAccountPasswordRequest, marshal_MailAccountApiCreateMailAccountRequest, @@ -2082,6 +2086,130 @@ async def migrate_control_panel( self._throw_on_error(res) return unmarshal_HostingSummary(res.json()) + async def reset_hosting( + self, + *, + hosting_id: str, + region: Optional[ScwRegion] = None, + ) -> Hosting: + """ + Reset a Web Hosting plan. + Reset a Web Hosting plan to its initial state, specified by its `hosting_id`. This permanently deletes all hosting data including files, databases and emails. The hosting will be re-provisioned. + :param hosting_id: Hosting ID of the Web Hosting plan to reset. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`Hosting ` + + Usage: + :: + + result = await api.reset_hosting( + hosting_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}/reset", + body={}, + ) + + self._throw_on_error(res) + return unmarshal_Hosting(res.json()) + + async def delete_hosting_domains( + self, + *, + hosting_id: str, + region: Optional[ScwRegion] = None, + domains: Optional[list[str]] = None, + ) -> Hosting: + """ + Delete domains from a Web Hosting plan. + Remove one or more domains from a Web Hosting plan, specified by its `hosting_id`. This permanently deletes the domains and all services tied to them, including mailboxes, FTP accounts and DNS zones. + :param hosting_id: Hosting ID of the Web Hosting plan from which to delete domains. + :param region: Region to target. If none is passed will use default region from the config. + :param domains: List of domains to delete from the Web Hosting plan. + :return: :class:`Hosting ` + + Usage: + :: + + result = await api.delete_hosting_domains( + hosting_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}/delete-domains", + body=marshal_HostingApiDeleteHostingDomainsRequest( + HostingApiDeleteHostingDomainsRequest( + hosting_id=hosting_id, + region=region, + domains=domains, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_Hosting(res.json()) + + async def update_hosting_free_domain( + self, + *, + hosting_id: str, + free_domain: str, + region: Optional[ScwRegion] = None, + ) -> Hosting: + """ + Update the free domain of a Web Hosting plan. + Change the free domain associated with a Web Hosting plan, specified by its `hosting_id`. + :param hosting_id: Hosting ID of the Web Hosting plan to update. + :param free_domain: New free domain to associate with the Web Hosting plan. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`Hosting ` + + Usage: + :: + + result = await api.update_hosting_free_domain( + hosting_id="example", + free_domain="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( + "PATCH", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/update-free-domain", + body=marshal_HostingApiUpdateHostingFreeDomainRequest( + HostingApiUpdateHostingFreeDomainRequest( + hosting_id=hosting_id, + free_domain=free_domain, + region=region, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_Hosting(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 e7c2b50f3..f9042ddd5 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py +++ b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py @@ -96,8 +96,10 @@ CreateHostingRequestDomainConfiguration, OfferOptionRequest, HostingApiCreateHostingRequest, + HostingApiDeleteHostingDomainsRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, + HostingApiUpdateHostingFreeDomainRequest, HostingApiUpdateHostingRequest, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, @@ -2075,6 +2077,18 @@ def marshal_HostingApiCreateHostingRequest( return output +def marshal_HostingApiDeleteHostingDomainsRequest( + request: HostingApiDeleteHostingDomainsRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.domains is not None: + output["domains"] = request.domains + + return output + + def marshal_HostingApiMigrateControlPanelRequest( request: HostingApiMigrateControlPanelRequest, defaults: ProfileDefaults, @@ -2102,6 +2116,18 @@ def marshal_HostingApiRemoveCustomDomainRequest( return output +def marshal_HostingApiUpdateHostingFreeDomainRequest( + request: HostingApiUpdateHostingFreeDomainRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.free_domain is not None: + output["free_domain"] = request.free_domain + + return output + + def marshal_HostingApiUpdateHostingRequest( request: HostingApiUpdateHostingRequest, defaults: ProfileDefaults, diff --git a/scaleway-async/scaleway_async/webhosting/v1/types.py b/scaleway-async/scaleway_async/webhosting/v1/types.py index 180a53486..c523b788b 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/types.py +++ b/scaleway-async/scaleway_async/webhosting/v1/types.py @@ -1858,6 +1858,24 @@ class HostingApiCreateSessionRequest: """ +@dataclass +class HostingApiDeleteHostingDomainsRequest: + hosting_id: str + """ + Hosting ID of the Web Hosting plan from which to delete domains. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + domains: Optional[list[str]] = field(default_factory=list) + """ + List of domains to delete from the Web Hosting plan. + """ + + @dataclass class HostingApiDeleteHostingRequest: hosting_id: str @@ -2011,6 +2029,37 @@ class HostingApiResetHostingPasswordRequest: """ +@dataclass +class HostingApiResetHostingRequest: + hosting_id: str + """ + Hosting ID of the Web Hosting plan to reset. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class HostingApiUpdateHostingFreeDomainRequest: + hosting_id: str + """ + Hosting ID of the Web Hosting plan to update. + """ + + free_domain: str + """ + New free domain to associate with the Web Hosting plan. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class HostingApiUpdateHostingRequest: hosting_id: str diff --git a/scaleway/scaleway/webhosting/v1/__init__.py b/scaleway/scaleway/webhosting/v1/__init__.py index ec0d64e0c..c71c26a66 100644 --- a/scaleway/scaleway/webhosting/v1/__init__.py +++ b/scaleway/scaleway/webhosting/v1/__init__.py @@ -96,6 +96,7 @@ from .types import HostingApiAddCustomDomainRequest from .types import HostingApiCreateHostingRequest from .types import HostingApiCreateSessionRequest +from .types import HostingApiDeleteHostingDomainsRequest from .types import HostingApiDeleteHostingRequest from .types import HostingApiGetHostingRequest from .types import HostingApiGetResourceSummaryRequest @@ -103,6 +104,8 @@ from .types import HostingApiMigrateControlPanelRequest from .types import HostingApiRemoveCustomDomainRequest from .types import HostingApiResetHostingPasswordRequest +from .types import HostingApiResetHostingRequest +from .types import HostingApiUpdateHostingFreeDomainRequest from .types import HostingApiUpdateHostingRequest from .types import ListBackupItemsResponse from .types import ListBackupsResponse @@ -239,6 +242,7 @@ "HostingApiAddCustomDomainRequest", "HostingApiCreateHostingRequest", "HostingApiCreateSessionRequest", + "HostingApiDeleteHostingDomainsRequest", "HostingApiDeleteHostingRequest", "HostingApiGetHostingRequest", "HostingApiGetResourceSummaryRequest", @@ -246,6 +250,8 @@ "HostingApiMigrateControlPanelRequest", "HostingApiRemoveCustomDomainRequest", "HostingApiResetHostingPasswordRequest", + "HostingApiResetHostingRequest", + "HostingApiUpdateHostingFreeDomainRequest", "HostingApiUpdateHostingRequest", "ListBackupItemsResponse", "ListBackupsResponse", diff --git a/scaleway/scaleway/webhosting/v1/api.py b/scaleway/scaleway/webhosting/v1/api.py index 162346688..e9d3fb17f 100644 --- a/scaleway/scaleway/webhosting/v1/api.py +++ b/scaleway/scaleway/webhosting/v1/api.py @@ -49,8 +49,10 @@ Hosting, HostingApiAddCustomDomainRequest, HostingApiCreateHostingRequest, + HostingApiDeleteHostingDomainsRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, + HostingApiUpdateHostingFreeDomainRequest, HostingApiUpdateHostingRequest, HostingSummary, ListBackupItemsResponse, @@ -132,8 +134,10 @@ marshal_FtpAccountApiCreateFtpAccountRequest, marshal_HostingApiAddCustomDomainRequest, marshal_HostingApiCreateHostingRequest, + marshal_HostingApiDeleteHostingDomainsRequest, marshal_HostingApiMigrateControlPanelRequest, marshal_HostingApiRemoveCustomDomainRequest, + marshal_HostingApiUpdateHostingFreeDomainRequest, marshal_HostingApiUpdateHostingRequest, marshal_MailAccountApiChangeMailAccountPasswordRequest, marshal_MailAccountApiCreateMailAccountRequest, @@ -2082,6 +2086,130 @@ def migrate_control_panel( self._throw_on_error(res) return unmarshal_HostingSummary(res.json()) + def reset_hosting( + self, + *, + hosting_id: str, + region: Optional[ScwRegion] = None, + ) -> Hosting: + """ + Reset a Web Hosting plan. + Reset a Web Hosting plan to its initial state, specified by its `hosting_id`. This permanently deletes all hosting data including files, databases and emails. The hosting will be re-provisioned. + :param hosting_id: Hosting ID of the Web Hosting plan to reset. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`Hosting ` + + Usage: + :: + + result = api.reset_hosting( + hosting_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}/reset", + body={}, + ) + + self._throw_on_error(res) + return unmarshal_Hosting(res.json()) + + def delete_hosting_domains( + self, + *, + hosting_id: str, + region: Optional[ScwRegion] = None, + domains: Optional[list[str]] = None, + ) -> Hosting: + """ + Delete domains from a Web Hosting plan. + Remove one or more domains from a Web Hosting plan, specified by its `hosting_id`. This permanently deletes the domains and all services tied to them, including mailboxes, FTP accounts and DNS zones. + :param hosting_id: Hosting ID of the Web Hosting plan from which to delete domains. + :param region: Region to target. If none is passed will use default region from the config. + :param domains: List of domains to delete from the Web Hosting plan. + :return: :class:`Hosting ` + + Usage: + :: + + result = api.delete_hosting_domains( + hosting_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}/delete-domains", + body=marshal_HostingApiDeleteHostingDomainsRequest( + HostingApiDeleteHostingDomainsRequest( + hosting_id=hosting_id, + region=region, + domains=domains, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_Hosting(res.json()) + + def update_hosting_free_domain( + self, + *, + hosting_id: str, + free_domain: str, + region: Optional[ScwRegion] = None, + ) -> Hosting: + """ + Update the free domain of a Web Hosting plan. + Change the free domain associated with a Web Hosting plan, specified by its `hosting_id`. + :param hosting_id: Hosting ID of the Web Hosting plan to update. + :param free_domain: New free domain to associate with the Web Hosting plan. + :param region: Region to target. If none is passed will use default region from the config. + :return: :class:`Hosting ` + + Usage: + :: + + result = api.update_hosting_free_domain( + hosting_id="example", + free_domain="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( + "PATCH", + f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/update-free-domain", + body=marshal_HostingApiUpdateHostingFreeDomainRequest( + HostingApiUpdateHostingFreeDomainRequest( + hosting_id=hosting_id, + free_domain=free_domain, + region=region, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_Hosting(res.json()) + class WebhostingV1FreeDomainAPI(API): """ diff --git a/scaleway/scaleway/webhosting/v1/marshalling.py b/scaleway/scaleway/webhosting/v1/marshalling.py index e7c2b50f3..f9042ddd5 100644 --- a/scaleway/scaleway/webhosting/v1/marshalling.py +++ b/scaleway/scaleway/webhosting/v1/marshalling.py @@ -96,8 +96,10 @@ CreateHostingRequestDomainConfiguration, OfferOptionRequest, HostingApiCreateHostingRequest, + HostingApiDeleteHostingDomainsRequest, HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, + HostingApiUpdateHostingFreeDomainRequest, HostingApiUpdateHostingRequest, MailAccountApiChangeMailAccountPasswordRequest, MailAccountApiCreateMailAccountRequest, @@ -2075,6 +2077,18 @@ def marshal_HostingApiCreateHostingRequest( return output +def marshal_HostingApiDeleteHostingDomainsRequest( + request: HostingApiDeleteHostingDomainsRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.domains is not None: + output["domains"] = request.domains + + return output + + def marshal_HostingApiMigrateControlPanelRequest( request: HostingApiMigrateControlPanelRequest, defaults: ProfileDefaults, @@ -2102,6 +2116,18 @@ def marshal_HostingApiRemoveCustomDomainRequest( return output +def marshal_HostingApiUpdateHostingFreeDomainRequest( + request: HostingApiUpdateHostingFreeDomainRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.free_domain is not None: + output["free_domain"] = request.free_domain + + return output + + def marshal_HostingApiUpdateHostingRequest( request: HostingApiUpdateHostingRequest, defaults: ProfileDefaults, diff --git a/scaleway/scaleway/webhosting/v1/types.py b/scaleway/scaleway/webhosting/v1/types.py index 180a53486..c523b788b 100644 --- a/scaleway/scaleway/webhosting/v1/types.py +++ b/scaleway/scaleway/webhosting/v1/types.py @@ -1858,6 +1858,24 @@ class HostingApiCreateSessionRequest: """ +@dataclass +class HostingApiDeleteHostingDomainsRequest: + hosting_id: str + """ + Hosting ID of the Web Hosting plan from which to delete domains. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + domains: Optional[list[str]] = field(default_factory=list) + """ + List of domains to delete from the Web Hosting plan. + """ + + @dataclass class HostingApiDeleteHostingRequest: hosting_id: str @@ -2011,6 +2029,37 @@ class HostingApiResetHostingPasswordRequest: """ +@dataclass +class HostingApiResetHostingRequest: + hosting_id: str + """ + Hosting ID of the Web Hosting plan to reset. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + +@dataclass +class HostingApiUpdateHostingFreeDomainRequest: + hosting_id: str + """ + Hosting ID of the Web Hosting plan to update. + """ + + free_domain: str + """ + New free domain to associate with the Web Hosting plan. + """ + + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class HostingApiUpdateHostingRequest: hosting_id: str