@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
@@ -10,17 +10,11 @@ const unmarshalACLRule = data => {
10
10
  throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
11
11
  }
12
12
  return {
13
- description: data.description ? data.description : undefined,
13
+ description: data.description,
14
14
  id: data.id,
15
- ipCidr: data.ip_cidr ? data.ip_cidr : undefined
15
+ ipCidr: data.ip_cidr
16
16
  };
17
17
  };
18
- const unmarshalPublicNetwork = data => {
19
- if (!isJSONObject(data)) {
20
- throw new TypeError(`Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`);
21
- }
22
- return {};
23
- };
24
18
  const unmarshalPrivateNetwork = data => {
25
19
  if (!isJSONObject(data)) {
26
20
  throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
@@ -32,6 +26,12 @@ const unmarshalPrivateNetwork = data => {
32
26
  zone: data.zone
33
27
  };
34
28
  };
29
+ const unmarshalPublicNetwork = data => {
30
+ if (!isJSONObject(data)) {
31
+ throw new TypeError(`Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`);
32
+ }
33
+ return {};
34
+ };
35
35
  const unmarshalEndpoint = data => {
36
36
  if (!isJSONObject(data)) {
37
37
  throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
@@ -116,13 +116,13 @@ const unmarshalAvailableClusterSetting = data => {
116
116
  throw new TypeError(`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`);
117
117
  }
118
118
  return {
119
- defaultValue: data.default_value ? data.default_value : undefined,
119
+ defaultValue: data.default_value,
120
120
  deprecated: data.deprecated,
121
121
  description: data.description,
122
- maxValue: data.max_value ? data.max_value : undefined,
123
- minValue: data.min_value ? data.min_value : undefined,
122
+ maxValue: data.max_value,
123
+ minValue: data.min_value,
124
124
  name: data.name,
125
- regex: data.regex ? data.regex : undefined,
125
+ regex: data.regex,
126
126
  type: data.type
127
127
  };
128
128
  };
@@ -196,20 +196,44 @@ const unmarshalSetEndpointsResponse = data => {
196
196
  endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)
197
197
  };
198
198
  };
199
+ const marshalACLRuleSpec = (request, defaults) => ({
200
+ description: request.description,
201
+ ip_cidr: request.ipCidr
202
+ });
199
203
  const marshalAddAclRulesRequest = (request, defaults) => ({
200
- acl_rules: request.aclRules
204
+ acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt))
205
+ });
206
+ const marshalClusterSetting = (request, defaults) => ({
207
+ name: request.name,
208
+ value: request.value
201
209
  });
202
210
  const marshalAddClusterSettingsRequest = (request, defaults) => ({
203
- settings: request.settings
211
+ settings: request.settings.map(elt => marshalClusterSetting(elt))
212
+ });
213
+ const marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({});
214
+ const marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({
215
+ id: request.id,
216
+ ipam_config: request.ipamConfig !== undefined ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(request.ipamConfig) : undefined,
217
+ service_ips: request.serviceIps
218
+ });
219
+ const marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({});
220
+ const marshalEndpointSpec = (request, defaults) => ({
221
+ ...resolveOneOf([{
222
+ param: 'private_network',
223
+ value: request.privateNetwork !== undefined ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined
224
+ }, {
225
+ param: 'public_network',
226
+ value: request.publicNetwork !== undefined ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined
227
+ }])
204
228
  });
205
229
  const marshalAddEndpointsRequest = (request, defaults) => ({
206
- endpoints: request.endpoints
230
+ endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt))
207
231
  });
