@scaleway/sdk-cockpit 2.2.1 → 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.
@@ -1,601 +1,378 @@
1
- import { resolveOneOf, isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
- const unmarshalContactPointEmail = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- to: data.to
10
- };
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalContactPointEmail = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`);
4
+ return { to: data.to };
11
5
  };
12
6
  const unmarshalContactPoint = (data) => {
13
- if (!isJSONObject(data)) {
14
- throw new TypeError(
15
- `Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`
16
- );
17
- }
18
- return {
19
- email: data.email ? unmarshalContactPointEmail(data.email) : void 0,
20
- region: data.region,
21
- sendResolvedNotifications: data.send_resolved_notifications
22
- };
7
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`);
8
+ return {
9
+ email: data.email ? unmarshalContactPointEmail(data.email) : void 0,
10
+ region: data.region,
11
+ sendResolvedNotifications: data.send_resolved_notifications
12
+ };
23
13
  };
24
14
  const unmarshalDataSource = (data) => {
25
- if (!isJSONObject(data)) {
26
- throw new TypeError(
27
- `Unmarshalling the type 'DataSource' failed as data isn't a dictionary.`
28
- );
29
- }
30
- return {
31
- createdAt: unmarshalDate(data.created_at),
32
- currentMonthUsage: data.current_month_usage,
33
- id: data.id,
34
- name: data.name,
35
- origin: data.origin,
36
- projectId: data.project_id,
37
- region: data.region,
38
- retentionDays: data.retention_days,
39
- synchronizedWithGrafana: data.synchronized_with_grafana,
40
- type: data.type,
41
- updatedAt: unmarshalDate(data.updated_at),
42
- url: data.url
43
- };
44
- };
45
- const unmarshalExporterDatadogDestination = (data) => {
46
- if (!isJSONObject(data)) {
47
- throw new TypeError(
48
- `Unmarshalling the type 'ExporterDatadogDestination' failed as data isn't a dictionary.`
49
- );
50
- }
51
- return {
52
- apiKey: data.api_key,
53
- endpoint: data.endpoint
54
- };
55
- };
56
- const unmarshalExporterOTLPDestination = (data) => {
57
- if (!isJSONObject(data)) {
58
- throw new TypeError(
59
- `Unmarshalling the type 'ExporterOTLPDestination' failed as data isn't a dictionary.`
60
- );
61
- }
62
- return {
63
- endpoint: data.endpoint,
64
- headers: data.headers
65
- };
15
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DataSource' failed as data isn't a dictionary.`);
16
+ return {
17
+ createdAt: unmarshalDate(data.created_at),
18
+ currentMonthUsage: data.current_month_usage,
19
+ id: data.id,
20
+ name: data.name,
21
+ origin: data.origin,
22
+ projectId: data.project_id,
23
+ region: data.region,
24
+ retentionDays: data.retention_days,
25
+ synchronizedWithGrafana: data.synchronized_with_grafana,
26
+ type: data.type,
27
+ updatedAt: unmarshalDate(data.updated_at),
28
+ url: data.url
29
+ };
30
+ };
31
+ var unmarshalExporterDatadogDestination = (data) => {
32
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ExporterDatadogDestination' failed as data isn't a dictionary.`);
33
+ return {
34
+ apiKey: data.api_key,
35
+ endpoint: data.endpoint
36
+ };
37
+ };
38
+ var unmarshalExporterOTLPDestination = (data) => {
39
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ExporterOTLPDestination' failed as data isn't a dictionary.`);
40
+ return {
41
+ endpoint: data.endpoint,
42
+ headers: data.headers
43
+ };
66
44
  };
67
45
  const unmarshalExporter = (data) => {
68
- if (!isJSONObject(data)) {
69
- throw new TypeError(
70
- `Unmarshalling the type 'Exporter' failed as data isn't a dictionary.`
71
- );
72
- }
73
- return {
74
- createdAt: unmarshalDate(data.created_at),
75
- datadogDestination: data.datadog_destination ? unmarshalExporterDatadogDestination(data.datadog_destination) : void 0,
76
- datasourceId: data.datasource_id,
77
- description: data.description,
78
- exportedProducts: data.exported_products,
79
- id: data.id,
80
- name: data.name,
81
- otlpDestination: data.otlp_destination ? unmarshalExporterOTLPDestination(data.otlp_destination) : void 0,
82
- status: data.status,
83
- updatedAt: unmarshalDate(data.updated_at)
84
- };
46
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Exporter' failed as data isn't a dictionary.`);
47
+ return {
48
+ createdAt: unmarshalDate(data.created_at),
49
+ datadogDestination: data.datadog_destination ? unmarshalExporterDatadogDestination(data.datadog_destination) : void 0,
50
+ datasourceId: data.datasource_id,
51
+ description: data.description,
52
+ exportedProducts: data.exported_products,
53
+ id: data.id,
54
+ name: data.name,
55
+ otlpDestination: data.otlp_destination ? unmarshalExporterOTLPDestination(data.otlp_destination) : void 0,
56
+ status: data.status,
57
+ updatedAt: unmarshalDate(data.updated_at)
58
+ };
85
59
  };
86
60
  const unmarshalGrafanaProductDashboard = (data) => {
87
- if (!isJSONObject(data)) {
88
- throw new TypeError(
89
- `Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`
90
- );
91
- }
92
- return {
93
- name: data.name,
94
- tags: data.tags,
95
- title: data.title,
96
- url: data.url,
97
- variables: data.variables
98
- };
61
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`);
62
+ return {
63
+ name: data.name,
64
+ tags: data.tags,
65
+ title: data.title,
66
+ url: data.url,
67
+ variables: data.variables
68
+ };
99
69
  };
