@scaleway/sdk-rdb 2.2.0 → 2.3.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,923 +1,587 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalTimeSeries } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalTimeSeries } from "@scaleway/sdk-client";
3
- const unmarshalEndpointDirectAccessDetails = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {};
10
- };
11
- const unmarshalEndpointLoadBalancerDetails = (data) => {
12
- if (!isJSONObject(data)) {
13
- throw new TypeError(
14
- `Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`
15
- );
16
- }
17
- return {};
18
- };
19
- const unmarshalEndpointPrivateNetworkDetails = (data) => {
20
- if (!isJSONObject(data)) {
21
- throw new TypeError(
22
- `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
23
- );
24
- }
25
- return {
26
- privateNetworkId: data.private_network_id,
27
- provisioningMode: data.provisioning_mode,
28
- serviceIp: data.service_ip,
29
- zone: data.zone
30
- };
3
+ var unmarshalEndpointDirectAccessDetails = (data) => {
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`);
5
+ return {};
6
+ };
7
+ var unmarshalEndpointLoadBalancerDetails = (data) => {
8
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`);
9
+ return {};
10
+ };
11
+ var unmarshalEndpointPrivateNetworkDetails = (data) => {
12
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
13
+ return {
14
+ privateNetworkId: data.private_network_id,
15
+ provisioningMode: data.provisioning_mode,
16
+ serviceIp: data.service_ip,
17
+ zone: data.zone
18
+ };
31
19
  };
32
20
  const unmarshalEndpoint = (data) => {
33
- if (!isJSONObject(data)) {
34
- throw new TypeError(
35
- `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
36
- );
37
- }
38
- return {
39
- directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : void 0,
40
- hostname: data.hostname,
41
- id: data.id,
42
- ip: data.ip,
43
- loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : void 0,
44
- name: data.name,
45
- port: data.port,
46
- privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0
47
- };
21
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
22
+ return {
23
+ directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : void 0,
24
+ hostname: data.hostname,
25
+ id: data.id,
26
+ ip: data.ip,
27
+ loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : void 0,
28
+ name: data.name,
29
+ port: data.port,
30
+ privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0
31
+ };
48
32
  };
49
33
  const unmarshalMaintenance = (data) => {
50
- if (!isJSONObject(data)) {
51
- throw new TypeError(
52
- `Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`
53
- );
54
- }
55
- return {
56
- closedAt: unmarshalDate(data.closed_at),
57
- forcedAt: unmarshalDate(data.forced_at),
58
- isApplicable: data.is_applicable,
59
- reason: data.reason,
60
- startsAt: unmarshalDate(data.starts_at),
61
- status: data.status,
62
- stopsAt: unmarshalDate(data.stops_at)
63
- };
34
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
35
+ return {
36
+ closedAt: unmarshalDate(data.closed_at),
37
+ forcedAt: unmarshalDate(data.forced_at),
38
+ isApplicable: data.is_applicable,
39
+ reason: data.reason,
40
+ startsAt: unmarshalDate(data.starts_at),
41
+ status: data.status,
42
+ stopsAt: unmarshalDate(data.stops_at)
43
+ };
64
44
  };
65
45
  const unmarshalReadReplica = (data) => {
66
- if (!isJSONObject(data)) {
67
- throw new TypeError(
68
- `Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`
69
- );
70
- }
71
- return {
72
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
73
- id: data.id,
74
- instanceId: data.instance_id,
75
- region: data.region,
76
- sameZone: data.same_zone,
77
- status: data.status
78
- };
46
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`);
47
+ return {
48
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
49
+ id: data.id,
50
+ instanceId: data.instance_id,
51
+ region: data.region,
52
+ sameZone: data.same_zone,
53
+ status: data.status
54
+ };
79
55
  };
80
56
  const unmarshalDatabaseBackup = (data) => {
81
- if (!isJSONObject(data)) {
82
- throw new TypeError(
83
- `Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`
84
- );
85
- }
86
- return {
87
- createdAt: unmarshalDate(data.created_at),
88
- databaseName: data.database_name,
89
- downloadUrl: data.download_url,
90
- downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),
91
- expiresAt: unmarshalDate(data.expires_at),
92
- id: data.id,
93
- instanceId: data.instance_id,
94
- instanceName: data.instance_name,
95
- name: data.name,
96
- region: data.region,
97
- sameRegion: data.same_region,
98
- size: data.size,
99
- status: data.status,
100
- updatedAt: unmarshalDate(data.updated_at)
101
- };
57
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`);
58
+ return {
59
+ createdAt: unmarshalDate(data.created_at),
60
+ databaseName: data.database_name,
61
+ downloadUrl: data.download_url,
62
+ downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),
63
+ expiresAt: unmarshalDate(data.expires_at),
64
+ id: data.id,
65
+ instanceId: data.instance_id,
66
+ instanceName: data.instance_name,
67
+ name: data.name,
68
+ region: data.region,
69
+ sameRegion: data.same_region,
70
+ size: data.size,
71
+ status: data.status,
72
+ updatedAt: unmarshalDate(data.updated_at)
73
+ };
102
74
  };
103
75
  const unmarshalDatabase = (data) => {
104
- if (!isJSONObject(data)) {
105
- throw new TypeError(
106
- `Unmarshalling the type 'Database' failed as data isn't a dictionary.`
107
- );
108
- }
109
- return {
110
- managed: data.managed,
111
- name: data.name,
112
- owner: data.owner,
113
- size: data.size
114
- };
76
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
77
+ return {
78
+ managed: data.managed,
79
+ name: data.name,
80
+ owner: data.owner,
81
+ size: data.size
82
+ };
115
83
  };
