@scaleway/sdk 2.0.0-alpha.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +12 -12
  2. package/dist/api/baremetal/v1/marshalling.gen.js +63 -52
  3. package/dist/api/billing/v2alpha1/api.gen.js +32 -1
  4. package/dist/api/billing/v2alpha1/marshalling.gen.js +46 -1
  5. package/dist/api/block/v1alpha1/api.gen.js +23 -19
  6. package/dist/api/block/v1alpha1/marshalling.gen.js +47 -40
  7. package/dist/api/block/v1alpha1/validation-rules.gen.js +11 -1
  8. package/dist/api/cockpit/v1beta1/api.gen.js +143 -48
  9. package/dist/api/cockpit/v1beta1/marshalling.gen.js +89 -36
  10. package/dist/api/container/v1beta1/index.gen.js +2 -0
  11. package/dist/api/container/v1beta1/marshalling.gen.js +63 -35
  12. package/dist/api/container/v1beta1/validation-rules.gen.js +44 -0
  13. package/dist/api/document_db/v1beta1/marshalling.gen.js +117 -61
  14. package/dist/api/domain/v2beta1/api.gen.js +29 -37
  15. package/dist/api/domain/v2beta1/index.gen.js +0 -2
  16. package/dist/api/domain/v2beta1/marshalling.gen.js +408 -194
  17. package/dist/api/flexibleip/v1alpha1/api.gen.js +6 -14
  18. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
  19. package/dist/api/function/v1beta1/api.gen.js +36 -0
  20. package/dist/api/function/v1beta1/index.gen.js +2 -0
  21. package/dist/api/function/v1beta1/marshalling.gen.js +64 -36
  22. package/dist/api/function/v1beta1/validation-rules.gen.js +44 -0
  23. package/dist/api/iam/v1alpha1/api.gen.js +54 -44
  24. package/dist/api/iam/v1alpha1/marshalling.gen.js +69 -34
  25. package/dist/api/iam/v1alpha1/validation-rules.gen.js +10 -1
  26. package/dist/api/instance/v1/api.gen.js +1 -1
  27. package/dist/api/instance/v1/content.gen.js +4 -1
  28. package/dist/api/instance/v1/index.js +1 -1
  29. package/dist/api/instance/v1/marshalling.gen.js +414 -205
  30. package/dist/api/iot/v1/api.gen.js +24 -32
  31. package/dist/api/iot/v1/marshalling.gen.js +87 -36
  32. package/dist/api/ipam/index.js +2 -0
  33. package/dist/api/ipam/v1/api.gen.js +113 -0
  34. package/dist/api/ipam/v1/index.gen.js +6 -0
  35. package/dist/api/ipam/v1/marshalling.gen.js +77 -0
  36. package/dist/api/ipam/v1/validation-rules.gen.js +11 -0
  37. package/dist/api/ipfs/v1alpha1/api.gen.js +120 -3
  38. package/dist/api/ipfs/v1alpha1/content.gen.js +4 -1
  39. package/dist/api/ipfs/v1alpha1/index.gen.js +2 -2
  40. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +71 -19
  41. package/dist/api/jobs/index.js +2 -0
  42. package/dist/api/jobs/v1alpha1/api.gen.js +111 -0
  43. package/dist/api/jobs/v1alpha1/content.gen.js +7 -0
  44. package/dist/api/jobs/v1alpha1/index.gen.js +7 -0
  45. package/dist/api/jobs/v1alpha1/marshalling.gen.js +84 -0
  46. package/dist/api/jobs/v1alpha1/validation-rules.gen.js +45 -0
  47. package/dist/api/k8s/v1/marshalling.gen.js +128 -40
  48. package/dist/api/lb/v1/api.gen.js +1 -1
  49. package/dist/api/lb/v1/marshalling.gen.js +268 -152
  50. package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
  51. package/dist/api/marketplace/v2/api.gen.js +3 -3
  52. package/dist/api/mnq/index.js +2 -0
  53. package/dist/api/mnq/v1alpha1/api.gen.js +12 -20
  54. package/dist/api/mnq/v1alpha1/marshalling.gen.js +19 -14
  55. package/dist/api/mnq/v1beta1/api.gen.js +529 -0
  56. package/dist/api/mnq/v1beta1/index.gen.js +6 -0
  57. package/dist/api/mnq/v1beta1/marshalling.gen.js +212 -0
  58. package/dist/api/mnq/v1beta1/validation-rules.gen.js +77 -0
  59. package/dist/api/rdb/v1/marshalling.gen.js +131 -66
  60. package/dist/api/redis/v1/marshalling.gen.js +51 -27
  61. package/dist/api/registry/v1/marshalling.gen.js +6 -4
  62. package/dist/api/secret/v1alpha1/api.gen.js +2 -2
  63. package/dist/api/secret/v1alpha1/marshalling.gen.js +17 -5
  64. package/dist/api/std/index.gen.js +1 -0
  65. package/dist/api/tem/v1alpha1/api.gen.js +8 -2
  66. package/dist/api/tem/v1alpha1/marshalling.gen.js +35 -13
  67. package/dist/api/test/v1/marshalling.gen.js +5 -3
  68. package/dist/api/vpc/v2/marshalling.gen.js +2 -0
  69. package/dist/api/vpcgw/v1/marshalling.gen.js +53 -24
  70. package/dist/api/webhosting/v1alpha1/api.gen.js +2 -54
  71. package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
  72. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +14 -41
  73. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +1 -10
  74. package/dist/index.cjs +4351 -1833
  75. package/dist/index.d.ts +6778 -2542
  76. package/dist/index.js +34 -28
  77. package/dist/scw/constants.js +1 -1
  78. package/package.json +2 -2
