@scaleway/sdk-container 2.5.0 → 2.6.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,4 +2,5 @@
2
2
  * This file is automatically generated
3
3
  * PLEASE DO NOT EDIT HERE
4
4
  */
5
+ export * as Containerv1 from './v1/index.gen.js';
5
6
  export * as Containerv1beta1 from './v1beta1/index.gen.js';
package/dist/index.gen.js CHANGED
@@ -1,2 +1,3 @@
1
- import { index_gen_exports } from "./v1beta1/index.gen.js";
2
- export { index_gen_exports as Containerv1beta1 };
1
+ import { index_gen_exports } from "./v1/index.gen.js";
2
+ import { index_gen_exports as index_gen_exports$1 } from "./v1beta1/index.gen.js";
3
+ export { index_gen_exports as Containerv1, index_gen_exports$1 as Containerv1beta1 };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is automatically generated
3
+ * PLEASE DO NOT EDIT HERE
4
+ */
5
+ export type Metadata = {
6
+ name: string;
7
+ namespace: string;
8
+ displayName: string;
9
+ versions: string[];
10
+ };
11
+ export declare const pkgMetadata: Metadata;
12
+ export default pkgMetadata;
@@ -0,0 +1,9 @@
1
+ import metadata_gen_default from "./metadata2.gen.js";
2
+ //#region src/metadata.gen.ts
3
+ /**
4
+ * This file is automatically generated
5
+ * PLEASE DO NOT EDIT HERE
6
+ */
7
+ var pkgMetadata = metadata_gen_default;
8
+ //#endregion
9
+ export { pkgMetadata as default, pkgMetadata };
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@scaleway/sdk-container",
3
+ "namespace": "container",
4
+ "displayName": "Container",
5
+ "versions": ["v1", "v1beta1"]
6
+ }
@@ -0,0 +1,8 @@
1
+ var metadata_gen_default = {
2
+ name: "@scaleway/sdk-container",
3
+ namespace: "container",
4
+ displayName: "Container",
5
+ versions: ["v1", "v1beta1"]
6
+ };
7
+ //#endregion
8
+ export { metadata_gen_default as default };
@@ -0,0 +1,226 @@
1
+ import type { ApiLocality, ServiceInfo, WaitForOptions } from '@scaleway/sdk-client';
2
+ import { API as ParentAPI } from '@scaleway/sdk-client';
3
+ import type { Container, CreateContainerRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTriggerRequest, DeleteContainerRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTriggerRequest, Domain, GetContainerRequest, GetDomainRequest, GetNamespaceRequest, GetServiceInfoRequest, GetTriggerRequest, ListContainersRequest, ListContainersResponse, ListDomainsRequest, ListDomainsResponse, ListNamespacesRequest, ListNamespacesResponse, ListTriggersRequest, ListTriggersResponse, Namespace, RedeployContainerRequest, Trigger, UpdateContainerRequest, UpdateDomainRequest, UpdateNamespaceRequest, UpdateTriggerRequest } from './types.gen.js';
4
+ /**
5
+ * Serverless Containers API.
6
+
7
+ Easily run containers on the cloud with a single command.
8
+ */
9
+ export declare class API extends ParentAPI {
10
+ /**
11
+ * Locality of this API.
12
+ * type ∈ {'zone','region','global','unspecified'}
13
+ */
14
+ static readonly LOCALITY: ApiLocality;
15
+ getServiceInfo: (request?: Readonly<GetServiceInfoRequest>) => Promise<ServiceInfo>;
16
+ /**
17
+ * Create a new namespace.. Namespace name must be unique inside a project.
18
+ *
19
+ * @param request - The request {@link CreateNamespaceRequest}
20
+ * @returns A Promise of Namespace
21
+ */
22
+ createNamespace: (request: Readonly<CreateNamespaceRequest>) => Promise<Namespace>;
23
+ /**
24
+ * Get the namespace associated with the specified ID.. Get the namespace associated with the specified ID.
25
+ *
26
+ * @param request - The request {@link GetNamespaceRequest}
27
+ * @returns A Promise of Namespace
28
+ */
29
+ getNamespace: (request: Readonly<GetNamespaceRequest>) => Promise<Namespace>;
30
+ /**
31
+ * Waits for {@link Namespace} to be in a final state.
32
+ *
33
+ * @param request - The request {@link GetNamespaceRequest}
34
+ * @param options - The waiting options
35
+ * @returns A Promise of Namespace
36
+ */
37
+ waitForNamespace: (request: Readonly<GetNamespaceRequest>, options?: Readonly<WaitForOptions<Namespace>>) => Promise<Namespace>;
38
+ protected pageOfListNamespaces: (request?: Readonly<ListNamespacesRequest>) => Promise<ListNamespacesResponse>;
39
+ /**
40
+ * List all namespaces the caller can access (read permission).. By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
41
+
42
+ Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, and `name`.
43
+ *
44
+ * @param request - The request {@link ListNamespacesRequest}
45
+ * @returns A Promise of ListNamespacesResponse
46
+ */
47
+ listNamespaces: (request?: Readonly<ListNamespacesRequest>) => Promise<ListNamespacesResponse> & {
48
+ all: () => Promise<Namespace[]>;
49
+ [Symbol.asyncIterator]: () => AsyncGenerator<Namespace[], void, void>;
50
+ };
51
+ /**
52
+ * Update the namespace associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
53
+ *
54
+ * @param request - The request {@link UpdateNamespaceRequest}
55
+ * @returns A Promise of Namespace
56
+ */
57
+ updateNamespace: (request: Readonly<UpdateNamespaceRequest>) => Promise<Namespace>;
58
+ /**
59
+ * Delete the namespace associated with the specified ID.. It also deletes in cascade any resource inside the namespace.
60
+
61
+ This action **cannot** be undone.
62
+ *
63
+ * @param request - The request {@link DeleteNamespaceRequest}
64
+ * @returns A Promise of Namespace
65
+ */
66
+ deleteNamespace: (request: Readonly<DeleteNamespaceRequest>) => Promise<Namespace>;
67
+ /**
68
+ * Create a new container in a namespace.. Name must be unique inside the given namespace.
69
+ *
70
+ * @param request - The request {@link CreateContainerRequest}
71
+ * @returns A Promise of Container
72
+ */
73
+ createContainer: (request: Readonly<CreateContainerRequest>) => Promise<Container>;
74
+ /**
75
+ * Get the container associated with the specified ID.. Get the container associated with the specified ID.
76
+ *
77
+ * @param request - The request {@link GetContainerRequest}
78
+ * @returns A Promise of Container
79
+ */
80
+ getContainer: (request: Readonly<GetContainerRequest>) => Promise<Container>;
81
+ /**
82
+ * Waits for {@link Container} to be in a final state.
83
+ *
84
+ * @param request - The request {@link GetContainerRequest}
85
+ * @param options - The waiting options
86
+ * @returns A Promise of Container
87
+ */
88
+ waitForContainer: (request: Readonly<GetContainerRequest>, options?: Readonly<WaitForOptions<Container>>) => Promise<Container>;
89
+ protected pageOfListContainers: (request?: Readonly<ListContainersRequest>) => Promise<ListContainersResponse>;
90
+ /**
91
+ * List all containers the caller can access (read permission).. By default, the containers listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
92
+
93
+ Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, and `name`.
94
+ *
95
+ * @param request - The request {@link ListContainersRequest}
96
+ * @returns A Promise of ListContainersResponse
97
+ */
98
+ listContainers: (request?: Readonly<ListContainersRequest>) => Promise<ListContainersResponse> & {
99
+ all: () => Promise<Container[]>;
100
+ [Symbol.asyncIterator]: () => AsyncGenerator<Container[], void, void>;
101
+ };
102
+ /**
103
+ * Update the container associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
104
+ *
105
+ * @param request - The request {@link UpdateContainerRequest}
106
+ * @returns A Promise of Container
107
+ */
108
+ updateContainer: (request: Readonly<UpdateContainerRequest>) => Promise<Container>;
109
+ /**
110
+ * Delete the container associated with the specified ID.. It also deletes in cascade any resource linked to the container (crons, tokens, etc.).
111
+
112
+ This action **cannot** be undone.
113
+ *
114
+ * @param request - The request {@link DeleteContainerRequest}
115
+ * @returns A Promise of Container
116
+ */
117
+ deleteContainer: (request: Readonly<DeleteContainerRequest>) => Promise<Container>;
118
+ /**
119
+ * Create a new custom domain for the container with the specified ID.. Create a new custom domain for the container with the specified ID.
120
+ *
121
+ * @param request - The request {@link CreateDomainRequest}
122
+ * @returns A Promise of Domain
123
+ */
124
+ createDomain: (request: Readonly<CreateDomainRequest>) => Promise<Domain>;
125
+ /**
126
+ * Get the custom domain associated with the specified ID.. Get the custom domain associated with the specified ID.
127
+ *
128
+ * @param request - The request {@link GetDomainRequest}
129
+ * @returns A Promise of Domain
130
+ */
131
+ getDomain: (request: Readonly<GetDomainRequest>) => Promise<Domain>;
132
+ /**
133
+ * Waits for {@link Domain} to be in a final state.
134
+ *
135
+ * @param request - The request {@link GetDomainRequest}
136
+ * @param options - The waiting options
137
+ * @returns A Promise of Domain
138
+ */
139
+ waitForDomain: (request: Readonly<GetDomainRequest>, options?: Readonly<WaitForOptions<Domain>>) => Promise<Domain>;
140
+ protected pageOfListDomains: (request?: Readonly<ListDomainsRequest>) => Promise<ListDomainsResponse>;
141
+ /**
142
+ * List all custom domains the caller can access (read permission).. By default, the custom domains listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
143
+
144
+ Additional parameters can be set in the query to filter the output, such as `organization_id`, `project_id`, `namespace_id`, or `container_id`.
145
+ *
146
+ * @param request - The request {@link ListDomainsRequest}
147
+ * @returns A Promise of ListDomainsResponse
148
+ */
149
+ listDomains: (request?: Readonly<ListDomainsRequest>) => Promise<ListDomainsResponse> & {
150
+ all: () => Promise<Domain[]>;
151
+ [Symbol.asyncIterator]: () => AsyncGenerator<Domain[], void, void>;
152
+ };
153
+ /**
154
+ * Update the domain associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
155
+ *
156
+ * @param request - The request {@link UpdateDomainRequest}
157
+ * @returns A Promise of Domain
158
+ */
159
+ updateDomain: (request: Readonly<UpdateDomainRequest>) => Promise<Domain>;
160
+ /**
161
+ * Delete the custom domain associated with the specified ID.. Delete the custom domain associated with the specified ID.
162
+ *
163
+ * @param request - The request {@link DeleteDomainRequest}
164
+ * @returns A Promise of Domain
165
+ */
166
+ deleteDomain: (request: Readonly<DeleteDomainRequest>) => Promise<Domain>;
167
+ /**
168
+ * Redeploy a container. Performs a rollout of the container by creating new instances with the latest image version and terminating the old instances.
169
+ When using mutable registry image references (e.g. `my-registry-namespace/image:tag`), this endpoint can be used to force the container to use
170
+ the most recent image version available in the registry.
171
+ *
172
+ * @param request - The request {@link RedeployContainerRequest}
173
+ * @returns A Promise of Container
174
+ */
175
+ redeployContainer: (request: Readonly<RedeployContainerRequest>) => Promise<Container>;
176
+ /**
177
+ * Create a new trigger for the container with the specified ID.. Create a new trigger for the container with the specified ID.
178
+ *
179
+ * @param request - The request {@link CreateTriggerRequest}
180
+ * @returns A Promise of Trigger
181
+ */
182
+ createTrigger: (request: Readonly<CreateTriggerRequest>) => Promise<Trigger>;
183
+ /**
184
+ * Get the trigger associated with the specified ID.. Get the trigger associated with the specified ID.
185
+ *
186
+ * @param request - The request {@link GetTriggerRequest}
187
+ * @returns A Promise of Trigger
188
+ */
189
+ getTrigger: (request: Readonly<GetTriggerRequest>) => Promise<Trigger>;
190
+ /**
191
+ * Waits for {@link Trigger} to be in a final state.
192
+ *
193
+ * @param request - The request {@link GetTriggerRequest}
194
+ * @param options - The waiting options
195
+ * @returns A Promise of Trigger
196
+ */
197
+ waitForTrigger: (request: Readonly<GetTriggerRequest>, options?: Readonly<WaitForOptions<Trigger>>) => Promise<Trigger>;
198
+ protected pageOfListTriggers: (request?: Readonly<ListTriggersRequest>) => Promise<ListTriggersResponse>;
199
+ /**
200
+ * List all triggers the caller can access (read permission).. By default, the triggers listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
201
+
202
+ Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, `namespace_id`, or `container_id`.
203
+ *
204
+ * @param request - The request {@link ListTriggersRequest}
205
+ * @returns A Promise of ListTriggersResponse
206
+ */
207
+ listTriggers: (request?: Readonly<ListTriggersRequest>) => Promise<ListTriggersResponse> & {
208
+ all: () => Promise<Trigger[]>;
209
+ [Symbol.asyncIterator]: () => AsyncGenerator<Trigger[], void, void>;
210
+ };
211
+ /**
212
+ * Update the trigger associated with the specified ID.. When updating a trigger, you cannot specify a different source type than the one already set.
213
+ Only fields present in the request are updated; others are left untouched.
214
+ *
215
+ * @param request - The request {@link UpdateTriggerRequest}
216
+ * @returns A Promise of Trigger
217
+ */
218
+ updateTrigger: (request: Readonly<UpdateTriggerRequest>) => Promise<Trigger>;
219
+ /**
220
+ * Delete the trigger associated with the specified ID.. This action **cannot** be undone.
221
+ *
222
+ * @param request - The request {@link DeleteTriggerRequest}
223
+ * @returns A Promise of Trigger
224
+ */
225
+ deleteTrigger: (request: Readonly<DeleteTriggerRequest>) => Promise<Trigger>;
226
+ }
@@ -0,0 +1,310 @@
1
+ import { CONTAINER_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalCreateContainerRequest, marshalCreateDomainRequest, marshalCreateNamespaceRequest, marshalCreateTriggerRequest, marshalUpdateContainerRequest, marshalUpdateDomainRequest, marshalUpdateNamespaceRequest, marshalUpdateTriggerRequest, unmarshalContainer, unmarshalDomain, unmarshalListContainersResponse, unmarshalListDomainsResponse, unmarshalListNamespacesResponse, unmarshalListTriggersResponse, unmarshalNamespace, unmarshalTrigger } from "./marshalling.gen.js";
3
+ import { API as API$1, enrichForPagination, toApiLocality, unmarshalServiceInfo, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ //#region src/v1/api.gen.ts
5
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
6
+ /**
7
+ * Serverless Containers API.
8
+
9
+ Easily run containers on the cloud with a single command.
10
+ */
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
+ getServiceInfo = (request = {}) => this.client.fetch({
22
+ method: "GET",
23
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}`
24
+ }, unmarshalServiceInfo);
25
+ /**
26
+ * Create a new namespace.. Namespace name must be unique inside a project.
27
+ *
28
+ * @param request - The request {@link CreateNamespaceRequest}
29
+ * @returns A Promise of Namespace
30
+ */
31
+ createNamespace = (request) => this.client.fetch({
32
+ body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),
33
+ headers: jsonContentHeaders,
34
+ method: "POST",
35
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`
36
+ }, unmarshalNamespace);
37
+ /**
38
+ * Get the namespace associated with the specified ID.. Get the namespace associated with the specified ID.
39
+ *
40
+ * @param request - The request {@link GetNamespaceRequest}
41
+ * @returns A Promise of Namespace
42
+ */
43
+ getNamespace = (request) => this.client.fetch({
44
+ method: "GET",
45
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
46
+ }, unmarshalNamespace);
47
+ /**
48
+ * Waits for {@link Namespace} to be in a final state.
49
+ *
50
+ * @param request - The request {@link GetNamespaceRequest}
51
+ * @param options - The waiting options
52
+ * @returns A Promise of Namespace
53
+ */
54
+ waitForNamespace = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);
55
+ pageOfListNamespaces = (request = {}) => this.client.fetch({
56
+ method: "GET",
57
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`,
58
+ 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])
59
+ }, unmarshalListNamespacesResponse);
60
+ /**
61
+ * List all namespaces the caller can access (read permission).. By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
62
+
63
+ Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, and `name`.
64
+ *
65
+ * @param request - The request {@link ListNamespacesRequest}
66
+ * @returns A Promise of ListNamespacesResponse
67
+ */
68
+ listNamespaces = (request = {}) => enrichForPagination("namespaces", this.pageOfListNamespaces, request);
69
+ /**
70
+ * Update the namespace associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
71
+ *
72
+ * @param request - The request {@link UpdateNamespaceRequest}
73
+ * @returns A Promise of Namespace
74
+ */
75
+ updateNamespace = (request) => this.client.fetch({
76
+ body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),
77
+ headers: jsonContentHeaders,
78
+ method: "PATCH",
79
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
80
+ }, unmarshalNamespace);
81
+ /**
82
+ * Delete the namespace associated with the specified ID.. It also deletes in cascade any resource inside the namespace.
83
+
84
+ This action **cannot** be undone.
85
+ *
86
+ * @param request - The request {@link DeleteNamespaceRequest}
87
+ * @returns A Promise of Namespace
88
+ */
89
+ deleteNamespace = (request) => this.client.fetch({
90
+ method: "DELETE",
91
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam("namespaceId", request.namespaceId)}`
92
+ }, unmarshalNamespace);
93
+ /**
94
+ * Create a new container in a namespace.. Name must be unique inside the given namespace.
95
+ *
96
+ * @param request - The request {@link CreateContainerRequest}
97
+ * @returns A Promise of Container
98
+ */
99
+ createContainer = (request) => this.client.fetch({
100
+ body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),
101
+ headers: jsonContentHeaders,
102
+ method: "POST",
103
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`
104
+ }, unmarshalContainer);
105
+ /**
106
+ * Get the container associated with the specified ID.. Get the container associated with the specified ID.
107
+ *
108
+ * @param request - The request {@link GetContainerRequest}
109
+ * @returns A Promise of Container
110
+ */
111
+ getContainer = (request) => this.client.fetch({
112
+ method: "GET",
113
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
114
+ }, unmarshalContainer);
115
+ /**
116
+ * Waits for {@link Container} to be in a final state.
117
+ *
118
+ * @param request - The request {@link GetContainerRequest}
119
+ * @param options - The waiting options
120
+ * @returns A Promise of Container
121
+ */
122
+ waitForContainer = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);
123
+ pageOfListContainers = (request = {}) => this.client.fetch({
124
+ method: "GET",
125
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`,
126
+ 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])
127
+ }, unmarshalListContainersResponse);
128
+ /**
129
+ * List all containers the caller can access (read permission).. By default, the containers listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
130
+
131
+ Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, and `name`.
132
+ *
133
+ * @param request - The request {@link ListContainersRequest}
134
+ * @returns A Promise of ListContainersResponse
135
+ */
136
+ listContainers = (request = {}) => enrichForPagination("containers", this.pageOfListContainers, request);
137
+ /**
138
+ * Update the container associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
139
+ *
140
+ * @param request - The request {@link UpdateContainerRequest}
141
+ * @returns A Promise of Container
142
+ */
143
+ updateContainer = (request) => this.client.fetch({
144
+ body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),
145
+ headers: jsonContentHeaders,
146
+ method: "PATCH",
147
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
148
+ }, unmarshalContainer);
149
+ /**
150
+ * Delete the container associated with the specified ID.. It also deletes in cascade any resource linked to the container (crons, tokens, etc.).
151
+
152
+ This action **cannot** be undone.
153
+ *
154
+ * @param request - The request {@link DeleteContainerRequest}
155
+ * @returns A Promise of Container
156
+ */
157
+ deleteContainer = (request) => this.client.fetch({
158
+ method: "DELETE",
159
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}`
160
+ }, unmarshalContainer);
161
+ /**
162
+ * Create a new custom domain for the container with the specified ID.. Create a new custom domain for the container with the specified ID.
163
+ *
164
+ * @param request - The request {@link CreateDomainRequest}
165
+ * @returns A Promise of Domain
166
+ */
167
+ createDomain = (request) => this.client.fetch({
168
+ body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),
169
+ headers: jsonContentHeaders,
170
+ method: "POST",
171
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`
172
+ }, unmarshalDomain);
173
+ /**
174
+ * Get the custom domain associated with the specified ID.. Get the custom domain associated with the specified ID.
175
+ *
176
+ * @param request - The request {@link GetDomainRequest}
177
+ * @returns A Promise of Domain
178
+ */
179
+ getDomain = (request) => this.client.fetch({
180
+ method: "GET",
181
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
182
+ }, unmarshalDomain);
183
+ /**
184
+ * Waits for {@link Domain} to be in a final state.
185
+ *
186
+ * @param request - The request {@link GetDomainRequest}
187
+ * @param options - The waiting options
188
+ * @returns A Promise of Domain
189
+ */
190
+ waitForDomain = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);
191
+ pageOfListDomains = (request = {}) => this.client.fetch({
192
+ method: "GET",
193
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`,
194
+ urlParams: urlParams(["container_id", request.containerId], ["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])
195
+ }, unmarshalListDomainsResponse);
196
+ /**
197
+ * List all custom domains the caller can access (read permission).. By default, the custom domains listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
198
+
199
+ Additional parameters can be set in the query to filter the output, such as `organization_id`, `project_id`, `namespace_id`, or `container_id`.
200
+ *
201
+ * @param request - The request {@link ListDomainsRequest}
202
+ * @returns A Promise of ListDomainsResponse
203
+ */
204
+ listDomains = (request = {}) => enrichForPagination("domains", this.pageOfListDomains, request);
205
+ /**
206
+ * Update the domain associated with the specified ID.. Only fields present in the request are updated; others are left untouched.
207
+ *
208
+ * @param request - The request {@link UpdateDomainRequest}
209
+ * @returns A Promise of Domain
210
+ */
211
+ updateDomain = (request) => this.client.fetch({
212
+ body: JSON.stringify(marshalUpdateDomainRequest(request, this.client.settings)),
213
+ headers: jsonContentHeaders,
214
+ method: "PATCH",
215
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
216
+ }, unmarshalDomain);
217
+ /**
218
+ * Delete the custom domain associated with the specified ID.. Delete the custom domain associated with the specified ID.
219
+ *
220
+ * @param request - The request {@link DeleteDomainRequest}
221
+ * @returns A Promise of Domain
222
+ */
223
+ deleteDomain = (request) => this.client.fetch({
224
+ method: "DELETE",
225
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam("domainId", request.domainId)}`
226
+ }, unmarshalDomain);
227
+ /**
228
+ * Redeploy a container. Performs a rollout of the container by creating new instances with the latest image version and terminating the old instances.
229
+ When using mutable registry image references (e.g. `my-registry-namespace/image:tag`), this endpoint can be used to force the container to use
230
+ the most recent image version available in the registry.
231
+ *
232
+ * @param request - The request {@link RedeployContainerRequest}
233
+ * @returns A Promise of Container
234
+ */
235
+ redeployContainer = (request) => this.client.fetch({
236
+ body: "{}",
237
+ headers: jsonContentHeaders,
238
+ method: "POST",
239
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam("containerId", request.containerId)}/redeploy`
240
+ }, unmarshalContainer);
241
+ /**
242
+ * Create a new trigger for the container with the specified ID.. Create a new trigger for the container with the specified ID.
243
+ *
244
+ * @param request - The request {@link CreateTriggerRequest}
245
+ * @returns A Promise of Trigger
246
+ */
247
+ createTrigger = (request) => this.client.fetch({
248
+ body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),
249
+ headers: jsonContentHeaders,
250
+ method: "POST",
251
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`
252
+ }, unmarshalTrigger);
253
+ /**
254
+ * Get the trigger associated with the specified ID.. Get the trigger associated with the specified ID.
255
+ *
256
+ * @param request - The request {@link GetTriggerRequest}
257
+ * @returns A Promise of Trigger
258
+ */
259
+ getTrigger = (request) => this.client.fetch({
260
+ method: "GET",
261
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
262
+ }, unmarshalTrigger);
263
+ /**
264
+ * Waits for {@link Trigger} to be in a final state.
265
+ *
266
+ * @param request - The request {@link GetTriggerRequest}
267
+ * @param options - The waiting options
268
+ * @returns A Promise of Trigger
269
+ */
270
+ waitForTrigger = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);
271
+ pageOfListTriggers = (request = {}) => this.client.fetch({
272
+ method: "GET",
273
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`,
274
+ urlParams: urlParams(["container_id", request.containerId], ["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])
275
+ }, unmarshalListTriggersResponse);
276
+ /**
277
+ * List all triggers the caller can access (read permission).. By default, the triggers listed are ordered by creation date in ascending order. This can be modified via the `order_by` field.
278
+
279
+ Additional parameters can be set in the query to filter, such as `organization_id`, `project_id`, `namespace_id`, or `container_id`.
280
+ *
281
+ * @param request - The request {@link ListTriggersRequest}
282
+ * @returns A Promise of ListTriggersResponse
283
+ */
284
+ listTriggers = (request = {}) => enrichForPagination("triggers", this.pageOfListTriggers, request);
285
+ /**
286
+ * Update the trigger associated with the specified ID.. When updating a trigger, you cannot specify a different source type than the one already set.
287
+ Only fields present in the request are updated; others are left untouched.
288
+ *
289
+ * @param request - The request {@link UpdateTriggerRequest}
290
+ * @returns A Promise of Trigger
291
+ */
292
+ updateTrigger = (request) => this.client.fetch({
293
+ body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),
294
+ headers: jsonContentHeaders,
295
+ method: "PATCH",
296
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
297
+ }, unmarshalTrigger);
298
+ /**
299
+ * Delete the trigger associated with the specified ID.. This action **cannot** be undone.
300
+ *
301
+ * @param request - The request {@link DeleteTriggerRequest}
302
+ * @returns A Promise of Trigger
303
+ */
304
+ deleteTrigger = (request) => this.client.fetch({
305
+ method: "DELETE",
306
+ path: `/containers/v1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam("triggerId", request.triggerId)}`
307
+ }, unmarshalTrigger);
308
+ };
309
+ //#endregion
310
+ export { API };
@@ -0,0 +1,9 @@
1
+ import type { ContainerStatus, DomainStatus, NamespaceStatus, TriggerStatus } from './types.gen.js';
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 DomainStatus}. */
5
+ export declare const DOMAIN_TRANSIENT_STATUSES: DomainStatus[];
6
+ /** Lists transient statutes of the enum {@link NamespaceStatus}. */
7
+ export declare const NAMESPACE_TRANSIENT_STATUSES: NamespaceStatus[];
8
+ /** Lists transient statutes of the enum {@link TriggerStatus}. */
9
+ export declare const TRIGGER_TRANSIENT_STATUSES: TriggerStatus[];
@@ -0,0 +1,35 @@
1
+ //#region src/v1/content.gen.ts
2
+ /** Lists transient statutes of the enum {@link ContainerStatus}. */
3
+ var CONTAINER_TRANSIENT_STATUSES = [
4
+ "updating",
5
+ "deleting",
6
+ "locking",
7
+ "creating",
8
+ "upgrading"
9
+ ];
10
+ /** Lists transient statutes of the enum {@link DomainStatus}. */
11
+ var DOMAIN_TRANSIENT_STATUSES = [
12
+ "creating",
13
+ "updating",
14
+ "deleting",
15
+ "locking",
16
+ "upgrading"
17
+ ];
18
+ /** Lists transient statutes of the enum {@link NamespaceStatus}. */
19
+ var NAMESPACE_TRANSIENT_STATUSES = [
20
+ "updating",
21
+ "deleting",
22
+ "locking",
23
+ "creating",
24
+ "upgrading"
25
+ ];
26
+ /** Lists transient statutes of the enum {@link TriggerStatus}. */
27
+ var TRIGGER_TRANSIENT_STATUSES = [
28
+ "deleting",
29
+ "updating",
30
+ "creating",
31
+ "locking",
32
+ "upgrading"
33
+ ];
34
+ //#endregion
35
+ export { CONTAINER_TRANSIENT_STATUSES, DOMAIN_TRANSIENT_STATUSES, NAMESPACE_TRANSIENT_STATUSES, TRIGGER_TRANSIENT_STATUSES };
@@ -0,0 +1,5 @@
1
+ export { API, } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { Container, ContainerPrivacy, ContainerProbe, ContainerProbeHTTPProbe, ContainerProbeTCPProbe, ContainerProtocol, ContainerSandbox, ContainerScalingOption, ContainerStatus, CreateContainerRequest, CreateDomainRequest, CreateNamespaceRequest, CreateTriggerRequest, CreateTriggerRequestCronConfig, CreateTriggerRequestDestinationConfig, CreateTriggerRequestDestinationConfigHttpMethod, CreateTriggerRequestNATSConfig, CreateTriggerRequestSQSConfig, DeleteContainerRequest, DeleteDomainRequest, DeleteNamespaceRequest, DeleteTriggerRequest, Domain, DomainStatus, GetContainerRequest, GetDomainRequest, GetNamespaceRequest, GetServiceInfoRequest, GetTriggerRequest, ListContainersRequest, ListContainersRequestOrderBy, ListContainersResponse, ListDomainsRequest, ListDomainsRequestOrderBy, ListDomainsResponse, ListNamespacesRequest, ListNamespacesRequestOrderBy, ListNamespacesResponse, ListTriggersRequest, ListTriggersRequestOrderBy, ListTriggersResponse, Namespace, NamespaceStatus, RedeployContainerRequest, Trigger, TriggerCronConfig, TriggerDestinationConfig, TriggerDestinationConfigHttpMethod, TriggerNATSConfig, TriggerSourceType, TriggerSQSConfig, TriggerStatus, UpdateContainerRequest, UpdateContainerRequestProbe, UpdateContainerRequestProbeHTTPProbe, UpdateContainerRequestProbeTCPProbe, UpdateDomainRequest, UpdateNamespaceRequest, UpdateTriggerRequest, UpdateTriggerRequestCronConfig, UpdateTriggerRequestDestinationConfig, UpdateTriggerRequestDestinationConfigHttpMethod, UpdateTriggerRequestNATSConfig, UpdateTriggerRequestSQSConfig, } from './types.gen.js';
5
+ export * as ValidationRules from './validation-rules.gen.js';