116
84
  const unmarshalInstanceLog = (data) => {
117
- if (!isJSONObject(data)) {
118
- throw new TypeError(
119
- `Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`
120
- );
121
- }
122
- return {
123
- createdAt: unmarshalDate(data.created_at),
124
- downloadUrl: data.download_url,
125
- expiresAt: unmarshalDate(data.expires_at),
126
- id: data.id,
127
- nodeName: data.node_name,
128
- region: data.region,
129
- status: data.status
130
- };
85
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`);
86
+ return {
87
+ createdAt: unmarshalDate(data.created_at),
88
+ downloadUrl: data.download_url,
89
+ expiresAt: unmarshalDate(data.expires_at),
90
+ id: data.id,
91
+ nodeName: data.node_name,
92
+ region: data.region,
93
+ status: data.status
94
+ };
131
95
  };
132
96
  const unmarshalBackupSchedule = (data) => {
133
- if (!isJSONObject(data)) {
134
- throw new TypeError(
135
- `Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`
136
- );
137
- }
138
- return {
139
- disabled: data.disabled,
140
- frequency: data.frequency,
141
- nextRunAt: unmarshalDate(data.next_run_at),
142
- retention: data.retention
143
- };
144
- };
145
- const unmarshalEncryptionAtRest = (data) => {
146
- if (!isJSONObject(data)) {
147
- throw new TypeError(
148
- `Unmarshalling the type 'EncryptionAtRest' failed as data isn't a dictionary.`
149
- );
150
- }
151
- return {
152
- enabled: data.enabled
153
- };
154
- };
155
- const unmarshalInstanceSetting = (data) => {
156
- if (!isJSONObject(data)) {
157
- throw new TypeError(
158
- `Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`
159
- );
160
- }
161
- return {
162
- name: data.name,
163
- value: data.value
164
- };
165
- };
166
- const unmarshalLogsPolicy = (data) => {
167
- if (!isJSONObject(data)) {
168
- throw new TypeError(
169
- `Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`
170
- );
171
- }
172
- return {
173
- maxAgeRetention: data.max_age_retention,
174
- totalDiskRetention: data.total_disk_retention
175
- };
176
- };
177
- const unmarshalUpgradableVersion = (data) => {
178
- if (!isJSONObject(data)) {
179
- throw new TypeError(
180
- `Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`
181
- );
182
- }
183
- return {
184
- id: data.id,
185
- minorVersion: data.minor_version,
186
- name: data.name,
187
- version: data.version
188
- };
189
- };
190
- const unmarshalVolume = (data) => {
191
- if (!isJSONObject(data)) {
192
- throw new TypeError(
193
- `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`
194
- );
195
- }
196
- return {
197
- class: data.class,
198
- size: data.size,
199
- type: data.type
200
- };
97
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);
98
+ return {
99
+ disabled: data.disabled,
100
+ frequency: data.frequency,
101
+ nextRunAt: unmarshalDate(data.next_run_at),
102
+ retention: data.retention
103
+ };
104
+ };
105
+ var unmarshalEncryptionAtRest = (data) => {
106
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EncryptionAtRest' failed as data isn't a dictionary.`);
107
+ return { enabled: data.enabled };
108
+ };
109
+ var unmarshalInstanceSetting = (data) => {
110
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);
111
+ return {
112
+ name: data.name,
113
+ value: data.value
114
+ };
115
+ };
116
+ var unmarshalLogsPolicy = (data) => {
117
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
118
+ return {
119
+ maxAgeRetention: data.max_age_retention,
120
+ totalDiskRetention: data.total_disk_retention
121
+ };
122
+ };
123
+ var unmarshalUpgradableVersion = (data) => {
124
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
125
+ return {
126
+ id: data.id,
127
+ minorVersion: data.minor_version,
128
+ name: data.name,
129
+ version: data.version
130
+ };
131
+ };
132
+ var unmarshalVolume = (data) => {
133
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
134
+ return {
135
+ class: data.class,
136
+ size: data.size,
137
+ type: data.type
138
+ };
201
139
  };
202
140
  const unmarshalInstance = (data) => {
203
- if (!isJSONObject(data)) {
204
- throw new TypeError(
205
- `Unmarshalling the type 'Instance' failed as data isn't a dictionary.`
206
- );
207
- }
208
- return {
209
- backupSameRegion: data.backup_same_region,
210
- backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : void 0,
211
- createdAt: unmarshalDate(data.created_at),
212
- encryption: data.encryption ? unmarshalEncryptionAtRest(data.encryption) : void 0,
213
- endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : void 0,
214
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
215
- engine: data.engine,
216
- id: data.id,
217
- initSettings: unmarshalArrayOfObject(
218
- data.init_settings,
219
- unmarshalInstanceSetting
220
- ),
221
- isHaCluster: data.is_ha_cluster,
222
- logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : void 0,
223
- maintenances: unmarshalArrayOfObject(
224
- data.maintenances,
225
- unmarshalMaintenance
226
- ),
227
- name: data.name,
228
- nodeType: data.node_type,
229
- organizationId: data.organization_id,
230
- projectId: data.project_id,
231
- readReplicas: unmarshalArrayOfObject(
232
- data.read_replicas,
233
- unmarshalReadReplica
234
- ),
235
- region: data.region,
236
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
237
- status: data.status,
238
- tags: data.tags,
239
- upgradableVersion: unmarshalArrayOfObject(
240
- data.upgradable_version,
241
- unmarshalUpgradableVersion
242
- ),
243
- volume: data.volume ? unmarshalVolume(data.volume) : void 0
244
- };
141
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
142
+ return {
143
+ backupSameRegion: data.backup_same_region,
144
+ backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : void 0,
145
+ createdAt: unmarshalDate(data.created_at),
146
+ encryption: data.encryption ? unmarshalEncryptionAtRest(data.encryption) : void 0,
147
+ endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : void 0,
148
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
149
+ engine: data.engine,
150
+ id: data.id,
151
+ initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting),
152
+ isHaCluster: data.is_ha_cluster,
153
+ logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : void 0,
154
+ maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),
155
+ name: data.name,
156
+ nodeType: data.node_type,
157
+ organizationId: data.organization_id,
158
+ projectId: data.project_id,
159
+ readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica),
160
+ region: data.region,
161
+ settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
162
+ status: data.status,
163
+ tags: data.tags,
164
+ upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
165
+ volume: data.volume ? unmarshalVolume(data.volume) : void 0
166
+ };
245
167
  };