208
232
  const marshalCreateClusterRequest = (request, defaults) => ({
209
- acl_rules: request.aclRules,
210
- cluster_settings: request.clusterSettings,
233
+ acl_rules: request.aclRules !== undefined ? request.aclRules.map(elt => marshalACLRuleSpec(elt)) : undefined,
234
+ cluster_settings: request.clusterSettings !== undefined ? request.clusterSettings.map(elt => marshalClusterSetting(elt)) : undefined,
211
235
  cluster_size: request.clusterSize,
212
- endpoints: request.endpoints,
236
+ endpoints: request.endpoints !== undefined ? request.endpoints.map(elt => marshalEndpointSpec(elt)) : undefined,
213
237
  name: request.name || randomName('ins'),
214
238
  node_type: request.nodeType,
215
239
  password: request.password,
@@ -221,24 +245,24 @@ const marshalCreateClusterRequest = (request, defaults) => ({
221
245
  });
222
246
  const marshalMigrateClusterRequest = (request, defaults) => ({
223
247
  ...resolveOneOf([{
224
- param: 'cluster_size',
225
- value: request.clusterSize
248
+ param: 'version',
249
+ value: request.version
226
250
  }, {
227
251
  param: 'node_type',
228
252
  value: request.nodeType
229
253
  }, {
230
- param: 'version',
231
- value: request.version
254
+ param: 'cluster_size',
255
+ value: request.clusterSize
232
256
  }])
233
257
  });
234
258
  const marshalSetAclRulesRequest = (request, defaults) => ({
235
- acl_rules: request.aclRules
259
+ acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt))
236
260
  });
237
261
  const marshalSetClusterSettingsRequest = (request, defaults) => ({
238
- settings: request.settings
262
+ settings: request.settings.map(elt => marshalClusterSetting(elt))
239
263
  });
240
264
  const marshalSetEndpointsRequest = (request, defaults) => ({
241
- endpoints: request.endpoints
265
+ endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt))
242
266
  });
