@scaleway/sdk-container 2.6.0 → 2.7.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.
@@ -2,420 +2,193 @@ import { CONTAINER_TRANSIENT_STATUSES, CRON_TRANSIENT_STATUSES, DOMAIN_TRANSIENT
2
2
  import { marshalCreateContainerRequest, marshalCreateCronRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTokenRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateCronRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalCron, unmarshalDomain, unmarshalListContainersResponse, unmarshalListCronsResponse, unmarshalListDomainsResponse, unmarshalListNamespacesResponse, unmarshalListTokensResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalToken, unmarshalTrigger } from "./marshalling.gen.js";
3
3
  import { API as API$1, enrichForPagination, resolveOneOf, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
4
  //#region src/v1beta1/api.gen.ts
5
- var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ const jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
6
  /**
7
7
  * Serverless Containers API.
8
8
 
9
9
  This API allows you to manage your Serverless Containers.
10
10
  */
11
11
  var API = class extends API$1 {
12
- /**
13
- * Locality of this API.
14
- * type {'zone','region','global','unspecified'}
15
- */
16
- static LOCALITY = toApiLocality({ regions: [
17
- "fr-par",
18
- "nl-ams",
19
- "pl-waw"
20
- ] });
21
- pageOfListNamespaces = (request = {}) => this.client.fetch({
22
- method: "GET",
23
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`,
24
- urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
25
- }, unmarshalListNamespacesResponse);
26
- /**
27
- * List all your namespaces. List all namespaces in a specified region.
28
- *
29
- * @param request - The request {@link ListNamespacesRequest}
30
- * @returns A Promise of ListNamespacesResponse
31
- */
32
- listNamespaces = (request = {}) => enrichForPagination("namespaces", this.pageOfListNamespaces, request);
33
- /**
34
- * Get a namespace. Get the namespace associated with the specified ID.
35
- *
36
- * @param request - The request {@link GetNamespaceRequest}
37
- * @returns A Promise of Namespace
38
- */
39
- getNamespace = (request) => this.client.fetch({
40
- method: "GET",
41
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
42
- }, unmarshalNamespace);
43
- /**
44
- * Waits for {@link Namespace} to be in a final state.
45
- *
46
- * @param request - The request {@link GetNamespaceRequest}
47
- * @param options - The waiting options
48
- * @returns A Promise of Namespace
49
- */
50
- waitForNamespace = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
51
- /**
52
- * Create a new namespace. Create a new namespace in a specified region.
53
- *
54
- * @param request - The request {@link CreateNamespaceRequest}
55
- * @returns A Promise of Namespace
56
- */
57
- createNamespace = (request = {}) => this.client.fetch({
58
- body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),
59
- headers: jsonContentHeaders,
60
- method: "POST",
61
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`
62
- }, unmarshalNamespace);
63
- /**
64
- * Update an existing namespace. Update the space associated with the specified ID.
65
- *
66
- * @param request - The request {@link UpdateNamespaceRequest}
67
- * @returns A Promise of Namespace
68
- */
69
- updateNamespace = (request) => this.client.fetch({
70
- body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
71
- headers: jsonContentHeaders,
72
- method: "PATCH",
73
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
74
- }, unmarshalNamespace);
75
- /**
76
- * Delete an existing namespace. Delete the namespace associated with the specified ID.
77
- *
78
- * @param request - The request {@link DeleteNamespaceRequest}
79
- * @returns A Promise of Namespace
80
- */
81
- deleteNamespace = (request) => this.client.fetch({
82
- method: "DELETE",
83
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
84
- }, unmarshalNamespace);
85
- pageOfListContainers = (request) => this.client.fetch({
86
- method: "GET",
87
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`,
88
- urlParams: urlParams(["name", request.name], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
89
- }, unmarshalListContainersResponse);
90
- /**
91
- * List all your containers. List all containers for a specified region.
92
- *
93
- * @param request - The request {@link ListContainersRequest}
94
- * @returns A Promise of ListContainersResponse
95
- */
96
- listContainers = (request) => enrichForPagination("containers", this.pageOfListContainers, request);
97
- /**
98
- * Get a container. Get the container associated with the specified ID.
99
- *
100
- * @param request - The request {@link GetContainerRequest}
101
- * @returns A Promise of Container
102
- */
103
- getContainer = (request) => this.client.fetch({
104
- method: "GET",
105
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
106
- }, unmarshalContainer);
107
- /**
108
- * Waits for {@link Container} to be in a final state.
109
- *
110
- * @param request - The request {@link GetContainerRequest}
111
- * @param options - The waiting options
112
- * @returns A Promise of Container
113
- */
114
- waitForContainer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
115
- /**
116
- * Create a new container. Create a new container in the specified region.
117
-
118
- When creating a container, the `created` status is no longer used. The deployment process is started
119
- and the status is set to `pending` accordingly.
120
- *
121
- * @param request - The request {@link CreateContainerRequest}
122
- * @returns A Promise of Container
123
- */
124
- createContainer = (request) => this.client.fetch({
125
- body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),
126
- headers: jsonContentHeaders,
127
- method: "POST",
128
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`
129
- }, unmarshalContainer);
130
- /**
131
- * Update an existing container. Update the container associated with the specified ID.
132
-
133
- When updating a container, the container is automatically redeployed to apply the changes.
134
-
135
- Warning: The `redeploy` field has been deprecated. An update now always redeploys the container.
136
- *
137
- * @param request - The request {@link UpdateContainerRequest}
138
- * @returns A Promise of Container
139
- */
140
- updateContainer = (request) => this.client.fetch({
141
- body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),
142
- headers: jsonContentHeaders,
143
- method: "PATCH",
144
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
145
- }, unmarshalContainer);
146
- /**
147
- * Delete a container. Delete the container associated with the specified ID.
148
- *
149
- * @param request - The request {@link DeleteContainerRequest}
150
- * @returns A Promise of Container
151
- */
152
- deleteContainer = (request) => this.client.fetch({
153
- method: "DELETE",
154
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
155
- }, unmarshalContainer);
156
- /**
157
- * Deploy a container. Deploy a container associated with the specified ID.
158
-
159
- Since updating a container now always deploys it (and passes its status to `pending`), this call becomes superfluous.
160
-
161
- Moreover, calling `DeployContainer` immediately after `UpdateContainer` can cause `409 - resource is in a transient state` errors, so it is better to not use it when updating a container.
162
- *
163
- * @param request - The request {@link DeployContainerRequest}
164
- * @returns A Promise of Container
165
- */
166
- deployContainer = (request) => this.client.fetch({
167
- body: "{}",
168
- headers: jsonContentHeaders,
169
- method: "POST",
170
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}/deploy`
171
- }, unmarshalContainer);
172
- pageOfListCrons = (request) => this.client.fetch({
173
- method: "GET",
174
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`,
175
- urlParams: urlParams(["container_id", request.containerId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
176
- }, unmarshalListCronsResponse);
177
- /**
178
- * List all your crons.
179
- *
180
- * @param request - The request {@link ListCronsRequest}
181
- * @returns A Promise of ListCronsResponse
182
- */
183
- listCrons = (request) => enrichForPagination("crons", this.pageOfListCrons, request);
184
- /**
185
- * Get a cron. Get the cron associated with the specified ID.
186
- *
187
- * @param request - The request {@link GetCronRequest}
188
- * @returns A Promise of Cron
189
- */
190
- getCron = (request) => this.client.fetch({
191
- method: "GET",
192
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
193
- }, unmarshalCron);
194
- /**
195
- * Waits for {@link Cron} to be in a final state.
196
- *
197
- * @param request - The request {@link GetCronRequest}
198
- * @param options - The waiting options
199
- * @returns A Promise of Cron
200
- */
201
- waitForCron = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
202
- /**
203
- * Create a new cron.
204
- *
205
- * @param request - The request {@link CreateCronRequest}
206
- * @returns A Promise of Cron
207
- */
208
- createCron = (request) => this.client.fetch({
209
- body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)),
210
- headers: jsonContentHeaders,
211
- method: "POST",
212
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`
213
- }, unmarshalCron);
214
- /**
215
- * Update an existing cron. Update the cron associated with the specified ID.
216
- *
217
- * @param request - The request {@link UpdateCronRequest}
218
- * @returns A Promise of Cron
219
- */
220
- updateCron = (request) => this.client.fetch({
221
- body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)),
222
- headers: jsonContentHeaders,
223
- method: "PATCH",
224
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
225
- }, unmarshalCron);
226
- /**
227
- * Delete an existing cron. Delete the cron associated with the specified ID.
228
- *
229
- * @param request - The request {@link DeleteCronRequest}
230
- * @returns A Promise of Cron
231
- */
232
- deleteCron = (request) => this.client.fetch({
233
- method: "DELETE",
234
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
235
- }, unmarshalCron);
236
- pageOfListDomains = (request) => this.client.fetch({
237
- method: "GET",
238
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
239
- urlParams: urlParams(["container_id", request.containerId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
240
- }, unmarshalListDomainsResponse);
241
- /**
242
- * List all custom domains. List all custom domains in a specified region.
243
- *
244
- * @param request - The request {@link ListDomainsRequest}
245
- * @returns A Promise of ListDomainsResponse
246
- */
247
- listDomains = (request) => enrichForPagination("domains", this.pageOfListDomains, request);
248
- /**
249
- * Get a custom domain. Get a custom domain for the container with the specified ID.
250
- *
251
- * @param request - The request {@link GetDomainRequest}
252
- * @returns A Promise of Domain
253
- */
254
- getDomain = (request) => this.client.fetch({
255
- method: "GET",
256
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
257
- }, unmarshalDomain);
258
- /**
259
- * Waits for {@link Domain} to be in a final state.
260
- *
261
- * @param request - The request {@link GetDomainRequest}
262
- * @param options - The waiting options
263
- * @returns A Promise of Domain
264
- */
265
- waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
266
- /**
267
- * Create a custom domain. Create a custom domain for the container with the specified ID.
268
- *
269
- * @param request - The request {@link CreateDomainRequest}
270
- * @returns A Promise of Domain
271
- */
272
- createDomain = (request) => this.client.fetch({
273
- body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
274
- headers: jsonContentHeaders,
275
- method: "POST",
276
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
277
- }, unmarshalDomain);
278
- /**
279
- * Delete a custom domain. Delete the custom domain with the specific ID.
280
- *
281
- * @param request - The request {@link DeleteDomainRequest}
282
- * @returns A Promise of Domain
283
- */
284
- deleteDomain = (request) => this.client.fetch({
285
- method: "DELETE",
286
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
287
- }, unmarshalDomain);
288
- /**
289
- * Create a new revocable token. Deprecated in favor of IAM authentication.
290
- *
291
- * @deprecated
292
- * @param request - The request {@link CreateTokenRequest}
293
- * @returns A Promise of Token
294
- */
295
- createToken = (request = {}) => this.client.fetch({
296
- body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)),
297
- headers: jsonContentHeaders,
298
- method: "POST",
299
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`
300
- }, unmarshalToken);
301
- /**
302
- * Get a token. Get a token with a specified ID.
303
- *
304
- * @param request - The request {@link GetTokenRequest}
305
- * @returns A Promise of Token
306
- */
307
- getToken = (request) => this.client.fetch({
308
- method: "GET",
309
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
310
- }, unmarshalToken);
311
- /**
312
- * Waits for {@link Token} to be in a final state.
313
- *
314
- * @param request - The request {@link GetTokenRequest}
315
- * @param options - The waiting options
316
- * @returns A Promise of Token
317
- */
318
- waitForToken = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
319
- pageOfListTokens = (request = {}) => this.client.fetch({
320
- method: "GET",
321
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`,
322
- urlParams: urlParams(["container_id", request.containerId], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
323
- }, unmarshalListTokensResponse);
324
- /**
325
- * List all tokens. List all tokens belonging to a specified Organization or Project.
326
- *
327
- * @param request - The request {@link ListTokensRequest}
328
- * @returns A Promise of ListTokensResponse
329
- */
330
- listTokens = (request = {}) => enrichForPagination("tokens", this.pageOfListTokens, request);
331
- /**
332
- * Delete a token. Delete a token with a specified ID.
333
- *
334
- * @param request - The request {@link DeleteTokenRequest}
335
- * @returns A Promise of Token
336
- */
337
- deleteToken = (request) => this.client.fetch({
338
- method: "DELETE",
339
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
340
- }, unmarshalToken);
341
- /**
342
- * Create a trigger. Create a new trigger for a specified container.
343
- *
344
- * @param request - The request {@link CreateTriggerRequest}
345
- * @returns A Promise of Trigger
346
- */
347
- createTrigger = (request) => this.client.fetch({
348
- body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
349
- headers: jsonContentHeaders,
350
- method: "POST",
351
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
352
- }, unmarshalTrigger);
353
- /**
354
- * Get a trigger. Get a trigger with a specified ID.
355
- *
356
- * @param request - The request {@link GetTriggerRequest}
357
- * @returns A Promise of Trigger
358
- */
359
- getTrigger = (request) => this.client.fetch({
360
- method: "GET",
361
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
362
- }, unmarshalTrigger);
363
- /**
364
- * Waits for {@link Trigger} to be in a final state.
365
- *
366
- * @param request - The request {@link GetTriggerRequest}
367
- * @param options - The waiting options
368
- * @returns A Promise of Trigger
369
- */
370
- waitForTrigger = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
371
- pageOfListTriggers = (request = {}) => this.client.fetch({
372
- method: "GET",
373
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
374
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([
375
- {
376
- param: "container_id",
377
- value: request.containerId
378
- },
379
- {
380
- param: "namespace_id",
381
- value: request.namespaceId
382
- },
383
- {
384
- default: this.client.settings.defaultProjectId,
385
- param: "project_id",
386
- value: request.projectId
387
- }
388
- ])))
389
- }, unmarshalListTriggersResponse);
390
- /**
391
- * List all triggers. List all triggers belonging to a specified Organization or Project.
392
- *
393
- * @param request - The request {@link ListTriggersRequest}
394
- * @returns A Promise of ListTriggersResponse
395
- */
396
- listTriggers = (request = {}) => enrichForPagination("triggers", this.pageOfListTriggers, request);
397
- /**
398
- * Update a trigger. Update a trigger with a specified ID.
399
- *
400
- * @param request - The request {@link UpdateTriggerRequest}
401
- * @returns A Promise of Trigger
402
- */
403
- updateTrigger = (request) => this.client.fetch({
404
- body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
405
- headers: jsonContentHeaders,
406
- method: "PATCH",
407
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
408
- }, unmarshalTrigger);
409
- /**
410
- * Delete a trigger. Delete a trigger with a specified ID.
411
- *
412
- * @param request - The request {@link DeleteTriggerRequest}
413
- * @returns A Promise of Trigger
414
- */
415
- deleteTrigger = (request) => this.client.fetch({
416
- method: "DELETE",
417
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
418
- }, unmarshalTrigger);
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.pageOfListNamespaces = (request = {}) => this.client.fetch({
15
+ method: "GET",
16
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`,
17
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
18
+ }, unmarshalListNamespacesResponse);
19
+ this.listNamespaces = (request = {}) => enrichForPagination("namespaces", this.pageOfListNamespaces, request);
20
+ this.getNamespace = (request) => this.client.fetch({
21
+ method: "GET",
22
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
23
+ }, unmarshalNamespace);
24
+ this.waitForNamespace = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
25
+ this.createNamespace = (request = {}) => this.client.fetch({
26
+ body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),
27
+ headers: jsonContentHeaders,
28
+ method: "POST",
29
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`
30
+ }, unmarshalNamespace);
31
+ this.updateNamespace = (request) => this.client.fetch({
32
+ body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
33
+ headers: jsonContentHeaders,
34
+ method: "PATCH",
35
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
36
+ }, unmarshalNamespace);
37
+ this.deleteNamespace = (request) => this.client.fetch({
38
+ method: "DELETE",
39
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
40
+ }, unmarshalNamespace);
41
+ this.pageOfListContainers = (request) => this.client.fetch({
42
+ method: "GET",
43
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`,
44
+ urlParams: urlParams(["name", request.name], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId])
45
+ }, unmarshalListContainersResponse);
46
+ this.listContainers = (request) => enrichForPagination("containers", this.pageOfListContainers, request);
47
+ this.getContainer = (request) => this.client.fetch({
48
+ method: "GET",
49
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
50
+ }, unmarshalContainer);
51
+ this.waitForContainer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
52
+ this.createContainer = (request) => this.client.fetch({
53
+ body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),
54
+ headers: jsonContentHeaders,
55
+ method: "POST",
56
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`
57
+ }, unmarshalContainer);
58
+ this.updateContainer = (request) => this.client.fetch({
59
+ body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),
60
+ headers: jsonContentHeaders,
61
+ method: "PATCH",
62
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
63
+ }, unmarshalContainer);
64
+ this.deleteContainer = (request) => this.client.fetch({
65
+ method: "DELETE",
66
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
67
+ }, unmarshalContainer);
68
+ this.deployContainer = (request) => this.client.fetch({
69
+ body: "{}",
70
+ headers: jsonContentHeaders,
71
+ method: "POST",
72
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}/deploy`
73
+ }, unmarshalContainer);
74
+ this.pageOfListCrons = (request) => this.client.fetch({
75
+ method: "GET",
76
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`,
77
+ urlParams: urlParams(["container_id", request.containerId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
78
+ }, unmarshalListCronsResponse);
79
+ this.listCrons = (request) => enrichForPagination("crons", this.pageOfListCrons, request);
80
+ this.getCron = (request) => this.client.fetch({
81
+ method: "GET",
82
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
83
+ }, unmarshalCron);
84
+ this.waitForCron = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
85
+ this.createCron = (request) => this.client.fetch({
86
+ body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)),
87
+ headers: jsonContentHeaders,
88
+ method: "POST",
89
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`
90
+ }, unmarshalCron);
91
+ this.updateCron = (request) => this.client.fetch({
92
+ body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)),
93
+ headers: jsonContentHeaders,
94
+ method: "PATCH",
95
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
96
+ }, unmarshalCron);
97
+ this.deleteCron = (request) => this.client.fetch({
98
+ method: "DELETE",
99
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
100
+ }, unmarshalCron);
101
+ this.pageOfListDomains = (request) => this.client.fetch({
102
+ method: "GET",
103
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
104
+ urlParams: urlParams(["container_id", request.containerId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
105
+ }, unmarshalListDomainsResponse);
106
+ this.listDomains = (request) => enrichForPagination("domains", this.pageOfListDomains, request);
107
+ this.getDomain = (request) => this.client.fetch({
108
+ method: "GET",
109
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
110
+ }, unmarshalDomain);
111
+ this.waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
112
+ this.createDomain = (request) => this.client.fetch({
113
+ body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
114
+ headers: jsonContentHeaders,
115
+ method: "POST",
116
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
117
+ }, unmarshalDomain);
118
+ this.deleteDomain = (request) => this.client.fetch({
119
+ method: "DELETE",
120
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
121
+ }, unmarshalDomain);
122
+ this.createToken = (request = {}) => this.client.fetch({
123
+ body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)),
124
+ headers: jsonContentHeaders,
125
+ method: "POST",
126
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`
127
+ }, unmarshalToken);
128
+ this.getToken = (request) => this.client.fetch({
129
+ method: "GET",
130
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
131
+ }, unmarshalToken);
132
+ this.waitForToken = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
133
+ this.pageOfListTokens = (request = {}) => this.client.fetch({
134
+ method: "GET",
135
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`,
136
+ urlParams: urlParams(["container_id", request.containerId], ["namespace_id", request.namespaceId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
137
+ }, unmarshalListTokensResponse);
138
+ this.listTokens = (request = {}) => enrichForPagination("tokens", this.pageOfListTokens, request);
139
+ this.deleteToken = (request) => this.client.fetch({
140
+ method: "DELETE",
141
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
142
+ }, unmarshalToken);
143
+ this.createTrigger = (request) => this.client.fetch({
144
+ body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
145
+ headers: jsonContentHeaders,
146
+ method: "POST",
147
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
148
+ }, unmarshalTrigger);
149
+ this.getTrigger = (request) => this.client.fetch({
150
+ method: "GET",
151
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
152
+ }, unmarshalTrigger);
153
+ this.waitForTrigger = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
154
+ this.pageOfListTriggers = (request = {}) => this.client.fetch({
155
+ method: "GET",
156
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
157
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([
158
+ {
159
+ param: "container_id",
160
+ value: request.containerId
161
+ },
162
+ {
163
+ param: "namespace_id",
164
+ value: request.namespaceId
165
+ },
166
+ {
167
+ default: this.client.settings.defaultProjectId,
168
+ param: "project_id",
169
+ value: request.projectId
170
+ }
171
+ ])))
172
+ }, unmarshalListTriggersResponse);
173
+ this.listTriggers = (request = {}) => enrichForPagination("triggers", this.pageOfListTriggers, request);
174
+ this.updateTrigger = (request) => this.client.fetch({
175
+ body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
176
+ headers: jsonContentHeaders,
177
+ method: "PATCH",
178
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
179
+ }, unmarshalTrigger);
180
+ this.deleteTrigger = (request) => this.client.fetch({
181
+ method: "DELETE",
182
+ path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
183
+ }, unmarshalTrigger);
184
+ }
185
+ static {
186
+ this.LOCALITY = toApiLocality({ regions: [
187
+ "fr-par",
188
+ "nl-ams",
189
+ "pl-waw"
190
+ ] });
191
+ }
419
192
  };
420
193
  //#endregion
421
194
  export { API };