@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
@@ -25,16 +25,16 @@ const unmarshalAPIKey = data => {
25
25
  }
26
26
  return {
27
27
  accessKey: data.access_key,
28
- applicationId: data.application_id ? data.application_id : undefined,
28
+ applicationId: data.application_id,
29
29
  createdAt: unmarshalDate(data.created_at),
30
30
  creationIp: data.creation_ip,
31
31
  defaultProjectId: data.default_project_id,
32
32
  description: data.description,
33
33
  editable: data.editable,
34
34
  expiresAt: unmarshalDate(data.expires_at),
35
- secretKey: data.secret_key ? data.secret_key : undefined,
35
+ secretKey: data.secret_key,
36
36
  updatedAt: unmarshalDate(data.updated_at),
37
- userId: data.user_id ? data.user_id : undefined
37
+ userId: data.user_id
38
38
  };
39
39
  };
40
40
  const unmarshalApplication = data => {
@@ -72,20 +72,20 @@ const unmarshalPolicy = data => {
72
72
  throw new TypeError(`Unmarshalling the type 'Policy' failed as data isn't a dictionary.`);
73
73
  }
74
74
  return {
75
- applicationId: data.application_id ? data.application_id : undefined,
75
+ applicationId: data.application_id,
76
76
  createdAt: unmarshalDate(data.created_at),
77
77
  description: data.description,
78
78
  editable: data.editable,
79
- groupId: data.group_id ? data.group_id : undefined,
79
+ groupId: data.group_id,
80
80
  id: data.id,
81
81
  name: data.name,
82
82
  nbPermissionSets: data.nb_permission_sets,
83
83
  nbRules: data.nb_rules,
84
84
  nbScopes: data.nb_scopes,
85
- noPrincipal: data.no_principal ? data.no_principal : undefined,
85
+ noPrincipal: data.no_principal,
86
86
  organizationId: data.organization_id,
87
87
  updatedAt: unmarshalDate(data.updated_at),
88
- userId: data.user_id ? data.user_id : undefined
88
+ userId: data.user_id
89
89
  };
90
90
  };
91
91
  const unmarshalQuotum = data => {
@@ -93,9 +93,9 @@ const unmarshalQuotum = data => {
93
93
  throw new TypeError(`Unmarshalling the type 'Quotum' failed as data isn't a dictionary.`);
94
94
  }
95
95
  return {
96
- limit: data.limit ? data.limit : undefined,
96
+ limit: data.limit,
97
97
  name: data.name,
98
- unlimited: data.unlimited ? data.unlimited : undefined
98
+ unlimited: data.unlimited
99
99
  };
100
100
  };