100
70
  const unmarshalGrafanaUser = (data) => {
101
- if (!isJSONObject(data)) {
102
- throw new TypeError(
103
- `Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`
104
- );
105
- }
106
- return {
107
- id: data.id,
108
- login: data.login,
109
- password: data.password,
110
- role: data.role
111
- };
71
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);
72
+ return {
73
+ id: data.id,
74
+ login: data.login,
75
+ password: data.password,
76
+ role: data.role
77
+ };
112
78
  };
113
79
  const unmarshalPlan = (data) => {
114
- if (!isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'Plan' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- logsIngestionPrice: data.logs_ingestion_price,
121
- monthlyPrice: data.monthly_price,
122
- name: data.name,
123
- retentionLogsInterval: data.retention_logs_interval,
124
- retentionMetricsInterval: data.retention_metrics_interval,
125
- retentionTracesInterval: data.retention_traces_interval,
126
- sampleIngestionPrice: data.sample_ingestion_price,
127
- tracesIngestionPrice: data.traces_ingestion_price
128
- };
80
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
81
+ return {
82
+ logsIngestionPrice: data.logs_ingestion_price,
83
+ monthlyPrice: data.monthly_price,
84
+ name: data.name,
85
+ retentionLogsInterval: data.retention_logs_interval,
86
+ retentionMetricsInterval: data.retention_metrics_interval,
87
+ retentionTracesInterval: data.retention_traces_interval,
88
+ sampleIngestionPrice: data.sample_ingestion_price,
89
+ tracesIngestionPrice: data.traces_ingestion_price
90
+ };
129
91
  };
130
92
  const unmarshalToken = (data) => {
131
- if (!isJSONObject(data)) {
132
- throw new TypeError(
133
- `Unmarshalling the type 'Token' failed as data isn't a dictionary.`
134
- );
135
- }
136
- return {
137
- createdAt: unmarshalDate(data.created_at),
138
- id: data.id,
139
- name: data.name,
140
- projectId: data.project_id,
141
- region: data.region,
142
- scopes: data.scopes,
143
- secretKey: data.secret_key,
144
- updatedAt: unmarshalDate(data.updated_at)
145
- };
93
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
94
+ return {
95
+ createdAt: unmarshalDate(data.created_at),
96
+ id: data.id,
97
+ name: data.name,
98
+ projectId: data.project_id,
99
+ region: data.region,
100
+ scopes: data.scopes,
101
+ secretKey: data.secret_key,
102
+ updatedAt: unmarshalDate(data.updated_at)
103
+ };
146
104
  };
