@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.
- 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.js +534 -755
- package/dist/v1/content.gen.js +3 -6
- package/dist/v1/index.gen.js +52 -50
- package/dist/v1/marshalling.gen.js +305 -512
- package/dist/v1/validation-rules.gen.js +81 -91
- package/package.json +4 -4
|
@@ -1,585 +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(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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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
|
-
|
|
420
|
-
|
|
421
|
-
|
|
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
|
-
|
|
428
|
-
|
|
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
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
303
|
+
name: request.name,
|
|
304
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
305
|
+
retention_days: request.retentionDays,
|
|
306
|
+
type: request.type
|
|
451
307
|
});
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
308
|
+
var marshalExporterDatadogDestination = (request, defaults) => ({
|
|
309
|
+
api_key: request.apiKey,
|
|
310
|
+
endpoint: request.endpoint
|
|
455
311
|
});
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
312
|
+
var marshalExporterOTLPDestination = (request, defaults) => ({
|
|
313
|
+
endpoint: request.endpoint,
|
|
314
|
+
headers: request.headers
|
|
459
315
|
});
|
|
460
316
|
const marshalRegionalApiCreateExporterRequest = (request, defaults) => ({
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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
|
-
|
|
478
|
-
|
|
479
|
-
|
|
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
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
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
|
-
|
|
495
|
-
|
|
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
|
-
|
|
505
|
-
|
|
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
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
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
|
-
|
|
525
|
-
|
|
363
|
+
name: request.name,
|
|
364
|
+
retention_days: request.retentionDays
|
|
526
365
|
});
|
|
527
366
|
const marshalRegionalApiUpdateExporterRequest = (request, defaults) => ({
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
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 };
|