@scaleway/sdk 1.5.0 → 1.7.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.
Files changed (46) hide show
  1. package/dist/api/applesilicon/v1alpha1/api.gen.js +2 -2
  2. package/dist/api/baremetal/v1/api.gen.js +3 -3
  3. package/dist/api/baremetal/v1/api.utils.js +1 -1
  4. package/dist/api/cockpit/v1beta1/api.gen.js +89 -29
  5. package/dist/api/cockpit/v1beta1/marshalling.gen.js +44 -1
  6. package/dist/api/container/v1beta1/api.gen.js +35 -29
  7. package/dist/api/container/v1beta1/marshalling.gen.js +1 -1
  8. package/dist/api/domain/v2beta1/api.gen.js +2 -2
  9. package/dist/api/flexibleip/v1alpha1/api.gen.js +2 -2
  10. package/dist/api/function/v1beta1/api.gen.js +40 -31
  11. package/dist/api/function/v1beta1/marshalling.gen.js +1 -20
  12. package/dist/api/iam/v1alpha1/api.gen.js +2 -3
  13. package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
  14. package/dist/api/iam/v1alpha1/validation-rules.gen.js +10 -10
  15. package/dist/api/instance/v1/api.gen.js +86 -67
  16. package/dist/api/instance/v1/api.utils.js +7 -13
  17. package/dist/api/iot/v1/api.gen.js +2 -2
  18. package/dist/api/k8s/v1/api.gen.js +4 -4
  19. package/dist/api/lb/v1/api.gen.js +6 -6
  20. package/dist/api/lb/v1/api.utils.js +4 -4
  21. package/dist/api/lb/v1/marshalling.gen.js +33 -19
  22. package/dist/api/marketplace/v2/api.gen.js +46 -3
  23. package/dist/api/mnq/v1alpha1/api.gen.js +36 -13
  24. package/dist/api/rdb/v1/api.gen.js +6 -6
  25. package/dist/api/redis/v1/api.gen.js +2 -2
  26. package/dist/api/redis/v1/marshalling.gen.js +2 -0
  27. package/dist/api/registry/v1/api.gen.js +4 -4
  28. package/dist/api/secret/v1alpha1/api.gen.js +27 -16
  29. package/dist/api/secret/v1alpha1/marshalling.gen.js +22 -3
  30. package/dist/api/tem/v1alpha1/api.gen.js +3 -3
  31. package/dist/api/test/v1/api.gen.js +1 -1
  32. package/dist/api/vpc/v1/api.gen.js +15 -7
  33. package/dist/api/vpcgw/v1/api.gen.js +3 -3
  34. package/dist/api/webhosting/v1alpha1/api.gen.js +2 -2
  35. package/dist/helpers/marshalling.js +1 -1
  36. package/dist/index.cjs +513 -234
  37. package/dist/index.d.ts +1469 -736
  38. package/dist/internal/async/interval-retrier.js +8 -2
  39. package/dist/internal/logger/level-resolver.js +3 -3
  40. package/dist/scw/client-ini-factory.js +6 -0
  41. package/dist/scw/client-ini-profile.js +18 -0
  42. package/dist/scw/client-settings.js +12 -0
  43. package/dist/scw/constants.js +1 -1
  44. package/dist/scw/custom-marshalling.js +4 -7
  45. package/dist/scw/errors/standard/quotas-exceeded-error.js +6 -0
  46. package/package.json +2 -2
@@ -154,7 +154,7 @@ class API extends API$1 {
154
154
  * @param options - The waiting options
155
155
  * @returns A Promise of Server
156
156
  */
157
- this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
157
+ this.waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
158
158
  /**
159
159
  * Update a server. Update the parameters of an existing Apple silicon server,
160
160
  * specified by its server ID.
@@ -209,8 +209,8 @@ class API extends API$1 {
209
209
  path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`
210
210
  }, unmarshalServer);
211
211
  }
212
+ /** Lists the available zones of the API. */
212
213
  }
213
- /** Lists the available zones of the API. */
214
214
  API.LOCALITIES = ['fr-par-3'];
215
215
 
