@scaleway/sdk 2.0.0-alpha.7 → 2.0.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 (78) hide show
  1. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +12 -12
  2. package/dist/api/baremetal/v1/marshalling.gen.js +63 -52
  3. package/dist/api/billing/v2alpha1/api.gen.js +32 -1
  4. package/dist/api/billing/v2alpha1/marshalling.gen.js +46 -1
  5. package/dist/api/block/v1alpha1/api.gen.js +23 -19
  6. package/dist/api/block/v1alpha1/marshalling.gen.js +47 -40
  7. package/dist/api/block/v1alpha1/validation-rules.gen.js +11 -1
  8. package/dist/api/cockpit/v1beta1/api.gen.js +143 -48
  9. package/dist/api/cockpit/v1beta1/marshalling.gen.js +89 -36
  10. package/dist/api/container/v1beta1/index.gen.js +2 -0
  11. package/dist/api/container/v1beta1/marshalling.gen.js +63 -35
  12. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  13. package/dist/api/document_db/v1beta1/marshalling.gen.js +117 -61
  14. package/dist/api/domain/v2beta1/api.gen.js +29 -37
  15. package/dist/api/domain/v2beta1/index.gen.js +0 -2
  16. package/dist/api/domain/v2beta1/marshalling.gen.js +408 -194
  17. package/dist/api/flexibleip/v1alpha1/api.gen.js +6 -14
  18. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
  19. package/dist/api/function/v1beta1/api.gen.js +36 -0
  20. package/dist/api/function/v1beta1/index.gen.js +2 -0
  21. package/dist/api/function/v1beta1/marshalling.gen.js +64 -36
  22. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  23. package/dist/api/iam/v1alpha1/api.gen.js +54 -44
  24. package/dist/api/iam/v1alpha1/marshalling.gen.js +69 -34
  25. package/dist/api/iam/v1alpha1/validation-rules.gen.js +10 -1
  26. package/dist/api/instance/v1/api.gen.js +1 -1
  27. package/dist/api/instance/v1/content.gen.js +4 -1
  28. package/dist/api/instance/v1/index.js +1 -1
  29. package/dist/api/instance/v1/marshalling.gen.js +414 -205
  30. package/dist/api/iot/v1/api.gen.js +24 -32
  31. package/dist/api/iot/v1/marshalling.gen.js +87 -36
  32. package/dist/api/ipam/index.js +2 -0
  33. package/dist/api/ipam/v1/api.gen.js +113 -0
  34. package/dist/api/ipam/v1/index.gen.js +6 -0
  35. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  36. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  37. package/dist/api/ipfs/v1alpha1/api.gen.js +120 -3
  38. package/dist/api/ipfs/v1alpha1/content.gen.js +4 -1
  39. package/dist/api/ipfs/v1alpha1/index.gen.js +2 -2
  40. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +71 -19
  41. package/dist/api/jobs/index.js +2 -0
  42. package/dist/api/jobs/v1alpha1/api.gen.js +111 -0
  43. package/dist/api/jobs/v1alpha1/content.gen.js +7 -0
  44. package/dist/api/jobs/v1alpha1/index.gen.js +7 -0
  45. package/dist/api/jobs/v1alpha1/marshalling.gen.js +84 -0
  46. package/dist/api/jobs/v1alpha1/validation-rules.gen.js +45 -0
  47. package/dist/api/k8s/v1/marshalling.gen.js +128 -40
  48. package/dist/api/lb/v1/api.gen.js +1 -1
  49. package/dist/api/lb/v1/marshalling.gen.js +268 -152
  50. package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
  51. package/dist/api/marketplace/v2/api.gen.js +3 -3
  52. package/dist/api/mnq/index.js +2 -0
  53. package/dist/api/mnq/v1alpha1/api.gen.js +12 -20
  54. package/dist/api/mnq/v1alpha1/marshalling.gen.js +19 -14
  55. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  56. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  57. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  58. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  59. package/dist/api/rdb/v1/marshalling.gen.js +131 -66
  60. package/dist/api/redis/v1/marshalling.gen.js +51 -27
  61. package/dist/api/registry/v1/marshalling.gen.js +6 -4
  62. package/dist/api/secret/v1alpha1/api.gen.js +2 -2
  63. package/dist/api/secret/v1alpha1/marshalling.gen.js +17 -5
  64. package/dist/api/std/index.gen.js +1 -0
  65. package/dist/api/tem/v1alpha1/api.gen.js +8 -2
  66. package/dist/api/tem/v1alpha1/marshalling.gen.js +35 -13
  67. package/dist/api/test/v1/marshalling.gen.js +5 -3
  68. package/dist/api/vpc/v2/marshalling.gen.js +2 -0
  69. package/dist/api/vpcgw/v1/marshalling.gen.js +53 -24
  70. package/dist/api/webhosting/v1alpha1/api.gen.js +2 -54
  71. package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
  72. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +14 -41
  73. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +1 -10
  74. package/dist/index.cjs +4351 -1833
  75. package/dist/index.d.ts +6778 -2542
  76. package/dist/index.js +34 -28
  77. package/dist/scw/constants.js +1 -1
  78. package/package.json +2 -2
