@scaleway/sdk 1.34.0 → 2.0.0-alpha.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 (61) hide show
  1. package/dist/api/account/v2/api.gen.js +1 -1
  2. package/dist/api/account/v3/api.gen.js +1 -1
  3. package/dist/api/applesilicon/v1alpha1/api.gen.js +1 -1
  4. package/dist/api/applesilicon/v1alpha1/marshalling.gen.js +26 -26
  5. package/dist/api/baremetal/v1/api.gen.js +6 -6
  6. package/dist/api/baremetal/v1/marshalling.gen.js +109 -120
  7. package/dist/api/billing/v2alpha1/api.gen.js +3 -3
  8. package/dist/api/billing/v2alpha1/marshalling.gen.js +9 -9
  9. package/dist/api/cockpit/v1beta1/api.gen.js +47 -71
  10. package/dist/api/cockpit/v1beta1/marshalling.gen.js +43 -63
  11. package/dist/api/container/v1beta1/api.gen.js +11 -11
  12. package/dist/api/container/v1beta1/marshalling.gen.js +76 -102
  13. package/dist/api/document_db/v1beta1/api.gen.js +6 -6
  14. package/dist/api/document_db/v1beta1/marshalling.gen.js +169 -225
  15. package/dist/api/domain/v2beta1/api.gen.js +45 -38
  16. package/dist/api/domain/v2beta1/index.gen.js +2 -0
  17. package/dist/api/domain/v2beta1/marshalling.gen.js +361 -575
  18. package/dist/api/flexibleip/v1alpha1/api.gen.js +15 -7
  19. package/dist/api/flexibleip/v1alpha1/marshalling.gen.js +2 -2
  20. package/dist/api/function/v1beta1/api.gen.js +11 -11
  21. package/dist/api/function/v1beta1/marshalling.gen.js +103 -129
  22. package/dist/api/iam/v1alpha1/api.gen.js +64 -32
  23. package/dist/api/iam/v1alpha1/marshalling.gen.js +68 -78
  24. package/dist/api/instance/v1/api.gen.js +1 -1
  25. package/dist/api/instance/v1/marshalling.gen.js +397 -602
  26. package/dist/api/iot/v1/api.gen.js +35 -27
  27. package/dist/api/iot/v1/marshalling.gen.js +111 -162
  28. package/dist/api/ipfs/v1alpha1/api.gen.js +2 -2
  29. package/dist/api/ipfs/v1alpha1/marshalling.gen.js +23 -27
  30. package/dist/api/k8s/v1/api.gen.js +3 -3
  31. package/dist/api/k8s/v1/marshalling.gen.js +109 -194
  32. package/dist/api/lb/v1/api.gen.js +583 -552
  33. package/dist/api/lb/v1/marshalling.gen.js +245 -361
  34. package/dist/api/marketplace/v1/marshalling.gen.js +11 -11
  35. package/dist/api/marketplace/v2/api.gen.js +6 -6
  36. package/dist/api/mnq/v1alpha1/api.gen.js +21 -14
  37. package/dist/api/mnq/v1alpha1/marshalling.gen.js +35 -40
  38. package/dist/api/rdb/v1/api.gen.js +7 -7
  39. package/dist/api/rdb/v1/marshalling.gen.js +184 -240
  40. package/dist/api/redis/v1/api.gen.js +1 -1
  41. package/dist/api/redis/v1/marshalling.gen.js +73 -97
  42. package/dist/api/registry/v1/api.gen.js +3 -3
  43. package/dist/api/registry/v1/marshalling.gen.js +5 -7
  44. package/dist/api/secret/v1alpha1/api.gen.js +2 -2
  45. package/dist/api/secret/v1alpha1/marshalling.gen.js +20 -30
  46. package/dist/api/tem/v1alpha1/api.gen.js +1 -1
  47. package/dist/api/tem/v1alpha1/marshalling.gen.js +52 -61
  48. package/dist/api/test/v1/api.gen.js +8 -25
  49. package/dist/api/test/v1/marshalling.gen.js +5 -7
  50. package/dist/api/vpc/v1/api.gen.js +1 -1
  51. package/dist/api/vpc/v2/api.gen.js +2 -2
  52. package/dist/api/vpc/v2/marshalling.gen.js +3 -5
  53. package/dist/api/vpcgw/v1/api.gen.js +6 -6
  54. package/dist/api/vpcgw/v1/marshalling.gen.js +36 -49
  55. package/dist/api/webhosting/v1alpha1/api.gen.js +56 -4
  56. package/dist/api/webhosting/v1alpha1/index.gen.js +1 -1
  57. package/dist/api/webhosting/v1alpha1/marshalling.gen.js +69 -42
  58. package/dist/api/webhosting/v1alpha1/validation-rules.gen.js +10 -1
  59. package/dist/index.cjs +3127 -3989
  60. package/dist/index.d.ts +9658 -12221
  61. package/package.json +2 -2