216
216
  export { API };
@@ -61,7 +61,7 @@ class API extends API$1 {
61
61
  * @param options - The waiting options
62
62
  * @returns A Promise of Server
63
63
  */
64
- this.waitForServer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
64
+ this.waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES.includes(res.status))), this.getServer, request, options);
65
65
  /**
66
66
  * Create an Elastic Metal server. Create a new Elastic Metal server. Once the
67
67
  * server is created, proceed with the [installation of an OS](#post-3e949e).
@@ -389,10 +389,10 @@ class API extends API$1 {
389
389
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`
390
390
  }, unmarshalOS);
391
391
  }
392
+ /** Lists the available zones of the API. */
392
393
  }
393
394
 
394
395
  /** Elastic Metal Private Network API. */
395
- /** Lists the available zones of the API. */
396
396
  API.LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];
397
397
  class PrivateNetworkAPI extends API$1 {
398
398
  constructor() {
@@ -459,8 +459,8 @@ class PrivateNetworkAPI extends API$1 {
459
459
  path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`
460
460
  });
461
461
  }
462
+ /** Lists the available zones of the API. */
462
463
  }
463
- /** Lists the available zones of the API. */
464
464
  PrivateNetworkAPI.LOCALITIES = ['fr-par-2'];
465
465
 
466
466
  export { API, PrivateNetworkAPI };
@@ -23,7 +23,7 @@ class BaremetalV1UtilsAPI extends API {
23
23
  done: !SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status),
24
24
  value
25
25
  };
26
- }, createExponentialBackoffStrategy((options == null ? void 0 : options.minDelay) ?? 1, (options == null ? void 0 : options.maxDelay) ?? 30), options == null ? void 0 : options.timeout);
26
+ }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);
27
27
  }
28
28
  }
29
29
 
@@ -3,7 +3,7 @@ import { API as API$1 } from '../../../scw/api.js';
3
3
  import { urlParams, validatePathParam } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
5
  import { COCKPIT_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { marshalActivateCockpitRequest, unmarshalCockpit, marshalDeactivateCockpitRequest, marshalResetCockpitGrafanaRequest, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest } from './marshalling.gen.js';
6
+ import { marshalActivateCockpitRequest, unmarshalCockpit, unmarshalCockpitMetrics, marshalDeactivateCockpitRequest, marshalResetCockpitGrafanaRequest, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalSelectPlanResponse } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  const jsonContentHeaders = {
@@ -11,9 +11,12 @@ const jsonContentHeaders = {
11
11
  };
12
12
 
13
13
  /**
14
- * Cockpit API.
14
+ * Cockpit API documentation.
15
15
  *
16
- * This API allows to manage Cockpits. Cockpit API.
16
+ * Cockpit's API allows you to monitor your applications and their
17
+ * infrastructure. Cockpit's API allows you to activate your Cockpit on your
18
+ * Projects. Scaleway's Cockpit stores metrics and logs and provides a dedicated
19
+ * Grafana for dashboarding to visualize them.
17
20
  */
18
21
  class API extends API$1 {
19
22
  constructor() {
@@ -21,8 +24,7 @@ class API extends API$1 {
21
24
  super(...arguments);
22
25
  _this = this;
23
26
  /**
24
- * Activate a cockpit. Activate a cockpit associated with the given project
25
- * ID.
27
+ * Activate a Cockpit. Activate the Cockpit of the specified Project ID.
26
28
  *
27
29
  * @param request - The request {@link ActivateCockpitRequest}
28
30
  * @returns A Promise of Cockpit
@@ -39,7 +41,7 @@ class API extends API$1 {
39
41
  }, unmarshalCockpit);
40
42
  };
41
43
  /**
42
- * Get cockpit. Get the cockpit associated with the given project ID.
44
+ * Get a Cockpit. Retrieve the Cockpit of the specified Project ID.
43
45
  *
44
46
  * @param request - The request {@link GetCockpitRequest}
45
47
  * @returns A Promise of Cockpit
@@ -65,11 +67,27 @@ class API extends API$1 {
65
67
  if (request === void 0) {
66
68
  request = {};
67
69
  }
68
- return waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!COCKPIT_TRANSIENT_STATUSES.includes(res.status))), _this.getCockpit, request, options);
70
+ return waitForResource(options?.stop ?? (res => Promise.resolve(!COCKPIT_TRANSIENT_STATUSES.includes(res.status))), _this.getCockpit, request, options);
69
71
  };
70
72
  /**
71
- * Deactivate a cockpit. Deactivate a cockpit associated with the given
72
- * project ID.
73
+ * Get Cockpit metrics. Get metrics from your Cockpit with the specified
74
+ * Project ID.
75
+ *
76
+ * @param request - The request {@link GetCockpitMetricsRequest}
77
+ * @returns A Promise of CockpitMetrics
78
+ */
79
+ this.getCockpitMetrics = function (request) {
80
+ if (request === void 0) {
81
+ request = {};
82
+ }
83
+ return _this.client.fetch({
84
+ method: 'GET',
85
+ path: `/cockpit/v1beta1/cockpit/metrics`,
86
+ urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['project_id', request.projectId ?? _this.client.settings.defaultProjectId], ['start_date', request.startDate])
87
+ }, unmarshalCockpitMetrics);
88
+ };
89
+ /**
90
+ * Deactivate a Cockpit. Deactivate the Cockpit of the specified Project ID.
73
91
  *
74
92
  * @param request - The request {@link DeactivateCockpitRequest}
75
93
  * @returns A Promise of Cockpit
@@ -86,8 +104,8 @@ class API extends API$1 {
86
104
  }, unmarshalCockpit);
87
105
  };
88
106
  /**
89
- * Reset Grafana. Reset the Grafana of your cockpit associated with the given
90
- * project ID.
107
+ * Reset a Grafana. Reset your Cockpit's Grafana associated with the specified
108
+ * Project ID.
91
109
  *
92
110
  * @param request - The request {@link ResetCockpitGrafanaRequest}
93
111
  * @returns A Promise of Cockpit
@@ -104,7 +122,7 @@ class API extends API$1 {
104
122
  }, unmarshalCockpit);
105
123
  };
106
124
  /**
107
- * Create a token. Create a token associated with the given project ID.
125
+ * Create a token. Create a token associated with the specified Project ID.
108
126
  *
109
127
  * @param request - The request {@link CreateTokenRequest}
110
128
  * @returns A Promise of Token
@@ -131,7 +149,7 @@ class API extends API$1 {
131
149
  }, unmarshalListTokensResponse);
132
150
  };
133
151
  /**
134
- * List tokens. List tokens associated with the given project ID.
152
+ * List tokens. Get a list of tokens associated with the specified Project ID.
135
153
  *
136
154
  * @param request - The request {@link ListTokensRequest}
137
155
  * @returns A Promise of ListTokensResponse
@@ -143,7 +161,7 @@ class API extends API$1 {
143
161
  return enrichForPagination('tokens', _this.pageOfListTokens, request);
144
162
  };
145
163
  /**
146
- * Get token. Get the token associated with the given ID.
164
+ * Get a token. Retrieve the token associated with the specified token ID.
147
165
  *
148
166
  * @param request - The request {@link GetTokenRequest}
149
167
  * @returns A Promise of Token
@@ -153,7 +171,7 @@ class API extends API$1 {
153
171
  path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`
154
172
  }, unmarshalToken);
155
173
  /**
156
- * Delete token. Delete the token associated with the given ID.
174
+ * Delete a token. Delete the token associated with the specified token ID.
157
175
  *
158
176
  * @param request - The request {@link DeleteTokenRequest}
159
177
  */
@@ -162,7 +180,7 @@ class API extends API$1 {
162
180
  path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`
163
181
  });
164
182
  /**
165
- * Create an alert contact point. Create an alert contact point for the
183
+ * Create a contact point. Create a contact point to receive alerts for the
166
184
  * default receiver.
167
185
  *
168
186
  * @param request - The request {@link CreateContactPointRequest}
@@ -190,8 +208,8 @@ class API extends API$1 {
190
208
  }, unmarshalListContactPointsResponse);
191
209
  };
192
210
  /**
193
- * List alert contact points. List alert contact points associated with the
194
- * given cockpit ID.
211
+ * List contact points. Get a list of contact points for the Cockpit
212
+ * associated with the specified Project ID.
195
213
  *
196
214
  * @param request - The request {@link ListContactPointsRequest}
197
215
  * @returns A Promise of ListContactPointsResponse
@@ -203,8 +221,8 @@ class API extends API$1 {
203
221
  return enrichForPagination('contactPoints', _this.pageOfListContactPoints, request);
204
222
  };
205
223
  /**
206
- * Delete an alert contact point. Delete an alert contact point for the
207
- * default receiver.
224
+ * Delete an alert contact point. Delete a contact point for the default
225
+ * receiver.
208
226
  *
209
227
  * @param request - The request {@link DeleteContactPointRequest}
210
228
  */
@@ -220,7 +238,8 @@ class API extends API$1 {
220
238
  });
221
239
  };
222
240
  /**
223
- * Enable managed alerts.
241
+ * Enable managed alerts. Enable the sending of managed alerts for the
242
+ * specified Project's Cockpit.
224
243
  *
225
244
  * @param request - The request {@link EnableManagedAlertsRequest}
226
245
  */
@@ -236,7 +255,8 @@ class API extends API$1 {
236
255
  });
237
256
  };
238
257
  /**
239
- * Disable managed alerts.
258
+ * Disable managed alerts. Disable the sending of managed alerts for the
259
+ * specified Project's Cockpit.
240
260
  *
241
261
  * @param request - The request {@link DisableManagedAlertsRequest}
242
262
  */
@@ -252,7 +272,8 @@ class API extends API$1 {
252
272
  });
253
273
  };
254
274
  /**
255
- * Trigger a test alert. Trigger a test alert to all receivers.
275
+ * Trigger a test alert. Trigger a test alert to all of the Cockpit's
276
+ * receivers.
256
277
  *
257
278
  * @param request - The request {@link TriggerTestAlertRequest}
258
279
  */
@@ -268,7 +289,9 @@ class API extends API$1 {
268
289
  });
269
290
  };
270
291
  /**
271
- * Create a grafana user. Create a grafana user for your grafana instance.
292
+ * Create a Grafana user. Create a Grafana user for your Cockpit's Grafana
293
+ * instance. Make sure you save the automatically-generated password and the
294
+ * Grafana user ID.
272
295
  *
273
296
  * @param request - The request {@link CreateGrafanaUserRequest}
274
297
  * @returns A Promise of GrafanaUser
@@ -290,8 +313,8 @@ class API extends API$1 {
290
313
  }, unmarshalListGrafanaUsersResponse);
291
314
  };
292
315
  /**
293
- * List grafana users. List grafana users who are able to connect to your
294
- * grafana instance.
316
+ * List Grafana users. Get a list of Grafana users who are able to connect to
317
+ * the Cockpit's Grafana instance.
295
318
  *
296
319
  * @param request - The request {@link ListGrafanaUsersRequest}
297
320
  * @returns A Promise of ListGrafanaUsersResponse
@@ -303,7 +326,8 @@ class API extends API$1 {
303
326
  return enrichForPagination('grafanaUsers', _this.pageOfListGrafanaUsers, request);
304
327
  };
305
328
  /**
306
- * Delete a grafana user. Delete a grafana user from your grafana instance.
329
+ * Delete a Grafana user. Delete a Grafana user from a Grafana instance,
330
+ * specified by the Cockpit's Project ID and the Grafana user ID.
307
331
  *
308
332
  * @param request - The request {@link DeleteGrafanaUserRequest}
309
333
  */
@@ -314,8 +338,8 @@ class API extends API$1 {
314
338
  path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/delete`
315
339
  });
