Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webhosting): add hosting domain status #863

Merged
merged 1 commit into from
Feb 21, 2025
Merged
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
54 changes: 36 additions & 18 deletions scaleway-async/scaleway_async/webhosting/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,33 +515,33 @@ def unmarshal_Hosting(data: Any) -> Hosting:
if field is not None:
args["tags"] = field

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

field = data.get("updated_at", None)
if field is not None:
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["updated_at"] = None

field = data.get("ipv4", None)
field = data.get("created_at", None)
if field is not None:
args["ipv4"] = field
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None

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

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

field = data.get("created_at", None)
field = data.get("region", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None
args["region"] = field

field = data.get("offer", None)
if field is not None:
Expand All @@ -555,6 +555,12 @@ def unmarshal_Hosting(data: Any) -> Hosting:
else:
args["platform"] = 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)
Expand Down Expand Up @@ -693,10 +699,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
if field is not None:
args["project_id"] = field

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

field = data.get("domain", None)
if field is not None:
args["domain"] = field
Expand All @@ -705,14 +707,18 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
if field is not None:
args["protected"] = field

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

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

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

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

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

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

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

return HostingSummary(**args)


Expand Down
49 changes: 32 additions & 17 deletions scaleway-async/scaleway_async/webhosting/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,6 @@ class HostingSummary:
ID of the Scaleway Project the Web Hosting plan belongs to.
"""

status: HostingSummaryStatus
"""
Status of the Web Hosting plan.
"""

domain: str
"""
Main domain associated with the Web Hosting plan.
Expand All @@ -594,14 +589,19 @@ class HostingSummary:
Whether the hosting is protected or not.
"""

dns_status: DnsRecordsStatus
offer_name: str
"""
DNS status of the Web Hosting plan.
Name of the active offer for the Web Hosting plan.
"""

offer_name: str
hosting_status: HostingStatus
"""
Name of the active offer for the Web Hosting plan.
Status of the Web Hosting plan.
"""

domain_status: DomainStatus
"""
Main domain status of the Web Hosting plan.
"""

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

status: Optional[HostingSummaryStatus]
"""
Status of the Web Hosting plan.
"""

dns_status: Optional[DnsRecordsStatus]
"""
DNS status of the Web Hosting plan.
"""


@dataclass
class MailAccount:
Expand Down Expand Up @@ -1232,34 +1242,34 @@ class Hosting:
List of tags associated with the Web Hosting plan.
"""

dns_status: DnsRecordsStatus
ipv4: str
"""
DNS status of the Web Hosting plan.
Current IPv4 address of the hosting.
"""

updated_at: Optional[datetime]
"""
Date on which the Web Hosting plan was last updated.
"""

ipv4: str
created_at: Optional[datetime]
"""
Current IPv4 address of the hosting.
Date on which the Web Hosting plan was created.
"""

protected: bool
"""
Whether the hosting is protected or not.
"""

region: ScwRegion
domain_status: DomainStatus
"""
Region where the Web Hosting plan is hosted.
Main domain status of the Web Hosting plan.
"""

created_at: Optional[datetime]
region: ScwRegion
"""
Date on which the Web Hosting plan was created.
Region where the Web Hosting plan is hosted.
"""

offer: Optional[Offer]
Expand All @@ -1272,6 +1282,11 @@ class Hosting:
Details of the hosting platform.
"""

dns_status: Optional[DnsRecordsStatus]
"""
DNS status of the Web Hosting plan.
"""

user: Optional[HostingUser]
"""
Details of the hosting user.
Expand Down
54 changes: 36 additions & 18 deletions scaleway/scaleway/webhosting/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,33 +515,33 @@ def unmarshal_Hosting(data: Any) -> Hosting:
if field is not None:
args["tags"] = field

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

field = data.get("updated_at", None)
if field is not None:
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["updated_at"] = None

field = data.get("ipv4", None)
field = data.get("created_at", None)
if field is not None:
args["ipv4"] = field
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None

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

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

field = data.get("created_at", None)
field = data.get("region", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
else:
args["created_at"] = None
args["region"] = field

field = data.get("offer", None)
if field is not None:
Expand All @@ -555,6 +555,12 @@ def unmarshal_Hosting(data: Any) -> Hosting:
else:
args["platform"] = 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)
Expand Down Expand Up @@ -693,10 +699,6 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
if field is not None:
args["project_id"] = field

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

field = data.get("domain", None)
if field is not None:
args["domain"] = field
Expand All @@ -705,14 +707,18 @@ def unmarshal_HostingSummary(data: Any) -> HostingSummary:
if field is not None:
args["protected"] = field

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

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

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

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

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

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

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

return HostingSummary(**args)


Expand Down
Loading