246
168
  const unmarshalPrivilege = (data) => {
247
- if (!isJSONObject(data)) {
248
- throw new TypeError(
249
- `Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`
250
- );
251
- }
252
- return {
253
- databaseName: data.database_name,
254
- permission: data.permission,
255
- userName: data.user_name
256
- };
257
- };
258
- const unmarshalSnapshotVolumeType = (data) => {
259
- if (!isJSONObject(data)) {
260
- throw new TypeError(
261
- `Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`
262
- );
263
- }
264
- return {
265
- class: data.class,
266
- type: data.type
267
- };
169
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`);
170
+ return {
171
+ databaseName: data.database_name,
172
+ permission: data.permission,
173
+ userName: data.user_name
174
+ };
175
+ };
176
+ var unmarshalSnapshotVolumeType = (data) => {
177
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`);
178
+ return {
179
+ class: data.class,
180
+ type: data.type
181
+ };
268
182
  };
269
183
  const unmarshalSnapshot = (data) => {
270
- if (!isJSONObject(data)) {
271
- throw new TypeError(
272
- `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`
273
- );
274
- }
275
- return {
276
- createdAt: unmarshalDate(data.created_at),
277
- expiresAt: unmarshalDate(data.expires_at),
278
- id: data.id,
279
- instanceId: data.instance_id,
280
- instanceName: data.instance_name,
281
- name: data.name,
282
- nodeType: data.node_type,
283
- region: data.region,
284
- size: data.size,
285
- status: data.status,
286
- updatedAt: unmarshalDate(data.updated_at),
287
- volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : void 0
288
- };
184
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
185
+ return {
186
+ createdAt: unmarshalDate(data.created_at),
187
+ expiresAt: unmarshalDate(data.expires_at),
188
+ id: data.id,
189
+ instanceId: data.instance_id,
190
+ instanceName: data.instance_name,
191
+ name: data.name,
192
+ nodeType: data.node_type,
193
+ region: data.region,
194
+ size: data.size,
195
+ status: data.status,
196
+ updatedAt: unmarshalDate(data.updated_at),
197
+ volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : void 0
198
+ };
289
199
  };
290
200
  const unmarshalUser = (data) => {
291
- if (!isJSONObject(data)) {
292
- throw new TypeError(
293
- `Unmarshalling the type 'User' failed as data isn't a dictionary.`
294
- );
295
- }
296
- return {
297
- isAdmin: data.is_admin,
298
- name: data.name
299
- };
201
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
202
+ return {
203
+ isAdmin: data.is_admin,
204
+ name: data.name
205
+ };
300
206
  };
301
207
  const unmarshalACLRule = (data) => {
302
- if (!isJSONObject(data)) {
303
- throw new TypeError(
304
- `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`
305
- );
306
- }
307
- return {
308
- action: data.action,
309
- description: data.description,
310
- direction: data.direction,
311
- ip: data.ip,
312
- port: data.port,
313
- protocol: data.protocol
314
- };
208
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
209
+ return {
210
+ action: data.action,
211
+ description: data.description,
212
+ direction: data.direction,
213
+ ip: data.ip,
214
+ port: data.port,
215
+ protocol: data.protocol
216
+ };
315
217
  };
316
218
  const unmarshalAddInstanceACLRulesResponse = (data) => {
317
- if (!isJSONObject(data)) {
318
- throw new TypeError(
319
- `Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`
320
- );
321
- }
322
- return {
323
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
324
- };
219
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`);
220
+ return { rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule) };
325
221
  };
326
222
  const unmarshalAddInstanceSettingsResponse = (data) => {
327
- if (!isJSONObject(data)) {
328
- throw new TypeError(
329
- `Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`
330
- );
331
- }
332
- return {
333
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
334
- };
223
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`);
224
+ return { settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) };
335
225
  };
336
226
  const unmarshalDeleteInstanceACLRulesResponse = (data) => {
337
- if (!isJSONObject(data)) {
338
- throw new TypeError(
339
- `Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`
340
- );
341
- }
342
- return {
343
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
344
- };
227
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`);
228
+ return { rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule) };
345
229
  };
346
230
  const unmarshalDeleteInstanceSettingsResponse = (data) => {
347
- if (!isJSONObject(data)) {
348
- throw new TypeError(
349
- `Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`
350
- );
351
- }
352
- return {
353
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
354
- };
231
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`);
232
+ return { settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) };
355
233
  };
356
234
  const unmarshalInstanceMetrics = (data) => {
357
- if (!isJSONObject(data)) {
358
- throw new TypeError(
359
- `Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`
360
- );
361
- }
362
- return {
363
- timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
364
- };
235
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`);
236
+ return { timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries) };
365
237
  };
366
238
  const unmarshalListDatabaseBackupsResponse = (data) => {
367
- if (!isJSONObject(data)) {
368
- throw new TypeError(
369
- `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`
370
- );
371
- }
372
- return {
373
- databaseBackups: unmarshalArrayOfObject(
374
- data.database_backups,
375
- unmarshalDatabaseBackup
376
- ),
377
- totalCount: data.total_count
378
- };
379
- };
380
- const unmarshalEngineSetting = (data) => {
381
- if (!isJSONObject(data)) {
382
- throw new TypeError(
383
- `Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`
384
- );
385
- }
386
- return {
387
- defaultValue: data.default_value,
388
- description: data.description,
389
- floatMax: data.float_max,
390
- floatMin: data.float_min,
391
- hotConfigurable: data.hot_configurable,
392
- intMax: data.int_max,
393
- intMin: data.int_min,
394
- name: data.name,
395
- propertyType: data.property_type,
396
- stringConstraint: data.string_constraint,
397
- unit: data.unit
398
- };
399
- };
400
- const unmarshalEngineVersion = (data) => {
401
- if (!isJSONObject(data)) {
402
- throw new TypeError(
403
- `Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`
404
- );
405
- }
406
- return {
407
- availableInitSettings: unmarshalArrayOfObject(
408
- data.available_init_settings,
409
- unmarshalEngineSetting
410
- ),
411
- availableSettings: unmarshalArrayOfObject(
412
- data.available_settings,
413
- unmarshalEngineSetting
414
- ),
415
- beta: data.beta,
416
- disabled: data.disabled,
417
- endOfLife: unmarshalDate(data.end_of_life),
418
- name: data.name,
419
- version: data.version
420
- };
421
- };
422
- const unmarshalDatabaseEngine = (data) => {
423
- if (!isJSONObject(data)) {
424
- throw new TypeError(
425
- `Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`
426
- );
427
- }
428
- return {
429
- logoUrl: data.logo_url,
430
- name: data.name,
431
- region: data.region,
432
- versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)
433
- };
239
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`);
240
+ return {
241
+ databaseBackups: unmarshalArrayOfObject(data.database_backups, unmarshalDatabaseBackup),
242
+ totalCount: data.total_count
243
+ };
244
+ };
245
+ var unmarshalEngineSetting = (data) => {
246
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`);
247
+ return {
248
+ defaultValue: data.default_value,
249
+ description: data.description,
250
+ floatMax: data.float_max,
251
+ floatMin: data.float_min,
252
+ hotConfigurable: data.hot_configurable,
253
+ intMax: data.int_max,
254
+ intMin: data.int_min,
255
+ name: data.name,
256
+ propertyType: data.property_type,
257
+ stringConstraint: data.string_constraint,
258
+ unit: data.unit
259
+ };
260
+ };
261
+ var unmarshalEngineVersion = (data) => {
262
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`);
263
+ return {
264
+ availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting),
265
+ availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting),
266
+ beta: data.beta,
267
+ disabled: data.disabled,
268
+ endOfLife: unmarshalDate(data.end_of_life),
269
+ name: data.name,
270
+ version: data.version
271
+ };
272
+ };
273
+ var unmarshalDatabaseEngine = (data) => {
274
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`);
275
+ return {
276
+ logoUrl: data.logo_url,
277
+ name: data.name,
278
+ region: data.region,
279
+ versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)
280
+ };
434
281
  };
435
282
  const unmarshalListDatabaseEnginesResponse = (data) => {
436
- if (!isJSONObject(data)) {
437
- throw new TypeError(
438
- `Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`
439
- );
440
- }
441
- return {
442
- engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),
443
- totalCount: data.total_count
444
- };
283
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`);
284
+ return {
285
+ engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),
286
+ totalCount: data.total_count
287
+ };
445
288
  };
