@scaleway/sdk-cockpit 2.2.2 → 2.3.1

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,585 +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(data.rules_count_by_datasource, unmarshalRulesCount)
228
- };
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
+ };
229
155
  };
230
156
  const unmarshalGrafana = (data) => {
231
- if (!isJSONObject(data)) {
232
- throw new TypeError(
233
- `Unmarshalling the type 'Grafana' failed as data isn't a dictionary.`
234
- );
235
- }
236
- return {
237
- grafanaUrl: data.grafana_url
238
- };
239
- };
240
- const unmarshalPreconfiguredAlertData = (data) => {
241
- if (!isJSONObject(data)) {
242
- throw new TypeError(
243
- `Unmarshalling the type 'PreconfiguredAlertData' failed as data isn't a dictionary.`
244
- );
245
- }
246
- return {
247
- displayDescription: data.display_description,
248
- displayName: data.display_name,
249
- preconfiguredRuleId: data.preconfigured_rule_id,
250
- productFamily: data.product_family,
251
- productName: data.product_name
252
- };
253
- };
254
- const unmarshalAlert = (data) => {
255
- if (!isJSONObject(data)) {
256
- throw new TypeError(
257
- `Unmarshalling the type 'Alert' failed as data isn't a dictionary.`
258
- );
259
- }
260
- return {
261
- annotations: data.annotations,
262
- dataSourceId: data.data_source_id,
263
- duration: data.duration,
264
- name: data.name,
265
- preconfigured: data.preconfigured,
266
- preconfiguredData: data.preconfigured_data ? unmarshalPreconfiguredAlertData(data.preconfigured_data) : void 0,
267
- region: data.region,
268
- rule: data.rule,
269
- ruleStatus: data.rule_status,
270
- state: data.state ? data.state : void 0
271
- };
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
+ };
272
184
  };
273
185
  const unmarshalListAlertsResponse = (data) => {
274
- if (!isJSONObject(data)) {
275
- throw new TypeError(
276
- `Unmarshalling the type 'ListAlertsResponse' failed as data isn't a dictionary.`
277
- );
278
- }
279
- return {
280
- alerts: unmarshalArrayOfObject(data.alerts, unmarshalAlert),
281
- totalCount: data.total_count
282
- };
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
+ };
283
191
  };
284
192
  const unmarshalListContactPointsResponse = (data) => {
285
- if (!isJSONObject(data)) {
286
- throw new TypeError(
287
- `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`
288
- );
289
- }
290
- return {
291
- contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint),
292
- hasAdditionalContactPoints: data.has_additional_contact_points,
293
- hasAdditionalReceivers: data.has_additional_receivers,
294
- totalCount: data.total_count
295
- };
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
+ };
296
200
  };
297
201
  const unmarshalListDataSourcesResponse = (data) => {
298
- if (!isJSONObject(data)) {
299
- throw new TypeError(
300
- `Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.`
301
- );
302
- }
303
- return {
304
- dataSources: unmarshalArrayOfObject(data.data_sources, unmarshalDataSource),
305
- totalCount: data.total_count
306
- };
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
+ };
307
207
  };
308
208
  const unmarshalListExportersResponse = (data) => {
309
- if (!isJSONObject(data)) {
310
- throw new TypeError(
311
- `Unmarshalling the type 'ListExportersResponse' failed as data isn't a dictionary.`
312
- );
313
- }
314
- return {
315
- exporters: unmarshalArrayOfObject(data.exporters, unmarshalExporter),
316
- totalCount: data.total_count
317
- };
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
+ };
318
214
  };
319
215
  const unmarshalListGrafanaProductDashboardsResponse = (data) => {
320
- if (!isJSONObject(data)) {
321
- throw new TypeError(
322
- `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`
323
- );
324
- }
325
- return {
326
- dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard),
327
- totalCount: data.total_count
328
- };
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
+ };
329
221
  };
330
222
  const unmarshalListGrafanaUsersResponse = (data) => {
331
- if (!isJSONObject(data)) {
332
- throw new TypeError(
333
- `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`
334
- );
335
- }
336
- return {
337
- grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser),
338
- totalCount: data.total_count
339
- };
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
+ };
340
228
  };
341
229
  const unmarshalListPlansResponse = (data) => {
342
- if (!isJSONObject(data)) {
343
- throw new TypeError(
344
- `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`
345
- );
346
- }
347
- return {
348
- plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
349
- totalCount: data.total_count
350
- };
351
- };
352
- const unmarshalProduct = (data) => {
353
- if (!isJSONObject(data)) {
354
- throw new TypeError(
355
- `Unmarshalling the type 'Product' failed as data isn't a dictionary.`
356
- );
357
- }
358
- return {
359
- displayName: data.display_name,
360
- familyName: data.family_name,
361
- name: data.name,
362
- resourceTypes: data.resource_types
363
- };
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
+ };
364
244
  };