316
340
  /**
317
- * Reset Grafana user password. Reset the Grafana user password from your
318
- * grafana instance.
341
+ * Reset a Grafana user's password. Reset a Grafana user's password specified
342
+ * by the Cockpit's Project ID and the Grafana user ID.
319
343
  *
320
344
  * @param request - The request {@link ResetGrafanaUserPasswordRequest}
321
345
  * @returns A Promise of GrafanaUser
@@ -326,6 +350,42 @@ class API extends API$1 {
326
350
  method: 'POST',
327
351
  path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/reset-password`
328
352
  }, unmarshalGrafanaUser);
353
+ this.pageOfListPlans = function (request) {
354
+ if (request === void 0) {
355
+ request = {};
356
+ }
357
+ return _this.client.fetch({
358
+ method: 'GET',
359
+ path: `/cockpit/v1beta1/plans`,
360
+ urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize])
361
+ }, unmarshalListPlansResponse);
362
+ };
363
+ /**
364
+ * List pricing plans. Get a list of all pricing plans available.
365
+ *
366
+ * @param request - The request {@link ListPlansRequest}
367
+ * @returns A Promise of ListPlansResponse
368
+ */
369
+ this.listPlans = function (request) {
370
+ if (request === void 0) {
371
+ request = {};
372
+ }
373
+ return enrichForPagination('plans', _this.pageOfListPlans, request);
374
+ };
375
+ /**
376
+ * Select pricing plan. Select your chosen pricing plan for your Cockpit,
377
+ * specifying the Cockpit's Project ID and the pricing plan's ID in the
378
+ * request.
379
+ *
380
+ * @param request - The request {@link SelectPlanRequest}
381
+ * @returns A Promise of SelectPlanResponse
382
+ */
383
+ this.selectPlan = request => this.client.fetch({
384
+ body: JSON.stringify(marshalSelectPlanRequest(request, this.client.settings)),
385
+ headers: jsonContentHeaders,
386
+ method: 'POST',
387
+ path: `/cockpit/v1beta1/select-plan`
388
+ }, unmarshalSelectPlanResponse);
329
389
  }
