@scaleway/sdk 2.1.0 → 2.3.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.
@@ -98,40 +98,6 @@ const unmarshalImage = data => {
98
98
  zone: data.zone
99
99
  };
100
100
  };
101
- const unmarshalCreateImageResponse = data => {
102
- if (!isJSONObject(data)) {
103
- throw new TypeError(`Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`);
104
- }
105
- return {
106
- image: data.image ? unmarshalImage(data.image) : undefined
107
- };
108
- };
109
- const unmarshalIp = data => {
110
- if (!isJSONObject(data)) {
111
- throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`);
112
- }
113
- return {
114
- address: data.address,
115
- id: data.id,
116
- organization: data.organization,
117
- prefix: data.prefix,
118
- project: data.project,
119
- reverse: data.reverse,
120
- server: data.server ? unmarshalServerSummary(data.server) : undefined,
121
- state: data.state,
122
- tags: data.tags,
123
- type: data.type,
124
- zone: data.zone
125
- };
126
- };
127
- const unmarshalCreateIpResponse = data => {
128
- if (!isJSONObject(data)) {
129
- throw new TypeError(`Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`);
130
- }
131
- return {
132
- ip: data.ip ? unmarshalIp(data.ip) : undefined
133
- };
134
- };
135
101
  const unmarshalPlacementGroup = data => {
136
102
  if (!isJSONObject(data)) {
137
103
  throw new TypeError(`Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.`);
@@ -148,79 +114,6 @@ const unmarshalPlacementGroup = data => {
148
114
  zone: data.zone
149
115
  };
150
116
  };
151
- const unmarshalCreatePlacementGroupResponse = data => {
152
- if (!isJSONObject(data)) {
153
- throw new TypeError(`Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`);
154
- }
155
- return {
156
- placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined
157
- };
158
- };
159
- const unmarshalCreatePrivateNICResponse = data => {
160
- if (!isJSONObject(data)) {
161
- throw new TypeError(`Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`);
162
- }
163
- return {
164
- privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined
165
- };
166
- };
167
- const unmarshalSecurityGroup = data => {
168
- if (!isJSONObject(data)) {
169
- throw new TypeError(`Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`);
170
- }
171
- return {
172
- creationDate: unmarshalDate(data.creation_date),
173
- description: data.description,
174
- enableDefaultSecurity: data.enable_default_security,
175
- id: data.id,
176
- inboundDefaultPolicy: data.inbound_default_policy,
177
- modificationDate: unmarshalDate(data.modification_date),
178
- name: data.name,
179
- organization: data.organization,
180
- organizationDefault: data.organization_default,
181
- outboundDefaultPolicy: data.outbound_default_policy,
182
- project: data.project,
183
- projectDefault: data.project_default,
184
- servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
185
- state: data.state,
186
- stateful: data.stateful,
187
- tags: data.tags,
188
- zone: data.zone
189
- };
190
- };
191
- const unmarshalCreateSecurityGroupResponse = data => {
192
- if (!isJSONObject(data)) {
193
- throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`);
194
- }
195
- return {
196
- securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined
197
- };
198
- };
199
- const unmarshalSecurityGroupRule = data => {
200
- if (!isJSONObject(data)) {
201
- throw new TypeError(`Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`);
202
- }
203
- return {
204
- action: data.action,
205
- destPortFrom: data.dest_port_from,
206
- destPortTo: data.dest_port_to,
207
- direction: data.direction,
208
- editable: data.editable,
209
- id: data.id,
210
- ipRange: data.ip_range,
211
- position: data.position,
212
- protocol: data.protocol,
213
- zone: data.zone
214
- };
215
- };
216
- const unmarshalCreateSecurityGroupRuleResponse = data => {
217
- if (!isJSONObject(data)) {
218
- throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
219
- }
220
- return {
221
- rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined
222
- };
223
- };
224
117
  const unmarshalSecurityGroupSummary = data => {
225
118
  if (!isJSONObject(data)) {
226
119
  throw new TypeError(`Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.`);
@@ -335,6 +228,121 @@ const unmarshalServer = data => {
335
228
  zone: data.zone
336
229
  };
337
230
  };
231
+ const unmarshalAttachServerVolumeResponse = data => {
232
+ if (!isJSONObject(data)) {
233
+ throw new TypeError(`Unmarshalling the type 'AttachServerVolumeResponse' failed as data isn't a dictionary.`);
234
+ }
235
+ return {
236
+ server: data.server ? unmarshalServer(data.server) : undefined
237
+ };
238
+ };
239
+ const unmarshalCreateImageResponse = data => {
240
+ if (!isJSONObject(data)) {
241
+ throw new TypeError(`Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`);
242
+ }
243
+ return {
244
+ image: data.image ? unmarshalImage(data.image) : undefined
245
+ };
246
+ };
247
+ const unmarshalIp = data => {
248
+ if (!isJSONObject(data)) {
249
+ throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`);
250
+ }
251
+ return {
252
+ address: data.address,
253
+ id: data.id,
254
+ organization: data.organization,
255
+ prefix: data.prefix,
256
+ project: data.project,
257
+ reverse: data.reverse,
258
+ server: data.server ? unmarshalServerSummary(data.server) : undefined,
259
+ state: data.state,
260
+ tags: data.tags,
261
+ type: data.type,
262
+ zone: data.zone
263
+ };
264
+ };
265
+ const unmarshalCreateIpResponse = data => {
266
+ if (!isJSONObject(data)) {
267
+ throw new TypeError(`Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`);
268
+ }
269
+ return {
270
+ ip: data.ip ? unmarshalIp(data.ip) : undefined
271
+ };
272
+ };
273
+ const unmarshalCreatePlacementGroupResponse = data => {
274
+ if (!isJSONObject(data)) {
275
+ throw new TypeError(`Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`);
276
+ }
277
+ return {
278
+ placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined
279
+ };
280
+ };
281
+ const unmarshalCreatePrivateNICResponse = data => {
282
+ if (!isJSONObject(data)) {
283
+ throw new TypeError(`Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`);
284
+ }
285
+ return {
286
+ privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined
287
+ };
288
+ };
289
+ const unmarshalSecurityGroup = data => {
290
+ if (!isJSONObject(data)) {
291
+ throw new TypeError(`Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`);
292
+ }
293
+ return {
294
+ creationDate: unmarshalDate(data.creation_date),
295
+ description: data.description,
296
+ enableDefaultSecurity: data.enable_default_security,
297
+ id: data.id,
298
+ inboundDefaultPolicy: data.inbound_default_policy,
299
+ modificationDate: unmarshalDate(data.modification_date),
300
+ name: data.name,
301
+ organization: data.organization,
302
+ organizationDefault: data.organization_default,
303
+ outboundDefaultPolicy: data.outbound_default_policy,
304
+ project: data.project,
305
+ projectDefault: data.project_default,
306
+ servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),
307
+ state: data.state,
308
+ stateful: data.stateful,
309
+ tags: data.tags,
310
+ zone: data.zone
311
+ };
312
+ };
313
+ const unmarshalCreateSecurityGroupResponse = data => {
314
+ if (!isJSONObject(data)) {
315
+ throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`);
316
+ }
317
+ return {
318
+ securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined
319
+ };
320
+ };
321
+ const unmarshalSecurityGroupRule = data => {
322
+ if (!isJSONObject(data)) {
323
+ throw new TypeError(`Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`);
324
+ }
325
+ return {
326
+ action: data.action,
327
+ destPortFrom: data.dest_port_from,
328
+ destPortTo: data.dest_port_to,
329
+ direction: data.direction,
330
+ editable: data.editable,
331
+ id: data.id,
332
+ ipRange: data.ip_range,
333
+ position: data.position,
334
+ protocol: data.protocol,
335
+ zone: data.zone
336
+ };
337
+ };
338
+ const unmarshalCreateSecurityGroupRuleResponse = data => {
339
+ if (!isJSONObject(data)) {
340
+ throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`);
341
+ }
342
+ return {
343
+ rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined
344
+ };
345
+ };
338
346
  const unmarshalCreateServerResponse = data => {
339
347
  if (!isJSONObject(data)) {
340
348
  throw new TypeError(`Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`);
@@ -405,6 +413,14 @@ const unmarshalCreateVolumeResponse = data => {
405
413
  volume: data.volume ? unmarshalVolume(data.volume) : undefined
406
414
  };
407
415
  };
416
+ const unmarshalDetachServerVolumeResponse = data => {
417
+ if (!isJSONObject(data)) {
418
+ throw new TypeError(`Unmarshalling the type 'DetachServerVolumeResponse' failed as data isn't a dictionary.`);
419
+ }
420
+ return {
421
+ server: data.server ? unmarshalServer(data.server) : undefined
422
+ };
423
+ };
408
424
  const unmarshalExportSnapshotResponse = data => {
409
425
  if (!isJSONObject(data)) {
410
426
  throw new TypeError(`Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`);
@@ -907,6 +923,11 @@ const marshalApplyBlockMigrationRequest = (request, defaults) => ({
907
923
  value: request.snapshotId
908
924
  }])
909
925
  });