@@ -5,15 +5,14 @@ import { unmarshalArrayOfObject, unmarshalDate, resolveOneOf } from '../../../he
5
5
 
6
6
  // This file was automatically generated. DO NOT EDIT.
7
7
  // If you have any remark or suggestion do not hesitate to open an issue.
8
- const unmarshalPrivateNetwork = data => {
8
+ const unmarshalACLRule = data => {
9
9
  if (!isJSONObject(data)) {
10
- throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
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
14
  id: data.id,
14
- provisioningMode: data.provisioning_mode,
15
- serviceIps: data.service_ips,
16
- zone: data.zone
15
+ ipCidr: data.ip_cidr ? data.ip_cidr : undefined
17
16
  };
18
17
  };
19
18
  const unmarshalPublicNetwork = data => {
@@ -22,29 +21,27 @@ const unmarshalPublicNetwork = data => {
22
21
  }
23
22
  return {};
24
23
  };
25
- const unmarshalACLRule = data => {
24
+ const unmarshalPrivateNetwork = data => {
26
25
  if (!isJSONObject(data)) {
27
- throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);
26
+ throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);
28
27
  }
29
28
  return {
30
- description: data.description,
31
29
  id: data.id,
32
- ipCidr: data.ip_cidr
30
+ provisioningMode: data.provisioning_mode,
31
+ serviceIps: data.service_ips,
32
+ zone: data.zone
33
33
  };
34
34
  };
