Skip to content

Commit 52424e9

Browse files
fix(webhosting): add hosting status naming (#875)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent e74ccfb commit 52424e9

File tree

8 files changed

+20
-92
lines changed

8 files changed

+20
-92
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from .types import DomainZoneOwner
1414
from .types import HostingStatus
1515
from .content import HOSTING_TRANSIENT_STATUSES
16-
from .types import HostingSummaryStatus
17-
from .content import HOSTING_SUMMARY_TRANSIENT_STATUSES
1816
from .types import ListDatabaseUsersRequestOrderBy
1917
from .types import ListDatabasesRequestOrderBy
2018
from .types import ListFtpAccountsRequestOrderBy
@@ -120,8 +118,6 @@
120118
"DomainZoneOwner",
121119
"HostingStatus",
122120
"HOSTING_TRANSIENT_STATUSES",
123-
"HostingSummaryStatus",
124-
"HOSTING_SUMMARY_TRANSIENT_STATUSES",
125121
"ListDatabaseUsersRequestOrderBy",
126122
"ListDatabasesRequestOrderBy",
127123
"ListFtpAccountsRequestOrderBy",

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
DomainAvailabilityStatus,
77
DomainStatus,
88
HostingStatus,
9-
HostingSummaryStatus,
109
)
1110

1211
DOMAIN_AVAILABILITY_TRANSIENT_STATUSES: List[DomainAvailabilityStatus] = [
@@ -29,11 +28,3 @@
2928
"""
3029
Lists transient statutes of the enum :class:`HostingStatus <HostingStatus>`.
3130
"""
32-
HOSTING_SUMMARY_TRANSIENT_STATUSES: List[HostingSummaryStatus] = [
33-
HostingSummaryStatus.DELIVERING,
34-
HostingSummaryStatus.DELETING,
35-
HostingSummaryStatus.MIGRATING,
36-
]
37-
"""
38-
Lists transient statutes of the enum :class:`HostingSummaryStatus <HostingSummaryStatus>`.
39-
"""

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,10 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
705705
if field is not None:
706706
args["project_id"] = field
707707

708+
field = data.get("status", None)
709+
if field is not None:
710+
args["status"] = field
711+
708712
field = data.get("domain", None)
709713
if field is not None:
710714
args["domain"] = field
@@ -717,10 +721,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
717721
if field is not None:
718722
args["offer_name"] = field
719723

720-
field = data.get("hosting_status", None)
721-
if field is not None:
722-
args["hosting_status"] = field
723-
724724
field = data.get("domain_status", None)
725725
if field is not None:
726726
args["domain_status"] = field
@@ -741,12 +741,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
741741
else:
742742
args["updated_at"] = None
743743

744-
field = data.get("status", None)
745-
if field is not None:
746-
args["status"] = field
747-
else:
748-
args["status"] = None
749-
750744
field = data.get("dns_status", None)
751745
if field is not None:
752746
args["dns_status"] = field

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

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class DomainDnsAction(str, Enum, metaclass=StrEnumMeta):
8989
AUTO_CONFIG_WEB_RECORDS = "auto_config_web_records"
9090
AUTO_CONFIG_MAIL_RECORDS = "auto_config_mail_records"
9191
AUTO_CONFIG_NAMESERVERS = "auto_config_nameservers"
92+
AUTO_CONFIG_NONE = "auto_config_none"
9293

9394
def __str__(self) -> str:
9495
return str(self.value)
@@ -129,19 +130,6 @@ def __str__(self) -> str:
129130
return str(self.value)
130131

131132

132-
class HostingSummaryStatus(str, Enum, metaclass=StrEnumMeta):
133-
UNKNOWN_STATUS = "unknown_status"
134-
DELIVERING = "delivering"
135-
READY = "ready"
136-
DELETING = "deleting"
137-
ERROR = "error"
138-
LOCKED = "locked"
139-
MIGRATING = "migrating"
140-
141-
def __str__(self) -> str:
142-
return str(self.value)
143-
144-
145133
class ListDatabaseUsersRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
146134
USERNAME_ASC = "username_asc"
147135
USERNAME_DESC = "username_desc"
@@ -579,6 +567,11 @@ class HostingSummary:
579567
ID of the Scaleway Project the Web Hosting plan belongs to.
580568
"""
581569

570+
status: HostingStatus
571+
"""
572+
Status of the Web Hosting plan.
573+
"""
574+
582575
domain: str
583576
"""
584577
Main domain associated with the Web Hosting plan.
@@ -594,11 +587,6 @@ class HostingSummary:
594587
Name of the active offer for the Web Hosting plan.
595588
"""
596589

597-
hosting_status: HostingStatus
598-
"""
599-
Status of the Web Hosting plan.
600-
"""
601-
602590
domain_status: DomainStatus
603591
"""
604592
Main domain status of the Web Hosting plan.
@@ -619,11 +607,6 @@ class HostingSummary:
619607
Date on which the Web Hosting plan was last updated.
620608
"""
621609

622-
status: Optional[HostingSummaryStatus]
623-
"""
624-
Status of the Web Hosting plan.
625-
"""
626-
627610
dns_status: Optional[DnsRecordsStatus]
628611
"""
629612
DNS status of the Web Hosting plan.

scaleway/scaleway/webhosting/v1/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from .types import DomainZoneOwner
1414
from .types import HostingStatus
1515
from .content import HOSTING_TRANSIENT_STATUSES
16-
from .types import HostingSummaryStatus
17-
from .content import HOSTING_SUMMARY_TRANSIENT_STATUSES
1816
from .types import ListDatabaseUsersRequestOrderBy
1917
from .types import ListDatabasesRequestOrderBy
2018
from .types import ListFtpAccountsRequestOrderBy
@@ -120,8 +118,6 @@
120118
"DomainZoneOwner",
121119
"HostingStatus",
122120
"HOSTING_TRANSIENT_STATUSES",
123-
"HostingSummaryStatus",
124-
"HOSTING_SUMMARY_TRANSIENT_STATUSES",
125121
"ListDatabaseUsersRequestOrderBy",
126122
"ListDatabasesRequestOrderBy",
127123
"ListFtpAccountsRequestOrderBy",

scaleway/scaleway/webhosting/v1/content.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
DomainAvailabilityStatus,
77
DomainStatus,
88
HostingStatus,
9-
HostingSummaryStatus,
109
)
1110

