@scaleway/sdk 2.0.0-alpha.7 → 2.0.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.
Files changed (78) hide show
  1. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +12 -12
  2. package/dist/api/baremetal/v1/marshalling.gen.js +63 -52
  3. package/dist/api/billing/v2alpha1/api.gen.js +32 -1
  4. package/dist/api/billing/v2alpha1/marshalling.gen.js +46 -1
  5. package/dist/api/block/v1alpha1/api.gen.js +23 -19
  6. package/dist/api/block/v1alpha1/marshalling.gen.js +47 -40
  7. package/dist/api/block/v1alpha1/validation-rules.gen.js +11 -1
  8. package/dist/api/cockpit/v1beta1/api.gen.js +143 -48
  9. package/dist/api/cockpit/v1beta1/marshalling.gen.js +89 -36
  10. package/dist/api/container/v1beta1/index.gen.js +2 -0
  11. package/dist/api/container/v1beta1/marshalling.gen.js +63 -35
  12. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  13. package/dist/api/document_db/v1beta1/marshalling.gen.js +117 -61
  14. package/dist/api/domain/v2beta1/api.gen.js +29 -37
  15. package/dist/api/domain/v2beta1/index.gen.js +0 -2
  16. package/dist/api/domain/v2beta1/marshalling.gen.js +408 -194
  17. package/dist/api/flexibleip/v1alpha1/api.gen.js +6 -14
  18. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
  19. package/dist/api/function/v1beta1/api.gen.js +36 -0
  20. package/dist/api/function/v1beta1/index.gen.js +2 -0
  21. package/dist/api/function/v1beta1/marshalling.gen.js +64 -36
  22. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  23. package/dist/api/iam/v1alpha1/api.gen.js +54 -44
  24. package/dist/api/iam/v1alpha1/marshalling.gen.js +69 -34
  25. package/dist/api/iam/v1alpha1/validation-rules.gen.js +10 -1
  26. package/dist/api/instance/v1/api.gen.js +1 -1
  27. package/dist/api/instance/v1/content.gen.js +4 -1
  28. package/dist/api/instance/v1/index.js +1 -1
  29. package/dist/api/instance/v1/marshalling.gen.js +414 -205
  30. package/dist/api/iot/v1/api.gen.js +24 -32
  31. package/dist/api/iot/v1/marshalling.gen.js +87 -36
  32. package/dist/api/ipam/index.js +2 -0
  33. package/dist/api/ipam/v1/api.gen.js +113 -0
  34. package/dist/api/ipam/v1/index.gen.js +6 -0
  35. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  36. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  37. package/dist/api/ipfs/v1alpha1/api.gen.js +120 -3
  38. package/dist/api/ipfs/v1alpha1/content.gen.js +4 -1
  39. package/dist/api/ipfs/v1alpha1/index.gen.js +2 -2
  40. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +71 -19
  41. package/dist/api/jobs/index.js +2 -0
  42. package/dist/api/jobs/v1alpha1/api.gen.js +111 -0
  43. package/dist/api/jobs/v1alpha1/content.gen.js +7 -0
  44. package/dist/api/jobs/v1alpha1/index.gen.js +7 -0
  45. package/dist/api/jobs/v1alpha1/marshalling.gen.js +84 -0
  46. package/dist/api/jobs/v1alpha1/validation-rules.gen.js +45 -0
  47. package/dist/api/k8s/v1/marshalling.gen.js +128 -40
  48. package/dist/api/lb/v1/api.gen.js +1 -1
  49. package/dist/api/lb/v1/marshalling.gen.js +268 -152
  50. package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
  51. package/dist/api/marketplace/v2/api.gen.js +3 -3
  52. package/dist/api/mnq/index.js +2 -0
  53. package/dist/api/mnq/v1alpha1/api.gen.js +12 -20
  54. package/dist/api/mnq/v1alpha1/marshalling.gen.js +19 -14
  55. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  56. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  57. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  58. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  59. package/dist/api/rdb/v1/marshalling.gen.js +131 -66
  60. package/dist/api/redis/v1/marshalling.gen.js +51 -27
  61. package/dist/api/registry/v1/marshalling.gen.js +6 -4
  62. package/dist/api/secret/v1alpha1/api.gen.js +2 -2
  63. package/dist/api/secret/v1alpha1/marshalling.gen.js +17 -5
  64. package/dist/api/std/index.gen.js +1 -0
  65. package/dist/api/tem/v1alpha1/api.gen.js +8 -2
  66. package/dist/api/tem/v1alpha1/marshalling.gen.js +35 -13
  67. package/dist/api/test/v1/marshalling.gen.js +5 -3
  68. package/dist/api/vpc/v2/marshalling.gen.js +2 -0
  69. package/dist/api/vpcgw/v1/marshalling.gen.js +53 -24
  70. package/dist/api/webhosting/v1alpha1/api.gen.js +2 -54
  71. package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
  72. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +14 -41
  73. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +1 -10
  74. package/dist/index.cjs +4351 -1833
  75. package/dist/index.d.ts +6778 -2542
  76. package/dist/index.js +34 -28
  77. package/dist/scw/constants.js +1 -1
  78. package/package.json +2 -2
