@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.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1/api.gen.d.ts +2 -2
- package/dist/v1/api.gen.js +534 -848
- package/dist/v1/content.gen.js +2 -3
- package/dist/v1/index.gen.js +52 -50
- package/dist/v1/marshalling.gen.js +305 -528
- package/dist/v1/validation-rules.gen.js +81 -91
- package/package.json +4 -4
|
@@ -1,601 +1,378 @@
|
|
|
1
|
-
import { resolveOneOf,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
162
|
-
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
|
|
305
|
-
|
|
306
|
-
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
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
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
-
|
|
440
|
-
|
|
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
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
303
|
+
name: request.name,
|
|
304
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
305
|
+
retention_days: request.retentionDays,
|
|
306
|
+
type: request.type
|
|
463
307
|
});
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
308
|
+
var marshalExporterDatadogDestination = (request, defaults) => ({
|
|
309
|
+
api_key: request.apiKey,
|
|
310
|
+
endpoint: request.endpoint
|
|
467
311
|
});
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
312
|
+
var marshalExporterOTLPDestination = (request, defaults) => ({
|
|
313
|
+
endpoint: request.endpoint,
|
|
314
|
+
headers: request.headers
|
|
471
315
|
});
|
|
472
316
|
const marshalRegionalApiCreateExporterRequest = (request, defaults) => ({
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
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
|
-
|
|
492
|
-
|
|
493
|
-
|
|
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
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
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
|
-
|
|
509
|
-
|
|
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
|
-
|
|
519
|
-
|
|
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
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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
|
-
|
|
539
|
-
|
|
363
|
+
name: request.name,
|
|
364
|
+
retention_days: request.retentionDays
|
|
540
365
|
});
|
|
541
366
|
const marshalRegionalApiUpdateExporterRequest = (request, defaults) => ({
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
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 };
|