Skip to content

Commit 132d691

Browse files
authored
fix(webhosting): add hosting domain status (#863)
1 parent 2f2d13c commit 132d691

File tree

4 files changed

+136
-70
lines changed

4 files changed

+136
-70
lines changed

scaleway-async/scaleway_async/webhosting/v1/marshalling.py

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -515,33 +515,33 @@ def unmarshal_Hosting(data: Any) -> Hosting:
515515
if field is not None:
516516
args["tags"] = field
517517

518-
field = data.get("dns_status", None)
518+
field = data.get("ipv4", None)
519519
if field is not None:
520-
args["dns_status"] = field
520+
args["ipv4"] = field
521521

522522
field = data.get("updated_at", None)
523523
if field is not None:
524524
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
525525
else:
526526
args["updated_at"] = None
527527

528-
field = data.get("ipv4", None)
528+
field = data.get("created_at", None)
529529
if field is not None:
530-
args["ipv4"] = field
530+
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
531+
else:
532+
args["created_at"] = None
531533

532534
field = data.get("protected", None)
533535
if field is not None:
534536
args["protected"] = field
535537

536-
field = data.get("region", None)
538+
field = data.get("domain_status", None)
537539
if field is not None:
538-
args["region"] = field
540+
args["domain_status"] = field
539541

540-
field = data.get("created_at", None)
542+
field = data.get("region", None)
541543
if field is not None:
542-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
543-
else:
544-
args["created_at"] = None
544+
args["region"] = field
545545

546546
field = data.get("offer", None)
547547
if field is not None:
@@ -555,6 +555,12 @@ def unmarshal_Hosting(data: Any) -> Hosting:
555555
else:
556556
args["platform"] = None
557557

558+
field = data.get("dns_status", None)
559+
if field is not None:
560+
args["dns_status"] = field
561+
else:
562+
args["dns_status"] = None
563+
558564
field = data.get("user", None)
559565
if field is not None:
560566
args["user"] = unmarshal_HostingUser(field)
@@ -693,10 +699,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
693699
if field is not None:
694700
args["project_id"] = field
695701

696-
field = data.get("status", None)
697-
if field is not None:
698-
args["status"] = field
699-
700702
field = data.get("domain", None)
701703
if field is not None:
702704
args["domain"] = field
@@ -705,14 +707,18 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
705707
if field is not None:
706708
args["protected"] = field
707709

708-
field = data.get("dns_status", None)
709-
if field is not None:
710-
args["dns_status"] = field
711-
712710
field = data.get("offer_name", None)
713711
if field is not None:
714712
args["offer_name"] = field
715713

714+
field = data.get("hosting_status", None)
715+
if field is not None:
716+
args["hosting_status"] = field
717+
718+
field = data.get("domain_status", None)
719+
if field is not None:
720+
args["domain_status"] = field
721+
716722
field = data.get("region", None)
717723
if field is not None:
718724
args["region"] = field
@@ -729,6 +735,18 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
729735
else:
730736
args["updated_at"] = None
731737

738+
field = data.get("status", None)
739+
if field is not None:
740+
args["status"] = field
741+
else:
742+
args["status"] = None
743+
744+
field = data.get("dns_status", None)
745+
if field is not None:
746+
args["dns_status"] = field
747+
else:
748+
args["dns_status"] = None
749+
732750
return HostingSummary(**args)
733751

734752

scaleway-async/scaleway_async/webhosting/v1/types.py

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -579,11 +579,6 @@ class HostingSummary:
579579
ID of the Scaleway Project the Web Hosting plan belongs to.
580580
"""
581581

582-
status: HostingSummaryStatus
583-
"""
584-
Status of the Web Hosting plan.
585-
"""
586-
587582
domain: str
588583
"""
589584
Main domain associated with the Web Hosting plan.
@@ -594,14 +589,19 @@ class HostingSummary:
594589
Whether the hosting is protected or not.
595590
"""
596591

597-
dns_status: DnsRecordsStatus
592+
offer_name: str
598593
"""
599-
DNS status of the Web Hosting plan.
594+
Name of the active offer for the Web Hosting plan.
600595
"""
601596

602-
offer_name: str
597+
hosting_status: HostingStatus
603598
"""
604-
Name of the active offer for the Web Hosting plan.
599+
Status of the Web Hosting plan.
600+
"""
601+
602+
domain_status: DomainStatus
603+
"""
604+
Main domain status of the Web Hosting plan.
605605
"""
606606

607607
region: ScwRegion
@@ -619,6 +619,16 @@ class HostingSummary:
619619
Date on which the Web Hosting plan was last updated.
620620
"""
621621

622+
status: Optional[HostingSummaryStatus]
623+
"""
624+
Status of the Web Hosting plan.
625+
"""
626+
627+
dns_status: Optional[DnsRecordsStatus]
628+
"""
629+
DNS status of the Web Hosting plan.
630+
"""
631+
622632

623633
@dataclass
624634
class MailAccount:
@@ -1232,34 +1242,34 @@ class Hosting:
12321242
List of tags associated with the Web Hosting plan.
12331243
"""
12341244

1235-
dns_status: DnsRecordsStatus
1245+
ipv4: str
12361246
"""
1237-
DNS status of the Web Hosting plan.
1247+
Current IPv4 address of the hosting.
12381248
"""
12391249

12401250
updated_at: Optional[datetime]
12411251
"""
12421252
Date on which the Web Hosting plan was last updated.
12431253
"""
12441254

1245-
ipv4: str
1255+
created_at: Optional[datetime]
12461256
"""
1247-
Current IPv4 address of the hosting.
1257+
Date on which the Web Hosting plan was created.
12481258
"""
12491259

12501260
protected: bool
12511261
"""
12521262
Whether the hosting is protected or not.
12531263
"""
12541264

1255-
region: ScwRegion
1265+
domain_status: DomainStatus
12561266
"""
1257-
Region where the Web Hosting plan is hosted.
1267+
Main domain status of the Web Hosting plan.
12581268
"""
12591269

1260-
created_at: Optional[datetime]
1270+
region: ScwRegion
12611271
"""
1262-
Date on which the Web Hosting plan was created.
1272+
Region where the Web Hosting plan is hosted.
12631273
"""
12641274

12651275
offer: Optional[Offer]
@@ -1272,6 +1282,11 @@ class Hosting:
12721282
Details of the hosting platform.
12731283
"""
12741284

1285+
dns_status: Optional[DnsRecordsStatus]
1286+
"""
1287+
DNS status of the Web Hosting plan.
1288+
"""
1289+
12751290
user: Optional[HostingUser]
12761291
"""
12771292
Details of the hosting user.

scaleway/scaleway/webhosting/v1/marshalling.py

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -515,33 +515,33 @@ def unmarshal_Hosting(data: Any) -> Hosting:
515515
if field is not None:
516516
args["tags"] = field
517517

518-
field = data.get("dns_status", None)
518+
field = data.get("ipv4", None)
519519
if field is not None:
520-
args["dns_status"] = field
520+
args["ipv4"] = field
521521

522522
field = data.get("updated_at", None)
523523
if field is not None:
524524
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
525525
else:
526526
args["updated_at"] = None
527527

528-
field = data.get("ipv4", None)
528+
field = data.get("created_at", None)
529529
if field is not None:
530-
args["ipv4"] = field
530+
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
531+
else:
532+
args["created_at"] = None
531533

532534
field = data.get("protected", None)
533535
if field is not None:
534536
args["protected"] = field
535537

536-
field = data.get("region", None)
538+
field = data.get("domain_status", None)
537539
if field is not None:
538-
args["region"] = field
540+
args["domain_status"] = field
539541

540-
field = data.get("created_at", None)
542+
field = data.get("region", None)
541543
if field is not None:
542-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
543-
else:
544-
args["created_at"] = None
544+
args["region"] = field
545545

546546
field = data.get("offer", None)
547547
if field is not None:
@@ -555,6 +555,12 @@ def unmarshal_Hosting(data: Any) -> Hosting:
555555
else:
556556
args["platform"] = None
557557

558+
field = data.get("dns_status", None)
559+
if field is not None:
560+
args["dns_status"] = field
561+
else:
562+
args["dns_status"] = None
563+
558564
field = data.get("user", None)
559565
if field is not None:
560566
args["user"] = unmarshal_HostingUser(field)
@@ -693,10 +699,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
693699
if field is not None:
694700
args["project_id"] = field
695701

696-
field = data.get("status", None)
697-
if field is not None:
698-
args["status"] = field
699-
700702
field = data.get("domain", None)
701703
if field is not None:
702704
args["domain"] = field
@@ -705,14 +707,18 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
705707
if field is not None:
706708
args["protected"] = field
707709

708-
field = data.get("dns_status", None)
709-
if field is not None:
710-
args["dns_status"] = field
711-
712710
field = data.get("offer_name", None)
713711
if field is not None:
714712
args["offer_name"] = field
715713

714+
field = data.get("hosting_status", None)
715+
if field is not None:
716+
args["hosting_status"] = field
717+
718+
field = data.get("domain_status", None)
719+
if field is not None:
720+
args["domain_status"] = field
721+
716722
field = data.get("region", None)
717723
if field is not None:
718724
args["region"] = field
@@ -729,6 +735,18 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
729735
else:
730736
args["updated_at"] = None
731737

738+
field = data.get("status", None)
739+
if field is not None:
740+
args["status"] = field
741+
else:
742+
args["status"] = None
743+
744+
field = data.get("dns_status", None)
745+
if field is not None:
746+
args["dns_status"] = field
747+
else:
748+
args["dns_status"] = None
749+
732750
return HostingSummary(**args)
733751

734752

0 commit comments

Comments
 (0)