35
- const unmarshalAvailableClusterSetting = data => {
35
+ const unmarshalEndpoint = data => {
36
36
  if (!isJSONObject(data)) {
37
- throw new TypeError(`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`);
37
+ throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
38
38
  }
39
39
  return {
40
- defaultValue: data.default_value,
41
- deprecated: data.deprecated,
42
- description: data.description,
43
- maxValue: data.max_value,
44
- minValue: data.min_value,
45
- name: data.name,
46
- regex: data.regex,
47
- type: data.type
40
+ id: data.id,
41
+ ips: data.ips,
42
+ port: data.port,
43
+ privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : undefined,
44
+ publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : undefined
48
45
  };
49
46
  };
50
47
  const unmarshalClusterSetting = data => {
@@ -56,18 +53,6 @@ const unmarshalClusterSetting = data => {
56
53
  value: data.value
57
54
  };
58
55
  };
59
- const unmarshalEndpoint = data => {
60
- if (!isJSONObject(data)) {
61
- throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
62
- }
63
- return {
64
- id: data.id,
65
- ips: data.ips,
66
- port: data.port,
67
- privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : undefined,
68
- publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : undefined
69
- };
70
- };
71
56
  const unmarshalCluster = data => {
72
57
  if (!isJSONObject(data)) {
73
58
  throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
@@ -92,33 +77,6 @@ const unmarshalCluster = data => {
92
77
  zone: data.zone
93
78
  };
94
79
  };
95
- const unmarshalClusterVersion = data => {
96
- if (!isJSONObject(data)) {
97
- throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`);
98
- }
99
- return {
100
- availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting),
101
- endOfLifeAt: unmarshalDate(data.end_of_life_at),
102
- logoUrl: data.logo_url,
103
- version: data.version,
104
- zone: data.zone
105
- };
106
- };
107
- const unmarshalNodeType = data => {
108
- if (!isJSONObject(data)) {
109
- throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
110
- }
111
- return {
112
- beta: data.beta,
113
- description: data.description,
114
- disabled: data.disabled,
115
- memory: data.memory,
116
- name: data.name,
117
- stockStatus: data.stock_status,
118
- vcpus: data.vcpus,
119
- zone: data.zone
120
- };
121
- };
122
80
  const unmarshalAddAclRulesResponse = data => {
123
81
  if (!isJSONObject(data)) {
124
82
  throw new TypeError(`Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`);
@@ -153,6 +111,33 @@ const unmarshalClusterSettingsResponse = data => {
153
111
  settings: unmarshalArrayOfObject(data.settings, unmarshalClusterSetting)
154
112
  };
155
113
  };
114
+ const unmarshalAvailableClusterSetting = data => {
115
+ if (!isJSONObject(data)) {
116
+ throw new TypeError(`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`);
117
+ }
118
+ return {
119
+ defaultValue: data.default_value ? data.default_value : undefined,
120
+ deprecated: data.deprecated,
121
+ description: data.description,
122
+ maxValue: data.max_value ? data.max_value : undefined,
123
+ minValue: data.min_value ? data.min_value : undefined,
124
+ name: data.name,
125
+ regex: data.regex ? data.regex : undefined,
126
+ type: data.type
127
+ };
128
+ };
129
+ const unmarshalClusterVersion = data => {
130
+ if (!isJSONObject(data)) {
131
+ throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`);
132
+ }
133
+ return {
134
+ availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting),
135
+ endOfLifeAt: unmarshalDate(data.end_of_life_at),
136
+ logoUrl: data.logo_url,
137
+ version: data.version,
138
+ zone: data.zone
139
+ };
140
+ };
156
141
  const unmarshalListClusterVersionsResponse = data => {
157
142
  if (!isJSONObject(data)) {
158
143
  throw new TypeError(`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`);
@@ -171,6 +156,21 @@ const unmarshalListClustersResponse = data => {
171
156
  totalCount: data.total_count
172
157
  };
173
158
  };
159
+ const unmarshalNodeType = data => {
160
+ if (!isJSONObject(data)) {
161
+ throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
162
+ }
163
+ return {
164
+ beta: data.beta,
165
+ description: data.description,
166
+ disabled: data.disabled,
167
+ memory: data.memory,
168
+ name: data.name,
169
+ stockStatus: data.stock_status,
170
+ vcpus: data.vcpus,
171
+ zone: data.zone
172
+ };
173
+ };
174
174
  const unmarshalListNodeTypesResponse = data => {
175
175
  if (!isJSONObject(data)) {
176
176
  throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
@@ -196,44 +196,20 @@ const unmarshalSetEndpointsResponse = data => {
196
196
  endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)
197
197
  };
198
198
  };
199
- const marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({});
200
- const marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({
201
- id: request.id,
202
- ipam_config: request.ipamConfig ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(request.ipamConfig) : undefined,
203
- service_ips: request.serviceIps
204
- });
205
- const marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({});
206
- const marshalACLRuleSpec = (request, defaults) => ({
207
- description: request.description,
208
- ip_cidr: request.ipCidr
209
- });
210
- const marshalClusterSetting = (request, defaults) => ({
211
- name: request.name,
212
- value: request.value
213
- });
214
- const marshalEndpointSpec = (request, defaults) => ({
215
- ...resolveOneOf([{
216
- param: 'private_network',
217
- value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined
218
- }, {
219
- param: 'public_network',
220
- value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined
221
- }])
222
- });
223
199
  const marshalAddAclRulesRequest = (request, defaults) => ({
224
- acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt))
200
+ acl_rules: request.aclRules
225
201
  });
226
202
  const marshalAddClusterSettingsRequest = (request, defaults) => ({
227
- settings: request.settings.map(elt => marshalClusterSetting(elt))
203
+ settings: request.settings
228
204
  });
229
205
  const marshalAddEndpointsRequest = (request, defaults) => ({
230
- endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt))
206
+ endpoints: request.endpoints
231
207
  });
