@scaleway/sdk-mongodb 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +3 -6
- package/dist/v1/api.gen.js +336 -506
- package/dist/v1/content.gen.js +12 -13
- package/dist/v1/index.gen.d.ts +1 -1
- package/dist/v1/index.gen.js +33 -31
- package/dist/v1/marshalling.gen.js +226 -368
- package/dist/v1/validation-rules.gen.js +162 -190
- package/dist/v1alpha1/api.gen.js +283 -419
- package/dist/v1alpha1/content.gen.js +11 -12
- package/dist/v1alpha1/index.gen.d.ts +1 -1
- package/dist/v1alpha1/index.gen.js +31 -29
- package/dist/v1alpha1/marshalling.gen.js +213 -334
- package/dist/v1alpha1/validation-rules.gen.js +135 -157
- package/package.json +4 -4
|
@@ -1,423 +1,281 @@
|
|
|
1
|
+
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
1
2
|
import randomName from "@scaleway/random-name";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
throw new TypeError(
|
|
6
|
-
`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
|
|
7
|
-
);
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
privateNetworkId: data.private_network_id
|
|
11
|
-
};
|
|
3
|
+
var unmarshalEndpointPrivateNetworkDetails = (data) => {
|
|
4
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
|
|
5
|
+
return { privateNetworkId: data.private_network_id };
|
|
12
6
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
return {};
|
|
7
|
+
var unmarshalEndpointPublicNetworkDetails = (data) => {
|
|
8
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`);
|
|
9
|
+
return {};
|
|
20
10
|
};
|
|
21
11
|
const unmarshalEndpoint = (data) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
port: data.port,
|
|
31
|
-
privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
|
|
32
|
-
publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : void 0
|
|
33
|
-
};
|
|
12
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
|
|
13
|
+
return {
|
|
14
|
+
dnsRecord: data.dns_record,
|
|
15
|
+
id: data.id,
|
|
16
|
+
port: data.port,
|
|
17
|
+
privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
|
|
18
|
+
publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : void 0
|
|
19
|
+
};
|
|
34
20
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
lastRun: unmarshalDate(data.last_run),
|
|
45
|
-
nextUpdate: unmarshalDate(data.next_update),
|
|
46
|
-
retentionDays: data.retention_days
|
|
47
|
-
};
|
|
21
|
+
var unmarshalInstanceSnapshotSchedule = (data) => {
|
|
22
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary.`);
|
|
23
|
+
return {
|
|
24
|
+
enabled: data.enabled,
|
|
25
|
+
frequencyHours: data.frequency_hours,
|
|
26
|
+
lastRun: unmarshalDate(data.last_run),
|
|
27
|
+
nextUpdate: unmarshalDate(data.next_update),
|
|
28
|
+
retentionDays: data.retention_days
|
|
29
|
+
};
|
|
48
30
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
sizeBytes: data.size_bytes,
|
|
57
|
-
type: data.type
|
|
58
|
-
};
|
|
31
|
+
var unmarshalVolume = (data) => {
|
|
32
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
|
|
33
|
+
return {
|
|
34
|
+
sizeBytes: data.size_bytes,
|
|
35
|
+
type: data.type
|
|
36
|
+
};
|
|
59
37
|
};
|
|
60
38
|
const unmarshalInstance = (data) => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
tags: data.tags,
|
|
79
|
-
version: data.version,
|
|
80
|
-
volume: data.volume ? unmarshalVolume(data.volume) : void 0
|
|
81
|
-
};
|
|
39
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
|
|
40
|
+
return {
|
|
41
|
+
createdAt: unmarshalDate(data.created_at),
|
|
42
|
+
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
|
|
43
|
+
id: data.id,
|
|
44
|
+
name: data.name,
|
|
45
|
+
nodeAmount: data.node_amount,
|
|
46
|
+
nodeType: data.node_type,
|
|
47
|
+
organizationId: data.organization_id,
|
|
48
|
+
projectId: data.project_id,
|
|
49
|
+
region: data.region,
|
|
50
|
+
snapshotSchedule: data.snapshot_schedule ? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule) : void 0,
|
|
51
|
+
status: data.status,
|
|
52
|
+
tags: data.tags,
|
|
53
|
+
version: data.version,
|
|
54
|
+
volume: data.volume ? unmarshalVolume(data.volume) : void 0
|
|
55
|
+
};
|
|
82
56
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`Unmarshalling the type 'EngineUpgrade' failed as data isn't a dictionary.`
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
return {
|
|
90
|
-
newVersionId: data.new_version_id
|
|
91
|
-
};
|
|
57
|
+
var unmarshalEngineUpgrade = (data) => {
|
|
58
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EngineUpgrade' failed as data isn't a dictionary.`);
|
|
59
|
+
return { newVersionId: data.new_version_id };
|
|
92
60
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
`Unmarshalling the type 'ServiceUpdate' failed as data isn't a dictionary.`
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
serviceName: data.service_name
|
|
101
|
-
};
|
|
61
|
+
var unmarshalServiceUpdate = (data) => {
|
|
62
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ServiceUpdate' failed as data isn't a dictionary.`);
|
|
63
|
+
return { serviceName: data.service_name };
|
|
102
64
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return {
|
|
110
|
-
engineUpgrade: data.engine_upgrade ? unmarshalEngineUpgrade(data.engine_upgrade) : void 0,
|
|
111
|
-
serviceUpdate: data.service_update ? unmarshalServiceUpdate(data.service_update) : void 0
|
|
112
|
-
};
|
|
65
|
+
var unmarshalWorkflow = (data) => {
|
|
66
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Workflow' failed as data isn't a dictionary.`);
|
|
67
|
+
return {
|
|
68
|
+
engineUpgrade: data.engine_upgrade ? unmarshalEngineUpgrade(data.engine_upgrade) : void 0,
|
|
69
|
+
serviceUpdate: data.service_update ? unmarshalServiceUpdate(data.service_update) : void 0
|
|
70
|
+
};
|
|
113
71
|
};
|
|
114
72
|
const unmarshalMaintenance = (data) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
status: data.status,
|
|
130
|
-
stopsAt: unmarshalDate(data.stops_at),
|
|
131
|
-
workflow: data.workflow ? unmarshalWorkflow(data.workflow) : void 0
|
|
132
|
-
};
|
|
73
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
|
|
74
|
+
return {
|
|
75
|
+
appliedAt: unmarshalDate(data.applied_at),
|
|
76
|
+
appliedBy: data.applied_by,
|
|
77
|
+
createdAt: unmarshalDate(data.created_at),
|
|
78
|
+
forcedAt: unmarshalDate(data.forced_at),
|
|
79
|
+
id: data.id,
|
|
80
|
+
instanceId: data.instance_id,
|
|
81
|
+
reason: data.reason,
|
|
82
|
+
startsAt: unmarshalDate(data.starts_at),
|
|
83
|
+
status: data.status,
|
|
84
|
+
stopsAt: unmarshalDate(data.stops_at),
|
|
85
|
+
workflow: data.workflow ? unmarshalWorkflow(data.workflow) : void 0
|
|
86
|
+
};
|
|
133
87
|
};
|
|
134
88
|
const unmarshalSnapshot = (data) => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
status: data.status,
|
|
151
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
152
|
-
volumeType: data.volume_type
|
|
153
|
-
};
|
|
89
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
|
|
90
|
+
return {
|
|
91
|
+
createdAt: unmarshalDate(data.created_at),
|
|
92
|
+
expiresAt: unmarshalDate(data.expires_at),
|
|
93
|
+
id: data.id,
|
|
94
|
+
instanceId: data.instance_id,
|
|
95
|
+
instanceName: data.instance_name,
|
|
96
|
+
name: data.name,
|
|
97
|
+
nodeType: data.node_type,
|
|
98
|
+
region: data.region,
|
|
99
|
+
sizeBytes: data.size_bytes,
|
|
100
|
+
status: data.status,
|
|
101
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
102
|
+
volumeType: data.volume_type
|
|
103
|
+
};
|
|
154
104
|
};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
anyDatabase: data.any_database,
|
|
163
|
-
databaseName: data.database_name,
|
|
164
|
-
role: data.role
|
|
165
|
-
};
|
|
105
|
+
var unmarshalUserRole = (data) => {
|
|
106
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UserRole' failed as data isn't a dictionary.`);
|
|
107
|
+
return {
|
|
108
|
+
anyDatabase: data.any_database,
|
|
109
|
+
databaseName: data.database_name,
|
|
110
|
+
role: data.role
|
|
111
|
+
};
|
|
166
112
|
};
|
|
167
113
|
const unmarshalUser = (data) => {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return {
|
|
174
|
-
name: data.name,
|
|
175
|
-
roles: unmarshalArrayOfObject(data.roles, unmarshalUserRole)
|
|
176
|
-
};
|
|
114
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
|
|
115
|
+
return {
|
|
116
|
+
name: data.name,
|
|
117
|
+
roles: unmarshalArrayOfObject(data.roles, unmarshalUserRole)
|
|
118
|
+
};
|
|
177
119
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
`Unmarshalling the type 'Database' failed as data isn't a dictionary.`
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
return {
|
|
185
|
-
name: data.name
|
|
186
|
-
};
|
|
120
|
+
var unmarshalDatabase = (data) => {
|
|
121
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
|
|
122
|
+
return { name: data.name };
|
|
187
123
|
};
|
|
188
124
|
const unmarshalListDatabasesResponse = (data) => {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
|
|
196
|
-
totalCount: data.total_count
|
|
197
|
-
};
|
|
125
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
|
|
126
|
+
return {
|
|
127
|
+
databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
|
|
128
|
+
totalCount: data.total_count
|
|
129
|
+
};
|
|
198
130
|
};
|
|
199
131
|
const unmarshalListInstancesResponse = (data) => {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return {
|
|
206
|
-
instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
|
|
207
|
-
totalCount: data.total_count
|
|
208
|
-
};
|
|
132
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);
|
|
133
|
+
return {
|
|
134
|
+
instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
|
|
135
|
+
totalCount: data.total_count
|
|
136
|
+
};
|
|
209
137
|
};
|
|
210
138
|
const unmarshalListMaintenancesResponse = (data) => {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return {
|
|
217
|
-
maintenances: unmarshalArrayOfObject(
|
|
218
|
-
data.maintenances,
|
|
219
|
-
unmarshalMaintenance
|
|
220
|
-
),
|
|
221
|
-
totalCount: data.total_count
|
|
222
|
-
};
|
|
139
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListMaintenancesResponse' failed as data isn't a dictionary.`);
|
|
140
|
+
return {
|
|
141
|
+
maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),
|
|
142
|
+
totalCount: data.total_count
|
|
143
|
+
};
|
|
223
144
|
};
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
maxSizeBytes: data.max_size_bytes,
|
|
234
|
-
minSizeBytes: data.min_size_bytes,
|
|
235
|
-
type: data.type
|
|
236
|
-
};
|
|
145
|
+
var unmarshalNodeTypeVolumeType = (data) => {
|
|
146
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
|
|
147
|
+
return {
|
|
148
|
+
chunkSizeBytes: data.chunk_size_bytes,
|
|
149
|
+
description: data.description,
|
|
150
|
+
maxSizeBytes: data.max_size_bytes,
|
|
151
|
+
minSizeBytes: data.min_size_bytes,
|
|
152
|
+
type: data.type
|
|
153
|
+
};
|
|
237
154
|
};
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
disabled: data.disabled,
|
|
252
|
-
instanceRange: data.instance_range,
|
|
253
|
-
memoryBytes: data.memory_bytes,
|
|
254
|
-
name: data.name,
|
|
255
|
-
stockStatus: data.stock_status,
|
|
256
|
-
vcpus: data.vcpus
|
|
257
|
-
};
|
|
155
|
+
var unmarshalNodeType = (data) => {
|
|
156
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
|
|
157
|
+
return {
|
|
158
|
+
availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
|
|
159
|
+
beta: data.beta,
|
|
160
|
+
description: data.description,
|
|
161
|
+
disabled: data.disabled,
|
|
162
|
+
instanceRange: data.instance_range,
|
|
163
|
+
memoryBytes: data.memory_bytes,
|
|
164
|
+
name: data.name,
|
|
165
|
+
stockStatus: data.stock_status,
|
|
166
|
+
vcpus: data.vcpus
|
|
167
|
+
};
|
|
258
168
|
};
|
|
259
169
|
const unmarshalListNodeTypesResponse = (data) => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return {
|
|
266
|
-
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
267
|
-
totalCount: data.total_count
|
|
268
|
-
};
|
|
170
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
|
|
171
|
+
return {
|
|
172
|
+
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
173
|
+
totalCount: data.total_count
|
|
174
|
+
};
|
|
269
175
|
};
|
|
270
176
|
const unmarshalListSnapshotsResponse = (data) => {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
return {
|
|
277
|
-
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
278
|
-
totalCount: data.total_count
|
|
279
|
-
};
|
|
177
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
|
|
178
|
+
return {
|
|
179
|
+
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
180
|
+
totalCount: data.total_count
|
|
181
|
+
};
|
|
280
182
|
};
|
|
281
183
|
const unmarshalListUsersResponse = (data) => {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return {
|
|
288
|
-
totalCount: data.total_count,
|
|
289
|
-
users: unmarshalArrayOfObject(data.users, unmarshalUser)
|
|
290
|
-
};
|
|
184
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
|
|
185
|
+
return {
|
|
186
|
+
totalCount: data.total_count,
|
|
187
|
+
users: unmarshalArrayOfObject(data.users, unmarshalUser)
|
|
188
|
+
};
|
|
291
189
|
};
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return {
|
|
299
|
-
endOfLifeAt: unmarshalDate(data.end_of_life_at),
|
|
300
|
-
version: data.version
|
|
301
|
-
};
|
|
190
|
+
var unmarshalVersion = (data) => {
|
|
191
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
|
|
192
|
+
return {
|
|
193
|
+
endOfLifeAt: unmarshalDate(data.end_of_life_at),
|
|
194
|
+
version: data.version
|
|
195
|
+
};
|
|
302
196
|
};
|
|
303
197
|
const unmarshalListVersionsResponse = (data) => {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
return {
|
|
310
|
-
totalCount: data.total_count,
|
|
311
|
-
versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
312
|
-
};
|
|
198
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
|
|
199
|
+
return {
|
|
200
|
+
totalCount: data.total_count,
|
|
201
|
+
versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
202
|
+
};
|
|
313
203
|
};
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
request.publicNetwork
|
|
324
|
-
) : void 0
|
|
325
|
-
},
|
|
326
|
-
{
|
|
327
|
-
param: "private_network",
|
|
328
|
-
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(
|
|
329
|
-
request.privateNetwork
|
|
330
|
-
) : void 0
|
|
331
|
-
}
|
|
332
|
-
])
|
|
333
|
-
});
|
|
204
|
+
var marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({ private_network_id: request.privateNetworkId });
|
|
205
|
+
var marshalEndpointSpecPublicNetworkDetails = (request, defaults) => ({});
|
|
206
|
+
var marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
|
|
207
|
+
param: "public_network",
|
|
208
|
+
value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkDetails(request.publicNetwork, defaults) : void 0
|
|
209
|
+
}, {
|
|
210
|
+
param: "private_network",
|
|
211
|
+
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
|
|
212
|
+
}]) });
|
|
334
213
|
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
335
|
-
|
|
336
|
-
|
|
214
|
+
endpoint: marshalEndpointSpec(request.endpoint, defaults),
|
|
215
|
+
instance_id: request.instanceId
|
|
337
216
|
});
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
217
|
+
var marshalVolume = (request, defaults) => ({
|
|
218
|
+
size_bytes: request.sizeBytes,
|
|
219
|
+
type: request.type
|
|
341
220
|
});
|
|
342
221
|
const marshalCreateInstanceRequest = (request, defaults) => ({
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
222
|
+
endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
|
|
223
|
+
name: request.name || randomName("mgdb"),
|
|
224
|
+
node_amount: request.nodeAmount,
|
|
225
|
+
node_type: request.nodeType,
|
|
226
|
+
password: request.password,
|
|
227
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
228
|
+
tags: request.tags,
|
|
229
|
+
user_name: request.userName,
|
|
230
|
+
version: request.version,
|
|
231
|
+
volume: request.volume !== void 0 ? marshalVolume(request.volume, defaults) : void 0
|
|
353
232
|
});
|
|
354
233
|
const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
234
|
+
expires_at: request.expiresAt,
|
|
235
|
+
instance_id: request.instanceId,
|
|
236
|
+
name: request.name
|
|
358
237
|
});
|
|
359
238
|
const marshalCreateUserRequest = (request, defaults) => ({
|
|
360
|
-
|
|
361
|
-
|
|
239
|
+
name: request.name,
|
|
240
|
+
password: request.password
|
|
362
241
|
});
|
|
363
242
|
const marshalRestoreSnapshotRequest = (request, defaults) => ({
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
243
|
+
instance_name: request.instanceName,
|
|
244
|
+
node_amount: request.nodeAmount,
|
|
245
|
+
node_type: request.nodeType,
|
|
246
|
+
volume_type: request.volumeType
|
|
368
247
|
});
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
248
|
+
var marshalUserRole = (request, defaults) => ({
|
|
249
|
+
role: request.role,
|
|
250
|
+
...resolveOneOf([{
|
|
251
|
+
param: "database_name",
|
|
252
|
+
value: request.databaseName
|
|
253
|
+
}, {
|
|
254
|
+
param: "any_database",
|
|
255
|
+
value: request.anyDatabase
|
|
256
|
+
}])
|
|
375
257
|
});
|
|
376
258
|
const marshalSetUserRoleRequest = (request, defaults) => ({
|
|
377
|
-
|
|
378
|
-
|
|
259
|
+
roles: request.roles !== void 0 ? request.roles.map((elt) => marshalUserRole(elt, defaults)) : void 0,
|
|
260
|
+
user_name: request.userName
|
|
379
261
|
});
|
|
380
262
|
const marshalUpdateInstanceRequest = (request, defaults) => ({
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
263
|
+
is_snapshot_schedule_enabled: request.isSnapshotScheduleEnabled,
|
|
264
|
+
name: request.name,
|
|
265
|
+
snapshot_schedule_frequency_hours: request.snapshotScheduleFrequencyHours,
|
|
266
|
+
snapshot_schedule_retention_days: request.snapshotScheduleRetentionDays,
|
|
267
|
+
tags: request.tags
|
|
386
268
|
});
|
|
387
269
|
const marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
});
|
|
391
|
-
const marshalUpdateUserRequest = (request, defaults) => ({
|
|
392
|
-
password: request.password
|
|
270
|
+
expires_at: request.expiresAt,
|
|
271
|
+
name: request.name
|
|
393
272
|
});
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
marshalCreateSnapshotRequest,
|
|
404
|
-
marshalCreateUserRequest,
|
|
405
|
-
marshalRestoreSnapshotRequest,
|
|
406
|
-
marshalSetUserRoleRequest,
|
|
407
|
-
marshalUpdateInstanceRequest,
|
|
408
|
-
marshalUpdateSnapshotRequest,
|
|
409
|
-
marshalUpdateUserRequest,
|
|
410
|
-
marshalUpgradeInstanceRequest,
|
|
411
|
-
unmarshalEndpoint,
|
|
412
|
-
unmarshalInstance,
|
|
413
|
-
unmarshalListDatabasesResponse,
|
|
414
|
-
unmarshalListInstancesResponse,
|
|
415
|
-
unmarshalListMaintenancesResponse,
|
|
416
|
-
unmarshalListNodeTypesResponse,
|
|
417
|
-
unmarshalListSnapshotsResponse,
|
|
418
|
-
unmarshalListUsersResponse,
|
|
419
|
-
unmarshalListVersionsResponse,
|
|
420
|
-
unmarshalMaintenance,
|
|
421
|
-
unmarshalSnapshot,
|
|
422
|
-
unmarshalUser
|
|
423
|
-
};
|
|
273
|
+
const marshalUpdateUserRequest = (request, defaults) => ({ password: request.password });
|
|
274
|
+
const marshalUpgradeInstanceRequest = (request, defaults) => ({ ...resolveOneOf([{
|
|
275
|
+
param: "volume_size_bytes",
|
|
276
|
+
value: request.volumeSizeBytes
|
|
277
|
+
}, {
|
|
278
|
+
param: "version_id",
|
|
279
|
+
value: request.versionId
|
|
280
|
+
}]) });
|
|
281
|
+
export { marshalCreateEndpointRequest, marshalCreateInstanceRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalRestoreSnapshotRequest, marshalSetUserRoleRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalEndpoint, unmarshalInstance, unmarshalListDatabasesResponse, unmarshalListInstancesResponse, unmarshalListMaintenancesResponse, unmarshalListNodeTypesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalMaintenance, unmarshalSnapshot, unmarshalUser };
|