446
289
  const unmarshalListDatabasesResponse = (data) => {
447
- if (!isJSONObject(data)) {
448
- throw new TypeError(
449
- `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`
450
- );
451
- }
452
- return {
453
- databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
454
- totalCount: data.total_count
455
- };
290
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
291
+ return {
292
+ databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
293
+ totalCount: data.total_count
294
+ };
456
295
  };
457
296
  const unmarshalListInstanceACLRulesResponse = (data) => {
458
- if (!isJSONObject(data)) {
459
- throw new TypeError(
460
- `Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`
461
- );
462
- }
463
- return {
464
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
465
- totalCount: data.total_count
466
- };
467
- };
468
- const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data) => {
469
- if (!isJSONObject(data)) {
470
- throw new TypeError(
471
- `Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`
472
- );
473
- }
474
- return {
475
- logName: data.log_name,
476
- size: data.size
477
- };
297
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`);
298
+ return {
299
+ rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
300
+ totalCount: data.total_count
301
+ };
302
+ };
303
+ var unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data) => {
304
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`);
305
+ return {
306
+ logName: data.log_name,
307
+ size: data.size
308
+ };
478
309
  };
479
310
  const unmarshalListInstanceLogsDetailsResponse = (data) => {
480
- if (!isJSONObject(data)) {
481
- throw new TypeError(
482
- `Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`
483
- );
484
- }
485
- return {
486
- details: unmarshalArrayOfObject(
487
- data.details,
488
- unmarshalListInstanceLogsDetailsResponseInstanceLogDetail
489
- )
490
- };
311
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`);
312
+ return { details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail) };
491
313
  };
492
314
  const unmarshalListInstanceLogsResponse = (data) => {
493
- if (!isJSONObject(data)) {
494
- throw new TypeError(
495
- `Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`
496
- );
497
- }
498
- return {
499
- instanceLogs: unmarshalArrayOfObject(
500
- data.instance_logs,
501
- unmarshalInstanceLog
502
- )
503
- };
315
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`);
316
+ return { instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog) };
504
317
  };
505
318
  const unmarshalListInstancesResponse = (data) => {
506
- if (!isJSONObject(data)) {
507
- throw new TypeError(
508
- `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`
509
- );
510
- }
511
- return {
512
- instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
513
- totalCount: data.total_count
514
- };
515
- };
516
- const unmarshalNodeTypeVolumeConstraintSizes = (data) => {
517
- if (!isJSONObject(data)) {
518
- throw new TypeError(
519
- `Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`
520
- );
521
- }
522
- return {
523
- maxSize: data.max_size,
524
- minSize: data.min_size
525
- };
526
- };
527
- const unmarshalNodeTypeVolumeType = (data) => {
528
- if (!isJSONObject(data)) {
529
- throw new TypeError(
530
- `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`
531
- );
532
- }
533
- return {
534
- chunkSize: data.chunk_size,
535
- class: data.class,
536
- description: data.description,
537
- maxSize: data.max_size,
538
- minSize: data.min_size,
539
- type: data.type
540
- };
541
- };
542
- const unmarshalNodeType = (data) => {
543
- if (!isJSONObject(data)) {
544
- throw new TypeError(
545
- `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
546
- );
547
- }
548
- return {
549
- availableVolumeTypes: unmarshalArrayOfObject(
550
- data.available_volume_types,
551
- unmarshalNodeTypeVolumeType
552
- ),
553
- beta: data.beta,
554
- description: data.description,
555
- disabled: data.disabled,
556
- generation: data.generation,
557
- instanceRange: data.instance_range,
558
- isBssdCompatible: data.is_bssd_compatible,
559
- isHaRequired: data.is_ha_required,
560
- memory: data.memory,
561
- name: data.name,
562
- region: data.region,
563
- stockStatus: data.stock_status,
564
- vcpus: data.vcpus,
565
- volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : void 0
566
- };
319
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);
320
+ return {
321
+ instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
322
+ totalCount: data.total_count
323
+ };
324
+ };
325
+ var unmarshalNodeTypeVolumeConstraintSizes = (data) => {
326
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
327
+ return {
328
+ maxSize: data.max_size,
329
+ minSize: data.min_size
330
+ };
331
+ };
332
+ var unmarshalNodeTypeVolumeType = (data) => {
333
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
334
+ return {
335
+ chunkSize: data.chunk_size,
336
+ class: data.class,
337
+ description: data.description,
338
+ maxSize: data.max_size,
339
+ minSize: data.min_size,
340
+ type: data.type
341
+ };
342
+ };
343
+ var unmarshalNodeType = (data) => {
344
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
345
+ return {
346
+ availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
347
+ beta: data.beta,
348
+ description: data.description,
349
+ disabled: data.disabled,
350
+ generation: data.generation,
351
+ instanceRange: data.instance_range,
352
+ isBssdCompatible: data.is_bssd_compatible,
353
+ isHaRequired: data.is_ha_required,
354
+ memory: data.memory,
355
+ name: data.name,
356
+ region: data.region,
357
+ stockStatus: data.stock_status,
358
+ vcpus: data.vcpus,
359
+ volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : void 0
360
+ };
567
361
  };
568
362
  const unmarshalListNodeTypesResponse = (data) => {
569
- if (!isJSONObject(data)) {
570
- throw new TypeError(
571
- `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
572
- );
573
- }
574
- return {
575
- nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
576
- totalCount: data.total_count
577
- };
363
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
364
+ return {
365
+ nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
366
+ totalCount: data.total_count
367
+ };
578
368
  };