330
390
  }
331
391
 
@@ -1,5 +1,6 @@
1
1
  import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
+ import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
3
4
  import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
4
5
 
5
6
  // This file was automatically generated. DO NOT EDIT.
@@ -55,6 +56,20 @@ const unmarshalGrafanaUser = data => {
55
56
  role: data.role
56
57
  };
57
58
  };
59
+ const unmarshalPlan = data => {
60
+ if (!isJSONObject(data)) {
61
+ throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
62
+ }
63
+ return {
64
+ id: data.id,
65
+ logsIngestionPrice: data.logs_ingestion_price,
66
+ name: data.name,
67
+ retentionLogsInterval: data.retention_logs_interval,
68
+ retentionMetricsInterval: data.retention_metrics_interval,
69
+ retentionPrice: data.retention_price,
70
+ sampleIngestionPrice: data.sample_ingestion_price
71
+ };
72
+ };
58
73
  const unmarshalToken = data => {
59
74
  if (!isJSONObject(data)) {
60
75
  throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
@@ -77,11 +92,20 @@ const unmarshalCockpit = data => {
77
92
  createdAt: unmarshalDate(data.created_at),
78
93
  endpoints: data.endpoints ? unmarshalCockpitEndpoints(data.endpoints) : undefined,
79
94
  managedAlertsEnabled: data.managed_alerts_enabled,
95
+ plan: data.plan ? unmarshalPlan(data.plan) : undefined,
80
96
  projectId: data.project_id,
81
97
  status: data.status,
82
98
  updatedAt: unmarshalDate(data.updated_at)
83
99
  };
84
100
  };
101
+ const unmarshalCockpitMetrics = data => {
102
+ if (!isJSONObject(data)) {
103
+ throw new TypeError(`Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`);
104
+ }
105
+ return {
106
+ timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
107
+ };
108
+ };
85
109
  const unmarshalListContactPointsResponse = data => {
86
110
  if (!isJSONObject(data)) {
87
111
  throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
@@ -102,6 +126,15 @@ const unmarshalListGrafanaUsersResponse = data => {
102
126
  totalCount: data.total_count
103
127
  };
104
128
  };
129
+ const unmarshalListPlansResponse = data => {
130
+ if (!isJSONObject(data)) {
131
+ throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);
132
+ }
133
+ return {
134
+ plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
135
+ totalCount: data.total_count
136
+ };
137
+ };
105
138
  const unmarshalListTokensResponse = data => {
106
139
  if (!isJSONObject(data)) {
107
140
  throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
@@ -111,6 +144,12 @@ const unmarshalListTokensResponse = data => {
111
144
  totalCount: data.total_count
112
145
  };
113
146
  };
147
+ const unmarshalSelectPlanResponse = data => {
148
+ if (!isJSONObject(data)) {
149
+ throw new TypeError(`Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.`);
150
+ }
151
+ return {};
152
+ };
114
153
  const marshalContactPointEmail = (request, defaults) => ({
115
154
  to: request.to
116
155
  });
@@ -168,8 +207,12 @@ const marshalResetCockpitGrafanaRequest = (request, defaults) => ({
168
207
  const marshalResetGrafanaUserPasswordRequest = (request, defaults) => ({
169
208
  project_id: request.projectId ?? defaults.defaultProjectId
170
209
  });
210
+ const marshalSelectPlanRequest = (request, defaults) => ({
211
+ plan_id: request.planId,
212
+ project_id: request.projectId ?? defaults.defaultProjectId
213
+ });
171
214
  const marshalTriggerTestAlertRequest = (request, defaults) => ({
172
215
  project_id: request.projectId ?? defaults.defaultProjectId
173
216
  });
174
217
 
175
- export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalContactPoint, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListGrafanaUsersResponse, unmarshalListTokensResponse, unmarshalToken };
218
+ export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
@@ -31,7 +31,7 @@ class API extends API$1 {
31
31
  }, unmarshalListNamespacesResponse);
32
32
  };
33
33
  /**
34
- * List all your namespaces.
34
+ * List all your namespaces. List all namespaces in a specified region.
35
35
  *
36
36
  * @param request - The request {@link ListNamespacesRequest}
37
37
  * @returns A Promise of ListNamespacesResponse
@@ -43,7 +43,7 @@ class API extends API$1 {
43
43
  return enrichForPagination('namespaces', _this.pageOfListNamespaces, request);
44
44
  };
45
45
  /**
46
- * Get a namespace. Get the namespace associated with the given id.
46
+ * Get a namespace. Get the namespace associated with the specified ID.
47
47
  *
48
48
  * @param request - The request {@link GetNamespaceRequest}
49
49
  * @returns A Promise of Namespace
@@ -59,9 +59,9 @@ class API extends API$1 {
59
59
  * @param options - The waiting options
60
60
  * @returns A Promise of Namespace
61
61
  */
62
- this.waitForNamespace = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
62
+ this.waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
63
63
  /**
64
- * Create a new namespace.
64
+ * Create a new namespace. Create a new namespace in a specified region.
65
65
  *
66
66
  * @param request - The request {@link CreateNamespaceRequest}
67
67
  * @returns A Promise of Namespace
@@ -78,8 +78,8 @@ class API extends API$1 {
78
78
  }, unmarshalNamespace);
79
79
  };
80
80
  /**
81
- * Update an existing namespace. Update the space associated with the given
82
- * id.
81
+ * Update an existing namespace. Update the space associated with the
82
+ * specified ID.
83
83
  *
84
84
  * @param request - The request {@link UpdateNamespaceRequest}
85
85
  * @returns A Promise of Namespace
@@ -92,7 +92,7 @@ class API extends API$1 {
92
92
  }, unmarshalNamespace);
93
93
  /**
94
94
  * Delete an existing namespace. Delete the namespace associated with the
95
- * given id.
95
+ * specified ID.
96
96
  *
97
97
  * @param request - The request {@link DeleteNamespaceRequest}
98
98
  * @returns A Promise of Namespace
@@ -107,14 +107,14 @@ class API extends API$1 {
107
107
  urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])
108
108
  }, unmarshalListContainersResponse);
109
109
  /**
110
- * List all your containers.
110
+ * List all your containers. List all containers for a specified region.
111
111
  *
112
112
  * @param request - The request {@link ListContainersRequest}
113
113
  * @returns A Promise of ListContainersResponse
114
114
  */
115
115
  this.listContainers = request => enrichForPagination('containers', this.pageOfListContainers, request);
116
116
  /**
117
- * Get a container. Get the container associated with the given id.
117
+ * Get a container. Get the container associated with the specified ID.
118
118
  *
119
119
  * @param request - The request {@link GetContainerRequest}
120
120
  * @returns A Promise of Container
@@ -130,9 +130,9 @@ class API extends API$1 {
130
130
  * @param options - The waiting options
131
131
  * @returns A Promise of Container
132
132
  */
133
- this.waitForContainer = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
133
+ this.waitForContainer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
134
134
  /**
135
- * Create a new container.
135
+ * Create a new container. Create a new container in the specified region.
136
136
  *
137
137
  * @param request - The request {@link CreateContainerRequest}
138
138
  * @returns A Promise of Container
@@ -145,7 +145,7 @@ class API extends API$1 {
145
145
  }, unmarshalContainer);
146
146
  /**
147
147
  * Update an existing container. Update the container associated with the
148
- * given id.
148
+ * specified ID.
149
149
  *
150
150
  * @param request - The request {@link UpdateContainerRequest}
151
151
  * @returns A Promise of Container
@@ -157,7 +157,7 @@ class API extends API$1 {
157
157
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
158
158
  }, unmarshalContainer);
159
159
  /**
160
- * Delete a container. Delete the container associated with the given id.
160
+ * Delete a container. Delete the container associated with the specified ID.
161
161
  *
162
162
  * @param request - The request {@link DeleteContainerRequest}
163
163
  * @returns A Promise of Container
@@ -167,7 +167,7 @@ class API extends API$1 {
167
167
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`
168
168
  }, unmarshalContainer);
169
169
  /**
170
- * Deploy a container. Deploy a container associated with the given id.
170
+ * Deploy a container. Deploy a container associated with the specified ID.
171
171
  *
172
172
  * @param request - The request {@link DeployContainerRequest}
173
173
  * @returns A Promise of Container
@@ -191,7 +191,7 @@ class API extends API$1 {
191
191
  */
192
192
  this.listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request);
