Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion scaleway-async/scaleway_async/webhosting/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
Hosting,
HostingApiAddCustomDomainRequest,
HostingApiCreateHostingRequest,
HostingApiRemoveCustomDomainRequest,
HostingApiUpdateHostingRequest,
HostingSummary,
ListBackupItemsResponse,
Expand Down Expand Up @@ -124,6 +125,7 @@
marshal_FtpAccountApiCreateFtpAccountRequest,
marshal_HostingApiAddCustomDomainRequest,
marshal_HostingApiCreateHostingRequest,
marshal_HostingApiRemoveCustomDomainRequest,
marshal_HostingApiUpdateHostingRequest,
marshal_MailAccountApiChangeMailAccountPasswordRequest,
marshal_MailAccountApiCreateMailAccountRequest,
Expand Down Expand Up @@ -1913,11 +1915,13 @@ async def remove_custom_domain(
self,
*,
hosting_id: str,
domain_name: str,
region: Optional[ScwRegion] = None,
) -> HostingSummary:
"""
Detach a custom domain from a webhosting.
:param hosting_id: Hosting ID to which the custom domain is detached from.
:param domain_name: The custom domain name to detach from the hosting.
:param region: Region to target. If none is passed will use default region from the config.
:return: :class:`HostingSummary <HostingSummary>`

Expand All @@ -1926,6 +1930,7 @@ async def remove_custom_domain(

result = await api.remove_custom_domain(
hosting_id="example",
domain_name="example",
)
"""

Expand All @@ -1937,7 +1942,14 @@ async def remove_custom_domain(
res = self._request(
"POST",
f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/remove-custom-domain",
body={},
body=marshal_HostingApiRemoveCustomDomainRequest(
HostingApiRemoveCustomDomainRequest(
hosting_id=hosting_id,
domain_name=domain_name,
region=region,
),
self.client,
),
)

self._throw_on_error(res)
Expand Down
13 changes: 13 additions & 0 deletions scaleway-async/scaleway_async/webhosting/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
CreateHostingRequestDomainConfiguration,
OfferOptionRequest,
HostingApiCreateHostingRequest,
HostingApiRemoveCustomDomainRequest,
HostingApiUpdateHostingRequest,
MailAccountApiChangeMailAccountPasswordRequest,
MailAccountApiCreateMailAccountRequest,
Expand Down Expand Up @@ -1951,6 +1952,18 @@ def marshal_HostingApiCreateHostingRequest(
return output


def marshal_HostingApiRemoveCustomDomainRequest(
request: HostingApiRemoveCustomDomainRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

if request.domain_name is not None:
output["domain_name"] = request.domain_name

return output


def marshal_HostingApiUpdateHostingRequest(
request: HostingApiUpdateHostingRequest,
defaults: ProfileDefaults,
Expand Down
5 changes: 5 additions & 0 deletions scaleway-async/scaleway_async/webhosting/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,11 @@ class HostingApiRemoveCustomDomainRequest:
Hosting ID to which the custom domain is detached from.
"""

domain_name: str
"""
The custom domain name to detach from the hosting.
"""

region: Optional[ScwRegion] = None
"""
Region to target. If none is passed will use default region from the config.
Expand Down
14 changes: 13 additions & 1 deletion scaleway/scaleway/webhosting/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
Hosting,
HostingApiAddCustomDomainRequest,
HostingApiCreateHostingRequest,
HostingApiRemoveCustomDomainRequest,
HostingApiUpdateHostingRequest,
HostingSummary,
ListBackupItemsResponse,
Expand Down Expand Up @@ -124,6 +125,7 @@
marshal_FtpAccountApiCreateFtpAccountRequest,
marshal_HostingApiAddCustomDomainRequest,
marshal_HostingApiCreateHostingRequest,
marshal_HostingApiRemoveCustomDomainRequest,
marshal_HostingApiUpdateHostingRequest,
marshal_MailAccountApiChangeMailAccountPasswordRequest,
marshal_MailAccountApiCreateMailAccountRequest,
Expand Down Expand Up @@ -1913,11 +1915,13 @@ def remove_custom_domain(
self,
*,
hosting_id: str,
domain_name: str,
region: Optional[ScwRegion] = None,
) -> HostingSummary:
"""
Detach a custom domain from a webhosting.
:param hosting_id: Hosting ID to which the custom domain is detached from.
:param domain_name: The custom domain name to detach from the hosting.
:param region: Region to target. If none is passed will use default region from the config.
:return: :class:`HostingSummary <HostingSummary>`

Expand All @@ -1926,6 +1930,7 @@ def remove_custom_domain(

result = api.remove_custom_domain(
hosting_id="example",
domain_name="example",
)
"""

Expand All @@ -1937,7 +1942,14 @@ def remove_custom_domain(
res = self._request(
"POST",
f"/webhosting/v1/regions/{param_region}/hostings/{param_hosting_id}/remove-custom-domain",
body={},
body=marshal_HostingApiRemoveCustomDomainRequest(
HostingApiRemoveCustomDomainRequest(
hosting_id=hosting_id,
domain_name=domain_name,
region=region,
),
self.client,
),
)

self._throw_on_error(res)
Expand Down
13 changes: 13 additions & 0 deletions scaleway/scaleway/webhosting/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
CreateHostingRequestDomainConfiguration,
OfferOptionRequest,
HostingApiCreateHostingRequest,
HostingApiRemoveCustomDomainRequest,
HostingApiUpdateHostingRequest,
MailAccountApiChangeMailAccountPasswordRequest,
MailAccountApiCreateMailAccountRequest,
Expand Down Expand Up @@ -1951,6 +1952,18 @@ def marshal_HostingApiCreateHostingRequest(
return output


def marshal_HostingApiRemoveCustomDomainRequest(
request: HostingApiRemoveCustomDomainRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}

if request.domain_name is not None:
output["domain_name"] = request.domain_name

return output


def marshal_HostingApiUpdateHostingRequest(
request: HostingApiUpdateHostingRequest,
defaults: ProfileDefaults,
Expand Down
5 changes: 5 additions & 0 deletions scaleway/scaleway/webhosting/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,11 @@ class HostingApiRemoveCustomDomainRequest:
Hosting ID to which the custom domain is detached from.
"""

domain_name: str
"""
The custom domain name to detach from the hosting.
"""

region: Optional[ScwRegion] = None
"""
Region to target. If none is passed will use default region from the config.
Expand Down