365
245
  const unmarshalListProductsResponse = (data) => {
366
- if (!isJSONObject(data)) {
367
- throw new TypeError(
368
- `Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`
369
- );
370
- }
371
- return {
372
- productsList: unmarshalArrayOfObject(data.products_list, unmarshalProduct),
373
- totalCount: data.total_count
374
- };
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
+ };
375
251
  };
376
252
  const unmarshalListTokensResponse = (data) => {
377
- if (!isJSONObject(data)) {
378
- throw new TypeError(
379
- `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`
380
- );
381
- }
382
- return {
383
- tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
384
- totalCount: data.total_count
385
- };
386
- };
387
- const unmarshalUsage = (data) => {
388
- if (!isJSONObject(data)) {
389
- throw new TypeError(
390
- `Unmarshalling the type 'Usage' failed as data isn't a dictionary.`
391
- );
392
- }
393
- return {
394
- dataSourceId: data.data_source_id,
395
- dataSourceOrigin: data.data_source_origin,
396
- dataSourceType: data.data_source_type,
397
- interval: data.interval,
398
- projectId: data.project_id,
399
- quantityOverInterval: data.quantity_over_interval,
400
- region: data.region,
401
- unit: data.unit
402
- };
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
+ };
403
271
  };
404
272
  const unmarshalUsageOverview = (data) => {
405
- if (!isJSONObject(data)) {
406
- throw new TypeError(
407
- `Unmarshalling the type 'UsageOverview' failed as data isn't a dictionary.`
408
- );
409
- }
410
- return {
411
- externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : void 0,
412
- externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : void 0,
413
- externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : void 0,
414
- scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : void 0,
415
- scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : void 0
416
- };
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
+ };
417
281
  };
418
282
  const marshalGlobalApiCreateGrafanaUserRequest = (request, defaults) => ({
419
- login: request.login,
420
- project_id: request.projectId ?? defaults.defaultProjectId,
421
- role: request.role
422
- });
423
- const marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({
424
- project_id: request.projectId ?? defaults.defaultProjectId
283
+ login: request.login,
284
+ project_id: request.projectId ?? defaults.defaultProjectId,
285
+ role: request.role
425
286
  });
287
+ const marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
426
288
  const marshalGlobalApiSelectPlanRequest = (request, defaults) => ({
427
- plan_name: request.planName,
428
- project_id: request.projectId ?? defaults.defaultProjectId
429
- });
430
- const marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({
431
- project_id: request.projectId ?? defaults.defaultProjectId
432
- });
433
- const marshalContactPointEmail = (request, defaults) => ({
434
- to: request.to
289
+ plan_name: request.planName,
290
+ project_id: request.projectId ?? defaults.defaultProjectId
435
291
  });
292
+ const marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
293
+ var marshalContactPointEmail = (request, defaults) => ({ to: request.to });
436
294
  const marshalRegionalApiCreateContactPointRequest = (request, defaults) => ({
437
- project_id: request.projectId ?? defaults.defaultProjectId,
438
- send_resolved_notifications: request.sendResolvedNotifications,
439
- ...resolveOneOf([
440
- {
441
- param: "email",
442
- value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
443
- }
444
- ])
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
+ }])
445
301
  });
446
302
  const marshalRegionalApiCreateDataSourceRequest = (request, defaults) => ({
447
- name: request.name,
448
- project_id: request.projectId ?? defaults.defaultProjectId,
449
- retention_days: request.retentionDays,
450
- type: request.type
303
+ name: request.name,
304
+ project_id: request.projectId ?? defaults.defaultProjectId,
305
+ retention_days: request.retentionDays,
306
+ type: request.type
451
307
  });
452
- const marshalExporterDatadogDestination = (request, defaults) => ({
453
- api_key: request.apiKey,
454
- endpoint: request.endpoint
308
+ var marshalExporterDatadogDestination = (request, defaults) => ({
309
+ api_key: request.apiKey,
310
+ endpoint: request.endpoint
455
311
  });
456
- const marshalExporterOTLPDestination = (request, defaults) => ({
457
- endpoint: request.endpoint,
458
- headers: request.headers
312
+ var marshalExporterOTLPDestination = (request, defaults) => ({
313
+ endpoint: request.endpoint,
314
+ headers: request.headers
459
315
  });
460
316
  const marshalRegionalApiCreateExporterRequest = (request, defaults) => ({
461
- datasource_id: request.datasourceId,
462
- description: request.description,
463
- exported_products: request.exportedProducts,
464
- name: request.name,
465
- ...resolveOneOf([
466
- {
467
- param: "datadog_destination",
468
- value: request.datadogDestination !== void 0 ? marshalExporterDatadogDestination(request.datadogDestination) : void 0
469
- },
470
- {
471
- param: "otlp_destination",
472
- value: request.otlpDestination !== void 0 ? marshalExporterOTLPDestination(request.otlpDestination) : void 0
473
- }
474
- ])
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
+ }])
475
328
  });
476
329
  const marshalRegionalApiCreateTokenRequest = (request, defaults) => ({
477
- name: request.name,
478
- project_id: request.projectId ?? defaults.defaultProjectId,
479
- 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
480
333
  });
481
334
  const marshalRegionalApiDeleteContactPointRequest = (request, defaults) => ({
482
- project_id: request.projectId ?? defaults.defaultProjectId,
483
- ...resolveOneOf([
484
- {
485
- param: "email",
486
- value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
487
- }
488
- ])
489
- });
490
- const marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({
491
- 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
+ }])
492
340
  });
