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