@scaleway/sdk 2.0.0-alpha.12 → 2.0.0-alpha.14

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.
Files changed (63) hide show
  1. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +12 -12
  2. package/dist/api/baremetal/v1/marshalling.gen.js +60 -49
  3. package/dist/api/block/v1alpha1/api.gen.js +23 -19
  4. package/dist/api/block/v1alpha1/marshalling.gen.js +47 -40
  5. package/dist/api/block/v1alpha1/validation-rules.gen.js +11 -1
  6. package/dist/api/cockpit/v1beta1/api.gen.js +143 -48
  7. package/dist/api/cockpit/v1beta1/marshalling.gen.js +86 -35
  8. package/dist/api/container/v1beta1/index.gen.js +2 -0
  9. package/dist/api/container/v1beta1/marshalling.gen.js +63 -35
  10. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  11. package/dist/api/document_db/v1beta1/marshalling.gen.js +117 -61
  12. package/dist/api/domain/v2beta1/api.gen.js +29 -37
  13. package/dist/api/domain/v2beta1/index.gen.js +0 -2
  14. package/dist/api/domain/v2beta1/marshalling.gen.js +408 -194
  15. package/dist/api/flexibleip/v1alpha1/api.gen.js +6 -14
  16. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
  17. package/dist/api/function/v1beta1/index.gen.js +2 -0
  18. package/dist/api/function/v1beta1/marshalling.gen.js +64 -36
  19. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  20. package/dist/api/iam/v1alpha1/api.gen.js +26 -42
  21. package/dist/api/iam/v1alpha1/marshalling.gen.js +44 -33
  22. package/dist/api/instance/v1/api.gen.js +1 -1
  23. package/dist/api/instance/v1/marshalling.gen.js +394 -185
  24. package/dist/api/iot/v1/api.gen.js +24 -32
  25. package/dist/api/iot/v1/marshalling.gen.js +87 -36
  26. package/dist/api/ipam/index.js +2 -0
  27. package/dist/api/ipam/v1/api.gen.js +113 -0
  28. package/dist/api/ipam/v1/index.gen.js +6 -0
  29. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  30. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  31. package/dist/api/ipfs/v1alpha1/api.gen.js +120 -3
  32. package/dist/api/ipfs/v1alpha1/content.gen.js +4 -1
  33. package/dist/api/ipfs/v1alpha1/index.gen.js +2 -2
  34. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +78 -19
  35. package/dist/api/k8s/v1/marshalling.gen.js +125 -37
  36. package/dist/api/lb/v1/api.gen.js +1 -1
  37. package/dist/api/lb/v1/marshalling.gen.js +251 -135
  38. package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
  39. package/dist/api/marketplace/v2/api.gen.js +3 -3
  40. package/dist/api/mnq/index.js +2 -0
  41. package/dist/api/mnq/v1alpha1/api.gen.js +12 -20
  42. package/dist/api/mnq/v1alpha1/marshalling.gen.js +19 -14
  43. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  44. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  45. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  46. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  47. package/dist/api/rdb/v1/marshalling.gen.js +122 -64
  48. package/dist/api/redis/v1/marshalling.gen.js +51 -27
  49. package/dist/api/registry/v1/marshalling.gen.js +3 -1
  50. package/dist/api/secret/v1alpha1/marshalling.gen.js +11 -4
  51. package/dist/api/tem/v1alpha1/marshalling.gen.js +22 -13
  52. package/dist/api/test/v1/marshalling.gen.js +2 -0
  53. package/dist/api/vpc/v2/marshalling.gen.js +2 -0
  54. package/dist/api/vpcgw/v1/marshalling.gen.js +47 -24
  55. package/dist/api/webhosting/v1alpha1/api.gen.js +2 -54
  56. package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
  57. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +14 -41
  58. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +1 -10
  59. package/dist/index.cjs +3735 -1615
  60. package/dist/index.d.ts +5809 -2209
  61. package/dist/index.js +30 -28
  62. package/dist/scw/constants.js +1 -1
  63. package/package.json +2 -2
@@ -19,10 +19,10 @@ const unmarshalContainer = data => {
19
19
  }