@@ -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, unmarshalCockpitMetrics, marshalDeactivateCockpitRequest, marshalResetCockpitGrafanaRequest, marshalCreateDatasourceRequest, unmarshalDatasource, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalSelectPlanResponse } from './marshalling.gen.js';
6
+ import { marshalActivateCockpitRequest, unmarshalCockpit, unmarshalCockpitMetrics, marshalDeactivateCockpitRequest, marshalResetCockpitGrafanaRequest, marshalCreateDatasourceRequest, unmarshalDatasource, unmarshalListDatasourcesResponse, marshalCreateTokenRequest, unmarshalToken, unmarshalListTokensResponse, marshalCreateContactPointRequest, unmarshalContactPoint, unmarshalListContactPointsResponse, marshalDeleteContactPointRequest, marshalEnableManagedAlertsRequest, marshalDisableManagedAlertsRequest, marshalTriggerTestAlertRequest, marshalCreateGrafanaUserRequest, unmarshalGrafanaUser, unmarshalListGrafanaUsersResponse, marshalDeleteGrafanaUserRequest, marshalResetGrafanaUserPasswordRequest, unmarshalListPlansResponse, marshalSelectPlanRequest, unmarshalSelectPlanResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalGrafanaProductDashboard } 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.
@@ -151,6 +151,35 @@ class API extends API$1 {
151
151
  method: 'POST',
152
152
  path: `/cockpit/v1beta1/datasources`
153
153
  }, unmarshalDatasource);
154
+ pageOfListDatasources = (() => {
155
+ var _this7 = this;
156
+ return function (request) {
157
+ if (request === void 0) {
158
+ request = {};
159
+ }
160
+ return _this7.client.fetch({
161
+ method: 'GET',
162
+ path: `/cockpit/v1beta1/datasources`,
163
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this7.client.settings.defaultProjectId], ['types', request.types])
164
+ }, unmarshalListDatasourcesResponse);
165
+ };
166
+ })();
167
+
168
+ /**
169
+ * Get a list of datasources for the specified Project ID.
170
+ *
171
+ * @param request - The request {@link ListDatasourcesRequest}
172
+ * @returns A Promise of ListDatasourcesResponse
173
+ */
174
+ listDatasources = (() => {
175
+ var _this8 = this;
176
+ return function (request) {
177
+ if (request === void 0) {
178
+ request = {};
179
+ }
180
+ return enrichForPagination('datasources', _this8.pageOfListDatasources, request);
181
+ };
182
+ })();
154
183
 
155
184
  /**
156
185
  * Create a token associated with the specified Project ID.
@@ -158,22 +187,30 @@ class API extends API$1 {
158
187
  * @param request - The request {@link CreateTokenRequest}
159
188
  * @returns A Promise of Token
160
189
  */
161
- createToken = request => this.client.fetch({
162
- body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)),
163
- headers: jsonContentHeaders,
164
- method: 'POST',
165
- path: `/cockpit/v1beta1/tokens`
166
- }, unmarshalToken);
190
+ createToken = (() => {
191
+ var _this9 = this;
192
+ return function (request) {
193
+ if (request === void 0) {
194
+ request = {};
195
+ }
196
+ return _this9.client.fetch({
197
+ body: JSON.stringify(marshalCreateTokenRequest(request, _this9.client.settings)),
198
+ headers: jsonContentHeaders,
199
+ method: 'POST',
200
+ path: `/cockpit/v1beta1/tokens`
201
+ }, unmarshalToken);
202
+ };
203
+ })();
167
204
  pageOfListTokens = (() => {
168
- var _this7 = this;
205
+ var _this10 = this;
169
206
  return function (request) {
170
207
  if (request === void 0) {
171
208
  request = {};
172
209
  }
173
- return _this7.client.fetch({
210
+ return _this10.client.fetch({
174
211
  method: 'GET',
175
212
  path: `/cockpit/v1beta1/tokens`,
176
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this7.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this7.client.settings.defaultProjectId])
213
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this10.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this10.client.settings.defaultProjectId])
177
214
  }, unmarshalListTokensResponse);
178
215
  };