101
101
  const unmarshalSSHKey = data => {
@@ -128,7 +128,7 @@ const unmarshalUser = data => {
128
128
  mfa: data.mfa,
129
129
  organizationId: data.organization_id,
130
130
  status: data.status,
131
- twoFactorEnabled: data.two_factor_enabled ? data.two_factor_enabled : undefined,
131
+ twoFactorEnabled: data.two_factor_enabled,
132
132
  type: data.type,
133
133
  updatedAt: unmarshalDate(data.updated_at)
134
134
  };
@@ -174,7 +174,7 @@ const unmarshalPermissionSet = data => {
174
174
  throw new TypeError(`Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.`);
175
175
  }
176
176
  return {
177
- categories: data.categories ? data.categories : undefined,
177
+ categories: data.categories,
178
178
  description: data.description,
179
179
  id: data.id,
180
180
  name: data.name,
@@ -213,12 +213,12 @@ const unmarshalRule = data => {
213
213
  throw new TypeError(`Unmarshalling the type 'Rule' failed as data isn't a dictionary.`);
214
214
  }
215
215
  return {
216
- accountRootUserId: data.account_root_user_id ? data.account_root_user_id : undefined,
216
+ accountRootUserId: data.account_root_user_id,
217
217
  id: data.id,
218
- organizationId: data.organization_id ? data.organization_id : undefined,
219
- permissionSetNames: data.permission_set_names ? data.permission_set_names : undefined,
218
+ organizationId: data.organization_id,
219
+ permissionSetNames: data.permission_set_names,
220
220
  permissionSetsScopeType: data.permission_sets_scope_type,
221
- projectIds: data.project_ids ? data.project_ids : undefined
221
+ projectIds: data.project_ids
222
222
  };
223
223
  };
224
224
  const unmarshalListRulesResponse = data => {
@@ -258,11 +258,11 @@ const unmarshalSetRulesResponse = data => {
258
258
  };
259
259
  const marshalAddGroupMemberRequest = (request, defaults) => ({
260
260
  ...resolveOneOf([{
261
- param: 'application_id',
262
- value: request.applicationId
263
- }, {
264
261
  param: 'user_id',
265
262
  value: request.userId
263
+ }, {
264
+ param: 'application_id',
265
+ value: request.applicationId
266
266
  }])
267
267
  });
268
268
  const marshalAddGroupMembersRequest = (request, defaults) => ({
@@ -291,23 +291,34 @@ const marshalCreateGroupRequest = (request, defaults) => ({
291
291
  name: request.name || randomName('grp'),
292
292
  organization_id: request.organizationId ?? defaults.defaultOrganizationId
293
293
  });
294
+ const marshalRuleSpecs = (request, defaults) => ({
295
+ permission_set_names: request.permissionSetNames,
296
+ ...resolveOneOf([{
297
+ param: 'project_ids',
298
+ value: request.projectIds
299
+ }, {
300
+ default: defaults.defaultOrganizationId,
301
+ param: 'organization_id',
302
+ value: request.organizationId
303
+ }])
304
+ });
294
305
  const marshalCreatePolicyRequest = (request, defaults) => ({
295
306
  description: request.description,
296
307
  name: request.name || randomName('pol'),
297
308
  organization_id: request.organizationId ?? defaults.defaultOrganizationId,
298
- rules: request.rules,
309
+ rules: request.rules !== undefined ? request.rules.map(elt => marshalRuleSpecs(elt, defaults)) : undefined,
299
310
  ...resolveOneOf([{
300
- param: 'application_id',
301
- value: request.applicationId
311
+ param: 'user_id',
312
+ value: request.userId
302
313
  }, {
303
314
  param: 'group_id',
304
315
  value: request.groupId
316
+ }, {
317
+ param: 'application_id',
318
+ value: request.applicationId
305
319
  }, {
306
320
  param: 'no_principal',
307
321
  value: request.noPrincipal
308
- }, {
309
- param: 'user_id',
310
- value: request.userId
311
322
  }])
312
323
  });
313
324
  const marshalCreateSSHKeyRequest = (request, defaults) => ({
@@ -321,11 +332,11 @@ const marshalCreateUserRequest = (request, defaults) => ({
321
332
  });
322
333
  const marshalRemoveGroupMemberRequest = (request, defaults) => ({
323
334
  ...resolveOneOf([{
324
- param: 'application_id',
325
- value: request.applicationId
326
- }, {
327
335
  param: 'user_id',
328
336
  value: request.userId
337
+ }, {
338
+ param: 'application_id',
339
+ value: request.applicationId
329
340
  }])
330
341
  });
331
342
  const marshalSetGroupMembersRequest = (request, defaults) => ({
@@ -334,7 +345,7 @@ const marshalSetGroupMembersRequest = (request, defaults) => ({
334
345
  });
335
346
  const marshalSetRulesRequest = (request, defaults) => ({
336
347
  policy_id: request.policyId,
337
- rules: request.rules
348
+ rules: request.rules.map(elt => marshalRuleSpecs(elt, defaults))
338
349
  });
339
350
  const marshalUpdateAPIKeyRequest = (request, defaults) => ({
340
351
  default_project_id: request.defaultProjectId,
@@ -352,17 +363,17 @@ const marshalUpdatePolicyRequest = (request, defaults) => ({
352
363
  description: request.description,
353
364
  name: request.name,
354
365
  ...resolveOneOf([{
355
- param: 'application_id',
356
- value: request.applicationId
366
+ param: 'user_id',
367
+ value: request.userId
357
368
  }, {
358
369
  param: 'group_id',
359
370
  value: request.groupId
371
+ }, {
372
+ param: 'application_id',
373
+ value: request.applicationId
360
374
  }, {
361
375
  param: 'no_principal',
362
376
  value: request.noPrincipal
363
- }, {
364
- param: 'user_id',
365
- value: request.userId
366
377
  }])
367
378
  });
368
379
  const marshalUpdateSSHKeyRequest = (request, defaults) => ({
@@ -83,7 +83,7 @@ class API extends API$1 {
83
83
  return _this4.client.fetch({
84
84
  method: 'GET',
85
85
  path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? _this4.client.settings.defaultZone)}/servers`,
86
- urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? _this4.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
86
+ urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? _this4.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], ['servers', request.servers && request.servers.length > 0 ? request.servers.join(',') : undefined], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])
87
87
  }, unmarshalListServersResponse);
88
88
  };
89
89
  })();