@scaleway/sdk-container 2.3.2 → 2.4.1

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.
@@ -1,502 +1,385 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
- const unmarshalContainerHealthCheckSpecHTTPProbe = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- path: data.path
11
- };
3
+ var unmarshalContainerHealthCheckSpecHTTPProbe = (data) => {
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.`);
5
+ return { path: data.path };
12
6
  };
13
- const unmarshalContainerHealthCheckSpecTCPProbe = (data) => {
14
- if (!isJSONObject(data)) {
15
- throw new TypeError(
16
- `Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.`
17
- );
18
- }
19
- return {};
7
+ var unmarshalContainerHealthCheckSpecTCPProbe = (data) => {
8
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.`);
9
+ return {};
20
10
  };
21
- const unmarshalContainerHealthCheckSpec = (data) => {
22
- if (!isJSONObject(data)) {
23
- throw new TypeError(
24
- `Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.`
25
- );
26
- }
27
- return {
28
- failureThreshold: data.failure_threshold,
29
- http: data.http ? unmarshalContainerHealthCheckSpecHTTPProbe(data.http) : void 0,
30
- interval: data.interval,
31
- tcp: data.tcp ? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp) : void 0
32
- };
11
+ var unmarshalContainerHealthCheckSpec = (data) => {
12
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.`);
13
+ return {
14
+ failureThreshold: data.failure_threshold,
15
+ http: data.http ? unmarshalContainerHealthCheckSpecHTTPProbe(data.http) : void 0,
16
+ interval: data.interval,
17
+ tcp: data.tcp ? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp) : void 0
18
+ };
33
19
  };
34
- const unmarshalContainerScalingOption = (data) => {
35
- if (!isJSONObject(data)) {
36
- throw new TypeError(
37
- `Unmarshalling the type 'ContainerScalingOption' failed as data isn't a dictionary.`
38
- );
39
- }
40
- return {
41
- concurrentRequestsThreshold: data.concurrent_requests_threshold,
42
- cpuUsageThreshold: data.cpu_usage_threshold,
43
- memoryUsageThreshold: data.memory_usage_threshold
44
- };
20
+ var unmarshalContainerScalingOption = (data) => {
21
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ContainerScalingOption' failed as data isn't a dictionary.`);
22
+ return {
23
+ concurrentRequestsThreshold: data.concurrent_requests_threshold,
24
+ cpuUsageThreshold: data.cpu_usage_threshold,
25
+ memoryUsageThreshold: data.memory_usage_threshold
26
+ };
45
27
  };
46
- const unmarshalSecretHashedValue = (data) => {
47
- if (!isJSONObject(data)) {
48
- throw new TypeError(
49
- `Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`
50
- );
51
- }
52
- return {
53
- hashedValue: data.hashed_value,
54
- key: data.key
55
- };
28
+ var unmarshalSecretHashedValue = (data) => {
29
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);
30
+ return {
31
+ hashedValue: data.hashed_value,
32
+ key: data.key
33
+ };
56
34
  };
57
35
  const unmarshalContainer = (data) => {
58
- if (!isJSONObject(data)) {
59
- throw new TypeError(
60
- `Unmarshalling the type 'Container' failed as data isn't a dictionary.`
61
- );
62
- }
63
- return {
64
- args: data.args,
65
- command: data.command,
66
- cpuLimit: data.cpu_limit,
67
- createdAt: unmarshalDate(data.created_at),
68
- description: data.description,
69
- domainName: data.domain_name,
70
- environmentVariables: data.environment_variables,
71
- errorMessage: data.error_message,
72
- healthCheck: data.health_check ? unmarshalContainerHealthCheckSpec(data.health_check) : void 0,
73
- httpOption: data.http_option,
74
- id: data.id,
75
- localStorageLimit: data.local_storage_limit,
76
- maxConcurrency: data.max_concurrency,
77
- maxScale: data.max_scale,
78
- memoryLimit: data.memory_limit,
79
- minScale: data.min_scale,
80
- name: data.name,
81
- namespaceId: data.namespace_id,
82
- port: data.port,
83
- privacy: data.privacy,
84
- privateNetworkId: data.private_network_id,
85
- protocol: data.protocol,
86
- readyAt: unmarshalDate(data.ready_at),
87
- region: data.region,
88
- registryImage: data.registry_image,
89
- sandbox: data.sandbox,
90
- scalingOption: data.scaling_option ? unmarshalContainerScalingOption(data.scaling_option) : void 0,
91
- secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
92
- status: data.status,
93
- tags: data.tags,
94
- timeout: data.timeout,
95
- updatedAt: unmarshalDate(data.updated_at)
96
- };
36
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Container' failed as data isn't a dictionary.`);
37
+ return {
38
+ args: data.args,
39
+ command: data.command,
40
+ cpuLimit: data.cpu_limit,
41
+ createdAt: unmarshalDate(data.created_at),
42
+ description: data.description,
43
+ domainName: data.domain_name,
44
+ environmentVariables: data.environment_variables,
45
+ errorMessage: data.error_message,
46
+ healthCheck: data.health_check ? unmarshalContainerHealthCheckSpec(data.health_check) : void 0,
47
+ httpOption: data.http_option,
48
+ id: data.id,
49
+ localStorageLimit: data.local_storage_limit,
50
+ maxConcurrency: data.max_concurrency,
51
+ maxScale: data.max_scale,
52
+ memoryLimit: data.memory_limit,
53
+ minScale: data.min_scale,
54
+ name: data.name,
55
+ namespaceId: data.namespace_id,
56
+ port: data.port,
57
+ privacy: data.privacy,
58
+ privateNetworkId: data.private_network_id,
59
+ protocol: data.protocol,
60
+ readyAt: unmarshalDate(data.ready_at),
61
+ region: data.region,
62
+ registryImage: data.registry_image,
63
+ sandbox: data.sandbox,
64
+ scalingOption: data.scaling_option ? unmarshalContainerScalingOption(data.scaling_option) : void 0,
65
+ secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
66
+ status: data.status,
67
+ tags: data.tags,
68
+ timeout: data.timeout,
69
+ updatedAt: unmarshalDate(data.updated_at)
70
+ };
97
71
  };
98
72
  const unmarshalCron = (data) => {
99
- if (!isJSONObject(data)) {
100
- throw new TypeError(
101
- `Unmarshalling the type 'Cron' failed as data isn't a dictionary.`
102
- );
103
- }
104
- return {
105
- args: data.args,
106
- containerId: data.container_id,
107
- id: data.id,
108
- name: data.name,
109
- schedule: data.schedule,
110
- status: data.status
111
- };
73
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);
74
+ return {
75
+ args: data.args,
76
+ containerId: data.container_id,
77
+ id: data.id,
78
+ name: data.name,
79
+ schedule: data.schedule,
80
+ status: data.status
81
+ };
112
82
  };
