@scaleway/sdk 0.1.0-beta.8 → 1.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 (173) hide show
  1. package/README.md +1 -1
  2. package/dist/api/account/index.js +2 -2
  3. package/dist/api/account/v2/api.gen.js +5 -18
  4. package/dist/api/account/v2/index.gen.js +3 -0
  5. package/dist/api/account/v2/marshalling.gen.js +0 -2
  6. package/dist/api/account/v2alpha1/api.gen.js +3 -13
  7. package/dist/api/account/v2alpha1/marshalling.gen.js +0 -5
  8. package/dist/api/applesilicon/index.js +2 -2
  9. package/dist/api/applesilicon/v1alpha1/api.gen.js +7 -27
  10. package/dist/api/applesilicon/v1alpha1/index.gen.js +4 -0
  11. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +1 -14
  12. package/dist/api/baremetal/v1/api.gen.js +47 -49
  13. package/dist/api/baremetal/v1/api.utils.js +2 -10
  14. package/dist/api/baremetal/v1/content.gen.js +6 -3
  15. package/dist/api/baremetal/v1/index.js +4 -1
  16. package/dist/api/baremetal/v1/marshalling.gen.js +44 -45
  17. package/dist/api/baremetal/v1/validation-rules.gen.js +109 -0
  18. package/dist/api/container/index.js +2 -2
  19. package/dist/api/container/v1beta1/api.gen.js +5 -51
  20. package/dist/api/container/v1beta1/content.gen.js +4 -4
  21. package/dist/api/container/v1beta1/{index.js → index.gen.js} +3 -1
  22. package/dist/api/container/v1beta1/marshalling.gen.js +12 -26
  23. package/dist/api/domain/index.js +2 -2
  24. package/dist/api/domain/v2beta1/api.gen.js +55 -85
  25. package/dist/api/domain/v2beta1/content.gen.js +22 -1
  26. package/dist/api/domain/v2beta1/index.gen.js +4 -0
  27. package/dist/api/domain/v2beta1/marshalling.gen.js +47 -165
  28. package/dist/api/flexibleip/index.js +2 -2
  29. package/dist/api/flexibleip/v1alpha1/api.gen.js +5 -22
  30. package/dist/api/flexibleip/v1alpha1/content.gen.js +1 -1
  31. package/dist/api/flexibleip/v1alpha1/index.gen.js +6 -0
  32. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +0 -7
  33. package/dist/api/flexibleip/v1alpha1/validation-rules.gen.js +14 -0
  34. package/dist/api/function/index.js +2 -2
  35. package/dist/api/function/v1beta1/api.gen.js +54 -57
  36. package/dist/api/function/v1beta1/content.gen.js +8 -5
  37. package/dist/api/function/v1beta1/index.gen.js +4 -0
  38. package/dist/api/function/v1beta1/marshalling.gen.js +125 -33
  39. package/dist/api/iam/index.js +2 -2
  40. package/dist/api/iam/v1alpha1/api.gen.js +15 -62
  41. package/dist/api/iam/v1alpha1/index.gen.js +5 -0
  42. package/dist/api/iam/v1alpha1/marshalling.gen.js +7 -29
  43. package/dist/api/iam/v1alpha1/validation-rules.gen.js +184 -0
  44. package/dist/api/instance/v1/api.gen.js +38 -118
  45. package/dist/api/instance/v1/api.utils.js +59 -51
  46. package/dist/api/instance/v1/content.gen.js +7 -7
  47. package/dist/api/instance/v1/marshalling.gen.js +46 -168
  48. package/dist/api/instance/v1/marshalling.utils.js +63 -0
  49. package/dist/api/iot/index.js +2 -2
  50. package/dist/api/iot/v1/api.gen.js +5 -56
  51. package/dist/api/iot/v1/index.gen.js +4 -0
  52. package/dist/api/iot/v1/marshalling.gen.js +2 -51
  53. package/dist/api/k8s/index.js +2 -2
  54. package/dist/api/k8s/v1/api.gen.js +17 -43
  55. package/dist/api/k8s/v1/content.gen.js +2 -2
  56. package/dist/api/k8s/v1/index.gen.js +6 -0
  57. package/dist/api/k8s/v1/marshalling.gen.js +18 -36
  58. package/dist/api/k8s/v1/validation-rules.gen.js +92 -0
  59. package/dist/api/lb/v1/api.gen.js +8 -163
  60. package/dist/api/lb/v1/api.utils.js +3 -9
  61. package/dist/api/lb/v1/content.gen.js +3 -3
  62. package/dist/api/lb/v1/marshalling.gen.js +74 -101
  63. package/dist/api/marketplace/index.js +4 -2
  64. package/dist/api/marketplace/v1/api.gen.js +3 -13
  65. package/dist/api/marketplace/v1/index.gen.js +3 -0
  66. package/dist/api/marketplace/v1/marshalling.gen.js +0 -13
  67. package/dist/api/marketplace/v2/api.gen.js +85 -0
  68. package/dist/api/marketplace/v2/index.gen.js +3 -0
  69. package/dist/api/marketplace/v2/marshalling.gen.js +92 -0
  70. package/dist/api/mnq/index.js +2 -2
  71. package/dist/api/mnq/v1alpha1/api.gen.js +7 -25
  72. package/dist/api/mnq/v1alpha1/index.gen.js +3 -0
  73. package/dist/api/mnq/v1alpha1/marshalling.gen.js +7 -46
  74. package/dist/api/rdb/index.js +2 -2
  75. package/dist/api/rdb/v1/api.gen.js +15 -89
  76. package/dist/api/rdb/v1/content.gen.js +10 -4
  77. package/dist/api/rdb/v1/index.gen.js +4 -0
  78. package/dist/api/rdb/v1/marshalling.gen.js +25 -81
  79. package/dist/api/redis/index.js +2 -2
  80. package/dist/api/redis/{v1alpha1 → v1}/api.gen.js +45 -77
  81. package/dist/api/redis/{v1alpha1 → v1}/content.gen.js +1 -1
  82. package/dist/api/redis/v1/index.gen.js +4 -0
  83. package/dist/api/redis/{v1alpha1 → v1}/marshalling.gen.js +42 -59
  84. package/dist/api/registry/index.js +2 -2
  85. package/dist/api/registry/v1/api.gen.js +5 -29
  86. package/dist/api/registry/v1/content.gen.js +2 -2
  87. package/dist/api/registry/v1/{index.js → index.gen.js} +3 -1
  88. package/dist/api/registry/v1/marshalling.gen.js +2 -8
  89. package/dist/api/secret/index.js +2 -0
  90. package/dist/api/secret/v1alpha1/api.gen.js +135 -0
  91. package/dist/api/secret/v1alpha1/index.gen.js +3 -0
  92. package/dist/api/secret/v1alpha1/marshalling.gen.js +82 -0
  93. package/dist/api/tem/index.js +2 -0
  94. package/dist/api/tem/v1alpha1/api.gen.js +109 -0
  95. package/dist/api/tem/v1alpha1/content.gen.js +10 -0
  96. package/dist/api/tem/v1alpha1/index.gen.js +4 -0
  97. package/dist/api/tem/v1alpha1/marshalling.gen.js +132 -0
  98. package/dist/api/test/index.js +2 -2
  99. package/dist/api/test/v1/api.gen.js +6 -20
  100. package/dist/api/test/v1/index.gen.js +4 -0
  101. package/dist/api/test/v1/marshalling.gen.js +2 -5
  102. package/dist/api/vpc/index.js +2 -2
  103. package/dist/api/vpc/v1/api.gen.js +6 -17
  104. package/dist/api/vpc/v1/index.gen.js +3 -0
  105. package/dist/api/vpc/v1/marshalling.gen.js +1 -3
  106. package/dist/api/vpcgw/index.js +2 -2
  107. package/dist/api/vpcgw/v1/api.gen.js +5 -64
  108. package/dist/api/vpcgw/v1/content.gen.js +2 -2
  109. package/dist/api/vpcgw/v1/{index.js → index.gen.js} +3 -1
  110. package/dist/api/vpcgw/v1/marshalling.gen.js +3 -24
  111. package/dist/helpers/json.js +1 -2
  112. package/dist/helpers/marshalling.js +7 -20
  113. package/dist/index.cjs +3870 -2948
  114. package/dist/index.d.ts +7218 -4335
  115. package/dist/index.js +10 -6
  116. package/dist/internal/async/interval-retrier.js +10 -16
  117. package/dist/internal/interceptors/interceptor.js +3 -1
  118. package/dist/internal/interceptors/request.js +1 -3
  119. package/dist/internal/logger/console-logger.js +3 -5
  120. package/dist/internal/logger/index.js +3 -5
  121. package/dist/internal/logger/level-resolver.js +0 -3
  122. package/dist/internal/validations/string-validation.js +8 -10
  123. package/dist/node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js +13 -0
  124. package/dist/scw/api.js +3 -4
  125. package/dist/scw/auth.js +3 -5
  126. package/dist/scw/client-ini-factory.js +32 -15
  127. package/dist/scw/client-ini-profile.js +10 -4
  128. package/dist/scw/client-settings.js +32 -15
  129. package/dist/scw/client.js +5 -6
  130. package/dist/scw/constants.js +1 -1
  131. package/dist/scw/custom-marshalling.js +8 -14
  132. package/dist/scw/errors/error-parser.js +2 -21
  133. package/dist/scw/errors/non-standard/invalid-request-mapper.js +17 -15
  134. package/dist/scw/errors/non-standard/unknown-resource-mapper.js +7 -6
  135. package/dist/scw/errors/scw-error.js +20 -20
  136. package/dist/scw/errors/standard/already-exists-error.js +3 -4
  137. package/dist/scw/errors/standard/denied-authentication-error.js +4 -11
  138. package/dist/scw/errors/standard/invalid-arguments-error.js +1 -10
  139. package/dist/scw/errors/standard/out-of-stock-error.js +0 -3
  140. package/dist/scw/errors/standard/permissions-denied-error.js +1 -4
  141. package/dist/scw/errors/standard/precondition-failed-error.js +4 -8
  142. package/dist/scw/errors/standard/quotas-exceeded-error.js +14 -14
  143. package/dist/scw/errors/standard/resource-expired-error.js +3 -4
  144. package/dist/scw/errors/standard/resource-locked-error.js +3 -4
  145. package/dist/scw/errors/standard/resource-not-found-error.js +3 -4
  146. package/dist/scw/errors/standard/too-many-requests-error.js +3 -16
  147. package/dist/scw/errors/standard/transient-state-error.js +3 -4
  148. package/dist/scw/errors/types.js +0 -3
  149. package/dist/scw/fetch/build-fetcher.js +1 -9
  150. package/dist/scw/fetch/http-dumper.js +4 -7
  151. package/dist/scw/fetch/http-interceptors.js +9 -12
  152. package/dist/scw/fetch/resource-paginator.js +18 -16
  153. package/dist/scw/fetch/response-parser.js +17 -23
  154. package/node_modules/@scaleway/random-name/CHANGELOG.md +42 -63
  155. package/node_modules/@scaleway/random-name/dist/index.js +5 -246
  156. package/node_modules/@scaleway/random-name/package.json +6 -5
  157. package/package.json +4 -5
  158. package/dist/api/account/v2/index.js +0 -1
  159. package/dist/api/applesilicon/v1alpha1/index.js +0 -2
  160. package/dist/api/domain/v2beta1/index.js +0 -2
  161. package/dist/api/flexibleip/v1alpha1/index.js +0 -2
  162. package/dist/api/function/v1beta1/index.js +0 -2
  163. package/dist/api/iam/v1alpha1/index.js +0 -1
  164. package/dist/api/iot/v1/index.js +0 -2
  165. package/dist/api/k8s/v1/index.js +0 -2
  166. package/dist/api/marketplace/v1/index.js +0 -1
  167. package/dist/api/mnq/v1alpha1/index.js +0 -1
  168. package/dist/api/rdb/v1/index.js +0 -2
  169. package/dist/api/redis/v1alpha1/index.js +0 -2
  170. package/dist/api/test/v1/index.js +0 -1
  171. package/dist/api/vpc/v1/index.js +0 -1
  172. package/dist/node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js +0 -254
  173. package/node_modules/@scaleway/random-name/dist/index.browser.js +0 -256