579
369
  const unmarshalListPrivilegesResponse = (data) => {
580
- if (!isJSONObject(data)) {
581
- throw new TypeError(
582
- `Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`
583
- );
584
- }
585
- return {
586
- privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),
587
- totalCount: data.total_count
588
- };
370
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`);
371
+ return {
372
+ privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),
373
+ totalCount: data.total_count
374
+ };
589
375
  };
590
376
  const unmarshalListSnapshotsResponse = (data) => {
591
- if (!isJSONObject(data)) {
592
- throw new TypeError(
593
- `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`
594
- );
595
- }
596
- return {
597
- snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
598
- totalCount: data.total_count
599
- };
377
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
378
+ return {
379
+ snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
380
+ totalCount: data.total_count
381
+ };
600
382
  };
601
383
  const unmarshalListUsersResponse = (data) => {
602
- if (!isJSONObject(data)) {
603
- throw new TypeError(
604
- `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`
605
- );
606
- }
607
- return {
608
- totalCount: data.total_count,
609
- users: unmarshalArrayOfObject(data.users, unmarshalUser)
610
- };
384
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
385
+ return {
386
+ totalCount: data.total_count,
387
+ users: unmarshalArrayOfObject(data.users, unmarshalUser)
388
+ };
611
389
  };
612
390
  const unmarshalPrepareInstanceLogsResponse = (data) => {
613
- if (!isJSONObject(data)) {
614
- throw new TypeError(
615
- `Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`
616
- );
617
- }
618
- return {
619
- instanceLogs: unmarshalArrayOfObject(
620
- data.instance_logs,
621
- unmarshalInstanceLog
622
- )
623
- };
391
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`);
392
+ return { instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog) };
624
393
  };
625
394
  const unmarshalSetInstanceACLRulesResponse = (data) => {
626
- if (!isJSONObject(data)) {
627
- throw new TypeError(
628
- `Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`
629
- );
630
- }
631
- return {
632
- rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
633
- };
395
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`);
396
+ return { rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule) };
634
397
  };
635
398
  const unmarshalSetInstanceSettingsResponse = (data) => {
636
- if (!isJSONObject(data)) {
637
- throw new TypeError(
638
- `Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`
639
- );
640
- }
641
- return {
642
- settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
643
- };
644
- };
645
- const marshalACLRuleRequest = (request, defaults) => ({
646
- description: request.description,
647
- ip: request.ip
648
- });
649
- const marshalAddInstanceACLRulesRequest = (request, defaults) => ({
650
- rules: request.rules.map((elt) => marshalACLRuleRequest(elt))
651
- });
652
- const marshalInstanceSetting = (request, defaults) => ({
653
- name: request.name,
654
- value: request.value
399
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`);
400
+ return { settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) };
401
+ };
402
+ var marshalACLRuleRequest = (request, defaults) => ({
403
+ description: request.description,
404
+ ip: request.ip
655
405
  });
656
- const marshalAddInstanceSettingsRequest = (request, defaults) => ({
657
- settings: request.settings.map((elt) => marshalInstanceSetting(elt))
406
+ const marshalAddInstanceACLRulesRequest = (request, defaults) => ({ rules: request.rules.map((elt) => marshalACLRuleRequest(elt, defaults)) });
407
+ var marshalInstanceSetting = (request, defaults) => ({
408
+ name: request.name,
409
+ value: request.value
658
410
  });
411
+ const marshalAddInstanceSettingsRequest = (request, defaults) => ({ settings: request.settings.map((elt) => marshalInstanceSetting(elt, defaults)) });
659
412
  const marshalCloneInstanceRequest = (request, defaults) => ({
660
- name: request.name,
661
- node_type: request.nodeType
413
+ name: request.name,
414
+ node_type: request.nodeType
662
415
  });
663
416
  const marshalCreateDatabaseBackupRequest = (request, defaults) => ({
664
- database_name: request.databaseName,
665
- expires_at: request.expiresAt,
666
- instance_id: request.instanceId,
667
- name: request.name || randomName("bkp")
668
- });
669
- const marshalCreateDatabaseRequest = (request, defaults) => ({
670
- name: request.name
671
- });
672
- const marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
673
- const marshalEndpointSpecLoadBalancer = (request, defaults) => ({});
674
- const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
675
- private_network_id: request.privateNetworkId,
676
- ...resolveOneOf([
677
- { param: "service_ip", value: request.serviceIp },
678
- {
679
- param: "ipam_config",
680
- value: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkIpamConfig(
681
- request.ipamConfig
682
- ) : void 0
683
- }
684
- ])
685
- });
686
- const marshalEndpointSpec = (request, defaults) => ({
687
- ...resolveOneOf([
688
- {
689
- param: "load_balancer",
690
- value: request.loadBalancer !== void 0 ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : void 0
691
- },
692
- {
693
- param: "private_network",
694
- value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0
695
- }
696
- ])
697
- });
698
- const marshalCreateEndpointRequest = (request, defaults) => ({
699
- endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec) : void 0
700
- });
417
+ database_name: request.databaseName,
418
+ expires_at: request.expiresAt,
419
+ instance_id: request.instanceId,
420
+ name: request.name || randomName("bkp")
421
+ });
422
+ const marshalCreateDatabaseRequest = (request, defaults) => ({ name: request.name });
423
+ var marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
424
+ var marshalEndpointSpecLoadBalancer = (request, defaults) => ({});
425
+ var marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
426
+ private_network_id: request.privateNetworkId,
427
+ ...resolveOneOf([{
428
+ param: "service_ip",
429
+ value: request.serviceIp
430
+ }, {
431
+ param: "ipam_config",
432
+ value: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig, defaults) : void 0
433
+ }])
434
+ });
435
+ var marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
436
+ param: "load_balancer",
437
+ value: request.loadBalancer !== void 0 ? marshalEndpointSpecLoadBalancer(request.loadBalancer, defaults) : void 0
438
+ }, {
439
+ param: "private_network",
440
+ value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork, defaults) : void 0
441
+ }]) });
442
+ const marshalCreateEndpointRequest = (request, defaults) => ({ endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec, defaults) : void 0 });
701
443
  const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({
702
- instance_name: request.instanceName,
703
- is_ha_cluster: request.isHaCluster,
704
- node_type: request.nodeType
705
- });
706
- const marshalEncryptionAtRest = (request, defaults) => ({
707
- enabled: request.enabled
444
+ instance_name: request.instanceName,
445
+ is_ha_cluster: request.isHaCluster,
446
+ node_type: request.nodeType
708
447
  });