193
193
  /**
194
- * Get a cron. Get the cron associated with the given id.
194
+ * Get a cron. Get the cron associated with the specified ID.
195
195
  *
196
196
  * @param request - The request {@link GetCronRequest}
197
197
  * @returns A Promise of Cron
@@ -207,7 +207,7 @@ class API extends API$1 {
207
207
  * @param options - The waiting options
208
208
  * @returns A Promise of Cron
209
209
  */
210
- this.waitForCron = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
210
+ this.waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
211
211
  /**
212
212
  * Create a new cron.
213
213
  *
@@ -221,7 +221,7 @@ class API extends API$1 {
221
221
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`
222
222
  }, unmarshalCron);
223
223
  /**
224
- * Update an existing cron. Update the cron associated with the given id.
224
+ * Update an existing cron. Update the cron associated with the specified ID.
225
225
  *
226
226
  * @param request - The request {@link UpdateCronRequest}
227
227
  * @returns A Promise of Cron
@@ -233,7 +233,7 @@ class API extends API$1 {
233
233
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`
234
234
  }, unmarshalCron);
235
235
  /**
236
- * Delete an existing cron. Delete the cron associated with the given id.
236
+ * Delete an existing cron. Delete the cron associated with the specified ID.
237
237
  *
238
238
  * @param request - The request {@link DeleteCronRequest}
239
239
  * @returns A Promise of Cron
@@ -248,7 +248,8 @@ class API extends API$1 {
248
248
  urlParams: urlParams(['order_by', request.orderBy ?? 'timestamp_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
249
249
  }, unmarshalListLogsResponse);
250
250
  /**
251
- * List your container logs.
251
+ * List your container logs. List the logs of the container with the specified
252
+ * ID.
252
253
  *
253
254
  * @param request - The request {@link ListLogsRequest}
254
255
  * @returns A Promise of ListLogsResponse
@@ -260,14 +261,16 @@ class API extends API$1 {
260
261
  urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
261
262
  }, unmarshalListDomainsResponse);
262
263
  /**
263
- * List all domain name bindings.
264
+ * List all domain name bindings. List all domain name bindings in a specified
265
+ * region.
264
266
  *
265
267
  * @param request - The request {@link ListDomainsRequest}
266
268
  * @returns A Promise of ListDomainsResponse
267
269
  */