@@ -1,43 +1,35 @@
1
- import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@3.0.2/node_modules/@scaleway/random-name/dist/index.js';
1
+ import randomName from '../../../node_modules/.pnpm/@scaleway_random-name@4.0.1/node_modules/@scaleway/random-name/dist/index.js';
2
2
  import { isJSONObject } from '../../../helpers/json.js';
3
3
  import { unmarshalTimeSeries } from '../../../scw/custom-marshalling.js';
4
4
  import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../helpers/marshalling.js';
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
-
8
7
  const unmarshalEndpointDirectAccessDetails = data => {
9
8
  if (!isJSONObject(data)) {
10
9
  throw new TypeError(`Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`);
11
10
  }
12
-
13
11
  return {};
14
12
  };
15
-
16
13
  const unmarshalEndpointLoadBalancerDetails = data => {
17
14
  if (!isJSONObject(data)) {
18
15
  throw new TypeError(`Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`);
19
16
  }
20
-
21
17
  return {};
22
18
  };
23
-
24
19
  const unmarshalEndpointPrivateNetworkDetails = data => {
25
20
  if (!isJSONObject(data)) {
26
21
  throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
27
22
  }
28
-
29
23
  return {
30
24
  privateNetworkId: data.private_network_id,
31
25
  serviceIp: data.service_ip,
32
26
  zone: data.zone
33
27
  };
34
28
  };
35
-
36
29
  const unmarshalEndpoint = data => {
37
30
  if (!isJSONObject(data)) {
38
31
  throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
39
32
  }
40
-
41
33
  return {
42
34
  directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : undefined,
43
35
  hostname: data.hostname,
@@ -49,12 +41,10 @@ const unmarshalEndpoint = data => {
49
41
  privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined
50
42
  };
51
43
  };
52
-
53
44
  const unmarshalEngineSetting = data => {
54
45
  if (!isJSONObject(data)) {
55
46
  throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`);
56
47
  }
57
-
58
48
  return {
59
49
  defaultValue: data.default_value,
60
50
  description: data.description,
@@ -69,24 +59,20 @@ const unmarshalEngineSetting = data => {
69
59
  unit: data.unit
70
60
  };
71
61
  };
72
-
73
62
  const unmarshalBackupSchedule = data => {
74
63
  if (!isJSONObject(data)) {
75
64
  throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);
76
65
  }
77
-
78
66
  return {
79
67
  disabled: data.disabled,
80
68
  frequency: data.frequency,
81
69
  retention: data.retention
82
70
  };
83
71
  };
84
-
85
72
  const unmarshalEngineVersion = data => {
86
73
  if (!isJSONObject(data)) {
87
74
  throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`);
88
75
  }
89
-
90
76
  return {
91
77
  availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting),
92
78
  availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting),
@@ -97,34 +83,28 @@ const unmarshalEngineVersion = data => {
97
83
  version: data.version
98
84
  };
99
85
  };
100
-
101
86
  const unmarshalInstanceSetting = data => {
102
87
  if (!isJSONObject(data)) {
103
88
  throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);
104
89
  }
105
-
106
90
  return {
107
91
  name: data.name,
108
92
  value: data.value
109
93
  };
110
94
  };
111
-
112
95
  const unmarshalLogsPolicy = data => {
113
96
  if (!isJSONObject(data)) {
114
97
  throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);
115
98
  }
116
-
117
99
  return {
118
100
  maxAgeRetention: data.max_age_retention,
119
101
  totalDiskRetention: data.total_disk_retention
120
102
  };
121
103
  };
122
-
123
104
  const unmarshalMaintenance = data => {
124
105
  if (!isJSONObject(data)) {
125
106
  throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);
126
107
  }
127
-
128
108
  return {
129
109
  closedAt: unmarshalDate(data.closed_at),
130
110
  reason: data.reason,
@@ -133,23 +113,19 @@ const unmarshalMaintenance = data => {
133
113
  stopsAt: unmarshalDate(data.stops_at)
134
114
  };
135
115
  };
136
-
137
116
  const unmarshalNodeTypeVolumeConstraintSizes = data => {
138
117
  if (!isJSONObject(data)) {
139
118
  throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);
140
119
  }
141
-
142
120
  return {
143
121
  maxSize: data.max_size,
144
122
  minSize: data.min_size
145
123
  };
146
124
  };
147
-
148
125
  const unmarshalNodeTypeVolumeType = data => {
149
126
  if (!isJSONObject(data)) {
150
127
  throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
151
128
  }
152
-
153
129
  return {
154
130
  chunkSize: data.chunk_size,
155
131
  description: data.description,
@@ -158,12 +134,10 @@ const unmarshalNodeTypeVolumeType = data => {
158
134
  type: data.type
159
135
  };
160
136
  };
161
-
162
137
  const unmarshalReadReplica = data => {
163
138
  if (!isJSONObject(data)) {
164
139
  throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`);
165
140
  }
166
-
167
141
  return {
168
142
  endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
169
143
  id: data.id,
@@ -171,23 +145,30 @@ const unmarshalReadReplica = data => {
171
145
  status: data.status
172
146
  };
173
147
  };
174
-
148
+ const unmarshalUpgradableVersion = data => {
149
+ if (!isJSONObject(data)) {
150
+ throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);
151
+ }
152
+ return {
153
+ id: data.id,
154
+ minorVersion: data.minor_version,
155
+ name: data.name,
156
+ version: data.version
157
+ };
158
+ };
175
159
  const unmarshalVolume = data => {
176
160
  if (!isJSONObject(data)) {
177
161
  throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
178
162
  }
179
-
180
163
  return {
181
164
  size: data.size,
182
165
  type: data.type
183
166
  };
184
167
  };
185
-
186
168
  const unmarshalACLRule = data => {
187
169
  if (!isJSONObject(data)) {
188
170
  throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
189
171
  }
190
-
191
172
  return {
192
173
  action: data.action,
193
174
  description: data.description,
@@ -197,12 +178,10 @@ const unmarshalACLRule = data => {
197
178
  protocol: data.protocol
198
179
  };
199
180
  };
200
-
201
181
  const unmarshalDatabase = data => {
202
182
  if (!isJSONObject(data)) {
203
183
  throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
204
184
  }
205
-
206
185
  return {
207
186
  managed: data.managed,
208
187
  name: data.name,
@@ -214,7 +193,6 @@ const unmarshalDatabaseBackup = data => {
214
193
  if (!isJSONObject(data)) {
215
194
  throw new TypeError(`Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`);
216
195
  }
217
-
218
196
  return {
219
197
  createdAt: unmarshalDate(data.created_at),
220
198
  databaseName: data.database_name,
@@ -232,12 +210,10 @@ const unmarshalDatabaseBackup = data => {
232
210
  updatedAt: unmarshalDate(data.updated_at)
233
211
  };
234
212
  };
235
-
236
213
  const unmarshalDatabaseEngine = data => {
237
214
  if (!isJSONObject(data)) {
238
215
  throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`);
239
216
  }
240
-
241
217
  return {
242
218
  logoUrl: data.logo_url,
243
219
  name: data.name,
@@ -245,12 +221,10 @@ const unmarshalDatabaseEngine = data => {
245
221
  versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)
246
222
  };
247
223
  };
248
-
249
224
  const unmarshalInstance = data => {
250
225
  if (!isJSONObject(data)) {
251
226
  throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);
252
227
  }
253
-
254
228
  return {
255
229
  backupSameRegion: data.backup_same_region,
256
230
  backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : undefined,
@@ -272,6 +246,7 @@ const unmarshalInstance = data => {
272
246
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
273
247
  status: data.status,
274
248
  tags: data.tags,
249
+ upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),
275
250
  volume: data.volume ? unmarshalVolume(data.volume) : undefined
276
251
  };
277
252
  };
@@ -279,7 +254,6 @@ const unmarshalInstanceLog = data => {
279
254
  if (!isJSONObject(data)) {
280
255
  throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`);
281
256
  }
282
-
283
257
  return {
284
258
  createdAt: unmarshalDate(data.created_at),
285
259
  downloadUrl: data.download_url,
@@ -290,29 +264,26 @@ const unmarshalInstanceLog = data => {
290
264
  status: data.status
291
265
  };
292
266
  };
293
-
294
267
  const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = data => {
295
268
  if (!isJSONObject(data)) {
296
269
  throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`);
297
270
  }
298
-
299
271
  return {
300
272
  logName: data.log_name,
301
273
  size: data.size
302
274
  };
303
275
  };
304
-
305
276
  const unmarshalNodeType = data => {
306
277
  if (!isJSONObject(data)) {
307
278
  throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
308
279
  }
309
-
310
280
  return {
311
281
  availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
312
282
  beta: data.beta,
313
283
  description: data.description,
314
284
  disabled: data.disabled,
315
285
  isBssdCompatible: data.is_bssd_compatible,
286
+ isHaRequired: data.is_ha_required,
316
287
  memory: data.memory,
317
288
  name: data.name,
318
289
  region: data.region,
@@ -321,12 +292,10 @@ const unmarshalNodeType = data => {
321
292
  volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : undefined
322
293
  };
323
294
  };
324
-
325
295
  const unmarshalPrivilege = data => {
326
296
  if (!isJSONObject(data)) {
327
297
  throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`);
328
298
  }
329
-
330
299
  return {
331
300
  databaseName: data.database_name,
332
301
  permission: data.permission,
@@ -337,7 +306,6 @@ const unmarshalSnapshot = data => {
337
306
  if (!isJSONObject(data)) {
338
307
  throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);
339
308
  }
340
-
341
309
  return {
342
310
  createdAt: unmarshalDate(data.created_at),
343
311
  expiresAt: unmarshalDate(data.expires_at),
@@ -356,7 +324,6 @@ const unmarshalUser = data => {
356
324
  if (!isJSONObject(data)) {
357
325
  throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
358
326
  }
359
-
360
327
  return {
361
328
  isAdmin: data.is_admin,
362
329
  name: data.name
@@ -366,7 +333,6 @@ const unmarshalAddInstanceACLRulesResponse = data => {
366
333
  if (!isJSONObject(data)) {
367
334
  throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`);
368
335
  }
369
-
370
336
  return {
371
337
  rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
372
338
  };
@@ -375,7 +341,6 @@ const unmarshalAddInstanceSettingsResponse = data => {
375
341
  if (!isJSONObject(data)) {
376
342
  throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`);
377
343
  }
378
-
379
344
  return {
380
345
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
381
346
  };
@@ -384,7 +349,6 @@ const unmarshalDeleteInstanceACLRulesResponse = data => {
384
349
  if (!isJSONObject(data)) {
385
350
  throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`);
386
351
  }
387
-
388
352
  return {
389
353
  rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
390
354
  };
@@ -393,7 +357,6 @@ const unmarshalDeleteInstanceSettingsResponse = data => {
393
357
  if (!isJSONObject(data)) {
394
358
  throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`);
395
359
  }
396
-
397
360
  return {
398
361
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
399
362
  };
@@ -402,7 +365,6 @@ const unmarshalInstanceMetrics = data => {
402
365
  if (!isJSONObject(data)) {
403
366
  throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`);
404
367
  }
405
-
406
368
  return {
407
369
  timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)
408
370
  };
@@ -411,7 +373,6 @@ const unmarshalListDatabaseBackupsResponse = data => {
411
373
  if (!isJSONObject(data)) {
412
374
  throw new TypeError(`Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`);
413
375
  }
414
-
415
376
  return {
416
377
  databaseBackups: unmarshalArrayOfObject(data.database_backups, unmarshalDatabaseBackup),
417
378
  totalCount: data.total_count
@@ -421,7 +382,6 @@ const unmarshalListDatabaseEnginesResponse = data => {
421
382
  if (!isJSONObject(data)) {
422
383
  throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`);
423
384
  }
424
-
425
385
  return {
426
386
  engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),
427
387
  totalCount: data.total_count
@@ -431,7 +391,6 @@ const unmarshalListDatabasesResponse = data => {
431
391
  if (!isJSONObject(data)) {
432
392
  throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
433
393
  }
434
-
435
394
  return {
436
395
  databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
437
396
  totalCount: data.total_count
@@ -441,7 +400,6 @@ const unmarshalListInstanceACLRulesResponse = data => {
441
400
  if (!isJSONObject(data)) {
442
401
  throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`);
443
402
  }
444
-
445
403
  return {
446
404
  rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule),
447
405
  totalCount: data.total_count
@@ -451,7 +409,6 @@ const unmarshalListInstanceLogsDetailsResponse = data => {
451
409
  if (!isJSONObject(data)) {
452
410
  throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`);
453
411
  }
454
-
455
412
  return {
456
413
  details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail)
457
414
  };
@@ -460,7 +417,6 @@ const unmarshalListInstanceLogsResponse = data => {
460
417
  if (!isJSONObject(data)) {
461
418
  throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`);
462
419
  }
463
-
464
420
  return {
465
421
  instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)
466
422
  };
@@ -469,7 +425,6 @@ const unmarshalListInstancesResponse = data => {
469
425
  if (!isJSONObject(data)) {
470
426
  throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);
471
427
  }
472
-
473
428
  return {
474
429
  instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),
475
430
  totalCount: data.total_count
@@ -479,7 +434,6 @@ const unmarshalListNodeTypesResponse = data => {
479
434
  if (!isJSONObject(data)) {
480
435
  throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
481
436
  }
482
-
483
437
  return {
484
438
  nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
485
439
  totalCount: data.total_count
@@ -489,7 +443,6 @@ const unmarshalListPrivilegesResponse = data => {
489
443
  if (!isJSONObject(data)) {
490
444
  throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`);
491
445
  }
492
-
493
446
  return {
494
447
  privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),
495
448
  totalCount: data.total_count
@@ -499,7 +452,6 @@ const unmarshalListSnapshotsResponse = data => {
499
452
  if (!isJSONObject(data)) {
500
453
  throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);
501
454
  }
502
-
503
455
  return {
504
456
  snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),
505
457
  totalCount: data.total_count
@@ -509,7 +461,6 @@ const unmarshalListUsersResponse = data => {
509
461
  if (!isJSONObject(data)) {
510
462
  throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
511
463
  }
512
-
513
464
  return {
514
465
  totalCount: data.total_count,
515
466
  users: unmarshalArrayOfObject(data.users, unmarshalUser)
@@ -519,7 +470,6 @@ const unmarshalPrepareInstanceLogsResponse = data => {
519
470
  if (!isJSONObject(data)) {
520
471
  throw new TypeError(`Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`);
521
472
  }
522
-
523
473
  return {
524
474
  instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)
525
475
  };
@@ -528,7 +478,6 @@ const unmarshalSetInstanceACLRulesResponse = data => {
528
478
  if (!isJSONObject(data)) {
529
479
  throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`);
530
480
  }
531
-
532
481
  return {
533
482
  rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule)
534
483
  };
@@ -537,32 +486,26 @@ const unmarshalSetInstanceSettingsResponse = data => {
537
486
  if (!isJSONObject(data)) {
538
487
  throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`);
539
488
  }
540
-
541
489
  return {
542
490
  settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)
543
491
  };
544
492
  };
545
-
546
493
  const marshalEndpointSpecLoadBalancer = (request, defaults) => ({});
547
-
548
494
  const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({
549
495
  private_network_id: request.privateNetworkId,
550
496
  service_ip: request.serviceIp
551
497
  });
552
-
553
498
  const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});
554
-
555
499
  const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({
556
500
  private_network_id: request.privateNetworkId,
557
501
  service_ip: request.serviceIp
558
502
  });
559
-
560
503
  const marshalACLRuleRequest = (request, defaults) => ({
561
504
  description: request.description,
562
505
  ip: request.ip
563
506
  });
564
-
565
- const marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
507
+ const marshalEndpointSpec = (request, defaults) => ({
508
+ ...resolveOneOf([{
566
509
  param: 'load_balancer',
567
510
  value: request.loadBalancer ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : undefined
568
511
  }, {
@@ -570,18 +513,16 @@ const marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
570
513
  value: request.privateNetwork ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
571
514
  }])
572
515
  });
573
-
574
516
  const marshalInstanceSetting = (request, defaults) => ({
575
517
  name: request.name,
576
518
  value: request.value
577
519
  });
578
-
579
520
  const marshalLogsPolicy = (request, defaults) => ({
580
521
  max_age_retention: request.maxAgeRetention,
581
522
  total_disk_retention: request.totalDiskRetention
582
523
  });
583
-
584
- const marshalReadReplicaEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
524
+ const marshalReadReplicaEndpointSpec = (request, defaults) => ({
525
+ ...resolveOneOf([{
585
526
  param: 'direct_access',
586
527
  value: request.directAccess ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess) : undefined
587
528
  }, {
@@ -589,7 +530,6 @@ const marshalReadReplicaEndpointSpec = (request, defaults) => ({ ...resolveOneOf
589
530
  value: request.privateNetwork ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork) : undefined
590
531
  }])
591
532
  });
592
-
593
533
  const marshalAddInstanceACLRulesRequest = (request, defaults) => ({
594
534
  rules: request.rules.map(elt => marshalACLRuleRequest(elt))
595
535
  });
@@ -630,7 +570,7 @@ const marshalCreateInstanceRequest = (request, defaults) => ({
630
570
  tags: request.tags,
631
571
  user_name: request.userName,
632
572
  volume_size: request.volumeSize,
633
- volume_type: request.volumeType,
573
+ volume_type: request.volumeType ?? 'lssd',
634
574
  ...resolveOneOf([{
635
575
  default: defaults.defaultProjectId,
636
576
  param: 'project_id',
@@ -682,7 +622,7 @@ const marshalSetInstanceSettingsRequest = (request, defaults) => ({
682
622
  });
683
623
  const marshalSetPrivilegeRequest = (request, defaults) => ({
684
624
  database_name: request.databaseName,
685
- permission: request.permission,
625
+ permission: request.permission ?? 'readonly',
686
626
  user_name: request.userName
687
627
  });
688
628
  const marshalUpdateDatabaseBackupRequest = (request, defaults) => ({
@@ -706,7 +646,8 @@ const marshalUpdateUserRequest = (request, defaults) => ({
706
646
  is_admin: request.isAdmin,
707
647
  password: request.password
708
648
  });
709
- const marshalUpgradeInstanceRequest = (request, defaults) => ({ ...resolveOneOf([{
649
+ const marshalUpgradeInstanceRequest = (request, defaults) => ({
650
+ ...resolveOneOf([{
710
651
  param: 'node_type',
711
652
  value: request.nodeType
712
653
  }, {
@@ -718,6 +659,9 @@ const marshalUpgradeInstanceRequest = (request, defaults) => ({ ...resolveOneOf(
718
659
  }, {
719
660
  param: 'volume_type',
720
661
  value: request.volumeType
662
+ }, {
663
+ param: 'upgradable_version_id',
664
+ value: request.upgradableVersionId
721
665
  }])
722
666
  });
723
667
 
@@ -1,2 +1,2 @@
1
- import * as index$1 from './v1alpha1/index.js';
2
- export { index$1 as v1alpha1 };
1
+ import * as index_gen from './v1/index.gen.js';
2
+ export { index_gen as v1 };