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