@scaleway/sdk-function 1.6.0 → 2.1.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,646 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const content_gen = require("./content.gen.cjs");
5
- const marshalling_gen = require("./marshalling.gen.cjs");
6
- const jsonContentHeaders = {
7
- "Content-Type": "application/json; charset=utf-8"
8
- };
9
- class API extends sdkClient.API {
10
- /**
11
- * Locality of this API.
12
- * type ∈ {'zone','region','global','unspecified'}
13
- */
14
- static LOCALITY = sdkClient.toApiLocality({
15
- regions: ["fr-par", "nl-ams", "pl-waw"]
16
- });
17
- pageOfListNamespaces = (request = {}) => this.client.fetch(
18
- {
19
- method: "GET",
20
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`,
21
- urlParams: sdkClient.urlParams(
22
- ["name", request.name],
23
- ["order_by", request.orderBy],
24
- ["organization_id", request.organizationId],
25
- ["page", request.page],
26
- [
27
- "page_size",
28
- request.pageSize ?? this.client.settings.defaultPageSize
29
- ],
30
- ["project_id", request.projectId]
31
- )
32
- },
33
- marshalling_gen.unmarshalListNamespacesResponse
34
- );
35
- /**
36
- * List all your namespaces. List all existing namespaces in the specified region.
37
- *
38
- * @param request - The request {@link ListNamespacesRequest}
39
- * @returns A Promise of ListNamespacesResponse
40
- */
41
- listNamespaces = (request = {}) => sdkClient.enrichForPagination("namespaces", this.pageOfListNamespaces, request);
42
- /**
43
- * Get a namespace. Get the namespace associated with the specified ID.
44
- *
45
- * @param request - The request {@link GetNamespaceRequest}
46
- * @returns A Promise of Namespace
47
- */
48
- getNamespace = (request) => this.client.fetch(
49
- {
50
- method: "GET",
51
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${sdkClient.validatePathParam("namespaceId", request.namespaceId)}`
52
- },
53
- marshalling_gen.unmarshalNamespace
54
- );
55
- /**
56
- * Waits for {@link Namespace} to be in a final state.
57
- *
58
- * @param request - The request {@link GetNamespaceRequest}
59
- * @param options - The waiting options
60
- * @returns A Promise of Namespace
61
- */
62
- waitForNamespace = (request, options) => sdkClient.waitForResource(
63
- options?.stop ?? ((res) => Promise.resolve(
64
- !content_gen.NAMESPACE_TRANSIENT_STATUSES.includes(res.status)
65
- )),
66
- this.getNamespace,
67
- request,
68
- options
69
- );
70
- /**
71
- * Create a new namespace. Create a new namespace in a specified Organization or Project.
72
- *
73
- * @param request - The request {@link CreateNamespaceRequest}
74
- * @returns A Promise of Namespace
75
- */
76
- createNamespace = (request = {}) => this.client.fetch(
77
- {
78
- body: JSON.stringify(
79
- marshalling_gen.marshalCreateNamespaceRequest(request, this.client.settings)
80
- ),
81
- headers: jsonContentHeaders,
82
- method: "POST",
83
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`
84
- },
85
- marshalling_gen.unmarshalNamespace
86
- );
87
- /**
88
- * Update an existing namespace. Update the namespace associated with the specified ID.
89
- *
90
- * @param request - The request {@link UpdateNamespaceRequest}
91
- * @returns A Promise of Namespace
92
- */
93
- updateNamespace = (request) => this.client.fetch(
94
- {
95
- body: JSON.stringify(
96
- marshalling_gen.marshalUpdateNamespaceRequest(request, this.client.settings)
97
- ),
98
- headers: jsonContentHeaders,
99
- method: "PATCH",
100
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${sdkClient.validatePathParam("namespaceId", request.namespaceId)}`
101
- },
102
- marshalling_gen.unmarshalNamespace
103
- );
104
- /**
105
- * Delete an existing namespace. Delete the namespace associated with the specified ID.
106
- *
107
- * @param request - The request {@link DeleteNamespaceRequest}
108
- * @returns A Promise of Namespace
109
- */
110
- deleteNamespace = (request) => this.client.fetch(
111
- {
112
- method: "DELETE",
113
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${sdkClient.validatePathParam("namespaceId", request.namespaceId)}`
114
- },
115
- marshalling_gen.unmarshalNamespace
116
- );
117
- pageOfListFunctions = (request) => this.client.fetch(
118
- {
119
- method: "GET",
120
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions`,
121
- urlParams: sdkClient.urlParams(
122
- ["name", request.name],
123
- ["namespace_id", request.namespaceId],
124
- ["order_by", request.orderBy],
125
- ["organization_id", request.organizationId],
126
- ["page", request.page],
127
- [
128
- "page_size",
129
- request.pageSize ?? this.client.settings.defaultPageSize
130
- ],
131
- ["project_id", request.projectId]
132
- )
133
- },
134
- marshalling_gen.unmarshalListFunctionsResponse
135
- );
136
- /**
137
- * List all your functions.
138
- *
139
- * @param request - The request {@link ListFunctionsRequest}
140
- * @returns A Promise of ListFunctionsResponse
141
- */
142
- listFunctions = (request) => sdkClient.enrichForPagination("functions", this.pageOfListFunctions, request);
143
- /**
144
- * Get a function. Get the function associated with the specified ID.
145
- *
146
- * @param request - The request {@link GetFunctionRequest}
147
- * @returns A Promise of Function
148
- */
149
- getFunction = (request) => this.client.fetch(
150
- {
151
- method: "GET",
152
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${sdkClient.validatePathParam("functionId", request.functionId)}`
153
- },
154
- marshalling_gen.unmarshalFunction
155
- );
156
- /**
157
- * Waits for {@link Function} to be in a final state.
158
- *
159
- * @param request - The request {@link GetFunctionRequest}
160
- * @param options - The waiting options
161
- * @returns A Promise of Function
162
- */
163
- waitForFunction = (request, options) => sdkClient.waitForResource(
164
- options?.stop ?? ((res) => Promise.resolve(
165
- !content_gen.FUNCTION_TRANSIENT_STATUSES.includes(res.status)
166
- )),
167
- this.getFunction,
168
- request,
169
- options
170
- );
171
- /**
172
- * Create a new function. Create a new function in the specified region for a specified Organization or Project.
173
- *
174
- * @param request - The request {@link CreateFunctionRequest}
175
- * @returns A Promise of Function
176
- */
177
- createFunction = (request) => this.client.fetch(
178
- {
179
- body: JSON.stringify(
180
- marshalling_gen.marshalCreateFunctionRequest(request, this.client.settings)
181
- ),
182
- headers: jsonContentHeaders,
183
- method: "POST",
184
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions`
185
- },
186
- marshalling_gen.unmarshalFunction
187
- );
188
- /**
189
- * Update an existing function. Update the function associated with the specified ID.
190
-
191
- When updating a function, the function is automatically redeployed to apply the changes.
192
- This behavior can be changed by setting the `redeploy` field to `false` in the request.
193
- *
194
- * @param request - The request {@link UpdateFunctionRequest}
195
- * @returns A Promise of Function
196
- */
197
- updateFunction = (request) => this.client.fetch(
198
- {
199
- body: JSON.stringify(
200
- marshalling_gen.marshalUpdateFunctionRequest(request, this.client.settings)
201
- ),
202
- headers: jsonContentHeaders,
203
- method: "PATCH",
204
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${sdkClient.validatePathParam("functionId", request.functionId)}`
205
- },
206
- marshalling_gen.unmarshalFunction
207
- );
208
- /**
209
- * Delete a function. Delete the function associated with the specified ID.
210
- *
211
- * @param request - The request {@link DeleteFunctionRequest}
212
- * @returns A Promise of Function
213
- */
214
- deleteFunction = (request) => this.client.fetch(
215
- {
216
- method: "DELETE",
217
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${sdkClient.validatePathParam("functionId", request.functionId)}`
218
- },
219
- marshalling_gen.unmarshalFunction
220
- );
221
- /**
222
- * Deploy a function. Deploy a function associated with the specified ID.
223
- *
224
- * @param request - The request {@link DeployFunctionRequest}
225
- * @returns A Promise of Function
226
- */
227
- deployFunction = (request) => this.client.fetch(
228
- {
229
- body: "{}",
230
- headers: jsonContentHeaders,
231
- method: "POST",
232
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${sdkClient.validatePathParam("functionId", request.functionId)}/deploy`
233
- },
234
- marshalling_gen.unmarshalFunction
235
- );
236
- /**
237
- * List function runtimes. List available function runtimes.
238
- *
239
- * @param request - The request {@link ListFunctionRuntimesRequest}
240
- * @returns A Promise of ListFunctionRuntimesResponse
241
- */
242
- listFunctionRuntimes = (request = {}) => this.client.fetch(
243
- {
244
- method: "GET",
245
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/runtimes`
246
- },
247
- marshalling_gen.unmarshalListFunctionRuntimesResponse
248
- );
249
- /**
250
- * Get an upload URL of a function. Get an upload URL of a function associated with the specified ID.
251
- *
252
- * @param request - The request {@link GetFunctionUploadURLRequest}
253
- * @returns A Promise of UploadURL
254
- */
255
- getFunctionUploadURL = (request) => this.client.fetch(
256
- {
257
- method: "GET",
258
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${sdkClient.validatePathParam("functionId", request.functionId)}/upload-url`,
259
- urlParams: sdkClient.urlParams(["content_length", request.contentLength])
260
- },
261
- marshalling_gen.unmarshalUploadURL
262
- );
263
- /**
264
- * Get a download URL of a function. Get a download URL for a function associated with the specified ID.
265
- *
266
- * @param request - The request {@link GetFunctionDownloadURLRequest}
267
- * @returns A Promise of DownloadURL
268
- */
269
- getFunctionDownloadURL = (request) => this.client.fetch(
270
- {
271
- method: "GET",
272
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${sdkClient.validatePathParam("functionId", request.functionId)}/download-url`
273
- },
274
- marshalling_gen.unmarshalDownloadURL
275
- );
276
- pageOfListCrons = (request) => this.client.fetch(
277
- {
278
- method: "GET",
279
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`,
280
- urlParams: sdkClient.urlParams(
281
- ["function_id", request.functionId],
282
- ["order_by", request.orderBy],
283
- ["page", request.page],
284
- [
285
- "page_size",
286
- request.pageSize ?? this.client.settings.defaultPageSize
287
- ]
288
- )
289
- },
290
- marshalling_gen.unmarshalListCronsResponse
291
- );
292
- /**
293
- * List all crons. List all the cronjobs in a specified region.
294
- *
295
- * @param request - The request {@link ListCronsRequest}
296
- * @returns A Promise of ListCronsResponse
297
- */
298
- listCrons = (request) => sdkClient.enrichForPagination("crons", this.pageOfListCrons, request);
299
- /**
300
- * Get a cron. Get the cron associated with the specified ID.
301
- *
302
- * @param request - The request {@link GetCronRequest}
303
- * @returns A Promise of Cron
304
- */
305
- getCron = (request) => this.client.fetch(
306
- {
307
- method: "GET",
308
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${sdkClient.validatePathParam("cronId", request.cronId)}`
309
- },
310
- marshalling_gen.unmarshalCron
311
- );
312
- /**
313
- * Waits for {@link Cron} to be in a final state.
314
- *
315
- * @param request - The request {@link GetCronRequest}
316
- * @param options - The waiting options
317
- * @returns A Promise of Cron
318
- */
319
- waitForCron = (request, options) => sdkClient.waitForResource(
320
- options?.stop ?? ((res) => Promise.resolve(
321
- !content_gen.CRON_TRANSIENT_STATUSES.includes(res.status)
322
- )),
323
- this.getCron,
324
- request,
325
- options
326
- );
327
- /**
328
- * Create a new cron. Create a new cronjob for a function with the specified ID.
329
- *
330
- * @param request - The request {@link CreateCronRequest}
331
- * @returns A Promise of Cron
332
- */
333
- createCron = (request) => this.client.fetch(
334
- {
335
- body: JSON.stringify(
336
- marshalling_gen.marshalCreateCronRequest(request, this.client.settings)
337
- ),
338
- headers: jsonContentHeaders,
339
- method: "POST",
340
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`
341
- },
342
- marshalling_gen.unmarshalCron
343
- );
344
- /**
345
- * Update an existing cron. Update the cron associated with the specified ID.
346
- *
347
- * @param request - The request {@link UpdateCronRequest}
348
- * @returns A Promise of Cron
349
- */
350
- updateCron = (request) => this.client.fetch(
351
- {
352
- body: JSON.stringify(
353
- marshalling_gen.marshalUpdateCronRequest(request, this.client.settings)
354
- ),
355
- headers: jsonContentHeaders,
356
- method: "PATCH",
357
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${sdkClient.validatePathParam("cronId", request.cronId)}`
358
- },
359
- marshalling_gen.unmarshalCron
360
- );
361
- /**
362
- * Delete an existing cron. Delete the cron associated with the specified ID.
363
- *
364
- * @param request - The request {@link DeleteCronRequest}
365
- * @returns A Promise of Cron
366
- */
367
- deleteCron = (request) => this.client.fetch(
368
- {
369
- method: "DELETE",
370
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${sdkClient.validatePathParam("cronId", request.cronId)}`
371
- },
372
- marshalling_gen.unmarshalCron
373
- );
374
- pageOfListDomains = (request) => this.client.fetch(
375
- {
376
- method: "GET",
377
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
378
- urlParams: sdkClient.urlParams(
379
- ["function_id", request.functionId],
380
- ["order_by", request.orderBy],
381
- ["page", request.page],
382
- [
383
- "page_size",
384
- request.pageSize ?? this.client.settings.defaultPageSize
385
- ]
386
- )
387
- },
388
- marshalling_gen.unmarshalListDomainsResponse
389
- );
390
- /**
391
- * List all domain name bindings. List all domain name bindings in a specified region.
392
- *
393
- * @param request - The request {@link ListDomainsRequest}
394
- * @returns A Promise of ListDomainsResponse
395
- */
396
- listDomains = (request) => sdkClient.enrichForPagination("domains", this.pageOfListDomains, request);
397
- /**
398
- * Get a domain name binding. Get a domain name binding for the function with the specified ID.
399
- *
400
- * @param request - The request {@link GetDomainRequest}
401
- * @returns A Promise of Domain
402
- */
403
- getDomain = (request) => this.client.fetch(
404
- {
405
- method: "GET",
406
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domainId", request.domainId)}`
407
- },
408
- marshalling_gen.unmarshalDomain
409
- );
410
- /**
411
- * Waits for {@link Domain} to be in a final state.
412
- *
413
- * @param request - The request {@link GetDomainRequest}
414
- * @param options - The waiting options
415
- * @returns A Promise of Domain
416
- */
417
- waitForDomain = (request, options) => sdkClient.waitForResource(
418
- options?.stop ?? ((res) => Promise.resolve(
419
- !content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status)
420
- )),
421
- this.getDomain,
422
- request,
423
- options
424
- );
425
- /**
426
- * Create a domain name binding. Create a domain name binding for the function with the specified ID.
427
- *
428
- * @param request - The request {@link CreateDomainRequest}
429
- * @returns A Promise of Domain
430
- */
431
- createDomain = (request) => this.client.fetch(
432
- {
433
- body: JSON.stringify(
434
- marshalling_gen.marshalCreateDomainRequest(request, this.client.settings)
435
- ),
436
- headers: jsonContentHeaders,
437
- method: "POST",
438
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
439
- },
440
- marshalling_gen.unmarshalDomain
441
- );
442
- /**
443
- * Delete a domain name binding. Delete a domain name binding for the function with the specified ID.
444
- *
445
- * @param request - The request {@link DeleteDomainRequest}
446
- * @returns A Promise of Domain
447
- */
448
- deleteDomain = (request) => this.client.fetch(
449
- {
450
- method: "DELETE",
451
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${sdkClient.validatePathParam("domainId", request.domainId)}`
452
- },
453
- marshalling_gen.unmarshalDomain
454
- );
455
- /**
456
- * Create a new revocable token.
457
- *
458
- * @param request - The request {@link CreateTokenRequest}
459
- * @returns A Promise of Token
460
- */
461
- createToken = (request = {}) => this.client.fetch(
462
- {
463
- body: JSON.stringify(
464
- marshalling_gen.marshalCreateTokenRequest(request, this.client.settings)
465
- ),
466
- headers: jsonContentHeaders,
467
- method: "POST",
468
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`
469
- },
470
- marshalling_gen.unmarshalToken
471
- );
472
- /**
473
- * Get a token.
474
- *
475
- * @param request - The request {@link GetTokenRequest}
476
- * @returns A Promise of Token
477
- */
478
- getToken = (request) => this.client.fetch(
479
- {
480
- method: "GET",
481
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${sdkClient.validatePathParam("tokenId", request.tokenId)}`
482
- },
483
- marshalling_gen.unmarshalToken
484
- );
485
- /**
486
- * Waits for {@link Token} to be in a final state.
487
- *
488
- * @param request - The request {@link GetTokenRequest}
489
- * @param options - The waiting options
490
- * @returns A Promise of Token
491
- */
492
- waitForToken = (request, options) => sdkClient.waitForResource(
493
- options?.stop ?? ((res) => Promise.resolve(
494
- !content_gen.TOKEN_TRANSIENT_STATUSES.includes(res.status)
495
- )),
496
- this.getToken,
497
- request,
498
- options
499
- );
500
- pageOfListTokens = (request = {}) => this.client.fetch(
501
- {
502
- method: "GET",
503
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`,
504
- urlParams: sdkClient.urlParams(
505
- ["function_id", request.functionId],
506
- ["namespace_id", request.namespaceId],
507
- ["order_by", request.orderBy],
508
- ["page", request.page],
509
- [
510
- "page_size",
511
- request.pageSize ?? this.client.settings.defaultPageSize
512
- ]
513
- )
514
- },
515
- marshalling_gen.unmarshalListTokensResponse
516
- );
517
- /**
518
- * List all tokens.
519
- *
520
- * @param request - The request {@link ListTokensRequest}
521
- * @returns A Promise of ListTokensResponse
522
- */
523
- listTokens = (request = {}) => sdkClient.enrichForPagination("tokens", this.pageOfListTokens, request);
524
- /**
525
- * Delete a token.
526
- *
527
- * @param request - The request {@link DeleteTokenRequest}
528
- * @returns A Promise of Token
529
- */
530
- deleteToken = (request) => this.client.fetch(
531
- {
532
- method: "DELETE",
533
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${sdkClient.validatePathParam("tokenId", request.tokenId)}`
534
- },
535
- marshalling_gen.unmarshalToken
536
- );
537
- /**
538
- * Create a trigger. Create a new trigger for a specified function.
539
- *
540
- * @param request - The request {@link CreateTriggerRequest}
541
- * @returns A Promise of Trigger
542
- */
543
- createTrigger = (request) => this.client.fetch(
544
- {
545
- body: JSON.stringify(
546
- marshalling_gen.marshalCreateTriggerRequest(request, this.client.settings)
547
- ),
548
- headers: jsonContentHeaders,
549
- method: "POST",
550
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
551
- },
552
- marshalling_gen.unmarshalTrigger
553
- );
554
- /**
555
- * Get a trigger. Get a trigger with a specified ID.
556
- *
557
- * @param request - The request {@link GetTriggerRequest}
558
- * @returns A Promise of Trigger
559
- */
560
- getTrigger = (request) => this.client.fetch(
561
- {
562
- method: "GET",
563
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${sdkClient.validatePathParam("triggerId", request.triggerId)}`
564
- },
565
- marshalling_gen.unmarshalTrigger
566
- );
567
- /**
568
- * Waits for {@link Trigger} to be in a final state.
569
- *
570
- * @param request - The request {@link GetTriggerRequest}
571
- * @param options - The waiting options
572
- * @returns A Promise of Trigger
573
- */
574
- waitForTrigger = (request, options) => sdkClient.waitForResource(
575
- options?.stop ?? ((res) => Promise.resolve(
576
- !content_gen.TRIGGER_TRANSIENT_STATUSES.includes(res.status)
577
- )),
578
- this.getTrigger,
579
- request,
580
- options
581
- );
582
- pageOfListTriggers = (request = {}) => this.client.fetch(
583
- {
584
- method: "GET",
585
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
586
- urlParams: sdkClient.urlParams(
587
- ["order_by", request.orderBy],
588
- ["page", request.page],
589
- [
590
- "page_size",
591
- request.pageSize ?? this.client.settings.defaultPageSize
592
- ],
593
- ...Object.entries(
594
- sdkClient.resolveOneOf([
595
- { param: "function_id", value: request.functionId },
596
- { param: "namespace_id", value: request.namespaceId },
597
- {
598
- default: this.client.settings.defaultProjectId,
599
- param: "project_id",
600
- value: request.projectId
601
- }
602
- ])
603
- )
604
- )
605
- },
606
- marshalling_gen.unmarshalListTriggersResponse
607
- );
608
- /**
609
- * List all triggers. List all triggers belonging to a specified Organization or Project.
610
- *
611
- * @param request - The request {@link ListTriggersRequest}
612
- * @returns A Promise of ListTriggersResponse
613
- */
614
- listTriggers = (request = {}) => sdkClient.enrichForPagination("triggers", this.pageOfListTriggers, request);
615
- /**
616
- * Update a trigger. Update a trigger with a specified ID.
617
- *
618
- * @param request - The request {@link UpdateTriggerRequest}
619
- * @returns A Promise of Trigger
620
- */
621
- updateTrigger = (request) => this.client.fetch(
622
- {
623
- body: JSON.stringify(
624
- marshalling_gen.marshalUpdateTriggerRequest(request, this.client.settings)
625
- ),
626
- headers: jsonContentHeaders,
627
- method: "PATCH",
628
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${sdkClient.validatePathParam("triggerId", request.triggerId)}`
629
- },
630
- marshalling_gen.unmarshalTrigger
631
- );
632
- /**
633
- * Delete a trigger. Delete a trigger with a specified ID.
634
- *
635
- * @param request - The request {@link DeleteTriggerRequest}
636
- * @returns A Promise of Trigger
637
- */
638
- deleteTrigger = (request) => this.client.fetch(
639
- {
640
- method: "DELETE",
641
- path: `/functions/v1beta1/regions/${sdkClient.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${sdkClient.validatePathParam("triggerId", request.triggerId)}`
642
- },
643
- marshalling_gen.unmarshalTrigger
644
- );
645
- }
646
- exports.API = API;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const CRON_TRANSIENT_STATUSES = [
4
- "deleting",
5
- "creating",
6
- "pending"
7
- ];
8
- const DOMAIN_TRANSIENT_STATUSES = [
9
- "deleting",
10
- "creating",
11
- "pending"
12
- ];
13
- const FUNCTION_TRANSIENT_STATUSES = [
14
- "deleting",
15
- "creating",
16
- "pending"
17
- ];
18
- const NAMESPACE_TRANSIENT_STATUSES = [
19
- "deleting",
20
- "creating",
21
- "pending"
22
- ];
23
- const TOKEN_TRANSIENT_STATUSES = ["deleting", "creating"];
24
- const TRIGGER_TRANSIENT_STATUSES = [
25
- "deleting",
26
- "creating",
27
- "pending"
28
- ];
29
- exports.CRON_TRANSIENT_STATUSES = CRON_TRANSIENT_STATUSES;
30
- exports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES;
31
- exports.FUNCTION_TRANSIENT_STATUSES = FUNCTION_TRANSIENT_STATUSES;
32
- exports.NAMESPACE_TRANSIENT_STATUSES = NAMESPACE_TRANSIENT_STATUSES;
33
- exports.TOKEN_TRANSIENT_STATUSES = TOKEN_TRANSIENT_STATUSES;
34
- exports.TRIGGER_TRANSIENT_STATUSES = TRIGGER_TRANSIENT_STATUSES;