147
105
  const unmarshalAlertManager = (data) => {
148
- if (!isJSONObject(data)) {
149
- throw new TypeError(
150
- `Unmarshalling the type 'AlertManager' failed as data isn't a dictionary.`
151
- );
152
- }
153
- return {
154
- alertManagerEnabled: data.alert_manager_enabled,
155
- alertManagerUrl: data.alert_manager_url,
156
- managedAlertsEnabled: data.managed_alerts_enabled,
157
- region: data.region
158
- };
106
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AlertManager' failed as data isn't a dictionary.`);
107
+ return {
108
+ alertManagerEnabled: data.alert_manager_enabled,
109
+ alertManagerUrl: data.alert_manager_url,
110
+ managedAlertsEnabled: data.managed_alerts_enabled,
111
+ region: data.region
112
+ };
159
113
  };
160
114
  const unmarshalDisableAlertRulesResponse = (data) => {
161
- if (!isJSONObject(data)) {
162
- throw new TypeError(
163
- `Unmarshalling the type 'DisableAlertRulesResponse' failed as data isn't a dictionary.`
164
- );
165
- }
166
- return {
167
- disabledRuleIds: data.disabled_rule_ids
168
- };
115
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DisableAlertRulesResponse' failed as data isn't a dictionary.`);
116
+ return { disabledRuleIds: data.disabled_rule_ids };
169
117
  };
170
118
  const unmarshalEnableAlertRulesResponse = (data) => {
171
- if (!isJSONObject(data)) {
172
- throw new TypeError(
173
- `Unmarshalling the type 'EnableAlertRulesResponse' failed as data isn't a dictionary.`
174
- );
175
- }
176
- return {
177
- enabledRuleIds: data.enabled_rule_ids
178
- };
179
- };
180
- const unmarshalGetConfigResponseRetention = (data) => {
181
- if (!isJSONObject(data)) {
182
- throw new TypeError(
183
- `Unmarshalling the type 'GetConfigResponseRetention' failed as data isn't a dictionary.`
184
- );
185
- }
186
- return {
187
- defaultDays: data.default_days,
188
- maxDays: data.max_days,
189
- minDays: data.min_days
190
- };
119
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EnableAlertRulesResponse' failed as data isn't a dictionary.`);
120
+ return { enabledRuleIds: data.enabled_rule_ids };
121
+ };
122
+ var unmarshalGetConfigResponseRetention = (data) => {
123
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetConfigResponseRetention' failed as data isn't a dictionary.`);
124
+ return {
125
+ defaultDays: data.default_days,
126
+ maxDays: data.max_days,
127
+ minDays: data.min_days
128
+ };
191
129
  };
192
130
  const unmarshalGetConfigResponse = (data) => {
193
- if (!isJSONObject(data)) {
194
- throw new TypeError(
195
- `Unmarshalling the type 'GetConfigResponse' failed as data isn't a dictionary.`
196
- );
197
- }
198
- return {
199
- customLogsRetention: data.custom_logs_retention ? unmarshalGetConfigResponseRetention(data.custom_logs_retention) : void 0,
200
- customMetricsRetention: data.custom_metrics_retention ? unmarshalGetConfigResponseRetention(data.custom_metrics_retention) : void 0,
201
- customTracesRetention: data.custom_traces_retention ? unmarshalGetConfigResponseRetention(data.custom_traces_retention) : void 0,
202
- productLogsRetention: data.product_logs_retention ? unmarshalGetConfigResponseRetention(data.product_logs_retention) : void 0,
203
- productMetricsRetention: data.product_metrics_retention ? unmarshalGetConfigResponseRetention(data.product_metrics_retention) : void 0
204
- };
205
- };
206
- const unmarshalRulesCount = (data) => {
207
- if (!isJSONObject(data)) {
208
- throw new TypeError(
209
- `Unmarshalling the type 'RulesCount' failed as data isn't a dictionary.`
210
- );
211
- }
212
- return {
213
- dataSourceId: data.data_source_id,
214
- dataSourceName: data.data_source_name,
215
- rulesCount: data.rules_count
216
- };
131
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetConfigResponse' failed as data isn't a dictionary.`);
132
+ return {
133
+ customLogsRetention: data.custom_logs_retention ? unmarshalGetConfigResponseRetention(data.custom_logs_retention) : void 0,
134
+ customMetricsRetention: data.custom_metrics_retention ? unmarshalGetConfigResponseRetention(data.custom_metrics_retention) : void 0,
135
+ customTracesRetention: data.custom_traces_retention ? unmarshalGetConfigResponseRetention(data.custom_traces_retention) : void 0,
136
+ productLogsRetention: data.product_logs_retention ? unmarshalGetConfigResponseRetention(data.product_logs_retention) : void 0,
137
+ productMetricsRetention: data.product_metrics_retention ? unmarshalGetConfigResponseRetention(data.product_metrics_retention) : void 0
138
+ };
139
+ };
140
+ var unmarshalRulesCount = (data) => {
141
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'RulesCount' failed as data isn't a dictionary.`);
142
+ return {
143
+ dataSourceId: data.data_source_id,
144
+ dataSourceName: data.data_source_name,
145
+ rulesCount: data.rules_count
146
+ };
217
147
  };