243
267
  const marshalUpdateClusterRequest = (request, defaults) => ({
244
268
  name: request.name,
@@ -249,10 +273,10 @@ const marshalUpdateClusterRequest = (request, defaults) => ({
249
273
  const marshalUpdateEndpointRequest = (request, defaults) => ({
250
274
  ...resolveOneOf([{
251
275
  param: 'private_network',
252
- value: request.privateNetwork
276
+ value: request.privateNetwork !== undefined ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined
253
277
  }, {
254
278
  param: 'public_network',
255
- value: request.publicNetwork
279
+ value: request.publicNetwork !== undefined ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined
256
280
  }])
257
281
  });
258
282
 
@@ -15,7 +15,7 @@ const unmarshalImage = data => {
15
15
  namespaceId: data.namespace_id,
16
16
  size: data.size,
17
17
  status: data.status,
18
- statusMessage: data.status_message ? data.status_message : undefined,
18
+ statusMessage: data.status_message,
19
19
  tags: data.tags,
20
20
  updatedAt: unmarshalDate(data.updated_at),
21
21
  visibility: data.visibility
@@ -88,9 +88,11 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
88
88
  is_public: request.isPublic,
89
89
  name: request.name || randomName('ns'),
90
90
  ...resolveOneOf([{
91
+ default: defaults.defaultOrganizationId,
91
92
  param: 'organization_id',
92
93
  value: request.organizationId
93
94
  }, {
95
+ default: defaults.defaultProjectId,
94
96
  param: 'project_id',
95
97
  value: request.projectId
96
98
  }])
@@ -21,7 +21,7 @@ const unmarshalSecretVersion = data => {
21
21
  }
22
22
  return {
23
23
  createdAt: unmarshalDate(data.created_at),
24
- description: data.description ? data.description : undefined,
24
+ description: data.description,
25
25
  isLatest: data.is_latest,
26
26
  revision: data.revision,
27
27
  secretId: data.secret_id,
@@ -35,7 +35,7 @@ const unmarshalSecret = data => {
35
35
  }
36
36
  return {
37
37
  createdAt: unmarshalDate(data.created_at),
38
- description: data.description ? data.description : undefined,
38
+ description: data.description,
39
39
  id: data.id,
40
40
  isManaged: data.is_managed,
41
41
  isProtected: data.is_protected,
@@ -56,7 +56,7 @@ const unmarshalAccessSecretVersionResponse = data => {
56
56
  }
57
57
  return {
58
58
  data: data.data,
59
- dataCrc32: data.data_crc32 ? data.data_crc32 : undefined,
59
+ dataCrc32: data.data_crc32,
60
60
  revision: data.revision,
61
61
  secretId: data.secret_id
62
62
  };
@@ -114,12 +114,19 @@ const marshalCreateSecretRequest = (request, defaults) => ({
114
114
  tags: request.tags,
115
115
  type: request.type
116
116
  });
117
+ const marshalPasswordGenerationParams = (request, defaults) => ({
118
+ additional_chars: request.additionalChars,
119
+ length: request.length,
120
+ no_digits: request.noDigits,
121
+ no_lowercase_letters: request.noLowercaseLetters,
122
+ no_uppercase_letters: request.noUppercaseLetters
123
+ });
117
124
  const marshalCreateSecretVersionRequest = (request, defaults) => ({
118
125
  data: request.data,
119
126
  data_crc32: request.dataCrc32,
120
127
  description: request.description,
121
128
  disable_previous: request.disablePrevious,
122
- password_generation: request.passwordGeneration
129
+ password_generation: request.passwordGeneration !== undefined ? marshalPasswordGenerationParams(request.passwordGeneration) : undefined
123
130
  });
124
131
  const marshalGeneratePasswordRequest = (request, defaults) => ({
125
132
  additional_chars: request.additionalChars,
@@ -27,10 +27,10 @@ const unmarshalEmail = data => {
27
27
  mailRcpt: data.mail_rcpt,
28
28
  messageId: data.message_id,
29
29
  projectId: data.project_id,
30
- rcptTo: data.rcpt_to ? data.rcpt_to : undefined,
30
+ rcptTo: data.rcpt_to,
31
31
  rcptType: data.rcpt_type,
32
32
  status: data.status,
33
- statusDetails: data.status_details ? data.status_details : undefined,
33
+ statusDetails: data.status_details,
34
34
  subject: data.subject,
35
35
  tryCount: data.try_count,
36
36
  updatedAt: unmarshalDate(data.updated_at)
@@ -55,7 +55,7 @@ const unmarshalDomain = data => {
55
55
  createdAt: unmarshalDate(data.created_at),
56
56
  dkimConfig: data.dkim_config,
57
57
  id: data.id,
58
- lastError: data.last_error ? data.last_error : undefined,
58
+ lastError: data.last_error,
59
59
  lastValidAt: unmarshalDate(data.last_valid_at),
60
60
  name: data.name,
61
61
  nextCheckAt: unmarshalDate(data.next_check_at),
@@ -64,7 +64,7 @@ const unmarshalDomain = data => {
64
64
  region: data.region,
65
65
  revokedAt: unmarshalDate(data.revoked_at),
66
66
  spfConfig: data.spf_config,
67
- statistics: unmarshalDomainStatistics(data.statistics),
67
+ statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : undefined,
68
68
  status: data.status
69
69
  };
70
70
  };
@@ -81,7 +81,7 @@ const unmarshalDomainLastStatusDkimRecord = data => {
81
81
  throw new TypeError(`Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`);
82
82
  }
83
83
  return {
84
- error: data.error ? data.error : undefined,
84
+ error: data.error,
85
85
  lastValidAt: unmarshalDate(data.last_valid_at),
86
86
  status: data.status
87
87
  };
@@ -91,7 +91,7 @@ const unmarshalDomainLastStatusSpfRecord = data => {
91
91
  throw new TypeError(`Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`);
92
92
  }
93
93
  return {
94
- error: data.error ? data.error : undefined,
94
+ error: data.error,
95
95
  lastValidAt: unmarshalDate(data.last_valid_at),
96
96
  status: data.status
97
97
  };
@@ -101,10 +101,10 @@ const unmarshalDomainLastStatus = data => {
101
101
  throw new TypeError(`Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`);
102
102
  }
103
103
  return {
104
- dkimRecord: unmarshalDomainLastStatusDkimRecord(data.dkim_record),
104
+ dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : undefined,
105
105
  domainId: data.domain_id,
106
106
  domainName: data.domain_name,
107
- spfRecord: unmarshalDomainLastStatusSpfRecord(data.spf_record)
107
+ spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : undefined
108
108
  };
109
109
  };
110
110
  const unmarshalListDomainsResponse = data => {
@@ -143,17 +143,26 @@ const marshalCreateDomainRequest = (request, defaults) => ({
143
143
  domain_name: request.domainName,
144
144
  project_id: request.projectId ?? defaults.defaultProjectId
145
145
  });
146
+ const marshalCreateEmailRequestAddress = (request, defaults) => ({
147
+ email: request.email,
148
+ name: request.name
149
+ });
150
+ const marshalCreateEmailRequestAttachment = (request, defaults) => ({
151
+ content: request.content,
152
+ name: request.name,
153
+ type: request.type
154
+ });
146
155
  const marshalCreateEmailRequest = (request, defaults) => ({
147
- attachments: request.attachments,
148
- bcc: request.bcc,
149
- cc: request.cc,
150
- from: request.from,
156
+ attachments: request.attachments !== undefined ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt)) : undefined,
157
+ bcc: request.bcc !== undefined ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
158
+ cc: request.cc !== undefined ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
159
+ from: request.from !== undefined ? marshalCreateEmailRequestAddress(request.from) : undefined,
151
160
  html: request.html,
152
161
  project_id: request.projectId ?? defaults.defaultProjectId,
153
162
  send_before: request.sendBefore,
154
163
  subject: request.subject,
155
164
  text: request.text,
156
- to: request.to
165
+ to: request.to !== undefined ? request.to.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined
157
166
  });
158
167
 
159
168
  export { marshalCreateDomainRequest, marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalDomain, unmarshalDomainLastStatus, unmarshalEmail, unmarshalListDomainsResponse, unmarshalListEmailsResponse, unmarshalStatistics };
@@ -54,9 +54,11 @@ const marshalCreateHumanRequest = (request, defaults) => ({
54
54
  name: request.name,
55
55
  shoe_size: request.shoeSize,
56
56
  ...resolveOneOf([{
57
+ default: defaults.defaultOrganizationId,
57
58
  param: 'organization_id',
58
59
  value: request.organizationId
59
60
  }, {
61
+ default: defaults.defaultProjectId,
60
62
  param: 'project_id',
61
63
  value: request.projectId
62
64
  }])
@@ -113,9 +113,11 @@ const marshalDeleteSubnetsRequest = (request, defaults) => ({
113
113
  const marshalMigrateZonalPrivateNetworksRequest = (request, defaults) => ({
114
114
  private_network_ids: request.privateNetworkIds,
115
115
  ...resolveOneOf([{
116
+ default: defaults.defaultOrganizationId,
116
117
  param: 'organization_id',
117
118
  value: request.organizationId
118
119
  }, {
120
+ default: defaults.defaultProjectId,
119
121
  param: 'project_id',
120
122
  value: request.projectId
121
123
  }])
@@ -22,27 +22,36 @@ const unmarshalDHCP = data => {
22
22
  projectId: data.project_id,
23
23
  pushDefaultRoute: data.push_default_route,
24
24
  pushDnsServer: data.push_dns_server,
25
- rebindTimer: data.rebind_timer ? data.rebind_timer : undefined,
26
- renewTimer: data.renew_timer ? data.renew_timer : undefined,
25
+ rebindTimer: data.rebind_timer,
26
+ renewTimer: data.renew_timer,
27
27
  subnet: data.subnet,
28
28
  updatedAt: unmarshalDate(data.updated_at),
29
- validLifetime: data.valid_lifetime ? data.valid_lifetime : undefined,
29
+ validLifetime: data.valid_lifetime,
30
30
  zone: data.zone
31
31
  };
32
32
  };
33
+ const unmarshalIpamConfig = data => {
34
+ if (!isJSONObject(data)) {
35
+ throw new TypeError(`Unmarshalling the type 'IpamConfig' failed as data isn't a dictionary.`);
36
+ }
37
+ return {
38
+ pushDefaultRoute: data.push_default_route
39
+ };
40
+ };
33
41
  const unmarshalGatewayNetwork = data => {
34
42
  if (!isJSONObject(data)) {
35
43
  throw new TypeError(`Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`);
36
44
  }
37
45
  return {
38
- address: data.address ? data.address : undefined,
46
+ address: data.address,
39
47
  createdAt: unmarshalDate(data.created_at),
40
- dhcp: unmarshalDHCP(data.dhcp),
48
+ dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : undefined,
41
49
  enableDhcp: data.enable_dhcp,
42
50
  enableMasquerade: data.enable_masquerade,
43
51
  gatewayId: data.gateway_id,
44
52
  id: data.id,
45
- macAddress: data.mac_address ? data.mac_address : undefined,
53
+ ipamConfig: data.ipam_config ? unmarshalIpamConfig(data.ipam_config) : undefined,
54
+ macAddress: data.mac_address,
46
55
  privateNetworkId: data.private_network_id,
47
56
  status: data.status,
48
57
  updatedAt: unmarshalDate(data.updated_at),
@@ -56,11 +65,11 @@ const unmarshalIP = data => {
56
65
  return {
57
66
  address: data.address,
58
67
  createdAt: unmarshalDate(data.created_at),
59
- gatewayId: data.gateway_id ? data.gateway_id : undefined,
68
+ gatewayId: data.gateway_id,
60
69
  id: data.id,
61
70
  organizationId: data.organization_id,
62
71
  projectId: data.project_id,
63
- reverse: data.reverse ? data.reverse : undefined,
72
+ reverse: data.reverse,
64
73
  tags: data.tags,
65
74
  updatedAt: unmarshalDate(data.updated_at),
66
75
  zone: data.zone
@@ -99,21 +108,22 @@ const unmarshalGateway = data => {
99
108
  return {
100
109
  bastionEnabled: data.bastion_enabled,
101
110
  bastionPort: data.bastion_port,
102
- canUpgradeTo: data.can_upgrade_to ? data.can_upgrade_to : undefined,
111
+ canUpgradeTo: data.can_upgrade_to,
103
112
  createdAt: unmarshalDate(data.created_at),
104
113
  gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
105
114
  id: data.id,
106
- ip: unmarshalIP(data.ip),
115
+ ip: data.ip ? unmarshalIP(data.ip) : undefined,
116
+ isLegacy: data.is_legacy,
107
117
  name: data.name,
108
118
  organizationId: data.organization_id,
109
119
  projectId: data.project_id,
110
120
  smtpEnabled: data.smtp_enabled,
111
121
  status: data.status,
112
122
  tags: data.tags,
113
- type: unmarshalGatewayType(data.type),
123
+ type: data.type ? unmarshalGatewayType(data.type) : undefined,
114
124
  updatedAt: unmarshalDate(data.updated_at),
115
125
  upstreamDnsServers: data.upstream_dns_servers,
116
- version: data.version ? data.version : undefined,
126
+ version: data.version,
117
127
  zone: data.zone
118
128
  };
119
129
  };
@@ -232,23 +242,26 @@ const marshalCreateDHCPEntryRequest = (request, defaults) => ({
232
242
  ip_address: request.ipAddress,
233
243
  mac_address: request.macAddress
234
244
  });
245
+ const marshalIpamConfig = (request, defaults) => ({
246
+ push_default_route: request.pushDefaultRoute
247
+ });
235
248
  const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
236
249
  enable_dhcp: request.enableDhcp,
237
250
  enable_masquerade: request.enableMasquerade,
238
251
  gateway_id: request.gatewayId,
239
252
  private_network_id: request.privateNetworkId,
240
253
  ...resolveOneOf([{
241
- param: 'address',
242
- value: request.address
254
+ param: 'dhcp_id',
255
+ value: request.dhcpId
243
256
  }, {
244
257
  param: 'dhcp',
245
- value: request.dhcp
258
+ value: request.dhcp !== undefined ? marshalCreateDHCPRequest(request.dhcp, defaults) : undefined
246
259
  }, {
247
- param: 'dhcp_id',
248
- value: request.dhcpId
260
+ param: 'address',
261
+ value: request.address
249
262
  }, {
250
263
  param: 'ipam_config',
251
- value: request.ipamConfig
264
+ value: request.ipamConfig !== undefined ? marshalIpamConfig(request.ipamConfig) : undefined
252
265
  }])
253
266
  });
254
267
  const marshalCreateGatewayRequest = (request, defaults) => ({
@@ -273,13 +286,23 @@ const marshalCreatePATRuleRequest = (request, defaults) => ({
273
286
  protocol: request.protocol,
274
287
  public_port: request.publicPort
275
288
  });
289
+ const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
290
+ ip_address: request.ipAddress,
291
+ mac_address: request.macAddress
292
+ });
276
293
  const marshalSetDHCPEntriesRequest = (request, defaults) => ({
277
- dhcp_entries: request.dhcpEntries,
294
+ dhcp_entries: request.dhcpEntries !== undefined ? request.dhcpEntries.map(elt => marshalSetDHCPEntriesRequestEntry(elt)) : undefined,
278
295
  gateway_network_id: request.gatewayNetworkId
279
296
  });
297
+ const marshalSetPATRulesRequestRule = (request, defaults) => ({
298
+ private_ip: request.privateIp,
299
+ private_port: request.privatePort,
300
+ protocol: request.protocol,
301
+ public_port: request.publicPort
302
+ });
280
303
  const marshalSetPATRulesRequest = (request, defaults) => ({
281
304
  gateway_id: request.gatewayId,
282
- pat_rules: request.patRules
305
+ pat_rules: request.patRules.map(elt => marshalSetPATRulesRequestRule(elt))
283
306
  });
284
307
  const marshalUpdateDHCPEntryRequest = (request, defaults) => ({
285
308
  ip_address: request.ipAddress
@@ -303,14 +326,14 @@ const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
303
326
  enable_dhcp: request.enableDhcp,
304
327
  enable_masquerade: request.enableMasquerade,
305
328
  ...resolveOneOf([{
306
- param: 'address',
307
- value: request.address
308
- }, {
309
329
  param: 'dhcp_id',
310
330
  value: request.dhcpId
331
+ }, {
332
+ param: 'address',
333
+ value: request.address
311
334
  }, {
312
335
  param: 'ipam_config',
313
- value: request.ipamConfig
336
+ value: request.ipamConfig !== undefined ? marshalIpamConfig(request.ipamConfig) : undefined
314
337
  }])
315
338
  });
316
339
  const marshalUpdateGatewayRequest = (request, defaults) => ({
@@ -3,7 +3,7 @@ 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
5
  import { HOSTING_TRANSIENT_STATUSES } from './content.gen.js';
6
- import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse, unmarshalListDediboxHostingsResponse, marshalDediboxApiMigrateDediboxHostingRequest } from './marshalling.gen.js';
6
+ import { marshalCreateHostingRequest, unmarshalHosting, unmarshalListHostingsResponse, marshalUpdateHostingRequest, unmarshalDnsRecords, unmarshalListOffersResponse } 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.
@@ -155,56 +155,4 @@ class API extends API$1 {
155
155
  }, unmarshalListOffersResponse);
156
156
  }
157
157
 
158
- /**
159
- * WebHosting Dedibox API.
160
- *
161
- * This API allows to migrate your Dedibox hostings.
162
- */
163
- class DediboxAPI extends API$1 {
164
- /** Lists the available regions of the API. */
165
- static LOCALITIES = ['fr-par'];
166
- pageOfListDediboxHostings = (() => {
167
- var _this3 = this;
168
- return function (request) {
169
- if (request === void 0) {
170
- request = {};
171
- }
172
- return _this3.client.fetch({
173
- method: 'GET',
174
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/dedibox-hostings`,
175
- urlParams: urlParams(['order_by', request.orderBy], ['organization_id', request.organizationId ?? _this3.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize])
176
- }, unmarshalListDediboxHostingsResponse);
177
- };
178
- })();
179
-
180
- /**
181
- * List all Dedibox hostings for Dedibox user ID.
182
- *
183
- * @param request - The request {@link DediboxApiListDediboxHostingsRequest}
184
- * @returns A Promise of ListDediboxHostingsResponse
185
- */
186
- listDediboxHostings = (() => {
187
- var _this4 = this;
188
- return function (request) {
189
- if (request === void 0) {
190
- request = {};
191
- }
192
- return enrichForPagination('dediboxHostings', _this4.pageOfListDediboxHostings, request);
193
- };
194
- })();
195
-
196
- /**
197
- * Migrate a hosting from Dedibox to Scaleway account.
198
- *
199
- * @param request - The request {@link DediboxApiMigrateDediboxHostingRequest}
200
- * @returns A Promise of Hosting
201
- */
202
- migrateDediboxHosting = request => this.client.fetch({
203
- body: JSON.stringify(marshalDediboxApiMigrateDediboxHostingRequest(request, this.client.settings)),
204
- headers: jsonContentHeaders,
205
- method: 'POST',
206
- path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/dedibox-hostings/migrate`
207
- }, unmarshalHosting);
208
- }
209
-
210
- export { API, DediboxAPI };
158
+ export { API };
@@ -1,4 +1,4 @@
1
- export { API, DediboxAPI } from './api.gen.js';
1
+ export { API } from './api.gen.js';
2
2
  export { HOSTING_TRANSIENT_STATUSES } from './content.gen.js';
3
3
  import * as validationRules_gen from './validation-rules.gen.js';
4
4
  export { validationRules_gen as ValidationRules };