From e31f216cc2ab879f290e625885b5923b9c63052b Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 20 Mar 2025 14:50:01 +0000 Subject: [PATCH] feat: update generated APIs --- .../webhosting/v1/marshalling.py | 69 +++++++++++-------- .../scaleway_async/webhosting/v1/types.py | 14 +++- .../scaleway/webhosting/v1/marshalling.py | 69 +++++++++++-------- scaleway/scaleway/webhosting/v1/types.py | 14 +++- 4 files changed, 108 insertions(+), 58 deletions(-) diff --git a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py index 0a78257ee..0d58e69f6 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/marshalling.py +++ b/scaleway-async/scaleway_async/webhosting/v1/marshalling.py @@ -21,10 +21,10 @@ FtpAccount, MailAccount, CheckUserOwnsDomainResponse, + AutoConfigDomainDns, DnsRecord, Nameserver, DnsRecords, - AutoConfigDomainDns, Domain, PlatformControlPanelUrls, OfferOption, @@ -164,6 +164,37 @@ def unmarshal_CheckUserOwnsDomainResponse(data: Any) -> CheckUserOwnsDomainRespo return CheckUserOwnsDomainResponse(**args) +def unmarshal_AutoConfigDomainDns(data: Any) -> AutoConfigDomainDns: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("nameservers", None) + if field is not None: + args["nameservers"] = field + + field = data.get("web_records", None) + if field is not None: + args["web_records"] = field + + field = data.get("mail_records", None) + if field is not None: + args["mail_records"] = field + + field = data.get("all_records", None) + if field is not None: + args["all_records"] = field + + field = data.get("none", None) + if field is not None: + args["none"] = field + + return AutoConfigDomainDns(**args) + + def unmarshal_DnsRecord(data: Any) -> DnsRecord: if not isinstance(data, dict): raise TypeError( @@ -257,35 +288,16 @@ def unmarshal_DnsRecords(data: Any) -> DnsRecords: args["dns_config"] = ( [DomainDnsAction(v) for v in field] if field is not None else None ) + else: + args["dns_config"] = None - return DnsRecords(**args) - - -def unmarshal_AutoConfigDomainDns(data: Any) -> AutoConfigDomainDns: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("nameservers", None) - if field is not None: - args["nameservers"] = field - - field = data.get("web_records", None) - if field is not None: - args["web_records"] = field - - field = data.get("mail_records", None) - if field is not None: - args["mail_records"] = field - - field = data.get("all_records", None) + field = data.get("auto_config_domain_dns", None) if field is not None: - args["all_records"] = field + args["auto_config_domain_dns"] = unmarshal_AutoConfigDomainDns(field) + else: + args["auto_config_domain_dns"] = None - return AutoConfigDomainDns(**args) + return DnsRecords(**args) def unmarshal_Domain(data: Any) -> Domain: @@ -1124,6 +1136,9 @@ def marshal_AutoConfigDomainDns( if request.all_records is not None: output["all_records"] = request.all_records + if request.none is not None: + output["none"] = request.none + return output diff --git a/scaleway-async/scaleway_async/webhosting/v1/types.py b/scaleway-async/scaleway_async/webhosting/v1/types.py index 6bf9257c4..2e0048129 100644 --- a/scaleway-async/scaleway_async/webhosting/v1/types.py +++ b/scaleway-async/scaleway_async/webhosting/v1/types.py @@ -329,6 +329,11 @@ class AutoConfigDomainDns: Whether or not to synchronize all types of records. Takes priority over the other fields. """ + none: bool + """ + No automatic domain configuration. Users must configure their domain for the Web Hosting to work. + """ + @dataclass class CreateHostingRequestDomainConfiguration: @@ -1095,9 +1100,14 @@ class DnsRecords: Status of the records. """ - dns_config: List[DomainDnsAction] + dns_config: Optional[List[DomainDnsAction]] + """ + Records dns auto configuration settings (deprecated, use auto_config_domain_dns). + """ + + auto_config_domain_dns: Optional[AutoConfigDomainDns] """ - Records dns auto configuration settings. + Whether or not to synchronize each types of records. """ diff --git a/scaleway/scaleway/webhosting/v1/marshalling.py b/scaleway/scaleway/webhosting/v1/marshalling.py index 0a78257ee..0d58e69f6 100644 --- a/scaleway/scaleway/webhosting/v1/marshalling.py +++ b/scaleway/scaleway/webhosting/v1/marshalling.py @@ -21,10 +21,10 @@ FtpAccount, MailAccount, CheckUserOwnsDomainResponse, + AutoConfigDomainDns, DnsRecord, Nameserver, DnsRecords, - AutoConfigDomainDns, Domain, PlatformControlPanelUrls, OfferOption, @@ -164,6 +164,37 @@ def unmarshal_CheckUserOwnsDomainResponse(data: Any) -> CheckUserOwnsDomainRespo return CheckUserOwnsDomainResponse(**args) +def unmarshal_AutoConfigDomainDns(data: Any) -> AutoConfigDomainDns: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary." + ) + + args: Dict[str, Any] = {} + + field = data.get("nameservers", None) + if field is not None: + args["nameservers"] = field + + field = data.get("web_records", None) + if field is not None: + args["web_records"] = field + + field = data.get("mail_records", None) + if field is not None: + args["mail_records"] = field + + field = data.get("all_records", None) + if field is not None: + args["all_records"] = field + + field = data.get("none", None) + if field is not None: + args["none"] = field + + return AutoConfigDomainDns(**args) + + def unmarshal_DnsRecord(data: Any) -> DnsRecord: if not isinstance(data, dict): raise TypeError( @@ -257,35 +288,16 @@ def unmarshal_DnsRecords(data: Any) -> DnsRecords: args["dns_config"] = ( [DomainDnsAction(v) for v in field] if field is not None else None ) + else: + args["dns_config"] = None - return DnsRecords(**args) - - -def unmarshal_AutoConfigDomainDns(data: Any) -> AutoConfigDomainDns: - if not isinstance(data, dict): - raise TypeError( - "Unmarshalling the type 'AutoConfigDomainDns' failed as data isn't a dictionary." - ) - - args: Dict[str, Any] = {} - - field = data.get("nameservers", None) - if field is not None: - args["nameservers"] = field - - field = data.get("web_records", None) - if field is not None: - args["web_records"] = field - - field = data.get("mail_records", None) - if field is not None: - args["mail_records"] = field - - field = data.get("all_records", None) + field = data.get("auto_config_domain_dns", None) if field is not None: - args["all_records"] = field + args["auto_config_domain_dns"] = unmarshal_AutoConfigDomainDns(field) + else: + args["auto_config_domain_dns"] = None - return AutoConfigDomainDns(**args) + return DnsRecords(**args) def unmarshal_Domain(data: Any) -> Domain: @@ -1124,6 +1136,9 @@ def marshal_AutoConfigDomainDns( if request.all_records is not None: output["all_records"] = request.all_records + if request.none is not None: + output["none"] = request.none + return output diff --git a/scaleway/scaleway/webhosting/v1/types.py b/scaleway/scaleway/webhosting/v1/types.py index 6bf9257c4..2e0048129 100644 --- a/scaleway/scaleway/webhosting/v1/types.py +++ b/scaleway/scaleway/webhosting/v1/types.py @@ -329,6 +329,11 @@ class AutoConfigDomainDns: Whether or not to synchronize all types of records. Takes priority over the other fields. """ + none: bool + """ + No automatic domain configuration. Users must configure their domain for the Web Hosting to work. + """ + @dataclass class CreateHostingRequestDomainConfiguration: @@ -1095,9 +1100,14 @@ class DnsRecords: Status of the records. """ - dns_config: List[DomainDnsAction] + dns_config: Optional[List[DomainDnsAction]] + """ + Records dns auto configuration settings (deprecated, use auto_config_domain_dns). + """ + + auto_config_domain_dns: Optional[AutoConfigDomainDns] """ - Records dns auto configuration settings. + Whether or not to synchronize each types of records. """