@scaleway/sdk-dedibox 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1439 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const content_gen = require("./content.gen.cjs");
5
+ const marshalling_gen = require("./marshalling.gen.cjs");
6
+ const jsonContentHeaders = {
7
+ "Content-Type": "application/json; charset=utf-8"
8
+ };
9
+ class API extends sdkClient.API {
10
+ /** Lists the available zones of the API. */
11
+ static LOCALITIES = [
12
+ "fr-par-1",
13
+ "fr-par-2",
14
+ "nl-ams-1"
15
+ ];
16
+ pageOfListServers = (request = {}) => this.client.fetch(
17
+ {
18
+ method: "GET",
19
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`,
20
+ urlParams: sdkClient.urlParams(
21
+ ["order_by", request.orderBy],
22
+ ["page", request.page],
23
+ [
24
+ "page_size",
25
+ request.pageSize ?? this.client.settings.defaultPageSize
26
+ ],
27
+ [
28
+ "project_id",
29
+ request.projectId ?? this.client.settings.defaultProjectId
30
+ ],
31
+ ["search", request.search]
32
+ )
33
+ },
34
+ marshalling_gen.unmarshalListServersResponse
35
+ );
36
+ /**
37
+ * List baremetal servers for project.
38
+ *
39
+ * @param request - The request {@link ListServersRequest}
40
+ * @returns A Promise of ListServersResponse
41
+ */
42
+ listServers = (request = {}) => sdkClient.enrichForPagination("servers", this.pageOfListServers, request);
43
+ /**
44
+ * Get a specific baremetal server. Get the server associated with the given ID.
45
+ *
46
+ * @param request - The request {@link GetServerRequest}
47
+ * @returns A Promise of Server
48
+ */
49
+ getServer = (request) => this.client.fetch(
50
+ {
51
+ method: "GET",
52
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
53
+ },
54
+ marshalling_gen.unmarshalServer
55
+ );
56
+ /**
57
+ * Waits for {@link Server} to be in a final state.
58
+ *
59
+ * @param request - The request {@link GetServerRequest}
60
+ * @param options - The waiting options
61
+ * @returns A Promise of Server
62
+ */
63
+ waitForServer = (request, options) => sdkClient.waitForResource(
64
+ options?.stop ?? ((res) => Promise.resolve(
65
+ !content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status)
66
+ )),
67
+ this.getServer,
68
+ request,
69
+ options
70
+ );
71
+ getServerBackup = (request) => this.client.fetch(
72
+ {
73
+ method: "GET",
74
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/backups`
75
+ },
76
+ marshalling_gen.unmarshalBackup
77
+ );
78
+ updateServerBackup = (request) => this.client.fetch(
79
+ {
80
+ body: JSON.stringify(
81
+ marshalling_gen.marshalUpdateServerBackupRequest(request, this.client.settings)
82
+ ),
83
+ headers: jsonContentHeaders,
84
+ method: "PATCH",
85
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/backups`
86
+ },
87
+ marshalling_gen.unmarshalBackup
88
+ );
89
+ pageOfListSubscribableServerOptions = (request) => this.client.fetch(
90
+ {
91
+ method: "GET",
92
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/subscribable-server-options`,
93
+ urlParams: sdkClient.urlParams(
94
+ ["page", request.page],
95
+ [
96
+ "page_size",
97
+ request.pageSize ?? this.client.settings.defaultPageSize
98
+ ]
99
+ )
100
+ },
101
+ marshalling_gen.unmarshalListSubscribableServerOptionsResponse
102
+ );
103
+ /**
104
+ * List subscribable server options. List subscribable options associated to the given server ID.
105
+ *
106
+ * @param request - The request {@link ListSubscribableServerOptionsRequest}
107
+ * @returns A Promise of ListSubscribableServerOptionsResponse
108
+ */
109
+ listSubscribableServerOptions = (request) => sdkClient.enrichForPagination(
110
+ "serverOptions",
111
+ this.pageOfListSubscribableServerOptions,
112
+ request
113
+ );
114
+ /**
115
+ * Subscribe server option. Subscribe option for the given server ID.
116
+ *
117
+ * @param request - The request {@link SubscribeServerOptionRequest}
118
+ * @returns A Promise of Service
119
+ */
120
+ subscribeServerOption = (request) => this.client.fetch(
121
+ {
122
+ body: JSON.stringify(
123
+ marshalling_gen.marshalSubscribeServerOptionRequest(request, this.client.settings)
124
+ ),
125
+ headers: jsonContentHeaders,
126
+ method: "PATCH",
127
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/subscribe-server-option`
128
+ },
129
+ marshalling_gen.unmarshalService
130
+ );
131
+ /**
132
+ * Create a baremetal server. Create a new baremetal server. The order return you a service ID to follow the provisionning status you could call GetService.
133
+ *
134
+ * @param request - The request {@link CreateServerRequest}
135
+ * @returns A Promise of Service
136
+ */
137
+ createServer = (request) => this.client.fetch(
138
+ {
139
+ body: JSON.stringify(
140
+ marshalling_gen.marshalCreateServerRequest(request, this.client.settings)
141
+ ),
142
+ headers: jsonContentHeaders,
143
+ method: "POST",
144
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`
145
+ },
146
+ marshalling_gen.unmarshalService
147
+ );
148
+ /**
149
+ * Subscribe storage server option. Subscribe storage option for the given server ID.
150
+ *
151
+ * @param request - The request {@link SubscribeStorageOptionsRequest}
152
+ * @returns A Promise of SubscribeStorageOptionsResponse
153
+ */
154
+ subscribeStorageOptions = (request) => this.client.fetch(
155
+ {
156
+ body: JSON.stringify(
157
+ marshalling_gen.marshalSubscribeStorageOptionsRequest(request, this.client.settings)
158
+ ),
159
+ headers: jsonContentHeaders,
160
+ method: "POST",
161
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/subscribe-storage-options`
162
+ },
163
+ marshalling_gen.unmarshalSubscribeStorageOptionsResponse
164
+ );
165
+ /**
166
+ * Update a baremetal server. Update the server associated with the given ID.
167
+ *
168
+ * @param request - The request {@link UpdateServerRequest}
169
+ * @returns A Promise of Server
170
+ */
171
+ updateServer = (request) => this.client.fetch(
172
+ {
173
+ body: JSON.stringify(
174
+ marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)
175
+ ),
176
+ headers: jsonContentHeaders,
177
+ method: "PATCH",
178
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
179
+ },
180
+ marshalling_gen.unmarshalServer
181
+ );
182
+ updateServerTags = (request) => this.client.fetch(
183
+ {
184
+ body: JSON.stringify(
185
+ marshalling_gen.marshalUpdateServerTagsRequest(request, this.client.settings)
186
+ ),
187
+ headers: jsonContentHeaders,
188
+ method: "POST",
189
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/tags`
190
+ },
191
+ marshalling_gen.unmarshalServer
192
+ );
193
+ /**
194
+ * Reboot a baremetal server. Reboot the server associated with the given ID, use boot param to reboot in rescue.
195
+ *
196
+ * @param request - The request {@link RebootServerRequest}
197
+ */
198
+ rebootServer = (request) => this.client.fetch({
199
+ body: "{}",
200
+ headers: jsonContentHeaders,
201
+ method: "POST",
202
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/reboot`
203
+ });
204
+ /**
205
+ * Start a baremetal server. Start the server associated with the given ID.
206
+ *
207
+ * @param request - The request {@link StartServerRequest}
208
+ */
209
+ startServer = (request) => this.client.fetch({
210
+ body: "{}",
211
+ headers: jsonContentHeaders,
212
+ method: "POST",
213
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/start`
214
+ });
215
+ /**
216
+ * Stop a baremetal server. Stop the server associated with the given ID.
217
+ *
218
+ * @param request - The request {@link StopServerRequest}
219
+ */
220
+ stopServer = (request) => this.client.fetch({
221
+ body: "{}",
222
+ headers: jsonContentHeaders,
223
+ method: "POST",
224
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/stop`
225
+ });
226
+ /**
227
+ * Delete a baremetal server. Delete the server associated with the given ID.
228
+ *
229
+ * @param request - The request {@link DeleteServerRequest}
230
+ */
231
+ deleteServer = (request) => this.client.fetch({
232
+ method: "DELETE",
233
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}`
234
+ });
235
+ pageOfListServerEvents = (request) => this.client.fetch(
236
+ {
237
+ method: "GET",
238
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/events`,
239
+ urlParams: sdkClient.urlParams(
240
+ ["order_by", request.orderBy],
241
+ ["page", request.page],
242
+ [
243
+ "page_size",
244
+ request.pageSize ?? this.client.settings.defaultPageSize
245
+ ]
246
+ )
247
+ },
248
+ marshalling_gen.unmarshalListServerEventsResponse
249
+ );
250
+ /**
251
+ * List server events. List events associated to the given server ID.
252
+ *
253
+ * @param request - The request {@link ListServerEventsRequest}
254
+ * @returns A Promise of ListServerEventsResponse
255
+ */
256
+ listServerEvents = (request) => sdkClient.enrichForPagination("events", this.pageOfListServerEvents, request);
257
+ pageOfListServerDisks = (request) => this.client.fetch(
258
+ {
259
+ method: "GET",
260
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/disks`,
261
+ urlParams: sdkClient.urlParams(
262
+ ["order_by", request.orderBy],
263
+ ["page", request.page],
264
+ [
265
+ "page_size",
266
+ request.pageSize ?? this.client.settings.defaultPageSize
267
+ ]
268
+ )
269
+ },
270
+ marshalling_gen.unmarshalListServerDisksResponse
271
+ );
272
+ /**
273
+ * List server disks. List disks associated to the given server ID.
274
+ *
275
+ * @param request - The request {@link ListServerDisksRequest}
276
+ * @returns A Promise of ListServerDisksResponse
277
+ */
278
+ listServerDisks = (request) => sdkClient.enrichForPagination("disks", this.pageOfListServerDisks, request);
279
+ getOrderedService = (request) => this.client.fetch(
280
+ {
281
+ method: "GET",
282
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ordered-services/${sdkClient.validatePathParam("orderedServiceId", request.orderedServiceId)}`
283
+ },
284
+ marshalling_gen.unmarshalService
285
+ );
286
+ /**
287
+ * Get a specific service. Get the service associated with the given ID.
288
+ *
289
+ * @param request - The request {@link GetServiceRequest}
290
+ * @returns A Promise of Service
291
+ */
292
+ getService = (request) => this.client.fetch(
293
+ {
294
+ body: "{}",
295
+ headers: jsonContentHeaders,
296
+ method: "PATCH",
297
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${sdkClient.validatePathParam("serviceId", request.serviceId)}`
298
+ },
299
+ marshalling_gen.unmarshalService
300
+ );
301
+ /**
302
+ * Delete a specific service. Delete the service associated with the given ID.
303
+ *
304
+ * @param request - The request {@link DeleteServiceRequest}
305
+ * @returns A Promise of Service
306
+ */
307
+ deleteService = (request) => this.client.fetch(
308
+ {
309
+ method: "DELETE",
310
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${sdkClient.validatePathParam("serviceId", request.serviceId)}`
311
+ },
312
+ marshalling_gen.unmarshalService
313
+ );
314
+ pageOfListServices = (request = {}) => this.client.fetch(
315
+ {
316
+ method: "GET",
317
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services`,
318
+ urlParams: sdkClient.urlParams(
319
+ ["order_by", request.orderBy],
320
+ ["page", request.page],
321
+ [
322
+ "page_size",
323
+ request.pageSize ?? this.client.settings.defaultPageSize
324
+ ],
325
+ ["project_id", request.projectId]
326
+ )
327
+ },
328
+ marshalling_gen.unmarshalListServicesResponse
329
+ );
330
+ /**
331
+ * List services.
332
+ *
333
+ * @param request - The request {@link ListServicesRequest}
334
+ * @returns A Promise of ListServicesResponse
335
+ */
336
+ listServices = (request = {}) => sdkClient.enrichForPagination("services", this.pageOfListServices, request);
337
+ /**
338
+ * Install a baremetal server. Install an OS on the server associated with the given ID.
339
+ *
340
+ * @param request - The request {@link InstallServerRequest}
341
+ * @returns A Promise of ServerInstall
342
+ */
343
+ installServer = (request) => this.client.fetch(
344
+ {
345
+ body: JSON.stringify(
346
+ marshalling_gen.marshalInstallServerRequest(request, this.client.settings)
347
+ ),
348
+ headers: jsonContentHeaders,
349
+ method: "POST",
350
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/install`
351
+ },
352
+ marshalling_gen.unmarshalServerInstall
353
+ );
354
+ /**
355
+ * Get a specific server installation status. Get the server installation status associated with the given server ID.
356
+ *
357
+ * @param request - The request {@link GetServerInstallRequest}
358
+ * @returns A Promise of ServerInstall
359
+ */
360
+ getServerInstall = (request) => this.client.fetch(
361
+ {
362
+ method: "GET",
363
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/install`
364
+ },
365
+ marshalling_gen.unmarshalServerInstall
366
+ );
367
+ /**
368
+ * Waits for {@link ServerInstall} to be in a final state.
369
+ *
370
+ * @param request - The request {@link GetServerInstallRequest}
371
+ * @param options - The waiting options
372
+ * @returns A Promise of ServerInstall
373
+ */
374
+ waitForServerInstall = (request, options) => sdkClient.waitForResource(
375
+ options?.stop ?? ((res) => Promise.resolve(
376
+ !content_gen.SERVER_INSTALL_TRANSIENT_STATUSES.includes(res.status)
377
+ )),
378
+ this.getServerInstall,
379
+ request,
380
+ options
381
+ );
382
+ /**
383
+ * Cancels the current (running) server installation. Cancels the current server installation associated with the given server ID.
384
+ *
385
+ * @param request - The request {@link CancelServerInstallRequest}
386
+ */
387
+ cancelServerInstall = (request) => this.client.fetch({
388
+ method: "POST",
389
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/cancel-install`
390
+ });
391
+ /**
392
+ * Get server default partitioning. Get the server default partitioning schema associated with the given server ID and OS ID.
393
+ *
394
+ * @param request - The request {@link GetServerDefaultPartitioningRequest}
395
+ * @returns A Promise of ServerDefaultPartitioning
396
+ */
397
+ getServerDefaultPartitioning = (request) => this.client.fetch(
398
+ {
399
+ method: "GET",
400
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/partitioning/${sdkClient.validatePathParam("osId", request.osId)}`
401
+ },
402
+ marshalling_gen.unmarshalServerDefaultPartitioning
403
+ );
404
+ /**
405
+ * Start BMC (Baseboard Management Controller) access for a given baremetal server. Start BMC (Baseboard Management Controller) access associated with the given ID.
406
+ The BMC (Baseboard Management Controller) access is available one hour after the installation of the server.
407
+ *
408
+ * @param request - The request {@link StartBMCAccessRequest}
409
+ */
410
+ startBMCAccess = (request) => this.client.fetch({
411
+ body: JSON.stringify(
412
+ marshalling_gen.marshalStartBMCAccessRequest(request, this.client.settings)
413
+ ),
414
+ headers: jsonContentHeaders,
415
+ method: "POST",
416
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/bmc-access`
417
+ });
418
+ /**
419
+ * Get BMC (Baseboard Management Controller) access for a given baremetal server. Get the BMC (Baseboard Management Controller) access associated with the given ID.
420
+ *
421
+ * @param request - The request {@link GetBMCAccessRequest}
422
+ * @returns A Promise of BMCAccess
423
+ */
424
+ getBMCAccess = (request) => this.client.fetch(
425
+ {
426
+ method: "GET",
427
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/bmc-access`
428
+ },
429
+ marshalling_gen.unmarshalBMCAccess
430
+ );
431
+ /**
432
+ * Waits for {@link BMCAccess} to be in a final state.
433
+ *
434
+ * @param request - The request {@link GetBMCAccessRequest}
435
+ * @param options - The waiting options
436
+ * @returns A Promise of BMCAccess
437
+ */
438
+ waitForBMCAccess = (request, options) => sdkClient.waitForResource(
439
+ options?.stop ?? ((res) => Promise.resolve(
440
+ !content_gen.BMC_ACCESS_TRANSIENT_STATUSES.includes(res.status)
441
+ )),
442
+ this.getBMCAccess,
443
+ request,
444
+ options
445
+ );
446
+ /**
447
+ * Stop BMC (Baseboard Management Controller) access for a given baremetal server. Stop BMC (Baseboard Management Controller) access associated with the given ID.
448
+ *
449
+ * @param request - The request {@link StopBMCAccessRequest}
450
+ */
451
+ stopBMCAccess = (request) => this.client.fetch({
452
+ method: "DELETE",
453
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/bmc-access`
454
+ });
455
+ pageOfListOffers = (request = {}) => this.client.fetch(
456
+ {
457
+ method: "GET",
458
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`,
459
+ urlParams: sdkClient.urlParams(
460
+ ["available_only", request.availableOnly],
461
+ ["catalog", request.catalog],
462
+ ["commercial_range", request.commercialRange],
463
+ ["is_failover_block", request.isFailoverBlock],
464
+ ["is_failover_ip", request.isFailoverIp],
465
+ ["is_rpn_san", request.isRpnSan],
466
+ ["order_by", request.orderBy],
467
+ ["page", request.page],
468
+ [
469
+ "page_size",
470
+ request.pageSize ?? this.client.settings.defaultPageSize
471
+ ],
472
+ ["project_id", request.projectId],
473
+ [
474
+ "sold_in",
475
+ request.soldIn && request.soldIn.length > 0 ? request.soldIn.join(",") : void 0
476
+ ]
477
+ )
478
+ },
479
+ marshalling_gen.unmarshalListOffersResponse
480
+ );
481
+ /**
482
+ * List offers. List all available server offers.
483
+ *
484
+ * @param request - The request {@link ListOffersRequest}
485
+ * @returns A Promise of ListOffersResponse
486
+ */
487
+ listOffers = (request = {}) => sdkClient.enrichForPagination("offers", this.pageOfListOffers, request);
488
+ /**
489
+ * Get offer. Return specific offer for the given ID.
490
+ *
491
+ * @param request - The request {@link GetOfferRequest}
492
+ * @returns A Promise of Offer
493
+ */
494
+ getOffer = (request) => this.client.fetch(
495
+ {
496
+ method: "GET",
497
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${sdkClient.validatePathParam("offerId", request.offerId)}`,
498
+ urlParams: sdkClient.urlParams(["project_id", request.projectId])
499
+ },
500
+ marshalling_gen.unmarshalOffer
501
+ );
502
+ pageOfListOS = (request) => this.client.fetch(
503
+ {
504
+ method: "GET",
505
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`,
506
+ urlParams: sdkClient.urlParams(
507
+ ["order_by", request.orderBy],
508
+ ["page", request.page],
509
+ [
510
+ "page_size",
511
+ request.pageSize ?? this.client.settings.defaultPageSize
512
+ ],
513
+ ["project_id", request.projectId],
514
+ ["server_id", request.serverId],
515
+ ["type", request.type]
516
+ )
517
+ },
518
+ marshalling_gen.unmarshalListOSResponse
519
+ );
520
+ /**
521
+ * List all available OS that can be install on a baremetal server.
522
+ *
523
+ * @param request - The request {@link ListOSRequest}
524
+ * @returns A Promise of ListOSResponse
525
+ */
526
+ listOS = (request) => sdkClient.enrichForPagination("os", this.pageOfListOS, request);
527
+ /**
528
+ * Get an OS with a given ID. Return specific OS for the given ID.
529
+ *
530
+ * @param request - The request {@link GetOSRequest}
531
+ * @returns A Promise of OS
532
+ */
533
+ getOS = (request) => this.client.fetch(
534
+ {
535
+ method: "GET",
536
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${sdkClient.validatePathParam("osId", request.osId)}`,
537
+ urlParams: sdkClient.urlParams(
538
+ ["project_id", request.projectId],
539
+ ["server_id", request.serverId]
540
+ )
541
+ },
542
+ marshalling_gen.unmarshalOS
543
+ );
544
+ /**
545
+ * Update reverse of ip. Update reverse of ip associated with the given ID.
546
+ *
547
+ * @param request - The request {@link UpdateReverseRequest}
548
+ * @returns A Promise of IP
549
+ */
550
+ updateReverse = (request) => this.client.fetch(
551
+ {
552
+ body: JSON.stringify(
553
+ marshalling_gen.marshalUpdateReverseRequest(request, this.client.settings)
554
+ ),
555
+ headers: jsonContentHeaders,
556
+ method: "PATCH",
557
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/reverses/${sdkClient.validatePathParam("ipId", request.ipId)}`
558
+ },
559
+ marshalling_gen.unmarshalIP
560
+ );
561
+ /**
562
+ * Order failover IPs. Order X failover IPs.
563
+ *
564
+ * @param request - The request {@link CreateFailoverIPsRequest}
565
+ * @returns A Promise of CreateFailoverIPsResponse
566
+ */
567
+ createFailoverIPs = (request) => this.client.fetch(
568
+ {
569
+ body: JSON.stringify(
570
+ marshalling_gen.marshalCreateFailoverIPsRequest(request, this.client.settings)
571
+ ),
572
+ headers: jsonContentHeaders,
573
+ method: "POST",
574
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips`
575
+ },
576
+ marshalling_gen.unmarshalCreateFailoverIPsResponse
577
+ );
578
+ /**
579
+ * Attach failovers on baremetal server. Attach failovers on the server associated with the given ID.
580
+ *
581
+ * @param request - The request {@link AttachFailoverIPsRequest}
582
+ */
583
+ attachFailoverIPs = (request) => this.client.fetch({
584
+ body: JSON.stringify(
585
+ marshalling_gen.marshalAttachFailoverIPsRequest(request, this.client.settings)
586
+ ),
587
+ headers: jsonContentHeaders,
588
+ method: "POST",
589
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach`
590
+ });
591
+ /**
592
+ * Detach failovers on baremetal server. Detach failovers on the server associated with the given ID.
593
+ *
594
+ * @param request - The request {@link DetachFailoverIPsRequest}
595
+ */
596
+ detachFailoverIPs = (request) => this.client.fetch({
597
+ body: JSON.stringify(
598
+ marshalling_gen.marshalDetachFailoverIPsRequest(request, this.client.settings)
599
+ ),
600
+ headers: jsonContentHeaders,
601
+ method: "POST",
602
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach`
603
+ });
604
+ /**
605
+ * Attach a failover IP to a MAC address.
606
+ *
607
+ * @param request - The request {@link AttachFailoverIPToMacAddressRequest}
608
+ * @returns A Promise of IP
609
+ */
610
+ attachFailoverIPToMacAddress = (request) => this.client.fetch(
611
+ {
612
+ body: JSON.stringify(
613
+ marshalling_gen.marshalAttachFailoverIPToMacAddressRequest(
614
+ request,
615
+ this.client.settings
616
+ )
617
+ ),
618
+ headers: jsonContentHeaders,
619
+ method: "POST",
620
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${sdkClient.validatePathParam("ipId", request.ipId)}/attach-to-mac-address`
621
+ },
622
+ marshalling_gen.unmarshalIP
623
+ );
624
+ /**
625
+ * Detach a failover IP from a MAC address.
626
+ *
627
+ * @param request - The request {@link DetachFailoverIPFromMacAddressRequest}
628
+ * @returns A Promise of IP
629
+ */
630
+ detachFailoverIPFromMacAddress = (request) => this.client.fetch(
631
+ {
632
+ body: "{}",
633
+ headers: jsonContentHeaders,
634
+ method: "POST",
635
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${sdkClient.validatePathParam("ipId", request.ipId)}/detach-from-mac-address`
636
+ },
637
+ marshalling_gen.unmarshalIP
638
+ );
639
+ /**
640
+ * Delete a failover server. Delete the failover associated with the given ID.
641
+ *
642
+ * @param request - The request {@link DeleteFailoverIPRequest}
643
+ */
644
+ deleteFailoverIP = (request) => this.client.fetch({
645
+ method: "DELETE",
646
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
647
+ });
648
+ pageOfListFailoverIPs = (request = {}) => this.client.fetch(
649
+ {
650
+ method: "GET",
651
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips`,
652
+ urlParams: sdkClient.urlParams(
653
+ ["only_available", request.onlyAvailable],
654
+ ["order_by", request.orderBy],
655
+ ["page", request.page],
656
+ [
657
+ "page_size",
658
+ request.pageSize ?? this.client.settings.defaultPageSize
659
+ ],
660
+ [
661
+ "project_id",
662
+ request.projectId ?? this.client.settings.defaultProjectId
663
+ ],
664
+ ["search", request.search]
665
+ )
666
+ },
667
+ marshalling_gen.unmarshalListFailoverIPsResponse
668
+ );
669
+ /**
670
+ * List failovers for project. List failovers servers for project.
671
+ *
672
+ * @param request - The request {@link ListFailoverIPsRequest}
673
+ * @returns A Promise of ListFailoverIPsResponse
674
+ */
675
+ listFailoverIPs = (request = {}) => sdkClient.enrichForPagination("failoverIps", this.pageOfListFailoverIPs, request);
676
+ /**
677
+ * Get a specific baremetal server. Get the server associated with the given ID.
678
+ *
679
+ * @param request - The request {@link GetFailoverIPRequest}
680
+ * @returns A Promise of FailoverIP
681
+ */
682
+ getFailoverIP = (request) => this.client.fetch(
683
+ {
684
+ method: "GET",
685
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${sdkClient.validatePathParam("ipId", request.ipId)}`
686
+ },
687
+ marshalling_gen.unmarshalFailoverIP
688
+ );
689
+ /**
690
+ * Get remaining quota.
691
+ *
692
+ * @param request - The request {@link GetRemainingQuotaRequest}
693
+ * @returns A Promise of GetRemainingQuotaResponse
694
+ */
695
+ getRemainingQuota = (request = {}) => this.client.fetch(
696
+ {
697
+ method: "GET",
698
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/remaining-quota`,
699
+ urlParams: sdkClient.urlParams(["project_id", request.projectId])
700
+ },
701
+ marshalling_gen.unmarshalGetRemainingQuotaResponse
702
+ );
703
+ /**
704
+ * Get raid. Return raid for the given server ID.
705
+ *
706
+ * @param request - The request {@link GetRaidRequest}
707
+ * @returns A Promise of Raid
708
+ */
709
+ getRaid = (request) => this.client.fetch(
710
+ {
711
+ method: "GET",
712
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/raid`
713
+ },
714
+ marshalling_gen.unmarshalRaid
715
+ );
716
+ /**
717
+ * Update RAID. Update RAID associated with the given server ID.
718
+ *
719
+ * @param request - The request {@link UpdateRaidRequest}
720
+ */
721
+ updateRaid = (request) => this.client.fetch({
722
+ body: JSON.stringify(
723
+ marshalling_gen.marshalUpdateRaidRequest(request, this.client.settings)
724
+ ),
725
+ headers: jsonContentHeaders,
726
+ method: "POST",
727
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/update-raid`
728
+ });
729
+ /**
730
+ * Start in rescue baremetal server. Start in rescue the server associated with the given ID.
731
+ *
732
+ * @param request - The request {@link StartRescueRequest}
733
+ * @returns A Promise of Rescue
734
+ */
735
+ startRescue = (request) => this.client.fetch(
736
+ {
737
+ body: JSON.stringify(
738
+ marshalling_gen.marshalStartRescueRequest(request, this.client.settings)
739
+ ),
740
+ headers: jsonContentHeaders,
741
+ method: "POST",
742
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/rescue`
743
+ },
744
+ marshalling_gen.unmarshalRescue
745
+ );
746
+ /**
747
+ * Get rescue information. Return rescue information for the given server ID.
748
+ *
749
+ * @param request - The request {@link GetRescueRequest}
750
+ * @returns A Promise of Rescue
751
+ */
752
+ getRescue = (request) => this.client.fetch(
753
+ {
754
+ method: "GET",
755
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/rescue`
756
+ },
757
+ marshalling_gen.unmarshalRescue
758
+ );
759
+ /**
760
+ * Stop rescue on baremetal server. Stop rescue on the server associated with the given ID.
761
+ *
762
+ * @param request - The request {@link StopRescueRequest}
763
+ */
764
+ stopRescue = (request) => this.client.fetch({
765
+ method: "DELETE",
766
+ path: `/dedibox/v1/zones/${sdkClient.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${sdkClient.validatePathParam("serverId", request.serverId)}/rescue`
767
+ });
768
+ }
769
+ class BillingAPI extends sdkClient.API {
770
+ pageOfListInvoices = (request = {}) => this.client.fetch(
771
+ {
772
+ method: "GET",
773
+ path: `/dedibox/v1/invoices`,
774
+ urlParams: sdkClient.urlParams(
775
+ ["order_by", request.orderBy],
776
+ ["page", request.page],
777
+ [
778
+ "page_size",
779
+ request.pageSize ?? this.client.settings.defaultPageSize
780
+ ],
781
+ ["project_id", request.projectId]
782
+ )
783
+ },
784
+ marshalling_gen.unmarshalListInvoicesResponse
785
+ );
786
+ listInvoices = (request = {}) => sdkClient.enrichForPagination("invoices", this.pageOfListInvoices, request);
787
+ getInvoice = (request) => this.client.fetch(
788
+ {
789
+ method: "GET",
790
+ path: `/dedibox/v1/invoices/${sdkClient.validatePathParam("invoiceId", request.invoiceId)}`
791
+ },
792
+ marshalling_gen.unmarshalInvoice
793
+ );
794
+ downloadInvoice = (request) => this.client.fetch({
795
+ method: "GET",
796
+ path: `/dedibox/v1/invoices/${sdkClient.validatePathParam("invoiceId", request.invoiceId)}/download`,
797
+ urlParams: sdkClient.urlParams(["dl", 1]),
798
+ responseType: "blob"
799
+ });
800
+ pageOfListRefunds = (request = {}) => this.client.fetch(
801
+ {
802
+ method: "GET",
803
+ path: `/dedibox/v1/refunds`,
804
+ urlParams: sdkClient.urlParams(
805
+ ["order_by", request.orderBy],
806
+ ["page", request.page],
807
+ [
808
+ "page_size",
809
+ request.pageSize ?? this.client.settings.defaultPageSize
810
+ ],
811
+ ["project_id", request.projectId]
812
+ )
813
+ },
814
+ marshalling_gen.unmarshalListRefundsResponse
815
+ );
816
+ listRefunds = (request = {}) => sdkClient.enrichForPagination("refunds", this.pageOfListRefunds, request);
817
+ getRefund = (request) => this.client.fetch(
818
+ {
819
+ method: "GET",
820
+ path: `/dedibox/v1/refunds/${sdkClient.validatePathParam("refundId", request.refundId)}`
821
+ },
822
+ marshalling_gen.unmarshalRefund
823
+ );
824
+ downloadRefund = (request) => this.client.fetch({
825
+ method: "GET",
826
+ path: `/dedibox/v1/refunds/${sdkClient.validatePathParam("refundId", request.refundId)}/download`,
827
+ urlParams: sdkClient.urlParams(["dl", 1]),
828
+ responseType: "blob"
829
+ });
830
+ canOrder = (request = {}) => this.client.fetch(
831
+ {
832
+ method: "GET",
833
+ path: `/dedibox/v1/can-order`,
834
+ urlParams: sdkClient.urlParams([
835
+ "project_id",
836
+ request.projectId ?? this.client.settings.defaultProjectId
837
+ ])
838
+ },
839
+ marshalling_gen.unmarshalCanOrderResponse
840
+ );
841
+ }
842
+ class IPv6BlockAPI extends sdkClient.API {
843
+ /**
844
+ * Get IPv6 block quota. Get IPv6 block quota with the given project ID.
845
+ /48 one per organization.
846
+ /56 link to your number of server.
847
+ /64 link to your number of failover IP.
848
+ *
849
+ * @param request - The request {@link IPv6BlockApiGetIPv6BlockQuotasRequest}
850
+ * @returns A Promise of GetIPv6BlockQuotasResponse
851
+ */
852
+ getIPv6BlockQuotas = (request = {}) => this.client.fetch(
853
+ {
854
+ method: "GET",
855
+ path: `/dedibox/v1/ipv6-block-quotas`,
856
+ urlParams: sdkClient.urlParams(["project_id", request.projectId])
857
+ },
858
+ marshalling_gen.unmarshalGetIPv6BlockQuotasResponse
859
+ );
860
+ /**
861
+ * Create IPv6 block for baremetal server. Create IPv6 block associated with the given project ID.
862
+ *
863
+ * @param request - The request {@link IPv6BlockApiCreateIPv6BlockRequest}
864
+ * @returns A Promise of IPv6Block
865
+ */
866
+ createIPv6Block = (request = {}) => this.client.fetch(
867
+ {
868
+ body: JSON.stringify(
869
+ marshalling_gen.marshalIPv6BlockApiCreateIPv6BlockRequest(
870
+ request,
871
+ this.client.settings
872
+ )
873
+ ),
874
+ headers: jsonContentHeaders,
875
+ method: "POST",
876
+ path: `/dedibox/v1/ipv6-block`
877
+ },
878
+ marshalling_gen.unmarshalIPv6Block
879
+ );
880
+ /**
881
+ * Get a specific IPv6 block. Get the IPv6 block associated with the given ID.
882
+ *
883
+ * @param request - The request {@link IPv6BlockApiGetIPv6BlockRequest}
884
+ * @returns A Promise of IPv6Block
885
+ */
886
+ getIPv6Block = (request = {}) => this.client.fetch(
887
+ {
888
+ method: "GET",
889
+ path: `/dedibox/v1/ipv6-block`,
890
+ urlParams: sdkClient.urlParams(["project_id", request.projectId])
891
+ },
892
+ marshalling_gen.unmarshalIPv6Block
893
+ );
894
+ /**
895
+ * Update IPv6 block. Update DNS associated to IPv6 block.
896
+ If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate).
897
+ *
898
+ * @param request - The request {@link IPv6BlockApiUpdateIPv6BlockRequest}
899
+ * @returns A Promise of IPv6Block
900
+ */
901
+ updateIPv6Block = (request) => this.client.fetch(
902
+ {
903
+ body: JSON.stringify(
904
+ marshalling_gen.marshalIPv6BlockApiUpdateIPv6BlockRequest(
905
+ request,
906
+ this.client.settings
907
+ )
908
+ ),
909
+ headers: jsonContentHeaders,
910
+ method: "PATCH",
911
+ path: `/dedibox/v1/ipv6-blocks/${sdkClient.validatePathParam("blockId", request.blockId)}`
912
+ },
913
+ marshalling_gen.unmarshalIPv6Block
914
+ );
915
+ /**
916
+ * Delete IPv6 block. Delete IPv6 block subnet with the given ID.
917
+ *
918
+ * @param request - The request {@link IPv6BlockApiDeleteIPv6BlockRequest}
919
+ */
920
+ deleteIPv6Block = (request) => this.client.fetch({
921
+ method: "DELETE",
922
+ path: `/dedibox/v1/ipv6-blocks/${sdkClient.validatePathParam("blockId", request.blockId)}`
923
+ });
924
+ /**
925
+ * Create IPv6 block subnet. Create IPv6 block subnet for the given IP ID.
926
+ /48 could create subnet in /56 (quota link to your number of server).
927
+ /56 could create subnet in /64 (quota link to your number of failover IP).
928
+ *
929
+ * @param request - The request {@link IPv6BlockApiCreateIPv6BlockSubnetRequest}
930
+ * @returns A Promise of IPv6Block
931
+ */
932
+ createIPv6BlockSubnet = (request) => this.client.fetch(
933
+ {
934
+ body: JSON.stringify(
935
+ marshalling_gen.marshalIPv6BlockApiCreateIPv6BlockSubnetRequest(
936
+ request,
937
+ this.client.settings
938
+ )
939
+ ),
940
+ headers: jsonContentHeaders,
941
+ method: "POST",
942
+ path: `/dedibox/v1/ipv6-blocks/${sdkClient.validatePathParam("blockId", request.blockId)}/subnets`
943
+ },
944
+ marshalling_gen.unmarshalIPv6Block
945
+ );
946
+ /**
947
+ * List available IPv6 block subnets. List all available IPv6 block subnets for given IP ID.
948
+ *
949
+ * @param request - The request {@link IPv6BlockApiListIPv6BlockSubnetsAvailableRequest}
950
+ * @returns A Promise of ListIPv6BlockSubnetsAvailableResponse
951
+ */
952
+ listIPv6BlockSubnetsAvailable = (request) => this.client.fetch(
953
+ {
954
+ method: "GET",
955
+ path: `/dedibox/v1/ipv6-blocks/${sdkClient.validatePathParam("blockId", request.blockId)}/subnets`
956
+ },
957
+ marshalling_gen.unmarshalListIPv6BlockSubnetsAvailableResponse
958
+ );
959
+ }
960
+ class RpnAPI extends sdkClient.API {
961
+ pageOfListRpnServerCapabilities = (request = {}) => this.client.fetch(
962
+ {
963
+ method: "GET",
964
+ path: `/dedibox/v1/rpn/server-capabilities`,
965
+ urlParams: sdkClient.urlParams(
966
+ ["order_by", request.orderBy],
967
+ ["page", request.page],
968
+ [
969
+ "page_size",
970
+ request.pageSize ?? this.client.settings.defaultPageSize
971
+ ],
972
+ ["project_id", request.projectId]
973
+ )
974
+ },
975
+ marshalling_gen.unmarshalListRpnServerCapabilitiesResponse
976
+ );
977
+ listRpnServerCapabilities = (request = {}) => sdkClient.enrichForPagination(
978
+ "servers",
979
+ this.pageOfListRpnServerCapabilities,
980
+ request
981
+ );
982
+ getRpnStatus = (request = {}) => this.client.fetch(
983
+ {
984
+ method: "GET",
985
+ path: `/dedibox/v1/rpn/status`,
986
+ urlParams: sdkClient.urlParams(
987
+ ["project_id", request.projectId],
988
+ ["rpnv1_group_id", request.rpnv1GroupId],
989
+ ["rpnv2_group_id", request.rpnv2GroupId]
990
+ )
991
+ },
992
+ marshalling_gen.unmarshalGetRpnStatusResponse
993
+ );
994
+ }
995
+ class RpnSanAPI extends sdkClient.API {
996
+ pageOfListRpnSans = (request = {}) => this.client.fetch(
997
+ {
998
+ method: "GET",
999
+ path: `/dedibox/v1/rpn-sans`,
1000
+ urlParams: sdkClient.urlParams(
1001
+ ["order_by", request.orderBy],
1002
+ ["page", request.page],
1003
+ [
1004
+ "page_size",
1005
+ request.pageSize ?? this.client.settings.defaultPageSize
1006
+ ],
1007
+ ["project_id", request.projectId]
1008
+ )
1009
+ },
1010
+ marshalling_gen.unmarshalListRpnSansResponse
1011
+ );
1012
+ listRpnSans = (request = {}) => sdkClient.enrichForPagination("rpnSans", this.pageOfListRpnSans, request);
1013
+ getRpnSan = (request) => this.client.fetch(
1014
+ {
1015
+ method: "GET",
1016
+ path: `/dedibox/v1/rpn-sans/${sdkClient.validatePathParam("rpnSanId", request.rpnSanId)}`
1017
+ },
1018
+ marshalling_gen.unmarshalRpnSan
1019
+ );
1020
+ /**
1021
+ * Waits for {@link RpnSan} to be in a final state.
1022
+ *
1023
+ * @param request - The request {@link RpnSanApiGetRpnSanRequest}
1024
+ * @param options - The waiting options
1025
+ * @returns A Promise of RpnSan
1026
+ */
1027
+ waitForRpnSan = (request, options) => sdkClient.waitForResource(
1028
+ options?.stop ?? ((res) => Promise.resolve(
1029
+ !content_gen.RPN_SAN_TRANSIENT_STATUSES.includes(res.status)
1030
+ )),
1031
+ this.getRpnSan,
1032
+ request,
1033
+ options
1034
+ );
1035
+ deleteRpnSan = (request) => this.client.fetch({
1036
+ method: "DELETE",
1037
+ path: `/dedibox/v1/rpn-sans/${sdkClient.validatePathParam("rpnSanId", request.rpnSanId)}`
1038
+ });
1039
+ createRpnSan = (request) => this.client.fetch(
1040
+ {
1041
+ body: JSON.stringify(
1042
+ marshalling_gen.marshalRpnSanApiCreateRpnSanRequest(request, this.client.settings)
1043
+ ),
1044
+ headers: jsonContentHeaders,
1045
+ method: "POST",
1046
+ path: `/dedibox/v1/rpn-sans`
1047
+ },
1048
+ marshalling_gen.unmarshalService
1049
+ );
1050
+ listIps = (request) => this.client.fetch(
1051
+ {
1052
+ method: "GET",
1053
+ path: `/dedibox/v1/rpn-sans/${sdkClient.validatePathParam("rpnSanId", request.rpnSanId)}/ips`,
1054
+ urlParams: sdkClient.urlParams(["type", request.type])
1055
+ },
1056
+ marshalling_gen.unmarshalListIpsResponse
1057
+ );
1058
+ addIp = (request) => this.client.fetch({
1059
+ body: JSON.stringify(
1060
+ marshalling_gen.marshalRpnSanApiAddIpRequest(request, this.client.settings)
1061
+ ),
1062
+ headers: jsonContentHeaders,
1063
+ method: "POST",
1064
+ path: `/dedibox/v1/rpn-sans/${sdkClient.validatePathParam("rpnSanId", request.rpnSanId)}/ips`
1065
+ });
1066
+ removeIp = (request) => this.client.fetch({
1067
+ body: JSON.stringify(
1068
+ marshalling_gen.marshalRpnSanApiRemoveIpRequest(request, this.client.settings)
1069
+ ),
1070
+ headers: jsonContentHeaders,
1071
+ method: "DELETE",
1072
+ path: `/dedibox/v1/rpn-sans/${sdkClient.validatePathParam("rpnSanId", request.rpnSanId)}/ips`
1073
+ });
1074
+ listAvailableIps = (request) => this.client.fetch(
1075
+ {
1076
+ method: "GET",
1077
+ path: `/dedibox/v1/rpn-sans/${sdkClient.validatePathParam("rpnSanId", request.rpnSanId)}/available-ips`,
1078
+ urlParams: sdkClient.urlParams(["type", request.type])
1079
+ },
1080
+ marshalling_gen.unmarshalListIpsResponse
1081
+ );
1082
+ }
1083
+ class RpnV1API extends sdkClient.API {
1084
+ pageOfListRpnGroups = (request = {}) => this.client.fetch(
1085
+ {
1086
+ method: "GET",
1087
+ path: `/dedibox/v1/rpnv1/groups`,
1088
+ urlParams: sdkClient.urlParams(
1089
+ ["order_by", request.orderBy],
1090
+ ["page", request.page],
1091
+ [
1092
+ "page_size",
1093
+ request.pageSize ?? this.client.settings.defaultPageSize
1094
+ ],
1095
+ ["project_id", request.projectId]
1096
+ )
1097
+ },
1098
+ marshalling_gen.unmarshalListRpnGroupsResponse
1099
+ );
1100
+ listRpnGroups = (request = {}) => sdkClient.enrichForPagination("rpnGroups", this.pageOfListRpnGroups, request);
1101
+ getRpnGroup = (request) => this.client.fetch(
1102
+ {
1103
+ method: "GET",
1104
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}`
1105
+ },
1106
+ marshalling_gen.unmarshalRpnGroup
1107
+ );
1108
+ createRpnGroup = (request) => this.client.fetch(
1109
+ {
1110
+ body: JSON.stringify(
1111
+ marshalling_gen.marshalRpnV1ApiCreateRpnGroupRequest(request, this.client.settings)
1112
+ ),
1113
+ headers: jsonContentHeaders,
1114
+ method: "POST",
1115
+ path: `/dedibox/v1/rpnv1/groups`
1116
+ },
1117
+ marshalling_gen.unmarshalRpnGroup
1118
+ );
1119
+ deleteRpnGroup = (request) => this.client.fetch({
1120
+ method: "DELETE",
1121
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}`
1122
+ });
1123
+ updateRpnGroupName = (request) => this.client.fetch(
1124
+ {
1125
+ body: JSON.stringify(
1126
+ marshalling_gen.marshalRpnV1ApiUpdateRpnGroupNameRequest(
1127
+ request,
1128
+ this.client.settings
1129
+ )
1130
+ ),
1131
+ headers: jsonContentHeaders,
1132
+ method: "PATCH",
1133
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}`
1134
+ },
1135
+ marshalling_gen.unmarshalRpnGroup
1136
+ );
1137
+ pageOfListRpnGroupMembers = (request) => this.client.fetch(
1138
+ {
1139
+ method: "GET",
1140
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/members`,
1141
+ urlParams: sdkClient.urlParams(
1142
+ ["order_by", request.orderBy],
1143
+ ["page", request.page],
1144
+ [
1145
+ "page_size",
1146
+ request.pageSize ?? this.client.settings.defaultPageSize
1147
+ ],
1148
+ ["project_id", request.projectId]
1149
+ )
1150
+ },
1151
+ marshalling_gen.unmarshalListRpnGroupMembersResponse
1152
+ );
1153
+ listRpnGroupMembers = (request) => sdkClient.enrichForPagination("members", this.pageOfListRpnGroupMembers, request);
1154
+ rpnGroupInvite = (request) => this.client.fetch({
1155
+ body: JSON.stringify(
1156
+ marshalling_gen.marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings)
1157
+ ),
1158
+ headers: jsonContentHeaders,
1159
+ method: "POST",
1160
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/invite`
1161
+ });
1162
+ leaveRpnGroup = (request) => this.client.fetch({
1163
+ body: JSON.stringify(
1164
+ marshalling_gen.marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings)
1165
+ ),
1166
+ headers: jsonContentHeaders,
1167
+ method: "POST",
1168
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/leave`
1169
+ });
1170
+ addRpnGroupMembers = (request) => this.client.fetch(
1171
+ {
1172
+ body: JSON.stringify(
1173
+ marshalling_gen.marshalRpnV1ApiAddRpnGroupMembersRequest(
1174
+ request,
1175
+ this.client.settings
1176
+ )
1177
+ ),
1178
+ headers: jsonContentHeaders,
1179
+ method: "POST",
1180
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/members`
1181
+ },
1182
+ marshalling_gen.unmarshalRpnGroup
1183
+ );
1184
+ deleteRpnGroupMembers = (request) => this.client.fetch(
1185
+ {
1186
+ body: JSON.stringify(
1187
+ marshalling_gen.marshalRpnV1ApiDeleteRpnGroupMembersRequest(
1188
+ request,
1189
+ this.client.settings
1190
+ )
1191
+ ),
1192
+ headers: jsonContentHeaders,
1193
+ method: "DELETE",
1194
+ path: `/dedibox/v1/rpnv1/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/members`
1195
+ },
1196
+ marshalling_gen.unmarshalRpnGroup
1197
+ );
1198
+ pageOfListRpnCapableServers = (request = {}) => this.client.fetch(
1199
+ {
1200
+ method: "GET",
1201
+ path: `/dedibox/v1/rpnv1/capable-servers`,
1202
+ urlParams: sdkClient.urlParams(
1203
+ ["order_by", request.orderBy],
1204
+ ["page", request.page],
1205
+ [
1206
+ "page_size",
1207
+ request.pageSize ?? this.client.settings.defaultPageSize
1208
+ ],
1209
+ ["project_id", request.projectId]
1210
+ )
1211
+ },
1212
+ marshalling_gen.unmarshalListRpnCapableServersResponse
1213
+ );
1214
+ listRpnCapableServers = (request = {}) => sdkClient.enrichForPagination("servers", this.pageOfListRpnCapableServers, request);
1215
+ pageOfListRpnCapableSanServers = (request = {}) => this.client.fetch(
1216
+ {
1217
+ method: "GET",
1218
+ path: `/dedibox/v1/rpnv1/capable-san-servers`,
1219
+ urlParams: sdkClient.urlParams(
1220
+ ["order_by", request.orderBy],
1221
+ ["page", request.page],
1222
+ [
1223
+ "page_size",
1224
+ request.pageSize ?? this.client.settings.defaultPageSize
1225
+ ],
1226
+ ["project_id", request.projectId]
1227
+ )
1228
+ },
1229
+ marshalling_gen.unmarshalListRpnCapableSanServersResponse
1230
+ );
1231
+ listRpnCapableSanServers = (request = {}) => sdkClient.enrichForPagination(
1232
+ "sanServers",
1233
+ this.pageOfListRpnCapableSanServers,
1234
+ request
1235
+ );
1236
+ pageOfListRpnInvites = (request = {}) => this.client.fetch(
1237
+ {
1238
+ method: "GET",
1239
+ path: `/dedibox/v1/rpnv1/invites`,
1240
+ urlParams: sdkClient.urlParams(
1241
+ ["order_by", request.orderBy],
1242
+ ["page", request.page],
1243
+ [
1244
+ "page_size",
1245
+ request.pageSize ?? this.client.settings.defaultPageSize
1246
+ ],
1247
+ [
1248
+ "project_id",
1249
+ request.projectId ?? this.client.settings.defaultProjectId
1250
+ ]
1251
+ )
1252
+ },
1253
+ marshalling_gen.unmarshalListRpnInvitesResponse
1254
+ );
1255
+ listRpnInvites = (request = {}) => sdkClient.enrichForPagination("members", this.pageOfListRpnInvites, request);
1256
+ acceptRpnInvite = (request) => this.client.fetch({
1257
+ method: "POST",
1258
+ path: `/dedibox/v1/rpnv1/invites/${sdkClient.validatePathParam("memberId", request.memberId)}/accept`
1259
+ });
1260
+ refuseRpnInvite = (request) => this.client.fetch({
1261
+ method: "POST",
1262
+ path: `/dedibox/v1/rpnv1/invites/${sdkClient.validatePathParam("memberId", request.memberId)}/refuse`
1263
+ });
1264
+ }
1265
+ class RpnV2API extends sdkClient.API {
1266
+ pageOfListRpnV2Groups = (request = {}) => this.client.fetch(
1267
+ {
1268
+ method: "GET",
1269
+ path: `/dedibox/v1/rpnv2/groups`,
1270
+ urlParams: sdkClient.urlParams(
1271
+ ["order_by", request.orderBy],
1272
+ ["page", request.page],
1273
+ [
1274
+ "page_size",
1275
+ request.pageSize ?? this.client.settings.defaultPageSize
1276
+ ],
1277
+ ["project_id", request.projectId]
1278
+ )
1279
+ },
1280
+ marshalling_gen.unmarshalListRpnV2GroupsResponse
1281
+ );
1282
+ listRpnV2Groups = (request = {}) => sdkClient.enrichForPagination("rpnGroups", this.pageOfListRpnV2Groups, request);
1283
+ pageOfListRpnV2Members = (request) => this.client.fetch(
1284
+ {
1285
+ method: "GET",
1286
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/members`,
1287
+ urlParams: sdkClient.urlParams(
1288
+ ["order_by", request.orderBy],
1289
+ ["page", request.page],
1290
+ [
1291
+ "page_size",
1292
+ request.pageSize ?? this.client.settings.defaultPageSize
1293
+ ],
1294
+ ["type", request.type]
1295
+ )
1296
+ },
1297
+ marshalling_gen.unmarshalListRpnV2MembersResponse
1298
+ );
1299
+ listRpnV2Members = (request) => sdkClient.enrichForPagination("members", this.pageOfListRpnV2Members, request);
1300
+ getRpnV2Group = (request) => this.client.fetch(
1301
+ {
1302
+ method: "GET",
1303
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}`
1304
+ },
1305
+ marshalling_gen.unmarshalRpnV2Group
1306
+ );
1307
+ /**
1308
+ * Waits for {@link RpnV2Group} to be in a final state.
1309
+ *
1310
+ * @param request - The request {@link RpnV2ApiGetRpnV2GroupRequest}
1311
+ * @param options - The waiting options
1312
+ * @returns A Promise of RpnV2Group
1313
+ */
1314
+ waitForRpnV2Group = (request, options) => sdkClient.waitForResource(
1315
+ options?.stop ?? ((res) => Promise.resolve(
1316
+ !content_gen.RPN_V2_GROUP_TRANSIENT_STATUSES.includes(res.status)
1317
+ )),
1318
+ this.getRpnV2Group,
1319
+ request,
1320
+ options
1321
+ );
1322
+ createRpnV2Group = (request) => this.client.fetch(
1323
+ {
1324
+ body: JSON.stringify(
1325
+ marshalling_gen.marshalRpnV2ApiCreateRpnV2GroupRequest(request, this.client.settings)
1326
+ ),
1327
+ headers: jsonContentHeaders,
1328
+ method: "POST",
1329
+ path: `/dedibox/v1/rpnv2/groups`
1330
+ },
1331
+ marshalling_gen.unmarshalRpnV2Group
1332
+ );
1333
+ deleteRpnV2Group = (request) => this.client.fetch({
1334
+ method: "DELETE",
1335
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}`
1336
+ });
1337
+ updateRpnV2GroupName = (request) => this.client.fetch(
1338
+ {
1339
+ body: JSON.stringify(
1340
+ marshalling_gen.marshalRpnV2ApiUpdateRpnV2GroupNameRequest(
1341
+ request,
1342
+ this.client.settings
1343
+ )
1344
+ ),
1345
+ headers: jsonContentHeaders,
1346
+ method: "PATCH",
1347
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}`
1348
+ },
1349
+ marshalling_gen.unmarshalRpnV2Group
1350
+ );
1351
+ addRpnV2Members = (request) => this.client.fetch({
1352
+ body: JSON.stringify(
1353
+ marshalling_gen.marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings)
1354
+ ),
1355
+ headers: jsonContentHeaders,
1356
+ method: "POST",
1357
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/members`
1358
+ });
1359
+ deleteRpnV2Members = (request) => this.client.fetch({
1360
+ body: JSON.stringify(
1361
+ marshalling_gen.marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings)
1362
+ ),
1363
+ headers: jsonContentHeaders,
1364
+ method: "DELETE",
1365
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/members`
1366
+ });
1367
+ pageOfListRpnV2CapableResources = (request = {}) => this.client.fetch(
1368
+ {
1369
+ method: "GET",
1370
+ path: `/dedibox/v1/rpnv2/groups/capable`,
1371
+ urlParams: sdkClient.urlParams(
1372
+ ["order_by", request.orderBy],
1373
+ ["page", request.page],
1374
+ [
1375
+ "page_size",
1376
+ request.pageSize ?? this.client.settings.defaultPageSize
1377
+ ],
1378
+ ["project_id", request.projectId]
1379
+ )
1380
+ },
1381
+ marshalling_gen.unmarshalListRpnV2CapableResourcesResponse
1382
+ );
1383
+ listRpnV2CapableResources = (request = {}) => sdkClient.enrichForPagination(
1384
+ "servers",
1385
+ this.pageOfListRpnV2CapableResources,
1386
+ request
1387
+ );
1388
+ pageOfListRpnV2GroupLogs = (request) => this.client.fetch(
1389
+ {
1390
+ method: "GET",
1391
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/logs`,
1392
+ urlParams: sdkClient.urlParams(
1393
+ ["order_by", request.orderBy],
1394
+ ["page", request.page],
1395
+ [
1396
+ "page_size",
1397
+ request.pageSize ?? this.client.settings.defaultPageSize
1398
+ ]
1399
+ )
1400
+ },
1401
+ marshalling_gen.unmarshalListRpnV2GroupLogsResponse
1402
+ );
1403
+ listRpnV2GroupLogs = (request) => sdkClient.enrichForPagination("logs", this.pageOfListRpnV2GroupLogs, request);
1404
+ updateRpnV2VlanForMembers = (request) => this.client.fetch({
1405
+ body: JSON.stringify(
1406
+ marshalling_gen.marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest(
1407
+ request,
1408
+ this.client.settings
1409
+ )
1410
+ ),
1411
+ headers: jsonContentHeaders,
1412
+ method: "PATCH",
1413
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/vlan`
1414
+ });
1415
+ enableRpnV2GroupCompatibility = (request) => this.client.fetch({
1416
+ body: JSON.stringify(
1417
+ marshalling_gen.marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest(
1418
+ request,
1419
+ this.client.settings
1420
+ )
1421
+ ),
1422
+ headers: jsonContentHeaders,
1423
+ method: "POST",
1424
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/enable-compatibility`
1425
+ });
1426
+ disableRpnV2GroupCompatibility = (request) => this.client.fetch({
1427
+ body: "{}",
1428
+ headers: jsonContentHeaders,
1429
+ method: "POST",
1430
+ path: `/dedibox/v1/rpnv2/groups/${sdkClient.validatePathParam("groupId", request.groupId)}/disable-compatibility`
1431
+ });
1432
+ }
1433
+ exports.API = API;
1434
+ exports.BillingAPI = BillingAPI;
1435
+ exports.IPv6BlockAPI = IPv6BlockAPI;
1436
+ exports.RpnAPI = RpnAPI;
1437
+ exports.RpnSanAPI = RpnSanAPI;
1438
+ exports.RpnV1API = RpnV1API;
1439
+ exports.RpnV2API = RpnV2API;