@@ -0,0 +1,212 @@
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.2/node_modules/@scaleway/random-name/dist/index.js';
2
+ import { isJSONObject } from '../../../helpers/json.js';
3
+ import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.js';
4
+
5
+ // This file was automatically generated. DO NOT EDIT.
6
+ // If you have any remark or suggestion do not hesitate to open an issue.
7
+ const unmarshalNatsAccount = data => {
8
+ if (!isJSONObject(data)) {
9
+ throw new TypeError(`Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.`);
10
+ }
11
+ return {
12
+ createdAt: unmarshalDate(data.created_at),
13
+ endpoint: data.endpoint,
14
+ id: data.id,
15
+ name: data.name,
16
+ projectId: data.project_id,
17
+ region: data.region,
18
+ updatedAt: unmarshalDate(data.updated_at)
19
+ };
20
+ };
21
+ const unmarshalFile = data => {
22
+ if (!isJSONObject(data)) {
23
+ throw new TypeError(`Unmarshalling the type 'File' failed as data isn't a dictionary.`);
24
+ }
25
+ return {
26
+ content: data.content,
27
+ name: data.name
28
+ };
29
+ };
30
+ const unmarshalNatsCredentials = data => {
31
+ if (!isJSONObject(data)) {
32
+ throw new TypeError(`Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.`);
33
+ }
34
+ return {
35
+ checksum: data.checksum,
36
+ createdAt: unmarshalDate(data.created_at),
37
+ credentials: data.credentials ? unmarshalFile(data.credentials) : undefined,
38
+ id: data.id,
39
+ name: data.name,
40
+ natsAccountId: data.nats_account_id,
41
+ updatedAt: unmarshalDate(data.updated_at)
42
+ };
43
+ };
44
+ const unmarshalSnsPermissions = data => {
45
+ if (!isJSONObject(data)) {
46
+ throw new TypeError(`Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.`);
47
+ }
48
+ return {
49
+ canManage: data.can_manage,
50
+ canPublish: data.can_publish,
51
+ canReceive: data.can_receive
52
+ };
53
+ };
54
+ const unmarshalSnsCredentials = data => {
55
+ if (!isJSONObject(data)) {
56
+ throw new TypeError(`Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.`);
57
+ }
58
+ return {
59
+ accessKey: data.access_key,
60
+ createdAt: unmarshalDate(data.created_at),
61
+ id: data.id,
62
+ name: data.name,
63
+ permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : undefined,
64
+ projectId: data.project_id,
65
+ region: data.region,
66
+ secretChecksum: data.secret_checksum,
67
+ secretKey: data.secret_key,
68
+ updatedAt: unmarshalDate(data.updated_at)
69
+ };
70
+ };
71
+ const unmarshalSqsPermissions = data => {
72
+ if (!isJSONObject(data)) {
73
+ throw new TypeError(`Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.`);
74
+ }
75
+ return {
76
+ canManage: data.can_manage,
77
+ canPublish: data.can_publish,
78
+ canReceive: data.can_receive
79
+ };
80
+ };
81
+ const unmarshalSqsCredentials = data => {
82
+ if (!isJSONObject(data)) {
83
+ throw new TypeError(`Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.`);
84
+ }
85
+ return {
86
+ accessKey: data.access_key,
87
+ createdAt: unmarshalDate(data.created_at),
88
+ id: data.id,
89
+ name: data.name,
90
+ permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : undefined,
91
+ projectId: data.project_id,
92
+ region: data.region,
93
+ secretChecksum: data.secret_checksum,
94
+ secretKey: data.secret_key,
95
+ updatedAt: unmarshalDate(data.updated_at)
96
+ };
97
+ };
98
+ const unmarshalListNatsAccountsResponse = data => {
99
+ if (!isJSONObject(data)) {
100
+ throw new TypeError(`Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`);
101
+ }
102
+ return {
103
+ natsAccounts: unmarshalArrayOfObject(data.nats_accounts, unmarshalNatsAccount),
104
+ totalCount: data.total_count
105
+ };
106
+ };
107
+ const unmarshalListNatsCredentialsResponse = data => {
108
+ if (!isJSONObject(data)) {
109
+ throw new TypeError(`Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`);
110
+ }
111
+ return {
112
+ natsCredentials: unmarshalArrayOfObject(data.nats_credentials, unmarshalNatsCredentials),
113
+ totalCount: data.total_count
114
+ };
115
+ };
116
+ const unmarshalListSnsCredentialsResponse = data => {
117
+ if (!isJSONObject(data)) {
118
+ throw new TypeError(`Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`);
119
+ }
120
+ return {
121
+ snsCredentials: unmarshalArrayOfObject(data.sns_credentials, unmarshalSnsCredentials),
122
+ totalCount: data.total_count
123
+ };
124
+ };
125
+ const unmarshalListSqsCredentialsResponse = data => {
126
+ if (!isJSONObject(data)) {
127
+ throw new TypeError(`Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`);
128
+ }
129
+ return {
130
+ sqsCredentials: unmarshalArrayOfObject(data.sqs_credentials, unmarshalSqsCredentials),
131
+ totalCount: data.total_count
132
+ };
133
+ };
134
+ const unmarshalSnsInfo = data => {
135
+ if (!isJSONObject(data)) {
136
+ throw new TypeError(`Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.`);
137
+ }
138
+ return {
139
+ createdAt: unmarshalDate(data.created_at),
140
+ projectId: data.project_id,
141
+ region: data.region,
142
+ snsEndpointUrl: data.sns_endpoint_url,
143
+ status: data.status,
144
+ updatedAt: unmarshalDate(data.updated_at)
145
+ };
146
+ };
147
+ const unmarshalSqsInfo = data => {
148
+ if (!isJSONObject(data)) {
149
+ throw new TypeError(`Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.`);
150
+ }
151
+ return {
152
+ createdAt: unmarshalDate(data.created_at),
153
+ projectId: data.project_id,
154
+ region: data.region,
155
+ sqsEndpointUrl: data.sqs_endpoint_url,
156
+ status: data.status,
157
+ updatedAt: unmarshalDate(data.updated_at)
158
+ };
159
+ };
160
+ const marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({
161
+ name: request.name || randomName('mnq'),
162
+ project_id: request.projectId ?? defaults.defaultProjectId
163
+ });
164
+ const marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({
165
+ name: request.name || randomName('mnq'),
166
+ nats_account_id: request.natsAccountId
167
+ });
168
+ const marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({
169
+ name: request.name
170
+ });
171
+ const marshalSnsApiActivateSnsRequest = (request, defaults) => ({
172
+ project_id: request.projectId ?? defaults.defaultProjectId
173
+ });
174
+ const marshalSnsPermissions = (request, defaults) => ({
175
+ can_manage: request.canManage,
176
+ can_publish: request.canPublish,
177
+ can_receive: request.canReceive
178
+ });
179
+ const marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({
180
+ name: request.name || randomName('mnq_sns'),
181
+ permissions: request.permissions !== undefined ? marshalSnsPermissions(request.permissions) : undefined,
182
+ project_id: request.projectId ?? defaults.defaultProjectId
183
+ });
184
+ const marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({
185
+ project_id: request.projectId ?? defaults.defaultProjectId
186
+ });
187
+ const marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({
188
+ name: request.name,
189
+ permissions: request.permissions !== undefined ? marshalSnsPermissions(request.permissions) : undefined
190
+ });
191
+ const marshalSqsApiActivateSqsRequest = (request, defaults) => ({
192
+ project_id: request.projectId ?? defaults.defaultProjectId
193
+ });
194
+ const marshalSqsPermissions = (request, defaults) => ({
195
+ can_manage: request.canManage,
196
+ can_publish: request.canPublish,
197
+ can_receive: request.canReceive
198
+ });
199
+ const marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({
200
+ name: request.name || randomName('mnq_sqs'),
201
+ permissions: request.permissions !== undefined ? marshalSqsPermissions(request.permissions) : undefined,
202
+ project_id: request.projectId ?? defaults.defaultProjectId
203
+ });
204
+ const marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({
205
+ project_id: request.projectId ?? defaults.defaultProjectId
206
+ });
207
+ const marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({
208
+ name: request.name,
209
+ permissions: request.permissions !== undefined ? marshalSqsPermissions(request.permissions) : undefined
210
+ });
211
+
212
+ export { marshalNatsApiCreateNatsAccountRequest, marshalNatsApiCreateNatsCredentialsRequest, marshalNatsApiUpdateNatsAccountRequest, marshalSnsApiActivateSnsRequest, marshalSnsApiCreateSnsCredentialsRequest, marshalSnsApiDeactivateSnsRequest, marshalSnsApiUpdateSnsCredentialsRequest, marshalSqsApiActivateSqsRequest, marshalSqsApiCreateSqsCredentialsRequest, marshalSqsApiDeactivateSqsRequest, marshalSqsApiUpdateSqsCredentialsRequest, unmarshalListNatsAccountsResponse, unmarshalListNatsCredentialsResponse, unmarshalListSnsCredentialsResponse, unmarshalListSqsCredentialsResponse, unmarshalNatsAccount, unmarshalNatsCredentials, unmarshalSnsCredentials, unmarshalSnsInfo, unmarshalSqsCredentials, unmarshalSqsInfo };
@@ -0,0 +1,77 @@
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 NatsAccount = {
5
+ name: {
6
+ maxLength: 64,
7
+ minLength: 1
8
+ }
9
+ };
10
+ const NatsApiCreateNatsAccountRequest = {
11
+ name: {
12
+ maxLength: 64,
13
+ minLength: 1
14
+ }
15
+ };
16
+ const NatsApiCreateNatsCredentialsRequest = {
17
+ name: {
18
+ maxLength: 500,
19
+ minLength: 1
20
+ }
21
+ };
22
+ const NatsApiUpdateNatsAccountRequest = {
23
+ name: {
24
+ maxLength: 64,
25
+ minLength: 1
26
+ }
27
+ };
28
+ const NatsCredentials = {
29
+ name: {
30
+ maxLength: 500,
31
+ minLength: 1
32
+ }
33
+ };
34
+ const SnsApiCreateSnsCredentialsRequest = {
35
+ name: {
36
+ maxLength: 500,
37
+ minLength: 1
38
+ }
39
+ };
40
+ const SnsApiUpdateSnsCredentialsRequest = {
41
+ name: {
42
+ maxLength: 500,
43
+ minLength: 1
44
+ }
45
+ };
46
+ const SnsCredentials = {
47
+ accessKey: {
48
+ minLength: 1
49
+ },
50
+ name: {
51
+ maxLength: 500,
52
+ minLength: 1
53
+ }
54
+ };
55
+ const SqsApiCreateSqsCredentialsRequest = {
56
+ name: {
57
+ maxLength: 500,
58
+ minLength: 1
59
+ }
60
+ };
61
+ const SqsApiUpdateSqsCredentialsRequest = {
62
+ name: {
63
+ maxLength: 500,
64
+ minLength: 1
65
+ }
66
+ };
67
+ const SqsCredentials = {
68
+ accessKey: {
69
+ minLength: 1
70
+ },
71
+ name: {
72
+ maxLength: 500,
73
+ minLength: 1
74
+ }
75
+ };
76
+
77
+ export { NatsAccount, NatsApiCreateNatsAccountRequest, NatsApiCreateNatsCredentialsRequest, NatsApiUpdateNatsAccountRequest, NatsCredentials, SnsApiCreateSnsCredentialsRequest, SnsApiUpdateSnsCredentialsRequest, SnsCredentials, SqsApiCreateSqsCredentialsRequest, SqsApiUpdateSqsCredentialsRequest, SqsCredentials };
@@ -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
  };