232
208
  const marshalCreateClusterRequest = (request, defaults) => ({
233
- acl_rules: request.aclRules ? request.aclRules.map(elt => marshalACLRuleSpec(elt)) : undefined,
234
- cluster_settings: request.clusterSettings ? request.clusterSettings.map(elt => marshalClusterSetting(elt)) : undefined,
209
+ acl_rules: request.aclRules,
210
+ cluster_settings: request.clusterSettings,
235
211
  cluster_size: request.clusterSize,
236
- endpoints: request.endpoints ? request.endpoints.map(elt => marshalEndpointSpec(elt)) : undefined,
212
+ endpoints: request.endpoints,
237
213
  name: request.name || randomName('ins'),
238
214
  node_type: request.nodeType,
239
215
  password: request.password,
@@ -245,24 +221,24 @@ const marshalCreateClusterRequest = (request, defaults) => ({
245
221
  });
246
222
  const marshalMigrateClusterRequest = (request, defaults) => ({
247
223
  ...resolveOneOf([{
248
- param: 'version',
249
- value: request.version
224
+ param: 'cluster_size',
225
+ value: request.clusterSize
250
226
  }, {
251
227
  param: 'node_type',
252
228
  value: request.nodeType
253
229
  }, {
254
- param: 'cluster_size',
255
- value: request.clusterSize
230
+ param: 'version',
231
+ value: request.version
256
232
  }])
257
233
  });
258
234
  const marshalSetAclRulesRequest = (request, defaults) => ({
259
- acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt))
235
+ acl_rules: request.aclRules
260
236
  });
261
237
  const marshalSetClusterSettingsRequest = (request, defaults) => ({
262
- settings: request.settings.map(elt => marshalClusterSetting(elt))
238
+ settings: request.settings
263
239
  });
264
240
  const marshalSetEndpointsRequest = (request, defaults) => ({
265
- endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt))
241
+ endpoints: request.endpoints
266
242
  });
267
243
  const marshalUpdateClusterRequest = (request, defaults) => ({
268
244
  name: request.name,
@@ -273,10 +249,10 @@ const marshalUpdateClusterRequest = (request, defaults) => ({
273
249
  const marshalUpdateEndpointRequest = (request, defaults) => ({
274
250
  ...resolveOneOf([{
275
251
  param: 'private_network',
276
- value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined
252
+ value: request.privateNetwork
277
253
  }, {
278
254
  param: 'public_network',
279
- value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined
255
+ value: request.publicNetwork
280
256
  }])
281
257
  });
282
258
 
@@ -24,7 +24,7 @@ class API extends API$1 {
24
24
  return _this.client.fetch({
25
25
  method: 'GET',
26
26
  path: `/registry/v1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/namespaces`,
27
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
27
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId])
28
28
  }, unmarshalListNamespacesResponse);
29
29
  };
30
30
  })();
@@ -124,7 +124,7 @@ class API extends API$1 {
124
124
  return _this3.client.fetch({
125
125
  method: 'GET',
126
126
  path: `/registry/v1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/images`,
127
- urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
127
+ urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['project_id', request.projectId])
128
128
  }, unmarshalListImagesResponse);
129
129
  };
130
130
  })();
@@ -199,7 +199,7 @@ class API extends API$1 {
199
199
  pageOfListTags = request => this.client.fetch({
200
200
  method: 'GET',
201
201
  path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}/tags`,
202
- urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
202
+ urlParams: urlParams(['name', request.name], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])
203
203
  }, unmarshalListTagsResponse);
204
204
 
205
205
  /**
@@ -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,
18
+ statusMessage: data.status_message ? data.status_message : undefined,
19
19
  tags: data.tags,
20
20
  updatedAt: unmarshalDate(data.updated_at),
21
21
  visibility: data.visibility
@@ -88,17 +88,15 @@ const marshalCreateNamespaceRequest = (request, defaults) => ({
88
88
  is_public: request.isPublic,
89
89
  name: request.name || randomName('ns'),
90
90
  ...resolveOneOf([{
91
- default: defaults.defaultProjectId,
92
- param: 'project_id',
93
- value: request.projectId
94
- }, {
95
- default: defaults.defaultOrganizationId,
96
91
  param: 'organization_id',
97
92
  value: request.organizationId
93
+ }, {
94
+ param: 'project_id',
95
+ value: request.projectId
98
96
  }])
99
97
  });
100
98
  const marshalUpdateImageRequest = (request, defaults) => ({
101
- visibility: request.visibility ?? 'visibility_unknown'
99
+ visibility: request.visibility
102
100
  });
103
101
  const marshalUpdateNamespaceRequest = (request, defaults) => ({
104
102
  description: request.description,
@@ -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 ?? 'name_asc'], ['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_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
  })();
@@ -130,7 +130,7 @@ class API extends API$1 {
130
130
  return _this3.client.fetch({
131
131
  method: 'GET',
132
132
  path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? _this3.client.settings.defaultRegion)}/folders`,
133
- urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId])
133
+ urlParams: urlParams(['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this3.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId])
134
134
  }, unmarshalListFoldersResponse);
