Skip to content

Commit 8f70ba0

Browse files
committed
feat: update generated APIs
1 parent 0b0b9a2 commit 8f70ba0

File tree

8 files changed

+532
-4
lines changed

8 files changed

+532
-4
lines changed

scaleway-async/scaleway_async/applesilicon/v1alpha1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
from .types import ConnectivityDiagnosticDiagnosticStatus
66
from .types import ListServerPrivateNetworksRequestOrderBy
77
from .types import ListServersRequestOrderBy
8+
from .types import RunnerConfigurationProvider
89
from .types import ServerPrivateNetworkServerStatus
910
from .content import SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES
1011
from .types import ServerPrivateNetworkStatus
1112
from .content import SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES
1213
from .types import ServerStatus
1314
from .content import SERVER_TRANSIENT_STATUSES
1415
from .types import ServerTypeStock
16+
from .types import OSSupportedServerType
1517
from .types import Commitment
1618
from .types import OS
19+
from .types import RunnerConfiguration
1720
from .types import ServerTypeCPU
1821
from .types import ServerTypeDisk
1922
from .types import ServerTypeGPU
2023
from .types import ServerTypeMemory
24+
from .types import ServerTypeNPU
2125
from .types import ServerTypeNetwork
2226
from .types import BatchCreateServersRequestBatchInnerCreateServerRequest
2327
from .types import Server
@@ -61,19 +65,23 @@
6165
"ConnectivityDiagnosticDiagnosticStatus",
6266
"ListServerPrivateNetworksRequestOrderBy",
6367
"ListServersRequestOrderBy",
68+
"RunnerConfigurationProvider",
6469
"ServerPrivateNetworkServerStatus",
6570
"SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES",
6671
"ServerPrivateNetworkStatus",
6772
"SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES",
6873
"ServerStatus",
6974
"SERVER_TRANSIENT_STATUSES",
7075
"ServerTypeStock",
76+
"OSSupportedServerType",
7177
"Commitment",
7278
"OS",
79+
"RunnerConfiguration",
7380
"ServerTypeCPU",
7481
"ServerTypeDisk",
7582
"ServerTypeGPU",
7683
"ServerTypeMemory",
84+
"ServerTypeNPU",
7785
"ServerTypeNetwork",
7886
"BatchCreateServersRequestBatchInnerCreateServerRequest",
7987
"Server",

scaleway-async/scaleway_async/applesilicon/v1alpha1/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
PrivateNetworkApiAddServerPrivateNetworkRequest,
3333
PrivateNetworkApiSetServerPrivateNetworksRequest,
3434
ReinstallServerRequest,
35+
RunnerConfiguration,
3536
Server,
3637
ServerPrivateNetwork,
3738
ServerType,
@@ -142,6 +143,7 @@ async def create_server(
142143
project_id: Optional[str] = None,
143144
os_id: Optional[str] = None,
144145
commitment_type: Optional[CommitmentType] = None,
146+
runner_configuration: Optional[RunnerConfiguration] = None,
145147
) -> Server:
146148
"""
147149
Create a server.
@@ -154,6 +156,7 @@ async def create_server(
154156
:param project_id: Create a server in the given project ID.
155157
:param os_id: Create a server & install the given os_id, when no os_id provided the default OS for this server type is chosen. Requesting a non-default OS will induce an extended delivery time.
156158
:param commitment_type: Activate commitment for this server. If not specified, there is a 24h commitment due to Apple licensing (commitment_type `duration_24h`). It can be updated with the Update Server request. Available commitment depends on server type.
159+
:param runner_configuration: Specify the configuration to install an optional CICD runner on the server during installation.
157160
:return: :class:`Server <Server>`
158161
159162
Usage:
@@ -181,6 +184,7 @@ async def create_server(
181184
project_id=project_id,
182185
os_id=os_id,
183186
commitment_type=commitment_type,
187+
runner_configuration=runner_configuration,
184188
),
185189
self.client,
186190
),
@@ -638,13 +642,15 @@ async def reinstall_server(
638642
server_id: str,
639643
zone: Optional[ScwZone] = None,
640644
os_id: Optional[str] = None,
645+
runner_configuration: Optional[RunnerConfiguration] = None,
641646
) -> Server:
642647
"""
643648
Reinstall a server.
644649
Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the defailt configuration values of the image (OS).
645650
:param server_id: UUID of the server you want to reinstall.
646651
:param zone: Zone to target. If none is passed will use default zone from the config.
647652
:param os_id: Reinstall the server with the target OS, when no os_id provided the default OS for the server type is used.
653+
:param runner_configuration: Specify the configuration to install an optional CICD runner on the server during installation.
648654
:return: :class:`Server <Server>`
649655
650656
Usage:
@@ -666,6 +672,7 @@ async def reinstall_server(
666672
server_id=server_id,
667673
zone=zone,
668674
os_id=os_id,
675+
runner_configuration=runner_configuration,
669676
),
670677
self.client,
671678
),

scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@
1111
ServerPrivateNetworkStatus,
1212
ServerStatus,
1313
ServerTypeStock,
14+
OSSupportedServerType,
1415
OS,
1516
Commitment,
17+
RunnerConfiguration,
1618
Server,
1719
ServerPrivateNetwork,
1820
ServerTypeCPU,
1921
ServerTypeDisk,
2022
ServerTypeGPU,
2123
ServerTypeMemory,
24+
ServerTypeNPU,
2225
ServerTypeNetwork,
2326
ServerType,
2427
BatchCreateServersResponse,
@@ -42,6 +45,29 @@
4245
)
4346

4447

48+
def unmarshal_OSSupportedServerType(data: Any) -> OSSupportedServerType:
49+
if not isinstance(data, dict):
50+
raise TypeError(
51+
"Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary."
52+
)
53+
54+
args: dict[str, Any] = {}
55+
56+
field = data.get("server_type", None)
57+
if field is not None:
58+
args["server_type"] = field
59+
else:
60+
args["server_type"] = None
61+
62+
field = data.get("fast_delivery_available", None)
63+
if field is not None:
64+
args["fast_delivery_available"] = field
65+
else:
66+
args["fast_delivery_available"] = None
67+
68+
return OSSupportedServerType(**args)
69+
70+
4571
def unmarshal_OS(data: Any) -> OS:
4672
if not isinstance(data, dict):
4773
raise TypeError(
@@ -98,6 +124,34 @@ def unmarshal_OS(data: Any) -> OS:
98124
else:
99125
args["xcode_version"] = None
100126

127+
field = data.get("release_notes_url", None)
128+
if field is not None:
129+
args["release_notes_url"] = field
130+
else:
131+
args["release_notes_url"] = None
132+
133+
field = data.get("description", None)
134+
if field is not None:
135+
args["description"] = field
136+
else:
137+
args["description"] = None
138+
139+
field = data.get("tags", None)
140+
if field is not None:
141+
args["tags"] = field
142+
else:
143+
args["tags"] = []
144+
145+
field = data.get("supported_server_types", None)
146+
if field is not None:
147+
args["supported_server_types"] = (
148+
[unmarshal_OSSupportedServerType(v) for v in field]
149+
if field is not None
150+
else None
151+
)
152+
else:
153+
args["supported_server_types"] = []
154+
101155
field = data.get("compatible_server_types", None)
102156
if field is not None:
103157
args["compatible_server_types"] = field
@@ -130,6 +184,41 @@ def unmarshal_Commitment(data: Any) -> Commitment:
130184
return Commitment(**args)
131185

132186

187+
def unmarshal_RunnerConfiguration(data: Any) -> RunnerConfiguration:
188+
if not isinstance(data, dict):
189+
raise TypeError(
190+
"Unmarshalling the type 'RunnerConfiguration' failed as data isn't a dictionary."
191+
)
192+
193+
args: dict[str, Any] = {}
194+
195+
field = data.get("name", None)
196+
if field is not None:
197+
args["name"] = field
198+
else:
199+
args["name"] = None
200+
201+
field = data.get("url", None)
202+
if field is not None:
203+
args["url"] = field
204+
else:
205+
args["url"] = None
206+
207+
field = data.get("token", None)
208+
if field is not None:
209+
args["token"] = field
210+
else:
211+
args["token"] = None
212+
213+
field = data.get("provider", None)
214+
if field is not None:
215+
args["provider"] = field
216+
else:
217+
args["provider"] = None
218+
219+
return RunnerConfiguration(**args)
220+
221+
133222
def unmarshal_Server(data: Any) -> Server:
134223
if not isinstance(data, dict):
135224
raise TypeError(
@@ -260,12 +349,24 @@ def unmarshal_Server(data: Any) -> Server:
260349
else:
261350
args["public_bandwidth_bps"] = 0
262351

352+
field = data.get("tags", None)
353+
if field is not None:
354+
args["tags"] = field
355+
else:
356+
args["tags"] = []
357+
263358
field = data.get("commitment", None)
264359
if field is not None:
265360
args["commitment"] = unmarshal_Commitment(field)
266361
else:
267362
args["commitment"] = None
268363

364+
field = data.get("runner_configuration", None)
365+
if field is not None:
366+
args["runner_configuration"] = unmarshal_RunnerConfiguration(field)
367+
else:
368+
args["runner_configuration"] = None
369+
269370
return Server(**args)
270371

271372

@@ -360,6 +461,18 @@ def unmarshal_ServerTypeCPU(data: Any) -> ServerTypeCPU:
360461
else:
361462
args["frequency"] = None
362463

464+
field = data.get("sockets", None)
465+
if field is not None:
466+
args["sockets"] = field
467+
else:
468+
args["sockets"] = None
469+
470+
field = data.get("threads_per_core", None)
471+
if field is not None:
472+
args["threads_per_core"] = field
473+
else:
474+
args["threads_per_core"] = None
475+
363476
return ServerTypeCPU(**args)
364477

365478

@@ -426,6 +539,23 @@ def unmarshal_ServerTypeMemory(data: Any) -> ServerTypeMemory:
426539
return ServerTypeMemory(**args)
427540

428541

542+
def unmarshal_ServerTypeNPU(data: Any) -> ServerTypeNPU:
543+
if not isinstance(data, dict):
544+
raise TypeError(
545+
"Unmarshalling the type 'ServerTypeNPU' failed as data isn't a dictionary."
546+
)
547+
548+
args: dict[str, Any] = {}
549+
550+
field = data.get("count", None)
551+
if field is not None:
552+
args["count"] = field
553+
else:
554+
args["count"] = None
555+
556+
return ServerTypeNPU(**args)
557+
558+
429559
def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork:
430560
if not isinstance(data, dict):
431561
raise TypeError(
@@ -446,6 +576,12 @@ def unmarshal_ServerTypeNetwork(data: Any) -> ServerTypeNetwork:
446576
else:
447577
args["supported_bandwidth"] = None
448578

579+
field = data.get("default_public_bandwidth", None)
580+
if field is not None:
581+
args["default_public_bandwidth"] = field
582+
else:
583+
args["default_public_bandwidth"] = None
584+
449585
return ServerTypeNetwork(**args)
450586

451587

@@ -511,6 +647,12 @@ def unmarshal_ServerType(data: Any) -> ServerType:
511647
else:
512648
args["default_os"] = None
513649

650+
field = data.get("npu", None)
651+
if field is not None:
652+
args["npu"] = unmarshal_ServerTypeNPU(field)
653+
else:
654+
args["npu"] = None
655+
514656
return ServerType(**args)
515657

516658

@@ -822,6 +964,27 @@ def marshal_BatchCreateServersRequest(
822964
return output
823965

824966

967+
def marshal_RunnerConfiguration(
968+
request: RunnerConfiguration,
969+
defaults: ProfileDefaults,
970+
) -> dict[str, Any]:
971+
output: dict[str, Any] = {}
972+
973+
if request.name is not None:
974+
output["name"] = request.name
975+
976+
if request.url is not None:
977+
output["url"] = request.url
978+
979+
if request.token is not None:
980+
output["token"] = request.token
981+
982+
if request.provider is not None:
983+
output["provider"] = request.provider
984+
985+
return output
986+
987+
825988
def marshal_CreateServerRequest(
826989
request: CreateServerRequest,
827990
defaults: ProfileDefaults,
@@ -851,6 +1014,11 @@ def marshal_CreateServerRequest(
8511014
if request.commitment_type is not None:
8521015
output["commitment_type"] = request.commitment_type
8531016

1017+
if request.runner_configuration is not None:
1018+
output["runner_configuration"] = marshal_RunnerConfiguration(
1019+
request.runner_configuration, defaults
1020+
)
1021+
8541022
return output
8551023

8561024

@@ -892,6 +1060,11 @@ def marshal_ReinstallServerRequest(
8921060
if request.os_id is not None:
8931061
output["os_id"] = request.os_id
8941062

1063+
if request.runner_configuration is not None:
1064+
output["runner_configuration"] = marshal_RunnerConfiguration(
1065+
request.runner_configuration, defaults
1066+
)
1067+
8951068
return output
8961069

8971070

0 commit comments

Comments
 (0)