@scaleway/sdk 2.22.0 → 2.23.0

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,974 @@
1
+ import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
+ import { API as API$1 } from '../../../scw/api.js';
3
+ import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
+ import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
+ 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';
6
+ 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';
7
+
8
+ // This file was automatically generated. DO NOT EDIT.
9
+ // If you have any remark or suggestion do not hesitate to open an issue.
10
+ const jsonContentHeaders = {
11
+ 'Content-Type': 'application/json; charset=utf-8'
12
+ };
13
+
14
+ /** Dedibox Phoenix API. */
15
+ class API extends API$1 {
16
+ /** Lists the available zones of the API. */
17
+ static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
18
+ pageOfListServers = (request = {}) => this.client.fetch({
19
+ method: 'GET',
20
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,
21
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['search', request.search])
22
+ }, unmarshalListServersResponse);
23
+
24
+ /**
25
+ * List baremetal servers for project.
26
+ *
27
+ * @param request - The request {@link ListServersRequest}
28
+ * @returns A Promise of ListServersResponse
29
+ */
30
+ listServers = (request = {}) => enrichForPagination('servers', this.pageOfListServers, request);
31
+
32
+ /**
33
+ * Get a specific baremetal server. Get the server associated with the given
34
+ * ID.
35
+ *
36
+ * @param request - The request {@link GetServerRequest}
37
+ * @returns A Promise of Server
38
+ */
39
+ getServer = request => this.client.fetch({
40
+ method: 'GET',
41
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
42
+ }, unmarshalServer);
43
+
44
+ /**
45
+ * Waits for {@link Server} to be in a final state.
46
+ *
47
+ * @param request - The request {@link GetServerRequest}
48
+ * @param options - The waiting options
49
+ * @returns A Promise of Server
50
+ */
51
+ waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
52
+ getServerBackup = request => this.client.fetch({
53
+ method: 'GET',
54
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/backups`
55
+ }, unmarshalBackup);
56
+ updateServerBackup = request => this.client.fetch({
57
+ body: JSON.stringify(marshalUpdateServerBackupRequest(request, this.client.settings)),
58
+ headers: jsonContentHeaders,
59
+ method: 'PATCH',
60
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/backups`
61
+ }, unmarshalBackup);
62
+ pageOfListSubscribableServerOptions = request => this.client.fetch({
63
+ method: 'GET',
64
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/subscribable-server-options`,
65
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
66
+ }, unmarshalListSubscribableServerOptionsResponse);
67
+
68
+ /**
69
+ * List subscribable server options. List subscribable options associated to
70
+ * the given server ID.
71
+ *
72
+ * @param request - The request {@link ListSubscribableServerOptionsRequest}
73
+ * @returns A Promise of ListSubscribableServerOptionsResponse
74
+ */
75
+ listSubscribableServerOptions = request => enrichForPagination('serverOptions', this.pageOfListSubscribableServerOptions, request);
76
+
77
+ /**
78
+ * Subscribe server option. Subscribe option for the given server ID.
79
+ *
80
+ * @param request - The request {@link SubscribeServerOptionRequest}
81
+ * @returns A Promise of Service
82
+ */
83
+ subscribeServerOption = request => this.client.fetch({
84
+ body: JSON.stringify(marshalSubscribeServerOptionRequest(request, this.client.settings)),
85
+ headers: jsonContentHeaders,
86
+ method: 'PATCH',
87
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/subscribe-server-option`
88
+ }, unmarshalService);
89
+
90
+ /**
91
+ * Create a baremetal server. Create a new baremetal server. The order return
92
+ * you a service ID to follow the provisionning status you could call
93
+ * GetService.
94
+ *
95
+ * @param request - The request {@link CreateServerRequest}
96
+ * @returns A Promise of Service
97
+ */
98
+ createServer = request => this.client.fetch({
99
+ body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),
100
+ headers: jsonContentHeaders,
101
+ method: 'POST',
102
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`
103
+ }, unmarshalService);
104
+
105
+ /**
106
+ * Subscribe storage server option. Subscribe storage option for the given
107
+ * server ID.
108
+ *
109
+ * @param request - The request {@link SubscribeStorageOptionsRequest}
110
+ * @returns A Promise of SubscribeStorageOptionsResponse
111
+ */
112
+ subscribeStorageOptions = request => this.client.fetch({
113
+ body: JSON.stringify(marshalSubscribeStorageOptionsRequest(request, this.client.settings)),
114
+ headers: jsonContentHeaders,
115
+ method: 'POST',
116
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/subscribe-storage-options`
117
+ }, unmarshalSubscribeStorageOptionsResponse);
118
+
119
+ /**
120
+ * Update a baremetal server. Update the server associated with the given ID.
121
+ *
122
+ * @param request - The request {@link UpdateServerRequest}
123
+ * @returns A Promise of Server
124
+ */
125
+ updateServer = request => this.client.fetch({
126
+ body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),
127
+ headers: jsonContentHeaders,
128
+ method: 'PATCH',
129
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
130
+ }, unmarshalServer);
131
+ updateServerTags = request => this.client.fetch({
132
+ body: JSON.stringify(marshalUpdateServerTagsRequest(request, this.client.settings)),
133
+ headers: jsonContentHeaders,
134
+ method: 'POST',
135
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/tags`
136
+ }, unmarshalServer);
137
+
138
+ /**
139
+ * Reboot a baremetal server. Reboot the server associated with the given ID,
140
+ * use boot param to reboot in rescue.
141
+ *
142
+ * @param request - The request {@link RebootServerRequest}
143
+ */
144
+ rebootServer = request => this.client.fetch({
145
+ body: '{}',
146
+ headers: jsonContentHeaders,
147
+ method: 'POST',
148
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`
149
+ });
150
+
151
+ /**
152
+ * Start a baremetal server. Start the server associated with the given ID.
153
+ *
154
+ * @param request - The request {@link StartServerRequest}
155
+ */
156
+ startServer = request => this.client.fetch({
157
+ body: '{}',
158
+ headers: jsonContentHeaders,
159
+ method: 'POST',
160
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`
161
+ });
162
+
163
+ /**
164
+ * Stop a baremetal server. Stop the server associated with the given ID.
165
+ *
166
+ * @param request - The request {@link StopServerRequest}
167
+ */
168
+ stopServer = request => this.client.fetch({
169
+ body: '{}',
170
+ headers: jsonContentHeaders,
171
+ method: 'POST',
172
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`
173
+ });
174
+
175
+ /**
176
+ * Delete a baremetal server. Delete the server associated with the given ID.
177
+ *
178
+ * @param request - The request {@link DeleteServerRequest}
179
+ */
180
+ deleteServer = request => this.client.fetch({
181
+ method: 'DELETE',
182
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`
183
+ });
184
+ pageOfListServerEvents = request => this.client.fetch({
185
+ method: 'GET',
186
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,
187
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
188
+ }, unmarshalListServerEventsResponse);
189
+
190
+ /**
191
+ * List server events. List events associated to the given server ID.
192
+ *
193
+ * @param request - The request {@link ListServerEventsRequest}
194
+ * @returns A Promise of ListServerEventsResponse
195
+ */
196
+ listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);
197
+ pageOfListServerDisks = request => this.client.fetch({
198
+ method: 'GET',
199
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/disks`,
200
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
201
+ }, unmarshalListServerDisksResponse);
202
+
203
+ /**
204
+ * List server disks. List disks associated to the given server ID.
205
+ *
206
+ * @param request - The request {@link ListServerDisksRequest}
207
+ * @returns A Promise of ListServerDisksResponse
208
+ */
209
+ listServerDisks = request => enrichForPagination('disks', this.pageOfListServerDisks, request);
210
+ getOrderedService = request => this.client.fetch({
211
+ method: 'GET',
212
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ordered-services/${validatePathParam('orderedServiceId', request.orderedServiceId)}`
213
+ }, unmarshalService);
214
+
215
+ /**
216
+ * Get a specific service. Get the service associated with the given ID.
217
+ *
218
+ * @param request - The request {@link GetServiceRequest}
219
+ * @returns A Promise of Service
220
+ */
221
+ getService = request => this.client.fetch({
222
+ body: '{}',
223
+ headers: jsonContentHeaders,
224
+ method: 'PATCH',
225
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/services/${validatePathParam('serviceId', request.serviceId)}`
226
+ }, unmarshalService);
227
+
228
+ /**
229
+ * Delete a specific service. Delete the service associated with the given ID.
230
+ *
231
+ * @param request - The request {@link DeleteServiceRequest}
232
+ * @returns A Promise of Service
233
+ */
234
+ deleteService = request => this.client.fetch({
235
+ method: 'DELETE',
236
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/services/${validatePathParam('serviceId', request.serviceId)}`
237
+ }, unmarshalService);
238
+ pageOfListServices = (request = {}) => this.client.fetch({
239
+ method: 'GET',
240
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/services`,
241
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
242
+ }, unmarshalListServicesResponse);
243
+
244
+ /**
245
+ * List services.
246
+ *
247
+ * @param request - The request {@link ListServicesRequest}
248
+ * @returns A Promise of ListServicesResponse
249
+ */
250
+ listServices = (request = {}) => enrichForPagination('services', this.pageOfListServices, request);
251
+
252
+ /**
253
+ * Install a baremetal server. Install an OS on the server associated with the
254
+ * given ID.
255
+ *
256
+ * @param request - The request {@link InstallServerRequest}
257
+ * @returns A Promise of ServerInstall
258
+ */
259
+ installServer = request => this.client.fetch({
260
+ body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),
261
+ headers: jsonContentHeaders,
262
+ method: 'POST',
263
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
264
+ }, unmarshalServerInstall);
265
+
266
+ /**
267
+ * Get a specific server installation status. Get the server installation
268
+ * status associated with the given server ID.
269
+ *
270
+ * @param request - The request {@link GetServerInstallRequest}
271
+ * @returns A Promise of ServerInstall
272
+ */
273
+ getServerInstall = request => this.client.fetch({
274
+ method: 'GET',
275
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`
276
+ }, unmarshalServerInstall);
277
+
278
+ /**
279
+ * Waits for {@link ServerInstall} to be in a final state.
280
+ *
281
+ * @param request - The request {@link GetServerInstallRequest}
282
+ * @param options - The waiting options
283
+ * @returns A Promise of ServerInstall
284
+ */
285
+ waitForServerInstall = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_INSTALL_TRANSIENT_STATUSES.includes(res.status))), this.getServerInstall, request, options);
286
+
287
+ /**
288
+ * Cancels the current (running) server installation. Cancels the current
289
+ * server installation associated with the given server ID.
290
+ *
291
+ * @param request - The request {@link CancelServerInstallRequest}
292
+ */
293
+ cancelServerInstall = request => this.client.fetch({
294
+ method: 'POST',
295
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/cancel-install`
296
+ });
297
+
298
+ /**
299
+ * Get server default partitioning. Get the server default partitioning schema
300
+ * associated with the given server ID and OS ID.
301
+ *
302
+ * @param request - The request {@link GetServerDefaultPartitioningRequest}
303
+ * @returns A Promise of ServerDefaultPartitioning
304
+ */
305
+ getServerDefaultPartitioning = request => this.client.fetch({
306
+ method: 'GET',
307
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/partitioning/${validatePathParam('osId', request.osId)}`
308
+ }, unmarshalServerDefaultPartitioning);
309
+
310
+ /**
311
+ * Start BMC (Baseboard Management Controller) access for a given baremetal
312
+ * server. Start BMC (Baseboard Management Controller) access associated with
313
+ * the given ID. The BMC (Baseboard Management Controller) access is available
314
+ * one hour after the installation of the server.
315
+ *
316
+ * @param request - The request {@link StartBMCAccessRequest}
317
+ */
318
+ startBMCAccess = request => this.client.fetch({
319
+ body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),
320
+ headers: jsonContentHeaders,
321
+ method: 'POST',
322
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
323
+ });
324
+
325
+ /**
326
+ * Get BMC (Baseboard Management Controller) access for a given baremetal
327
+ * server. Get the BMC (Baseboard Management Controller) access associated
328
+ * with the given ID.
329
+ *
330
+ * @param request - The request {@link GetBMCAccessRequest}
331
+ * @returns A Promise of BMCAccess
332
+ */
333
+ getBMCAccess = request => this.client.fetch({
334
+ method: 'GET',
335
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
336
+ }, unmarshalBMCAccess);
337
+
338
+ /**
339
+ * Waits for {@link BMCAccess} to be in a final state.
340
+ *
341
+ * @param request - The request {@link GetBMCAccessRequest}
342
+ * @param options - The waiting options
343
+ * @returns A Promise of BMCAccess
344
+ */
345
+ waitForBMCAccess = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!BMC_ACCESS_TRANSIENT_STATUSES.includes(res.status))), this.getBMCAccess, request, options);
346
+
347
+ /**
348
+ * Stop BMC (Baseboard Management Controller) access for a given baremetal
349
+ * server. Stop BMC (Baseboard Management Controller) access associated with
350
+ * the given ID.
351
+ *
352
+ * @param request - The request {@link StopBMCAccessRequest}
353
+ */
354
+ stopBMCAccess = request => this.client.fetch({
355
+ method: 'DELETE',
356
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`
357
+ });
358
+ pageOfListOffers = (request = {}) => this.client.fetch({
359
+ method: 'GET',
360
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers`,
361
+ urlParams: urlParams(['available_only', request.availableOnly], ['catalog', request.catalog], ['commercial_range', request.commercialRange], ['is_failover_block', request.isFailoverBlock], ['is_failover_ip', request.isFailoverIp], ['is_rpn_san', request.isRpnSan], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['sold_in', request.soldIn && request.soldIn.length > 0 ? request.soldIn.join(',') : undefined])
362
+ }, unmarshalListOffersResponse);
363
+
364
+ /**
365
+ * List offers. List all available server offers.
366
+ *
367
+ * @param request - The request {@link ListOffersRequest}
368
+ * @returns A Promise of ListOffersResponse
369
+ */
370
+ listOffers = (request = {}) => enrichForPagination('offers', this.pageOfListOffers, request);
371
+
372
+ /**
373
+ * Get offer. Return specific offer for the given ID.
374
+ *
375
+ * @param request - The request {@link GetOfferRequest}
376
+ * @returns A Promise of Offer
377
+ */
378
+ getOffer = request => this.client.fetch({
379
+ method: 'GET',
380
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`,
381
+ urlParams: urlParams(['project_id', request.projectId])
382
+ }, unmarshalOffer);
383
+ pageOfListOS = request => this.client.fetch({
384
+ method: 'GET',
385
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os`,
386
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['server_id', request.serverId], ['type', request.type])
387
+ }, unmarshalListOSResponse);
388
+
389
+ /**
390
+ * List all available OS that can be install on a baremetal server.
391
+ *
392
+ * @param request - The request {@link ListOSRequest}
393
+ * @returns A Promise of ListOSResponse
394
+ */
395
+ listOS = request => enrichForPagination('os', this.pageOfListOS, request);
396
+
397
+ /**
398
+ * Get an OS with a given ID. Return specific OS for the given ID.
399
+ *
400
+ * @param request - The request {@link GetOSRequest}
401
+ * @returns A Promise of OS
402
+ */
403
+ getOS = request => this.client.fetch({
404
+ method: 'GET',
405
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`,
406
+ urlParams: urlParams(['project_id', request.projectId], ['server_id', request.serverId])
407
+ }, unmarshalOS);
408
+
409
+ /**
410
+ * Update reverse of ip. Update reverse of ip associated with the given ID.
411
+ *
412
+ * @param request - The request {@link UpdateReverseRequest}
413
+ * @returns A Promise of IP
414
+ */
415
+ updateReverse = request => this.client.fetch({
416
+ body: JSON.stringify(marshalUpdateReverseRequest(request, this.client.settings)),
417
+ headers: jsonContentHeaders,
418
+ method: 'PATCH',
419
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/reverses/${validatePathParam('ipId', request.ipId)}`
420
+ }, unmarshalIP);
421
+
422
+ /**
423
+ * Order failover IPs. Order X failover IPs.
424
+ *
425
+ * @param request - The request {@link CreateFailoverIPsRequest}
426
+ * @returns A Promise of CreateFailoverIPsResponse
427
+ */
428
+ createFailoverIPs = request => this.client.fetch({
429
+ body: JSON.stringify(marshalCreateFailoverIPsRequest(request, this.client.settings)),
430
+ headers: jsonContentHeaders,
431
+ method: 'POST',
432
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips`
433
+ }, unmarshalCreateFailoverIPsResponse);
434
+
435
+ /**
436
+ * Attach failovers on baremetal server. Attach failovers on the server
437
+ * associated with the given ID.
438
+ *
439
+ * @param request - The request {@link AttachFailoverIPsRequest}
440
+ */
441
+ attachFailoverIPs = request => this.client.fetch({
442
+ body: JSON.stringify(marshalAttachFailoverIPsRequest(request, this.client.settings)),
443
+ headers: jsonContentHeaders,
444
+ method: 'POST',
445
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach`
446
+ });
447
+
448
+ /**
449
+ * Detach failovers on baremetal server. Detach failovers on the server
450
+ * associated with the given ID.
451
+ *
452
+ * @param request - The request {@link DetachFailoverIPsRequest}
453
+ */
454
+ detachFailoverIPs = request => this.client.fetch({
455
+ body: JSON.stringify(marshalDetachFailoverIPsRequest(request, this.client.settings)),
456
+ headers: jsonContentHeaders,
457
+ method: 'POST',
458
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach`
459
+ });
460
+
461
+ /**
462
+ * Attach a failover IP to a MAC address.
463
+ *
464
+ * @param request - The request {@link AttachFailoverIPToMacAddressRequest}
465
+ * @returns A Promise of IP
466
+ */
467
+ attachFailoverIPToMacAddress = request => this.client.fetch({
468
+ body: JSON.stringify(marshalAttachFailoverIPToMacAddressRequest(request, this.client.settings)),
469
+ headers: jsonContentHeaders,
470
+ method: 'POST',
471
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam('ipId', request.ipId)}/attach-to-mac-address`
472
+ }, unmarshalIP);
473
+
474
+ /**
475
+ * Detach a failover IP from a MAC address.
476
+ *
477
+ * @param request - The request {@link DetachFailoverIPFromMacAddressRequest}
478
+ * @returns A Promise of IP
479
+ */
480
+ detachFailoverIPFromMacAddress = request => this.client.fetch({
481
+ body: '{}',
482
+ headers: jsonContentHeaders,
483
+ method: 'POST',
484
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam('ipId', request.ipId)}/detach-from-mac-address`
485
+ }, unmarshalIP);
486
+
487
+ /**
488
+ * Delete a failover server. Delete the failover associated with the given ID.
489
+ *
490
+ * @param request - The request {@link DeleteFailoverIPRequest}
491
+ */
492
+ deleteFailoverIP = request => this.client.fetch({
493
+ method: 'DELETE',
494
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam('ipId', request.ipId)}`
495
+ });
496
+ pageOfListFailoverIPs = (request = {}) => this.client.fetch({
497
+ method: 'GET',
498
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips`,
499
+ urlParams: urlParams(['only_available', request.onlyAvailable], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['search', request.search])
500
+ }, unmarshalListFailoverIPsResponse);
501
+
502
+ /**
503
+ * List failovers for project. List failovers servers for project.
504
+ *
505
+ * @param request - The request {@link ListFailoverIPsRequest}
506
+ * @returns A Promise of ListFailoverIPsResponse
507
+ */
508
+ listFailoverIPs = (request = {}) => enrichForPagination('failoverIps', this.pageOfListFailoverIPs, request);
509
+
510
+ /**
511
+ * Get a specific baremetal server. Get the server associated with the given
512
+ * ID.
513
+ *
514
+ * @param request - The request {@link GetFailoverIPRequest}
515
+ * @returns A Promise of FailoverIP
516
+ */
517
+ getFailoverIP = request => this.client.fetch({
518
+ method: 'GET',
519
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam('ipId', request.ipId)}`
520
+ }, unmarshalFailoverIP);
521
+
522
+ /**
523
+ * Get remaining quota.
524
+ *
525
+ * @param request - The request {@link GetRemainingQuotaRequest}
526
+ * @returns A Promise of GetRemainingQuotaResponse
527
+ */
528
+ getRemainingQuota = (request = {}) => this.client.fetch({
529
+ method: 'GET',
530
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/remaining-quota`,
531
+ urlParams: urlParams(['project_id', request.projectId])
532
+ }, unmarshalGetRemainingQuotaResponse);
533
+
534
+ /**
535
+ * Get raid. Return raid for the given server ID.
536
+ *
537
+ * @param request - The request {@link GetRaidRequest}
538
+ * @returns A Promise of Raid
539
+ */
540
+ getRaid = request => this.client.fetch({
541
+ method: 'GET',
542
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/raid`
543
+ }, unmarshalRaid);
544
+
545
+ /**
546
+ * Update RAID. Update RAID associated with the given server ID.
547
+ *
548
+ * @param request - The request {@link UpdateRaidRequest}
549
+ */
550
+ updateRaid = request => this.client.fetch({
551
+ body: JSON.stringify(marshalUpdateRaidRequest(request, this.client.settings)),
552
+ headers: jsonContentHeaders,
553
+ method: 'POST',
554
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/update-raid`
555
+ });
556
+
557
+ /**
558
+ * Start in rescue baremetal server. Start in rescue the server associated
559
+ * with the given ID.
560
+ *
561
+ * @param request - The request {@link StartRescueRequest}
562
+ * @returns A Promise of Rescue
563
+ */
564
+ startRescue = request => this.client.fetch({
565
+ body: JSON.stringify(marshalStartRescueRequest(request, this.client.settings)),
566
+ headers: jsonContentHeaders,
567
+ method: 'POST',
568
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/rescue`
569
+ }, unmarshalRescue);
570
+
571
+ /**
572
+ * Get rescue information. Return rescue information for the given server ID.
573
+ *
574
+ * @param request - The request {@link GetRescueRequest}
575
+ * @returns A Promise of Rescue
576
+ */
577
+ getRescue = request => this.client.fetch({
578
+ method: 'GET',
579
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/rescue`
580
+ }, unmarshalRescue);
581
+
582
+ /**
583
+ * Stop rescue on baremetal server. Stop rescue on the server associated with
584
+ * the given ID.
585
+ *
586
+ * @param request - The request {@link StopRescueRequest}
587
+ */
588
+ stopRescue = request => this.client.fetch({
589
+ method: 'DELETE',
590
+ path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/rescue`
591
+ });
592
+ }
593
+
594
+ /** Dedibox Phoenix Billing API. */
595
+ class BillingAPI extends API$1 {
596
+ pageOfListInvoices = (request = {}) => this.client.fetch({
597
+ method: 'GET',
598
+ path: `/dedibox/v1/invoices`,
599
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
600
+ }, unmarshalListInvoicesResponse);
601
+ listInvoices = (request = {}) => enrichForPagination('invoices', this.pageOfListInvoices, request);
602
+ getInvoice = request => this.client.fetch({
603
+ method: 'GET',
604
+ path: `/dedibox/v1/invoices/${validatePathParam('invoiceId', request.invoiceId)}`
605
+ }, unmarshalInvoice);
606
+ downloadInvoice = request => this.client.fetch({
607
+ method: 'GET',
608
+ path: `/dedibox/v1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`,
609
+ urlParams: urlParams(['dl', 1]),
610
+ responseType: 'blob'
611
+ });
612
+ pageOfListRefunds = (request = {}) => this.client.fetch({
613
+ method: 'GET',
614
+ path: `/dedibox/v1/refunds`,
615
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
616
+ }, unmarshalListRefundsResponse);
617
+ listRefunds = (request = {}) => enrichForPagination('refunds', this.pageOfListRefunds, request);
618
+ getRefund = request => this.client.fetch({
619
+ method: 'GET',
620
+ path: `/dedibox/v1/refunds/${validatePathParam('refundId', request.refundId)}`
621
+ }, unmarshalRefund);
622
+ downloadRefund = request => this.client.fetch({
623
+ method: 'GET',
624
+ path: `/dedibox/v1/refunds/${validatePathParam('refundId', request.refundId)}/download`,
625
+ urlParams: urlParams(['dl', 1]),
626
+ responseType: 'blob'
627
+ });
628
+ canOrder = (request = {}) => this.client.fetch({
629
+ method: 'GET',
630
+ path: `/dedibox/v1/can-order`,
631
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
632
+ }, unmarshalCanOrderResponse);
633
+ }
634
+
635
+ /** Dedibox Phoenix IPv6 Block API. */
636
+ class IPv6BlockAPI extends API$1 {
637
+ /**
638
+ * Get IPv6 block quota. Get IPv6 block quota with the given project ID. /48
639
+ * one per organization. /56 link to your number of server. /64 link to your
640
+ * number of failover IP.
641
+ *
642
+ * @param request - The request {@link IPv6BlockApiGetIPv6BlockQuotasRequest}
643
+ * @returns A Promise of GetIPv6BlockQuotasResponse
644
+ */
645
+ getIPv6BlockQuotas = (request = {}) => this.client.fetch({
646
+ method: 'GET',
647
+ path: `/dedibox/v1/ipv6-block-quotas`,
648
+ urlParams: urlParams(['project_id', request.projectId])
649
+ }, unmarshalGetIPv6BlockQuotasResponse);
650
+
651
+ /**
652
+ * Create IPv6 block for baremetal server. Create IPv6 block associated with
653
+ * the given project ID.
654
+ *
655
+ * @param request - The request {@link IPv6BlockApiCreateIPv6BlockRequest}
656
+ * @returns A Promise of IPv6Block
657
+ */
658
+ createIPv6Block = (request = {}) => this.client.fetch({
659
+ body: JSON.stringify(marshalIPv6BlockApiCreateIPv6BlockRequest(request, this.client.settings)),
660
+ headers: jsonContentHeaders,
661
+ method: 'POST',
662
+ path: `/dedibox/v1/ipv6-block`
663
+ }, unmarshalIPv6Block);
664
+
665
+ /**
666
+ * Get a specific IPv6 block. Get the IPv6 block associated with the given ID.
667
+ *
668
+ * @param request - The request {@link IPv6BlockApiGetIPv6BlockRequest}
669
+ * @returns A Promise of IPv6Block
670
+ */
671
+ getIPv6Block = (request = {}) => this.client.fetch({
672
+ method: 'GET',
673
+ path: `/dedibox/v1/ipv6-block`,
674
+ urlParams: urlParams(['project_id', request.projectId])
675
+ }, unmarshalIPv6Block);
676
+
677
+ /**
678
+ * Update IPv6 block. Update DNS associated to IPv6 block. If DNS is used,
679
+ * minimum of 2 is necessary and maximum of 5 (no duplicate).
680
+ *
681
+ * @param request - The request {@link IPv6BlockApiUpdateIPv6BlockRequest}
682
+ * @returns A Promise of IPv6Block
683
+ */
684
+ updateIPv6Block = request => this.client.fetch({
685
+ body: JSON.stringify(marshalIPv6BlockApiUpdateIPv6BlockRequest(request, this.client.settings)),
686
+ headers: jsonContentHeaders,
687
+ method: 'PATCH',
688
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam('blockId', request.blockId)}`
689
+ }, unmarshalIPv6Block);
690
+
691
+ /**
692
+ * Delete IPv6 block. Delete IPv6 block subnet with the given ID.
693
+ *
694
+ * @param request - The request {@link IPv6BlockApiDeleteIPv6BlockRequest}
695
+ */
696
+ deleteIPv6Block = request => this.client.fetch({
697
+ method: 'DELETE',
698
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam('blockId', request.blockId)}`
699
+ });
700
+
701
+ /**
702
+ * Create IPv6 block subnet. Create IPv6 block subnet for the given IP ID. /48
703
+ * could create subnet in /56 (quota link to your number of server). /56 could
704
+ * create subnet in /64 (quota link to your number of failover IP).
705
+ *
706
+ * @param request - The request
707
+ * {@link IPv6BlockApiCreateIPv6BlockSubnetRequest}
708
+ * @returns A Promise of IPv6Block
709
+ */
710
+ createIPv6BlockSubnet = request => this.client.fetch({
711
+ body: JSON.stringify(marshalIPv6BlockApiCreateIPv6BlockSubnetRequest(request, this.client.settings)),
712
+ headers: jsonContentHeaders,
713
+ method: 'POST',
714
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam('blockId', request.blockId)}/subnets`
715
+ }, unmarshalIPv6Block);
716
+
717
+ /**
718
+ * List available IPv6 block subnets. List all available IPv6 block subnets
719
+ * for given IP ID.
720
+ *
721
+ * @param request - The request
722
+ * {@link IPv6BlockApiListIPv6BlockSubnetsAvailableRequest}
723
+ * @returns A Promise of ListIPv6BlockSubnetsAvailableResponse
724
+ */
725
+ listIPv6BlockSubnetsAvailable = request => this.client.fetch({
726
+ method: 'GET',
727
+ path: `/dedibox/v1/ipv6-blocks/${validatePathParam('blockId', request.blockId)}/subnets`
728
+ }, unmarshalListIPv6BlockSubnetsAvailableResponse);
729
+ }
730
+
731
+ /** Dedibox Phoenix RPN API. */
732
+ class RpnAPI extends API$1 {
733
+ pageOfListRpnServerCapabilities = (request = {}) => this.client.fetch({
734
+ method: 'GET',
735
+ path: `/dedibox/v1/rpn/server-capabilities`,
736
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
737
+ }, unmarshalListRpnServerCapabilitiesResponse);
738
+ listRpnServerCapabilities = (request = {}) => enrichForPagination('servers', this.pageOfListRpnServerCapabilities, request);
739
+ getRpnStatus = (request = {}) => this.client.fetch({
740
+ method: 'GET',
741
+ path: `/dedibox/v1/rpn/status`,
742
+ urlParams: urlParams(['project_id', request.projectId], ['rpnv1_group_id', request.rpnv1GroupId], ['rpnv2_group_id', request.rpnv2GroupId])
743
+ }, unmarshalGetRpnStatusResponse);
744
+ }
745
+
746
+ /** Dedibox Phoenix RPN SAN API. */
747
+ class RpnSanAPI extends API$1 {
748
+ pageOfListRpnSans = (request = {}) => this.client.fetch({
749
+ method: 'GET',
750
+ path: `/dedibox/v1/rpn-sans`,
751
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
752
+ }, unmarshalListRpnSansResponse);
753
+ listRpnSans = (request = {}) => enrichForPagination('rpnSans', this.pageOfListRpnSans, request);
754
+ getRpnSan = request => this.client.fetch({
755
+ method: 'GET',
756
+ path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}`
757
+ }, unmarshalRpnSan);
758
+
759
+ /**
760
+ * Waits for {@link RpnSan} to be in a final state.
761
+ *
762
+ * @param request - The request {@link RpnSanApiGetRpnSanRequest}
763
+ * @param options - The waiting options
764
+ * @returns A Promise of RpnSan
765
+ */
766
+ waitForRpnSan = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!RPN_SAN_TRANSIENT_STATUSES.includes(res.status))), this.getRpnSan, request, options);
767
+ deleteRpnSan = request => this.client.fetch({
768
+ method: 'DELETE',
769
+ path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}`
770
+ });
771
+ createRpnSan = request => this.client.fetch({
772
+ body: JSON.stringify(marshalRpnSanApiCreateRpnSanRequest(request, this.client.settings)),
773
+ headers: jsonContentHeaders,
774
+ method: 'POST',
775
+ path: `/dedibox/v1/rpn-sans`
776
+ }, unmarshalService);
777
+ listIps = request => this.client.fetch({
778
+ method: 'GET',
779
+ path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`,
780
+ urlParams: urlParams(['type', request.type])
781
+ }, unmarshalListIpsResponse);
782
+ addIp = request => this.client.fetch({
783
+ body: JSON.stringify(marshalRpnSanApiAddIpRequest(request, this.client.settings)),
784
+ headers: jsonContentHeaders,
785
+ method: 'POST',
786
+ path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`
787
+ });
788
+ removeIp = request => this.client.fetch({
789
+ body: JSON.stringify(marshalRpnSanApiRemoveIpRequest(request, this.client.settings)),
790
+ headers: jsonContentHeaders,
791
+ method: 'DELETE',
792
+ path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`
793
+ });
794
+ listAvailableIps = request => this.client.fetch({
795
+ method: 'GET',
796
+ path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/available-ips`,
797
+ urlParams: urlParams(['type', request.type])
798
+ }, unmarshalListIpsResponse);
799
+ }
800
+
801
+ /** Dedibox Phoenix RPN v1 API. */
802
+ class RpnV1API extends API$1 {
803
+ pageOfListRpnGroups = (request = {}) => this.client.fetch({
804
+ method: 'GET',
805
+ path: `/dedibox/v1/rpnv1/groups`,
806
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
807
+ }, unmarshalListRpnGroupsResponse);
808
+ listRpnGroups = (request = {}) => enrichForPagination('rpnGroups', this.pageOfListRpnGroups, request);
809
+ getRpnGroup = request => this.client.fetch({
810
+ method: 'GET',
811
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`
812
+ }, unmarshalRpnGroup);
813
+ createRpnGroup = request => this.client.fetch({
814
+ body: JSON.stringify(marshalRpnV1ApiCreateRpnGroupRequest(request, this.client.settings)),
815
+ headers: jsonContentHeaders,
816
+ method: 'POST',
817
+ path: `/dedibox/v1/rpnv1/groups`
818
+ }, unmarshalRpnGroup);
819
+ deleteRpnGroup = request => this.client.fetch({
820
+ method: 'DELETE',
821
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`
822
+ });
823
+ updateRpnGroupName = request => this.client.fetch({
824
+ body: JSON.stringify(marshalRpnV1ApiUpdateRpnGroupNameRequest(request, this.client.settings)),
825
+ headers: jsonContentHeaders,
826
+ method: 'PATCH',
827
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`
828
+ }, unmarshalRpnGroup);
829
+ pageOfListRpnGroupMembers = request => this.client.fetch({
830
+ method: 'GET',
831
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/members`,
832
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
833
+ }, unmarshalListRpnGroupMembersResponse);
834
+ listRpnGroupMembers = request => enrichForPagination('members', this.pageOfListRpnGroupMembers, request);
835
+ rpnGroupInvite = request => this.client.fetch({
836
+ body: JSON.stringify(marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings)),
837
+ headers: jsonContentHeaders,
838
+ method: 'POST',
839
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/invite`
840
+ });
841
+ leaveRpnGroup = request => this.client.fetch({
842
+ body: JSON.stringify(marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings)),
843
+ headers: jsonContentHeaders,
844
+ method: 'POST',
845
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/leave`
846
+ });
847
+ addRpnGroupMembers = request => this.client.fetch({
848
+ body: JSON.stringify(marshalRpnV1ApiAddRpnGroupMembersRequest(request, this.client.settings)),
849
+ headers: jsonContentHeaders,
850
+ method: 'POST',
851
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/members`
852
+ }, unmarshalRpnGroup);
853
+ deleteRpnGroupMembers = request => this.client.fetch({
854
+ body: JSON.stringify(marshalRpnV1ApiDeleteRpnGroupMembersRequest(request, this.client.settings)),
855
+ headers: jsonContentHeaders,
856
+ method: 'DELETE',
857
+ path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/members`
858
+ }, unmarshalRpnGroup);
859
+ pageOfListRpnCapableServers = (request = {}) => this.client.fetch({
860
+ method: 'GET',
861
+ path: `/dedibox/v1/rpnv1/capable-servers`,
862
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
863
+ }, unmarshalListRpnCapableServersResponse);
864
+ listRpnCapableServers = (request = {}) => enrichForPagination('servers', this.pageOfListRpnCapableServers, request);
865
+ pageOfListRpnCapableSanServers = (request = {}) => this.client.fetch({
866
+ method: 'GET',
867
+ path: `/dedibox/v1/rpnv1/capable-san-servers`,
868
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
869
+ }, unmarshalListRpnCapableSanServersResponse);
870
+ listRpnCapableSanServers = (request = {}) => enrichForPagination('sanServers', this.pageOfListRpnCapableSanServers, request);
871
+ pageOfListRpnInvites = (request = {}) => this.client.fetch({
872
+ method: 'GET',
873
+ path: `/dedibox/v1/rpnv1/invites`,
874
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])
875
+ }, unmarshalListRpnInvitesResponse);
876
+ listRpnInvites = (request = {}) => enrichForPagination('members', this.pageOfListRpnInvites, request);
877
+ acceptRpnInvite = request => this.client.fetch({
878
+ method: 'POST',
879
+ path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/accept`
880
+ });
881
+ refuseRpnInvite = request => this.client.fetch({
882
+ method: 'POST',
883
+ path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/refuse`
884
+ });
885
+ }
886
+
887
+ /** Dedibox Phoenix RPN v2 API. */
888
+ class RpnV2API extends API$1 {
889
+ pageOfListRpnV2Groups = (request = {}) => this.client.fetch({
890
+ method: 'GET',
891
+ path: `/dedibox/v1/rpnv2/groups`,
892
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
893
+ }, unmarshalListRpnV2GroupsResponse);
894
+ listRpnV2Groups = (request = {}) => enrichForPagination('rpnGroups', this.pageOfListRpnV2Groups, request);
895
+ pageOfListRpnV2Members = request => this.client.fetch({
896
+ method: 'GET',
897
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`,
898
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['type', request.type])
899
+ }, unmarshalListRpnV2MembersResponse);
900
+ listRpnV2Members = request => enrichForPagination('members', this.pageOfListRpnV2Members, request);
901
+ getRpnV2Group = request => this.client.fetch({
902
+ method: 'GET',
903
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}`
904
+ }, unmarshalRpnV2Group);
905
+
906
+ /**
907
+ * Waits for {@link RpnV2Group} to be in a final state.
908
+ *
909
+ * @param request - The request {@link RpnV2ApiGetRpnV2GroupRequest}
910
+ * @param options - The waiting options
911
+ * @returns A Promise of RpnV2Group
912
+ */
913
+ waitForRpnV2Group = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!RPN_V2_GROUP_TRANSIENT_STATUSES.includes(res.status))), this.getRpnV2Group, request, options);
914
+ createRpnV2Group = request => this.client.fetch({
915
+ body: JSON.stringify(marshalRpnV2ApiCreateRpnV2GroupRequest(request, this.client.settings)),
916
+ headers: jsonContentHeaders,
917
+ method: 'POST',
918
+ path: `/dedibox/v1/rpnv2/groups`
919
+ }, unmarshalRpnV2Group);
920
+ deleteRpnV2Group = request => this.client.fetch({
921
+ method: 'DELETE',
922
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}`
923
+ });
924
+ updateRpnV2GroupName = request => this.client.fetch({
925
+ body: JSON.stringify(marshalRpnV2ApiUpdateRpnV2GroupNameRequest(request, this.client.settings)),
926
+ headers: jsonContentHeaders,
927
+ method: 'PATCH',
928
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}`
929
+ }, unmarshalRpnV2Group);
930
+ addRpnV2Members = request => this.client.fetch({
931
+ body: JSON.stringify(marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings)),
932
+ headers: jsonContentHeaders,
933
+ method: 'POST',
934
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`
935
+ });
936
+ deleteRpnV2Members = request => this.client.fetch({
937
+ body: JSON.stringify(marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings)),
938
+ headers: jsonContentHeaders,
939
+ method: 'DELETE',
940
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`
941
+ });
942
+ pageOfListRpnV2CapableResources = (request = {}) => this.client.fetch({
943
+ method: 'GET',
944
+ path: `/dedibox/v1/rpnv2/groups/capable`,
945
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
946
+ }, unmarshalListRpnV2CapableResourcesResponse);
947
+ listRpnV2CapableResources = (request = {}) => enrichForPagination('servers', this.pageOfListRpnV2CapableResources, request);
948
+ pageOfListRpnV2GroupLogs = request => this.client.fetch({
949
+ method: 'GET',
950
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/logs`,
951
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
952
+ }, unmarshalListRpnV2GroupLogsResponse);
953
+ listRpnV2GroupLogs = request => enrichForPagination('logs', this.pageOfListRpnV2GroupLogs, request);
954
+ updateRpnV2VlanForMembers = request => this.client.fetch({
955
+ body: JSON.stringify(marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest(request, this.client.settings)),
956
+ headers: jsonContentHeaders,
957
+ method: 'PATCH',
958
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/vlan`
959
+ });
960
+ enableRpnV2GroupCompatibility = request => this.client.fetch({
961
+ body: JSON.stringify(marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest(request, this.client.settings)),
962
+ headers: jsonContentHeaders,
963
+ method: 'POST',
964
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/enable-compatibility`
965
+ });
966
+ disableRpnV2GroupCompatibility = request => this.client.fetch({
967
+ body: '{}',
968
+ headers: jsonContentHeaders,
969
+ method: 'POST',
970
+ path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/disable-compatibility`
971
+ });
972
+ }
973
+
974
+ export { API, BillingAPI, IPv6BlockAPI, RpnAPI, RpnSanAPI, RpnV1API, RpnV2API };