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