@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.
@@ -1,425 +1,281 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
- const unmarshalEndpointPrivateNetworkDetails = (data) => {
4
- if (!isJSONObject(data)) {
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
- const unmarshalEndpointPublicNetworkDetails = (data) => {
14
- if (!isJSONObject(data)) {
15
- throw new TypeError(
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
- if (!isJSONObject(data)) {
23
- throw new TypeError(
24
- `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
25
- );
26
- }
27
- return {
28
- dnsRecord: data.dns_record,
29
- id: data.id,
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
- const unmarshalInstanceSnapshotSchedule = (data) => {
36
- if (!isJSONObject(data)) {
37
- throw new TypeError(
38
- `Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary.`
39
- );
40
- }
41
- return {
42
- enabled: data.enabled,
43
- frequencyHours: data.frequency_hours,
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
- const unmarshalVolume = (data) => {
50
- if (!isJSONObject(data)) {
51
- throw new TypeError(
52
- `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
62
- throw new TypeError(
63
- `Unmarshalling the type 'Instance' failed as data isn't a dictionary.`
64
- );
65
- }
66
- return {
67
- createdAt: unmarshalDate(data.created_at),
68
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
69
- id: data.id,
70
- name: data.name,
71
- nodeAmount: data.node_amount,
72
- nodeType: data.node_type,
73
- organizationId: data.organization_id,
74
- projectId: data.project_id,
75
- region: data.region,
76
- snapshotSchedule: data.snapshot_schedule ? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule) : void 0,
77
- status: data.status,
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
- const unmarshalEngineUpgrade = (data) => {
84
- if (!isJSONObject(data)) {
85
- throw new TypeError(
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
- const unmarshalServiceUpdate = (data) => {
94
- if (!isJSONObject(data)) {
95
- throw new TypeError(
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
- const unmarshalWorkflow = (data) => {
104
- if (!isJSONObject(data)) {
105
- throw new TypeError(
106
- `Unmarshalling the type 'Workflow' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
116
- throw new TypeError(
117
- `Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`
118
- );
119
- }
120
- return {
121
- appliedAt: unmarshalDate(data.applied_at),
122
- appliedBy: data.applied_by,
123
- createdAt: unmarshalDate(data.created_at),
124
- forcedAt: unmarshalDate(data.forced_at),
125
- id: data.id,
126
- instanceId: data.instance_id,
127
- reason: data.reason,
128
- startsAt: unmarshalDate(data.starts_at),
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
- if (!isJSONObject(data)) {
136
- throw new TypeError(
137
- `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`
138
- );
139
- }
140
- return {
141
- createdAt: unmarshalDate(data.created_at),
142
- expiresAt: unmarshalDate(data.expires_at),
143
- id: data.id,
144
- instanceId: data.instance_id,
145
- instanceName: data.instance_name,
146
- name: data.name,
147
- nodeType: data.node_type,
148
- region: data.region,
149
- sizeBytes: data.size_bytes,
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
- const unmarshalUserRole = (data) => {
156
- if (!isJSONObject(data)) {
157
- throw new TypeError(
158
- `Unmarshalling the type 'UserRole' failed as data isn't a dictionary.`
159
- );
160
- }
161
- return {
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
- if (!isJSONObject(data)) {
169
- throw new TypeError(
170
- `Unmarshalling the type 'User' failed as data isn't a dictionary.`
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
- const unmarshalDatabase = (data) => {
179
- if (!isJSONObject(data)) {
180
- throw new TypeError(
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
- if (!isJSONObject(data)) {
190
- throw new TypeError(
191
- `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
201
- throw new TypeError(
202
- `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
212
- throw new TypeError(
213
- `Unmarshalling the type 'ListMaintenancesResponse' failed as data isn't a dictionary.`
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
- const unmarshalNodeTypeVolumeType = (data) => {
222
- if (!isJSONObject(data)) {
223
- throw new TypeError(
224
- `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`
225
- );
226
- }
227
- return {
228
- chunkSizeBytes: data.chunk_size_bytes,
229
- description: data.description,
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
- const unmarshalNodeType = (data) => {
236
- if (!isJSONObject(data)) {
237
- throw new TypeError(
238
- `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
239
- );
240
- }
241
- return {
242
- availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
243
- beta: data.beta,
244
- description: data.description,
245
- disabled: data.disabled,
246
- instanceRange: data.instance_range,
247
- memoryBytes: data.memory_bytes,
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
- if (!isJSONObject(data)) {
255
- throw new TypeError(
256
- `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
266
- throw new TypeError(
267
- `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
277
- throw new TypeError(
278
- `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`
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
- const unmarshalVersion = (data) => {
287
- if (!isJSONObject(data)) {
288
- throw new TypeError(
289
- `Unmarshalling the type 'Version' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
299
- throw new TypeError(
300
- `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`
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
- const marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({
309
- private_network_id: request.privateNetworkId
310
- });
311
- const marshalEndpointSpecPublicNetworkDetails = (request, defaults) => ({});
312
- const marshalEndpointSpec = (request, defaults) => ({
313
- ...resolveOneOf([
314
- {
315
- param: "public_network",
316
- value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkDetails(request.publicNetwork) : void 0
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
- endpoint: marshalEndpointSpec(request.endpoint),
326
- instance_id: request.instanceId
214
+ endpoint: marshalEndpointSpec(request.endpoint, defaults),
215
+ instance_id: request.instanceId
327
216
  });
328
- const marshalVolume = (request, defaults) => ({
329
- size_bytes: request.sizeBytes,
330
- type: request.type
217
+ var marshalVolume = (request, defaults) => ({
218
+ size_bytes: request.sizeBytes,
219
+ type: request.type
331
220
  });
332
221
  const marshalCreateInstanceRequest = (request, defaults) => ({
333
- endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,
334
- name: request.name || randomName("mgdb"),
335
- node_amount: request.nodeAmount,
336
- node_type: request.nodeType,
337
- password: request.password,
338
- project_id: request.projectId ?? defaults.defaultProjectId,
339
- tags: request.tags,
340
- user_name: request.userName,
341
- version: request.version,
342
- volume: request.volume !== void 0 ? marshalVolume(request.volume) : void 0
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
- expires_at: request.expiresAt,
346
- instance_id: request.instanceId,
347
- name: request.name
234
+ expires_at: request.expiresAt,
235
+ instance_id: request.instanceId,
236
+ name: request.name
348
237
  });
349
238
  const marshalCreateUserRequest = (request, defaults) => ({
350
- name: request.name,
351
- password: request.password
239
+ name: request.name,
240
+ password: request.password
352
241
  });
353
242
  const marshalRestoreSnapshotRequest = (request, defaults) => ({
354
- instance_name: request.instanceName,
355
- node_amount: request.nodeAmount,
356
- node_type: request.nodeType,
357
- volume_type: request.volumeType
243
+ instance_name: request.instanceName,
244
+ node_amount: request.nodeAmount,
245
+ node_type: request.nodeType,
246
+ volume_type: request.volumeType
358
247
  });
359
- const marshalUserRole = (request, defaults) => ({
360
- role: request.role,
361
- ...resolveOneOf([
362
- {
363
- param: "database_name",
364
- value: request.databaseName
365
- },
366
- {
367
- param: "any_database",
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
- roles: request.roles !== void 0 ? request.roles.map((elt) => marshalUserRole(elt)) : void 0,
374
- user_name: request.userName
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
- is_snapshot_schedule_enabled: request.isSnapshotScheduleEnabled,
378
- name: request.name,
379
- snapshot_schedule_frequency_hours: request.snapshotScheduleFrequencyHours,
380
- snapshot_schedule_retention_days: request.snapshotScheduleRetentionDays,
381
- tags: request.tags
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
- expires_at: request.expiresAt,
385
- name: request.name
386
- });
387
- const marshalUpdateUserRequest = (request, defaults) => ({
388
- password: request.password
270
+ expires_at: request.expiresAt,
271
+ name: request.name
389
272
  });
390
- const marshalUpgradeInstanceRequest = (request, defaults) => ({
391
- ...resolveOneOf([
392
- {
393
- param: "volume_size_bytes",
394
- value: request.volumeSizeBytes
395
- },
396
- {
397
- param: "version_id",
398
- value: request.versionId
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 };