@@ -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,11 +88,13 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
88
88
  is_public: request.isPublic,
89
89
  name: request.name || randomName('ns'),
90
90
  ...resolveOneOf([{
91
- param: 'organization_id',
92
- value: request.organizationId
93
- }, {
91
+ default: defaults.defaultProjectId,
94
92
  param: 'project_id',
95
93
  value: request.projectId
94
+ }, {
95
+ default: defaults.defaultOrganizationId,
96
+ param: 'organization_id',
97
+ value: request.organizationId
96
98
  }])
97
99
  });
98
100
  const marshalUpdateImageRequest = (request, defaults) => ({
@@ -17,7 +17,7 @@ const jsonContentHeaders = {
17
17
  */
18
18
  class API extends API$1 {
19
19
  /** Lists the available regions of the API. */
20
- static LOCALITIES = ['fr-par'];
20
+ static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];
21
21
 
22
22
  /**
23
23
  * Create a secret. You must specify the `region` to create a secret.
@@ -99,7 +99,7 @@ class API extends API$1 {
99
99
  return _this.client.fetch({
100
100
  method: 'GET',
101
101
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/secrets`,
102
- urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
102
+ urlParams: urlParams(['is_ephemeral', request.isEphemeral], ['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])
103
103
  }, unmarshalListSecretsResponse);
104
104
  };
105
105
  })();
@@ -12,7 +12,8 @@ const unmarshalFolder = data => {
12
12
  id: data.id,
13
13
  name: data.name,
14
14
  path: data.path,
15
- projectId: data.project_id
15
+ projectId: data.project_id,
16
+ region: data.region
16
17
  };
17
18
  };
18
19
  const unmarshalSecretVersion = data => {
@@ -21,7 +22,7 @@ const unmarshalSecretVersion = data => {
21
22
  }
22
23
  return {
23
24
  createdAt: unmarshalDate(data.created_at),
24
- description: data.description ? data.description : undefined,
25
+ description: data.description,
25
26
  isLatest: data.is_latest,
26
27
  revision: data.revision,
27
28
  secretId: data.secret_id,
@@ -35,7 +36,9 @@ const unmarshalSecret = data => {
35
36
  }
36
37
  return {
37
38
  createdAt: unmarshalDate(data.created_at),
38
- description: data.description ? data.description : undefined,
39
+ description: data.description,
40
+ ephemeralAction: data.ephemeral_action,
41
+ expiresAt: unmarshalDate(data.expires_at),
39
42
  id: data.id,
40
43
  isManaged: data.is_managed,
41
44
  isProtected: data.is_protected,
@@ -56,7 +59,7 @@ const unmarshalAccessSecretVersionResponse = data => {
56
59
  }
57
60
  return {
58
61
  data: data.data,
59
- dataCrc32: data.data_crc32 ? data.data_crc32 : undefined,
62
+ dataCrc32: data.data_crc32,
60
63
  revision: data.revision,
61
64
  secretId: data.secret_id
62
65
  };
@@ -108,18 +111,27 @@ const marshalCreateFolderRequest = (request, defaults) => ({
108
111
  });
109
112
  const marshalCreateSecretRequest = (request, defaults) => ({
110
113
  description: request.description,
114
+ ephemeral_action: request.ephemeralAction,
115
+ expires_at: request.expiresAt,
111
116
  name: request.name,
112
117
  path: request.path,
113
118
  project_id: request.projectId ?? defaults.defaultProjectId,
114
119
  tags: request.tags,
115
120
  type: request.type
116
121
  });
122
+ const marshalPasswordGenerationParams = (request, defaults) => ({
123
+ additional_chars: request.additionalChars,
124
+ length: request.length,
125
+ no_digits: request.noDigits,
126
+ no_lowercase_letters: request.noLowercaseLetters,
127
+ no_uppercase_letters: request.noUppercaseLetters
128
+ });
117
129
  const marshalCreateSecretVersionRequest = (request, defaults) => ({
118
130
  data: request.data,
119
131
  data_crc32: request.dataCrc32,
120
132
  description: request.description,
121
133
  disable_previous: request.disablePrevious,
122
- password_generation: request.passwordGeneration
134
+ password_generation: request.passwordGeneration !== undefined ? marshalPasswordGenerationParams(request.passwordGeneration) : undefined
123
135
  });
124
136
  const marshalGeneratePasswordRequest = (request, defaults) => ({
125
137
  additional_chars: request.additionalChars,
@@ -0,0 +1 @@
1
+
@@ -134,7 +134,13 @@ class API extends API$1 {
134
134
 
135
135
  /**
136
136
  * Get information about a domain. Retrieve information about a specific
137
- * domain using the `region` and `domain_id` parameters.
137
+ * domain using the `region` and `domain_id` parameters. Monitor your domain's
138
+ * reputation and improve **average** and **bad** reputation statuses, using
139
+ * your domain's **Email activity** tab on the [Scaleway
140
+ * console](https://console.scaleway.com/transactional-email/domains) to get a
141
+ * more detailed report. Check out our [dedicated
142
+ * documentation](https://www.scaleway.com/en/docs/managed-services/transactional-email/reference-content/understanding-tem-reputation-score/)
143
+ * to improve your domain's reputation.
138
144
  *
139
145
  * @param request - The request {@link GetDomainRequest}
140
146
  * @returns A Promise of Domain
@@ -167,7 +173,7 @@ class API extends API$1 {
167
173
  })();
168
174
 
169
175
  /**
170
- * List domains. Retrieve domains in a specific project or in a specific
176
+ * List domains. Retrieve domains in a specific Project or in a specific
171
177
  * Organization using the `region` parameter.
172
178
  *
173
179
  * @param request - The request {@link ListDomainsRequest}
@@ -27,15 +27,27 @@ 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)
37
37
  };
38
38
  };
39
+ const unmarshalDomainReputation = data => {
40
+ if (!isJSONObject(data)) {
41
+ throw new TypeError(`Unmarshalling the type 'DomainReputation' failed as data isn't a dictionary.`);
42
+ }
43
+ return {
44
+ previousScore: data.previous_score,
45
+ previousScoredAt: unmarshalDate(data.previous_scored_at),
46
+ score: data.score,
47
+ scoredAt: unmarshalDate(data.scored_at),
48
+ status: data.status
49
+ };
50
+ };
39
51
  const unmarshalDomainStatistics = data => {
40
52
  if (!isJSONObject(data)) {
41
53
  throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`);
@@ -55,16 +67,17 @@ const unmarshalDomain = data => {
55
67
  createdAt: unmarshalDate(data.created_at),
56
68
  dkimConfig: data.dkim_config,
57
69
  id: data.id,
58
- lastError: data.last_error ? data.last_error : undefined,
70
+ lastError: data.last_error,
59
71
  lastValidAt: unmarshalDate(data.last_valid_at),
60
72
  name: data.name,
61
73
  nextCheckAt: unmarshalDate(data.next_check_at),
62
74
  organizationId: data.organization_id,
63
75
  projectId: data.project_id,
64
76
  region: data.region,
77
+ reputation: data.reputation ? unmarshalDomainReputation(data.reputation) : undefined,
65
78
  revokedAt: unmarshalDate(data.revoked_at),
66
79
  spfConfig: data.spf_config,
67
- statistics: unmarshalDomainStatistics(data.statistics),
80
+ statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : undefined,
68
81
  status: data.status
69
82
  };
70
83
  };
@@ -81,7 +94,7 @@ const unmarshalDomainLastStatusDkimRecord = data => {
81
94
  throw new TypeError(`Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`);
82
95
  }
83
96
  return {
84
- error: data.error ? data.error : undefined,
97
+ error: data.error,
85
98
  lastValidAt: unmarshalDate(data.last_valid_at),
86
99
  status: data.status
87
100
  };
@@ -91,7 +104,7 @@ const unmarshalDomainLastStatusSpfRecord = data => {
91
104
  throw new TypeError(`Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`);
92
105
  }
93
106
  return {
94
- error: data.error ? data.error : undefined,
107
+ error: data.error,
95
108
  lastValidAt: unmarshalDate(data.last_valid_at),
96
109
  status: data.status
97
110
  };
@@ -101,10 +114,10 @@ const unmarshalDomainLastStatus = data => {
101
114
  throw new TypeError(`Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`);
102
115
  }
103
116
  return {
104
- dkimRecord: unmarshalDomainLastStatusDkimRecord(data.dkim_record),
117
+ dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : undefined,
105
118
  domainId: data.domain_id,
106
119
  domainName: data.domain_name,
107
- spfRecord: unmarshalDomainLastStatusSpfRecord(data.spf_record)
120
+ spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : undefined
108
121
  };
109
122
  };
110
123
  const unmarshalListDomainsResponse = data => {
@@ -143,17 +156,26 @@ const marshalCreateDomainRequest = (request, defaults) => ({
143
156
  domain_name: request.domainName,
144
157
  project_id: request.projectId ?? defaults.defaultProjectId
145
158
  });
159
+ const marshalCreateEmailRequestAddress = (request, defaults) => ({
160
+ email: request.email,
161
+ name: request.name
162
+ });
163
+ const marshalCreateEmailRequestAttachment = (request, defaults) => ({
164
+ content: request.content,
165
+ name: request.name,
166
+ type: request.type
167
+ });
146
168
  const marshalCreateEmailRequest = (request, defaults) => ({
147
- attachments: request.attachments,
148
- bcc: request.bcc,
149
- cc: request.cc,
150
- from: request.from,
169
+ attachments: request.attachments !== undefined ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt)) : undefined,
170
+ bcc: request.bcc !== undefined ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
171
+ cc: request.cc !== undefined ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
172
+ from: request.from !== undefined ? marshalCreateEmailRequestAddress(request.from) : undefined,
151
173
  html: request.html,
152
174
  project_id: request.projectId ?? defaults.defaultProjectId,
153
175
  send_before: request.sendBefore,
154
176
  subject: request.subject,
155
177
  text: request.text,
156
- to: request.to
178
+ to: request.to !== undefined ? request.to.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined
157
179
  });
158
180
 
159
181
  export { marshalCreateDomainRequest, marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalDomain, unmarshalDomainLastStatus, unmarshalEmail, unmarshalListDomainsResponse, unmarshalListEmailsResponse, unmarshalStatistics };
@@ -54,11 +54,13 @@ const marshalCreateHumanRequest = (request, defaults) => ({
54
54
  name: request.name,
55
55
  shoe_size: request.shoeSize,
56
56
  ...resolveOneOf([{
57
- param: 'organization_id',
58
- value: request.organizationId
59
- }, {
57
+ default: defaults.defaultProjectId,
60
58
  param: 'project_id',
61
59
  value: request.projectId
60
+ }, {
61
+ default: defaults.defaultOrganizationId,
62
+ param: 'organization_id',
63
+ value: request.organizationId
62
64
  }])
63
65
  });
64
66
  const marshalRegisterRequest = (request, defaults) => ({
@@ -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,37 @@ 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
+ ipamIpId: data.ipam_ip_id,
39
+ pushDefaultRoute: data.push_default_route
40
+ };
41
+ };
33
42
  const unmarshalGatewayNetwork = data => {
34
43
  if (!isJSONObject(data)) {
35
44
  throw new TypeError(`Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`);
36
45
  }
37
46
  return {
38
- address: data.address ? data.address : undefined,
47
+ address: data.address,
39
48
  createdAt: unmarshalDate(data.created_at),
40
- dhcp: unmarshalDHCP(data.dhcp),
49
+ dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : undefined,
41
50
  enableDhcp: data.enable_dhcp,
42
51
  enableMasquerade: data.enable_masquerade,
43
52
  gatewayId: data.gateway_id,
44
53
  id: data.id,
45
- macAddress: data.mac_address ? data.mac_address : undefined,
54
+ ipamConfig: data.ipam_config ? unmarshalIpamConfig(data.ipam_config) : undefined,
55
+ macAddress: data.mac_address,
46
56
  privateNetworkId: data.private_network_id,
47
57
  status: data.status,
48
58
  updatedAt: unmarshalDate(data.updated_at),
@@ -56,11 +66,11 @@ const unmarshalIP = data => {
56
66
  return {
57
67
  address: data.address,
58
68
  createdAt: unmarshalDate(data.created_at),
59
- gatewayId: data.gateway_id ? data.gateway_id : undefined,
69
+ gatewayId: data.gateway_id,
60
70
  id: data.id,
61
71
  organizationId: data.organization_id,
62
72
  projectId: data.project_id,
63
- reverse: data.reverse ? data.reverse : undefined,
73
+ reverse: data.reverse,
64
74
  tags: data.tags,
65
75
  updatedAt: unmarshalDate(data.updated_at),
66
76
  zone: data.zone
@@ -99,21 +109,22 @@ const unmarshalGateway = data => {
99
109
  return {
100
110
  bastionEnabled: data.bastion_enabled,
101
111
  bastionPort: data.bastion_port,
102
- canUpgradeTo: data.can_upgrade_to ? data.can_upgrade_to : undefined,
112
+ canUpgradeTo: data.can_upgrade_to,
103
113
  createdAt: unmarshalDate(data.created_at),
104
114
  gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),
105
115
  id: data.id,
106
- ip: unmarshalIP(data.ip),
116
+ ip: data.ip ? unmarshalIP(data.ip) : undefined,
117
+ isLegacy: data.is_legacy,
107
118
  name: data.name,
108
119
  organizationId: data.organization_id,
109
120
  projectId: data.project_id,
110
121
  smtpEnabled: data.smtp_enabled,
111
122
  status: data.status,
112
123
  tags: data.tags,
113
- type: unmarshalGatewayType(data.type),
124
+ type: data.type ? unmarshalGatewayType(data.type) : undefined,
114
125
  updatedAt: unmarshalDate(data.updated_at),
115
126
  upstreamDnsServers: data.upstream_dns_servers,
116
- version: data.version ? data.version : undefined,
127
+ version: data.version,
117
128
  zone: data.zone
118
129
  };
119
130
  };
@@ -232,23 +243,27 @@ const marshalCreateDHCPEntryRequest = (request, defaults) => ({
232
243
  ip_address: request.ipAddress,
233
244
  mac_address: request.macAddress
234
245
  });
246
+ const marshalCreateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
247
+ ipam_ip_id: request.ipamIpId,
248
+ push_default_route: request.pushDefaultRoute
249
+ });
235
250
  const marshalCreateGatewayNetworkRequest = (request, defaults) => ({
236
251
  enable_dhcp: request.enableDhcp,
237
252
  enable_masquerade: request.enableMasquerade,
238
253
  gateway_id: request.gatewayId,
239
254
  private_network_id: request.privateNetworkId,
240
255
  ...resolveOneOf([{
241
- param: 'address',
242
- value: request.address
256
+ param: 'dhcp_id',
257
+ value: request.dhcpId
243
258
  }, {
244
259
  param: 'dhcp',
245
- value: request.dhcp
260
+ value: request.dhcp !== undefined ? marshalCreateDHCPRequest(request.dhcp, defaults) : undefined
246
261
  }, {
247
- param: 'dhcp_id',
248
- value: request.dhcpId
262
+ param: 'address',
263
+ value: request.address
249
264
  }, {
250
265
  param: 'ipam_config',
251
- value: request.ipamConfig
266
+ value: request.ipamConfig !== undefined ? marshalCreateGatewayNetworkRequestIpamConfig(request.ipamConfig) : undefined
252
267
  }])
253
268
  });
254
269
  const marshalCreateGatewayRequest = (request, defaults) => ({
@@ -273,13 +288,23 @@ const marshalCreatePATRuleRequest = (request, defaults) => ({
273
288
  protocol: request.protocol,
274
289
  public_port: request.publicPort
275
290
  });
291
+ const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({
292
+ ip_address: request.ipAddress,
293
+ mac_address: request.macAddress
294
+ });
276
295
  const marshalSetDHCPEntriesRequest = (request, defaults) => ({
277
- dhcp_entries: request.dhcpEntries,
296
+ dhcp_entries: request.dhcpEntries !== undefined ? request.dhcpEntries.map(elt => marshalSetDHCPEntriesRequestEntry(elt)) : undefined,
278
297
  gateway_network_id: request.gatewayNetworkId
279
298
  });
299
+ const marshalSetPATRulesRequestRule = (request, defaults) => ({
300
+ private_ip: request.privateIp,
301
+ private_port: request.privatePort,
302
+ protocol: request.protocol,
303
+ public_port: request.publicPort
304
+ });
280
305
  const marshalSetPATRulesRequest = (request, defaults) => ({
281
306
  gateway_id: request.gatewayId,
282
- pat_rules: request.patRules
307
+ pat_rules: request.patRules.map(elt => marshalSetPATRulesRequestRule(elt))
283
308
  });
284
309
  const marshalUpdateDHCPEntryRequest = (request, defaults) => ({
285
310
  ip_address: request.ipAddress
@@ -299,18 +324,22 @@ const marshalUpdateDHCPRequest = (request, defaults) => ({
299
324
  subnet: request.subnet,
300
325
  valid_lifetime: request.validLifetime
301
326
  });
327
+ const marshalUpdateGatewayNetworkRequestIpamConfig = (request, defaults) => ({
328
+ ipam_ip_id: request.ipamIpId,
329
+ push_default_route: request.pushDefaultRoute
330
+ });
302
331
  const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({
303
332
  enable_dhcp: request.enableDhcp,
304
333
  enable_masquerade: request.enableMasquerade,
305
334
  ...resolveOneOf([{
306
- param: 'address',
307
- value: request.address
308
- }, {
309
335
  param: 'dhcp_id',
310
336
  value: request.dhcpId
337
+ }, {
338
+ param: 'address',
339
+ value: request.address
311
340
  }, {
312
341
  param: 'ipam_config',
313
- value: request.ipamConfig
342
+ value: request.ipamConfig !== undefined ? marshalUpdateGatewayNetworkRequestIpamConfig(request.ipamConfig) : undefined
314
343
  }])
315
344
  });
316
345
  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 };