113
83
  const unmarshalDomain = (data) => {
114
- if (!isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'Domain' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- containerId: data.container_id,
121
- errorMessage: data.error_message,
122
- hostname: data.hostname,
123
- id: data.id,
124
- status: data.status,
125
- url: data.url
126
- };
84
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);
85
+ return {
86
+ containerId: data.container_id,
87
+ errorMessage: data.error_message,
88
+ hostname: data.hostname,
89
+ id: data.id,
90
+ status: data.status,
91
+ url: data.url
92
+ };
127
93
  };
128
94
  const unmarshalNamespace = (data) => {
129
- if (!isJSONObject(data)) {
130
- throw new TypeError(
131
- `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`
132
- );
133
- }
134
- return {
135
- createdAt: unmarshalDate(data.created_at),
136
- description: data.description,
137
- environmentVariables: data.environment_variables,
138
- errorMessage: data.error_message,
139
- id: data.id,
140
- name: data.name,
141
- organizationId: data.organization_id,
142
- projectId: data.project_id,
143
- region: data.region,
144
- registryEndpoint: data.registry_endpoint,
145
- registryNamespaceId: data.registry_namespace_id,
146
- secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
147
- status: data.status,
148
- tags: data.tags,
149
- updatedAt: unmarshalDate(data.updated_at),
150
- vpcIntegrationActivated: data.vpc_integration_activated
151
- };
95
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);
96
+ return {
97
+ createdAt: unmarshalDate(data.created_at),
98
+ description: data.description,
99
+ environmentVariables: data.environment_variables,
100
+ errorMessage: data.error_message,
101
+ id: data.id,
102
+ name: data.name,
103
+ organizationId: data.organization_id,
104
+ projectId: data.project_id,
105
+ region: data.region,
106
+ registryEndpoint: data.registry_endpoint,
107
+ registryNamespaceId: data.registry_namespace_id,
108
+ secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),
109
+ status: data.status,
110
+ tags: data.tags,
111
+ updatedAt: unmarshalDate(data.updated_at),
112
+ vpcIntegrationActivated: data.vpc_integration_activated
113
+ };
152
114
  };