448
+ var marshalEncryptionAtRest = (request, defaults) => ({ enabled: request.enabled });
709
449
  const marshalCreateInstanceRequest = (request, defaults) => ({
710
- backup_same_region: request.backupSameRegion,
711
- disable_backup: request.disableBackup,
712
- encryption: request.encryption !== void 0 ? marshalEncryptionAtRest(request.encryption) : void 0,
713
- engine: request.engine,
714
- init_endpoints: request.initEndpoints !== void 0 ? request.initEndpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,
715
- init_settings: request.initSettings !== void 0 ? request.initSettings.map((elt) => marshalInstanceSetting(elt)) : void 0,
716
- is_ha_cluster: request.isHaCluster,
717
- name: request.name || randomName("ins"),
718
- node_type: request.nodeType,
719
- password: request.password,
720
- tags: request.tags,
721
- user_name: request.userName,
722
- volume_size: request.volumeSize,
723
- volume_type: request.volumeType,
724
- ...resolveOneOf([
725
- {
726
- default: defaults.defaultProjectId,
727
- param: "project_id",
728
- value: request.projectId
729
- },
730
- {
731
- default: defaults.defaultOrganizationId,
732
- param: "organization_id",
733
- value: request.organizationId
734
- }
735
- ])
736
- });
737
- const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
738
- const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});
739
- const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({
740
- private_network_id: request.privateNetworkId,
741
- ...resolveOneOf([
742
- { param: "service_ip", value: request.serviceIp },
743
- {
744
- param: "ipam_config",
745
- value: request.ipamConfig !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(
746
- request.ipamConfig
747
- ) : void 0
748
- }
749
- ])
750
- });
751
- const marshalReadReplicaEndpointSpec = (request, defaults) => ({
752
- ...resolveOneOf([
753
- {
754
- param: "direct_access",
755
- value: request.directAccess !== void 0 ? marshalReadReplicaEndpointSpecDirectAccess(
756
- request.directAccess
757
- ) : void 0
758
- },
759
- {
760
- param: "private_network",
761
- value: request.privateNetwork !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetwork(
762
- request.privateNetwork
763
- ) : void 0
764
- }
765
- ])
766
- });
767
- const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({
768
- endpoint_spec: request.endpointSpec.map(
769
- (elt) => marshalReadReplicaEndpointSpec(elt)
770
- )
771
- });
450
+ backup_same_region: request.backupSameRegion,
451
+ disable_backup: request.disableBackup,
452
+ encryption: request.encryption !== void 0 ? marshalEncryptionAtRest(request.encryption, defaults) : void 0,
453
+ engine: request.engine,
454
+ init_endpoints: request.initEndpoints !== void 0 ? request.initEndpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
455
+ init_settings: request.initSettings !== void 0 ? request.initSettings.map((elt) => marshalInstanceSetting(elt, defaults)) : void 0,
456
+ is_ha_cluster: request.isHaCluster,
457
+ name: request.name || randomName("ins"),
458
+ node_type: request.nodeType,
459
+ password: request.password,
460
+ tags: request.tags,
461
+ user_name: request.userName,
462
+ volume_size: request.volumeSize,
463
+ volume_type: request.volumeType,
464
+ ...resolveOneOf([{
465
+ default: defaults.defaultProjectId,
466
+ param: "project_id",
467
+ value: request.projectId
468
+ }, {
469
+ default: defaults.defaultOrganizationId,
470
+ param: "organization_id",
471
+ value: request.organizationId
472
+ }])
473
+ });
474
+ var marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
475
+ var marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});
476
+ var marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({
477
+ private_network_id: request.privateNetworkId,
478
+ ...resolveOneOf([{
479
+ param: "service_ip",
480
+ value: request.serviceIp
481
+ }, {
482
+ param: "ipam_config",
483
+ value: request.ipamConfig !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig, defaults) : void 0
484
+ }])
485
+ });
486
+ var marshalReadReplicaEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
487
+ param: "direct_access",
488
+ value: request.directAccess !== void 0 ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess, defaults) : void 0
489
+ }, {
490
+ param: "private_network",
491
+ value: request.privateNetwork !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork, defaults) : void 0
492
+ }]) });
493
+ const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({ endpoint_spec: request.endpointSpec.map((elt) => marshalReadReplicaEndpointSpec(elt, defaults)) });
772
494
  const marshalCreateReadReplicaRequest = (request, defaults) => ({
773
- endpoint_spec: request.endpointSpec !== void 0 ? request.endpointSpec.map(
774
- (elt) => marshalReadReplicaEndpointSpec(elt)
775
- ) : void 0,
776
- instance_id: request.instanceId,
777
- same_zone: request.sameZone
495
+ endpoint_spec: request.endpointSpec !== void 0 ? request.endpointSpec.map((elt) => marshalReadReplicaEndpointSpec(elt, defaults)) : void 0,
496
+ instance_id: request.instanceId,
497
+ same_zone: request.sameZone
778
498
  });
