@scaleway/sdk-mongodb 2.3.1 → 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 -489
- package/dist/v1/content.gen.js +13 -16
- package/dist/v1/index.gen.js +33 -31
- package/dist/v1/marshalling.gen.js +226 -370
- package/dist/v1/validation-rules.gen.js +162 -190
- package/dist/v1alpha1/api.gen.js +283 -410
- package/dist/v1alpha1/content.gen.js +11 -12
- package/dist/v1alpha1/index.gen.js +31 -29
- package/dist/v1alpha1/marshalling.gen.js +213 -337
- package/dist/v1alpha1/validation-rules.gen.js +135 -157
- package/package.json +4 -4
|
@@ -1,425 +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(data.maintenances, unmarshalMaintenance),
|
|
218
|
-
totalCount: data.total_count
|
|
219
|
-
};
|
|
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
|
+
};
|
|
220
144
|
};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
maxSizeBytes: data.max_size_bytes,
|
|
231
|
-
minSizeBytes: data.min_size_bytes,
|
|
232
|
-
type: data.type
|
|
233
|
-
};
|
|
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
|
+
};
|
|
234
154
|
};
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
name: data.name,
|
|
249
|
-
stockStatus: data.stock_status,
|
|
250
|
-
vcpus: data.vcpus
|
|
251
|
-
};
|
|
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
|
+
};
|
|
252
168
|
};
|
|
253
169
|
const unmarshalListNodeTypesResponse = (data) => {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
return {
|
|
260
|
-
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
261
|
-
totalCount: data.total_count
|
|
262
|
-
};
|
|
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
|
+
};
|
|
263
175
|
};
|
|
264
176
|
const unmarshalListSnapshotsResponse = (data) => {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return {
|
|
271
|
-
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
272
|
-
totalCount: data.total_count
|
|
273
|
-
};
|
|
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
|
+
};
|
|
274
182
|
};
|
|
275
183
|
const unmarshalListUsersResponse = (data) => {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return {
|
|
282
|
-
totalCount: data.total_count,
|
|
283
|
-
users: unmarshalArrayOfObject(data.users, unmarshalUser)
|
|
284
|
-
};
|
|
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
|
+
};
|
|
285
189
|
};
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return {
|
|
293
|
-
endOfLifeAt: unmarshalDate(data.end_of_life_at),
|
|
294
|
-
version: data.version
|
|
295
|
-
};
|
|
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
|
+
};
|
|
296
196
|
};
|
|
297
197
|
const unmarshalListVersionsResponse = (data) => {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
return {
|
|
304
|
-
totalCount: data.total_count,
|
|
305
|
-
versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
|
|
306
|
-
};
|
|
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
|
+
};
|
|
307
203
|
};
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
param: "private_network",
|
|
320
|
-
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork) : void 0
|
|
321
|
-
}
|
|
322
|
-
])
|
|
323
|
-
});
|
|
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
|
+
}]) });
|
|
324
213
|
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
325
|
-
|
|
326
|
-
|
|
214
|
+
endpoint: marshalEndpointSpec(request.endpoint, defaults),
|
|
215
|
+
instance_id: request.instanceId
|
|
327
216
|
});
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
217
|
+
var marshalVolume = (request, defaults) => ({
|
|
218
|
+
size_bytes: request.sizeBytes,
|
|
219
|
+
type: request.type
|
|
331
220
|
});
|
|
332
221
|
const marshalCreateInstanceRequest = (request, defaults) => ({
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
|
343
232
|
});
|
|
344
233
|
const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
234
|
+
expires_at: request.expiresAt,
|
|
235
|
+
instance_id: request.instanceId,
|
|
236
|
+
name: request.name
|
|
348
237
|
});
|
|
349
238
|
const marshalCreateUserRequest = (request, defaults) => ({
|
|
350
|
-
|
|
351
|
-
|
|
239
|
+
name: request.name,
|
|
240
|
+
password: request.password
|
|
352
241
|
});
|
|
353
242
|
const marshalRestoreSnapshotRequest = (request, defaults) => ({
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
243
|
+
instance_name: request.instanceName,
|
|
244
|
+
node_amount: request.nodeAmount,
|
|
245
|
+
node_type: request.nodeType,
|
|
246
|
+
volume_type: request.volumeType
|
|
358
247
|
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
value: request.anyDatabase
|
|
369
|
-
}
|
|
370
|
-
])
|
|
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
|
+
}])
|
|
371
257
|
});
|
|
372
258
|
const marshalSetUserRoleRequest = (request, defaults) => ({
|
|
373
|
-
|
|
374
|
-
|
|
259
|
+
roles: request.roles !== void 0 ? request.roles.map((elt) => marshalUserRole(elt, defaults)) : void 0,
|
|
260
|
+
user_name: request.userName
|
|
375
261
|
});
|
|
376
262
|
const marshalUpdateInstanceRequest = (request, defaults) => ({
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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
|
|
382
268
|
});
|
|
383
269
|
const marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
});
|
|
387
|
-
const marshalUpdateUserRequest = (request, defaults) => ({
|
|
388
|
-
password: request.password
|
|
270
|
+
expires_at: request.expiresAt,
|
|
271
|
+
name: request.name
|
|
389
272
|
});
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
])
|
|
401
|
-
});
|
|
402
|
-
export {
|
|
403
|
-
marshalCreateEndpointRequest,
|
|
404
|
-
marshalCreateInstanceRequest,
|
|
405
|
-
marshalCreateSnapshotRequest,
|
|
406
|
-
marshalCreateUserRequest,
|
|
407
|
-
marshalRestoreSnapshotRequest,
|
|
408
|
-
marshalSetUserRoleRequest,
|
|
409
|
-
marshalUpdateInstanceRequest,
|
|
410
|
-
marshalUpdateSnapshotRequest,
|
|
411
|
-
marshalUpdateUserRequest,
|
|
412
|
-
marshalUpgradeInstanceRequest,
|
|
413
|
-
unmarshalEndpoint,
|
|
414
|
-
unmarshalInstance,
|
|
415
|
-
unmarshalListDatabasesResponse,
|
|
416
|
-
unmarshalListInstancesResponse,
|
|
417
|
-
unmarshalListMaintenancesResponse,
|
|
418
|
-
unmarshalListNodeTypesResponse,
|
|
419
|
-
unmarshalListSnapshotsResponse,
|
|
420
|
-
unmarshalListUsersResponse,
|
|
421
|
-
unmarshalListVersionsResponse,
|
|
422
|
-
unmarshalMaintenance,
|
|
423
|
-
unmarshalSnapshot,
|
|
424
|
-
unmarshalUser
|
|
425
|
-
};
|
|
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 };
|