153
115
  const unmarshalToken = (data) => {
154
- if (!isJSONObject(data)) {
155
- throw new TypeError(
156
- `Unmarshalling the type 'Token' failed as data isn't a dictionary.`
157
- );
158
- }
159
- return {
160
- containerId: data.container_id,
161
- description: data.description,
162
- expiresAt: unmarshalDate(data.expires_at),
163
- id: data.id,
164
- namespaceId: data.namespace_id,
165
- publicKey: data.public_key,
166
- status: data.status,
167
- token: data.token
168
- };
116
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);
117
+ return {
118
+ containerId: data.container_id,
119
+ description: data.description,
120
+ expiresAt: unmarshalDate(data.expires_at),
121
+ id: data.id,
122
+ namespaceId: data.namespace_id,
123
+ publicKey: data.public_key,
124
+ status: data.status,
125
+ token: data.token
126
+ };
169
127
  };
170
- const unmarshalTriggerMnqNatsClientConfig = (data) => {
171
- if (!isJSONObject(data)) {
172
- throw new TypeError(
173
- `Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`
174
- );
175
- }
176
- return {
177
- mnqCredentialId: data.mnq_credential_id,
178
- mnqNatsAccountId: data.mnq_nats_account_id,
179
- mnqProjectId: data.mnq_project_id,
180
- mnqRegion: data.mnq_region,
181
- subject: data.subject
182
- };
128
+ var unmarshalTriggerMnqNatsClientConfig = (data) => {
129
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);
130
+ return {
131
+ mnqCredentialId: data.mnq_credential_id,
132
+ mnqNatsAccountId: data.mnq_nats_account_id,
133
+ mnqProjectId: data.mnq_project_id,
134
+ mnqRegion: data.mnq_region,
135
+ subject: data.subject
136
+ };
183
137
  };
184
- const unmarshalTriggerMnqSqsClientConfig = (data) => {
185
- if (!isJSONObject(data)) {
186
- throw new TypeError(
187
- `Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`
188
- );
189
- }
190
- return {
191
- mnqCredentialId: data.mnq_credential_id,
192
- mnqProjectId: data.mnq_project_id,
193
- mnqRegion: data.mnq_region,
194
- queue: data.queue
195
- };
138
+ var unmarshalTriggerMnqSqsClientConfig = (data) => {
139
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);
140
+ return {
141
+ mnqCredentialId: data.mnq_credential_id,
142
+ mnqProjectId: data.mnq_project_id,
143
+ mnqRegion: data.mnq_region,
144
+ queue: data.queue
145
+ };
196
146
  };
197
- const unmarshalTriggerSqsClientConfig = (data) => {
198
- if (!isJSONObject(data)) {
199
- throw new TypeError(
200
- `Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`
201
- );
202
- }
203
- return {
204
- accessKey: data.access_key,
205
- endpoint: data.endpoint,
206
- queueUrl: data.queue_url,
207
- secretKey: data.secret_key
208
- };
147
+ var unmarshalTriggerSqsClientConfig = (data) => {
148
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);
149
+ return {
150
+ accessKey: data.access_key,
151
+ endpoint: data.endpoint,
152
+ queueUrl: data.queue_url,
153
+ secretKey: data.secret_key
154
+ };
209
155
  };
