@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.
@@ -1,423 +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(
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
- const unmarshalNodeTypeVolumeType = (data) => {
225
- if (!isJSONObject(data)) {
226
- throw new TypeError(
227
- `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`
228
- );
229
- }
230
- return {
231
- chunkSizeBytes: data.chunk_size_bytes,
232
- description: data.description,
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
- const unmarshalNodeType = (data) => {
239
- if (!isJSONObject(data)) {
240
- throw new TypeError(
241
- `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
242
- );
243
- }
244
- return {
245
- availableVolumeTypes: unmarshalArrayOfObject(
246
- data.available_volume_types,
247
- unmarshalNodeTypeVolumeType
248
- ),
249
- beta: data.beta,
250
- description: data.description,
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
- if (!isJSONObject(data)) {
261
- throw new TypeError(
262
- `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
272
- throw new TypeError(
273
- `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
283
- throw new TypeError(
284
- `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`
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
- const unmarshalVersion = (data) => {
293
- if (!isJSONObject(data)) {
294
- throw new TypeError(
295
- `Unmarshalling the type 'Version' failed as data isn't a dictionary.`
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
- if (!isJSONObject(data)) {
305
- throw new TypeError(
306
- `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`
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
- const marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({
315
- private_network_id: request.privateNetworkId
316
- });
317
- const marshalEndpointSpecPublicNetworkDetails = (request, defaults) => ({});
318
- const marshalEndpointSpec = (request, defaults) => ({
319
- ...resolveOneOf([
320
- {
321
- param: "public_network",
322
- value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkDetails(
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
- endpoint: marshalEndpointSpec(request.endpoint),
336
- instance_id: request.instanceId
214
+ endpoint: marshalEndpointSpec(request.endpoint, defaults),
215
+ instance_id: request.instanceId
337
216
  });
338
- const marshalVolume = (request, defaults) => ({
339
- size_bytes: request.sizeBytes,
340
- type: request.type
217
+ var marshalVolume = (request, defaults) => ({
218
+ size_bytes: request.sizeBytes,
219
+ type: request.type
341
220
  });
342
221
  const marshalCreateInstanceRequest = (request, defaults) => ({
343
- endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,
344
- name: request.name || randomName("mgdb"),
345
- node_amount: request.nodeAmount,
346
- node_type: request.nodeType,
347
- password: request.password,
348
- project_id: request.projectId ?? defaults.defaultProjectId,
349
- tags: request.tags,
350
- user_name: request.userName,
351
- version: request.version,
352
- 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
353
232
  });
354
233
  const marshalCreateSnapshotRequest = (request, defaults) => ({
355
- expires_at: request.expiresAt,
356
- instance_id: request.instanceId,
357
- name: request.name
234
+ expires_at: request.expiresAt,
235
+ instance_id: request.instanceId,
236
+ name: request.name
358
237
  });
359
238
  const marshalCreateUserRequest = (request, defaults) => ({
360
- name: request.name,
361
- password: request.password
239
+ name: request.name,
240
+ password: request.password
362
241
  });
363
242
  const marshalRestoreSnapshotRequest = (request, defaults) => ({
364
- instance_name: request.instanceName,
365
- node_amount: request.nodeAmount,
366
- node_type: request.nodeType,
367
- volume_type: request.volumeType
243
+ instance_name: request.instanceName,
244
+ node_amount: request.nodeAmount,
245
+ node_type: request.nodeType,
246
+ volume_type: request.volumeType
368
247
  });
369
- const marshalUserRole = (request, defaults) => ({
370
- role: request.role,
371
- ...resolveOneOf([
372
- { param: "database_name", value: request.databaseName },
373
- { param: "any_database", value: request.anyDatabase }
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
- roles: request.roles !== void 0 ? request.roles.map((elt) => marshalUserRole(elt)) : void 0,
378
- user_name: request.userName
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
- is_snapshot_schedule_enabled: request.isSnapshotScheduleEnabled,
382
- name: request.name,
383
- snapshot_schedule_frequency_hours: request.snapshotScheduleFrequencyHours,
384
- snapshot_schedule_retention_days: request.snapshotScheduleRetentionDays,
385
- 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
386
268
  });
387
269
  const marshalUpdateSnapshotRequest = (request, defaults) => ({
388
- expires_at: request.expiresAt,
389
- name: request.name
390
- });
391
- const marshalUpdateUserRequest = (request, defaults) => ({
392
- password: request.password
270
+ expires_at: request.expiresAt,
271
+ name: request.name
393
272
  });
394
- const marshalUpgradeInstanceRequest = (request, defaults) => ({
395
- ...resolveOneOf([
396
- { param: "volume_size_bytes", value: request.volumeSizeBytes },
397
- { param: "version_id", value: request.versionId }
398
- ])
399
- });
400
- export {
401
- marshalCreateEndpointRequest,
402
- marshalCreateInstanceRequest,
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 };