Skip to content

Commit 9d81a09

Browse files
fix(ipam/v1): allow source field to be null in responses (#554)
Co-authored-by: Jonathan R <jremy@scaleway.com>
1 parent 0632509 commit 9d81a09

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ def unmarshal_IP(data: Any) -> IP:
126126
if field is not None:
127127
args["is_ipv6"] = field
128128

129-
field = data.get("source", None)
130-
if field is not None:
131-
args["source"] = unmarshal_Source(field)
132-
133129
field = data.get("tags", None)
134130
if field is not None:
135131
args["tags"] = field
@@ -156,6 +152,12 @@ def unmarshal_IP(data: Any) -> IP:
156152
else:
157153
args["updated_at"] = None
158154

155+
field = data.get("source", None)
156+
if field is not None:
157+
args["source"] = unmarshal_Source(field)
158+
else:
159+
args["source"] = None
160+
159161
field = data.get("resource", None)
160162
if field is not None:
161163
args["resource"] = unmarshal_Resource(field)

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ class IP:
116116
Defines whether the IP is an IPv6 (false = IPv4).
117117
"""
118118

119-
source: Source
120-
"""
121-
Source pool where the IP was booked in.
122-
"""
123-
124119
tags: List[str]
125120
"""
126121
Tags for the IP.
@@ -146,6 +141,11 @@ class IP:
146141
Date the IP was last modified.
147142
"""
148143

144+
source: Optional[Source]
145+
"""
146+
Source pool where the IP was booked in.
147+
"""
148+
149149
resource: Optional[Resource]
150150
"""
151151
Resource which the IP is attached to.

scaleway/scaleway/ipam/v1/marshalling.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ def unmarshal_IP(data: Any) -> IP:
126126
if field is not None:
127127
args["is_ipv6"] = field
128128

129-
field = data.get("source", None)
130-
if field is not None:
131-
args["source"] = unmarshal_Source(field)
132-
133129
field = data.get("tags", None)
134130
if field is not None:
135131
args["tags"] = field
@@ -156,6 +152,12 @@ def unmarshal_IP(data: Any) -> IP:
156152
else:
157153
args["updated_at"] = None
158154

155+
field = data.get("source", None)
156+
if field is not None:
157+
args["source"] = unmarshal_Source(field)
158+
else:
159+
args["source"] = None
160+
159161
field = data.get("resource", None)
160162
if field is not None:
161163
args["resource"] = unmarshal_Resource(field)

scaleway/scaleway/ipam/v1/types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ class IP:
116116
Defines whether the IP is an IPv6 (false = IPv4).
117117
"""
118118

119-
source: Source
120-
"""
121-
Source pool where the IP was booked in.
122-
"""
123-
124119
tags: List[str]
125120
"""
126121
Tags for the IP.
@@ -146,6 +141,11 @@ class IP:
146141
Date the IP was last modified.
147142
"""
148143

144+
source: Optional[Source]
145+
"""
146+
Source pool where the IP was booked in.
147+
"""
148+
149149
resource: Optional[Resource]
150150
"""
151151
Resource which the IP is attached to.

0 commit comments

Comments
 (0)