210
156
  const unmarshalTrigger = (data) => {
211
- if (!isJSONObject(data)) {
212
- throw new TypeError(
213
- `Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`
214
- );
215
- }
216
- return {
217
- containerId: data.container_id,
218
- description: data.description,
219
- errorMessage: data.error_message,
220
- id: data.id,
221
- inputType: data.input_type,
222
- name: data.name,
223
- scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : void 0,
224
- scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : void 0,
225
- sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : void 0,
226
- status: data.status
227
- };
157
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);
158
+ return {
159
+ containerId: data.container_id,
160
+ description: data.description,
161
+ errorMessage: data.error_message,
162
+ id: data.id,
163
+ inputType: data.input_type,
164
+ name: data.name,
165
+ scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : void 0,
166
+ scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : void 0,
167
+ sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : void 0,
168
+ status: data.status
169
+ };
228
170
  };
229
171
  const unmarshalListContainersResponse = (data) => {
230
- if (!isJSONObject(data)) {
231
- throw new TypeError(
232
- `Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`
233
- );
234
- }
235
- return {
236
- containers: unmarshalArrayOfObject(data.containers, unmarshalContainer),
237
- totalCount: data.total_count
238
- };
172
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`);
173
+ return {
174
+ containers: unmarshalArrayOfObject(data.containers, unmarshalContainer),
175
+ totalCount: data.total_count
176
+ };
239
177
  };
240
178
  const unmarshalListCronsResponse = (data) => {
241
- if (!isJSONObject(data)) {
242
- throw new TypeError(
243
- `Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`
244
- );
245
- }
246
- return {
247
- crons: unmarshalArrayOfObject(data.crons, unmarshalCron),
248
- totalCount: data.total_count
249
- };
179
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`);
180
+ return {
181
+ crons: unmarshalArrayOfObject(data.crons, unmarshalCron),
182
+ totalCount: data.total_count
183
+ };
250
184
  };
251
185
  const unmarshalListDomainsResponse = (data) => {
252
- if (!isJSONObject(data)) {
253
- throw new TypeError(
254
- `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`
255
- );
256
- }
257
- return {
258
- domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
259
- totalCount: data.total_count
260
- };
186
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);
187
+ return {
188
+ domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),
189
+ totalCount: data.total_count
190
+ };
261
191
  };
262
192
  const unmarshalListNamespacesResponse = (data) => {
263
- if (!isJSONObject(data)) {
264
- throw new TypeError(
265
- `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`
266
- );
267
- }
268
- return {
269
- namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
270
- totalCount: data.total_count
271
- };
193
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);
194
+ return {
195
+ namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),
196
+ totalCount: data.total_count
197
+ };
272
198
  };
273
199
  const unmarshalListTokensResponse = (data) => {
274
- if (!isJSONObject(data)) {
275
- throw new TypeError(
276
- `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`
277
- );
278
- }
279
- return {
280
- tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
281
- totalCount: data.total_count
282
- };
200
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);
201
+ return {
202
+ tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),
203
+ totalCount: data.total_count
204
+ };
283
205
  };
284
206
  const unmarshalListTriggersResponse = (data) => {
285
- if (!isJSONObject(data)) {
286
- throw new TypeError(
287
- `Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`
288
- );
289
- }
290
- return {
291
- totalCount: data.total_count,
292
- triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
293
- };
207
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);
208
+ return {
209
+ totalCount: data.total_count,
210
+ triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)
211
+ };
294
212
  };