218
148
  const unmarshalGetRulesCountResponse = (data) => {
219
- if (!isJSONObject(data)) {
220
- throw new TypeError(
221
- `Unmarshalling the type 'GetRulesCountResponse' failed as data isn't a dictionary.`
222
- );
223
- }
224
- return {
225
- customRulesCount: data.custom_rules_count,
226
- preconfiguredRulesCount: data.preconfigured_rules_count,
227
- rulesCountByDatasource: unmarshalArrayOfObject(
228
- data.rules_count_by_datasource,
229
- unmarshalRulesCount
230
- )
231
- };
149
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'GetRulesCountResponse' failed as data isn't a dictionary.`);
150
+ return {
151
+ customRulesCount: data.custom_rules_count,
152
+ preconfiguredRulesCount: data.preconfigured_rules_count,
153
+ rulesCountByDatasource: unmarshalArrayOfObject(data.rules_count_by_datasource, unmarshalRulesCount)
154
+ };
232
155
  };
233
156
  const unmarshalGrafana = (data) => {
234
- if (!isJSONObject(data)) {
235
- throw new TypeError(
236
- `Unmarshalling the type 'Grafana' failed as data isn't a dictionary.`
237
- );
238
- }
239
- return {
240
- grafanaUrl: data.grafana_url
241
- };
242
- };
243
- const unmarshalPreconfiguredAlertData = (data) => {
244
- if (!isJSONObject(data)) {
245
- throw new TypeError(
246
- `Unmarshalling the type 'PreconfiguredAlertData' failed as data isn't a dictionary.`
247
- );
248
- }
249
- return {
250
- displayDescription: data.display_description,
251
- displayName: data.display_name,
252
- preconfiguredRuleId: data.preconfigured_rule_id,
253
- productFamily: data.product_family,
254
- productName: data.product_name
255
- };
256
- };
257
- const unmarshalAlert = (data) => {
258
- if (!isJSONObject(data)) {
259
- throw new TypeError(
260
- `Unmarshalling the type 'Alert' failed as data isn't a dictionary.`
261
- );
262
- }
263
- return {
264
- annotations: data.annotations,
265
- dataSourceId: data.data_source_id,
266
- duration: data.duration,
267
- name: data.name,
268
- preconfigured: data.preconfigured,
269
- preconfiguredData: data.preconfigured_data ? unmarshalPreconfiguredAlertData(data.preconfigured_data) : void 0,
270
- region: data.region,
271
- rule: data.rule,
272
- ruleStatus: data.rule_status,
273
- state: data.state ? data.state : void 0
274
- };
157
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Grafana' failed as data isn't a dictionary.`);
158
+ return { grafanaUrl: data.grafana_url };
159
+ };
160
+ var unmarshalPreconfiguredAlertData = (data) => {
161
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PreconfiguredAlertData' failed as data isn't a dictionary.`);
162
+ return {
163
+ displayDescription: data.display_description,
164
+ displayName: data.display_name,
165
+ preconfiguredRuleId: data.preconfigured_rule_id,
166
+ productFamily: data.product_family,
167
+ productName: data.product_name
168
+ };
169
+ };
170
+ var unmarshalAlert = (data) => {
171
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Alert' failed as data isn't a dictionary.`);
172
+ return {
173
+ annotations: data.annotations,
174
+ dataSourceId: data.data_source_id,
175
+ duration: data.duration,
176
+ name: data.name,
177
+ preconfigured: data.preconfigured,
178
+ preconfiguredData: data.preconfigured_data ? unmarshalPreconfiguredAlertData(data.preconfigured_data) : void 0,
179
+ region: data.region,
180
+ rule: data.rule,
181
+ ruleStatus: data.rule_status,
182
+ state: data.state ? data.state : void 0
183
+ };
275
184
  };
276
185
  const unmarshalListAlertsResponse = (data) => {
277
- if (!isJSONObject(data)) {
278
- throw new TypeError(
279
- `Unmarshalling the type 'ListAlertsResponse' failed as data isn't a dictionary.`
280
- );
281
- }
282
- return {
283
- alerts: unmarshalArrayOfObject(data.alerts, unmarshalAlert),
284
- totalCount: data.total_count
285
- };
186
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAlertsResponse' failed as data isn't a dictionary.`);
187
+ return {
188
+ alerts: unmarshalArrayOfObject(data.alerts, unmarshalAlert),
189
+ totalCount: data.total_count
190
+ };
286
191
  };
287
192
  const unmarshalListContactPointsResponse = (data) => {
288
- if (!isJSONObject(data)) {
289
- throw new TypeError(
290
- `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`
291
- );
292
- }
293
- return {
294
- contactPoints: unmarshalArrayOfObject(
295
- data.contact_points,
296
- unmarshalContactPoint
297
- ),
298
- hasAdditionalContactPoints: data.has_additional_contact_points,
299
- hasAdditionalReceivers: data.has_additional_receivers,
300
- totalCount: data.total_count
301
- };
193
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
194
+ return {
195
+ contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint),
196
+ hasAdditionalContactPoints: data.has_additional_contact_points,
197
+ hasAdditionalReceivers: data.has_additional_receivers,
198
+ totalCount: data.total_count
199
+ };
302
200
  };
303
201
  const unmarshalListDataSourcesResponse = (data) => {
304
- if (!isJSONObject(data)) {
305
- throw new TypeError(
306
- `Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.`
307
- );
308
- }
309
- return {
310
- dataSources: unmarshalArrayOfObject(data.data_sources, unmarshalDataSource),
311
- totalCount: data.total_count
312
- };
202
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.`);
203
+ return {
204
+ dataSources: unmarshalArrayOfObject(data.data_sources, unmarshalDataSource),
205
+ totalCount: data.total_count
206
+ };
313
207
  };