179
216
  })();
@@ -185,12 +222,12 @@ class API extends API$1 {
185
222
  * @returns A Promise of ListTokensResponse
186
223
  */
187
224
  listTokens = (() => {
188
- var _this8 = this;
225
+ var _this11 = this;
189
226
  return function (request) {
190
227
  if (request === void 0) {
191
228
  request = {};
192
229
  }
193
- return enrichForPagination('tokens', _this8.pageOfListTokens, request);
230
+ return enrichForPagination('tokens', _this11.pageOfListTokens, request);
194
231
  };
195
232
  })();
196
233
 
@@ -221,22 +258,30 @@ class API extends API$1 {
221
258
  * @param request - The request {@link CreateContactPointRequest}
222
259
  * @returns A Promise of ContactPoint
223
260
  */
224
- createContactPoint = request => this.client.fetch({
225
- body: JSON.stringify(marshalCreateContactPointRequest(request, this.client.settings)),
226
- headers: jsonContentHeaders,
227
- method: 'POST',
228
- path: `/cockpit/v1beta1/contact-points`
229
- }, unmarshalContactPoint);
261
+ createContactPoint = (() => {
262
+ var _this12 = this;
263
+ return function (request) {
264
+ if (request === void 0) {
265
+ request = {};
266
+ }
267
+ return _this12.client.fetch({
268
+ body: JSON.stringify(marshalCreateContactPointRequest(request, _this12.client.settings)),
269
+ headers: jsonContentHeaders,
270
+ method: 'POST',
271
+ path: `/cockpit/v1beta1/contact-points`
272
+ }, unmarshalContactPoint);
273
+ };
274
+ })();
230
275
  pageOfListContactPoints = (() => {
231
- var _this9 = this;
276
+ var _this13 = this;
232
277
  return function (request) {
233
278
  if (request === void 0) {
234
279
  request = {};
235
280
  }
236
- return _this9.client.fetch({
281
+ return _this13.client.fetch({
237
282
  method: 'GET',
238
283
  path: `/cockpit/v1beta1/contact-points`,
239
- urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this9.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this9.client.settings.defaultProjectId])
284
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this13.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this13.client.settings.defaultProjectId])
240
285
  }, unmarshalListContactPointsResponse);
241
286
  };
242
287
  })();