295
- const marshalContainerHealthCheckSpecHTTPProbe = (request, defaults) => ({
296
- path: request.path
213
+ var marshalContainerHealthCheckSpecHTTPProbe = (request, defaults) => ({ path: request.path });
214
+ var marshalContainerHealthCheckSpecTCPProbe = (request, defaults) => ({});
215
+ var marshalContainerHealthCheckSpec = (request, defaults) => ({
216
+ failure_threshold: request.failureThreshold,
217
+ interval: request.interval,
218
+ ...resolveOneOf([{
219
+ param: "http",
220
+ value: request.http !== void 0 ? marshalContainerHealthCheckSpecHTTPProbe(request.http, defaults) : void 0
221
+ }, {
222
+ param: "tcp",
223
+ value: request.tcp !== void 0 ? marshalContainerHealthCheckSpecTCPProbe(request.tcp, defaults) : void 0
224
+ }])
297
225
  });
298
- const marshalContainerHealthCheckSpecTCPProbe = (request, defaults) => ({});
299
- const marshalContainerHealthCheckSpec = (request, defaults) => ({
300
- failure_threshold: request.failureThreshold,
301
- interval: request.interval,
302
- ...resolveOneOf([
303
- {
304
- param: "http",
305
- value: request.http !== void 0 ? marshalContainerHealthCheckSpecHTTPProbe(request.http) : void 0
306
- },
307
- {
308
- param: "tcp",
309
- value: request.tcp !== void 0 ? marshalContainerHealthCheckSpecTCPProbe(request.tcp) : void 0
310
- }
311
- ])
312
- });
313
- const marshalContainerScalingOption = (request, defaults) => ({
314
- ...resolveOneOf([
315
- {
316
- param: "concurrent_requests_threshold",
317
- value: request.concurrentRequestsThreshold
318
- },
319
- {
320
- param: "cpu_usage_threshold",
321
- value: request.cpuUsageThreshold
322
- },
323
- {
324
- param: "memory_usage_threshold",
325
- value: request.memoryUsageThreshold
326
- }
327
- ])
328
- });
329
- const marshalSecret = (request, defaults) => ({
330
- key: request.key,
331
- value: request.value
226
+ var marshalContainerScalingOption = (request, defaults) => ({ ...resolveOneOf([
227
+ {
228
+ param: "concurrent_requests_threshold",
229
+ value: request.concurrentRequestsThreshold
230
+ },
231
+ {
232
+ param: "cpu_usage_threshold",
233
+ value: request.cpuUsageThreshold
234
+ },
235
+ {
236
+ param: "memory_usage_threshold",
237
+ value: request.memoryUsageThreshold
238
+ }
239
+ ]) });
240
+ var marshalSecret = (request, defaults) => ({
241
+ key: request.key,
242
+ value: request.value
332
243
  });
333
244
  const marshalCreateContainerRequest = (request, defaults) => ({
334
- args: request.args,
335
- command: request.command,
336
- cpu_limit: request.cpuLimit,
337
- description: request.description,
338
- environment_variables: request.environmentVariables,
339
- health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
340
- http_option: request.httpOption,
341
- local_storage_limit: request.localStorageLimit,
342
- max_concurrency: request.maxConcurrency,
343
- max_scale: request.maxScale,
344
- memory_limit: request.memoryLimit,
345
- min_scale: request.minScale,
346
- name: request.name,
347
- namespace_id: request.namespaceId,
348
- port: request.port,
349
- privacy: request.privacy,
350
- private_network_id: request.privateNetworkId,
351
- protocol: request.protocol,
352
- registry_image: request.registryImage,
353
- sandbox: request.sandbox,
354
- scaling_option: request.scalingOption !== void 0 ? marshalContainerScalingOption(request.scalingOption) : void 0,
355
- secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
356
- tags: request.tags,
357
- timeout: request.timeout
245
+ args: request.args,
246
+ command: request.command,
247
+ cpu_limit: request.cpuLimit,
248
+ description: request.description,
249
+ environment_variables: request.environmentVariables,
250
+ health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck, defaults) : void 0,
251
+ http_option: request.httpOption,
252
+ local_storage_limit: request.localStorageLimit,
253
+ max_concurrency: request.maxConcurrency,
254
+ max_scale: request.maxScale,
255
+ memory_limit: request.memoryLimit,
256
+ min_scale: request.minScale,
257
+ name: request.name,
258
+ namespace_id: request.namespaceId,
259
+ port: request.port,
260
+ privacy: request.privacy,
261
+ private_network_id: request.privateNetworkId,
262
+ protocol: request.protocol,
263
+ registry_image: request.registryImage,
264
+ sandbox: request.sandbox,
265
+ scaling_option: request.scalingOption !== void 0 ? marshalContainerScalingOption(request.scalingOption, defaults) : void 0,
266
+ secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt, defaults)) : void 0,
267
+ tags: request.tags,
268
+ timeout: request.timeout
358
269
  });
359
270
  const marshalCreateCronRequest = (request, defaults) => ({
360
- args: request.args,
361
- container_id: request.containerId,
362
- name: request.name,
363
- schedule: request.schedule
271
+ args: request.args,
272
+ container_id: request.containerId,
273
+ name: request.name,
274
+ schedule: request.schedule
364
275
  });
365
276
  const marshalCreateDomainRequest = (request, defaults) => ({
366
- container_id: request.containerId,
367
- hostname: request.hostname
277
+ container_id: request.containerId,
278
+ hostname: request.hostname
368
279
  });
369
280
  const marshalCreateNamespaceRequest = (request, defaults) => ({
370
- activate_vpc_integration: request.activateVpcIntegration,
371
- description: request.description,
372
- environment_variables: request.environmentVariables,
373
- name: request.name || randomName("cns"),
374
- project_id: request.projectId ?? defaults.defaultProjectId,
375
- secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
376
- tags: request.tags
281
+ activate_vpc_integration: request.activateVpcIntegration,
282
+ description: request.description,
283
+ environment_variables: request.environmentVariables,
284
+ name: request.name || randomName("cns"),
285
+ project_id: request.projectId ?? defaults.defaultProjectId,
286
+ secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt, defaults)) : void 0,
287
+ tags: request.tags
377
288
  });
