Skip to content

Commit 5fde01d

Browse files
authored
feat: update generated APIs (#305)
1 parent 5c559b3 commit 5fde01d

File tree

6 files changed

+108
-90
lines changed

6 files changed

+108
-90
lines changed

scaleway-async/scaleway_async/k8s/v1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ async def list_clusters(
107107
name: Optional[str] = None,
108108
status: ClusterStatus = ClusterStatus.UNKNOWN,
109109
type_: Optional[str] = None,
110+
private_network_id: Optional[str] = None,
110111
) -> ListClustersResponse:
111112
"""
112113
List Clusters.
@@ -120,6 +121,7 @@ async def list_clusters(
120121
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
121122
:param status: Status to filter on, only clusters with this status will be returned.
122123
:param type_: Type to filter on, only clusters with this type will be returned.
124+
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
123125
:return: :class:`ListClustersResponse <ListClustersResponse>`
124126
125127
Usage:
@@ -142,6 +144,7 @@ async def list_clusters(
142144
or self.client.default_organization_id,
143145
"page": page,
144146
"page_size": page_size or self.client.default_page_size,
147+
"private_network_id": private_network_id,
145148
"project_id": project_id or self.client.default_project_id,
146149
"status": status,
147150
"type": type_,
@@ -163,6 +166,7 @@ async def list_clusters_all(
163166
name: Optional[str] = None,
164167
status: Optional[ClusterStatus] = None,
165168
type_: Optional[str] = None,
169+
private_network_id: Optional[str] = None,
166170
) -> List[Cluster]:
167171
"""
168172
List Clusters.
@@ -176,6 +180,7 @@ async def list_clusters_all(
176180
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
177181
:param status: Status to filter on, only clusters with this status will be returned.
178182
:param type_: Type to filter on, only clusters with this type will be returned.
183+
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
179184
:return: :class:`List[ListClustersResponse] <List[ListClustersResponse]>`
180185
181186
Usage:
@@ -198,6 +203,7 @@ async def list_clusters_all(
198203
"name": name,
199204
"status": status,
200205
"type_": type_,
206+
"private_network_id": private_network_id,
201207
},
202208
)
203209

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

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757

5858

5959
def unmarshal_MaintenanceWindow(data: Any) -> MaintenanceWindow:
60-
if not isinstance(data, dict):
60+
if type(data) is not dict:
6161
raise TypeError(
62-
"Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary."
62+
f"Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary."
6363
)
6464

6565
args: Dict[str, Any] = {}
@@ -74,9 +74,9 @@ def unmarshal_MaintenanceWindow(data: Any) -> MaintenanceWindow:
7474

7575

7676
def unmarshal_ClusterAutoUpgrade(data: Any) -> ClusterAutoUpgrade:
77-
if not isinstance(data, dict):
77+
if type(data) is not dict:
7878
raise TypeError(
79-
"Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary."
79+
f"Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary."
8080
)
8181

8282
args: Dict[str, Any] = {}
@@ -93,9 +93,9 @@ def unmarshal_ClusterAutoUpgrade(data: Any) -> ClusterAutoUpgrade:
9393

9494

9595
def unmarshal_ClusterAutoscalerConfig(data: Any) -> ClusterAutoscalerConfig:
96-
if not isinstance(data, dict):
96+
if type(data) is not dict:
9797
raise TypeError(
98-
"Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary."
98+
f"Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary."
9999
)
100100

101101
args: Dict[str, Any] = {}
@@ -134,9 +134,9 @@ def unmarshal_ClusterAutoscalerConfig(data: Any) -> ClusterAutoscalerConfig:
134134

135135

136136
def unmarshal_ClusterOpenIDConnectConfig(data: Any) -> ClusterOpenIDConnectConfig:
137-
if not isinstance(data, dict):
137+
if type(data) is not dict:
138138
raise TypeError(
139-
"Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary."
139+
f"Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary."
140140
)
141141

142142
args: Dict[str, Any] = {}
@@ -166,9 +166,9 @@ def unmarshal_ClusterOpenIDConnectConfig(data: Any) -> ClusterOpenIDConnectConfi
166166

167167

168168
def unmarshal_PoolUpgradePolicy(data: Any) -> PoolUpgradePolicy:
169-
if not isinstance(data, dict):
169+
if type(data) is not dict:
170170
raise TypeError(
171-
"Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary."
171+
f"Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary."
172172
)
173173

174174
args: Dict[str, Any] = {}
@@ -183,9 +183,9 @@ def unmarshal_PoolUpgradePolicy(data: Any) -> PoolUpgradePolicy:
183183

184184

185185
def unmarshal_Cluster(data: Any) -> Cluster:
186-
if not isinstance(data, dict):
186+
if type(data) is not dict:
187187
raise TypeError(
188-
"Unmarshalling the type 'Cluster' failed as data isn't a dictionary."
188+
f"Unmarshalling the type 'Cluster' failed as data isn't a dictionary."
189189
)
190190

191191
args: Dict[str, Any] = {}
@@ -213,12 +213,10 @@ def unmarshal_Cluster(data: Any) -> Cluster:
213213
args["cni"] = field
214214

215215
field = data.get("commitment_ends_at", None)
216-
args["commitment_ends_at"] = (
217-
parser.isoparse(field) if isinstance(field, str) else field
218-
)
216+
args["commitment_ends_at"] = parser.isoparse(field) if type(field) is str else field
219217

220218
field = data.get("created_at", None)
221-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
219+
args["created_at"] = parser.isoparse(field) if type(field) is str else field
222220

223221
field = data.get("dashboard_enabled", None)
224222
args["dashboard_enabled"] = field
@@ -268,7 +266,7 @@ def unmarshal_Cluster(data: Any) -> Cluster:
268266
args["type_"] = field
269267

270268
field = data.get("updated_at", None)
271-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
269+
args["updated_at"] = parser.isoparse(field) if type(field) is str else field
272270

273271
field = data.get("upgrade_available", None)
274272
args["upgrade_available"] = field
@@ -280,9 +278,9 @@ def unmarshal_Cluster(data: Any) -> Cluster:
280278

281279

282280
def unmarshal_ClusterType(data: Any) -> ClusterType:
283-
if not isinstance(data, dict):
281+
if type(data) is not dict:
284282
raise TypeError(
285-
"Unmarshalling the type 'ClusterType' failed as data isn't a dictionary."
283+
f"Unmarshalling the type 'ClusterType' failed as data isn't a dictionary."
286284
)
287285

288286
args: Dict[str, Any] = {}
@@ -315,9 +313,9 @@ def unmarshal_ClusterType(data: Any) -> ClusterType:
315313

316314

317315
def unmarshal_Node(data: Any) -> Node:
318-
if not isinstance(data, dict):
316+
if type(data) is not dict:
319317
raise TypeError(
320-
"Unmarshalling the type 'Node' failed as data isn't a dictionary."
318+
f"Unmarshalling the type 'Node' failed as data isn't a dictionary."
321319
)
322320

323321
args: Dict[str, Any] = {}
@@ -329,7 +327,7 @@ def unmarshal_Node(data: Any) -> Node:
329327
args["conditions"] = field
330328

331329
field = data.get("created_at", None)
332-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
330+
args["created_at"] = parser.isoparse(field) if type(field) is str else field
333331

334332
field = data.get("error_message", None)
335333
args["error_message"] = field
@@ -359,15 +357,15 @@ def unmarshal_Node(data: Any) -> Node:
359357
args["status"] = field
360358

361359
field = data.get("updated_at", None)
362-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
360+
args["updated_at"] = parser.isoparse(field) if type(field) is str else field
363361

364362
return Node(**args)
365363

366364

367365
def unmarshal_Pool(data: Any) -> Pool:
368-
if not isinstance(data, dict):
366+
if type(data) is not dict:
369367
raise TypeError(
370-
"Unmarshalling the type 'Pool' failed as data isn't a dictionary."
368+
f"Unmarshalling the type 'Pool' failed as data isn't a dictionary."
371369
)
372370

373371
args: Dict[str, Any] = {}
@@ -385,7 +383,7 @@ def unmarshal_Pool(data: Any) -> Pool:
385383
args["container_runtime"] = field
386384

387385
field = data.get("created_at", None)
388-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
386+
args["created_at"] = parser.isoparse(field) if type(field) is str else field
389387

390388
field = data.get("id", None)
391389
args["id"] = field
@@ -427,7 +425,7 @@ def unmarshal_Pool(data: Any) -> Pool:
427425
args["tags"] = field
428426

429427
field = data.get("updated_at", None)
430-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
428+
args["updated_at"] = parser.isoparse(field) if type(field) is str else field
431429

432430
field = data.get("upgrade_policy", None)
433431
args["upgrade_policy"] = (
@@ -444,9 +442,9 @@ def unmarshal_Pool(data: Any) -> Pool:
444442

445443

446444
def unmarshal_Version(data: Any) -> Version:
447-
if not isinstance(data, dict):
445+
if type(data) is not dict:
448446
raise TypeError(
449-
"Unmarshalling the type 'Version' failed as data isn't a dictionary."
447+
f"Unmarshalling the type 'Version' failed as data isn't a dictionary."
450448
)
451449

452450
args: Dict[str, Any] = {}
@@ -482,9 +480,9 @@ def unmarshal_Version(data: Any) -> Version:
482480

483481

484482
def unmarshal_ExternalNode(data: Any) -> ExternalNode:
485-
if not isinstance(data, dict):
483+
if type(data) is not dict:
486484
raise TypeError(
487-
"Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary."
485+
f"Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary."
488486
)
489487

490488
args: Dict[str, Any] = {}
@@ -519,9 +517,9 @@ def unmarshal_ExternalNode(data: Any) -> ExternalNode:
519517
def unmarshal_ListClusterAvailableTypesResponse(
520518
data: Any,
521519
) -> ListClusterAvailableTypesResponse:
522-
if not isinstance(data, dict):
520+
if type(data) is not dict:
523521
raise TypeError(
524-
"Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary."
522+
f"Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary."
525523
)
526524

527525
args: Dict[str, Any] = {}
@@ -540,9 +538,9 @@ def unmarshal_ListClusterAvailableTypesResponse(
540538
def unmarshal_ListClusterAvailableVersionsResponse(
541539
data: Any,
542540
) -> ListClusterAvailableVersionsResponse:
543-
if not isinstance(data, dict):
541+
if type(data) is not dict:
544542
raise TypeError(
545-
"Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary."
543+
f"Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary."
546544
)
547545

548546
args: Dict[str, Any] = {}
@@ -556,9 +554,9 @@ def unmarshal_ListClusterAvailableVersionsResponse(
556554

557555

558556
def unmarshal_ListClusterTypesResponse(data: Any) -> ListClusterTypesResponse:
559-
if not isinstance(data, dict):
557+
if type(data) is not dict:
560558
raise TypeError(
561-
"Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary."
559+
f"Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary."
562560
)
563561

564562
args: Dict[str, Any] = {}
@@ -575,9 +573,9 @@ def unmarshal_ListClusterTypesResponse(data: Any) -> ListClusterTypesResponse:
575573

576574

577575
def unmarshal_ListClustersResponse(data: Any) -> ListClustersResponse:
578-
if not isinstance(data, dict):
576+
if type(data) is not dict:
579577
raise TypeError(
580-
"Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary."
578+
f"Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary."
581579
)
582580

583581
args: Dict[str, Any] = {}
@@ -594,9 +592,9 @@ def unmarshal_ListClustersResponse(data: Any) -> ListClustersResponse:
594592

595593

596594
def unmarshal_ListNodesResponse(data: Any) -> ListNodesResponse:
597-
if not isinstance(data, dict):
595+
if type(data) is not dict:
598596
raise TypeError(
599-
"Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary."
597+
f"Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary."
600598
)
601599

602600
args: Dict[str, Any] = {}
@@ -611,9 +609,9 @@ def unmarshal_ListNodesResponse(data: Any) -> ListNodesResponse:
611609

612610

613611
def unmarshal_ListPoolsResponse(data: Any) -> ListPoolsResponse:
614-
if not isinstance(data, dict):
612+
if type(data) is not dict:
615613
raise TypeError(
616-
"Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary."
614+
f"Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary."
617615
)
618616

619617
args: Dict[str, Any] = {}
@@ -628,9 +626,9 @@ def unmarshal_ListPoolsResponse(data: Any) -> ListPoolsResponse:
628626

629627

630628
def unmarshal_ListVersionsResponse(data: Any) -> ListVersionsResponse:
631-
if not isinstance(data, dict):
629+
if type(data) is not dict:
632630
raise TypeError(
633-
"Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary."
631+
f"Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary."
634632
)
635633

636634
args: Dict[str, Any] = {}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,11 @@ class ListClustersRequest:
12871287
Type to filter on, only clusters with this type will be returned.
12881288
"""
12891289

1290+
private_network_id: Optional[str]
1291+
"""
1292+
Private Network ID to filter on, only clusters within this Private Network will be returned.
1293+
"""
1294+
12901295

12911296
@dataclass
12921297
class CreateClusterRequest:

scaleway/scaleway/k8s/v1/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def list_clusters(
107107
name: Optional[str] = None,
108108
status: ClusterStatus = ClusterStatus.UNKNOWN,
109109
type_: Optional[str] = None,
110+
private_network_id: Optional[str] = None,
110111
) -> ListClustersResponse:
111112
"""
112113
List Clusters.
@@ -120,6 +121,7 @@ def list_clusters(
120121
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
121122
:param status: Status to filter on, only clusters with this status will be returned.
122123
:param type_: Type to filter on, only clusters with this type will be returned.
124+
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
123125
:return: :class:`ListClustersResponse <ListClustersResponse>`
124126
125127
Usage:
@@ -142,6 +144,7 @@ def list_clusters(
142144
or self.client.default_organization_id,
143145
"page": page,
144146
"page_size": page_size or self.client.default_page_size,
147+
"private_network_id": private_network_id,
145148
"project_id": project_id or self.client.default_project_id,
146149
"status": status,
147150
"type": type_,
@@ -163,6 +166,7 @@ def list_clusters_all(
163166
name: Optional[str] = None,
164167
status: Optional[ClusterStatus] = None,
165168
type_: Optional[str] = None,
169+
private_network_id: Optional[str] = None,
166170
) -> List[Cluster]:
167171
"""
168172
List Clusters.
@@ -176,6 +180,7 @@ def list_clusters_all(
176180
:param name: Name to filter on, only clusters containing this substring in their name will be returned.
177181
:param status: Status to filter on, only clusters with this status will be returned.
178182
:param type_: Type to filter on, only clusters with this type will be returned.
183+
:param private_network_id: Private Network ID to filter on, only clusters within this Private Network will be returned.
179184
:return: :class:`List[ListClustersResponse] <List[ListClustersResponse]>`
180185
181186
Usage:
@@ -198,6 +203,7 @@ def list_clusters_all(
198203
"name": name,
199204
"status": status,
200205
"type_": type_,
206+
"private_network_id": private_network_id,
201207
},
202208
)
203209

0 commit comments

Comments
 (0)