@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.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1beta1/api.gen.js +441 -626
- package/dist/v1beta1/content.gen.js +23 -27
- package/dist/v1beta1/index.gen.js +39 -37
- package/dist/v1beta1/marshalling.gen.js +287 -398
- package/dist/v1beta1/validation-rules.gen.js +39 -49
- package/package.json +4 -4
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
307
|
-
|
|
226
|
+
function_id: request.functionId,
|
|
227
|
+
hostname: request.hostname
|
|
308
228
|
});
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
229
|
+
var marshalSecret = (request, defaults) => ({
|
|
230
|
+
key: request.key,
|
|
231
|
+
value: request.value
|
|
312
232
|
});
|
|
313
233
|
const marshalCreateFunctionRequest = (request, defaults) => ({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
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
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
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
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
277
|
+
var marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({
|
|
278
|
+
mnq_project_id: request.mnqProjectId,
|
|
279
|
+
mnq_region: request.mnqRegion,
|
|
280
|
+
queue: request.queue
|
|
364
281
|
});
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
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
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
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
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
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
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
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
|
-
|
|
420
|
-
|
|
421
|
-
|
|
336
|
+
var marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({
|
|
337
|
+
access_key: request.accessKey,
|
|
338
|
+
secret_key: request.secretKey
|
|
422
339
|
});
|
|
423
340
|
const marshalUpdateTriggerRequest = (request, defaults) => ({
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
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 };
|