@@ -61,7 +61,7 @@ const unmarshalDatabaseBackup = data => {
61
61
  return {
62
62
  createdAt: unmarshalDate(data.created_at),
63
63
  databaseName: data.database_name,
64
- downloadUrl: data.download_url ? data.download_url : undefined,
64
+ downloadUrl: data.download_url,
65
65
  downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),
66
66
  expiresAt: unmarshalDate(data.expires_at),
67
67
  id: data.id,
@@ -70,7 +70,7 @@ const unmarshalDatabaseBackup = data => {
70
70
  name: data.name,
71
71
  region: data.region,
72
72
  sameRegion: data.same_region,
73
- size: data.size ? data.size : undefined,
73
+ size: data.size,
74
74
  status: data.status,
75
75
  updatedAt: unmarshalDate(data.updated_at)
76
76
  };
@@ -92,7 +92,7 @@ const unmarshalInstanceLog = data => {
92
92
  }
93
93
  return {
94
94
  createdAt: unmarshalDate(data.created_at),
95
- downloadUrl: data.download_url ? data.download_url : undefined,
95
+ downloadUrl: data.download_url,
96
96
  expiresAt: unmarshalDate(data.expires_at),
97
97
  id: data.id,
98
98
  nodeName: data.node_name,
@@ -100,27 +100,6 @@ const unmarshalInstanceLog = data => {
100
100
  status: data.status
101
101
  };
102
102
  };
103
- const unmarshalMaintenance = data => {
104
- if (!isJSONObject(data)) {
105
- throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
106
- }
107
- return {
108
- closedAt: unmarshalDate(data.closed_at),
109
- reason: data.reason,
110
- startsAt: unmarshalDate(data.starts_at),
111
- status: data.status,
112
- stopsAt: unmarshalDate(data.stops_at)
113
- };
114
- };
115
- const unmarshalLogsPolicy = data => {
116
- if (!isJSONObject(data)) {
117
- throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
118
- }
119
- return {
120
- maxAgeRetention: data.max_age_retention ? data.max_age_retention : undefined,
121
- totalDiskRetention: data.total_disk_retention ? data.total_disk_retention : undefined
122
- };
123
- };
124
103
  const unmarshalBackupSchedule = data => {
125
104
  if (!isJSONObject(data)) {
126
105
  throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);
@@ -141,6 +120,27 @@ const unmarshalInstanceSetting = data => {
141
120
  value: data.value
142
121
  };
143
122
  };
123
+ const unmarshalLogsPolicy = data => {
124
+ if (!isJSONObject(data)) {
125
+ throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
126
+ }
127
+ return {
128
+ maxAgeRetention: data.max_age_retention,
129
+ totalDiskRetention: data.total_disk_retention
130
+ };
131
+ };
132
+ const unmarshalMaintenance = data => {
133
+ if (!isJSONObject(data)) {
134
+ throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
135
+ }
136
+ return {
137
+ closedAt: unmarshalDate(data.closed_at),
138
+ reason: data.reason,
139
+ startsAt: unmarshalDate(data.starts_at),
140
+ status: data.status,
141
+ stopsAt: unmarshalDate(data.stops_at)
142
+ };
143
+ };
144
144
  const unmarshalUpgradableVersion = data => {
145
145
  if (!isJSONObject(data)) {
146
146
  throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
@@ -157,6 +157,7 @@ const unmarshalVolume = data => {
157
157
  throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
158
158
  }
159
159
  return {
160
+ class: data.class,
160
161
  size: data.size,
161
162
  type: data.type
162
163
  };
@@ -167,7 +168,7 @@ const unmarshalInstance = data => {
167
168
  }
168
169
  return {
169
170
  backupSameRegion: data.backup_same_region,
170
- backupSchedule: unmarshalBackupSchedule(data.backup_schedule),
171
+ backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : undefined,
171
172
  createdAt: unmarshalDate(data.created_at),
172
173
  endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : undefined,
173
174
  endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
@@ -175,7 +176,7 @@ const unmarshalInstance = data => {
175
176
  id: data.id,
176
177
  initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting),
177
178
  isHaCluster: data.is_ha_cluster,
178
- logsPolicy: unmarshalLogsPolicy(data.logs_policy),
179
+ logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : undefined,
179
180
  maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),
180
181
  name: data.name,
181
182
  nodeType: data.node_type,
@@ -187,7 +188,7 @@ const unmarshalInstance = data => {
187
188
  status: data.status,
188
189
  tags: data.tags,
189
190
  upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
190
- volume: unmarshalVolume(data.volume)
191
+ volume: data.volume ? unmarshalVolume(data.volume) : undefined
191
192
  };
192
193
  };
193
194
  const unmarshalPrivilege = data => {
@@ -213,7 +214,7 @@ const unmarshalSnapshot = data => {
213
214
  name: data.name,
214
215
  nodeType: data.node_type,
215
216
  region: data.region,
216
- size: data.size ? data.size : undefined,
217
+ size: data.size,
217
218
  status: data.status,
218
219
  updatedAt: unmarshalDate(data.updated_at)
219
220
  };
@@ -236,7 +237,7 @@ const unmarshalACLRule = data => {
236
237
  description: data.description,
237
238
  direction: data.direction,
238
239
  ip: data.ip,
239
- port: data.port ? data.port : undefined,
240
+ port: data.port,
240
241
  protocol: data.protocol
241
242
  };
242
243
  };
@@ -296,15 +297,15 @@ const unmarshalEngineSetting = data => {
296
297
  return {
297
298
  defaultValue: data.default_value,
298
299
  description: data.description,
299
- floatMax: data.float_max ? data.float_max : undefined,
300
- floatMin: data.float_min ? data.float_min : undefined,
300
+ floatMax: data.float_max,
301
+ floatMin: data.float_min,
301
302
  hotConfigurable: data.hot_configurable,
302
- intMax: data.int_max ? data.int_max : undefined,
303
- intMin: data.int_min ? data.int_min : undefined,
303
+ intMax: data.int_max,
304
+ intMin: data.int_min,
304
305
  name: data.name,
305
306
  propertyType: data.property_type,
306
- stringConstraint: data.string_constraint ? data.string_constraint : undefined,
307
- unit: data.unit ? data.unit : undefined
307
+ stringConstraint: data.string_constraint,
308
+ unit: data.unit
308
309
  };
309
310
  };
310
311
  const unmarshalEngineVersion = data => {
@@ -393,25 +394,26 @@ const unmarshalListInstancesResponse = data => {
393
394
  totalCount: data.total_count
394
395
  };
395
396
  };
396
- const unmarshalNodeTypeVolumeType = data => {
397
+ const unmarshalNodeTypeVolumeConstraintSizes = data => {
397
398
  if (!isJSONObject(data)) {
398
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
399
+ throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
399
400
  }
400
401
  return {
401
- chunkSize: data.chunk_size,
402
- description: data.description,
403
402
  maxSize: data.max_size,
404
- minSize: data.min_size,
405
- type: data.type
403
+ minSize: data.min_size
406
404
  };
407
405
  };
408
- const unmarshalNodeTypeVolumeConstraintSizes = data => {
406
+ const unmarshalNodeTypeVolumeType = data => {
409
407
  if (!isJSONObject(data)) {
410
- throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
408
+ throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
411
409
  }
412
410
  return {
411
+ chunkSize: data.chunk_size,
412
+ class: data.class,
413
+ description: data.description,
413
414
  maxSize: data.max_size,
414
- minSize: data.min_size
415
+ minSize: data.min_size,
416
+ type: data.type
415
417
  };
416
418
  };
417
419
  const unmarshalNodeType = data => {
@@ -425,7 +427,7 @@ const unmarshalNodeType = data => {
425
427
  disabled: data.disabled,
426
428
  generation: data.generation,
427
429
  instanceRange: data.instance_range,
428
- isBssdCompatible: data.is_bssd_compatible ? data.is_bssd_compatible : undefined,
430
+ isBssdCompatible: data.is_bssd_compatible,
429
431
  isHaRequired: data.is_ha_required,
430
432
  memory: data.memory,
431
433
  name: data.name,
@@ -495,11 +497,19 @@ const unmarshalSetInstanceSettingsResponse = data => {
495
497
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
496
498
  };
497
499
  };
500
+ const marshalACLRuleRequest = (request, defaults) => ({
501
+ description: request.description,
502
+ ip: request.ip
503
+ });
498
504
  const marshalAddInstanceACLRulesRequest = (request, defaults) => ({
499
- rules: request.rules
505
+ rules: request.rules.map(elt => marshalACLRuleRequest(elt))
506
+ });
507
+ const marshalInstanceSetting = (request, defaults) => ({
508
+ name: request.name,
509
+ value: request.value
500
510
  });
501
511
  const marshalAddInstanceSettingsRequest = (request, defaults) => ({
502
- settings: request.settings
512
+ settings: request.settings.map(elt => marshalInstanceSetting(elt))
503
513
  });
504
514
  const marshalCloneInstanceRequest = (request, defaults) => ({
505
515
  name: request.name,
@@ -514,8 +524,29 @@ const marshalCreateDatabaseBackupRequest = (request, defaults) => ({
514
524
  const marshalCreateDatabaseRequest = (request, defaults) => ({
515
525
  name: request.name
516
526
  });
527
+ const marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
528
+ const marshalEndpointSpecLoadBalancer = (request, defaults) => ({});
529
+ const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
530
+ private_network_id: request.privateNetworkId,
531
+ ...resolveOneOf([{
532
+ param: 'service_ip',
533
+ value: request.serviceIp
534
+ }, {
535
+ param: 'ipam_config',
536
+ value: request.ipamConfig !== undefined ? marshalEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined
537
+ }])
538
+ });
539
+ const marshalEndpointSpec = (request, defaults) => ({
540
+ ...resolveOneOf([{
541
+ param: 'load_balancer',
542
+ value: request.loadBalancer !== undefined ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : undefined
543
+ }, {
544
+ param: 'private_network',
545
+ value: request.privateNetwork !== undefined ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
546
+ }])
547
+ });
517
548
  const marshalCreateEndpointRequest = (request, defaults) => ({
518
- endpoint_spec: request.endpointSpec
549
+ endpoint_spec: request.endpointSpec !== undefined ? marshalEndpointSpec(request.endpointSpec) : undefined
519
550
  });
520
551
  const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({
521
552
  instance_name: request.instanceName,
@@ -526,8 +557,8 @@ const marshalCreateInstanceRequest = (request, defaults) => ({
526
557
  backup_same_region: request.backupSameRegion,
527
558
  disable_backup: request.disableBackup,
528
559
  engine: request.engine,
529
- init_endpoints: request.initEndpoints,
530
- init_settings: request.initSettings,
560
+ init_endpoints: request.initEndpoints !== undefined ? request.initEndpoints.map(elt => marshalEndpointSpec(elt)) : undefined,
561
+ init_settings: request.initSettings !== undefined ? request.initSettings.map(elt => marshalInstanceSetting(elt)) : undefined,
531
562
  is_ha_cluster: request.isHaCluster,
532
563
  name: request.name || randomName('ins'),
533
564
  node_type: request.nodeType,
@@ -537,18 +568,41 @@ const marshalCreateInstanceRequest = (request, defaults) => ({
537
568
  volume_size: request.volumeSize,
538
569
  volume_type: request.volumeType,
539
570
  ...resolveOneOf([{
571
+ default: defaults.defaultProjectId,
572
+ param: 'project_id',
573
+ value: request.projectId
574
+ }, {
575
+ default: defaults.defaultOrganizationId,
540
576
  param: 'organization_id',
541
577
  value: request.organizationId
578
+ }])
579
+ });
580
+ const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});
581
+ const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});
582
+ const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({
583
+ private_network_id: request.privateNetworkId,
584
+ ...resolveOneOf([{
585
+ param: 'service_ip',
586
+ value: request.serviceIp
542
587
  }, {
543
- param: 'project_id',
544
- value: request.projectId
588
+ param: 'ipam_config',
589
+ value: request.ipamConfig !== undefined ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined
590
+ }])
591
+ });
592
+ const marshalReadReplicaEndpointSpec = (request, defaults) => ({
593
+ ...resolveOneOf([{
594
+ param: 'direct_access',
595
+ value: request.directAccess !== undefined ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess) : undefined
596
+ }, {
597
+ param: 'private_network',
598
+ value: request.privateNetwork !== undefined ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
545
599
  }])
546
600
  });
547
601
  const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({
548
- endpoint_spec: request.endpointSpec
602
+ endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt))
549
603
  });
550
604
  const marshalCreateReadReplicaRequest = (request, defaults) => ({
551
- endpoint_spec: request.endpointSpec,
605
+ endpoint_spec: request.endpointSpec !== undefined ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt)) : undefined,
552
606
  instance_id: request.instanceId,
553
607
  same_zone: request.sameZone
554
608
  });
@@ -582,10 +636,10 @@ const marshalRestoreDatabaseBackupRequest = (request, defaults) => ({
582
636
  instance_id: request.instanceId
583
637
  });
584
638
  const marshalSetInstanceACLRulesRequest = (request, defaults) => ({
585
- rules: request.rules
639
+ rules: request.rules.map(elt => marshalACLRuleRequest(elt))
586
640
  });
587
641
  const marshalSetInstanceSettingsRequest = (request, defaults) => ({
588
- settings: request.settings
642
+ settings: request.settings.map(elt => marshalInstanceSetting(elt))
589
643
  });
590
644
  const marshalSetPrivilegeRequest = (request, defaults) => ({
591
645
  database_name: request.databaseName,
@@ -596,13 +650,17 @@ const marshalUpdateDatabaseBackupRequest = (request, defaults) => ({
596
650
  expires_at: request.expiresAt,
597
651
  name: request.name
598
652
  });
653
+ const marshalLogsPolicy = (request, defaults) => ({
654
+ max_age_retention: request.maxAgeRetention,
655
+ total_disk_retention: request.totalDiskRetention
656
+ });
599
657
  const marshalUpdateInstanceRequest = (request, defaults) => ({
600
658
  backup_same_region: request.backupSameRegion,
601
659
  backup_schedule_frequency: request.backupScheduleFrequency,
602
660
  backup_schedule_retention: request.backupScheduleRetention,
603
661
  backup_schedule_start_hour: request.backupScheduleStartHour,
604
662
  is_backup_schedule_disabled: request.isBackupScheduleDisabled,
605
- logs_policy: request.logsPolicy,
663
+ logs_policy: request.logsPolicy !== undefined ? marshalLogsPolicy(request.logsPolicy) : undefined,
606
664
  name: request.name,
607
665
  tags: request.tags
608
666
  });
@@ -614,23 +672,30 @@ const marshalUpdateUserRequest = (request, defaults) => ({
614
672
  is_admin: request.isAdmin,
615
673
  password: request.password
616
674
  });
675
+ const marshalUpgradeInstanceRequestMajorUpgradeWorkflow = (request, defaults) => ({
676
+ upgradable_version_id: request.upgradableVersionId,
677
+ with_endpoints: request.withEndpoints
678
+ });
617
679
  const marshalUpgradeInstanceRequest = (request, defaults) => ({
618
680
  ...resolveOneOf([{
619
- param: 'enable_ha',
620
- value: request.enableHa
621
- }, {
622
681
  param: 'node_type',
623
682
  value: request.nodeType
624
683
  }, {
625
- param: 'upgradable_version_id',
626
- value: request.upgradableVersionId
684
+ param: 'enable_ha',
685
+ value: request.enableHa
627
686
  }, {
628
687
  param: 'volume_size',
629
688
  value: request.volumeSize
630
689
  }, {
631
690
  param: 'volume_type',
632
691
  value: request.volumeType
692
+ }, {
693
+ param: 'upgradable_version_id',
694
+ value: request.upgradableVersionId
695
+ }, {
696
+ param: 'major_upgrade_workflow',
697
+ value: request.majorUpgradeWorkflow !== undefined ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow(request.majorUpgradeWorkflow) : undefined
633
698
  }])
634
699
  });
635
700
 
636
- 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, unmarshalAddInstanceACLRulesResponse, unmarshalAddInstanceSettingsResponse, unmarshalDatabase, unmarshalDatabaseBackup, unmarshalDeleteInstanceACLRulesResponse, unmarshalDeleteInstanceSettingsResponse, unmarshalEndpoint, unmarshalInstance, unmarshalInstanceLog, unmarshalInstanceMetrics, unmarshalListDatabaseBackupsResponse, unmarshalListDatabaseEnginesResponse, unmarshalListDatabasesResponse, unmarshalListInstanceACLRulesResponse, unmarshalListInstanceLogsDetailsResponse, unmarshalListInstanceLogsResponse, unmarshalListInstancesResponse, unmarshalListNodeTypesResponse, unmarshalListPrivilegesResponse, unmarshalListSnapshotsResponse, unmarshalListUsersResponse, unmarshalPrepareInstanceLogsResponse, unmarshalPrivilege, unmarshalReadReplica, unmarshalSetInstanceACLRulesResponse, unmarshalSetInstanceSettingsResponse, unmarshalSnapshot, unmarshalUser };
701
+ 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, unmarshalPrepareInstanceLogsResponse, unmarshalPrivilege, unmarshalReadReplica, unmarshalSetInstanceACLRulesResponse, unmarshalSetInstanceSettingsResponse, unmarshalSnapshot, unmarshalUser };