268
270
  this.listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request);
269
271
  /**
270
- * Get a domain name binding.
272
+ * Get a domain name binding. Get a domain name binding for the container with
273
+ * the specified ID.
271
274
  *
272
275
  * @param request - The request {@link GetDomainRequest}
273
276
  * @returns A Promise of Domain
@@ -283,9 +286,10 @@ class API extends API$1 {
283
286
  * @param options - The waiting options
284
287
  * @returns A Promise of Domain
285
288
  */
286
- this.waitForDomain = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
289
+ this.waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
287
290
  /**
288
- * Create a domain name binding.
291
+ * Create a domain name binding. Create a domain name binding for the
292
+ * container with the specified ID.
289
293
  *
290
294
  * @param request - The request {@link CreateDomainRequest}
291
295
  * @returns A Promise of Domain
@@ -297,7 +301,8 @@ class API extends API$1 {
297
301
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`
298
302
  }, unmarshalDomain);
299
303
  /**
300
- * Delete a domain name binding.
304
+ * Delete a domain name binding. Delete the domain name binding with the
305
+ * specific ID.
301
306
  *
302
307
  * @param request - The request {@link DeleteDomainRequest}
303
308
  * @returns A Promise of Domain
@@ -345,7 +350,7 @@ class API extends API$1 {
345
350
  }, unmarshalToken);
346
351
  };
347
352
  /**
348
- * Get a token.
353
+ * Get a token. Get a token with a specified ID.
349
354
  *
350
355
  * @param request - The request {@link GetTokenRequest}
351
356
  * @returns A Promise of Token
@@ -361,7 +366,7 @@ class API extends API$1 {
361
366
  * @param options - The waiting options
362
367
  * @returns A Promise of Token
363
368
  */
