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