926
+ const marshalAttachServerVolumeRequest = (request, defaults) => ({
927
+ boot: request.boot,
928
+ volume_id: request.volumeId,
929
+ volume_type: request.volumeType
930
+ });
910
931
  const marshalVolumeTemplate = (request, defaults) => ({
911
932
  id: request.id,
912
933
  name: request.name,
@@ -1096,6 +1117,9 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
1096
1117
  value: request.baseSnapshot
1097
1118
  }])
1098
1119
  });
1120
+ const marshalDetachServerVolumeRequest = (request, defaults) => ({
1121
+ volume_id: request.volumeId
1122
+ });
1099
1123
  const marshalExportSnapshotRequest = (request, defaults) => ({
1100
1124
  bucket: request.bucket,
1101
1125
  key: request.key
@@ -1412,4 +1436,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
1412
1436
  tags: request.tags
1413
1437
  });
1414
1438
 
1415
- export { marshalApplyBlockMigrationRequest, marshalCreateImageRequest, marshalCreateIpRequest, marshalCreatePlacementGroupRequest, marshalCreatePrivateNICRequest, marshalCreateSecurityGroupRequest, marshalCreateSecurityGroupRuleRequest, marshalCreateServerRequest, marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalExportSnapshotRequest, marshalPlanBlockMigrationRequest, marshalServerActionRequest, marshalSetImageRequest, marshalSetPlacementGroupRequest, marshalSetPlacementGroupServersRequest, marshalSetSecurityGroupRequest, marshalSetSecurityGroupRuleRequest, marshalSetSecurityGroupRulesRequest, marshalSetServerRequest, marshalSetSnapshotRequest, marshalUpdateIpRequest, marshalUpdatePlacementGroupRequest, marshalUpdatePlacementGroupServersRequest, marshalUpdatePrivateNICRequest, marshalUpdateServerRequest, marshalUpdateVolumeRequest, unmarshalCreateImageResponse, unmarshalCreateIpResponse, unmarshalCreatePlacementGroupResponse, unmarshalCreatePrivateNICResponse, unmarshalCreateSecurityGroupResponse, unmarshalCreateSecurityGroupRuleResponse, unmarshalCreateServerResponse, unmarshalCreateSnapshotResponse, unmarshalCreateVolumeResponse, unmarshalExportSnapshotResponse, unmarshalGetBootscriptResponse, unmarshalGetDashboardResponse, unmarshalGetImageResponse, unmarshalGetIpResponse, unmarshalGetPlacementGroupResponse, unmarshalGetPlacementGroupServersResponse, unmarshalGetPrivateNICResponse, unmarshalGetSecurityGroupResponse, unmarshalGetSecurityGroupRuleResponse, unmarshalGetServerResponse, unmarshalGetServerTypesAvailabilityResponse, unmarshalGetSnapshotResponse, unmarshalGetVolumeResponse, unmarshalListBootscriptsResponse, unmarshalListImagesResponse, unmarshalListIpsResponse, unmarshalListPlacementGroupsResponse, unmarshalListPrivateNICsResponse, unmarshalListSecurityGroupRulesResponse, unmarshalListSecurityGroupsResponse, unmarshalListServerActionsResponse, unmarshalListServerUserDataResponse, unmarshalListServersResponse, unmarshalListServersTypesResponse, unmarshalListSnapshotsResponse, unmarshalListVolumesResponse, unmarshalListVolumesTypesResponse, unmarshalMigrationPlan, unmarshalPrivateNIC, unmarshalServerActionResponse, unmarshalSetImageResponse, unmarshalSetPlacementGroupResponse, unmarshalSetPlacementGroupServersResponse, unmarshalSetSecurityGroupResponse, unmarshalSetSecurityGroupRuleResponse, unmarshalSetSecurityGroupRulesResponse, unmarshalSetServerResponse, unmarshalSetSnapshotResponse, unmarshalUpdateIpResponse, unmarshalUpdatePlacementGroupResponse, unmarshalUpdatePlacementGroupServersResponse, unmarshalUpdateServerResponse, unmarshalUpdateVolumeResponse };
1439
+ export { marshalApplyBlockMigrationRequest, marshalAttachServerVolumeRequest, marshalCreateImageRequest, marshalCreateIpRequest, marshalCreatePlacementGroupRequest, marshalCreatePrivateNICRequest, marshalCreateSecurityGroupRequest, marshalCreateSecurityGroupRuleRequest, marshalCreateServerRequest, marshalCreateSnapshotRequest, marshalCreateVolumeRequest, marshalDetachServerVolumeRequest, marshalExportSnapshotRequest, marshalPlanBlockMigrationRequest, marshalServerActionRequest, marshalSetImageRequest, marshalSetPlacementGroupRequest, marshalSetPlacementGroupServersRequest, marshalSetSecurityGroupRequest, marshalSetSecurityGroupRuleRequest, marshalSetSecurityGroupRulesRequest, marshalSetServerRequest, marshalSetSnapshotRequest, marshalUpdateIpRequest, marshalUpdatePlacementGroupRequest, marshalUpdatePlacementGroupServersRequest, marshalUpdatePrivateNICRequest, marshalUpdateServerRequest, marshalUpdateVolumeRequest, unmarshalAttachServerVolumeResponse, unmarshalCreateImageResponse, unmarshalCreateIpResponse, unmarshalCreatePlacementGroupResponse, unmarshalCreatePrivateNICResponse, unmarshalCreateSecurityGroupResponse, unmarshalCreateSecurityGroupRuleResponse, unmarshalCreateServerResponse, unmarshalCreateSnapshotResponse, unmarshalCreateVolumeResponse, unmarshalDetachServerVolumeResponse, unmarshalExportSnapshotResponse, unmarshalGetBootscriptResponse, unmarshalGetDashboardResponse, unmarshalGetImageResponse, unmarshalGetIpResponse, unmarshalGetPlacementGroupResponse, unmarshalGetPlacementGroupServersResponse, unmarshalGetPrivateNICResponse, unmarshalGetSecurityGroupResponse, unmarshalGetSecurityGroupRuleResponse, unmarshalGetServerResponse, unmarshalGetServerTypesAvailabilityResponse, unmarshalGetSnapshotResponse, unmarshalGetVolumeResponse, unmarshalListBootscriptsResponse, unmarshalListImagesResponse, unmarshalListIpsResponse, unmarshalListPlacementGroupsResponse, unmarshalListPrivateNICsResponse, unmarshalListSecurityGroupRulesResponse, unmarshalListSecurityGroupsResponse, unmarshalListServerActionsResponse, unmarshalListServerUserDataResponse, unmarshalListServersResponse, unmarshalListServersTypesResponse, unmarshalListSnapshotsResponse, unmarshalListVolumesResponse, unmarshalListVolumesTypesResponse, unmarshalMigrationPlan, unmarshalPrivateNIC, unmarshalServerActionResponse, unmarshalSetImageResponse, unmarshalSetPlacementGroupResponse, unmarshalSetPlacementGroupServersResponse, unmarshalSetSecurityGroupResponse, unmarshalSetSecurityGroupRuleResponse, unmarshalSetSecurityGroupRulesResponse, unmarshalSetServerResponse, unmarshalSetSnapshotResponse, unmarshalUpdateIpResponse, unmarshalUpdatePlacementGroupResponse, unmarshalUpdatePlacementGroupServersResponse, unmarshalUpdateServerResponse, unmarshalUpdateVolumeResponse };
@@ -137,6 +137,21 @@ class API extends API$1 {
137
137
  method: 'POST',
138
138
  path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/create-by-cid`
139
139
  }, unmarshalPin);
140
+
141
+ /**
142
+ * Replace pin by CID. Deletes the given resource ID and pins the new CID in
143
+ * its place. Will fetch and store the content pointed by the provided CID.
144
+ * The content must be available on the public IPFS network. The content (IPFS
145
+ * blocks) is hosted by the pinning service until the pin is deleted. While
146
+ * the content is available any other IPFS peer can fetch and host your
147
+ * content. For this reason, we recommend that you pin either public or
148
+ * encrypted content. Several different pin requests can target the same CID.
149
+ * A pin is defined by its ID (UUID), its status (queued, pinning, pinned or
150
+ * failed) and target CID.
151
+ *
152
+ * @param request - The request {@link ReplacePinRequest}
153
+ * @returns A Promise of ReplacePinResponse
154
+ */
140
155
  replacePin = request => this.client.fetch({
141
156
  body: JSON.stringify(marshalReplacePinRequest(request, this.client.settings)),
142
157
  headers: jsonContentHeaders,
@@ -260,6 +260,13 @@ class API extends API$1 {
260
260
  * metadata of a secret's given version specified by the `region`,
261
261
  * `secret_name`, `revision` and `project_id` parameters.
262
262
  *
263
+ * This method is deprecated.
264
+ *
265
+ * Scaleway recommends that you use the `ListSecrets` request with the `name`
266
+ * filter to specify the secret version desired, then use the
267
+ * `GetSecretVersion` request.
268
+ *
269
+ * @deprecated
263
270
  * @param request - The request {@link GetSecretVersionByNameRequest}
264
271
  * @returns A Promise of SecretVersion
265
272
  */
@@ -308,6 +315,13 @@ class API extends API$1 {
308
315
  * given secret's versions specified by the `secret_name`,`region` and
309
316
  * `project_id` parameters.
310
317
  *
318
+ * This method is deprecated.
319
+ *
320
+ * Scaleway recommends that you use the `ListSecrets` request with the `name`
321
+ * filter to specify the secret version desired, then use the
322
+ * `ListSecretVersions` request.
323
+ *
324
+ * @deprecated
311
325
  * @param request - The request {@link ListSecretVersionsByNameRequest}
312
326
  * @returns A Promise of ListSecretVersionsResponse
313
327
  */
@@ -359,6 +373,13 @@ class API extends API$1 {
359
373
  * a secret's version specified by the `region`, `secret_name`, `revision` and
360
374
  * `project_id` parameters.
361
375
  *
376
+ * This method is deprecated.
377
+ *
378
+ * Scaleway recommends that you use the `ListSecrets` request with the `name`
379
+ * filter to specify the secret version desired, then use the
380
+ * `AccessSecretVersion` request.
381
+ *
382
+ * @deprecated
362
383
  * @param request - The request {@link AccessSecretVersionByNameRequest}
363
384
  * @returns A Promise of AccessSecretVersionResponse
364
385
  */
@@ -14,7 +14,7 @@ const jsonContentHeaders = {
14
14
  /** Public Gateways API. */
15
15
  class API extends API$1 {
16
16
  /** Lists the available zones of the API. */
17
- static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2'];
17
+ static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2', 'pl-waw-3'];
18
18
  pageOfListGateways = (() => {
19
19
  var _this = this;
20
20
  return function (request) {
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { HOSTING_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse } from './marshalling.gen.js';
6
+ import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse, unmarshalListControlPanelsResponse } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -14,7 +14,7 @@ const jsonContentHeaders = {
14
14
  /** Web Hosting API. */
15
15
  class API extends API$1 {
16
16
  /** Lists the available regions of the API. */
17
- static LOCALITIES = ['fr-par'];
17
+ static LOCALITIES = ['fr-par', 'nl-ams'];
18
18
 
19
19
  /**
20
20
  * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer
@@ -38,7 +38,7 @@ class API extends API$1 {
38
38
  return _this.client.fetch({
39
39
  method: 'GET',
40
40
  path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/hostings`,
41
- urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['tags', request.tags])
41
+ urlParams: urlParams(['control_panels', request.controlPanels], ['domain', request.domain], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['tags', request.tags])
42
42
  }, unmarshalListHostingsResponse);