341
+ const marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
493
342
  const marshalRegionalApiDisableAlertRulesRequest = (request, defaults) => ({
494
- project_id: request.projectId ?? defaults.defaultProjectId,
495
- rule_ids: request.ruleIds
496
- });
497
- const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({
498
- project_id: request.projectId ?? defaults.defaultProjectId
499
- });
500
- const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({
501
- project_id: request.projectId ?? defaults.defaultProjectId
343
+ project_id: request.projectId ?? defaults.defaultProjectId,
344
+ rule_ids: request.ruleIds
502
345
  });
346
+ const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
347
+ const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
503
348
  const marshalRegionalApiEnableAlertRulesRequest = (request, defaults) => ({
504
- project_id: request.projectId ?? defaults.defaultProjectId,
505
- rule_ids: request.ruleIds
506
- });
507
- const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({
508
- project_id: request.projectId ?? defaults.defaultProjectId
509
- });
510
- const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({
511
- project_id: request.projectId ?? defaults.defaultProjectId
349
+ project_id: request.projectId ?? defaults.defaultProjectId,
350
+ rule_ids: request.ruleIds
512
351
  });
352
+ const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
353
+ const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId });
513
354
  const marshalRegionalApiUpdateContactPointRequest = (request, defaults) => ({
514
- project_id: request.projectId ?? defaults.defaultProjectId,
515
- send_resolved_notifications: request.sendResolvedNotifications,
516
- ...resolveOneOf([
517
- {
518
- param: "email",
519
- value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
520
- }
521
- ])
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
+ }])
522
361
  });
523
362
  const marshalRegionalApiUpdateDataSourceRequest = (request, defaults) => ({
524
- name: request.name,
525
- retention_days: request.retentionDays
363
+ name: request.name,
364
+ retention_days: request.retentionDays
526
365
  });
527
366
  const marshalRegionalApiUpdateExporterRequest = (request, defaults) => ({
528
- description: request.description,
529
- exported_products: request.exportedProducts,
530
- name: request.name,
531
- ...resolveOneOf([
532
- {
533
- param: "datadog_destination",
534
- value: request.datadogDestination !== void 0 ? marshalExporterDatadogDestination(request.datadogDestination) : void 0
535
- },
536
- {
537
- param: "otlp_destination",
538
- value: request.otlpDestination !== void 0 ? marshalExporterOTLPDestination(request.otlpDestination) : void 0
539
- }
540
- ])
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
+ }])
541
377
  });
542
- export {
543
- marshalGlobalApiCreateGrafanaUserRequest,
544
- marshalGlobalApiResetGrafanaUserPasswordRequest,
545
- marshalGlobalApiSelectPlanRequest,
546
- marshalGlobalApiSyncGrafanaDataSourcesRequest,
547
- marshalRegionalApiCreateContactPointRequest,
548
- marshalRegionalApiCreateDataSourceRequest,
549
- marshalRegionalApiCreateExporterRequest,
550
- marshalRegionalApiCreateTokenRequest,
551
- marshalRegionalApiDeleteContactPointRequest,
552
- marshalRegionalApiDisableAlertManagerRequest,
553
- marshalRegionalApiDisableAlertRulesRequest,
554
- marshalRegionalApiDisableManagedAlertsRequest,
555
- marshalRegionalApiEnableAlertManagerRequest,
556
- marshalRegionalApiEnableAlertRulesRequest,
557
- marshalRegionalApiEnableManagedAlertsRequest,
558
- marshalRegionalApiTriggerTestAlertRequest,
559
- marshalRegionalApiUpdateContactPointRequest,
560
- marshalRegionalApiUpdateDataSourceRequest,
561
- marshalRegionalApiUpdateExporterRequest,
562
- unmarshalAlertManager,
563
- unmarshalContactPoint,
564
- unmarshalDataSource,
565
- unmarshalDisableAlertRulesResponse,
566
- unmarshalEnableAlertRulesResponse,
567
- unmarshalExporter,
568
- unmarshalGetConfigResponse,
569
- unmarshalGetRulesCountResponse,
570
- unmarshalGrafana,
571
- unmarshalGrafanaProductDashboard,
572
- unmarshalGrafanaUser,
573
- unmarshalListAlertsResponse,
574
- unmarshalListContactPointsResponse,
575
- unmarshalListDataSourcesResponse,
576
- unmarshalListExportersResponse,
577
- unmarshalListGrafanaProductDashboardsResponse,
578
- unmarshalListGrafanaUsersResponse,
579
- unmarshalListPlansResponse,
580
- unmarshalListProductsResponse,
581
- unmarshalListTokensResponse,
582
- unmarshalPlan,
583
- unmarshalToken,
584
- unmarshalUsageOverview
585
- };
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 };