135
135
  };
136
136
  })();
@@ -1,5 +1,5 @@
1
1
  import { isJSONObject } from '../../../helpers/json.js';
2
- import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from '../../../helpers/marshalling.js';
2
+ import { unmarshalDate, unmarshalArrayOfObject } from '../../../helpers/marshalling.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.
@@ -15,13 +15,27 @@ const unmarshalFolder = data => {
15
15
  projectId: data.project_id
16
16
  };
17
17
  };
18
+ const unmarshalSecretVersion = data => {
19
+ if (!isJSONObject(data)) {
20
+ throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);
21
+ }
22
+ return {
23
+ createdAt: unmarshalDate(data.created_at),
24
+ description: data.description ? data.description : undefined,
25
+ isLatest: data.is_latest,
26
+ revision: data.revision,
27
+ secretId: data.secret_id,
28
+ status: data.status,
29
+ updatedAt: unmarshalDate(data.updated_at)
30
+ };
31
+ };
18
32
  const unmarshalSecret = data => {
19
33
  if (!isJSONObject(data)) {
20
34
  throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);
21
35
  }
22
36
  return {
23
37
  createdAt: unmarshalDate(data.created_at),
24
- description: data.description,
38
+ description: data.description ? data.description : undefined,
25
39
  id: data.id,
26
40
  isManaged: data.is_managed,
27
41
  isProtected: data.is_protected,
@@ -36,27 +50,13 @@ const unmarshalSecret = data => {
36
50
  versionCount: data.version_count
37
51
  };
38
52
  };
39
- const unmarshalSecretVersion = data => {
40
- if (!isJSONObject(data)) {
41
- throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);
42
- }
43
- return {
44
- createdAt: unmarshalDate(data.created_at),
45
- description: data.description,
46
- isLatest: data.is_latest,
47
- revision: data.revision,
48
- secretId: data.secret_id,
49
- status: data.status,
50
- updatedAt: unmarshalDate(data.updated_at)
51
- };
52
- };
53
53
  const unmarshalAccessSecretVersionResponse = data => {
54
54
  if (!isJSONObject(data)) {
55
55
  throw new TypeError(`Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`);
56
56
  }
57
57
  return {
58
58
  data: data.data,
59
- dataCrc32: data.data_crc32,
59
+ dataCrc32: data.data_crc32 ? data.data_crc32 : undefined,
60
60
  revision: data.revision,
61
61
  secretId: data.secret_id
62
62
  };
@@ -97,15 +97,8 @@ const unmarshalListTagsResponse = data => {
97
97
  totalCount: data.total_count
98
98
  };
99
99
  };
100
- const marshalPasswordGenerationParams = (request, defaults) => ({
101
- additional_chars: request.additionalChars,
102
- length: request.length,
103
- no_digits: request.noDigits,
104
- no_lowercase_letters: request.noLowercaseLetters,
105
- no_uppercase_letters: request.noUppercaseLetters
106
- });
107
100
  const marshalAddSecretOwnerRequest = (request, defaults) => ({
108
- product: request.product ?? 'unknown',
101
+ product: request.product,
109
102
  product_name: request.productName
110
103
  });