314
208
  const unmarshalListExportersResponse = (data) => {
315
- if (!isJSONObject(data)) {
316
- throw new TypeError(
317
- `Unmarshalling the type 'ListExportersResponse' failed as data isn't a dictionary.`
318
- );
319
- }
320
- return {
321
- exporters: unmarshalArrayOfObject(data.exporters, unmarshalExporter),
322
- totalCount: data.total_count
323
- };
209
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListExportersResponse' failed as data isn't a dictionary.`);
210
+ return {
211
+ exporters: unmarshalArrayOfObject(data.exporters, unmarshalExporter),
212
+ totalCount: data.total_count
213
+ };
324
214
  };
325
215
  const unmarshalListGrafanaProductDashboardsResponse = (data) => {
326
- if (!isJSONObject(data)) {
327
- throw new TypeError(
328
- `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`
329
- );
330
- }
331
- return {
332
- dashboards: unmarshalArrayOfObject(
333
- data.dashboards,
334
- unmarshalGrafanaProductDashboard
335
- ),
336
- totalCount: data.total_count
337
- };
216
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`);
217
+ return {
218
+ dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard),
219
+ totalCount: data.total_count
220
+ };
338
221
  };
339
222
  const unmarshalListGrafanaUsersResponse = (data) => {
340
- if (!isJSONObject(data)) {
341
- throw new TypeError(
342
- `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`
343
- );
344
- }
345
- return {
346
- grafanaUsers: unmarshalArrayOfObject(
347
- data.grafana_users,
348
- unmarshalGrafanaUser
349
- ),
350
- totalCount: data.total_count
351
- };
223
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);
224
+ return {
225
+ grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser),
226
+ totalCount: data.total_count
227
+ };
352
228
  };
353
229
  const unmarshalListPlansResponse = (data) => {
354
- if (!isJSONObject(data)) {
355
- throw new TypeError(
356
- `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`
357
- );
358
- }
359
- return {
360
- plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
361
- totalCount: data.total_count
362
- };
363
- };
364
- const unmarshalProduct = (data) => {
365
- if (!isJSONObject(data)) {
366
- throw new TypeError(
367
- `Unmarshalling the type 'Product' failed as data isn't a dictionary.`
368
- );
369
- }
370
- return {
371
- displayName: data.display_name,
372
- familyName: data.family_name,
373
- name: data.name,
374
- resourceTypes: data.resource_types
375
- };
230
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);
231
+ return {
232
+ plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
233
+ totalCount: data.total_count
234
+ };
235
+ };
236
+ var unmarshalProduct = (data) => {
237
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Product' failed as data isn't a dictionary.`);
238
+ return {
239
+ displayName: data.display_name,
240
+ familyName: data.family_name,
241
+ name: data.name,
242
+ resourceTypes: data.resource_types
243
+ };
376
244
  };
377
245
  const unmarshalListProductsResponse = (data) => {
378
- if (!isJSONObject(data)) {
379
- throw new TypeError(
380
- `Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`
381
- );
382
- }
383
- return {
384
- productsList: unmarshalArrayOfObject(data.products_list, unmarshalProduct),
385
- totalCount: data.total_count
386
- };
246
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`);
247
+ return {
248
+ productsList: unmarshalArrayOfObject(data.products_list, unmarshalProduct),
249
+ totalCount: data.total_count
250
+ };
387
251
  };
