@scaleway/sdk 2.0.0-alpha.13 → 2.0.0-alpha.14
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/dist/api/account/index.js +4 -0
- package/dist/api/account/v2/api.gen.js +147 -0
- package/dist/api/account/v2/index.gen.js +4 -0
- package/dist/api/account/v2/marshalling.gen.js +39 -0
- package/dist/api/account/v3/api.gen.js +129 -0
- package/dist/api/account/v3/index.gen.js +6 -0
- package/dist/api/account/v3/marshalling.gen.js +39 -0
- package/dist/api/account/v3/validation-rules.gen.js +39 -0
- package/dist/api/applesilicon/index.js +2 -0
- package/dist/api/applesilicon/v1alpha1/api.gen.js +220 -0
- package/dist/api/applesilicon/v1alpha1/content.gen.js +7 -0
- package/dist/api/applesilicon/v1alpha1/index.gen.js +5 -0
- package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +113 -0
- package/dist/api/baremetal/index.js +2 -0
- package/dist/api/baremetal/v1/api.gen.js +523 -0
- package/dist/api/baremetal/v1/api.utils.js +27 -0
- package/dist/api/baremetal/v1/content.gen.js +13 -0
- package/dist/api/baremetal/v1/index.js +5 -0
- package/dist/api/baremetal/v1/marshalling.gen.js +406 -0
- package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
- package/dist/api/billing/index.js +2 -0
- package/dist/api/billing/v2alpha1/api.gen.js +80 -0
- package/dist/api/billing/v2alpha1/index.gen.js +4 -0
- package/dist/api/billing/v2alpha1/marshalling.gen.js +53 -0
- package/dist/api/block/index.js +2 -0
- package/dist/api/block/v1alpha1/api.gen.js +249 -0
- package/dist/api/block/v1alpha1/content.gen.js +13 -0
- package/dist/api/block/v1alpha1/index.gen.js +7 -0
- package/dist/api/block/v1alpha1/marshalling.gen.js +182 -0
- package/dist/api/block/v1alpha1/validation-rules.gen.js +52 -0
- package/dist/api/cockpit/index.js +2 -0
- package/dist/api/cockpit/v1beta1/api.gen.js +543 -0
- package/dist/api/cockpit/v1beta1/content.gen.js +7 -0
- package/dist/api/cockpit/v1beta1/index.gen.js +5 -0
- package/dist/api/cockpit/v1beta1/marshalling.gen.js +271 -0
- package/dist/api/container/index.js +2 -0
- package/dist/api/container/v1beta1/api.gen.js +549 -0
- package/dist/api/container/v1beta1/content.gen.js +22 -0
- package/dist/api/container/v1beta1/index.gen.js +7 -0
- package/dist/api/container/v1beta1/marshalling.gen.js +358 -0
- package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/document_db/index.js +2 -0
- package/dist/api/document_db/v1beta1/api.gen.js +830 -0
- package/dist/api/document_db/v1beta1/content.gen.js +19 -0
- package/dist/api/document_db/v1beta1/index.gen.js +7 -0
- package/dist/api/document_db/v1beta1/marshalling.gen.js +636 -0
- package/dist/api/document_db/v1beta1/validation-rules.gen.js +10 -0
- package/dist/api/domain/index.js +2 -0
- package/dist/api/domain/v2beta1/api.gen.js +867 -0
- package/dist/api/domain/v2beta1/content.gen.js +28 -0
- package/dist/api/domain/v2beta1/index.gen.js +5 -0
- package/dist/api/domain/v2beta1/marshalling.gen.js +1172 -0
- package/dist/api/flexibleip/index.js +2 -0
- package/dist/api/flexibleip/v1alpha1/api.gen.js +195 -0
- package/dist/api/flexibleip/v1alpha1/content.gen.js +10 -0
- package/dist/api/flexibleip/v1alpha1/index.gen.js +7 -0
- package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +97 -0
- package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/function/index.js +2 -0
- package/dist/api/function/v1beta1/api.gen.js +560 -0
- package/dist/api/function/v1beta1/content.gen.js +22 -0
- package/dist/api/function/v1beta1/index.gen.js +7 -0
- package/dist/api/function/v1beta1/marshalling.gen.js +396 -0
- package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
- package/dist/api/iam/index.js +2 -0
- package/dist/api/iam/v1alpha1/api.gen.js +783 -0
- package/dist/api/iam/v1alpha1/index.gen.js +6 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +384 -0
- package/dist/api/iam/v1alpha1/validation-rules.gen.js +207 -0
- package/dist/api/instance/index.js +2 -0
- package/dist/api/instance/v1/api.gen.js +1003 -0
- package/dist/api/instance/v1/api.utils.js +369 -0
- package/dist/api/instance/v1/content.gen.js +31 -0
- package/dist/api/instance/v1/index.js +2 -0
- package/dist/api/instance/v1/marshalling.gen.js +1415 -0
- package/dist/api/instance/v1/marshalling.utils.js +63 -0
- package/dist/api/iot/index.js +2 -0
- package/dist/api/iot/v1/api.gen.js +573 -0
- package/dist/api/iot/v1/content.gen.js +7 -0
- package/dist/api/iot/v1/index.gen.js +5 -0
- package/dist/api/iot/v1/marshalling.gen.js +439 -0
- package/dist/api/ipam/index.js +2 -0
- package/dist/api/ipam/v1/api.gen.js +113 -0
- package/dist/api/ipam/v1/index.gen.js +6 -0
- package/dist/api/ipam/v1/marshalling.gen.js +77 -0
- package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
- package/dist/api/ipfs/index.js +2 -0
- package/dist/api/ipfs/v1alpha1/api.gen.js +314 -0
- package/dist/api/ipfs/v1alpha1/content.gen.js +10 -0
- package/dist/api/ipfs/v1alpha1/index.gen.js +5 -0
- package/dist/api/ipfs/v1alpha1/marshalling.gen.js +180 -0
- package/dist/api/k8s/index.js +2 -0
- package/dist/api/k8s/v1/api.gen.js +454 -0
- package/dist/api/k8s/v1/api.utils.js +13 -0
- package/dist/api/k8s/v1/content.gen.js +13 -0
- package/dist/api/k8s/v1/index.js +4 -0
- package/dist/api/k8s/v1/marshalling.gen.js +421 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +101 -0
- package/dist/api/lb/index.js +2 -0
- package/dist/api/lb/v1/api.gen.js +1669 -0
- package/dist/api/lb/v1/api.utils.js +81 -0
- package/dist/api/lb/v1/content.gen.js +16 -0
- package/dist/api/lb/v1/index.js +2 -0
- package/dist/api/lb/v1/marshalling.gen.js +1039 -0
- package/dist/api/marketplace/index.js +4 -0
- package/dist/api/marketplace/v1/api.gen.js +60 -0
- package/dist/api/marketplace/v1/index.gen.js +4 -0
- package/dist/api/marketplace/v1/marshalling.gen.js +92 -0
- package/dist/api/marketplace/v2/api.gen.js +162 -0
- package/dist/api/marketplace/v2/index.gen.js +4 -0
- package/dist/api/marketplace/v2/marshalling.gen.js +94 -0
- package/dist/api/mnq/index.js +4 -0
- package/dist/api/mnq/v1alpha1/api.gen.js +197 -0
- package/dist/api/mnq/v1alpha1/index.gen.js +4 -0
- package/dist/api/mnq/v1alpha1/marshalling.gen.js +126 -0
- package/dist/api/mnq/v1beta1/api.gen.js +529 -0
- package/dist/api/mnq/v1beta1/index.gen.js +6 -0
- package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
- package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
- package/dist/api/rdb/index.js +2 -0
- package/dist/api/rdb/v1/api.gen.js +972 -0
- package/dist/api/rdb/v1/content.gen.js +22 -0
- package/dist/api/rdb/v1/index.gen.js +7 -0
- package/dist/api/rdb/v1/marshalling.gen.js +694 -0
- package/dist/api/rdb/v1/validation-rules.gen.js +10 -0
- package/dist/api/redis/index.js +2 -0
- package/dist/api/redis/v1/api.gen.js +389 -0
- package/dist/api/redis/v1/content.gen.js +7 -0
- package/dist/api/redis/v1/index.gen.js +5 -0
- package/dist/api/redis/v1/marshalling.gen.js +283 -0
- package/dist/api/registry/index.js +2 -0
- package/dist/api/registry/v1/api.gen.js +252 -0
- package/dist/api/registry/v1/content.gen.js +13 -0
- package/dist/api/registry/v1/index.gen.js +5 -0
- package/dist/api/registry/v1/marshalling.gen.js +108 -0
- package/dist/api/secret/index.js +2 -0
- package/dist/api/secret/v1alpha1/api.gen.js +415 -0
- package/dist/api/secret/v1alpha1/index.gen.js +4 -0
- package/dist/api/secret/v1alpha1/marshalling.gen.js +150 -0
- package/dist/api/tem/index.js +2 -0
- package/dist/api/tem/v1alpha1/api.gen.js +229 -0
- package/dist/api/tem/v1alpha1/content.gen.js +10 -0
- package/dist/api/tem/v1alpha1/index.gen.js +5 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.js +168 -0
- package/dist/api/test/index.js +2 -0
- package/dist/api/test/v1/api.gen.js +152 -0
- package/dist/api/test/v1/content.gen.js +7 -0
- package/dist/api/test/v1/index.gen.js +5 -0
- package/dist/api/test/v1/marshalling.gen.js +81 -0
- package/dist/api/vpc/index.js +4 -0
- package/dist/api/vpc/v1/api.gen.js +110 -0
- package/dist/api/vpc/v1/index.gen.js +4 -0
- package/dist/api/vpc/v1/marshalling.gen.js +44 -0
- package/dist/api/vpc/v2/api.gen.js +276 -0
- package/dist/api/vpc/v2/index.gen.js +4 -0
- package/dist/api/vpc/v2/marshalling.gen.js +137 -0
- package/dist/api/vpcgw/index.js +2 -0
- package/dist/api/vpcgw/v1/api.gen.js +669 -0
- package/dist/api/vpcgw/v1/content.gen.js +10 -0
- package/dist/api/vpcgw/v1/index.gen.js +5 -0
- package/dist/api/vpcgw/v1/marshalling.gen.js +359 -0
- package/dist/api/webhosting/index.js +2 -0
- package/dist/api/webhosting/v1alpha1/api.gen.js +158 -0
- package/dist/api/webhosting/v1alpha1/content.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/index.gen.js +7 -0
- package/dist/api/webhosting/v1alpha1/marshalling.gen.js +146 -0
- package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/helpers/is-browser.js +5 -0
- package/dist/helpers/is-response.js +10 -0
- package/dist/helpers/json.js +11 -0
- package/dist/helpers/marshalling.js +130 -0
- package/dist/index.cjs +26484 -0
- package/dist/index.d.ts +31184 -0
- package/dist/index.js +71 -0
- package/dist/internal/async/interval-retrier.js +105 -0
- package/dist/internal/async/sleep.js +13 -0
- package/dist/internal/interceptors/composer.js +46 -0
- package/dist/internal/interceptors/helpers.js +32 -0
- package/dist/internal/logger/console-logger.js +38 -0
- package/dist/internal/logger/index.js +41 -0
- package/dist/internal/logger/level-resolver.js +13 -0
- package/dist/internal/validations/string-validation.js +38 -0
- package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js +13 -0
- package/dist/scw/api.js +12 -0
- package/dist/scw/auth.js +68 -0
- package/dist/scw/client-ini-factory.js +174 -0
- package/dist/scw/client-ini-profile.js +54 -0
- package/dist/scw/client-settings.js +78 -0
- package/dist/scw/client.js +98 -0
- package/dist/scw/constants.js +4 -0
- package/dist/scw/custom-marshalling.js +131 -0
- package/dist/scw/errors/error-parser.js +107 -0
- package/dist/scw/errors/non-standard/invalid-request-mapper.js +36 -0
- package/dist/scw/errors/non-standard/unknown-resource-mapper.js +27 -0
- package/dist/scw/errors/scw-error.js +66 -0
- package/dist/scw/errors/standard/already-exists-error.js +26 -0
- package/dist/scw/errors/standard/denied-authentication-error.js +52 -0
- package/dist/scw/errors/standard/index.js +13 -0
- package/dist/scw/errors/standard/invalid-arguments-error.js +67 -0
- package/dist/scw/errors/standard/out-of-stock-error.js +22 -0
- package/dist/scw/errors/standard/permissions-denied-error.js +48 -0
- package/dist/scw/errors/standard/precondition-failed-error.js +42 -0
- package/dist/scw/errors/standard/quotas-exceeded-error.js +68 -0
- package/dist/scw/errors/standard/resource-expired-error.js +26 -0
- package/dist/scw/errors/standard/resource-locked-error.js +25 -0
- package/dist/scw/errors/standard/resource-not-found-error.js +25 -0
- package/dist/scw/errors/standard/too-many-requests-error.js +70 -0
- package/dist/scw/errors/standard/transient-state-error.js +26 -0
- package/dist/scw/errors/types.js +23 -0
- package/dist/scw/fetch/build-fetcher.js +72 -0
- package/dist/scw/fetch/http-dumper.js +54 -0
- package/dist/scw/fetch/http-interceptors.js +99 -0
- package/dist/scw/fetch/resource-paginator.js +84 -0
- package/dist/scw/fetch/response-parser.js +72 -0
- package/package.json +2 -2
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
|
|
2
|
+
import { isJSONObject } from '../../../helpers/json.js';
|
|
3
|
+
import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
|
|
4
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
|
|
5
|
+
|
|
6
|
+
// This file was automatically generated. DO NOT EDIT.
|
|
7
|
+
// If you have any remark or suggestion do not hesitate to open an issue.
|
|
8
|
+
const unmarshalContactPointEmail = data => {
|
|
9
|
+
if (!isJSONObject(data)) {
|
|
10
|
+
throw new TypeError(`Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`);
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
to: data.to
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const unmarshalContactPoint = data => {
|
|
17
|
+
if (!isJSONObject(data)) {
|
|
18
|
+
throw new TypeError(`Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
email: data.email ? unmarshalContactPointEmail(data.email) : undefined
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const unmarshalDatasource = data => {
|
|
25
|
+
if (!isJSONObject(data)) {
|
|
26
|
+
throw new TypeError(`Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
id: data.id,
|
|
30
|
+
name: data.name,
|
|
31
|
+
projectId: data.project_id,
|
|
32
|
+
type: data.type,
|
|
33
|
+
url: data.url
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const unmarshalGrafanaProductDashboard = data => {
|
|
37
|
+
if (!isJSONObject(data)) {
|
|
38
|
+
throw new TypeError(`Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`);
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
dashboardName: data.dashboard_name,
|
|
42
|
+
tags: data.tags,
|
|
43
|
+
title: data.title,
|
|
44
|
+
url: data.url,
|
|
45
|
+
variables: data.variables
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
const unmarshalGrafanaUser = data => {
|
|
49
|
+
if (!isJSONObject(data)) {
|
|
50
|
+
throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
id: data.id,
|
|
54
|
+
login: data.login,
|
|
55
|
+
password: data.password,
|
|
56
|
+
role: data.role
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const unmarshalTokenScopes = data => {
|
|
60
|
+
if (!isJSONObject(data)) {
|
|
61
|
+
throw new TypeError(`Unmarshalling the type 'TokenScopes' failed as data isn't a dictionary.`);
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
queryLogs: data.query_logs,
|
|
65
|
+
queryMetrics: data.query_metrics,
|
|
66
|
+
queryTraces: data.query_traces,
|
|
67
|
+
setupAlerts: data.setup_alerts,
|
|
68
|
+
setupLogsRules: data.setup_logs_rules,
|
|
69
|
+
setupMetricsRules: data.setup_metrics_rules,
|
|
70
|
+
writeLogs: data.write_logs,
|
|
71
|
+
writeMetrics: data.write_metrics,
|
|
72
|
+
writeTraces: data.write_traces
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const unmarshalToken = data => {
|
|
76
|
+
if (!isJSONObject(data)) {
|
|
77
|
+
throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
createdAt: unmarshalDate(data.created_at),
|
|
81
|
+
id: data.id,
|
|
82
|
+
name: data.name,
|
|
83
|
+
projectId: data.project_id,
|
|
84
|
+
scopes: data.scopes ? unmarshalTokenScopes(data.scopes) : undefined,
|
|
85
|
+
secretKey: data.secret_key,
|
|
86
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const unmarshalCockpitEndpoints = data => {
|
|
90
|
+
if (!isJSONObject(data)) {
|
|
91
|
+
throw new TypeError(`Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
alertmanagerUrl: data.alertmanager_url,
|
|
95
|
+
grafanaUrl: data.grafana_url,
|
|
96
|
+
logsUrl: data.logs_url,
|
|
97
|
+
metricsUrl: data.metrics_url,
|
|
98
|
+
tracesUrl: data.traces_url
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
const unmarshalPlan = data => {
|
|
102
|
+
if (!isJSONObject(data)) {
|
|
103
|
+
throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
id: data.id,
|
|
107
|
+
logsIngestionPrice: data.logs_ingestion_price,
|
|
108
|
+
name: data.name,
|
|
109
|
+
retentionLogsInterval: data.retention_logs_interval,
|
|
110
|
+
retentionMetricsInterval: data.retention_metrics_interval,
|
|
111
|
+
retentionPrice: data.retention_price,
|
|
112
|
+
sampleIngestionPrice: data.sample_ingestion_price
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
const unmarshalCockpit = data => {
|
|
116
|
+
if (!isJSONObject(data)) {
|
|
117
|
+
throw new TypeError(`Unmarshalling the type 'Cockpit' failed as data isn't a dictionary.`);
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
createdAt: unmarshalDate(data.created_at),
|
|
121
|
+
endpoints: data.endpoints ? unmarshalCockpitEndpoints(data.endpoints) : undefined,
|
|
122
|
+
managedAlertsEnabled: data.managed_alerts_enabled,
|
|
123
|
+
plan: data.plan ? unmarshalPlan(data.plan) : undefined,
|
|
124
|
+
projectId: data.project_id,
|
|
125
|
+
status: data.status,
|
|
126
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
const unmarshalCockpitMetrics = data => {
|
|
130
|
+
if (!isJSONObject(data)) {
|
|
131
|
+
throw new TypeError(`Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`);
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
const unmarshalListContactPointsResponse = data => {
|
|
138
|
+
if (!isJSONObject(data)) {
|
|
139
|
+
throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint),
|
|
143
|
+
hasAdditionalContactPoints: data.has_additional_contact_points,
|
|
144
|
+
hasAdditionalReceivers: data.has_additional_receivers,
|
|
145
|
+
totalCount: data.total_count
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
const unmarshalListDatasourcesResponse = data => {
|
|
149
|
+
if (!isJSONObject(data)) {
|
|
150
|
+
throw new TypeError(`Unmarshalling the type 'ListDatasourcesResponse' failed as data isn't a dictionary.`);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
datasources: unmarshalArrayOfObject(data.datasources, unmarshalDatasource),
|
|
154
|
+
totalCount: data.total_count
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const unmarshalListGrafanaProductDashboardsResponse = data => {
|
|
158
|
+
if (!isJSONObject(data)) {
|
|
159
|
+
throw new TypeError(`Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`);
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard),
|
|
163
|
+
totalCount: data.total_count
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
const unmarshalListGrafanaUsersResponse = data => {
|
|
167
|
+
if (!isJSONObject(data)) {
|
|
168
|
+
throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser),
|
|
172
|
+
totalCount: data.total_count
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
const unmarshalListPlansResponse = data => {
|
|
176
|
+
if (!isJSONObject(data)) {
|
|
177
|
+
throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),
|
|
181
|
+
totalCount: data.total_count
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
const unmarshalListTokensResponse = data => {
|
|
185
|
+
if (!isJSONObject(data)) {
|
|
186
|
+
throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
|
|
190
|
+
totalCount: data.total_count
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
const unmarshalSelectPlanResponse = data => {
|
|
194
|
+
if (!isJSONObject(data)) {
|
|
195
|
+
throw new TypeError(`Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.`);
|
|
196
|
+
}
|
|
197
|
+
return {};
|
|
198
|
+
};
|
|
199
|
+
const marshalActivateCockpitRequest = (request, defaults) => ({
|
|
200
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
201
|
+
});
|
|
202
|
+
const marshalContactPointEmail = (request, defaults) => ({
|
|
203
|
+
to: request.to
|
|
204
|
+
});
|
|
205
|
+
const marshalContactPoint = (request, defaults) => ({
|
|
206
|
+
...resolveOneOf([{
|
|
207
|
+
param: 'email',
|
|
208
|
+
value: request.email !== undefined ? marshalContactPointEmail(request.email) : undefined
|
|
209
|
+
}])
|
|
210
|
+
});
|
|
211
|
+
const marshalCreateContactPointRequest = (request, defaults) => ({
|
|
212
|
+
contact_point: request.contactPoint !== undefined ? marshalContactPoint(request.contactPoint) : undefined,
|
|
213
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
214
|
+
});
|
|
215
|
+
const marshalCreateDatasourceRequest = (request, defaults) => ({
|
|
216
|
+
name: request.name,
|
|
217
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
218
|
+
type: request.type
|
|
219
|
+
});
|
|
220
|
+
const marshalCreateGrafanaUserRequest = (request, defaults) => ({
|
|
221
|
+
login: request.login,
|
|
222
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
223
|
+
role: request.role
|
|
224
|
+
});
|
|
225
|
+
const marshalTokenScopes = (request, defaults) => ({
|
|
226
|
+
query_logs: request.queryLogs,
|
|
227
|
+
query_metrics: request.queryMetrics,
|
|
228
|
+
query_traces: request.queryTraces,
|
|
229
|
+
setup_alerts: request.setupAlerts,
|
|
230
|
+
setup_logs_rules: request.setupLogsRules,
|
|
231
|
+
setup_metrics_rules: request.setupMetricsRules,
|
|
232
|
+
write_logs: request.writeLogs,
|
|
233
|
+
write_metrics: request.writeMetrics,
|
|
234
|
+
write_traces: request.writeTraces
|
|
235
|
+
});
|
|
236
|
+
const marshalCreateTokenRequest = (request, defaults) => ({
|
|
237
|
+
name: request.name || randomName('token'),
|
|
238
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
239
|
+
scopes: request.scopes !== undefined ? marshalTokenScopes(request.scopes) : undefined
|
|
240
|
+
});
|
|
241
|
+
const marshalDeactivateCockpitRequest = (request, defaults) => ({
|
|
242
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
243
|
+
});
|
|
244
|
+
const marshalDeleteContactPointRequest = (request, defaults) => ({
|
|
245
|
+
contact_point: request.contactPoint !== undefined ? marshalContactPoint(request.contactPoint) : undefined,
|
|
246
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
247
|
+
});
|
|
248
|
+
const marshalDeleteGrafanaUserRequest = (request, defaults) => ({
|
|
249
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
250
|
+
});
|
|
251
|
+
const marshalDisableManagedAlertsRequest = (request, defaults) => ({
|
|
252
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
253
|
+
});
|
|
254
|
+
const marshalEnableManagedAlertsRequest = (request, defaults) => ({
|
|
255
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
256
|
+
});
|
|
257
|
+
const marshalResetCockpitGrafanaRequest = (request, defaults) => ({
|
|
258
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
259
|
+
});
|
|
260
|
+
const marshalResetGrafanaUserPasswordRequest = (request, defaults) => ({
|
|
261
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
262
|
+
});
|
|
263
|
+
const marshalSelectPlanRequest = (request, defaults) => ({
|
|
264
|
+
plan_id: request.planId,
|
|
265
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
266
|
+
});
|
|
267
|
+
const marshalTriggerTestAlertRequest = (request, defaults) => ({
|
|
268
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
export { marshalActivateCockpitRequest, marshalCreateContactPointRequest, marshalCreateDatasourceRequest, marshalCreateGrafanaUserRequest, marshalCreateTokenRequest, marshalDeactivateCockpitRequest, marshalDeleteContactPointRequest, marshalDeleteGrafanaUserRequest, marshalDisableManagedAlertsRequest, marshalEnableManagedAlertsRequest, marshalResetCockpitGrafanaRequest, marshalResetGrafanaUserPasswordRequest, marshalSelectPlanRequest, marshalTriggerTestAlertRequest, unmarshalCockpit, unmarshalCockpitMetrics, unmarshalContactPoint, unmarshalDatasource, unmarshalGrafanaProductDashboard, unmarshalGrafanaUser, unmarshalListContactPointsResponse, unmarshalListDatasourcesResponse, unmarshalListGrafanaProductDashboardsResponse, unmarshalListGrafanaUsersResponse, unmarshalListPlansResponse, unmarshalListTokensResponse, unmarshalSelectPlanResponse, unmarshalToken };
|