@@ -249,12 +294,12 @@ class API extends API$1 {
249
294
  * @returns A Promise of ListContactPointsResponse
250
295
  */
251
296
  listContactPoints = (() => {
252
- var _this10 = this;
297
+ var _this14 = this;
253
298
  return function (request) {
254
299
  if (request === void 0) {
255
300
  request = {};
256
301
  }
257
- return enrichForPagination('contactPoints', _this10.pageOfListContactPoints, request);
302
+ return enrichForPagination('contactPoints', _this14.pageOfListContactPoints, request);
258
303
  };
259
304
  })();
260
305
 
@@ -263,12 +308,20 @@ class API extends API$1 {
263
308
  *
264
309
  * @param request - The request {@link DeleteContactPointRequest}
265
310
  */
266
- deleteContactPoint = request => this.client.fetch({
267
- body: JSON.stringify(marshalDeleteContactPointRequest(request, this.client.settings)),
268
- headers: jsonContentHeaders,
269
- method: 'POST',
270
- path: `/cockpit/v1beta1/delete-contact-point`
271
- });
311
+ deleteContactPoint = (() => {
312
+ var _this15 = this;
313
+ return function (request) {
314
+ if (request === void 0) {
315
+ request = {};
316
+ }
317
+ return _this15.client.fetch({
318
+ body: JSON.stringify(marshalDeleteContactPointRequest(request, _this15.client.settings)),
319
+ headers: jsonContentHeaders,
320
+ method: 'POST',
321
+ path: `/cockpit/v1beta1/delete-contact-point`
322
+ });
323
+ };
324
+ })();
272
325
 
273
326
  /**
274
327
  * Enable the sending of managed alerts for the specified Project's Cockpit.
@@ -276,13 +329,13 @@ class API extends API$1 {
276
329
  * @param request - The request {@link EnableManagedAlertsRequest}
277
330
  */
278
331
  enableManagedAlerts = (() => {
279
- var _this11 = this;
332
+ var _this16 = this;
280
333
  return function (request) {
281
334
  if (request === void 0) {
282
335
  request = {};
283
336
  }
284
- return _this11.client.fetch({
285
- body: JSON.stringify(marshalEnableManagedAlertsRequest(request, _this11.client.settings)),
337
+ return _this16.client.fetch({
338
+ body: JSON.stringify(marshalEnableManagedAlertsRequest(request, _this16.client.settings)),
286
339
  headers: jsonContentHeaders,
287
340
  method: 'POST',
288
341
  path: `/cockpit/v1beta1/enable-managed-alerts`
@@ -296,13 +349,13 @@ class API extends API$1 {
296
349
  * @param request - The request {@link DisableManagedAlertsRequest}
297
350
  */
298
351
  disableManagedAlerts = (() => {
299
- var _this12 = this;
352
+ var _this17 = this;
300
353
  return function (request) {
301
354
  if (request === void 0) {
302
355
  request = {};
303
356
  }
304
- return _this12.client.fetch({
305
- body: JSON.stringify(marshalDisableManagedAlertsRequest(request, _this12.client.settings)),
357
+ return _this17.client.fetch({
358
+ body: JSON.stringify(marshalDisableManagedAlertsRequest(request, _this17.client.settings)),
306
359
  headers: jsonContentHeaders,
307
360
  method: 'POST',
308
361
  path: `/cockpit/v1beta1/disable-managed-alerts`
@@ -316,13 +369,13 @@ class API extends API$1 {
316
369
  * @param request - The request {@link TriggerTestAlertRequest}
317
370
  */
318
371
  triggerTestAlert = (() => {
319
- var _this13 = this;
372
+ var _this18 = this;
320
373
  return function (request) {
321
374
  if (request === void 0) {
322
375
  request = {};
323
376
  }
324
- return _this13.client.fetch({
325
- body: JSON.stringify(marshalTriggerTestAlertRequest(request, _this13.client.settings)),
377
+ return _this18.client.fetch({
378
+ body: JSON.stringify(marshalTriggerTestAlertRequest(request, _this18.client.settings)),
326
379
  headers: jsonContentHeaders,
327
380
  method: 'POST',
328
381
  path: `/cockpit/v1beta1/trigger-test-alert`
@@ -344,15 +397,15 @@ class API extends API$1 {
344
397
  path: `/cockpit/v1beta1/grafana-users`
345
398
  }, unmarshalGrafanaUser);
346
399
  pageOfListGrafanaUsers = (() => {
347
- var _this14 = this;
400
+ var _this19 = this;
348
401
  return function (request) {
349
402
  if (request === void 0) {
350
403
  request = {};
351
404
  }
352
- return _this14.client.fetch({
405
+ return _this19.client.fetch({
353
406
  method: 'GET',
354
407
  path: `/cockpit/v1beta1/grafana-users`,
355
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this14.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this14.client.settings.defaultProjectId])
408
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this19.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this19.client.settings.defaultProjectId])
356
409
  }, unmarshalListGrafanaUsersResponse);
357
410
  };
358
411
  })();
@@ -365,12 +418,12 @@ class API extends API$1 {
365
418
  * @returns A Promise of ListGrafanaUsersResponse
366
419
  */
367
420
  listGrafanaUsers = (() => {
368
- var _this15 = this;
421
+ var _this20 = this;
369
422
  return function (request) {
370
423
  if (request === void 0) {
371
424
  request = {};
372
425
  }
373
- return enrichForPagination('grafanaUsers', _this15.pageOfListGrafanaUsers, request);
426
+ return enrichForPagination('grafanaUsers', _this20.pageOfListGrafanaUsers, request);
374
427
  };
375
428
  })();
376
429
 
@@ -401,15 +454,15 @@ class API extends API$1 {
401
454
  path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/reset-password`
402
455
  }, unmarshalGrafanaUser);
403
456
  pageOfListPlans = (() => {
404
- var _this16 = this;
457
+ var _this21 = this;
405
458
  return function (request) {
406
459
  if (request === void 0) {
407
460
  request = {};
408
461
  }
409
- return _this16.client.fetch({
462
+ return _this21.client.fetch({
410
463
  method: 'GET',
411
464
  path: `/cockpit/v1beta1/plans`,
412
- urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this16.client.settings.defaultPageSize])
465
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this21.client.settings.defaultPageSize])
413
466
  }, unmarshalListPlansResponse);
414
467
  };
415
468
  })();
@@ -421,12 +474,12 @@ class API extends API$1 {
421
474
  * @returns A Promise of ListPlansResponse
422
475
  */
423
476
  listPlans = (() => {
424
- var _this17 = this;
477
+ var _this22 = this;
425
478
  return function (request) {
426
479
  if (request === void 0) {
427
480
  request = {};
428
481
  }
429
- return enrichForPagination('plans', _this17.pageOfListPlans, request);
482
+ return enrichForPagination('plans', _this22.pageOfListPlans, request);
430
483
  };
431
484
  })();
432
485
 
@@ -443,6 +496,48 @@ class API extends API$1 {
443
496
  method: 'POST',
444
497
  path: `/cockpit/v1beta1/select-plan`
445
498
  }, unmarshalSelectPlanResponse);
499
+ pageOfListGrafanaProductDashboards = (() => {
500
+ var _this23 = this;
501
+ return function (request) {
502
+ if (request === void 0) {
503
+ request = {};
504
+ }
505
+ return _this23.client.fetch({
506
+ method: 'GET',
507
+ path: `/cockpit/v1beta1/grafana-product-dashboards`,
508
+ urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? _this23.client.settings.defaultPageSize], ['project_id', request.projectId ?? _this23.client.settings.defaultProjectId], ['tags', request.tags])
509
+ }, unmarshalListGrafanaProductDashboardsResponse);
510
+ };
511
+ })();
512
+
513
+ /**
514
+ * List product dashboards. Get a list of available product dashboards.
515
+ *
516
+ * @param request - The request {@link ListGrafanaProductDashboardsRequest}
517
+ * @returns A Promise of ListGrafanaProductDashboardsResponse
518
+ */
519
+ listGrafanaProductDashboards = (() => {
520
+ var _this24 = this;
521
+ return function (request) {
522
+ if (request === void 0) {
523
+ request = {};
524
+ }
525
+ return enrichForPagination('dashboards', _this24.pageOfListGrafanaProductDashboards, request);
526
+ };
527
+ })();
528
+
529
+ /**
530
+ * Get a product dashboard. Get a product dashboard specified by the dashboard
531
+ * ID.
532
+ *
533
+ * @param request - The request {@link GetGrafanaProductDashboardRequest}
534
+ * @returns A Promise of GrafanaProductDashboard
535
+ */
536
+ getGrafanaProductDashboard = request => this.client.fetch({
537
+ method: 'GET',
538
+ path: `/cockpit/v1beta1/grafana-product-dashboards/${validatePathParam('dashboardName', request.dashboardName)}`,
539
+ urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])
540
+ }, unmarshalGrafanaProductDashboard);
446
541
  }
447
542
 
448
543
  export { API };
@@ -1,7 +1,7 @@
1
1
  import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
- import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
4
+ import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
7
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -21,6 +21,30 @@ const unmarshalContactPoint = data => {
21
21
  email: data.email ? unmarshalContactPointEmail(data.email) : undefined
22
22
  };
23
23
  };
24
+ const unmarshalDatasource = data => {
25
+ if (!isJSONObject(data)) {
26
+ throw new TypeError(`Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`);
27
+ }
28
+ return {
29
+ id: data.id,
30
+ name: data.name,
31
+ projectId: data.project_id,
32
+ type: data.type,
33
+ url: data.url
34
+ };
35
+ };
36
+ const unmarshalGrafanaProductDashboard = data => {
37
+ if (!isJSONObject(data)) {
38
+ throw new TypeError(`Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`);
39
+ }
40
+ return {
41
+ dashboardName: data.dashboard_name,
42
+ tags: data.tags,
43
+ title: data.title,
44
+ url: data.url,
45
+ variables: data.variables
46
+ };
47
+ };
24
48
  const unmarshalGrafanaUser = data => {
25
49
  if (!isJSONObject(data)) {
26
50
  throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);
@@ -28,7 +52,7 @@ const unmarshalGrafanaUser = data => {
28
52
  return {
29
53
  id: data.id,
30
54
  login: data.login,
31
- password: data.password ? data.password : undefined,
55
+ password: data.password,
32
56
  role: data.role
33
57
  };
34
58
  };
@@ -57,11 +81,23 @@ const unmarshalToken = data => {
57
81
  id: data.id,
58
82
  name: data.name,
59
83
  projectId: data.project_id,
60
- scopes: unmarshalTokenScopes(data.scopes),
61
- secretKey: data.secret_key ? data.secret_key : undefined,
84
+ scopes: data.scopes ? unmarshalTokenScopes(data.scopes) : undefined,
85
+ secretKey: data.secret_key,
62
86
  updatedAt: unmarshalDate(data.updated_at)
63
87
  };
64
88
  };
89
+ const unmarshalCockpitEndpoints = data => {
90
+ if (!isJSONObject(data)) {
91
+ throw new TypeError(`Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`);
92
+ }
93
+ return {
94
+ alertmanagerUrl: data.alertmanager_url,
95
+ grafanaUrl: data.grafana_url,
96
+ logsUrl: data.logs_url,
97
+ metricsUrl: data.metrics_url,
98
+ tracesUrl: data.traces_url
99
+ };
100
+ };
65
101
  const unmarshalPlan = data => {
66
102
  if (!isJSONObject(data)) {
67
103
  throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
@@ -70,21 +106,12 @@ const unmarshalPlan = data => {
70
106
  id: data.id,
71
107
  logsIngestionPrice: data.logs_ingestion_price,
72
108
  name: data.name,
73
- retentionLogsInterval: data.retention_logs_interval ? data.retention_logs_interval : undefined,
74
- retentionMetricsInterval: data.retention_metrics_interval ? data.retention_metrics_interval : undefined,
109
+ retentionLogsInterval: data.retention_logs_interval,
110
+ retentionMetricsInterval: data.retention_metrics_interval,
75
111
  retentionPrice: data.retention_price,
76
- sampleIngestionPrice: data.sample_ingestion_price
77
- };
78
- };
79
- const unmarshalCockpitEndpoints = data => {
80
- if (!isJSONObject(data)) {
81
- throw new TypeError(`Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`);
82
- }
83
- return {
84
- alertmanagerUrl: data.alertmanager_url,
85
- grafanaUrl: data.grafana_url,
86
- logsUrl: data.logs_url,
87
- metricsUrl: data.metrics_url
112
+ retentionTracesInterval: data.retention_traces_interval,
113
+ sampleIngestionPrice: data.sample_ingestion_price,
114
+ tracesIngestionPrice: data.traces_ingestion_price
88
115
  };
89
116
  };
90
117
  const unmarshalCockpit = data => {
@@ -93,9 +120,9 @@ const unmarshalCockpit = data => {
93
120
  }
94
121
  return {
95
122
  createdAt: unmarshalDate(data.created_at),
96
- endpoints: unmarshalCockpitEndpoints(data.endpoints),
123
+ endpoints: data.endpoints ? unmarshalCockpitEndpoints(data.endpoints) : undefined,
97
124
  managedAlertsEnabled: data.managed_alerts_enabled,
98
- plan: unmarshalPlan(data.plan),
125
+ plan: data.plan ? unmarshalPlan(data.plan) : undefined,
99
126
  projectId: data.project_id,
100
127
  status: data.status,
101
128
  updatedAt: unmarshalDate(data.updated_at)
@@ -109,18 +136,6 @@ const unmarshalCockpitMetrics = data => {
109
136
  timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
110
137
  };
111
138
  };
112
- const unmarshalDatasource = data => {
113
- if (!isJSONObject(data)) {
114
- throw new TypeError(`Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`);
115
- }
116
- return {
117
- id: data.id,
118
- name: data.name,
119
- projectId: data.project_id,
120
- type: data.type,
121
- url: data.url
122
- };
123
- };
124
139
  const unmarshalListContactPointsResponse = data => {
125
140
  if (!isJSONObject(data)) {
126
141
  throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
@@ -132,6 +147,24 @@ const unmarshalListContactPointsResponse = data => {
132
147
  totalCount: data.total_count
133
148
  };
134
149
  };
150
+ const unmarshalListDatasourcesResponse = data => {
151
+ if (!isJSONObject(data)) {
152
+ throw new TypeError(`Unmarshalling the type 'ListDatasourcesResponse' failed as data isn't a dictionary.`);
153
+ }
154
+ return {
155
+ datasources: unmarshalArrayOfObject(data.datasources, unmarshalDatasource),
156
+ totalCount: data.total_count
157
+ };
158
+ };
159
+ const unmarshalListGrafanaProductDashboardsResponse = data => {
160
+ if (!isJSONObject(data)) {
161
+ throw new TypeError(`Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`);
162
+ }
163
+ return {
164
+ dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard),
165
+ totalCount: data.total_count
166
+ };
167
+ };
135
168
  const unmarshalListGrafanaUsersResponse = data => {
136
169
  if (!isJSONObject(data)) {
137
170
  throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);
@@ -168,8 +201,17 @@ const unmarshalSelectPlanResponse = data => {
168
201
  const marshalActivateCockpitRequest = (request, defaults) => ({
169
202
  project_id: request.projectId ?? defaults.defaultProjectId
170
203
  });
204
+ const marshalContactPointEmail = (request, defaults) => ({
205
+ to: request.to
206
+ });
207
+ const marshalContactPoint = (request, defaults) => ({
208
+ ...resolveOneOf([{
209
+ param: 'email',
210
+ value: request.email !== undefined ? marshalContactPointEmail(request.email) : undefined
211
+ }])
212
+ });
171
213
  const marshalCreateContactPointRequest = (request, defaults) => ({
172
- contact_point: request.contactPoint,
214
+ contact_point: request.contactPoint !== undefined ? marshalContactPoint(request.contactPoint) : undefined,
173
215
  project_id: request.projectId ?? defaults.defaultProjectId
174
216
  });
175
217
  const marshalCreateDatasourceRequest = (request, defaults) => ({
@@ -182,16 +224,27 @@ const marshalCreateGrafanaUserRequest = (request, defaults) => ({
182
224
  project_id: request.projectId ?? defaults.defaultProjectId,
183
225
  role: request.role
184
226
  });
227
+ const marshalTokenScopes = (request, defaults) => ({
228
+ query_logs: request.queryLogs,
229
+ query_metrics: request.queryMetrics,
230
+ query_traces: request.queryTraces,
231
+ setup_alerts: request.setupAlerts,
232
+ setup_logs_rules: request.setupLogsRules,
233
+ setup_metrics_rules: request.setupMetricsRules,
234
+ write_logs: request.writeLogs,
235
+ write_metrics: request.writeMetrics,
236
+ write_traces: request.writeTraces
237
+ });
185
238
  const marshalCreateTokenRequest = (request, defaults) => ({
186
239
  name: request.name || randomName('token'),
187
240
  project_id: request.projectId ?? defaults.defaultProjectId,
188
- scopes: request.scopes
241
+ scopes: request.scopes !== undefined ? marshalTokenScopes(request.scopes) : undefined
189
242
  });
190
243
  const marshalDeactivateCockpitRequest = (request, defaults) => ({
191
244
  project_id: request.projectId ?? defaults.defaultProjectId
192
245
  });
193
246
  const marshalDeleteContactPointRequest = (request, defaults) => ({
194
- contact_point: request.contactPoint,
247
+ contact_point: request.contactPoint !== undefined ? marshalContactPoint(request.contactPoint) : undefined,
195
248
  project_id: request.projectId ?? defaults.defaultProjectId
196
249
  });
197
250
  const marshalDeleteGrafanaUserRequest = (request, defaults) => ({
@@ -217,4 +270,4 @@ const marshalTriggerTestAlertRequest = (request, defaults) => ({
217
270
  project_id: request.projectId ?? defaults.defaultProjectId
218
271
  });
219
272
 
220
- export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateDatasourceRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDatasource, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
273
+ export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateDatasourceRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDatasource, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListDatasourcesResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
@@ -1,5 +1,7 @@
1
1
  export { API } from './api.gen.js';
2
2
  export { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TOKEN_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from './content.gen.js';
3
+ import * as validationRules_gen from './validation-rules.gen.js';
4
+ export { validationRules_gen as ValidationRules };
3
5
 
4
6
  // This file was automatically generated. DO NOT EDIT.
5
7
  // If you have any remark or suggestion do not hesitate to open an issue.