364
- this.waitForToken = (request, options) => waitForResource((options == null ? void 0 : options.stop) ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
369
+ this.waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
365
370
  this.pageOfListTokens = function (request) {
366
371
  if (request === void 0) {
367
372
  request = {};
@@ -373,7 +378,8 @@ class API extends API$1 {
373
378
  }, unmarshalListTokensResponse);
374
379
  };
375
380
  /**
376
- * List all tokens.
381
+ * List all tokens. List all tokens belonging to a specified Organization or
382
+ * Project.
377
383
  *
378
384
  * @param request - The request {@link ListTokensRequest}
379
385
  * @returns A Promise of ListTokensResponse
@@ -385,7 +391,7 @@ class API extends API$1 {
385
391
  return enrichForPagination('tokens', _this.pageOfListTokens, request);
386
392
  };
387
393
  /**
388
- * Delete a token.
394
+ * Delete a token. Delete a token with a specified ID.
389
395
  *
390
396
  * @param request - The request {@link DeleteTokenRequest}
391
397
  * @returns A Promise of Token
@@ -395,8 +401,8 @@ class API extends API$1 {
395
401
  path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`
396
402
  }, unmarshalToken);
397
403
  }
404
+ /** Lists the available regions of the API. */
398
405
  }
399
- /** Lists the available regions of the API. */
400
406
  API.LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
401
407
 
402
408
  export { API };
@@ -179,7 +179,7 @@ const marshalCreateContainerRequest = (request, defaults) => ({
179
179
  max_scale: request.maxScale,
180
180
  memory_limit: request.memoryLimit,
181
181
  min_scale: request.minScale,
182
- name: request.name || randomName('ctnr'),
182
+ name: request.name,
183
183
  namespace_id: request.namespaceId,
184
184
  port: request.port,
185
185
  privacy: request.privacy ?? 'unknown_privacy',