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