378
289
  const marshalCreateTokenRequest = (request, defaults) => ({
379
- description: request.description,
380
- expires_at: request.expiresAt,
381
- ...resolveOneOf([
382
- {
383
- param: "container_id",
384
- value: request.containerId
385
- },
386
- {
387
- param: "namespace_id",
388
- value: request.namespaceId
389
- }
390
- ])
290
+ description: request.description,
291
+ expires_at: request.expiresAt,
292
+ ...resolveOneOf([{
293
+ param: "container_id",
294
+ value: request.containerId
295
+ }, {
296
+ param: "namespace_id",
297
+ value: request.namespaceId
298
+ }])
391
299
  });
392
- const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
393
- mnq_nats_account_id: request.mnqNatsAccountId,
394
- mnq_project_id: request.mnqProjectId,
395
- mnq_region: request.mnqRegion,
396
- subject: request.subject
300
+ var marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({
301
+ mnq_nats_account_id: request.mnqNatsAccountId,
302
+ mnq_project_id: request.mnqProjectId,
303
+ mnq_region: request.mnqRegion,
304
+ subject: request.subject
397
305
  });
398
- const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
399
- mnq_project_id: request.mnqProjectId,
400
- mnq_region: request.mnqRegion,
401
- queue: request.queue
306
+ var marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
307
+ mnq_project_id: request.mnqProjectId,
308
+ mnq_region: request.mnqRegion,
309
+ queue: request.queue
402
310
  });
403
- const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
404
- access_key: request.accessKey,
405
- endpoint: request.endpoint,
406
- queue_url: request.queueUrl,
407
- secret_key: request.secretKey
311
+ var marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({
312
+ access_key: request.accessKey,
313
+ endpoint: request.endpoint,
314
+ queue_url: request.queueUrl,
315
+ secret_key: request.secretKey
408
316
  });
409
317
  const marshalCreateTriggerRequest = (request, defaults) => ({
410
- container_id: request.containerId,
411
- description: request.description,
412
- name: request.name,
413
- ...resolveOneOf([
414
- {
415
- param: "scw_sqs_config",
416
- value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : void 0
417
- },
418
- {
419
- param: "scw_nats_config",
420
- value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : void 0
421
- },
422
- {
423
- param: "sqs_config",
424
- value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : void 0
425
- }
426
- ])
318
+ container_id: request.containerId,
319
+ description: request.description,
320
+ name: request.name,
321
+ ...resolveOneOf([
322
+ {
323
+ param: "scw_sqs_config",
324
+ value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig, defaults) : void 0
325
+ },
326
+ {
327
+ param: "scw_nats_config",
328
+ value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig, defaults) : void 0
329
+ },
330
+ {
331
+ param: "sqs_config",
332
+ value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig, defaults) : void 0
333
+ }
334
+ ])
427
335
  });
