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