20
20
  return {
21
21
  cpuLimit: data.cpu_limit,
22
- description: data.description ? data.description : undefined,
22
+ description: data.description,
23
23
  domainName: data.domain_name,
24
24
  environmentVariables: data.environment_variables,
25
- errorMessage: data.error_message ? data.error_message : undefined,
25
+ errorMessage: data.error_message,
26
26
  httpOption: data.http_option,
27
27
  id: data.id,
28
28
  maxConcurrency: data.max_concurrency,
@@ -38,7 +38,7 @@ const unmarshalContainer = data => {
38
38
  registryImage: data.registry_image,
39
39
  secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
40
40
  status: data.status,
41
- timeout: data.timeout ? data.timeout : undefined
41
+ timeout: data.timeout
42
42
  };
43
43
  };
44
44
  const unmarshalCron = data => {
@@ -46,7 +46,7 @@ const unmarshalCron = data => {
46
46
  throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
47
47
  }
48
48
  return {
49
- args: data.args ? data.args : undefined,
49
+ args: data.args,
50
50
  containerId: data.container_id,
51
51
  id: data.id,
52
52
  name: data.name,
@@ -60,7 +60,7 @@ const unmarshalDomain = data => {
60
60
  }
61
61
  return {
62
62
  containerId: data.container_id,
63
- errorMessage: data.error_message ? data.error_message : undefined,
63
+ errorMessage: data.error_message,
64
64
  hostname: data.hostname,
65
65
  id: data.id,
66
66
  status: data.status,
@@ -72,9 +72,9 @@ const unmarshalNamespace = data => {
72
72
  throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
73
73
  }
74
74
  return {
75
- description: data.description ? data.description : undefined,
75
+ description: data.description,
76
76
  environmentVariables: data.environment_variables,
77
- errorMessage: data.error_message ? data.error_message : undefined,
77
+ errorMessage: data.error_message,
78
78
  id: data.id,
79
79
  name: data.name,
80
80
  organizationId: data.organization_id,
@@ -91,12 +91,12 @@ const unmarshalToken = data => {
91
91
  throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
92
92
  }
93
93
  return {
94
- containerId: data.container_id ? data.container_id : undefined,
95
- description: data.description ? data.description : undefined,
94
+ containerId: data.container_id,
95
+ description: data.description,
96
96
  expiresAt: unmarshalDate(data.expires_at),
97
97
  id: data.id,
98
- namespaceId: data.namespace_id ? data.namespace_id : undefined,
99
- publicKey: data.public_key ? data.public_key : undefined,
98
+ namespaceId: data.namespace_id,
99
+ publicKey: data.public_key,
100
100
  status: data.status,
101
101
  token: data.token
102
102
  };
@@ -106,36 +106,37 @@ const unmarshalTriggerMnqNatsClientConfig = data => {
106
106
  throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
107
107
  }
108
108
  return {
109
- mnqCredentialId: data.mnq_credential_id ? data.mnq_credential_id : undefined,
109
+ mnqCredentialId: data.mnq_credential_id,
110
110
  mnqNamespaceId: data.mnq_namespace_id,
111
+ mnqNatsAccountId: data.mnq_nats_account_id,
111
112
  mnqProjectId: data.mnq_project_id,
112
113
  mnqRegion: data.mnq_region,
113
114
  subject: data.subject
114
115
  };
115
116
  };
116
- const unmarshalTriggerSqsClientConfig = data => {
117
- if (!isJSONObject(data)) {
118
- throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
119
- }
120
- return {
121
- accessKey: data.access_key,
122
- endpoint: data.endpoint,
123
- queueUrl: data.queue_url,
124
- secretKey: data.secret_key
125
- };
126
- };
127
117
  const unmarshalTriggerMnqSqsClientConfig = data => {
128
118
  if (!isJSONObject(data)) {
129
119
  throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
130
120
  }
131
121
  return {
132
- mnqCredentialId: data.mnq_credential_id ? data.mnq_credential_id : undefined,
122
+ mnqCredentialId: data.mnq_credential_id,
133
123
  mnqNamespaceId: data.mnq_namespace_id,
134
124
  mnqProjectId: data.mnq_project_id,
135
125
  mnqRegion: data.mnq_region,
136
126
  queue: data.queue
137
127
  };
138
128
  };
129
+ const unmarshalTriggerSqsClientConfig = data => {
130
+ if (!isJSONObject(data)) {
131
+ throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
132
+ }
133
+ return {
134
+ accessKey: data.access_key,
135
+ endpoint: data.endpoint,
136
+ queueUrl: data.queue_url,
137
+ secretKey: data.secret_key
138
+ };
139
+ };
139
140
  const unmarshalTrigger = data => {
140
141
  if (!isJSONObject(data)) {
141
142
  throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
@@ -143,7 +144,7 @@ const unmarshalTrigger = data => {
143
144
  return {
144
145
  containerId: data.container_id,
145
146
  description: data.description,
146
- errorMessage: data.error_message ? data.error_message : undefined,
147
+ errorMessage: data.error_message,
147
148
  id: data.id,
148
149
  inputType: data.input_type,
149
150
  name: data.name,
@@ -229,6 +230,10 @@ const unmarshalListTriggersResponse = data => {
229
230
  triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
230
231
  };
231
232
  };
233
+ const marshalSecret = (request, defaults) => ({
234
+ key: request.key,
235
+ value: request.value
236
+ });
232
237
  const marshalCreateContainerRequest = (request, defaults) => ({
233
238
  cpu_limit: request.cpuLimit,
234
239
  description: request.description,
@@ -244,7 +249,7 @@ const marshalCreateContainerRequest = (request, defaults) => ({
244
249
  privacy: request.privacy,
245
250
  protocol: request.protocol,
246
251
  registry_image: request.registryImage,
247
- secret_environment_variables: request.secretEnvironmentVariables,
252
+ secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
248
253
  timeout: request.timeout
249
254
  });
250
255
  const marshalCreateCronRequest = (request, defaults) => ({
@@ -262,7 +267,7 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
262
267
  environment_variables: request.environmentVariables,
263
268
  name: request.name || randomName('cns'),
264
269
  project_id: request.projectId ?? defaults.defaultProjectId,
265
- secret_environment_variables: request.secretEnvironmentVariables
270
+ secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
266
271
  });
267
272
  const marshalCreateTokenRequest = (request, defaults) => ({
268
273
  description: request.description,
@@ -275,19 +280,38 @@ const marshalCreateTokenRequest = (request, defaults) => ({
275
280
  value: request.namespaceId
276
281
  }])
277
282
  });
283
+ const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
284
+ mnq_namespace_id: request.mnqNamespaceId,
285
+ mnq_nats_account_id: request.mnqNatsAccountId,
286
+ mnq_project_id: request.mnqProjectId,
287
+ mnq_region: request.mnqRegion,
288
+ subject: request.subject
289
+ });
290
+ const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
291
+ mnq_namespace_id: request.mnqNamespaceId,
292
+ mnq_project_id: request.mnqProjectId,
293
+ mnq_region: request.mnqRegion,
294
+ queue: request.queue
295
+ });
296
+ const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
297
+ access_key: request.accessKey,
298
+ endpoint: request.endpoint,
299
+ queue_url: request.queueUrl,
300
+ secret_key: request.secretKey
301
+ });
278
302
  const marshalCreateTriggerRequest = (request, defaults) => ({
279
303
  container_id: request.containerId,
280
304
  description: request.description,
281
305
  name: request.name,
282
306
  ...resolveOneOf([{
283
- param: 'scw_nats_config',
284
- value: request.scwNatsConfig
285
- }, {
286
307
  param: 'scw_sqs_config',
287
- value: request.scwSqsConfig
308
+ value: request.scwSqsConfig !== undefined ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined
288
309
  }, {
289
310
  param: 'sqs_config',
290
- value: request.sqsConfig
311
+ value: request.sqsConfig !== undefined ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
312
+ }, {
313
+ param: 'scw_nats_config',
314
+ value: request.scwNatsConfig !== undefined ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined
291
315
  }])
292
316
  });
293
317
  const marshalUpdateContainerRequest = (request, defaults) => ({
@@ -304,7 +328,7 @@ const marshalUpdateContainerRequest = (request, defaults) => ({
304
328
  protocol: request.protocol,
305
329
  redeploy: request.redeploy,
306
330
  registry_image: request.registryImage,
307
- secret_environment_variables: request.secretEnvironmentVariables,
331
+ secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,
308
332
  timeout: request.timeout
309
333
  });
310
334
  const marshalUpdateCronRequest = (request, defaults) => ({
@@ -316,14 +340,18 @@ const marshalUpdateCronRequest = (request, defaults) => ({
316
340
  const marshalUpdateNamespaceRequest = (request, defaults) => ({
317
341
  description: request.description,
318
342
  environment_variables: request.environmentVariables,
319
- secret_environment_variables: request.secretEnvironmentVariables
343
+ secret_environment_variables: request.secretEnvironmentVariables !== undefined ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined
344
+ });
345
+ const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
346
+ access_key: request.accessKey,
347
+ secret_key: request.secretKey
320
348
  });
321
349
  const marshalUpdateTriggerRequest = (request, defaults) => ({
322
350
  description: request.description,
323
351
  name: request.name,
324
352
  ...resolveOneOf([{
325
353
  param: 'sqs_config',
326
- value: request.sqsConfig
354
+ value: request.sqsConfig !== undefined ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined
327
355
  }])
328
356
  });
329
357
 
@@ -0,0 +1,44 @@
1
+ // This file was automatically generated. DO NOT EDIT.
2
+ // If you have any remark or suggestion do not hesitate to open an issue.
3
+
4
+ const CreateTriggerRequest = {
5
+ description: {
6
+ maxLength: 255
7
+ },
8
+ name: {
9
+ maxLength: 50,
10
+ minLength: 1
11
+ }
12
+ };
13
+ const CreateTriggerRequestMnqNatsClientConfig = {
14
+ mnqRegion: {
15
+ maxLength: 20,
16
+ minLength: 1
17
+ },
18
+ subject: {
19
+ maxLength: 100,
20
+ minLength: 1,
21
+ pattern: /^[^\s]+$/
22
+ }
23
+ };
24
+ const CreateTriggerRequestMnqSqsClientConfig = {
25
+ mnqRegion: {
26
+ maxLength: 20,
27
+ minLength: 1
28
+ },
29
+ queue: {
30
+ maxLength: 100,
31
+ minLength: 1
32
+ }
33
+ };
34
+ const UpdateTriggerRequest = {
35
+ description: {
36
+ maxLength: 255
37
+ },
38
+ name: {
39
+ maxLength: 50,
40
+ minLength: 1
41
+ }
42
+ };
43
+
44
+ export { CreateTriggerRequest, CreateTriggerRequestMnqNatsClientConfig, CreateTriggerRequestMnqSqsClientConfig, UpdateTriggerRequest };
@@ -33,11 +33,11 @@ const unmarshalEndpoint = data => {
33
33
  }
34
34
  return {
35
35
  directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : undefined,
36
- hostname: data.hostname ? data.hostname : undefined,
36
+ hostname: data.hostname,
37
37
  id: data.id,
38
- ip: data.ip ? data.ip : undefined,
38
+ ip: data.ip,
39
39
  loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : undefined,
40
- name: data.name ? data.name : undefined,
40
+ name: data.name,
41
41
  port: data.port,
42
42
  privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined
43
43
  };
@@ -71,7 +71,7 @@ const unmarshalInstanceLog = data => {
71
71
  }
72
72
  return {
73
73
  createdAt: unmarshalDate(data.created_at),
74
- downloadUrl: data.download_url ? data.download_url : undefined,
74
+ downloadUrl: data.download_url,
75
75
  expiresAt: unmarshalDate(data.expires_at),
76
76
  id: data.id,
77
77
  nodeName: data.node_name,
@@ -79,27 +79,6 @@ const unmarshalInstanceLog = data => {
79
79
  status: data.status
80
80
  };
81
81
  };
82
- const unmarshalMaintenance = data => {
83
- if (!isJSONObject(data)) {
84
- throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
85
- }
86
- return {
87
- closedAt: unmarshalDate(data.closed_at),
88
- reason: data.reason,
89
- startsAt: unmarshalDate(data.starts_at),
90
- status: data.status,
91
- stopsAt: unmarshalDate(data.stops_at)
92
- };
93
- };
94
- const unmarshalLogsPolicy = data => {
95
- if (!isJSONObject(data)) {
96
- throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
97
- }
98
- return {
99
- maxAgeRetention: data.max_age_retention ? data.max_age_retention : undefined,
100
- totalDiskRetention: data.total_disk_retention ? data.total_disk_retention : undefined
101
- };
102
- };
103
82
  const unmarshalBackupSchedule = data => {
104
83
  if (!isJSONObject(data)) {
105
84
  throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);
@@ -120,6 +99,27 @@ const unmarshalInstanceSetting = data => {
120
99
  value: data.value
121
100
  };
122
101
  };
102
+ const unmarshalLogsPolicy = data => {
103
+ if (!isJSONObject(data)) {
104
+ throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
105
+ }
106
+ return {
107
+ maxAgeRetention: data.max_age_retention,
108
+ totalDiskRetention: data.total_disk_retention
109
+ };
110
+ };
111
+ const unmarshalMaintenance = data => {
112
+ if (!isJSONObject(data)) {
113
+ throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
114
+ }
115
+ return {
116
+ closedAt: unmarshalDate(data.closed_at),
117
+ reason: data.reason,
118
+ startsAt: unmarshalDate(data.starts_at),
119
+ status: data.status,
120
+ stopsAt: unmarshalDate(data.stops_at)
121
+ };
122
+ };
123
123
  const unmarshalUpgradableVersion = data => {
124
124
  if (!isJSONObject(data)) {
125
125
  throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
@@ -146,7 +146,7 @@ const unmarshalInstance = data => {
146
146
  }
147
147
  return {
148
148
  backupSameRegion: data.backup_same_region,
149
- backupSchedule: unmarshalBackupSchedule(data.backup_schedule),
149
+ backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : undefined,
150
150
  createdAt: unmarshalDate(data.created_at),
151
151
  endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : undefined,
152
152
  endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
@@ -154,7 +154,7 @@ const unmarshalInstance = data => {
154
154
  id: data.id,
155
155
  initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting),
156
156
  isHaCluster: data.is_ha_cluster,
157
- logsPolicy: unmarshalLogsPolicy(data.logs_policy),
157
+ logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : undefined,
158
158
  maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),
159
159
  name: data.name,
160
160
  nodeType: data.node_type,
@@ -166,7 +166,7 @@ const unmarshalInstance = data => {
166
166
  status: data.status,
167
167
  tags: data.tags,
168
168
  upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
169
- volume: unmarshalVolume(data.volume)
169
+ volume: data.volume ? unmarshalVolume(data.volume) : undefined
170
170
  };
171
171
  };
172
172
  const unmarshalPrivilege = data => {
@@ -192,7 +192,7 @@ const unmarshalSnapshot = data => {
192
192
  name: data.name,
193
193
  nodeType: data.node_type,
194
194
  region: data.region,
195
- size: data.size ? data.size : undefined,
195
+ size: data.size,
196
196
  status: data.status,
197
197
  updatedAt: unmarshalDate(data.updated_at)
198
198
  };
@@ -215,7 +215,7 @@ const unmarshalACLRule = data => {
215
215
  description: data.description,
216
216
  direction: data.direction,
217
217
  ip: data.ip,
218
- port: data.port ? data.port : undefined,
218
+ port: data.port,
219
219
  protocol: data.protocol
220
220
  };
221
221
  };
@@ -266,15 +266,15 @@ const unmarshalEngineSetting = data => {
266
266
  return {
267
267
  defaultValue: data.default_value,
268
268
  description: data.description,
269
- floatMax: data.float_max ? data.float_max : undefined,
270
- floatMin: data.float_min ? data.float_min : undefined,
269
+ floatMax: data.float_max,
270
+ floatMin: data.float_min,
271
271
  hotConfigurable: data.hot_configurable,
272
- intMax: data.int_max ? data.int_max : undefined,
273
- intMin: data.int_min ? data.int_min : undefined,
272
+ intMax: data.int_max,
273
+ intMin: data.int_min,
274
274
  name: data.name,
275
275
  propertyType: data.property_type,
276
- stringConstraint: data.string_constraint ? data.string_constraint : undefined,
277
- unit: data.unit ? data.unit : undefined
276
+ stringConstraint: data.string_constraint,
277
+ unit: data.unit
278
278
  };
279
279
  };
280
280
  const unmarshalEngineVersion = data => {
@@ -363,25 +363,25 @@ const unmarshalListInstancesResponse = data => {
363
363
  totalCount: data.total_count
364
364
  };
365
365
  };
366
- const unmarshalNodeTypeVolumeType = data => {
366
+ const unmarshalNodeTypeVolumeConstraintSizes = data => {
367
367
  if (!isJSONObject(data)) {
368
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
368
+ throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
369
369
  }
370
370
  return {
371
- chunkSize: data.chunk_size,
372
- description: data.description,
373
371
  maxSize: data.max_size,
374
- minSize: data.min_size,
375
- type: data.type
372
+ minSize: data.min_size
376
373
  };
377
374
  };
378
- const unmarshalNodeTypeVolumeConstraintSizes = data => {
375
+ const unmarshalNodeTypeVolumeType = data => {
379
376
  if (!isJSONObject(data)) {
380
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
377
+ throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
381
378
  }
382
379
  return {
380
+ chunkSize: data.chunk_size,
381
+ description: data.description,
383
382
  maxSize: data.max_size,
384
- minSize: data.min_size
383
+ minSize: data.min_size,
384
+ type: data.type
385
385
  };
386
386
  };
387
387
  const unmarshalNodeType = data => {
@@ -395,7 +395,7 @@ const unmarshalNodeType = data => {
395
395
  disabled: data.disabled,
396
396
  generation: data.generation,
397
397
  instanceRange: data.instance_range,
398
- isBssdCompatible: data.is_bssd_compatible ? data.is_bssd_compatible : undefined,
398
+ isBssdCompatible: data.is_bssd_compatible,
399
399
  isHaRequired: data.is_ha_required,
400
400
  memory: data.memory,
401
401
  name: data.name,
@@ -457,11 +457,19 @@ const unmarshalSetInstanceSettingsResponse = data => {
457
457
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
458
458
  };
459
459
  };
460
+ const marshalACLRuleRequest = (request, defaults) => ({
461
+ description: request.description,
462
+ ip: request.ip
463
+ });
460
464
  const marshalAddInstanceACLRulesRequest = (request, defaults) => ({
461
- rules: request.rules
465
+ rules: request.rules.map(elt => marshalACLRuleRequest(elt))
466
+ });
467
+ const marshalInstanceSetting = (request, defaults) => ({
468
+ name: request.name,
469
+ value: request.value
462
470
  });
463
471
  const marshalAddInstanceSettingsRequest = (request, defaults) => ({
464
- settings: request.settings
472
+ settings: request.settings.map(elt => marshalInstanceSetting(elt))
465
473
  });
466
474
  const marshalCloneInstanceRequest = (request, defaults) => ({
467
475
  name: request.name,
@@ -470,8 +478,29 @@ const marshalCloneInstanceRequest = (request, defaults) => ({
470
478
  const marshalCreateDatabaseRequest = (request, defaults) => ({
471
479
  name: request.name
472
480
  });
481
+ const marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
482
+ const marshalEndpointSpecLoadBalancer = (request, defaults) => ({});
483
+ const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
484
+ private_network_id: request.privateNetworkId,
485
+ ...resolveOneOf([{
486
+ param: 'service_ip',
487
+ value: request.serviceIp
488
+ }, {
489
+ param: 'ipam_config',
490
+ value: request.ipamConfig !== undefined ? marshalEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined
491
+ }])
492
+ });
493
+ const marshalEndpointSpec = (request, defaults) => ({
494
+ ...resolveOneOf([{
495
+ param: 'load_balancer',
496
+ value: request.loadBalancer !== undefined ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : undefined
497
+ }, {
498
+ param: 'private_network',
499
+ value: request.privateNetwork !== undefined ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
500
+ }])
501
+ });
473
502
  const marshalCreateEndpointRequest = (request, defaults) => ({
474
- endpoint_spec: request.endpointSpec
503
+ endpoint_spec: request.endpointSpec !== undefined ? marshalEndpointSpec(request.endpointSpec) : undefined
475
504
  });
476
505
  const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({
477
506
  instance_name: request.instanceName,
@@ -482,8 +511,8 @@ const marshalCreateInstanceRequest = (request, defaults) => ({
482
511
  backup_same_region: request.backupSameRegion,
483
512
  disable_backup: request.disableBackup,
484
513
  engine: request.engine,
485
- init_endpoints: request.initEndpoints,
486
- init_settings: request.initSettings,
514
+ init_endpoints: request.initEndpoints !== undefined ? request.initEndpoints.map(elt => marshalEndpointSpec(elt)) : undefined,
515
+ init_settings: request.initSettings !== undefined ? request.initSettings.map(elt => marshalInstanceSetting(elt)) : undefined,
487
516
  is_ha_cluster: request.isHaCluster,
488
517
  name: request.name || randomName('ins'),
489
518
  node_type: request.nodeType,
@@ -493,18 +522,41 @@ const marshalCreateInstanceRequest = (request, defaults) => ({
493
522
  volume_size: request.volumeSize,
494
523
  volume_type: request.volumeType,
495
524
  ...resolveOneOf([{
525
+ default: defaults.defaultOrganizationId,
496
526
  param: 'organization_id',
497
527
  value: request.organizationId
498
528
  }, {
529
+ default: defaults.defaultProjectId,
499
530
  param: 'project_id',
500
531
  value: request.projectId
501
532
  }])
502
533
  });
534
+ const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
535
+ const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});
536
+ const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({
537
+ private_network_id: request.privateNetworkId,
538
+ ...resolveOneOf([{
539
+ param: 'service_ip',
540
+ value: request.serviceIp
541
+ }, {
542
+ param: 'ipam_config',
543
+ value: request.ipamConfig !== undefined ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined
544
+ }])
545
+ });
546
+ const marshalReadReplicaEndpointSpec = (request, defaults) => ({
547
+ ...resolveOneOf([{
548
+ param: 'direct_access',
549
+ value: request.directAccess !== undefined ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess) : undefined
550
+ }, {
551
+ param: 'private_network',
552
+ value: request.privateNetwork !== undefined ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
553
+ }])
554
+ });
503
555
  const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({
504
- endpoint_spec: request.endpointSpec
556
+ endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt))
505
557
  });
506
558
  const marshalCreateReadReplicaRequest = (request, defaults) => ({
507
- endpoint_spec: request.endpointSpec,
559
+ endpoint_spec: request.endpointSpec !== undefined ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt)) : undefined,
508
560
  instance_id: request.instanceId,
509
561
  same_zone: request.sameZone
510
562
  });
@@ -530,23 +582,27 @@ const marshalPurgeInstanceLogsRequest = (request, defaults) => ({
530
582
  log_name: request.logName
531
583
  });
532
584
  const marshalSetInstanceACLRulesRequest = (request, defaults) => ({
533
- rules: request.rules
585
+ rules: request.rules.map(elt => marshalACLRuleRequest(elt))
534
586
  });
535
587
  const marshalSetInstanceSettingsRequest = (request, defaults) => ({
536
- settings: request.settings
588
+ settings: request.settings.map(elt => marshalInstanceSetting(elt))
537
589
  });
538
590
  const marshalSetPrivilegeRequest = (request, defaults) => ({
539
591
  database_name: request.databaseName,
540
592
  permission: request.permission,
541
593
  user_name: request.userName
542
594
  });
595
+ const marshalLogsPolicy = (request, defaults) => ({
596
+ max_age_retention: request.maxAgeRetention,
597
+ total_disk_retention: request.totalDiskRetention
598
+ });
543
599
  const marshalUpdateInstanceRequest = (request, defaults) => ({
544
600
  backup_same_region: request.backupSameRegion,
545
601
  backup_schedule_frequency: request.backupScheduleFrequency,
546
602
  backup_schedule_retention: request.backupScheduleRetention,
547
603
  backup_schedule_start_hour: request.backupScheduleStartHour,
548
604
  is_backup_schedule_disabled: request.isBackupScheduleDisabled,
549
- logs_policy: request.logsPolicy,
605
+ logs_policy: request.logsPolicy !== undefined ? marshalLogsPolicy(request.logsPolicy) : undefined,
550
606
  name: request.name,
551
607
  tags: request.tags
552
608
  });
@@ -560,20 +616,20 @@ const marshalUpdateUserRequest = (request, defaults) => ({
560
616
  });
561
617
  const marshalUpgradeInstanceRequest = (request, defaults) => ({
562
618
  ...resolveOneOf([{
563
- param: 'enable_ha',
564
- value: request.enableHa
565
- }, {
566
619
  param: 'node_type',
567
620
  value: request.nodeType
568
621
  }, {
569
- param: 'upgradable_version_id',
570
- value: request.upgradableVersionId
622
+ param: 'enable_ha',
623
+ value: request.enableHa
571
624
  }, {
572
625
  param: 'volume_size',
573
626
  value: request.volumeSize
574
627
  }, {
575
628
  param: 'volume_type',
576
629
  value: request.volumeType
630
+ }, {
631
+ param: 'upgradable_version_id',
632
+ value: request.upgradableVersionId
577
633
  }])
578
634
  });
579
635