388
252
  const unmarshalListTokensResponse = (data) => {
389
- if (!isJSONObject(data)) {
390
- throw new TypeError(
391
- `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`
392
- );
393
- }
394
- return {
395
- tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
396
- totalCount: data.total_count
397
- };
398
- };
399
- const unmarshalUsage = (data) => {
400
- if (!isJSONObject(data)) {
401
- throw new TypeError(
402
- `Unmarshalling the type 'Usage' failed as data isn't a dictionary.`
403
- );
404
- }
405
- return {
406
- dataSourceId: data.data_source_id,
407
- dataSourceOrigin: data.data_source_origin,
408
- dataSourceType: data.data_source_type,
409
- interval: data.interval,
410
- projectId: data.project_id,
411
- quantityOverInterval: data.quantity_over_interval,
412
- region: data.region,
413
- unit: data.unit
414
- };
253
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
254
+ return {
255
+ tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
256
+ totalCount: data.total_count
257
+ };
258
+ };
259
+ var unmarshalUsage = (data) => {
260
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Usage' failed as data isn't a dictionary.`);
261
+ return {
262
+ dataSourceId: data.data_source_id,
263
+ dataSourceOrigin: data.data_source_origin,
264
+ dataSourceType: data.data_source_type,
265
+ interval: data.interval,
266
+ projectId: data.project_id,
267
+ quantityOverInterval: data.quantity_over_interval,
268
+ region: data.region,
269
+ unit: data.unit
270
+ };
415
271
  };
416
272
  const unmarshalUsageOverview = (data) => {
417
- if (!isJSONObject(data)) {
418
- throw new TypeError(
419
- `Unmarshalling the type 'UsageOverview' failed as data isn't a dictionary.`
420
- );
421
- }
422
- return {
423
- externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : void 0,
424
- externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : void 0,
425
- externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : void 0,
426
- scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : void 0,
427
- scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : void 0
428
- };
273
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UsageOverview' failed as data isn't a dictionary.`);
274
+ return {
275
+ externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : void 0,
276
+ externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : void 0,
277
+ externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : void 0,
278
+ scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : void 0,
279
+ scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : void 0
280
+ };
429
281
  };
430
282
  const marshalGlobalApiCreateGrafanaUserRequest = (request, defaults) => ({
431
- login: request.login,
432
- project_id: request.projectId ?? defaults.defaultProjectId,
433
- role: request.role
434
- });
435
- const marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({
436
- project_id: request.projectId ?? defaults.defaultProjectId
283
+ login: request.login,
284
+ project_id: request.projectId ?? defaults.defaultProjectId,
285
+ role: request.role
437
286
  });
287
+ const marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
438
288
  const marshalGlobalApiSelectPlanRequest = (request, defaults) => ({
439
- plan_name: request.planName,
440
- project_id: request.projectId ?? defaults.defaultProjectId
441
- });
442
- const marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({
443
- project_id: request.projectId ?? defaults.defaultProjectId
444
- });
445
- const marshalContactPointEmail = (request, defaults) => ({
446
- to: request.to
289
+ plan_name: request.planName,
290
+ project_id: request.projectId ?? defaults.defaultProjectId
447
291
  });
292
+ const marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
293
+ var marshalContactPointEmail = (request, defaults) => ({ to: request.to });
448
294
  const marshalRegionalApiCreateContactPointRequest = (request, defaults) => ({
449
- project_id: request.projectId ?? defaults.defaultProjectId,
450
- send_resolved_notifications: request.sendResolvedNotifications,
451
- ...resolveOneOf([
452
- {
453
- param: "email",
454
- value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
455
- }
456
- ])
295
+ project_id: request.projectId ?? defaults.defaultProjectId,
296
+ send_resolved_notifications: request.sendResolvedNotifications,
297
+ ...resolveOneOf([{
298
+ param: "email",
299
+ value: request.email !== void 0 ? marshalContactPointEmail(request.email, defaults) : void 0
300
+ }])
457
301
  });
458
302
  const marshalRegionalApiCreateDataSourceRequest = (request, defaults) => ({
459
- name: request.name,
460
- project_id: request.projectId ?? defaults.defaultProjectId,
461
- retention_days: request.retentionDays,
462
- type: request.type
303
+ name: request.name,
304
+ project_id: request.projectId ?? defaults.defaultProjectId,
305
+ retention_days: request.retentionDays,
306
+ type: request.type
463
307
  });
464
- const marshalExporterDatadogDestination = (request, defaults) => ({
465
- api_key: request.apiKey,
466
- endpoint: request.endpoint
308
+ var marshalExporterDatadogDestination = (request, defaults) => ({
309
+ api_key: request.apiKey,
310
+ endpoint: request.endpoint
467
311
  });
468
- const marshalExporterOTLPDestination = (request, defaults) => ({
469
- endpoint: request.endpoint,
470
- headers: request.headers
312
+ var marshalExporterOTLPDestination = (request, defaults) => ({
313
+ endpoint: request.endpoint,
314
+ headers: request.headers
471
315
  });
472
316
  const marshalRegionalApiCreateExporterRequest = (request, defaults) => ({
473
- datasource_id: request.datasourceId,
474
- description: request.description,
475
- exported_products: request.exportedProducts,
476
- name: request.name,
477
- ...resolveOneOf([
478
- {
479
- param: "datadog_destination",
480
- value: request.datadogDestination !== void 0 ? marshalExporterDatadogDestination(
481
- request.datadogDestination
482
- ) : void 0
483
- },
484
- {
485
- param: "otlp_destination",
486
- value: request.otlpDestination !== void 0 ? marshalExporterOTLPDestination(request.otlpDestination) : void 0
487
- }
488
- ])
317
+ datasource_id: request.datasourceId,
318
+ description: request.description,
319
+ exported_products: request.exportedProducts,
320
+ name: request.name,
321
+ ...resolveOneOf([{
322
+ param: "datadog_destination",
323
+ value: request.datadogDestination !== void 0 ? marshalExporterDatadogDestination(request.datadogDestination, defaults) : void 0
324
+ }, {
325
+ param: "otlp_destination",
326
+ value: request.otlpDestination !== void 0 ? marshalExporterOTLPDestination(request.otlpDestination, defaults) : void 0
327
+ }])
489
328
  });
490
329
  const marshalRegionalApiCreateTokenRequest = (request, defaults) => ({
491
- name: request.name,
492
- project_id: request.projectId ?? defaults.defaultProjectId,
493
- token_scopes: request.tokenScopes !== void 0 ? request.tokenScopes : void 0
330
+ name: request.name,
331
+ project_id: request.projectId ?? defaults.defaultProjectId,
332
+ token_scopes: request.tokenScopes !== void 0 ? request.tokenScopes : void 0
494
333
  });
495
334
  const marshalRegionalApiDeleteContactPointRequest = (request, defaults) => ({
496
- project_id: request.projectId ?? defaults.defaultProjectId,
497
- ...resolveOneOf([
498
- {
499
- param: "email",
500
- value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
501
- }
502
- ])
503
- });
504
- const marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({
505
- project_id: request.projectId ?? defaults.defaultProjectId
335
+ project_id: request.projectId ?? defaults.defaultProjectId,
336
+ ...resolveOneOf([{
337
+ param: "email",
338
+ value: request.email !== void 0 ? marshalContactPointEmail(request.email, defaults) : void 0
339
+ }])
506
340
  });
341
+ const marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
507
342
  const marshalRegionalApiDisableAlertRulesRequest = (request, defaults) => ({
508
- project_id: request.projectId ?? defaults.defaultProjectId,
509
- rule_ids: request.ruleIds
510
- });
511
- const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({
512
- project_id: request.projectId ?? defaults.defaultProjectId
513
- });
514
- const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({
515
- project_id: request.projectId ?? defaults.defaultProjectId
343
+ project_id: request.projectId ?? defaults.defaultProjectId,
344
+ rule_ids: request.ruleIds
516
345
  });
346
+ const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
347
+ const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
517
348
  const marshalRegionalApiEnableAlertRulesRequest = (request, defaults) => ({
518
- project_id: request.projectId ?? defaults.defaultProjectId,
519
- rule_ids: request.ruleIds
520
- });
521
- const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({
522
- project_id: request.projectId ?? defaults.defaultProjectId
523
- });
524
- const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({
525
- project_id: request.projectId ?? defaults.defaultProjectId
349
+ project_id: request.projectId ?? defaults.defaultProjectId,
350
+ rule_ids: request.ruleIds
526
351
  });
352
+ const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
353
+ const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
527
354
  const marshalRegionalApiUpdateContactPointRequest = (request, defaults) => ({
528
- project_id: request.projectId ?? defaults.defaultProjectId,
529
- send_resolved_notifications: request.sendResolvedNotifications,
530
- ...resolveOneOf([
531
- {
532
- param: "email",
533
- value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
534
- }
535
- ])
355
+ project_id: request.projectId ?? defaults.defaultProjectId,
356
+ send_resolved_notifications: request.sendResolvedNotifications,
357
+ ...resolveOneOf([{
358
+ param: "email",
359
+ value: request.email !== void 0 ? marshalContactPointEmail(request.email, defaults) : void 0
360
+ }])
536
361
  });
537
362
  const marshalRegionalApiUpdateDataSourceRequest = (request, defaults) => ({
538
- name: request.name,
539
- retention_days: request.retentionDays
363
+ name: request.name,
364
+ retention_days: request.retentionDays
540
365
  });
541
366
  const marshalRegionalApiUpdateExporterRequest = (request, defaults) => ({
542
- description: request.description,
543
- exported_products: request.exportedProducts,
544
- name: request.name,
545
- ...resolveOneOf([
546
- {
547
- param: "datadog_destination",
548
- value: request.datadogDestination !== void 0 ? marshalExporterDatadogDestination(
549
- request.datadogDestination
550
- ) : void 0
551
- },
552
- {
553
- param: "otlp_destination",
554
- value: request.otlpDestination !== void 0 ? marshalExporterOTLPDestination(request.otlpDestination) : void 0
555
- }
556
- ])
367
+ description: request.description,
368
+ exported_products: request.exportedProducts,
369
+ name: request.name,
370
+ ...resolveOneOf([{
371
+ param: "datadog_destination",
372
+ value: request.datadogDestination !== void 0 ? marshalExporterDatadogDestination(request.datadogDestination, defaults) : void 0
373
+ }, {
374
+ param: "otlp_destination",
375
+ value: request.otlpDestination !== void 0 ? marshalExporterOTLPDestination(request.otlpDestination, defaults) : void 0
376
+ }])
557
377
  });
558
- export {
559
- marshalGlobalApiCreateGrafanaUserRequest,
560
- marshalGlobalApiResetGrafanaUserPasswordRequest,
561
- marshalGlobalApiSelectPlanRequest,
562
- marshalGlobalApiSyncGrafanaDataSourcesRequest,
563
- marshalRegionalApiCreateContactPointRequest,
564
- marshalRegionalApiCreateDataSourceRequest,
565
- marshalRegionalApiCreateExporterRequest,
566
- marshalRegionalApiCreateTokenRequest,
567
- marshalRegionalApiDeleteContactPointRequest,
568
- marshalRegionalApiDisableAlertManagerRequest,
569
- marshalRegionalApiDisableAlertRulesRequest,
570
- marshalRegionalApiDisableManagedAlertsRequest,
571
- marshalRegionalApiEnableAlertManagerRequest,
572
- marshalRegionalApiEnableAlertRulesRequest,
573
- marshalRegionalApiEnableManagedAlertsRequest,
574
- marshalRegionalApiTriggerTestAlertRequest,
575
- marshalRegionalApiUpdateContactPointRequest,
576
- marshalRegionalApiUpdateDataSourceRequest,
577
- marshalRegionalApiUpdateExporterRequest,
578
- unmarshalAlertManager,
579
- unmarshalContactPoint,
580
- unmarshalDataSource,
581
- unmarshalDisableAlertRulesResponse,
582
- unmarshalEnableAlertRulesResponse,
583
- unmarshalExporter,
584
- unmarshalGetConfigResponse,
585
- unmarshalGetRulesCountResponse,
586
- unmarshalGrafana,
587
- unmarshalGrafanaProductDashboard,
588
- unmarshalGrafanaUser,
589
- unmarshalListAlertsResponse,
590
- unmarshalListContactPointsResponse,
591
- unmarshalListDataSourcesResponse,
592
- unmarshalListExportersResponse,
593
- unmarshalListGrafanaProductDashboardsResponse,
594
- unmarshalListGrafanaUsersResponse,
595
- unmarshalListPlansResponse,
596
- unmarshalListProductsResponse,
597
- unmarshalListTokensResponse,
598
- unmarshalPlan,
599
- unmarshalToken,
600
- unmarshalUsageOverview
601
- };
378
+ export { marshalGlobalApiCreateGrafanaUserRequest, marshalGlobalApiResetGrafanaUserPasswordRequest, marshalGlobalApiSelectPlanRequest, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalRegionalApiCreateContactPointRequest, marshalRegionalApiCreateDataSourceRequest, marshalRegionalApiCreateExporterRequest, marshalRegionalApiCreateTokenRequest, marshalRegionalApiDeleteContactPointRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiDisableAlertRulesRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiEnableAlertRulesRequest, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest, marshalRegionalApiUpdateContactPointRequest, marshalRegionalApiUpdateDataSourceRequest, marshalRegionalApiUpdateExporterRequest, unmarshalAlertManager, unmarshalContactPoint, unmarshalDataSource, unmarshalDisableAlertRulesResponse, unmarshalEnableAlertRulesResponse, unmarshalExporter, unmarshalGetConfigResponse, unmarshalGetRulesCountResponse, unmarshalGrafana, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListAlertsResponse, unmarshalListContactPointsResponse, unmarshalListDataSourcesResponse, unmarshalListExportersResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListProductsResponse, unmarshalListTokensResponse, unmarshalPlan, unmarshalToken, unmarshalUsageOverview };