111
104
  const marshalCreateFolderRequest = (request, defaults) => ({
@@ -119,17 +112,14 @@ const marshalCreateSecretRequest = (request, defaults) => ({
119
112
  path: request.path,
120
113
  project_id: request.projectId ?? defaults.defaultProjectId,
121
114
  tags: request.tags,
122
- type: request.type ?? 'unknown_secret_type'
115
+ type: request.type
123
116
  });
124
117
  const marshalCreateSecretVersionRequest = (request, defaults) => ({
125
118
  data: request.data,
126
119
  data_crc32: request.dataCrc32,
127
120
  description: request.description,
128
121
  disable_previous: request.disablePrevious,
129
- ...resolveOneOf([{
130
- param: 'password_generation',
131
- value: request.passwordGeneration ? marshalPasswordGenerationParams(request.passwordGeneration) : undefined
132
- }])
122
+ password_generation: request.passwordGeneration
133
123
  });
134
124
  const marshalGeneratePasswordRequest = (request, defaults) => ({
135
125
  additional_chars: request.additionalChars,
@@ -61,7 +61,7 @@ class API extends API$1 {
61
61
  return _this.client.fetch({
62
62
  method: 'GET',
63
63
  path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? _this.client.settings.defaultRegion)}/emails`,
64
- urlParams: urlParams(['domain_id', request.domainId], ['flags', request.flags], ['mail_from', request.mailFrom], ['mail_rcpt', request.mailRcpt], ['mail_to', request.mailTo], ['message_id', request.messageId], ['order_by', request.orderBy ?? 'created_at_desc'], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['search', request.search], ['since', request.since], ['statuses', request.statuses], ['subject', request.subject], ['until', request.until])
64
+ urlParams: urlParams(['domain_id', request.domainId], ['flags', request.flags], ['mail_from', request.mailFrom], ['mail_rcpt', request.mailRcpt], ['mail_to', request.mailTo], ['message_id', request.messageId], ['order_by', request.orderBy], ['page', request.page], ['page_size', request.pageSize ?? _this.client.settings.defaultPageSize], ['project_id', request.projectId], ['search', request.search], ['since', request.since], ['statuses', request.statuses], ['subject', request.subject], ['until', request.until])
65
65
  }, unmarshalListEmailsResponse);
66
66
  };
67
67
  })();
@@ -3,17 +3,6 @@ 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 unmarshalDomainStatistics = data => {
7
- if (!isJSONObject(data)) {
8
- throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`);
9
- }
10
- return {
11
- canceledCount: data.canceled_count,
12
- failedCount: data.failed_count,
13
- sentCount: data.sent_count,
14
- totalCount: data.total_count
15
- };
16
- };
17
6
  const unmarshalEmailTry = data => {
18
7
  if (!isJSONObject(data)) {
19
8
  throw new TypeError(`Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`);
@@ -25,6 +14,39 @@ const unmarshalEmailTry = data => {
25
14
  triedAt: unmarshalDate(data.tried_at)
26
15
  };
27
16
  };
17
+ const unmarshalEmail = data => {
18
+ if (!isJSONObject(data)) {
19
+ throw new TypeError(`Unmarshalling the type 'Email' failed as data isn't a dictionary.`);
20
+ }
21
+ return {
22
+ createdAt: unmarshalDate(data.created_at),
23
+ flags: data.flags,
24
+ id: data.id,
25
+ lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),
26
+ mailFrom: data.mail_from,
27
+ mailRcpt: data.mail_rcpt,
28
+ messageId: data.message_id,
29
+ projectId: data.project_id,
30
+ rcptTo: data.rcpt_to ? data.rcpt_to : undefined,
31
+ rcptType: data.rcpt_type,
32
+ status: data.status,
33
+ statusDetails: data.status_details ? data.status_details : undefined,
34
+ subject: data.subject,
35
+ tryCount: data.try_count,
36
+ updatedAt: unmarshalDate(data.updated_at)
37
+ };
38
+ };
39
+ const unmarshalDomainStatistics = data => {
40
+ if (!isJSONObject(data)) {
41
+ throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`);
42
+ }
43
+ return {
44
+ canceledCount: data.canceled_count,
45
+ failedCount: data.failed_count,
46
+ sentCount: data.sent_count,
47
+ totalCount: data.total_count
48
+ };
49
+ };
28
50
  const unmarshalDomain = data => {
29
51
  if (!isJSONObject(data)) {
30
52
  throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
@@ -33,7 +55,7 @@ const unmarshalDomain = data => {
33
55
  createdAt: unmarshalDate(data.created_at),
34
56
  dkimConfig: data.dkim_config,
35
57
  id: data.id,
36
- lastError: data.last_error,
58
+ lastError: data.last_error ? data.last_error : undefined,
37
59
  lastValidAt: unmarshalDate(data.last_valid_at),
38
60
  name: data.name,
39
61
  nextCheckAt: unmarshalDate(data.next_check_at),
@@ -42,16 +64,24 @@ const unmarshalDomain = data => {
42
64
  region: data.region,
43
65
  revokedAt: unmarshalDate(data.revoked_at),
44
66
  spfConfig: data.spf_config,
45
- statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : undefined,
67
+ statistics: unmarshalDomainStatistics(data.statistics),
46
68
  status: data.status
47
69
  };
48
70
  };
71
+ const unmarshalCreateEmailResponse = data => {
72
+ if (!isJSONObject(data)) {
73
+ throw new TypeError(`Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`);
74
+ }
75
+ return {
76
+ emails: unmarshalArrayOfObject(data.emails, unmarshalEmail)
77
+ };
78
+ };
49
79
  const unmarshalDomainLastStatusDkimRecord = data => {
50
80
  if (!isJSONObject(data)) {
51
81
  throw new TypeError(`Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`);
52
82
  }
53
83
  return {
54
- error: data.error,
84
+ error: data.error ? data.error : undefined,
55
85
  lastValidAt: unmarshalDate(data.last_valid_at),
56
86
  status: data.status
57
87
  };
@@ -61,50 +91,20 @@ const unmarshalDomainLastStatusSpfRecord = data => {
61
91
  throw new TypeError(`Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`);
62
92
  }
63
93
  return {
64
- error: data.error,
94
+ error: data.error ? data.error : undefined,
65
95
  lastValidAt: unmarshalDate(data.last_valid_at),
66
96
  status: data.status
67
97
  };
68
98
  };
69
- const unmarshalEmail = data => {
70
- if (!isJSONObject(data)) {
71
- throw new TypeError(`Unmarshalling the type 'Email' failed as data isn't a dictionary.`);
72
- }
73
- return {
74
- createdAt: unmarshalDate(data.created_at),
75
- flags: data.flags,
76
- id: data.id,
77
- lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),
78
- mailFrom: data.mail_from,
79
- mailRcpt: data.mail_rcpt,
80
- messageId: data.message_id,
81
- projectId: data.project_id,
82
- rcptTo: data.rcpt_to,
83
- rcptType: data.rcpt_type,
84
- status: data.status,
85
- statusDetails: data.status_details,
86
- subject: data.subject,
87
- tryCount: data.try_count,
88
- updatedAt: unmarshalDate(data.updated_at)
89
- };
90
- };
91
- const unmarshalCreateEmailResponse = data => {
92
- if (!isJSONObject(data)) {
93
- throw new TypeError(`Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`);
94
- }
95
- return {
96
- emails: unmarshalArrayOfObject(data.emails, unmarshalEmail)
97
- };
98
- };
99
99
  const unmarshalDomainLastStatus = data => {
100
100
  if (!isJSONObject(data)) {
101
101
  throw new TypeError(`Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`);
102
102
  }
103
103
  return {
104
- dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : undefined,
104
+ dkimRecord: unmarshalDomainLastStatusDkimRecord(data.dkim_record),
105
105
  domainId: data.domain_id,
106
106
  domainName: data.domain_name,
107
- spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : undefined
107
+ spfRecord: unmarshalDomainLastStatusSpfRecord(data.spf_record)
108
108
  };
109
109
  };
110
110
  const unmarshalListDomainsResponse = data => {
@@ -138,31 +138,22 @@ const unmarshalStatistics = data => {
138
138
  totalCount: data.total_count
139
139
  };
140
140
  };
141
- const marshalCreateEmailRequestAddress = (request, defaults) => ({
142
- email: request.email,
143
- name: request.name
144
- });
145
- const marshalCreateEmailRequestAttachment = (request, defaults) => ({
146
- content: request.content,
147
- name: request.name,
148
- type: request.type
149
- });
150
141
  const marshalCreateDomainRequest = (request, defaults) => ({
151
142
  accept_tos: request.acceptTos,
152
143
  domain_name: request.domainName,
153
144
  project_id: request.projectId ?? defaults.defaultProjectId
154
145
  });
155
146
  const marshalCreateEmailRequest = (request, defaults) => ({
156
- attachments: request.attachments ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt)) : undefined,
157
- bcc: request.bcc ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
158
- cc: request.cc ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,
159
- from: request.from ? marshalCreateEmailRequestAddress(request.from) : undefined,
147
+ attachments: request.attachments,
148
+ bcc: request.bcc,
149
+ cc: request.cc,
150
+ from: request.from,
160
151
  html: request.html,
161
152
  project_id: request.projectId ?? defaults.defaultProjectId,
162
153
  send_before: request.sendBefore,
163
154
  subject: request.subject,
164
155
  text: request.text,
165
- to: request.to ? request.to.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined
156
+ to: request.to
166
157
  });
167
158
 
168
159
  export { marshalCreateDomainRequest, marshalCreateEmailRequest, unmarshalCreateEmailResponse, unmarshalDomain, unmarshalDomainLastStatus, unmarshalEmail, unmarshalListDomainsResponse, unmarshalListEmailsResponse, unmarshalStatistics };