1211
DOMAIN_AVAILABILITY_TRANSIENT_STATUSES: List[DomainAvailabilityStatus] = [
@@ -29,11 +28,3 @@
2928
"""
3029
Lists transient statutes of the enum :class:`HostingStatus <HostingStatus>`.
3130
"""
32-
HOSTING_SUMMARY_TRANSIENT_STATUSES: List[HostingSummaryStatus] = [
33-
HostingSummaryStatus.DELIVERING,
34-
HostingSummaryStatus.DELETING,
35-
HostingSummaryStatus.MIGRATING,
36-
]
37-
"""
38-
Lists transient statutes of the enum :class:`HostingSummaryStatus <HostingSummaryStatus>`.
39-
"""

scaleway/scaleway/webhosting/v1/marshalling.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,10 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
705705
if field is not None:
706706
args["project_id"] = field
707707

708+
field = data.get("status", None)
709+
if field is not None:
710+
args["status"] = field
711+
708712
field = data.get("domain", None)
709713
if field is not None:
710714
args["domain"] = field
@@ -717,10 +721,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
717721
if field is not None:
718722
args["offer_name"] = field
719723

720-
field = data.get("hosting_status", None)
721-
if field is not None:
722-
args["hosting_status"] = field
723-
724724
field = data.get("domain_status", None)
725725
if field is not None:
726726
args["domain_status"] = field
@@ -741,12 +741,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
741741
else:
742742
args["updated_at"] = None
743743

744-
field = data.get("status", None)
745-
if field is not None:
746-
args["status"] = field
747-
else:
748-
args["status"] = None
749-
750744
field = data.get("dns_status", None)
751745
if field is not None:
752746
args["dns_status"] = field

scaleway/scaleway/webhosting/v1/types.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class DomainDnsAction(str, Enum, metaclass=StrEnumMeta):
8989
AUTO_CONFIG_WEB_RECORDS = "auto_config_web_records"
9090
AUTO_CONFIG_MAIL_RECORDS = "auto_config_mail_records"
9191
AUTO_CONFIG_NAMESERVERS = "auto_config_nameservers"
92+
AUTO_CONFIG_NONE = "auto_config_none"
9293

9394
def __str__(self) -> str:
9495
return str(self.value)
@@ -129,19 +130,6 @@ def __str__(self) -> str:
129130
return str(self.value)
130131

131132

132-
class HostingSummaryStatus(str, Enum, metaclass=StrEnumMeta):
133-
UNKNOWN_STATUS = "unknown_status"
134-
DELIVERING = "delivering"
135-
READY = "ready"
136-
DELETING = "deleting"
137-
ERROR = "error"
138-
LOCKED = "locked"
139-
MIGRATING = "migrating"
140-
141-
def __str__(self) -> str:
142-
return str(self.value)
143-
144-
145133
class ListDatabaseUsersRequestOrderBy(str, Enum, metaclass=StrEnumMeta):
146134
USERNAME_ASC = "username_asc"
147135
USERNAME_DESC = "username_desc"
@@ -579,6 +567,11 @@ class HostingSummary:
579567
ID of the Scaleway Project the Web Hosting plan belongs to.
580568
"""
581569

570+
status: HostingStatus
571+
"""
572+
Status of the Web Hosting plan.
573+
"""
574+
582575
domain: str
583576
"""
584577
Main domain associated with the Web Hosting plan.
@@ -594,11 +587,6 @@ class HostingSummary:
594587
Name of the active offer for the Web Hosting plan.
595588
"""
596589

597-
hosting_status: HostingStatus
598-
"""
599-
Status of the Web Hosting plan.
600-
"""
601-
602590
domain_status: DomainStatus
603591
"""
604592
Main domain status of the Web Hosting plan.
@@ -619,11 +607,6 @@ class HostingSummary:
619607
Date on which the Web Hosting plan was last updated.
620608
"""
621609

622-
status: Optional[HostingSummaryStatus]
623-
"""
624-
Status of the Web Hosting plan.
625-
"""
626-
627610
dns_status: Optional[DnsRecordsStatus]
628611
"""
629612
DNS status of the Web Hosting plan.

0 commit comments

Comments
 (0)