diff --git a/scaleway-async/scaleway_async/webhosting/v1alpha1/__init__.py b/scaleway-async/scaleway_async/webhosting/v1alpha1/__init__.py index 044b4485..e025d685 100644 --- a/scaleway-async/scaleway_async/webhosting/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/webhosting/v1alpha1/__init__.py @@ -11,6 +11,7 @@ from .types import NameserverStatus from .types import OfferQuotaWarning from .types import ControlPanel +from .types import CreateHostingRequestDomainConfiguration from .types import DnsRecord from .types import DnsRecords from .types import Hosting @@ -37,6 +38,7 @@ "NameserverStatus", "OfferQuotaWarning", "ControlPanel", + "CreateHostingRequestDomainConfiguration", "DnsRecord", "DnsRecords", "Hosting", diff --git a/scaleway-async/scaleway_async/webhosting/v1alpha1/api.py b/scaleway-async/scaleway_async/webhosting/v1alpha1/api.py index 7e46ac59..9af019de 100644 --- a/scaleway-async/scaleway_async/webhosting/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/webhosting/v1alpha1/api.py @@ -19,6 +19,7 @@ ListHostingsRequestOrderBy, ListOffersRequestOrderBy, ControlPanel, + CreateHostingRequestDomainConfiguration, DnsRecords, Hosting, ListControlPanelsResponse, @@ -59,6 +60,7 @@ async def create_hosting( email: Optional[str] = None, tags: Optional[List[str]] = None, option_ids: Optional[List[str]] = None, + domain_configuration: Optional[CreateHostingRequestDomainConfiguration] = None, ) -> Hosting: """ Order a Web Hosting plan. @@ -71,6 +73,7 @@ async def create_hosting( :param domain: Domain name to link to the Web Hosting plan. You must already own this domain name, and have completed the DNS validation process beforehand. :param option_ids: IDs of any selected additional options for the Web Hosting plan. :param language: Default language for the control panel interface. + :param domain_configuration: Indicates whether to update hosting domain name servers and DNS records for domains managed by Scaleway Elements. :return: :class:`Hosting ` Usage: @@ -100,6 +103,7 @@ async def create_hosting( email=email, tags=tags, option_ids=option_ids, + domain_configuration=domain_configuration, ), self.client, ), @@ -296,6 +300,7 @@ async def update_hosting( tags: Optional[List[str]] = None, option_ids: Optional[List[str]] = None, offer_id: Optional[str] = None, + protected: Optional[bool] = None, ) -> Hosting: """ Update a Web Hosting plan. @@ -306,6 +311,7 @@ async def update_hosting( :param tags: New tags for the Web Hosting plan. :param option_ids: IDs of the new options for the Web Hosting plan. :param offer_id: ID of the new offer for the Web Hosting plan. + :param protected: Whether the hosting is protected or not. :return: :class:`Hosting ` Usage: @@ -330,6 +336,7 @@ async def update_hosting( tags=tags, option_ids=option_ids, offer_id=offer_id, + protected=protected, ), self.client, ), diff --git a/scaleway-async/scaleway_async/webhosting/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/webhosting/v1alpha1/marshalling.py index bc0637b7..381a5929 100644 --- a/scaleway-async/scaleway_async/webhosting/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/webhosting/v1alpha1/marshalling.py @@ -11,6 +11,7 @@ from .types import ( LanguageCode, ControlPanel, + CreateHostingRequestDomainConfiguration, DnsRecord, DnsRecords, Hosting, @@ -214,6 +215,9 @@ def unmarshal_Hosting(data: Any) -> Hosting: field = data.get("project_id", None) args["project_id"] = field + field = data.get("protected", None) + args["protected"] = field + field = data.get("region", None) args["region"] = field @@ -363,6 +367,27 @@ def unmarshal_ListOffersResponse(data: Any) -> ListOffersResponse: return ListOffersResponse(**args) +def marshal_CreateHostingRequestDomainConfiguration( + request: CreateHostingRequestDomainConfiguration, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.update_all_records is not None: + output["update_all_records"] = request.update_all_records + + if request.update_mail_record is not None: + output["update_mail_record"] = request.update_mail_record + + if request.update_nameservers is not None: + output["update_nameservers"] = request.update_nameservers + + if request.update_web_record is not None: + output["update_web_record"] = request.update_web_record + + return output + + def marshal_CreateHostingRequest( request: CreateHostingRequest, defaults: ProfileDefaults, @@ -372,6 +397,13 @@ def marshal_CreateHostingRequest( if request.domain is not None: output["domain"] = request.domain + if request.domain_configuration is not None: + output["domain_configuration"] = ( + marshal_CreateHostingRequestDomainConfiguration( + request.domain_configuration, defaults + ) + ) + if request.email is not None: output["email"] = request.email @@ -408,6 +440,9 @@ def marshal_UpdateHostingRequest( if request.option_ids is not None: output["option_ids"] = request.option_ids + if request.protected is not None: + output["protected"] = request.protected + if request.tags is not None: output["tags"] = request.tags diff --git a/scaleway-async/scaleway_async/webhosting/v1alpha1/types.py b/scaleway-async/scaleway_async/webhosting/v1alpha1/types.py index 8df07f66..0fb0d365 100644 --- a/scaleway-async/scaleway_async/webhosting/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/webhosting/v1alpha1/types.py @@ -135,6 +135,17 @@ class ControlPanel: """ +@dataclass +class CreateHostingRequestDomainConfiguration: + update_nameservers: bool + + update_web_record: bool + + update_mail_record: bool + + update_all_records: bool + + @dataclass class DnsRecord: """ @@ -305,6 +316,11 @@ class Hosting: IPv6 address of the hosting's host server. """ + protected: bool + """ + Whether the hosting is protected or not. + """ + region: Region """ Region where the Web Hosting plan is hosted. @@ -549,6 +565,11 @@ class CreateHostingRequest: Default language for the control panel interface. """ + domain_configuration: Optional[CreateHostingRequestDomainConfiguration] + """ + Indicates whether to update hosting domain name servers and DNS records for domains managed by Scaleway Elements. + """ + @dataclass class ListHostingsRequest: @@ -648,6 +669,11 @@ class UpdateHostingRequest: ID of the new offer for the Web Hosting plan. """ + protected: Optional[bool] + """ + Whether the hosting is protected or not. + """ + @dataclass class DeleteHostingRequest: diff --git a/scaleway/scaleway/webhosting/v1alpha1/__init__.py b/scaleway/scaleway/webhosting/v1alpha1/__init__.py index 044b4485..e025d685 100644 --- a/scaleway/scaleway/webhosting/v1alpha1/__init__.py +++ b/scaleway/scaleway/webhosting/v1alpha1/__init__.py @@ -11,6 +11,7 @@ from .types import NameserverStatus from .types import OfferQuotaWarning from .types import ControlPanel +from .types import CreateHostingRequestDomainConfiguration from .types import DnsRecord from .types import DnsRecords from .types import Hosting @@ -37,6 +38,7 @@ "NameserverStatus", "OfferQuotaWarning", "ControlPanel", + "CreateHostingRequestDomainConfiguration", "DnsRecord", "DnsRecords", "Hosting", diff --git a/scaleway/scaleway/webhosting/v1alpha1/api.py b/scaleway/scaleway/webhosting/v1alpha1/api.py index ee4f5e95..7b841376 100644 --- a/scaleway/scaleway/webhosting/v1alpha1/api.py +++ b/scaleway/scaleway/webhosting/v1alpha1/api.py @@ -19,6 +19,7 @@ ListHostingsRequestOrderBy, ListOffersRequestOrderBy, ControlPanel, + CreateHostingRequestDomainConfiguration, DnsRecords, Hosting, ListControlPanelsResponse, @@ -59,6 +60,7 @@ def create_hosting( email: Optional[str] = None, tags: Optional[List[str]] = None, option_ids: Optional[List[str]] = None, + domain_configuration: Optional[CreateHostingRequestDomainConfiguration] = None, ) -> Hosting: """ Order a Web Hosting plan. @@ -71,6 +73,7 @@ def create_hosting( :param domain: Domain name to link to the Web Hosting plan. You must already own this domain name, and have completed the DNS validation process beforehand. :param option_ids: IDs of any selected additional options for the Web Hosting plan. :param language: Default language for the control panel interface. + :param domain_configuration: Indicates whether to update hosting domain name servers and DNS records for domains managed by Scaleway Elements. :return: :class:`Hosting ` Usage: @@ -100,6 +103,7 @@ def create_hosting( email=email, tags=tags, option_ids=option_ids, + domain_configuration=domain_configuration, ), self.client, ), @@ -296,6 +300,7 @@ def update_hosting( tags: Optional[List[str]] = None, option_ids: Optional[List[str]] = None, offer_id: Optional[str] = None, + protected: Optional[bool] = None, ) -> Hosting: """ Update a Web Hosting plan. @@ -306,6 +311,7 @@ def update_hosting( :param tags: New tags for the Web Hosting plan. :param option_ids: IDs of the new options for the Web Hosting plan. :param offer_id: ID of the new offer for the Web Hosting plan. + :param protected: Whether the hosting is protected or not. :return: :class:`Hosting ` Usage: @@ -330,6 +336,7 @@ def update_hosting( tags=tags, option_ids=option_ids, offer_id=offer_id, + protected=protected, ), self.client, ), diff --git a/scaleway/scaleway/webhosting/v1alpha1/marshalling.py b/scaleway/scaleway/webhosting/v1alpha1/marshalling.py index bc0637b7..381a5929 100644 --- a/scaleway/scaleway/webhosting/v1alpha1/marshalling.py +++ b/scaleway/scaleway/webhosting/v1alpha1/marshalling.py @@ -11,6 +11,7 @@ from .types import ( LanguageCode, ControlPanel, + CreateHostingRequestDomainConfiguration, DnsRecord, DnsRecords, Hosting, @@ -214,6 +215,9 @@ def unmarshal_Hosting(data: Any) -> Hosting: field = data.get("project_id", None) args["project_id"] = field + field = data.get("protected", None) + args["protected"] = field + field = data.get("region", None) args["region"] = field @@ -363,6 +367,27 @@ def unmarshal_ListOffersResponse(data: Any) -> ListOffersResponse: return ListOffersResponse(**args) +def marshal_CreateHostingRequestDomainConfiguration( + request: CreateHostingRequestDomainConfiguration, + defaults: ProfileDefaults, +) -> Dict[str, Any]: + output: Dict[str, Any] = {} + + if request.update_all_records is not None: + output["update_all_records"] = request.update_all_records + + if request.update_mail_record is not None: + output["update_mail_record"] = request.update_mail_record + + if request.update_nameservers is not None: + output["update_nameservers"] = request.update_nameservers + + if request.update_web_record is not None: + output["update_web_record"] = request.update_web_record + + return output + + def marshal_CreateHostingRequest( request: CreateHostingRequest, defaults: ProfileDefaults, @@ -372,6 +397,13 @@ def marshal_CreateHostingRequest( if request.domain is not None: output["domain"] = request.domain + if request.domain_configuration is not None: + output["domain_configuration"] = ( + marshal_CreateHostingRequestDomainConfiguration( + request.domain_configuration, defaults + ) + ) + if request.email is not None: output["email"] = request.email @@ -408,6 +440,9 @@ def marshal_UpdateHostingRequest( if request.option_ids is not None: output["option_ids"] = request.option_ids + if request.protected is not None: + output["protected"] = request.protected + if request.tags is not None: output["tags"] = request.tags diff --git a/scaleway/scaleway/webhosting/v1alpha1/types.py b/scaleway/scaleway/webhosting/v1alpha1/types.py index 8df07f66..0fb0d365 100644 --- a/scaleway/scaleway/webhosting/v1alpha1/types.py +++ b/scaleway/scaleway/webhosting/v1alpha1/types.py @@ -135,6 +135,17 @@ class ControlPanel: """ +@dataclass +class CreateHostingRequestDomainConfiguration: + update_nameservers: bool + + update_web_record: bool + + update_mail_record: bool + + update_all_records: bool + + @dataclass class DnsRecord: """ @@ -305,6 +316,11 @@ class Hosting: IPv6 address of the hosting's host server. """ + protected: bool + """ + Whether the hosting is protected or not. + """ + region: Region """ Region where the Web Hosting plan is hosted. @@ -549,6 +565,11 @@ class CreateHostingRequest: Default language for the control panel interface. """ + domain_configuration: Optional[CreateHostingRequestDomainConfiguration] + """ + Indicates whether to update hosting domain name servers and DNS records for domains managed by Scaleway Elements. + """ + @dataclass class ListHostingsRequest: @@ -648,6 +669,11 @@ class UpdateHostingRequest: ID of the new offer for the Web Hosting plan. """ + protected: Optional[bool] + """ + Whether the hosting is protected or not. + """ + @dataclass class DeleteHostingRequest: