@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
@@ -2,8 +2,8 @@ import { waitForResource } from '../../../internal/async/interval-retrier.js';
2
2
  import { API as API$1 } from '../../../scw/api.js';
3
3
  import { validatePathParam, urlParams } from '../../../helpers/marshalling.js';
4
4
  import { enrichForPagination } from '../../../scw/fetch/resource-paginator.js';
5
- import { PIN_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { marshalCreateVolumeRequest, unmarshalVolume, unmarshalListVolumesResponse, marshalUpdateVolumeRequest, marshalCreatePinByURLRequest, unmarshalPin, marshalCreatePinByCIDRequest, marshalReplacePinRequest, unmarshalReplacePinResponse, unmarshalListPinsResponse } from './marshalling.gen.js';
5
+ import { PIN_TRANSIENT_STATUSES, NAME_TRANSIENT_STATUSES } from './content.gen.js';
6
+ import { marshalCreateVolumeRequest, unmarshalVolume, unmarshalListVolumesResponse, marshalUpdateVolumeRequest, marshalCreatePinByURLRequest, unmarshalPin, marshalCreatePinByCIDRequest, marshalReplacePinRequest, unmarshalReplacePinResponse, unmarshalListPinsResponse, marshalIpnsApiCreateNameRequest, unmarshalName, unmarshalListNamesResponse, marshalIpnsApiUpdateNameRequest, unmarshalExportKeyNameResponse, marshalIpnsApiImportKeyNameRequest } from './marshalling.gen.js';
7
7
 
8
8
  // This file was automatically generated. DO NOT EDIT.
9
9
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -194,4 +194,121 @@ class API extends API$1 {
194
194
  });
195
195
  }
196
196
 
197
- export { API };
197
+ /** IPFS Naming service API. */
198
+ class IpnsAPI extends API$1 {
199
+ /** Lists the available regions of the API. */
200
+ static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
201
+
202
+ /**
203
+ * Create a new name. You can use the `ipns key` command to list and generate
204
+ * more names and their respective keys.
205
+ *
206
+ * @param request - The request {@link IpnsApiCreateNameRequest}
207
+ * @returns A Promise of Name
208
+ */
209
+ createName = request => this.client.fetch({
210
+ body: JSON.stringify(marshalIpnsApiCreateNameRequest(request, this.client.settings)),
211
+ headers: jsonContentHeaders,
212
+ method: 'POST',
213
+ path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`
214
+ }, unmarshalName);
215
+
216
+ /**
217
+ * Get information about a name. Retrieve information about a specific name.
218
+ *
219
+ * @param request - The request {@link IpnsApiGetNameRequest}
220
+ * @returns A Promise of Name
221
+ */
222
+ getName = request => this.client.fetch({
223
+ method: 'GET',
224
+ path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
225
+ }, unmarshalName);
226
+
227
+ /**
228
+ * Waits for {@link Name} to be in a final state.
229
+ *
230
+ * @param request - The request {@link IpnsApiGetNameRequest}
231
+ * @param options - The waiting options
232
+ * @returns A Promise of Name
233
+ */
234
+ waitForName = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAME_TRANSIENT_STATUSES.includes(res.status))), this.getName, request, options);
235
+
236
+ /**
237
+ * Delete an existing name. Delete a name by its ID.
238
+ *
239
+ * @param request - The request {@link IpnsApiDeleteNameRequest}
240
+ */
241
+ deleteName = request => this.client.fetch({
242
+ method: 'DELETE',
243
+ path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
244
+ });
245
+ pageOfListNames = (() => {
246
+ var _this3 = this;
247
+ return function (request) {
248
+ if (request === void 0) {
249
+ request = {};
250
+ }
251
+ return _this3.client.fetch({
252
+ method: 'GET',
253
+ path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/names`,
254
+ urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
255
+ }, unmarshalListNamesResponse);
256
+ };
257
+ })();
258
+
259
+ /**
260
+ * List all names by a Project ID. Retrieve information about all names from a
261
+ * Project ID.
262
+ *
263
+ * @param request - The request {@link IpnsApiListNamesRequest}
264
+ * @returns A Promise of ListNamesResponse
265
+ */
266
+ listNames = (() => {
267
+ var _this4 = this;
268
+ return function (request) {
269
+ if (request === void 0) {
270
+ request = {};
271
+ }
272
+ return enrichForPagination('names', _this4.pageOfListNames, request);
273
+ };
274
+ })();
275
+
276
+ /**
277
+ * Update name information. Update name information (CID, tag, name...).
278
+ *
279
+ * @param request - The request {@link IpnsApiUpdateNameRequest}
280
+ * @returns A Promise of Name
281
+ */
282
+ updateName = request => this.client.fetch({
283
+ body: JSON.stringify(marshalIpnsApiUpdateNameRequest(request, this.client.settings)),
284
+ headers: jsonContentHeaders,
285
+ method: 'PATCH',
286
+ path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`
287
+ }, unmarshalName);
288
+
289
+ /**
290
+ * Export your private key. Export a private key by its ID.
291
+ *
292
+ * @param request - The request {@link IpnsApiExportKeyNameRequest}
293
+ * @returns A Promise of ExportKeyNameResponse
294
+ */
295
+ exportKeyName = request => this.client.fetch({
296
+ method: 'GET',
297
+ path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}/export-key`
298
+ }, unmarshalExportKeyNameResponse);
299
+
300
+ /**
301
+ * Import your private key. Import a private key.
302
+ *
303
+ * @param request - The request {@link IpnsApiImportKeyNameRequest}
304
+ * @returns A Promise of Name
305
+ */
306
+ importKeyName = request => this.client.fetch({
307
+ body: JSON.stringify(marshalIpnsApiImportKeyNameRequest(request, this.client.settings)),
308
+ headers: jsonContentHeaders,
309
+ method: 'POST',
310
+ path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/import-key`
311
+ }, unmarshalName);
312
+ }
313
+
314
+ export { API, IpnsAPI };
@@ -1,7 +1,10 @@
1
1
  // This file was automatically generated. DO NOT EDIT.
2
2
  // If you have any remark or suggestion do not hesitate to open an issue.
3
3
 
4
+ /** Lists transient statutes of the enum {@link NameStatus}. */
5
+ const NAME_TRANSIENT_STATUSES = ['queued', 'publishing'];
6
+
4
7
  /** Lists transient statutes of the enum {@link PinStatus}. */
5
8
  const PIN_TRANSIENT_STATUSES = ['queued', 'pinning'];
6
9
 
7
- export { PIN_TRANSIENT_STATUSES };
10
+ export { NAME_TRANSIENT_STATUSES, PIN_TRANSIENT_STATUSES };
@@ -1,5 +1,5 @@
1
- export { API } from './api.gen.js';
2
- export { PIN_TRANSIENT_STATUSES } from './content.gen.js';
1
+ export { API, IpnsAPI } from './api.gen.js';
2
+ export { NAME_TRANSIENT_STATUSES, PIN_TRANSIENT_STATUSES } from './content.gen.js';
3
3
 
4
4
  // This file was automatically generated. DO NOT EDIT.
5
5
  // If you have any remark or suggestion do not hesitate to open an issue.
@@ -3,16 +3,21 @@ import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshall
3
3
 
4
4
  // This file was automatically generated. DO NOT EDIT.
5
5
  // If you have any remark or suggestion do not hesitate to open an issue.
6
- const unmarshalPinInfo = data => {
6
+ const unmarshalName = data => {
7
7
  if (!isJSONObject(data)) {
8
- throw new TypeError(`Unmarshalling the type 'PinInfo' failed as data isn't a dictionary.`);
8
+ throw new TypeError(`Unmarshalling the type 'Name' failed as data isn't a dictionary.`);
9
9
  }
10
10
  return {
11
- id: data.id ? data.id : undefined,
12
- progress: data.progress ? data.progress : undefined,
13
- size: data.size ? data.size : undefined,
14
- statusDetails: data.status_details,
15
- url: data.url ? data.url : undefined
11
+ createdAt: unmarshalDate(data.created_at),
12
+ key: data.key,
13
+ name: data.name,
14
+ nameId: data.name_id,
15
+ projectId: data.project_id,
16
+ region: data.region,
17
+ status: data.status,
18
+ tags: data.tags,
19
+ updatedAt: unmarshalDate(data.updated_at),
20
+ value: data.value
16
21
  };
17
22
  };
18
23
  const unmarshalPinCIDMeta = data => {
@@ -20,7 +25,7 @@ const unmarshalPinCIDMeta = data => {
20
25
  throw new TypeError(`Unmarshalling the type 'PinCIDMeta' failed as data isn't a dictionary.`);
21
26
  }
22
27
  return {
23
- id: data.id ? data.id : undefined
28
+ id: data.id
24
29
  };
25
30
  };
26
31
  const unmarshalPinCID = data => {
@@ -28,21 +33,33 @@ const unmarshalPinCID = data => {
28
33
  throw new TypeError(`Unmarshalling the type 'PinCID' failed as data isn't a dictionary.`);
29
34
  }
30
35
  return {
31
- cid: data.cid ? data.cid : undefined,
32
- meta: unmarshalPinCIDMeta(data.meta),
33
- name: data.name ? data.name : undefined,
36
+ cid: data.cid,
37
+ meta: data.meta ? unmarshalPinCIDMeta(data.meta) : undefined,
38
+ name: data.name,
34
39
  origins: data.origins
35
40
  };
36
41
  };
42
+ const unmarshalPinInfo = data => {
43
+ if (!isJSONObject(data)) {
44
+ throw new TypeError(`Unmarshalling the type 'PinInfo' failed as data isn't a dictionary.`);
45
+ }
46
+ return {
47
+ id: data.id,
48
+ progress: data.progress,
49
+ size: data.size,
50
+ statusDetails: data.status_details,
51
+ url: data.url
52
+ };
53
+ };
37
54
  const unmarshalPin = data => {
38
55
  if (!isJSONObject(data)) {
39
56
  throw new TypeError(`Unmarshalling the type 'Pin' failed as data isn't a dictionary.`);
40
57
  }
41
58
  return {
42
- cid: unmarshalPinCID(data.cid),
59
+ cid: data.cid ? unmarshalPinCID(data.cid) : undefined,
43
60
  createdAt: unmarshalDate(data.created_at),
44
61
  delegates: data.delegates,
45
- info: unmarshalPinInfo(data.info),
62
+ info: data.info ? unmarshalPinInfo(data.info) : undefined,
46
63
  pinId: data.pin_id,
47
64
  status: data.status
48
65
  };
@@ -58,11 +75,33 @@ const unmarshalVolume = data => {
58
75
  name: data.name,
59
76
  projectId: data.project_id,
60
77
  region: data.region,
61
- size: data.size ? data.size : undefined,
78
+ size: data.size,
62
79
  tags: data.tags,
63
80
  updatedAt: unmarshalDate(data.updated_at)
64
81
  };
65
82
  };
83
+ const unmarshalExportKeyNameResponse = data => {
84
+ if (!isJSONObject(data)) {
85
+ throw new TypeError(`Unmarshalling the type 'ExportKeyNameResponse' failed as data isn't a dictionary.`);
86
+ }
87
+ return {
88
+ createdAt: unmarshalDate(data.created_at),
89
+ nameId: data.name_id,
90
+ privateKey: data.private_key,
91
+ projectId: data.project_id,
92
+ publicKey: data.public_key,
93
+ updatedAt: unmarshalDate(data.updated_at)
94
+ };
95
+ };
96
+ const unmarshalListNamesResponse = data => {
97
+ if (!isJSONObject(data)) {
98
+ throw new TypeError(`Unmarshalling the type 'ListNamesResponse' failed as data isn't a dictionary.`);
99
+ }
100
+ return {
101
+ names: unmarshalArrayOfObject(data.names, unmarshalName),
102
+ totalCount: data.total_count
103
+ };
104
+ };
66
105
  const unmarshalListPinsResponse = data => {
67
106
  if (!isJSONObject(data)) {
68
107
  throw new TypeError(`Unmarshalling the type 'ListPinsResponse' failed as data isn't a dictionary.`);
@@ -86,19 +125,23 @@ const unmarshalReplacePinResponse = data => {
86
125
  throw new TypeError(`Unmarshalling the type 'ReplacePinResponse' failed as data isn't a dictionary.`);
87
126
  }
88
127
  return {
89
- pin: unmarshalPin(data.pin)
128
+ pin: data.pin ? unmarshalPin(data.pin) : undefined
90
129
  };
91
130
  };
131
+ const marshalPinOptions = (request, defaults) => ({
132
+ replication_count: request.replicationCount,
133
+ required_zones: request.requiredZones
134
+ });
92
135
  const marshalCreatePinByCIDRequest = (request, defaults) => ({
93
136
  cid: request.cid,
94
137
  name: request.name,
95
138
  origins: request.origins,
96
- pin_options: request.pinOptions,
139
+ pin_options: request.pinOptions !== undefined ? marshalPinOptions(request.pinOptions) : undefined,
97
140
  volume_id: request.volumeId
98
141
  });
99
142
  const marshalCreatePinByURLRequest = (request, defaults) => ({
100
143
  name: request.name,
101
- pin_options: request.pinOptions,
144
+ pin_options: request.pinOptions !== undefined ? marshalPinOptions(request.pinOptions) : undefined,
102
145
  url: request.url,
103
146
  volume_id: request.volumeId
104
147
  });
@@ -106,11 +149,27 @@ const marshalCreateVolumeRequest = (request, defaults) => ({
106
149
  name: request.name,
107
150
  project_id: request.projectId ?? defaults.defaultProjectId
108
151
  });
152
+ const marshalIpnsApiCreateNameRequest = (request, defaults) => ({
153
+ name: request.name,
154
+ project_id: request.projectId ?? defaults.defaultProjectId,
155
+ value: request.value
156
+ });
157
+ const marshalIpnsApiImportKeyNameRequest = (request, defaults) => ({
158
+ name: request.name,
159
+ private_key: request.privateKey,
160
+ project_id: request.projectId ?? defaults.defaultProjectId,
161
+ value: request.value
162
+ });
163
+ const marshalIpnsApiUpdateNameRequest = (request, defaults) => ({
164
+ name: request.name,
165
+ tags: request.tags,
166
+ value: request.value
167
+ });
109
168
  const marshalReplacePinRequest = (request, defaults) => ({
110
169
  cid: request.cid,
111
170
  name: request.name,
112
171
  origins: request.origins,
113
- pin_options: request.pinOptions,
172
+ pin_options: request.pinOptions !== undefined ? marshalPinOptions(request.pinOptions) : undefined,
114
173
  volume_id: request.volumeId
115
174
  });
116
175
  const marshalUpdateVolumeRequest = (request, defaults) => ({
@@ -118,4 +177,4 @@ const marshalUpdateVolumeRequest = (request, defaults) => ({
118
177
  tags: request.tags
119
178
  });
120
179
 
121
- export { marshalCreatePinByCIDRequest, marshalCreatePinByURLRequest, marshalCreateVolumeRequest, marshalReplacePinRequest, marshalUpdateVolumeRequest, unmarshalListPinsResponse, unmarshalListVolumesResponse, unmarshalPin, unmarshalReplacePinResponse, unmarshalVolume };
180
+ export { marshalCreatePinByCIDRequest, marshalCreatePinByURLRequest, marshalCreateVolumeRequest, marshalIpnsApiCreateNameRequest, marshalIpnsApiImportKeyNameRequest, marshalIpnsApiUpdateNameRequest, marshalReplacePinRequest, marshalUpdateVolumeRequest, unmarshalExportKeyNameResponse, unmarshalListNamesResponse, unmarshalListPinsResponse, unmarshalListVolumesResponse, unmarshalName, unmarshalPin, unmarshalReplacePinResponse, unmarshalVolume };
@@ -29,15 +29,16 @@ const unmarshalPool = data => {
29
29
  minSize: data.min_size,
30
30
  name: data.name,
31
31
  nodeType: data.node_type,
32
- placementGroupId: data.placement_group_id ? data.placement_group_id : undefined,
32
+ placementGroupId: data.placement_group_id,
33
+ publicIpDisabled: data.public_ip_disabled,
33
34
  region: data.region,
34
- rootVolumeSize: data.root_volume_size ? data.root_volume_size : undefined,
35
+ rootVolumeSize: data.root_volume_size,
35
36
  rootVolumeType: data.root_volume_type,
36
37
  size: data.size,
37
38
  status: data.status,
38
39
  tags: data.tags,
39
40
  updatedAt: unmarshalDate(data.updated_at),
40
- upgradePolicy: unmarshalPoolUpgradePolicy(data.upgrade_policy),
41
+ upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : undefined,
41
42
  version: data.version,
42
43
  zone: data.zone
43
44
  };
@@ -58,20 +59,6 @@ const unmarshalVersion = data => {
58
59
  region: data.region
59
60
  };
60
61
  };
61
- const unmarshalClusterOpenIDConnectConfig = data => {
62
- if (!isJSONObject(data)) {
63
- throw new TypeError(`Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`);
64
- }
65
- return {
66
- clientId: data.client_id,
67
- groupsClaim: data.groups_claim,
68
- groupsPrefix: data.groups_prefix,
69
- issuerUrl: data.issuer_url,
70
- requiredClaim: data.required_claim,
71
- usernameClaim: data.username_claim,
72
- usernamePrefix: data.username_prefix
73
- };
74
- };
75
62
  const unmarshalMaintenanceWindow = data => {
76
63
  if (!isJSONObject(data)) {
77
64
  throw new TypeError(`Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.`);
@@ -87,7 +74,7 @@ const unmarshalClusterAutoUpgrade = data => {
87
74
  }
88
75
  return {
89
76
  enabled: data.enabled,
90
- maintenanceWindow: unmarshalMaintenanceWindow(data.maintenance_window)
77
+ maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : undefined
91
78
  };
92
79
  };
93
80
  const unmarshalClusterAutoscalerConfig = data => {
@@ -107,6 +94,20 @@ const unmarshalClusterAutoscalerConfig = data => {
107
94
  scaleDownUtilizationThreshold: data.scale_down_utilization_threshold
108
95
  };
109
96
  };
97
+ const unmarshalClusterOpenIDConnectConfig = data => {
98
+ if (!isJSONObject(data)) {
99
+ throw new TypeError(`Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`);
100
+ }
101
+ return {
102
+ clientId: data.client_id,
103
+ groupsClaim: data.groups_claim,
104
+ groupsPrefix: data.groups_prefix,
105
+ issuerUrl: data.issuer_url,
106
+ requiredClaim: data.required_claim,
107
+ usernameClaim: data.username_claim,
108
+ usernamePrefix: data.username_prefix
109
+ };
110
+ };
110
111
  const unmarshalCluster = data => {
111
112
  if (!isJSONObject(data)) {
112
113
  throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
@@ -114,22 +115,22 @@ const unmarshalCluster = data => {
114
115
  return {
115
116
  admissionPlugins: data.admission_plugins,
116
117
  apiserverCertSans: data.apiserver_cert_sans,
117
- autoUpgrade: unmarshalClusterAutoUpgrade(data.auto_upgrade),
118
- autoscalerConfig: unmarshalClusterAutoscalerConfig(data.autoscaler_config),
118
+ autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : undefined,
119
+ autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : undefined,
119
120
  clusterUrl: data.cluster_url,
120
121
  cni: data.cni,
121
122
  commitmentEndsAt: unmarshalDate(data.commitment_ends_at),
122
123
  createdAt: unmarshalDate(data.created_at),
123
- dashboardEnabled: data.dashboard_enabled ? data.dashboard_enabled : undefined,
124
+ dashboardEnabled: data.dashboard_enabled,
124
125
  description: data.description,
125
126
  dnsWildcard: data.dns_wildcard,
126
127
  featureGates: data.feature_gates,
127
128
  id: data.id,
128
129
  ingress: data.ingress ? data.ingress : undefined,
129
130
  name: data.name,
130
- openIdConnectConfig: unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config),
131
+ openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : undefined,
131
132
  organizationId: data.organization_id,
132
- privateNetworkId: data.private_network_id ? data.private_network_id : undefined,
133
+ privateNetworkId: data.private_network_id,
133
134
  projectId: data.project_id,
134
135
  region: data.region,
135
136
  status: data.status,
@@ -148,13 +149,13 @@ const unmarshalNode = data => {
148
149
  clusterId: data.cluster_id,
149
150
  conditions: data.conditions ? data.conditions : undefined,
150
151
  createdAt: unmarshalDate(data.created_at),
151
- errorMessage: data.error_message ? data.error_message : undefined,
152
+ errorMessage: data.error_message,
152
153
  id: data.id,
153
154
  name: data.name,
154
155
  poolId: data.pool_id,
155
156
  providerId: data.provider_id,
156
- publicIpV4: data.public_ip_v4 ? data.public_ip_v4 : undefined,
157
- publicIpV6: data.public_ip_v6 ? data.public_ip_v6 : undefined,
157
+ publicIpV4: data.public_ip_v4,
158
+ publicIpV6: data.public_ip_v6,
158
159
  region: data.region,
159
160
  status: data.status,
160
161
  updatedAt: unmarshalDate(data.updated_at)
@@ -181,7 +182,7 @@ const unmarshalClusterType = data => {
181
182
  }
182
183
  return {
183
184
  availability: data.availability,
184
- commitmentDelay: data.commitment_delay ? data.commitment_delay : undefined,
185
+ commitmentDelay: data.commitment_delay,
185
186
  dedicated: data.dedicated,
186
187
  maxNodes: data.max_nodes,
187
188
  memory: data.memory,
@@ -251,46 +252,104 @@ const unmarshalListVersionsResponse = data => {
251
252
  versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
252
253
  };
253
254
  };
255
+ const marshalMaintenanceWindow = (request, defaults) => ({
256
+ day: request.day,
257
+ start_hour: request.startHour
258
+ });
259
+ const marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({
260
+ max_surge: request.maxSurge,
261
+ max_unavailable: request.maxUnavailable
262
+ });
263
+ const marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({
264
+ enable: request.enable,
265
+ maintenance_window: request.maintenanceWindow !== undefined ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined
266
+ });
267
+ const marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({
268
+ balance_similar_node_groups: request.balanceSimilarNodeGroups,
269
+ estimator: request.estimator,
270
+ expander: request.expander,
271
+ expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
272
+ ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
273
+ max_graceful_termination_sec: request.maxGracefulTerminationSec,
274
+ scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
275
+ scale_down_disabled: request.scaleDownDisabled,
276
+ scale_down_unneeded_time: request.scaleDownUnneededTime,
277
+ scale_down_utilization_threshold: request.scaleDownUtilizationThreshold
278
+ });
279
+ const marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
280
+ client_id: request.clientId,
281
+ groups_claim: request.groupsClaim,
282
+ groups_prefix: request.groupsPrefix,
283
+ issuer_url: request.issuerUrl,
284
+ required_claim: request.requiredClaim,
285
+ username_claim: request.usernameClaim,
286
+ username_prefix: request.usernamePrefix
287
+ });
288
+ const marshalCreateClusterRequestPoolConfig = (request, defaults) => ({
289
+ autohealing: request.autohealing,
290
+ autoscaling: request.autoscaling,
291
+ container_runtime: request.containerRuntime,
292
+ kubelet_args: request.kubeletArgs,
293
+ max_size: request.maxSize,
294
+ min_size: request.minSize,
295
+ name: request.name,
296
+ node_type: request.nodeType,
297
+ placement_group_id: request.placementGroupId,
298
+ public_ip_disabled: request.publicIpDisabled,
299
+ root_volume_size: request.rootVolumeSize,
300
+ root_volume_type: request.rootVolumeType,
301
+ size: request.size,
302
+ tags: request.tags,
303
+ upgrade_policy: request.upgradePolicy !== undefined ? marshalCreateClusterRequestPoolConfigUpgradePolicy(request.upgradePolicy) : undefined,
304
+ zone: request.zone
305
+ });
254
306
  const marshalCreateClusterRequest = (request, defaults) => ({
255
307
  admission_plugins: request.admissionPlugins,
256
308
  apiserver_cert_sans: request.apiserverCertSans,
257
- auto_upgrade: request.autoUpgrade,
258
- autoscaler_config: request.autoscalerConfig,
309
+ auto_upgrade: request.autoUpgrade !== undefined ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined,
310
+ autoscaler_config: request.autoscalerConfig !== undefined ? marshalCreateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined,
259
311
  cni: request.cni,
260
312
  description: request.description,
261
313
  enable_dashboard: request.enableDashboard,
262
314
  feature_gates: request.featureGates,
263
315
  ingress: request.ingress,
264
316
  name: request.name || randomName('k8s'),
265
- open_id_connect_config: request.openIdConnectConfig,
266
- pools: request.pools,
317
+ open_id_connect_config: request.openIdConnectConfig !== undefined ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined,
318
+ pools: request.pools !== undefined ? request.pools.map(elt => marshalCreateClusterRequestPoolConfig(elt)) : undefined,
267
319
  private_network_id: request.privateNetworkId,
268
320
  tags: request.tags,
269
321
  type: request.type,
270
322
  version: request.version,
271
323
  ...resolveOneOf([{
324
+ default: defaults.defaultOrganizationId,
272
325
  param: 'organization_id',
273
326
  value: request.organizationId
274
327
  }, {
328
+ default: defaults.defaultProjectId,
275
329
  param: 'project_id',
276
330
  value: request.projectId
277
331
  }])
278
332
  });
333
+ const marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({
334
+ max_surge: request.maxSurge,
335
+ max_unavailable: request.maxUnavailable
336
+ });
279
337
  const marshalCreatePoolRequest = (request, defaults) => ({
280
338
  autohealing: request.autohealing,
281
339
  autoscaling: request.autoscaling,
282
340
  container_runtime: request.containerRuntime,
283
- kubelet_args: request.kubeletArgs,
341
+ kubelet_args: request.kubeletArgs !== undefined ? request.kubeletArgs : undefined,
284
342
  max_size: request.maxSize,
285
343
  min_size: request.minSize,
286
344
  name: request.name || randomName('pool'),
287
345
  node_type: request.nodeType,
288
346
  placement_group_id: request.placementGroupId,
347
+ public_ip_disabled: request.publicIpDisabled,
289
348
  root_volume_size: request.rootVolumeSize,
290
349
  root_volume_type: request.rootVolumeType,
291
350
  size: request.size,
292
351
  tags: request.tags,
293
- upgrade_policy: request.upgradePolicy,
352
+ upgrade_policy: request.upgradePolicy !== undefined ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined,
294
353
  zone: request.zone ?? defaults.defaultZone
295
354
  });
296
355
  const marshalMigrateToPrivateNetworkClusterRequest = (request, defaults) => ({
@@ -299,19 +358,48 @@ const marshalMigrateToPrivateNetworkClusterRequest = (request, defaults) => ({
299
358
  const marshalSetClusterTypeRequest = (request, defaults) => ({
300
359
  type: request.type
301
360
  });
361
+ const marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({
362
+ enable: request.enable,
363
+ maintenance_window: request.maintenanceWindow !== undefined ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined
364
+ });
365
+ const marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({
366
+ balance_similar_node_groups: request.balanceSimilarNodeGroups,
367
+ estimator: request.estimator,
368
+ expander: request.expander,
369
+ expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,
370
+ ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,
371
+ max_graceful_termination_sec: request.maxGracefulTerminationSec,
372
+ scale_down_delay_after_add: request.scaleDownDelayAfterAdd,
373
+ scale_down_disabled: request.scaleDownDisabled,
374
+ scale_down_unneeded_time: request.scaleDownUnneededTime,
375
+ scale_down_utilization_threshold: request.scaleDownUtilizationThreshold
376
+ });
377
+ const marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({
378
+ client_id: request.clientId,
379
+ groups_claim: request.groupsClaim,
380
+ groups_prefix: request.groupsPrefix,
381
+ issuer_url: request.issuerUrl,
382
+ required_claim: request.requiredClaim,
383
+ username_claim: request.usernameClaim,
384
+ username_prefix: request.usernamePrefix
385
+ });
302
386
  const marshalUpdateClusterRequest = (request, defaults) => ({
303
387
  admission_plugins: request.admissionPlugins,
304
388
  apiserver_cert_sans: request.apiserverCertSans,
305
- auto_upgrade: request.autoUpgrade,
306
- autoscaler_config: request.autoscalerConfig,
389
+ auto_upgrade: request.autoUpgrade !== undefined ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined,
390
+ autoscaler_config: request.autoscalerConfig !== undefined ? marshalUpdateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined,
307
391
  description: request.description,
308
392
  enable_dashboard: request.enableDashboard,
309
393
  feature_gates: request.featureGates,
310
394
  ingress: request.ingress,
311
395
  name: request.name,
312
- open_id_connect_config: request.openIdConnectConfig,
396
+ open_id_connect_config: request.openIdConnectConfig !== undefined ? marshalUpdateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined,
313
397
  tags: request.tags
314
398
  });
399
+ const marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({
400
+ max_surge: request.maxSurge,
401
+ max_unavailable: request.maxUnavailable
402
+ });
315
403
  const marshalUpdatePoolRequest = (request, defaults) => ({
316
404
  autohealing: request.autohealing,
317
405
  autoscaling: request.autoscaling,
@@ -320,7 +408,7 @@ const marshalUpdatePoolRequest = (request, defaults) => ({
320
408
  min_size: request.minSize,
321
409
  size: request.size,
322
410
  tags: request.tags,
323
- upgrade_policy: request.upgradePolicy
411
+ upgrade_policy: request.upgradePolicy !== undefined ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined
324
412
  });
325
413
  const marshalUpgradeClusterRequest = (request, defaults) => ({
326
414
  upgrade_pools: request.upgradePools,
@@ -18,7 +18,7 @@ const jsonContentHeaders = {
18
18
  */
19
19
  class ZonedAPI extends API$1 {
20
20
  /** Lists the available zones of the API. */
21
- static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2'];
21
+ static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2', 'pl-waw-3'];
22
22
  pageOfListLbs = (() => {
23
23
  var _this = this;
24
24
  return function (request) {