@scaleway/sdk-rdb 2.2.1 → 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.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1/api.gen.js +723 -1033
- package/dist/v1/content.gen.js +29 -34
- package/dist/v1/index.gen.js +71 -69
- package/dist/v1/marshalling.gen.js +496 -809
- package/dist/v1/validation-rules.gen.js +4 -8
- package/package.json +4 -4
|
@@ -1,900 +1,587 @@
|
|
|
1
|
+
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalTimeSeries } from "@scaleway/sdk-client";
|
|
1
2
|
import randomName from "@scaleway/random-name";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
tags: data.tags,
|
|
230
|
-
upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
|
|
231
|
-
volume: data.volume ? unmarshalVolume(data.volume) : void 0
|
|
232
|
-
};
|
|
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
|
+
};
|
|
233
167
|
};
|
|
234
168
|
const unmarshalPrivilege = (data) => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
throw new TypeError(
|
|
249
|
-
`Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
return {
|
|
253
|
-
class: data.class,
|
|
254
|
-
type: data.type
|
|
255
|
-
};
|
|
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
|
+
};
|
|
256
182
|
};
|
|
257
183
|
const unmarshalSnapshot = (data) => {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
status: data.status,
|
|
274
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
275
|
-
volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : void 0
|
|
276
|
-
};
|
|
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
|
+
};
|
|
277
199
|
};
|
|
278
200
|
const unmarshalUser = (data) => {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return {
|
|
285
|
-
isAdmin: data.is_admin,
|
|
286
|
-
name: data.name
|
|
287
|
-
};
|
|
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
|
+
};
|
|
288
206
|
};
|
|
289
207
|
const unmarshalACLRule = (data) => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
ip: data.ip,
|
|
300
|
-
port: data.port,
|
|
301
|
-
protocol: data.protocol
|
|
302
|
-
};
|
|
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
|
+
};
|
|
303
217
|
};
|
|
304
218
|
const unmarshalAddInstanceACLRulesResponse = (data) => {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
return {
|
|
311
|
-
rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
|
|
312
|
-
};
|
|
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) };
|
|
313
221
|
};
|
|
314
222
|
const unmarshalAddInstanceSettingsResponse = (data) => {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`
|
|
318
|
-
);
|
|
319
|
-
}
|
|
320
|
-
return {
|
|
321
|
-
settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
|
|
322
|
-
};
|
|
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) };
|
|
323
225
|
};
|
|
324
226
|
const unmarshalDeleteInstanceACLRulesResponse = (data) => {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
return {
|
|
331
|
-
rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
|
|
332
|
-
};
|
|
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) };
|
|
333
229
|
};
|
|
334
230
|
const unmarshalDeleteInstanceSettingsResponse = (data) => {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
return {
|
|
341
|
-
settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
|
|
342
|
-
};
|
|
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) };
|
|
343
233
|
};
|
|
344
234
|
const unmarshalInstanceMetrics = (data) => {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
return {
|
|
351
|
-
timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
|
|
352
|
-
};
|
|
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) };
|
|
353
237
|
};
|
|
354
238
|
const unmarshalListDatabaseBackupsResponse = (data) => {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
name: data.name,
|
|
398
|
-
version: data.version
|
|
399
|
-
};
|
|
400
|
-
};
|
|
401
|
-
const unmarshalDatabaseEngine = (data) => {
|
|
402
|
-
if (!isJSONObject(data)) {
|
|
403
|
-
throw new TypeError(
|
|
404
|
-
`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
return {
|
|
408
|
-
logoUrl: data.logo_url,
|
|
409
|
-
name: data.name,
|
|
410
|
-
region: data.region,
|
|
411
|
-
versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)
|
|
412
|
-
};
|
|
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
|
+
};
|
|
413
281
|
};
|
|
414
282
|
const unmarshalListDatabaseEnginesResponse = (data) => {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
return {
|
|
421
|
-
engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),
|
|
422
|
-
totalCount: data.total_count
|
|
423
|
-
};
|
|
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
|
+
};
|
|
424
288
|
};
|
|
425
289
|
const unmarshalListDatabasesResponse = (data) => {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
return {
|
|
432
|
-
databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
|
|
433
|
-
totalCount: data.total_count
|
|
434
|
-
};
|
|
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
|
+
};
|
|
435
295
|
};
|
|
436
296
|
const unmarshalListInstanceACLRulesResponse = (data) => {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
throw new TypeError(
|
|
450
|
-
`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`
|
|
451
|
-
);
|
|
452
|
-
}
|
|
453
|
-
return {
|
|
454
|
-
logName: data.log_name,
|
|
455
|
-
size: data.size
|
|
456
|
-
};
|
|
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
|
+
};
|
|
457
309
|
};
|
|
458
310
|
const unmarshalListInstanceLogsDetailsResponse = (data) => {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
return {
|
|
465
|
-
details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail)
|
|
466
|
-
};
|
|
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) };
|
|
467
313
|
};
|
|
468
314
|
const unmarshalListInstanceLogsResponse = (data) => {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`
|
|
472
|
-
);
|
|
473
|
-
}
|
|
474
|
-
return {
|
|
475
|
-
instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)
|
|
476
|
-
};
|
|
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) };
|
|
477
317
|
};
|
|
478
318
|
const unmarshalListInstancesResponse = (data) => {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
return {
|
|
522
|
-
availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
|
|
523
|
-
beta: data.beta,
|
|
524
|
-
description: data.description,
|
|
525
|
-
disabled: data.disabled,
|
|
526
|
-
generation: data.generation,
|
|
527
|
-
instanceRange: data.instance_range,
|
|
528
|
-
isBssdCompatible: data.is_bssd_compatible,
|
|
529
|
-
isHaRequired: data.is_ha_required,
|
|
530
|
-
memory: data.memory,
|
|
531
|
-
name: data.name,
|
|
532
|
-
region: data.region,
|
|
533
|
-
stockStatus: data.stock_status,
|
|
534
|
-
vcpus: data.vcpus,
|
|
535
|
-
volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : void 0
|
|
536
|
-
};
|
|
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
|
+
};
|
|
537
361
|
};
|
|
538
362
|
const unmarshalListNodeTypesResponse = (data) => {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
return {
|
|
545
|
-
nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
|
|
546
|
-
totalCount: data.total_count
|
|
547
|
-
};
|
|
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
|
+
};
|
|
548
368
|
};
|
|
549
369
|
const unmarshalListPrivilegesResponse = (data) => {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
return {
|
|
556
|
-
privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),
|
|
557
|
-
totalCount: data.total_count
|
|
558
|
-
};
|
|
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
|
+
};
|
|
559
375
|
};
|
|
560
376
|
const unmarshalListSnapshotsResponse = (data) => {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
return {
|
|
567
|
-
snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
|
|
568
|
-
totalCount: data.total_count
|
|
569
|
-
};
|
|
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
|
+
};
|
|
570
382
|
};
|
|
571
383
|
const unmarshalListUsersResponse = (data) => {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
return {
|
|
578
|
-
totalCount: data.total_count,
|
|
579
|
-
users: unmarshalArrayOfObject(data.users, unmarshalUser)
|
|
580
|
-
};
|
|
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
|
+
};
|
|
581
389
|
};
|
|
582
390
|
const unmarshalPrepareInstanceLogsResponse = (data) => {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
`Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`
|
|
586
|
-
);
|
|
587
|
-
}
|
|
588
|
-
return {
|
|
589
|
-
instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)
|
|
590
|
-
};
|
|
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) };
|
|
591
393
|
};
|
|
592
394
|
const unmarshalSetInstanceACLRulesResponse = (data) => {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`
|
|
596
|
-
);
|
|
597
|
-
}
|
|
598
|
-
return {
|
|
599
|
-
rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
|
|
600
|
-
};
|
|
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) };
|
|
601
397
|
};
|
|
602
398
|
const unmarshalSetInstanceSettingsResponse = (data) => {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
|
|
610
|
-
};
|
|
611
|
-
};
|
|
612
|
-
const marshalACLRuleRequest = (request, defaults) => ({
|
|
613
|
-
description: request.description,
|
|
614
|
-
ip: request.ip
|
|
615
|
-
});
|
|
616
|
-
const marshalAddInstanceACLRulesRequest = (request, defaults) => ({
|
|
617
|
-
rules: request.rules.map((elt) => marshalACLRuleRequest(elt))
|
|
618
|
-
});
|
|
619
|
-
const marshalInstanceSetting = (request, defaults) => ({
|
|
620
|
-
name: request.name,
|
|
621
|
-
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
|
|
622
405
|
});
|
|
623
|
-
const
|
|
624
|
-
|
|
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
|
|
625
410
|
});
|
|
411
|
+
const marshalAddInstanceSettingsRequest = (request, defaults) => ({ settings: request.settings.map((elt) => marshalInstanceSetting(elt, defaults)) });
|
|
626
412
|
const marshalCloneInstanceRequest = (request, defaults) => ({
|
|
627
|
-
|
|
628
|
-
|
|
413
|
+
name: request.name,
|
|
414
|
+
node_type: request.nodeType
|
|
629
415
|
});
|
|
630
416
|
const marshalCreateDatabaseBackupRequest = (request, defaults) => ({
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
});
|
|
636
|
-
const marshalCreateDatabaseRequest = (request, defaults) => ({
|
|
637
|
-
|
|
638
|
-
});
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
param: "load_balancer",
|
|
658
|
-
value: request.loadBalancer !== void 0 ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : void 0
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
param: "private_network",
|
|
662
|
-
value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0
|
|
663
|
-
}
|
|
664
|
-
])
|
|
665
|
-
});
|
|
666
|
-
const marshalCreateEndpointRequest = (request, defaults) => ({
|
|
667
|
-
endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec) : void 0
|
|
668
|
-
});
|
|
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 });
|
|
669
443
|
const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
});
|
|
674
|
-
const marshalEncryptionAtRest = (request, defaults) => ({
|
|
675
|
-
enabled: request.enabled
|
|
444
|
+
instance_name: request.instanceName,
|
|
445
|
+
is_ha_cluster: request.isHaCluster,
|
|
446
|
+
node_type: request.nodeType
|
|
676
447
|
});
|
|
448
|
+
var marshalEncryptionAtRest = (request, defaults) => ({ enabled: request.enabled });
|
|
677
449
|
const marshalCreateInstanceRequest = (request, defaults) => ({
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
{
|
|
723
|
-
param: "direct_access",
|
|
724
|
-
value: request.directAccess !== void 0 ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess) : void 0
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
param: "private_network",
|
|
728
|
-
value: request.privateNetwork !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork) : void 0
|
|
729
|
-
}
|
|
730
|
-
])
|
|
731
|
-
});
|
|
732
|
-
const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({
|
|
733
|
-
endpoint_spec: request.endpointSpec.map((elt) => marshalReadReplicaEndpointSpec(elt))
|
|
734
|
-
});
|
|
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)) });
|
|
735
494
|
const marshalCreateReadReplicaRequest = (request, defaults) => ({
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
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
|
|
739
498
|
});
|
|
740
499
|
const marshalCreateSnapshotRequest = (request, defaults) => ({
|
|
741
|
-
|
|
742
|
-
|
|
500
|
+
expires_at: request.expiresAt,
|
|
501
|
+
name: request.name || randomName("snp")
|
|
743
502
|
});
|
|
744
503
|
const marshalCreateUserRequest = (request, defaults) => ({
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
});
|
|
749
|
-
const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({
|
|
750
|
-
acl_rule_ips: request.aclRuleIps
|
|
751
|
-
});
|
|
752
|
-
const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({
|
|
753
|
-
setting_names: request.settingNames
|
|
754
|
-
});
|
|
755
|
-
const marshalMigrateEndpointRequest = (request, defaults) => ({
|
|
756
|
-
instance_id: request.instanceId
|
|
504
|
+
is_admin: request.isAdmin,
|
|
505
|
+
name: request.name,
|
|
506
|
+
password: request.password
|
|
757
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 });
|
|
758
511
|
const marshalPrepareInstanceLogsRequest = (request, defaults) => ({
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
});
|
|
762
|
-
const marshalPurgeInstanceLogsRequest = (request, defaults) => ({
|
|
763
|
-
log_name: request.logName
|
|
512
|
+
end_date: request.endDate,
|
|
513
|
+
start_date: request.startDate
|
|
764
514
|
});
|
|
515
|
+
const marshalPurgeInstanceLogsRequest = (request, defaults) => ({ log_name: request.logName });
|
|
765
516
|
const marshalRestoreDatabaseBackupRequest = (request, defaults) => ({
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
});
|
|
769
|
-
const marshalSetInstanceACLRulesRequest = (request, defaults) => ({
|
|
770
|
-
rules: request.rules.map((elt) => marshalACLRuleRequest(elt))
|
|
771
|
-
});
|
|
772
|
-
const marshalSetInstanceSettingsRequest = (request, defaults) => ({
|
|
773
|
-
settings: request.settings.map((elt) => marshalInstanceSetting(elt))
|
|
517
|
+
database_name: request.databaseName,
|
|
518
|
+
instance_id: request.instanceId
|
|
774
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)) });
|
|
775
522
|
const marshalSetPrivilegeRequest = (request, defaults) => ({
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
523
|
+
database_name: request.databaseName,
|
|
524
|
+
permission: request.permission,
|
|
525
|
+
user_name: request.userName
|
|
779
526
|
});
|
|
780
527
|
const marshalUpdateDatabaseBackupRequest = (request, defaults) => ({
|
|
781
|
-
|
|
782
|
-
|
|
528
|
+
expires_at: request.expiresAt,
|
|
529
|
+
name: request.name
|
|
783
530
|
});
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
531
|
+
var marshalLogsPolicy = (request, defaults) => ({
|
|
532
|
+
max_age_retention: request.maxAgeRetention,
|
|
533
|
+
total_disk_retention: request.totalDiskRetention
|
|
787
534
|
});
|
|
788
535
|
const marshalUpdateInstanceRequest = (request, defaults) => ({
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
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
|
|
797
544
|
});
|
|
798
545
|
const marshalUpdateSnapshotRequest = (request, defaults) => ({
|
|
799
|
-
|
|
800
|
-
|
|
546
|
+
expires_at: request.expiresAt,
|
|
547
|
+
name: request.name
|
|
801
548
|
});
|
|
802
549
|
const marshalUpdateUserRequest = (request, defaults) => ({
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
});
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
});
|
|
810
|
-
const marshalUpgradeInstanceRequest = (request, defaults) => ({
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
});
|
|
842
|
-
export {
|
|
843
|
-
marshalAddInstanceACLRulesRequest,
|
|
844
|
-
marshalAddInstanceSettingsRequest,
|
|
845
|
-
marshalCloneInstanceRequest,
|
|
846
|
-
marshalCreateDatabaseBackupRequest,
|
|
847
|
-
marshalCreateDatabaseRequest,
|
|
848
|
-
marshalCreateEndpointRequest,
|
|
849
|
-
marshalCreateInstanceFromSnapshotRequest,
|
|
850
|
-
marshalCreateInstanceRequest,
|
|
851
|
-
marshalCreateReadReplicaEndpointRequest,
|
|
852
|
-
marshalCreateReadReplicaRequest,
|
|
853
|
-
marshalCreateSnapshotRequest,
|
|
854
|
-
marshalCreateUserRequest,
|
|
855
|
-
marshalDeleteInstanceACLRulesRequest,
|
|
856
|
-
marshalDeleteInstanceSettingsRequest,
|
|
857
|
-
marshalMigrateEndpointRequest,
|
|
858
|
-
marshalPrepareInstanceLogsRequest,
|
|
859
|
-
marshalPurgeInstanceLogsRequest,
|
|
860
|
-
marshalRestoreDatabaseBackupRequest,
|
|
861
|
-
marshalSetInstanceACLRulesRequest,
|
|
862
|
-
marshalSetInstanceSettingsRequest,
|
|
863
|
-
marshalSetPrivilegeRequest,
|
|
864
|
-
marshalUpdateDatabaseBackupRequest,
|
|
865
|
-
marshalUpdateInstanceRequest,
|
|
866
|
-
marshalUpdateSnapshotRequest,
|
|
867
|
-
marshalUpdateUserRequest,
|
|
868
|
-
marshalUpgradeInstanceRequest,
|
|
869
|
-
unmarshalACLRule,
|
|
870
|
-
unmarshalAddInstanceACLRulesResponse,
|
|
871
|
-
unmarshalAddInstanceSettingsResponse,
|
|
872
|
-
unmarshalBackupSchedule,
|
|
873
|
-
unmarshalDatabase,
|
|
874
|
-
unmarshalDatabaseBackup,
|
|
875
|
-
unmarshalDeleteInstanceACLRulesResponse,
|
|
876
|
-
unmarshalDeleteInstanceSettingsResponse,
|
|
877
|
-
unmarshalEndpoint,
|
|
878
|
-
unmarshalInstance,
|
|
879
|
-
unmarshalInstanceLog,
|
|
880
|
-
unmarshalInstanceMetrics,
|
|
881
|
-
unmarshalListDatabaseBackupsResponse,
|
|
882
|
-
unmarshalListDatabaseEnginesResponse,
|
|
883
|
-
unmarshalListDatabasesResponse,
|
|
884
|
-
unmarshalListInstanceACLRulesResponse,
|
|
885
|
-
unmarshalListInstanceLogsDetailsResponse,
|
|
886
|
-
unmarshalListInstanceLogsResponse,
|
|
887
|
-
unmarshalListInstancesResponse,
|
|
888
|
-
unmarshalListNodeTypesResponse,
|
|
889
|
-
unmarshalListPrivilegesResponse,
|
|
890
|
-
unmarshalListSnapshotsResponse,
|
|
891
|
-
unmarshalListUsersResponse,
|
|
892
|
-
unmarshalMaintenance,
|
|
893
|
-
unmarshalPrepareInstanceLogsResponse,
|
|
894
|
-
unmarshalPrivilege,
|
|
895
|
-
unmarshalReadReplica,
|
|
896
|
-
unmarshalSetInstanceACLRulesResponse,
|
|
897
|
-
unmarshalSetInstanceSettingsResponse,
|
|
898
|
-
unmarshalSnapshot,
|
|
899
|
-
unmarshalUser
|
|
900
|
-
};
|
|
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 };
|