779
499
  const marshalCreateSnapshotRequest = (request, defaults) => ({
780
- expires_at: request.expiresAt,
781
- name: request.name || randomName("snp")
500
+ expires_at: request.expiresAt,
501
+ name: request.name || randomName("snp")
782
502
  });
783
503
  const marshalCreateUserRequest = (request, defaults) => ({
784
- is_admin: request.isAdmin,
785
- name: request.name,
786
- password: request.password
787
- });
788
- const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({
789
- acl_rule_ips: request.aclRuleIps
790
- });
791
- const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({
792
- setting_names: request.settingNames
793
- });
794
- const marshalMigrateEndpointRequest = (request, defaults) => ({
795
- instance_id: request.instanceId
504
+ is_admin: request.isAdmin,
505
+ name: request.name,
506
+ password: request.password
796
507
  });
508
+ const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({ acl_rule_ips: request.aclRuleIps });
509
+ const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({ setting_names: request.settingNames });
510
+ const marshalMigrateEndpointRequest = (request, defaults) => ({ instance_id: request.instanceId });
797
511
  const marshalPrepareInstanceLogsRequest = (request, defaults) => ({
798
- end_date: request.endDate,
799
- start_date: request.startDate
800
- });
801
- const marshalPurgeInstanceLogsRequest = (request, defaults) => ({
802
- log_name: request.logName
512
+ end_date: request.endDate,
513
+ start_date: request.startDate
803
514
  });
515
+ const marshalPurgeInstanceLogsRequest = (request, defaults) => ({ log_name: request.logName });
804
516
  const marshalRestoreDatabaseBackupRequest = (request, defaults) => ({
805
- database_name: request.databaseName,
806
- instance_id: request.instanceId
807
- });
808
- const marshalSetInstanceACLRulesRequest = (request, defaults) => ({
809
- rules: request.rules.map((elt) => marshalACLRuleRequest(elt))
810
- });
811
- const marshalSetInstanceSettingsRequest = (request, defaults) => ({
812
- settings: request.settings.map((elt) => marshalInstanceSetting(elt))
517
+ database_name: request.databaseName,
518
+ instance_id: request.instanceId
813
519
  });
520
+ const marshalSetInstanceACLRulesRequest = (request, defaults) => ({ rules: request.rules.map((elt) => marshalACLRuleRequest(elt, defaults)) });
521
+ const marshalSetInstanceSettingsRequest = (request, defaults) => ({ settings: request.settings.map((elt) => marshalInstanceSetting(elt, defaults)) });
814
522
  const marshalSetPrivilegeRequest = (request, defaults) => ({
815
- database_name: request.databaseName,
816
- permission: request.permission,
817
- user_name: request.userName
523
+ database_name: request.databaseName,
524
+ permission: request.permission,
525
+ user_name: request.userName
818
526
  });
819
527
  const marshalUpdateDatabaseBackupRequest = (request, defaults) => ({
820
- expires_at: request.expiresAt,
821
- name: request.name
528
+ expires_at: request.expiresAt,
529
+ name: request.name
822
530
  });