43
43
  };
44
44
  })();
@@ -153,6 +153,36 @@ class API extends API$1 {
153
153
  path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offers`,
154
154
  urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy], ['without_options', request.withoutOptions])
155
155
  }, unmarshalListOffersResponse);
156
+ pageOfListControlPanels = (() => {
157
+ var _this3 = this;
158
+ return function (request) {
159
+ if (request === void 0) {
160
+ request = {};
161
+ }
162
+ return _this3.client.fetch({
163
+ method: 'GET',
164
+ path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/control-panels`,
165
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize])
166
+ }, unmarshalListControlPanelsResponse);
167
+ };
168
+ })();
169
+
170
+ /**
171
+ * List all control panels type. List the control panels type: cpanel or
172
+ * plesk.
173
+ *
174
+ * @param request - The request {@link ListControlPanelsRequest}
175
+ * @returns A Promise of ListControlPanelsResponse
176
+ */
177
+ listControlPanels = (() => {
178
+ var _this4 = this;
179
+ return function (request) {
180
+ if (request === void 0) {
181
+ request = {};
182
+ }
183
+ return enrichForPagination('controlPanels', _this4.pageOfListControlPanels, request);
184
+ };
185
+ })();
156
186
  }
157
187
 
158
188
  export { API };
@@ -27,6 +27,7 @@ const unmarshalHosting = data => {
27
27
  throw new TypeError(`Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`);
28
28
  }
