Skip to content
Draft
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
16 changes: 6 additions & 10 deletions scaleway-async/scaleway_async/webhosting/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,22 +1232,22 @@ async def sync_domain_dns_records(
self,
*,
domain: str,
update_web_records: bool,
update_mail_records: bool,
update_all_records: bool,
update_nameservers: bool,
region: Optional[ScwRegion] = None,
update_web_records: Optional[bool] = None,
update_mail_records: Optional[bool] = None,
update_all_records: Optional[bool] = None,
update_nameservers: Optional[bool] = None,
custom_records: Optional[list[SyncDomainDnsRecordsRequestRecord]] = None,
auto_config_domain_dns: Optional[AutoConfigDomainDns] = None,
) -> DnsRecords:
"""
Synchronize your DNS records on the Elements Console and on cPanel.
:param domain: Domain for which the DNS records will be synchronized.
:param region: Region to target. If none is passed will use default region from the config.
:param update_web_records: Whether or not to synchronize the web records (deprecated, use auto_config_domain_dns).
:param update_mail_records: Whether or not to synchronize the mail records (deprecated, use auto_config_domain_dns).
:param update_all_records: Whether or not to synchronize all types of records. This one has priority (deprecated, use auto_config_domain_dns).
:param update_nameservers: Whether or not to synchronize domain nameservers (deprecated, use auto_config_domain_dns).
:param region: Region to target. If none is passed will use default region from the config.
:param custom_records: Custom records to synchronize.
:param auto_config_domain_dns: Whether or not to synchronize each types of records.
:return: :class:`DnsRecords <DnsRecords>`
Expand All @@ -1257,10 +1257,6 @@ async def sync_domain_dns_records(

result = await api.sync_domain_dns_records(
domain="example",
update_web_records=False,
update_mail_records=False,
update_all_records=False,
update_nameservers=False,
)
"""

Expand All @@ -1275,11 +1271,11 @@ async def sync_domain_dns_records(
body=marshal_DnsApiSyncDomainDnsRecordsRequest(
DnsApiSyncDomainDnsRecordsRequest(
domain=domain,
region=region,
update_web_records=update_web_records,
update_mail_records=update_mail_records,
update_all_records=update_all_records,
update_nameservers=update_nameservers,
region=region,
custom_records=custom_records,
auto_config_domain_dns=auto_config_domain_dns,
),
Expand Down
76 changes: 38 additions & 38 deletions scaleway-async/scaleway_async/webhosting/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,36 +350,18 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
else:
args["status"] = HostingStatus.UNKNOWN_STATUS

field = data.get("domain", None)
if field is not None:
args["domain"] = field
else:
args["domain"] = None

field = data.get("protected", None)
if field is not None:
args["protected"] = field
else:
args["protected"] = False

field = data.get("dns_status", None)
if field is not None:
args["dns_status"] = field
else:
args["dns_status"] = DnsRecordsStatus.UNKNOWN_STATUS

field = data.get("offer_name", None)
if field is not None:
args["offer_name"] = field
else:
args["offer_name"] = None

field = data.get("domain_status", None)
if field is not None:
args["domain_status"] = field
else:
args["domain_status"] = DomainStatus.UNKNOWN_STATUS

field = data.get("region", None)
if field is not None:
args["region"] = field
Expand All @@ -398,6 +380,24 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
else:
args["updated_at"] = None

field = data.get("domain", None)
if field is not None:
args["domain"] = field
else:
args["domain"] = None

field = data.get("dns_status", None)
if field is not None:
args["dns_status"] = field
else:
args["dns_status"] = None

field = data.get("domain_status", None)
if field is not None:
args["domain_status"] = field
else:
args["domain_status"] = None

field = data.get("domain_info", None)
if field is not None:
args["domain_info"] = unmarshal_HostingDomain(field)
Expand Down Expand Up @@ -650,7 +650,7 @@ def unmarshal_DnsRecords(data: Any) -> DnsRecords:
[DomainDnsAction(v) for v in field] if field is not None else None
)
else:
args["dns_config"] = []
args["dns_config"] = None

field = data.get("auto_config_domain_dns", None)
if field is not None:
Expand Down Expand Up @@ -707,7 +707,7 @@ def unmarshal_Domain(data: Any) -> Domain:
[DomainDnsAction(v) for v in field] if field is not None else None
)
else:
args["available_dns_actions"] = []
args["available_dns_actions"] = None

field = data.get("auto_config_domain_dns", None)
if field is not None:
Expand Down Expand Up @@ -1145,12 +1145,6 @@ def unmarshal_Hosting(data: Any) -> Hosting:
else:
args["status"] = HostingStatus.UNKNOWN_STATUS

field = data.get("domain", None)
if field is not None:
args["domain"] = field
else:
args["domain"] = None

field = data.get("updated_at", None)
if field is not None:
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand All @@ -1163,6 +1157,12 @@ def unmarshal_Hosting(data: Any) -> Hosting:
else:
args["created_at"] = None

field = data.get("domain", None)
if field is not None:
args["domain"] = field
else:
args["domain"] = None

field = data.get("offer", None)
if field is not None:
args["offer"] = unmarshal_Offer(field)
Expand All @@ -1181,12 +1181,6 @@ def unmarshal_Hosting(data: Any) -> Hosting:
else:
args["tags"] = []

field = data.get("dns_status", None)
if field is not None:
args["dns_status"] = field
else:
args["dns_status"] = DnsRecordsStatus.UNKNOWN_STATUS

field = data.get("ipv4", None)
if field is not None:
args["ipv4"] = field
Expand All @@ -1199,24 +1193,30 @@ def unmarshal_Hosting(data: Any) -> Hosting:
else:
args["protected"] = False

field = data.get("domain_status", None)
if field is not None:
args["domain_status"] = field
else:
args["domain_status"] = DomainStatus.UNKNOWN_STATUS

field = data.get("region", None)
if field is not None:
args["region"] = field
else:
args["region"] = None

field = data.get("dns_status", None)
if field is not None:
args["dns_status"] = field
else:
args["dns_status"] = None

field = data.get("user", None)
if field is not None:
args["user"] = unmarshal_HostingUser(field)
else:
args["user"] = None

field = data.get("domain_status", None)
if field is not None:
args["domain_status"] = field
else:
args["domain_status"] = None

field = data.get("domain_info", None)
if field is not None:
args["domain_info"] = unmarshal_HostingDomain(field)
Expand Down
Loading
Loading