823
- const marshalLogsPolicy = (request, defaults) => ({
824
- max_age_retention: request.maxAgeRetention,
825
- total_disk_retention: request.totalDiskRetention
531
+ var marshalLogsPolicy = (request, defaults) => ({
532
+ max_age_retention: request.maxAgeRetention,
533
+ total_disk_retention: request.totalDiskRetention
826
534
  });
827
535
  const marshalUpdateInstanceRequest = (request, defaults) => ({
828
- backup_same_region: request.backupSameRegion,
829
- backup_schedule_frequency: request.backupScheduleFrequency,
830
- backup_schedule_retention: request.backupScheduleRetention,
831
- backup_schedule_start_hour: request.backupScheduleStartHour,
832
- is_backup_schedule_disabled: request.isBackupScheduleDisabled,
833
- logs_policy: request.logsPolicy !== void 0 ? marshalLogsPolicy(request.logsPolicy) : void 0,
834
- name: request.name,
835
- tags: request.tags
536
+ backup_same_region: request.backupSameRegion,
537
+ backup_schedule_frequency: request.backupScheduleFrequency,
538
+ backup_schedule_retention: request.backupScheduleRetention,
539
+ backup_schedule_start_hour: request.backupScheduleStartHour,
540
+ is_backup_schedule_disabled: request.isBackupScheduleDisabled,
541
+ logs_policy: request.logsPolicy !== void 0 ? marshalLogsPolicy(request.logsPolicy, defaults) : void 0,
542
+ name: request.name,
543
+ tags: request.tags
836
544
  });
837
545
  const marshalUpdateSnapshotRequest = (request, defaults) => ({
838
- expires_at: request.expiresAt,
839
- name: request.name
546
+ expires_at: request.expiresAt,
547
+ name: request.name
840
548
  });
841
549
  const marshalUpdateUserRequest = (request, defaults) => ({
842
- is_admin: request.isAdmin,
843
- password: request.password
844
- });
845
- const marshalUpgradeInstanceRequestMajorUpgradeWorkflow = (request, defaults) => ({
846
- upgradable_version_id: request.upgradableVersionId,
847
- with_endpoints: request.withEndpoints
848
- });
849
- const marshalUpgradeInstanceRequest = (request, defaults) => ({
850
- ...resolveOneOf([
851
- { param: "node_type", value: request.nodeType },
852
- { param: "enable_ha", value: request.enableHa },
853
- { param: "volume_size", value: request.volumeSize },
854
- { param: "volume_type", value: request.volumeType },
855
- { param: "upgradable_version_id", value: request.upgradableVersionId },
856
- {
857
- param: "major_upgrade_workflow",
858
- value: request.majorUpgradeWorkflow !== void 0 ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow(
859
- request.majorUpgradeWorkflow
860
- ) : void 0
861
- },
862
- { param: "enable_encryption", value: request.enableEncryption }
863
- ])
864
- });
865
- export {
866
- marshalAddInstanceACLRulesRequest,
867
- marshalAddInstanceSettingsRequest,
868
- marshalCloneInstanceRequest,
869
- marshalCreateDatabaseBackupRequest,
870
- marshalCreateDatabaseRequest,
871
- marshalCreateEndpointRequest,
872
- marshalCreateInstanceFromSnapshotRequest,
873
- marshalCreateInstanceRequest,
874
- marshalCreateReadReplicaEndpointRequest,
875
- marshalCreateReadReplicaRequest,
876
- marshalCreateSnapshotRequest,
877
- marshalCreateUserRequest,
878
- marshalDeleteInstanceACLRulesRequest,
879
- marshalDeleteInstanceSettingsRequest,
880
- marshalMigrateEndpointRequest,
881
- marshalPrepareInstanceLogsRequest,
882
- marshalPurgeInstanceLogsRequest,
883
- marshalRestoreDatabaseBackupRequest,
884
- marshalSetInstanceACLRulesRequest,
885
- marshalSetInstanceSettingsRequest,
886
- marshalSetPrivilegeRequest,
887
- marshalUpdateDatabaseBackupRequest,
888
- marshalUpdateInstanceRequest,
889
- marshalUpdateSnapshotRequest,
890
- marshalUpdateUserRequest,
891
- marshalUpgradeInstanceRequest,
892
- unmarshalACLRule,
893
- unmarshalAddInstanceACLRulesResponse,
894
- unmarshalAddInstanceSettingsResponse,
895
- unmarshalBackupSchedule,
896
- unmarshalDatabase,
897
- unmarshalDatabaseBackup,
898
- unmarshalDeleteInstanceACLRulesResponse,
899
- unmarshalDeleteInstanceSettingsResponse,
900
- unmarshalEndpoint,
901
- unmarshalInstance,
902
- unmarshalInstanceLog,
903
- unmarshalInstanceMetrics,
904
- unmarshalListDatabaseBackupsResponse,
905
- unmarshalListDatabaseEnginesResponse,
906
- unmarshalListDatabasesResponse,
907
- unmarshalListInstanceACLRulesResponse,
908
- unmarshalListInstanceLogsDetailsResponse,
909
- unmarshalListInstanceLogsResponse,
910
- unmarshalListInstancesResponse,
911
- unmarshalListNodeTypesResponse,
912
- unmarshalListPrivilegesResponse,
913
- unmarshalListSnapshotsResponse,
914
- unmarshalListUsersResponse,
915
- unmarshalMaintenance,
916
- unmarshalPrepareInstanceLogsResponse,
917
- unmarshalPrivilege,
918
- unmarshalReadReplica,
919
- unmarshalSetInstanceACLRulesResponse,
920
- unmarshalSetInstanceSettingsResponse,
921
- unmarshalSnapshot,
922
- unmarshalUser
923
- };
550
+ is_admin: request.isAdmin,
551
+ password: request.password
552
+ });
553
+ var marshalUpgradeInstanceRequestMajorUpgradeWorkflow = (request, defaults) => ({
554
+ upgradable_version_id: request.upgradableVersionId,
555
+ with_endpoints: request.withEndpoints
556
+ });
557
+ const marshalUpgradeInstanceRequest = (request, defaults) => ({ ...resolveOneOf([
558
+ {
559
+ param: "node_type",
560
+ value: request.nodeType
561
+ },
562
+ {
563
+ param: "enable_ha",
564
+ value: request.enableHa
565
+ },
566
+ {
567
+ param: "volume_size",
568
+ value: request.volumeSize
569
+ },
570
+ {
571
+ param: "volume_type",
572
+ value: request.volumeType
573
+ },
574
+ {
575
+ param: "upgradable_version_id",
576
+ value: request.upgradableVersionId
577
+ },
578
+ {
579
+ param: "major_upgrade_workflow",
580
+ value: request.majorUpgradeWorkflow !== void 0 ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow(request.majorUpgradeWorkflow, defaults) : void 0
581
+ },
582
+ {
583
+ param: "enable_encryption",
584
+ value: request.enableEncryption
585
+ }
586
+ ]) });
587
+ export { marshalAddInstanceACLRulesRequest, marshalAddInstanceSettingsRequest, marshalCloneInstanceRequest, marshalCreateDatabaseBackupRequest, marshalCreateDatabaseRequest, marshalCreateEndpointRequest, marshalCreateInstanceFromSnapshotRequest, marshalCreateInstanceRequest, marshalCreateReadReplicaEndpointRequest, marshalCreateReadReplicaRequest, marshalCreateSnapshotRequest, marshalCreateUserRequest, marshalDeleteInstanceACLRulesRequest, marshalDeleteInstanceSettingsRequest, marshalMigrateEndpointRequest, marshalPrepareInstanceLogsRequest, marshalPurgeInstanceLogsRequest, marshalRestoreDatabaseBackupRequest, marshalSetInstanceACLRulesRequest, marshalSetInstanceSettingsRequest, marshalSetPrivilegeRequest, marshalUpdateDatabaseBackupRequest, marshalUpdateInstanceRequest, marshalUpdateSnapshotRequest, marshalUpdateUserRequest, marshalUpgradeInstanceRequest, unmarshalACLRule, unmarshalAddInstanceACLRulesResponse, unmarshalAddInstanceSettingsResponse, unmarshalBackupSchedule, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalDeleteInstanceACLRulesResponse, unmarshalDeleteInstanceSettingsResponse, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceLog, unmarshalInstanceMetrics, unmarshalListDatabaseBackupsResponse, unmarshalListDatabaseEnginesResponse, unmarshalListDatabasesResponse, unmarshalListInstanceACLRulesResponse, unmarshalListInstanceLogsDetailsResponse, unmarshalListInstanceLogsResponse, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListPrivilegesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalMaintenance, unmarshalPrepareInstanceLogsResponse, unmarshalPrivilege, unmarshalReadReplica, unmarshalSetInstanceACLRulesResponse, unmarshalSetInstanceSettingsResponse, unmarshalSnapshot, unmarshalUser };