Skip to content

Commit

Permalink
feat(vpc/v2): expose Subnet fields that v1 exposed (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored May 24, 2024
1 parent 4411e8e commit d040119
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scaleway-async/scaleway_async/vpc/v2/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ def unmarshal_Subnet(data: Any) -> Subnet:
if field is not None:
args["subnet"] = field

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

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

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

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand Down
15 changes: 15 additions & 0 deletions scaleway-async/scaleway_async/vpc/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ class Subnet:
Subnet CIDR.
"""

project_id: str
"""
Scaleway Project the subnet belongs to.
"""

private_network_id: str
"""
Private Network the subnet belongs to.
"""

vpc_id: str
"""
VPC the subnet belongs to.
"""

created_at: Optional[datetime]
"""
Subnet creation date.
Expand Down
12 changes: 12 additions & 0 deletions scaleway/scaleway/vpc/v2/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ def unmarshal_Subnet(data: Any) -> Subnet:
if field is not None:
args["subnet"] = field

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

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

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

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand Down
15 changes: 15 additions & 0 deletions scaleway/scaleway/vpc/v2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ class Subnet:
Subnet CIDR.
"""

project_id: str
"""
Scaleway Project the subnet belongs to.
"""

private_network_id: str
"""
Private Network the subnet belongs to.
"""

vpc_id: str
"""
VPC the subnet belongs to.
"""

created_at: Optional[datetime]
"""
Subnet creation date.
Expand Down

0 comments on commit d040119

Please sign in to comment.