428
336
  const marshalUpdateContainerRequest = (request, defaults) => ({
429
- args: request.args,
430
- command: request.command,
431
- cpu_limit: request.cpuLimit,
432
- description: request.description,
433
- environment_variables: request.environmentVariables,
434
- health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck) : void 0,
435
- http_option: request.httpOption,
436
- local_storage_limit: request.localStorageLimit,
437
- max_concurrency: request.maxConcurrency,
438
- max_scale: request.maxScale,
439
- memory_limit: request.memoryLimit,
440
- min_scale: request.minScale,
441
- port: request.port,
442
- privacy: request.privacy,
443
- private_network_id: request.privateNetworkId,
444
- protocol: request.protocol,
445
- redeploy: request.redeploy,
446
- registry_image: request.registryImage,
447
- sandbox: request.sandbox,
448
- scaling_option: request.scalingOption !== void 0 ? marshalContainerScalingOption(request.scalingOption) : void 0,
449
- secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
450
- tags: request.tags,
451
- timeout: request.timeout
337
+ args: request.args,
338
+ command: request.command,
339
+ cpu_limit: request.cpuLimit,
340
+ description: request.description,
341
+ environment_variables: request.environmentVariables,
342
+ health_check: request.healthCheck !== void 0 ? marshalContainerHealthCheckSpec(request.healthCheck, defaults) : void 0,
343
+ http_option: request.httpOption,
344
+ local_storage_limit: request.localStorageLimit,
345
+ max_concurrency: request.maxConcurrency,
346
+ max_scale: request.maxScale,
347
+ memory_limit: request.memoryLimit,
348
+ min_scale: request.minScale,
349
+ port: request.port,
350
+ privacy: request.privacy,
351
+ private_network_id: request.privateNetworkId,
352
+ protocol: request.protocol,
353
+ redeploy: request.redeploy,
354
+ registry_image: request.registryImage,
355
+ sandbox: request.sandbox,
356
+ scaling_option: request.scalingOption !== void 0 ? marshalContainerScalingOption(request.scalingOption, defaults) : void 0,
357
+ secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt, defaults)) : void 0,
358
+ tags: request.tags,
359
+ timeout: request.timeout
452
360
  });
453
361
  const marshalUpdateCronRequest = (request, defaults) => ({
454
- args: request.args,
455
- container_id: request.containerId,
456
- name: request.name,
457
- schedule: request.schedule
362
+ args: request.args,
363
+ container_id: request.containerId,
364
+ name: request.name,
365
+ schedule: request.schedule
458
366
  });
459
367
  const marshalUpdateNamespaceRequest = (request, defaults) => ({
460
- description: request.description,
461
- environment_variables: request.environmentVariables,
462
- secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt)) : void 0,
463
- tags: request.tags
368
+ description: request.description,
369
+ environment_variables: request.environmentVariables,
370
+ secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map((elt) => marshalSecret(elt, defaults)) : void 0,
371
+ tags: request.tags
464
372
  });
465
- const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
466
- access_key: request.accessKey,
467
- secret_key: request.secretKey
373
+ var marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
374
+ access_key: request.accessKey,
375
+ secret_key: request.secretKey
468
376
  });
469
377
  const marshalUpdateTriggerRequest = (request, defaults) => ({
470
- description: request.description,
471
- name: request.name,
472
- ...resolveOneOf([
473
- {
474
- param: "sqs_config",
475
- value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : void 0
476
- }
477
- ])
378
+ description: request.description,
379
+ name: request.name,
380
+ ...resolveOneOf([{
381
+ param: "sqs_config",
382
+ value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig, defaults) : void 0
383
+ }])
478
384
  });
479
- export {
480
- marshalCreateContainerRequest,
481
- marshalCreateCronRequest,
482
- marshalCreateDomainRequest,
483
- marshalCreateNamespaceRequest,
484
- marshalCreateTokenRequest,
485
- marshalCreateTriggerRequest,
486
- marshalUpdateContainerRequest,
487
- marshalUpdateCronRequest,
488
- marshalUpdateNamespaceRequest,
489
- marshalUpdateTriggerRequest,
490
- unmarshalContainer,
491
- unmarshalCron,
492
- unmarshalDomain,
493
- unmarshalListContainersResponse,
494
- unmarshalListCronsResponse,
495
- unmarshalListDomainsResponse,
496
- unmarshalListNamespacesResponse,
497
- unmarshalListTokensResponse,
498
- unmarshalListTriggersResponse,
499
- unmarshalNamespace,
500
- unmarshalToken,
501
- unmarshalTrigger
502
- };
385
+ export { marshalCreateContainerRequest, marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateCronRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalCron, unmarshalDomain, unmarshalListContainersResponse, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalToken, unmarshalTrigger };