@scaleway/sdk-cockpit 1.1.2

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.
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const api_gen = require("./api.gen.cjs");
4
+ const marshalling_gen = require("./marshalling.gen.cjs");
5
+ const validationRules_gen = require("./validation-rules.gen.cjs");
6
+ exports.GlobalAPI = api_gen.GlobalAPI;
7
+ exports.RegionalAPI = api_gen.RegionalAPI;
8
+ exports.marshalGlobalApiCreateGrafanaUserRequest = marshalling_gen.marshalGlobalApiCreateGrafanaUserRequest;
9
+ exports.marshalGlobalApiResetGrafanaUserPasswordRequest = marshalling_gen.marshalGlobalApiResetGrafanaUserPasswordRequest;
10
+ exports.marshalGlobalApiSelectPlanRequest = marshalling_gen.marshalGlobalApiSelectPlanRequest;
11
+ exports.marshalGlobalApiSyncGrafanaDataSourcesRequest = marshalling_gen.marshalGlobalApiSyncGrafanaDataSourcesRequest;
12
+ exports.marshalRegionalApiCreateContactPointRequest = marshalling_gen.marshalRegionalApiCreateContactPointRequest;
13
+ exports.marshalRegionalApiCreateDataSourceRequest = marshalling_gen.marshalRegionalApiCreateDataSourceRequest;
14
+ exports.marshalRegionalApiCreateTokenRequest = marshalling_gen.marshalRegionalApiCreateTokenRequest;
15
+ exports.marshalRegionalApiDeleteContactPointRequest = marshalling_gen.marshalRegionalApiDeleteContactPointRequest;
16
+ exports.marshalRegionalApiDisableAlertManagerRequest = marshalling_gen.marshalRegionalApiDisableAlertManagerRequest;
17
+ exports.marshalRegionalApiDisableAlertRulesRequest = marshalling_gen.marshalRegionalApiDisableAlertRulesRequest;
18
+ exports.marshalRegionalApiDisableManagedAlertsRequest = marshalling_gen.marshalRegionalApiDisableManagedAlertsRequest;
19
+ exports.marshalRegionalApiEnableAlertManagerRequest = marshalling_gen.marshalRegionalApiEnableAlertManagerRequest;
20
+ exports.marshalRegionalApiEnableAlertRulesRequest = marshalling_gen.marshalRegionalApiEnableAlertRulesRequest;
21
+ exports.marshalRegionalApiEnableManagedAlertsRequest = marshalling_gen.marshalRegionalApiEnableManagedAlertsRequest;
22
+ exports.marshalRegionalApiTriggerTestAlertRequest = marshalling_gen.marshalRegionalApiTriggerTestAlertRequest;
23
+ exports.marshalRegionalApiUpdateContactPointRequest = marshalling_gen.marshalRegionalApiUpdateContactPointRequest;
24
+ exports.marshalRegionalApiUpdateDataSourceRequest = marshalling_gen.marshalRegionalApiUpdateDataSourceRequest;
25
+ exports.unmarshalAlertManager = marshalling_gen.unmarshalAlertManager;
26
+ exports.unmarshalContactPoint = marshalling_gen.unmarshalContactPoint;
27
+ exports.unmarshalDataSource = marshalling_gen.unmarshalDataSource;
28
+ exports.unmarshalDisableAlertRulesResponse = marshalling_gen.unmarshalDisableAlertRulesResponse;
29
+ exports.unmarshalEnableAlertRulesResponse = marshalling_gen.unmarshalEnableAlertRulesResponse;
30
+ exports.unmarshalGetConfigResponse = marshalling_gen.unmarshalGetConfigResponse;
31
+ exports.unmarshalGrafana = marshalling_gen.unmarshalGrafana;
32
+ exports.unmarshalGrafanaProductDashboard = marshalling_gen.unmarshalGrafanaProductDashboard;
33
+ exports.unmarshalGrafanaUser = marshalling_gen.unmarshalGrafanaUser;
34
+ exports.unmarshalListAlertsResponse = marshalling_gen.unmarshalListAlertsResponse;
35
+ exports.unmarshalListContactPointsResponse = marshalling_gen.unmarshalListContactPointsResponse;
36
+ exports.unmarshalListDataSourcesResponse = marshalling_gen.unmarshalListDataSourcesResponse;
37
+ exports.unmarshalListGrafanaProductDashboardsResponse = marshalling_gen.unmarshalListGrafanaProductDashboardsResponse;
38
+ exports.unmarshalListGrafanaUsersResponse = marshalling_gen.unmarshalListGrafanaUsersResponse;
39
+ exports.unmarshalListPlansResponse = marshalling_gen.unmarshalListPlansResponse;
40
+ exports.unmarshalListTokensResponse = marshalling_gen.unmarshalListTokensResponse;
41
+ exports.unmarshalPlan = marshalling_gen.unmarshalPlan;
42
+ exports.unmarshalToken = marshalling_gen.unmarshalToken;
43
+ exports.unmarshalUsageOverview = marshalling_gen.unmarshalUsageOverview;
44
+ exports.ValidationRules = validationRules_gen;
@@ -0,0 +1,4 @@
1
+ export { GlobalAPI, RegionalAPI, } from './api.gen';
2
+ export * from './marshalling.gen';
3
+ export type { Alert, AlertManager, AlertState, ContactPoint, ContactPointEmail, DataSource, DataSourceOrigin, DataSourceType, DisableAlertRulesResponse, EnableAlertRulesResponse, GetConfigResponse, GetConfigResponseRetention, GlobalApiCreateGrafanaUserRequest, GlobalApiDeleteGrafanaUserRequest, GlobalApiGetCurrentPlanRequest, GlobalApiGetGrafanaProductDashboardRequest, GlobalApiGetGrafanaRequest, GlobalApiListGrafanaProductDashboardsRequest, GlobalApiListGrafanaUsersRequest, GlobalApiListPlansRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, GrafanaUserRole, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesRequestOrderBy, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersRequestOrderBy, ListGrafanaUsersResponse, ListPlansRequestOrderBy, ListPlansResponse, ListTokensRequestOrderBy, ListTokensResponse, Plan, PlanName, PreconfiguredAlertData, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDeleteDataSourceRequest, RegionalApiDeleteTokenRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiGetAlertManagerRequest, RegionalApiGetConfigRequest, RegionalApiGetDataSourceRequest, RegionalApiGetTokenRequest, RegionalApiGetUsageOverviewRequest, RegionalApiListAlertsRequest, RegionalApiListContactPointsRequest, RegionalApiListDataSourcesRequest, RegionalApiListTokensRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, Token, TokenScope, Usage, UsageOverview, UsageUnit, } from './types.gen';
4
+ export * as ValidationRules from './validation-rules.gen';
@@ -0,0 +1,44 @@
1
+ import { GlobalAPI, RegionalAPI } from "./api.gen.js";
2
+ import { marshalGlobalApiCreateGrafanaUserRequest, marshalGlobalApiResetGrafanaUserPasswordRequest, marshalGlobalApiSelectPlanRequest, marshalGlobalApiSyncGrafanaDataSourcesRequest, marshalRegionalApiCreateContactPointRequest, marshalRegionalApiCreateDataSourceRequest, marshalRegionalApiCreateTokenRequest, marshalRegionalApiDeleteContactPointRequest, marshalRegionalApiDisableAlertManagerRequest, marshalRegionalApiDisableAlertRulesRequest, marshalRegionalApiDisableManagedAlertsRequest, marshalRegionalApiEnableAlertManagerRequest, marshalRegionalApiEnableAlertRulesRequest, marshalRegionalApiEnableManagedAlertsRequest, marshalRegionalApiTriggerTestAlertRequest, marshalRegionalApiUpdateContactPointRequest, marshalRegionalApiUpdateDataSourceRequest, unmarshalAlertManager, unmarshalContactPoint, unmarshalDataSource, unmarshalDisableAlertRulesResponse, unmarshalEnableAlertRulesResponse, unmarshalGetConfigResponse, unmarshalGrafana, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListAlertsResponse, unmarshalListContactPointsResponse, unmarshalListDataSourcesResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalPlan, unmarshalToken, unmarshalUsageOverview } from "./marshalling.gen.js";
3
+ import * as validationRules_gen from "./validation-rules.gen.js";
4
+ export {
5
+ GlobalAPI,
6
+ RegionalAPI,
7
+ validationRules_gen as ValidationRules,
8
+ marshalGlobalApiCreateGrafanaUserRequest,
9
+ marshalGlobalApiResetGrafanaUserPasswordRequest,
10
+ marshalGlobalApiSelectPlanRequest,
11
+ marshalGlobalApiSyncGrafanaDataSourcesRequest,
12
+ marshalRegionalApiCreateContactPointRequest,
13
+ marshalRegionalApiCreateDataSourceRequest,
14
+ marshalRegionalApiCreateTokenRequest,
15
+ marshalRegionalApiDeleteContactPointRequest,
16
+ marshalRegionalApiDisableAlertManagerRequest,
17
+ marshalRegionalApiDisableAlertRulesRequest,
18
+ marshalRegionalApiDisableManagedAlertsRequest,
19
+ marshalRegionalApiEnableAlertManagerRequest,
20
+ marshalRegionalApiEnableAlertRulesRequest,
21
+ marshalRegionalApiEnableManagedAlertsRequest,
22
+ marshalRegionalApiTriggerTestAlertRequest,
23
+ marshalRegionalApiUpdateContactPointRequest,
24
+ marshalRegionalApiUpdateDataSourceRequest,
25
+ unmarshalAlertManager,
26
+ unmarshalContactPoint,
27
+ unmarshalDataSource,
28
+ unmarshalDisableAlertRulesResponse,
29
+ unmarshalEnableAlertRulesResponse,
30
+ unmarshalGetConfigResponse,
31
+ unmarshalGrafana,
32
+ unmarshalGrafanaProductDashboard,
33
+ unmarshalGrafanaUser,
34
+ unmarshalListAlertsResponse,
35
+ unmarshalListContactPointsResponse,
36
+ unmarshalListDataSourcesResponse,
37
+ unmarshalListGrafanaProductDashboardsResponse,
38
+ unmarshalListGrafanaUsersResponse,
39
+ unmarshalListPlansResponse,
40
+ unmarshalListTokensResponse,
41
+ unmarshalPlan,
42
+ unmarshalToken,
43
+ unmarshalUsageOverview
44
+ };
@@ -0,0 +1,445 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const sdkClient = require("@scaleway/sdk-client");
4
+ const unmarshalContactPointEmail = (data) => {
5
+ if (!sdkClient.isJSONObject(data)) {
6
+ throw new TypeError(
7
+ `Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`
8
+ );
9
+ }
10
+ return {
11
+ to: data.to
12
+ };
13
+ };
14
+ const unmarshalContactPoint = (data) => {
15
+ if (!sdkClient.isJSONObject(data)) {
16
+ throw new TypeError(
17
+ `Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`
18
+ );
19
+ }
20
+ return {
21
+ email: data.email ? unmarshalContactPointEmail(data.email) : void 0,
22
+ region: data.region,
23
+ sendResolvedNotifications: data.send_resolved_notifications
24
+ };
25
+ };
26
+ const unmarshalDataSource = (data) => {
27
+ if (!sdkClient.isJSONObject(data)) {
28
+ throw new TypeError(
29
+ `Unmarshalling the type 'DataSource' failed as data isn't a dictionary.`
30
+ );
31
+ }
32
+ return {
33
+ createdAt: sdkClient.unmarshalDate(data.created_at),
34
+ id: data.id,
35
+ name: data.name,
36
+ origin: data.origin,
37
+ projectId: data.project_id,
38
+ region: data.region,
39
+ retentionDays: data.retention_days,
40
+ synchronizedWithGrafana: data.synchronized_with_grafana,
41
+ type: data.type,
42
+ updatedAt: sdkClient.unmarshalDate(data.updated_at),
43
+ url: data.url
44
+ };
45
+ };
46
+ const unmarshalGrafanaProductDashboard = (data) => {
47
+ if (!sdkClient.isJSONObject(data)) {
48
+ throw new TypeError(
49
+ `Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`
50
+ );
51
+ }
52
+ return {
53
+ name: data.name,
54
+ tags: data.tags,
55
+ title: data.title,
56
+ url: data.url,
57
+ variables: data.variables
58
+ };
59
+ };
60
+ const unmarshalGrafanaUser = (data) => {
61
+ if (!sdkClient.isJSONObject(data)) {
62
+ throw new TypeError(
63
+ `Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`
64
+ );
65
+ }
66
+ return {
67
+ id: data.id,
68
+ login: data.login,
69
+ password: data.password,
70
+ role: data.role
71
+ };
72
+ };
73
+ const unmarshalPlan = (data) => {
74
+ if (!sdkClient.isJSONObject(data)) {
75
+ throw new TypeError(
76
+ `Unmarshalling the type 'Plan' failed as data isn't a dictionary.`
77
+ );
78
+ }
79
+ return {
80
+ logsIngestionPrice: data.logs_ingestion_price,
81
+ monthlyPrice: data.monthly_price,
82
+ name: data.name,
83
+ retentionLogsInterval: data.retention_logs_interval,
84
+ retentionMetricsInterval: data.retention_metrics_interval,
85
+ retentionTracesInterval: data.retention_traces_interval,
86
+ sampleIngestionPrice: data.sample_ingestion_price,
87
+ tracesIngestionPrice: data.traces_ingestion_price
88
+ };
89
+ };
90
+ const unmarshalToken = (data) => {
91
+ if (!sdkClient.isJSONObject(data)) {
92
+ throw new TypeError(
93
+ `Unmarshalling the type 'Token' failed as data isn't a dictionary.`
94
+ );
95
+ }
96
+ return {
97
+ createdAt: sdkClient.unmarshalDate(data.created_at),
98
+ id: data.id,
99
+ name: data.name,
100
+ projectId: data.project_id,
101
+ region: data.region,
102
+ scopes: data.scopes,
103
+ secretKey: data.secret_key,
104
+ updatedAt: sdkClient.unmarshalDate(data.updated_at)
105
+ };
106
+ };
107
+ const unmarshalAlertManager = (data) => {
108
+ if (!sdkClient.isJSONObject(data)) {
109
+ throw new TypeError(
110
+ `Unmarshalling the type 'AlertManager' failed as data isn't a dictionary.`
111
+ );
112
+ }
113
+ return {
114
+ alertManagerEnabled: data.alert_manager_enabled,
115
+ alertManagerUrl: data.alert_manager_url,
116
+ managedAlertsEnabled: data.managed_alerts_enabled,
117
+ region: data.region
118
+ };
119
+ };
120
+ const unmarshalDisableAlertRulesResponse = (data) => {
121
+ if (!sdkClient.isJSONObject(data)) {
122
+ throw new TypeError(
123
+ `Unmarshalling the type 'DisableAlertRulesResponse' failed as data isn't a dictionary.`
124
+ );
125
+ }
126
+ return {
127
+ disabledRuleIds: data.disabled_rule_ids
128
+ };
129
+ };
130
+ const unmarshalEnableAlertRulesResponse = (data) => {
131
+ if (!sdkClient.isJSONObject(data)) {
132
+ throw new TypeError(
133
+ `Unmarshalling the type 'EnableAlertRulesResponse' failed as data isn't a dictionary.`
134
+ );
135
+ }
136
+ return {
137
+ enabledRuleIds: data.enabled_rule_ids
138
+ };
139
+ };
140
+ const unmarshalGetConfigResponseRetention = (data) => {
141
+ if (!sdkClient.isJSONObject(data)) {
142
+ throw new TypeError(
143
+ `Unmarshalling the type 'GetConfigResponseRetention' failed as data isn't a dictionary.`
144
+ );
145
+ }
146
+ return {
147
+ defaultDays: data.default_days,
148
+ maxDays: data.max_days,
149
+ minDays: data.min_days
150
+ };
151
+ };
152
+ const unmarshalGetConfigResponse = (data) => {
153
+ if (!sdkClient.isJSONObject(data)) {
154
+ throw new TypeError(
155
+ `Unmarshalling the type 'GetConfigResponse' failed as data isn't a dictionary.`
156
+ );
157
+ }
158
+ return {
159
+ customLogsRetention: data.custom_logs_retention ? unmarshalGetConfigResponseRetention(data.custom_logs_retention) : void 0,
160
+ customMetricsRetention: data.custom_metrics_retention ? unmarshalGetConfigResponseRetention(data.custom_metrics_retention) : void 0,
161
+ customTracesRetention: data.custom_traces_retention ? unmarshalGetConfigResponseRetention(data.custom_traces_retention) : void 0,
162
+ productLogsRetention: data.product_logs_retention ? unmarshalGetConfigResponseRetention(data.product_logs_retention) : void 0,
163
+ productMetricsRetention: data.product_metrics_retention ? unmarshalGetConfigResponseRetention(data.product_metrics_retention) : void 0
164
+ };
165
+ };
166
+ const unmarshalGrafana = (data) => {
167
+ if (!sdkClient.isJSONObject(data)) {
168
+ throw new TypeError(
169
+ `Unmarshalling the type 'Grafana' failed as data isn't a dictionary.`
170
+ );
171
+ }
172
+ return {
173
+ grafanaUrl: data.grafana_url
174
+ };
175
+ };
176
+ const unmarshalPreconfiguredAlertData = (data) => {
177
+ if (!sdkClient.isJSONObject(data)) {
178
+ throw new TypeError(
179
+ `Unmarshalling the type 'PreconfiguredAlertData' failed as data isn't a dictionary.`
180
+ );
181
+ }
182
+ return {
183
+ displayDescription: data.display_description,
184
+ displayName: data.display_name,
185
+ preconfiguredRuleId: data.preconfigured_rule_id
186
+ };
187
+ };
188
+ const unmarshalAlert = (data) => {
189
+ if (!sdkClient.isJSONObject(data)) {
190
+ throw new TypeError(
191
+ `Unmarshalling the type 'Alert' failed as data isn't a dictionary.`
192
+ );
193
+ }
194
+ return {
195
+ annotations: data.annotations,
196
+ duration: data.duration,
197
+ enabled: data.enabled,
198
+ name: data.name,
199
+ preconfigured: data.preconfigured,
200
+ preconfiguredData: data.preconfigured_data ? unmarshalPreconfiguredAlertData(data.preconfigured_data) : void 0,
201
+ region: data.region,
202
+ rule: data.rule,
203
+ state: data.state ? data.state : void 0
204
+ };
205
+ };
206
+ const unmarshalListAlertsResponse = (data) => {
207
+ if (!sdkClient.isJSONObject(data)) {
208
+ throw new TypeError(
209
+ `Unmarshalling the type 'ListAlertsResponse' failed as data isn't a dictionary.`
210
+ );
211
+ }
212
+ return {
213
+ alerts: sdkClient.unmarshalArrayOfObject(data.alerts, unmarshalAlert),
214
+ totalCount: data.total_count
215
+ };
216
+ };
217
+ const unmarshalListContactPointsResponse = (data) => {
218
+ if (!sdkClient.isJSONObject(data)) {
219
+ throw new TypeError(
220
+ `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`
221
+ );
222
+ }
223
+ return {
224
+ contactPoints: sdkClient.unmarshalArrayOfObject(
225
+ data.contact_points,
226
+ unmarshalContactPoint
227
+ ),
228
+ hasAdditionalContactPoints: data.has_additional_contact_points,
229
+ hasAdditionalReceivers: data.has_additional_receivers,
230
+ totalCount: data.total_count
231
+ };
232
+ };
233
+ const unmarshalListDataSourcesResponse = (data) => {
234
+ if (!sdkClient.isJSONObject(data)) {
235
+ throw new TypeError(
236
+ `Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.`
237
+ );
238
+ }
239
+ return {
240
+ dataSources: sdkClient.unmarshalArrayOfObject(data.data_sources, unmarshalDataSource),
241
+ totalCount: data.total_count
242
+ };
243
+ };
244
+ const unmarshalListGrafanaProductDashboardsResponse = (data) => {
245
+ if (!sdkClient.isJSONObject(data)) {
246
+ throw new TypeError(
247
+ `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`
248
+ );
249
+ }
250
+ return {
251
+ dashboards: sdkClient.unmarshalArrayOfObject(
252
+ data.dashboards,
253
+ unmarshalGrafanaProductDashboard
254
+ ),
255
+ totalCount: data.total_count
256
+ };
257
+ };
258
+ const unmarshalListGrafanaUsersResponse = (data) => {
259
+ if (!sdkClient.isJSONObject(data)) {
260
+ throw new TypeError(
261
+ `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`
262
+ );
263
+ }
264
+ return {
265
+ grafanaUsers: sdkClient.unmarshalArrayOfObject(
266
+ data.grafana_users,
267
+ unmarshalGrafanaUser
268
+ ),
269
+ totalCount: data.total_count
270
+ };
271
+ };
272
+ const unmarshalListPlansResponse = (data) => {
273
+ if (!sdkClient.isJSONObject(data)) {
274
+ throw new TypeError(
275
+ `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`
276
+ );
277
+ }
278
+ return {
279
+ plans: sdkClient.unmarshalArrayOfObject(data.plans, unmarshalPlan),
280
+ totalCount: data.total_count
281
+ };
282
+ };
283
+ const unmarshalListTokensResponse = (data) => {
284
+ if (!sdkClient.isJSONObject(data)) {
285
+ throw new TypeError(
286
+ `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`
287
+ );
288
+ }
289
+ return {
290
+ tokens: sdkClient.unmarshalArrayOfObject(data.tokens, unmarshalToken),
291
+ totalCount: data.total_count
292
+ };
293
+ };
294
+ const unmarshalUsage = (data) => {
295
+ if (!sdkClient.isJSONObject(data)) {
296
+ throw new TypeError(
297
+ `Unmarshalling the type 'Usage' failed as data isn't a dictionary.`
298
+ );
299
+ }
300
+ return {
301
+ dataSourceId: data.data_source_id,
302
+ dataSourceOrigin: data.data_source_origin,
303
+ dataSourceType: data.data_source_type,
304
+ interval: data.interval,
305
+ projectId: data.project_id,
306
+ quantityOverInterval: data.quantity_over_interval,
307
+ region: data.region,
308
+ unit: data.unit
309
+ };
310
+ };
311
+ const unmarshalUsageOverview = (data) => {
312
+ if (!sdkClient.isJSONObject(data)) {
313
+ throw new TypeError(
314
+ `Unmarshalling the type 'UsageOverview' failed as data isn't a dictionary.`
315
+ );
316
+ }
317
+ return {
318
+ externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : void 0,
319
+ externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : void 0,
320
+ externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : void 0,
321
+ scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : void 0,
322
+ scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : void 0
323
+ };
324
+ };
325
+ const marshalGlobalApiCreateGrafanaUserRequest = (request, defaults) => ({
326
+ login: request.login,
327
+ project_id: request.projectId ?? defaults.defaultProjectId,
328
+ role: request.role
329
+ });
330
+ const marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({
331
+ project_id: request.projectId ?? defaults.defaultProjectId
332
+ });
333
+ const marshalGlobalApiSelectPlanRequest = (request, defaults) => ({
334
+ plan_name: request.planName,
335
+ project_id: request.projectId ?? defaults.defaultProjectId
336
+ });
337
+ const marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({
338
+ project_id: request.projectId ?? defaults.defaultProjectId
339
+ });
340
+ const marshalContactPointEmail = (request, defaults) => ({
341
+ to: request.to
342
+ });
343
+ const marshalRegionalApiCreateContactPointRequest = (request, defaults) => ({
344
+ project_id: request.projectId ?? defaults.defaultProjectId,
345
+ send_resolved_notifications: request.sendResolvedNotifications,
346
+ ...sdkClient.resolveOneOf([
347
+ {
348
+ param: "email",
349
+ value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
350
+ }
351
+ ])
352
+ });
353
+ const marshalRegionalApiCreateDataSourceRequest = (request, defaults) => ({
354
+ name: request.name,
355
+ project_id: request.projectId ?? defaults.defaultProjectId,
356
+ retention_days: request.retentionDays,
357
+ type: request.type
358
+ });
359
+ const marshalRegionalApiCreateTokenRequest = (request, defaults) => ({
360
+ name: request.name,
361
+ project_id: request.projectId ?? defaults.defaultProjectId,
362
+ token_scopes: request.tokenScopes !== void 0 ? request.tokenScopes : void 0
363
+ });
364
+ const marshalRegionalApiDeleteContactPointRequest = (request, defaults) => ({
365
+ project_id: request.projectId ?? defaults.defaultProjectId,
366
+ ...sdkClient.resolveOneOf([
367
+ {
368
+ param: "email",
369
+ value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
370
+ }
371
+ ])
372
+ });
373
+ const marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({
374
+ project_id: request.projectId ?? defaults.defaultProjectId
375
+ });
376
+ const marshalRegionalApiDisableAlertRulesRequest = (request, defaults) => ({
377
+ project_id: request.projectId ?? defaults.defaultProjectId,
378
+ rule_ids: request.ruleIds
379
+ });
380
+ const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({
381
+ project_id: request.projectId ?? defaults.defaultProjectId
382
+ });
383
+ const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({
384
+ project_id: request.projectId ?? defaults.defaultProjectId
385
+ });
386
+ const marshalRegionalApiEnableAlertRulesRequest = (request, defaults) => ({
387
+ project_id: request.projectId ?? defaults.defaultProjectId,
388
+ rule_ids: request.ruleIds
389
+ });
390
+ const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({
391
+ project_id: request.projectId ?? defaults.defaultProjectId
392
+ });
393
+ const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({
394
+ project_id: request.projectId ?? defaults.defaultProjectId
395
+ });
396
+ const marshalRegionalApiUpdateContactPointRequest = (request, defaults) => ({
397
+ project_id: request.projectId ?? defaults.defaultProjectId,
398
+ send_resolved_notifications: request.sendResolvedNotifications,
399
+ ...sdkClient.resolveOneOf([
400
+ {
401
+ param: "email",
402
+ value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0
403
+ }
404
+ ])
405
+ });
406
+ const marshalRegionalApiUpdateDataSourceRequest = (request, defaults) => ({
407
+ name: request.name,
408
+ retention_days: request.retentionDays
409
+ });
410
+ exports.marshalGlobalApiCreateGrafanaUserRequest = marshalGlobalApiCreateGrafanaUserRequest;
411
+ exports.marshalGlobalApiResetGrafanaUserPasswordRequest = marshalGlobalApiResetGrafanaUserPasswordRequest;
412
+ exports.marshalGlobalApiSelectPlanRequest = marshalGlobalApiSelectPlanRequest;
413
+ exports.marshalGlobalApiSyncGrafanaDataSourcesRequest = marshalGlobalApiSyncGrafanaDataSourcesRequest;
414
+ exports.marshalRegionalApiCreateContactPointRequest = marshalRegionalApiCreateContactPointRequest;
415
+ exports.marshalRegionalApiCreateDataSourceRequest = marshalRegionalApiCreateDataSourceRequest;
416
+ exports.marshalRegionalApiCreateTokenRequest = marshalRegionalApiCreateTokenRequest;
417
+ exports.marshalRegionalApiDeleteContactPointRequest = marshalRegionalApiDeleteContactPointRequest;
418
+ exports.marshalRegionalApiDisableAlertManagerRequest = marshalRegionalApiDisableAlertManagerRequest;
419
+ exports.marshalRegionalApiDisableAlertRulesRequest = marshalRegionalApiDisableAlertRulesRequest;
420
+ exports.marshalRegionalApiDisableManagedAlertsRequest = marshalRegionalApiDisableManagedAlertsRequest;
421
+ exports.marshalRegionalApiEnableAlertManagerRequest = marshalRegionalApiEnableAlertManagerRequest;
422
+ exports.marshalRegionalApiEnableAlertRulesRequest = marshalRegionalApiEnableAlertRulesRequest;
423
+ exports.marshalRegionalApiEnableManagedAlertsRequest = marshalRegionalApiEnableManagedAlertsRequest;
424
+ exports.marshalRegionalApiTriggerTestAlertRequest = marshalRegionalApiTriggerTestAlertRequest;
425
+ exports.marshalRegionalApiUpdateContactPointRequest = marshalRegionalApiUpdateContactPointRequest;
426
+ exports.marshalRegionalApiUpdateDataSourceRequest = marshalRegionalApiUpdateDataSourceRequest;
427
+ exports.unmarshalAlertManager = unmarshalAlertManager;
428
+ exports.unmarshalContactPoint = unmarshalContactPoint;
429
+ exports.unmarshalDataSource = unmarshalDataSource;
430
+ exports.unmarshalDisableAlertRulesResponse = unmarshalDisableAlertRulesResponse;
431
+ exports.unmarshalEnableAlertRulesResponse = unmarshalEnableAlertRulesResponse;
432
+ exports.unmarshalGetConfigResponse = unmarshalGetConfigResponse;
433
+ exports.unmarshalGrafana = unmarshalGrafana;
434
+ exports.unmarshalGrafanaProductDashboard = unmarshalGrafanaProductDashboard;
435
+ exports.unmarshalGrafanaUser = unmarshalGrafanaUser;
436
+ exports.unmarshalListAlertsResponse = unmarshalListAlertsResponse;
437
+ exports.unmarshalListContactPointsResponse = unmarshalListContactPointsResponse;
438
+ exports.unmarshalListDataSourcesResponse = unmarshalListDataSourcesResponse;
439
+ exports.unmarshalListGrafanaProductDashboardsResponse = unmarshalListGrafanaProductDashboardsResponse;
440
+ exports.unmarshalListGrafanaUsersResponse = unmarshalListGrafanaUsersResponse;
441
+ exports.unmarshalListPlansResponse = unmarshalListPlansResponse;
442
+ exports.unmarshalListTokensResponse = unmarshalListTokensResponse;
443
+ exports.unmarshalPlan = unmarshalPlan;
444
+ exports.unmarshalToken = unmarshalToken;
445
+ exports.unmarshalUsageOverview = unmarshalUsageOverview;
@@ -0,0 +1,38 @@
1
+ import type { DefaultValues } from '@scaleway/sdk-client';
2
+ import type { AlertManager, ContactPoint, DataSource, DisableAlertRulesResponse, EnableAlertRulesResponse, GetConfigResponse, GlobalApiCreateGrafanaUserRequest, GlobalApiResetGrafanaUserPasswordRequest, GlobalApiSelectPlanRequest, GlobalApiSyncGrafanaDataSourcesRequest, Grafana, GrafanaProductDashboard, GrafanaUser, ListAlertsResponse, ListContactPointsResponse, ListDataSourcesResponse, ListGrafanaProductDashboardsResponse, ListGrafanaUsersResponse, ListPlansResponse, ListTokensResponse, Plan, RegionalApiCreateContactPointRequest, RegionalApiCreateDataSourceRequest, RegionalApiCreateTokenRequest, RegionalApiDeleteContactPointRequest, RegionalApiDisableAlertManagerRequest, RegionalApiDisableAlertRulesRequest, RegionalApiDisableManagedAlertsRequest, RegionalApiEnableAlertManagerRequest, RegionalApiEnableAlertRulesRequest, RegionalApiEnableManagedAlertsRequest, RegionalApiTriggerTestAlertRequest, RegionalApiUpdateContactPointRequest, RegionalApiUpdateDataSourceRequest, Token, UsageOverview } from './types.gen';
3
+ export declare const unmarshalContactPoint: (data: unknown) => ContactPoint;
4
+ export declare const unmarshalDataSource: (data: unknown) => DataSource;
5
+ export declare const unmarshalGrafanaProductDashboard: (data: unknown) => GrafanaProductDashboard;
6
+ export declare const unmarshalGrafanaUser: (data: unknown) => GrafanaUser;
7
+ export declare const unmarshalPlan: (data: unknown) => Plan;
8
+ export declare const unmarshalToken: (data: unknown) => Token;
9
+ export declare const unmarshalAlertManager: (data: unknown) => AlertManager;
10
+ export declare const unmarshalDisableAlertRulesResponse: (data: unknown) => DisableAlertRulesResponse;
11
+ export declare const unmarshalEnableAlertRulesResponse: (data: unknown) => EnableAlertRulesResponse;
12
+ export declare const unmarshalGetConfigResponse: (data: unknown) => GetConfigResponse;
13
+ export declare const unmarshalGrafana: (data: unknown) => Grafana;
14
+ export declare const unmarshalListAlertsResponse: (data: unknown) => ListAlertsResponse;
15
+ export declare const unmarshalListContactPointsResponse: (data: unknown) => ListContactPointsResponse;
16
+ export declare const unmarshalListDataSourcesResponse: (data: unknown) => ListDataSourcesResponse;
17
+ export declare const unmarshalListGrafanaProductDashboardsResponse: (data: unknown) => ListGrafanaProductDashboardsResponse;
18
+ export declare const unmarshalListGrafanaUsersResponse: (data: unknown) => ListGrafanaUsersResponse;
19
+ export declare const unmarshalListPlansResponse: (data: unknown) => ListPlansResponse;
20
+ export declare const unmarshalListTokensResponse: (data: unknown) => ListTokensResponse;
21
+ export declare const unmarshalUsageOverview: (data: unknown) => UsageOverview;
22
+ export declare const marshalGlobalApiCreateGrafanaUserRequest: (request: GlobalApiCreateGrafanaUserRequest, defaults: DefaultValues) => Record<string, unknown>;
23
+ export declare const marshalGlobalApiResetGrafanaUserPasswordRequest: (request: GlobalApiResetGrafanaUserPasswordRequest, defaults: DefaultValues) => Record<string, unknown>;
24
+ export declare const marshalGlobalApiSelectPlanRequest: (request: GlobalApiSelectPlanRequest, defaults: DefaultValues) => Record<string, unknown>;
25
+ export declare const marshalGlobalApiSyncGrafanaDataSourcesRequest: (request: GlobalApiSyncGrafanaDataSourcesRequest, defaults: DefaultValues) => Record<string, unknown>;
26
+ export declare const marshalRegionalApiCreateContactPointRequest: (request: RegionalApiCreateContactPointRequest, defaults: DefaultValues) => Record<string, unknown>;
27
+ export declare const marshalRegionalApiCreateDataSourceRequest: (request: RegionalApiCreateDataSourceRequest, defaults: DefaultValues) => Record<string, unknown>;
28
+ export declare const marshalRegionalApiCreateTokenRequest: (request: RegionalApiCreateTokenRequest, defaults: DefaultValues) => Record<string, unknown>;
29
+ export declare const marshalRegionalApiDeleteContactPointRequest: (request: RegionalApiDeleteContactPointRequest, defaults: DefaultValues) => Record<string, unknown>;
30
+ export declare const marshalRegionalApiDisableAlertManagerRequest: (request: RegionalApiDisableAlertManagerRequest, defaults: DefaultValues) => Record<string, unknown>;
31
+ export declare const marshalRegionalApiDisableAlertRulesRequest: (request: RegionalApiDisableAlertRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
32
+ export declare const marshalRegionalApiDisableManagedAlertsRequest: (request: RegionalApiDisableManagedAlertsRequest, defaults: DefaultValues) => Record<string, unknown>;
33
+ export declare const marshalRegionalApiEnableAlertManagerRequest: (request: RegionalApiEnableAlertManagerRequest, defaults: DefaultValues) => Record<string, unknown>;
34
+ export declare const marshalRegionalApiEnableAlertRulesRequest: (request: RegionalApiEnableAlertRulesRequest, defaults: DefaultValues) => Record<string, unknown>;
35
+ export declare const marshalRegionalApiEnableManagedAlertsRequest: (request: RegionalApiEnableManagedAlertsRequest, defaults: DefaultValues) => Record<string, unknown>;
36
+ export declare const marshalRegionalApiTriggerTestAlertRequest: (request: RegionalApiTriggerTestAlertRequest, defaults: DefaultValues) => Record<string, unknown>;
37
+ export declare const marshalRegionalApiUpdateContactPointRequest: (request: RegionalApiUpdateContactPointRequest, defaults: DefaultValues) => Record<string, unknown>;
38
+ export declare const marshalRegionalApiUpdateDataSourceRequest: (request: RegionalApiUpdateDataSourceRequest, defaults: DefaultValues) => Record<string, unknown>;