29
29
  return {
30
+ controlPanelName: data.control_panel_name,
30
31
  cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : undefined,
31
32
  createdAt: unmarshalDate(data.created_at),
32
33
  dnsStatus: data.dns_status,
@@ -80,6 +81,25 @@ const unmarshalDnsRecords = data => {
80
81
  status: data.status
81
82
  };
82
83
  };
84
+ const unmarshalControlPanel = data => {
85
+ if (!isJSONObject(data)) {
86
+ throw new TypeError(`Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`);
87
+ }
88
+ return {
89
+ available: data.available,
90
+ logoUrl: data.logo_url,
91
+ name: data.name
92
+ };
93
+ };
94
+ const unmarshalListControlPanelsResponse = data => {
95
+ if (!isJSONObject(data)) {
96
+ throw new TypeError(`Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.`);
97
+ }
98
+ return {
99
+ controlPanels: unmarshalArrayOfObject(data.control_panels, unmarshalControlPanel),
100
+ totalCount: data.total_count
101
+ };
102
+ };
83
103
  const unmarshalListHostingsResponse = data => {
84
104
  if (!isJSONObject(data)) {
85
105
  throw new TypeError(`Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`);
@@ -113,6 +133,7 @@ const unmarshalOffer = data => {
113
133
  return {
114
134
  available: data.available,
115
135
  billingOperationPath: data.billing_operation_path,
136
+ controlPanelName: data.control_panel_name,
116
137
  endOfLife: data.end_of_life,
117
138
  id: data.id,
118
139
  price: data.price ? unmarshalMoney(data.price) : undefined,
@@ -143,4 +164,4 @@ const marshalUpdateHostingRequest = (request, defaults) => ({
143
164
  tags: request.tags
144
165
  });
145
166
 
146
- export { marshalCreateHostingRequest, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalHosting, unmarshalListHostingsResponse, unmarshalListOffersResponse };
167
+ export { marshalCreateHostingRequest, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalHosting, unmarshalListControlPanelsResponse, unmarshalListHostingsResponse, unmarshalListOffersResponse };
@@ -1,6 +1,15 @@
1
1
  // This file was automatically generated. DO NOT EDIT.
2
2
  // If you have any remark or suggestion do not hesitate to open an issue.
3
3
 
4
+ const ListControlPanelsRequest = {
5
+ page: {
6
+ greaterThan: 0
7
+ },
8
+ pageSize: {
9
+ greaterThan: 0,
10
+ lessThanOrEqual: 100
11
+ }
12
+ };
4
13
  const ListHostingsRequest = {
5
14
  page: {
6
15
  greaterThan: 0
@@ -11,4 +20,4 @@ const ListHostingsRequest = {
11
20
  }
12
21
  };
13
22
 
14
- export { ListHostingsRequest };
23
+ export { ListControlPanelsRequest, ListHostingsRequest };