@scaleway/sdk-container 2.5.0 → 2.7.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.
@@ -2,412 +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
- * @param request - The request {@link CreateContainerRequest}
119
- * @returns A Promise of Container
120
- */
121
- createContainer = (request) => this.client.fetch({
122
- body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),
123
- headers: jsonContentHeaders,
124
- method: "POST",
125
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`
126
- }, unmarshalContainer);
127
- /**
128
- * Update an existing container. Update the container associated with the specified ID.
129
-
130
- When updating a container, the container is automatically redeployed to apply the changes.
131
- This behavior can be changed by setting the `redeploy` field to `false` in the request.
132
- *
133
- * @param request - The request {@link UpdateContainerRequest}
134
- * @returns A Promise of Container
135
- */
136
- updateContainer = (request) => this.client.fetch({
137
- body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),
138
- headers: jsonContentHeaders,
139
- method: "PATCH",
140
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
141
- }, unmarshalContainer);
142
- /**
143
- * Delete a container. Delete the container associated with the specified ID.
144
- *
145
- * @param request - The request {@link DeleteContainerRequest}
146
- * @returns A Promise of Container
147
- */
148
- deleteContainer = (request) => this.client.fetch({
149
- method: "DELETE",
150
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
151
- }, unmarshalContainer);
152
- /**
153
- * Deploy a container. Deploy a container associated with the specified ID.
154
- *
155
- * @param request - The request {@link DeployContainerRequest}
156
- * @returns A Promise of Container
157
- */
158
- deployContainer = (request) => this.client.fetch({
159
- body: "{}",
160
- headers: jsonContentHeaders,
161
- method: "POST",
162
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}/deploy`
163
- }, unmarshalContainer);
164
- pageOfListCrons = (request) => this.client.fetch({
165
- method: "GET",
166
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`,
167
- urlParams: urlParams(["container_id", request.containerId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
168
- }, unmarshalListCronsResponse);
169
- /**
170
- * List all your crons.
171
- *
172
- * @param request - The request {@link ListCronsRequest}
173
- * @returns A Promise of ListCronsResponse
174
- */
175
- listCrons = (request) => enrichForPagination("crons", this.pageOfListCrons, request);
176
- /**
177
- * Get a cron. Get the cron associated with the specified ID.
178
- *
179
- * @param request - The request {@link GetCronRequest}
180
- * @returns A Promise of Cron
181
- */
182
- getCron = (request) => this.client.fetch({
183
- method: "GET",
184
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
185
- }, unmarshalCron);
186
- /**
187
- * Waits for {@link Cron} to be in a final state.
188
- *
189
- * @param request - The request {@link GetCronRequest}
190
- * @param options - The waiting options
191
- * @returns A Promise of Cron
192
- */
193
- waitForCron = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);
194
- /**
195
- * Create a new cron.
196
- *
197
- * @param request - The request {@link CreateCronRequest}
198
- * @returns A Promise of Cron
199
- */
200
- createCron = (request) => this.client.fetch({
201
- body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)),
202
- headers: jsonContentHeaders,
203
- method: "POST",
204
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`
205
- }, unmarshalCron);
206
- /**
207
- * Update an existing cron. Update the cron associated with the specified ID.
208
- *
209
- * @param request - The request {@link UpdateCronRequest}
210
- * @returns A Promise of Cron
211
- */
212
- updateCron = (request) => this.client.fetch({
213
- body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)),
214
- headers: jsonContentHeaders,
215
- method: "PATCH",
216
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
217
- }, unmarshalCron);
218
- /**
219
- * Delete an existing cron. Delete the cron associated with the specified ID.
220
- *
221
- * @param request - The request {@link DeleteCronRequest}
222
- * @returns A Promise of Cron
223
- */
224
- deleteCron = (request) => this.client.fetch({
225
- method: "DELETE",
226
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam("cronId", request.cronId)}`
227
- }, unmarshalCron);
228
- pageOfListDomains = (request) => this.client.fetch({
229
- method: "GET",
230
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
231
- urlParams: urlParams(["container_id", request.containerId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
232
- }, unmarshalListDomainsResponse);
233
- /**
234
- * List all custom domains. List all custom domains in a specified region.
235
- *
236
- * @param request - The request {@link ListDomainsRequest}
237
- * @returns A Promise of ListDomainsResponse
238
- */
239
- listDomains = (request) => enrichForPagination("domains", this.pageOfListDomains, request);
240
- /**
241
- * Get a custom domain. Get a custom domain for the container with the specified ID.
242
- *
243
- * @param request - The request {@link GetDomainRequest}
244
- * @returns A Promise of Domain
245
- */
246
- getDomain = (request) => this.client.fetch({
247
- method: "GET",
248
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
249
- }, unmarshalDomain);
250
- /**
251
- * Waits for {@link Domain} to be in a final state.
252
- *
253
- * @param request - The request {@link GetDomainRequest}
254
- * @param options - The waiting options
255
- * @returns A Promise of Domain
256
- */
257
- waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
258
- /**
259
- * Create a custom domain. Create a custom domain for the container with the specified ID.
260
- *
261
- * @param request - The request {@link CreateDomainRequest}
262
- * @returns A Promise of Domain
263
- */
264
- createDomain = (request) => this.client.fetch({
265
- body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
266
- headers: jsonContentHeaders,
267
- method: "POST",
268
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
269
- }, unmarshalDomain);
270
- /**
271
- * Delete a custom domain. Delete the custom domain with the specific ID.
272
- *
273
- * @param request - The request {@link DeleteDomainRequest}
274
- * @returns A Promise of Domain
275
- */
276
- deleteDomain = (request) => this.client.fetch({
277
- method: "DELETE",
278
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
279
- }, unmarshalDomain);
280
- /**
281
- * Create a new revocable token. Deprecated in favor of IAM authentication.
282
- *
283
- * @deprecated
284
- * @param request - The request {@link CreateTokenRequest}
285
- * @returns A Promise of Token
286
- */
287
- createToken = (request = {}) => this.client.fetch({
288
- body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)),
289
- headers: jsonContentHeaders,
290
- method: "POST",
291
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`
292
- }, unmarshalToken);
293
- /**
294
- * Get a token. Get a token with a specified ID.
295
- *
296
- * @param request - The request {@link GetTokenRequest}
297
- * @returns A Promise of Token
298
- */
299
- getToken = (request) => this.client.fetch({
300
- method: "GET",
301
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
302
- }, unmarshalToken);
303
- /**
304
- * Waits for {@link Token} to be in a final state.
305
- *
306
- * @param request - The request {@link GetTokenRequest}
307
- * @param options - The waiting options
308
- * @returns A Promise of Token
309
- */
310
- waitForToken = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);
311
- pageOfListTokens = (request = {}) => this.client.fetch({
312
- method: "GET",
313
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`,
314
- 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])
315
- }, unmarshalListTokensResponse);
316
- /**
317
- * List all tokens. List all tokens belonging to a specified Organization or Project.
318
- *
319
- * @param request - The request {@link ListTokensRequest}
320
- * @returns A Promise of ListTokensResponse
321
- */
322
- listTokens = (request = {}) => enrichForPagination("tokens", this.pageOfListTokens, request);
323
- /**
324
- * Delete a token. Delete a token with a specified ID.
325
- *
326
- * @param request - The request {@link DeleteTokenRequest}
327
- * @returns A Promise of Token
328
- */
329
- deleteToken = (request) => this.client.fetch({
330
- method: "DELETE",
331
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam("tokenId", request.tokenId)}`
332
- }, unmarshalToken);
333
- /**
334
- * Create a trigger. Create a new trigger for a specified container.
335
- *
336
- * @param request - The request {@link CreateTriggerRequest}
337
- * @returns A Promise of Trigger
338
- */
339
- createTrigger = (request) => this.client.fetch({
340
- body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
341
- headers: jsonContentHeaders,
342
- method: "POST",
343
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
344
- }, unmarshalTrigger);
345
- /**
346
- * Get a trigger. Get a trigger with a specified ID.
347
- *
348
- * @param request - The request {@link GetTriggerRequest}
349
- * @returns A Promise of Trigger
350
- */
351
- getTrigger = (request) => this.client.fetch({
352
- method: "GET",
353
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
354
- }, unmarshalTrigger);
355
- /**
356
- * Waits for {@link Trigger} to be in a final state.
357
- *
358
- * @param request - The request {@link GetTriggerRequest}
359
- * @param options - The waiting options
360
- * @returns A Promise of Trigger
361
- */
362
- waitForTrigger = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
363
- pageOfListTriggers = (request = {}) => this.client.fetch({
364
- method: "GET",
365
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
366
- urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([
367
- {
368
- param: "container_id",
369
- value: request.containerId
370
- },
371
- {
372
- param: "namespace_id",
373
- value: request.namespaceId
374
- },
375
- {
376
- default: this.client.settings.defaultProjectId,
377
- param: "project_id",
378
- value: request.projectId
379
- }
380
- ])))
381
- }, unmarshalListTriggersResponse);
382
- /**
383
- * List all triggers. List all triggers belonging to a specified Organization or Project.
384
- *
385
- * @param request - The request {@link ListTriggersRequest}
386
- * @returns A Promise of ListTriggersResponse
387
- */
388
- listTriggers = (request = {}) => enrichForPagination("triggers", this.pageOfListTriggers, request);
389
- /**
390
- * Update a trigger. Update a trigger with a specified ID.
391
- *
392
- * @param request - The request {@link UpdateTriggerRequest}
393
- * @returns A Promise of Trigger
394
- */
395
- updateTrigger = (request) => this.client.fetch({
396
- body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
397
- headers: jsonContentHeaders,
398
- method: "PATCH",
399
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
400
- }, unmarshalTrigger);
401
- /**
402
- * Delete a trigger. Delete a trigger with a specified ID.
403
- *
404
- * @param request - The request {@link DeleteTriggerRequest}
405
- * @returns A Promise of Trigger
406
- */
407
- deleteTrigger = (request) => this.client.fetch({
408
- method: "DELETE",
409
- path: `/containers/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
410
- }, 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
+ }
411
192
  };
412
193
  //#endregion
413
194
  export { API };