@scaleway/sdk-kafka 2.2.0 → 2.3.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.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Kafka.v1.API(client)
83
83
  ## Support
84
84
 
85
85
  We love feedback! Feel free to reach us on:
86
+
86
87
  - [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
87
88
  - [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
88
89
 
@@ -0,0 +1,11 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __exportAll = (all, no_symbols) => {
3
+ let target = {};
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
9
+ return target;
10
+ };
11
+ export { __exportAll };
package/dist/index.gen.js CHANGED
@@ -1,4 +1,2 @@
1
- import * as index_gen from "./v1alpha1/index.gen.js";
2
- export {
3
- index_gen as Kafkav1alpha1
4
- };
1
+ import { index_gen_exports } from "./v1alpha1/index.gen.js";
2
+ export { index_gen_exports as Kafkav1alpha1 };
@@ -1,252 +1,173 @@
1
- import { API as API$1, toApiLocality, urlParams, validatePathParam, enrichForPagination, waitForResource } from "@scaleway/sdk-client";
2
1
  import { CLUSTER_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalListNodeTypesResponse, unmarshalListVersionsResponse, unmarshalListClustersResponse, unmarshalCluster, marshalCreateClusterRequest, marshalUpdateClusterRequest, marshalCreateEndpointRequest, unmarshalEndpoint, unmarshalListUsersResponse, marshalUpdateUserRequest, unmarshalUser } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
6
- };
7
- class API extends API$1 {
8
- /**
9
- * Locality of this API.
10
- * type ∈ {'zone','region','global','unspecified'}
11
- */
12
- static LOCALITY = toApiLocality({
13
- regions: ["fr-par"]
14
- });
15
- pageOfListNodeTypes = (request = {}) => this.client.fetch(
16
- {
17
- method: "GET",
18
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
19
- urlParams: urlParams(
20
- ["include_disabled_types", request.includeDisabledTypes],
21
- ["page", request.page],
22
- [
23
- "page_size",
24
- request.pageSize ?? this.client.settings.defaultPageSize
25
- ]
26
- )
27
- },
28
- unmarshalListNodeTypesResponse
29
- );
30
- /**
31
- * List available node types.
32
- *
33
- * @param request - The request {@link ListNodeTypesRequest}
34
- * @returns A Promise of ListNodeTypesResponse
35
- */
36
- listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
37
- pageOfListVersions = (request = {}) => this.client.fetch(
38
- {
39
- method: "GET",
40
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
41
- urlParams: urlParams(
42
- ["page", request.page],
43
- [
44
- "page_size",
45
- request.pageSize ?? this.client.settings.defaultPageSize
46
- ],
47
- ["version", request.version]
48
- )
49
- },
50
- unmarshalListVersionsResponse
51
- );
52
- /**
53
- * List Kafka versions. List all available versions of Kafka at the current time.
54
- *
55
- * @param request - The request {@link ListVersionsRequest}
56
- * @returns A Promise of ListVersionsResponse
57
- */
58
- listVersions = (request = {}) => enrichForPagination("versions", this.pageOfListVersions, request);
59
- pageOfListClusters = (request = {}) => this.client.fetch(
60
- {
61
- method: "GET",
62
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`,
63
- urlParams: urlParams(
64
- ["name", request.name],
65
- ["order_by", request.orderBy],
66
- ["organization_id", request.organizationId],
67
- ["page", request.page],
68
- [
69
- "page_size",
70
- request.pageSize ?? this.client.settings.defaultPageSize
71
- ],
72
- ["project_id", request.projectId],
73
- ["tags", request.tags]
74
- )
75
- },
76
- unmarshalListClustersResponse
77
- );
78
- /**
79
- * List Kafka clusters. List all Kafka clusters in the specified region. By default, the clusters returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
80
- *
81
- * @param request - The request {@link ListClustersRequest}
82
- * @returns A Promise of ListClustersResponse
83
- */
84
- listClusters = (request = {}) => enrichForPagination("clusters", this.pageOfListClusters, request);
85
- /**
86
- * Get a Kafka cluster. Retrieve information about a given Kafka cluster, specified by the `region` and `cluster_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object.
87
- *
88
- * @param request - The request {@link GetClusterRequest}
89
- * @returns A Promise of Cluster
90
- */
91
- getCluster = (request) => this.client.fetch(
92
- {
93
- method: "GET",
94
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
95
- },
96
- unmarshalCluster
97
- );
98
- /**
99
- * Waits for {@link Cluster} to be in a final state.
100
- *
101
- * @param request - The request {@link GetClusterRequest}
102
- * @param options - The waiting options
103
- * @returns A Promise of Cluster
104
- */
105
- waitForCluster = (request, options) => waitForResource(
106
- options?.stop ?? ((res) => Promise.resolve(
107
- !CLUSTER_TRANSIENT_STATUSES.includes(res.status)
108
- )),
109
- this.getCluster,
110
- request,
111
- options
112
- );
113
- /**
114
- * Create a Kafka cluster. Create a new Kafka cluster.
115
- *
116
- * @param request - The request {@link CreateClusterRequest}
117
- * @returns A Promise of Cluster
118
- */
119
- createCluster = (request) => this.client.fetch(
120
- {
121
- body: JSON.stringify(
122
- marshalCreateClusterRequest(request, this.client.settings)
123
- ),
124
- headers: jsonContentHeaders,
125
- method: "POST",
126
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`
127
- },
128
- unmarshalCluster
129
- );
130
- /**
131
- * Update a Kafka cluster. Update the parameters of a Kafka cluster.
132
- *
133
- * @param request - The request {@link UpdateClusterRequest}
134
- * @returns A Promise of Cluster
135
- */
136
- updateCluster = (request) => this.client.fetch(
137
- {
138
- body: JSON.stringify(
139
- marshalUpdateClusterRequest(request, this.client.settings)
140
- ),
141
- headers: jsonContentHeaders,
142
- method: "PATCH",
143
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
144
- },
145
- unmarshalCluster
146
- );
147
- /**
148
- * Delete a Kafka cluster. Delete a given Kafka cluster, specified by the `region` and `cluster_id` parameters. Deleting a Kafka cluster is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
149
- *
150
- * @param request - The request {@link DeleteClusterRequest}
151
- * @returns A Promise of Cluster
152
- */
153
- deleteCluster = (request) => this.client.fetch(
154
- {
155
- method: "DELETE",
156
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
157
- },
158
- unmarshalCluster
159
- );
160
- /**
161
- * Get a Kafka cluster's certificate authority. Retrieve certificate authority for a given Kafka cluster, specified by the `region` and `cluster_id` parameters. The response object contains the certificate in PEM format. The certificate is required to validate the sever from the client side during TLS connection.
162
- *
163
- * @param request - The request {@link GetClusterCertificateAuthorityRequest}
164
- * @returns A Promise of Blob
165
- */
166
- getClusterCertificateAuthority = (request) => this.client.fetch({
167
- method: "GET",
168
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/certificate-authority`,
169
- urlParams: urlParams(["dl", 1]),
170
- responseType: "blob"
171
- });
172
- /**
173
- * Renew the Kafka cluster's certificate authority. Request to renew the certificate authority for a given Kafka cluster, specified by the `region` and `cluster_id` parameters. The certificate authority will be renewed within a few minutes.
174
- *
175
- * @param request - The request {@link RenewClusterCertificateAuthorityRequest}
176
- */
177
- renewClusterCertificateAuthority = (request) => this.client.fetch({
178
- body: "{}",
179
- headers: jsonContentHeaders,
180
- method: "POST",
181
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/renew-certificate-authority`
182
- });
183
- /**
184
- * Delete a Kafka cluster endpoint. Delete the endpoint of a Kafka cluster. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint.
185
- *
186
- * @param request - The request {@link DeleteEndpointRequest}
187
- */
188
- deleteEndpoint = (request) => this.client.fetch({
189
- method: "DELETE",
190
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
191
- });
192
- /**
193
- * Create a new Kafka cluster endpoint. Create a new endpoint for a Kafka cluster. You can add `public_network` or `private_network` specifications to the body of the request. Note that currently only `private_network` is supported.
194
- *
195
- * @param request - The request {@link CreateEndpointRequest}
196
- * @returns A Promise of Endpoint
197
- */
198
- createEndpoint = (request) => this.client.fetch(
199
- {
200
- body: JSON.stringify(
201
- marshalCreateEndpointRequest(request, this.client.settings)
202
- ),
203
- headers: jsonContentHeaders,
204
- method: "POST",
205
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
206
- },
207
- unmarshalEndpoint
208
- );
209
- pageOfListUsers = (request) => this.client.fetch(
210
- {
211
- method: "GET",
212
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/users`,
213
- urlParams: urlParams(
214
- ["name", request.name],
215
- ["order_by", request.orderBy],
216
- ["page", request.page],
217
- [
218
- "page_size",
219
- request.pageSize ?? this.client.settings.defaultPageSize
220
- ]
221
- )
222
- },
223
- unmarshalListUsersResponse
224
- );
225
- /**
226
- * Retrieve a list of deployment users.
227
- *
228
- * @param request - The request {@link ListUsersRequest}
229
- * @returns A Promise of ListUsersResponse
230
- */
231
- listUsers = (request) => enrichForPagination("users", this.pageOfListUsers, request);
232
- /**
233
- * Update an existing user.
234
- *
235
- * @param request - The request {@link UpdateUserRequest}
236
- * @returns A Promise of User
237
- */
238
- updateUser = (request) => this.client.fetch(
239
- {
240
- body: JSON.stringify(
241
- marshalUpdateUserRequest(request, this.client.settings)
242
- ),
243
- headers: jsonContentHeaders,
244
- method: "PATCH",
245
- path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/users/${validatePathParam("username", request.username)}`
246
- },
247
- unmarshalUser
248
- );
249
- }
250
- export {
251
- API
2
+ import { marshalCreateClusterRequest, marshalCreateEndpointRequest, marshalUpdateClusterRequest, marshalUpdateUserRequest, unmarshalCluster, unmarshalEndpoint, unmarshalListClustersResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Clusters for Apache Kafka®.
7
+
8
+ This API allows you to manage your Clusters for Apache Kafka®. This product is currently in Public Beta.
9
+ */
10
+ var API$1 = class extends API {
11
+ /**
12
+ * Locality of this API.
13
+ * type ∈ {'zone','region','global','unspecified'}
14
+ */
15
+ static LOCALITY = toApiLocality({ regions: ["fr-par"] });
16
+ pageOfListNodeTypes = (request = {}) => this.client.fetch({
17
+ method: "GET",
18
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
19
+ urlParams: urlParams(["include_disabled_types", request.includeDisabledTypes], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
20
+ }, unmarshalListNodeTypesResponse);
21
+ /**
22
+ * List available node types.
23
+ *
24
+ * @param request - The request {@link ListNodeTypesRequest}
25
+ * @returns A Promise of ListNodeTypesResponse
26
+ */
27
+ listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
28
+ pageOfListVersions = (request = {}) => this.client.fetch({
29
+ method: "GET",
30
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions`,
31
+ urlParams: urlParams(["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["version", request.version])
32
+ }, unmarshalListVersionsResponse);
33
+ /**
34
+ * List Kafka versions. List all available versions of Kafka at the current time.
35
+ *
36
+ * @param request - The request {@link ListVersionsRequest}
37
+ * @returns A Promise of ListVersionsResponse
38
+ */
39
+ listVersions = (request = {}) => enrichForPagination("versions", this.pageOfListVersions, request);
40
+ pageOfListClusters = (request = {}) => this.client.fetch({
41
+ method: "GET",
42
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`,
43
+ 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], ["tags", request.tags])
44
+ }, unmarshalListClustersResponse);
45
+ /**
46
+ * List Kafka clusters. List all Kafka clusters in the specified region. By default, the clusters returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
47
+ *
48
+ * @param request - The request {@link ListClustersRequest}
49
+ * @returns A Promise of ListClustersResponse
50
+ */
51
+ listClusters = (request = {}) => enrichForPagination("clusters", this.pageOfListClusters, request);
52
+ /**
53
+ * Get a Kafka cluster. Retrieve information about a given Kafka cluster, specified by the `region` and `cluster_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object.
54
+ *
55
+ * @param request - The request {@link GetClusterRequest}
56
+ * @returns A Promise of Cluster
57
+ */
58
+ getCluster = (request) => this.client.fetch({
59
+ method: "GET",
60
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
61
+ }, unmarshalCluster);
62
+ /**
63
+ * Waits for {@link Cluster} to be in a final state.
64
+ *
65
+ * @param request - The request {@link GetClusterRequest}
66
+ * @param options - The waiting options
67
+ * @returns A Promise of Cluster
68
+ */
69
+ waitForCluster = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options);
70
+ /**
71
+ * Create a Kafka cluster. Create a new Kafka cluster.
72
+ *
73
+ * @param request - The request {@link CreateClusterRequest}
74
+ * @returns A Promise of Cluster
75
+ */
76
+ createCluster = (request) => this.client.fetch({
77
+ body: JSON.stringify(marshalCreateClusterRequest(request, this.client.settings)),
78
+ headers: jsonContentHeaders,
79
+ method: "POST",
80
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`
81
+ }, unmarshalCluster);
82
+ /**
83
+ * Update a Kafka cluster. Update the parameters of a Kafka cluster.
84
+ *
85
+ * @param request - The request {@link UpdateClusterRequest}
86
+ * @returns A Promise of Cluster
87
+ */
88
+ updateCluster = (request) => this.client.fetch({
89
+ body: JSON.stringify(marshalUpdateClusterRequest(request, this.client.settings)),
90
+ headers: jsonContentHeaders,
91
+ method: "PATCH",
92
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
93
+ }, unmarshalCluster);
94
+ /**
95
+ * Delete a Kafka cluster. Delete a given Kafka cluster, specified by the `region` and `cluster_id` parameters. Deleting a Kafka cluster is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
96
+ *
97
+ * @param request - The request {@link DeleteClusterRequest}
98
+ * @returns A Promise of Cluster
99
+ */
100
+ deleteCluster = (request) => this.client.fetch({
101
+ method: "DELETE",
102
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}`
103
+ }, unmarshalCluster);
104
+ /**
105
+ * Get a Kafka cluster's certificate authority. Retrieve certificate authority for a given Kafka cluster, specified by the `region` and `cluster_id` parameters. The response object contains the certificate in PEM format. The certificate is required to validate the sever from the client side during TLS connection.
106
+ *
107
+ * @param request - The request {@link GetClusterCertificateAuthorityRequest}
108
+ * @returns A Promise of Blob
109
+ */
110
+ getClusterCertificateAuthority = (request) => this.client.fetch({
111
+ method: "GET",
112
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/certificate-authority`,
113
+ urlParams: urlParams(["dl", 1]),
114
+ responseType: "blob"
115
+ });
116
+ /**
117
+ * Renew the Kafka cluster's certificate authority. Request to renew the certificate authority for a given Kafka cluster, specified by the `region` and `cluster_id` parameters. The certificate authority will be renewed within a few minutes.
118
+ *
119
+ * @param request - The request {@link RenewClusterCertificateAuthorityRequest}
120
+ */
121
+ renewClusterCertificateAuthority = (request) => this.client.fetch({
122
+ body: "{}",
123
+ headers: jsonContentHeaders,
124
+ method: "POST",
125
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/renew-certificate-authority`
126
+ });
127
+ /**
128
+ * Delete a Kafka cluster endpoint. Delete the endpoint of a Kafka cluster. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint.
129
+ *
130
+ * @param request - The request {@link DeleteEndpointRequest}
131
+ */
132
+ deleteEndpoint = (request) => this.client.fetch({
133
+ method: "DELETE",
134
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam("endpointId", request.endpointId)}`
135
+ });
136
+ /**
137
+ * Create a new Kafka cluster endpoint. Create a new endpoint for a Kafka cluster. You can add `public_network` or `private_network` specifications to the body of the request. Note that currently only `private_network` is supported.
138
+ *
139
+ * @param request - The request {@link CreateEndpointRequest}
140
+ * @returns A Promise of Endpoint
141
+ */
142
+ createEndpoint = (request) => this.client.fetch({
143
+ body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),
144
+ headers: jsonContentHeaders,
145
+ method: "POST",
146
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints`
147
+ }, unmarshalEndpoint);
148
+ pageOfListUsers = (request) => this.client.fetch({
149
+ method: "GET",
150
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/users`,
151
+ urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
152
+ }, unmarshalListUsersResponse);
153
+ /**
154
+ * Retrieve a list of deployment users.
155
+ *
156
+ * @param request - The request {@link ListUsersRequest}
157
+ * @returns A Promise of ListUsersResponse
158
+ */
159
+ listUsers = (request) => enrichForPagination("users", this.pageOfListUsers, request);
160
+ /**
161
+ * Update an existing user.
162
+ *
163
+ * @param request - The request {@link UpdateUserRequest}
164
+ * @returns A Promise of User
165
+ */
166
+ updateUser = (request) => this.client.fetch({
167
+ body: JSON.stringify(marshalUpdateUserRequest(request, this.client.settings)),
168
+ headers: jsonContentHeaders,
169
+ method: "PATCH",
170
+ path: `/kafka/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam("clusterId", request.clusterId)}/users/${validatePathParam("username", request.username)}`
171
+ }, unmarshalUser);
252
172
  };
173
+ export { API$1 as API };
@@ -1,8 +1,7 @@
1
+ /** Lists transient statutes of the enum {@link ClusterStatus}. */
1
2
  const CLUSTER_TRANSIENT_STATUSES = [
2
- "creating",
3
- "configuring",
4
- "deleting"
3
+ "creating",
4
+ "configuring",
5
+ "deleting"
5
6
  ];
6
- export {
7
- CLUSTER_TRANSIENT_STATUSES
8
- };
7
+ export { CLUSTER_TRANSIENT_STATUSES };
@@ -1,4 +1,4 @@
1
- export { API } from './api.gen.js';
1
+ export { API, } from './api.gen.js';
2
2
  export * from './content.gen.js';
3
3
  export * from './marshalling.gen.js';
4
4
  export type { Cluster, ClusterSetting, ClusterStatus, CreateClusterRequest, CreateClusterRequestVolumeSpec, CreateEndpointRequest, DeleteClusterRequest, DeleteEndpointRequest, Endpoint, EndpointPrivateNetworkDetails, EndpointPublicDetails, EndpointSpec, EndpointSpecPrivateNetworkDetails, EndpointSpecPublicDetails, GetClusterCertificateAuthorityRequest, GetClusterRequest, ListClustersRequest, ListClustersRequestOrderBy, ListClustersResponse, ListNodeTypesRequest, ListNodeTypesResponse, ListUsersRequest, ListUsersRequestOrderBy, ListUsersResponse, ListVersionsRequest, ListVersionsResponse, NodeType, NodeTypeStock, NodeTypeVolumeType, RenewClusterCertificateAuthorityRequest, UpdateClusterRequest, UpdateUserRequest, User, Version, VersionAvailableSetting, VersionAvailableSettingBooleanProperty, VersionAvailableSettingFloatProperty, VersionAvailableSettingIntegerProperty, VersionAvailableSettingStringProperty, Volume, VolumeType, } from './types.gen.js';
@@ -1,20 +1,22 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { CLUSTER_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { marshalCreateClusterRequest, marshalCreateEndpointRequest, marshalUpdateClusterRequest, marshalUpdateUserRequest, unmarshalCluster, unmarshalEndpoint, unmarshalListClustersResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser } from "./marshalling.gen.js";
4
- import * as validationRules_gen from "./validation-rules.gen.js";
5
- export {
6
- API,
7
- CLUSTER_TRANSIENT_STATUSES,
8
- validationRules_gen as ValidationRules,
9
- marshalCreateClusterRequest,
10
- marshalCreateEndpointRequest,
11
- marshalUpdateClusterRequest,
12
- marshalUpdateUserRequest,
13
- unmarshalCluster,
14
- unmarshalEndpoint,
15
- unmarshalListClustersResponse,
16
- unmarshalListNodeTypesResponse,
17
- unmarshalListUsersResponse,
18
- unmarshalListVersionsResponse,
19
- unmarshalUser
20
- };
4
+ import { API } from "./api.gen.js";
5
+ import { validation_rules_gen_exports } from "./validation-rules.gen.js";
6
+ var index_gen_exports = /* @__PURE__ */ __exportAll({
7
+ API: () => API,
8
+ CLUSTER_TRANSIENT_STATUSES: () => CLUSTER_TRANSIENT_STATUSES,
9
+ ValidationRules: () => validation_rules_gen_exports,
10
+ marshalCreateClusterRequest: () => marshalCreateClusterRequest,
11
+ marshalCreateEndpointRequest: () => marshalCreateEndpointRequest,
12
+ marshalUpdateClusterRequest: () => marshalUpdateClusterRequest,
13
+ marshalUpdateUserRequest: () => marshalUpdateUserRequest,
14
+ unmarshalCluster: () => unmarshalCluster,
15
+ unmarshalEndpoint: () => unmarshalEndpoint,
16
+ unmarshalListClustersResponse: () => unmarshalListClustersResponse,
17
+ unmarshalListNodeTypesResponse: () => unmarshalListNodeTypesResponse,
18
+ unmarshalListUsersResponse: () => unmarshalListUsersResponse,
19
+ unmarshalListVersionsResponse: () => unmarshalListVersionsResponse,
20
+ unmarshalUser: () => unmarshalUser
21
+ });
22
+ export { index_gen_exports };
@@ -1,308 +1,197 @@
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
1
2
  import randomName from "@scaleway/random-name";
2
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
3
- const unmarshalEndpointPrivateNetworkDetails = (data) => {
4
- if (!isJSONObject(data)) {
5
- throw new TypeError(
6
- `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
7
- );
8
- }
9
- return {
10
- privateNetworkId: data.private_network_id
11
- };
3
+ var unmarshalEndpointPrivateNetworkDetails = (data) => {
4
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
5
+ return { privateNetworkId: data.private_network_id };
12
6
  };
13
- const unmarshalEndpointPublicDetails = (data) => {
14
- if (!isJSONObject(data)) {
15
- throw new TypeError(
16
- `Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`
17
- );
18
- }
19
- return {};
7
+ var unmarshalEndpointPublicDetails = (data) => {
8
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`);
9
+ return {};
20
10
  };
21
11
  const unmarshalEndpoint = (data) => {
22
- if (!isJSONObject(data)) {
23
- throw new TypeError(
24
- `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
25
- );
26
- }
27
- return {
28
- dnsRecords: data.dns_records,
29
- id: data.id,
30
- port: data.port,
31
- privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
32
- publicNetwork: data.public_network ? unmarshalEndpointPublicDetails(data.public_network) : void 0
33
- };
34
- };
35
- const unmarshalClusterSetting = (data) => {
36
- if (!isJSONObject(data)) {
37
- throw new TypeError(
38
- `Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`
39
- );
40
- }
41
- return {
42
- boolValue: data.bool_value,
43
- floatValue: data.float_value,
44
- intValue: data.int_value,
45
- name: data.name,
46
- stringValue: data.string_value
47
- };
48
- };
49
- const unmarshalVolume = (data) => {
50
- if (!isJSONObject(data)) {
51
- throw new TypeError(
52
- `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`
53
- );
54
- }
55
- return {
56
- sizeBytes: data.size_bytes,
57
- type: data.type
58
- };
12
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
13
+ return {
14
+ dnsRecords: data.dns_records,
15
+ id: data.id,
16
+ port: data.port,
17
+ privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
18
+ publicNetwork: data.public_network ? unmarshalEndpointPublicDetails(data.public_network) : void 0
19
+ };
20
+ };
21
+ var unmarshalClusterSetting = (data) => {
22
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`);
23
+ return {
24
+ boolValue: data.bool_value,
25
+ floatValue: data.float_value,
26
+ intValue: data.int_value,
27
+ name: data.name,
28
+ stringValue: data.string_value
29
+ };
30
+ };
31
+ var unmarshalVolume = (data) => {
32
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
33
+ return {
34
+ sizeBytes: data.size_bytes,
35
+ type: data.type
36
+ };
59
37
  };
60
38
  const unmarshalCluster = (data) => {
61
- if (!isJSONObject(data)) {
62
- throw new TypeError(
63
- `Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`
64
- );
65
- }
66
- return {
67
- createdAt: unmarshalDate(data.created_at),
68
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
69
- id: data.id,
70
- name: data.name,
71
- nodeAmount: data.node_amount,
72
- nodeType: data.node_type,
73
- organizationId: data.organization_id,
74
- projectId: data.project_id,
75
- region: data.region,
76
- settings: unmarshalArrayOfObject(data.settings, unmarshalClusterSetting),
77
- status: data.status,
78
- tags: data.tags,
79
- updatedAt: unmarshalDate(data.updated_at),
80
- version: data.version,
81
- volume: data.volume ? unmarshalVolume(data.volume) : void 0
82
- };
39
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
40
+ return {
41
+ createdAt: unmarshalDate(data.created_at),
42
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
43
+ id: data.id,
44
+ name: data.name,
45
+ nodeAmount: data.node_amount,
46
+ nodeType: data.node_type,
47
+ organizationId: data.organization_id,
48
+ projectId: data.project_id,
49
+ region: data.region,
50
+ settings: unmarshalArrayOfObject(data.settings, unmarshalClusterSetting),
51
+ status: data.status,
52
+ tags: data.tags,
53
+ updatedAt: unmarshalDate(data.updated_at),
54
+ version: data.version,
55
+ volume: data.volume ? unmarshalVolume(data.volume) : void 0
56
+ };
83
57
  };
84
58
  const unmarshalUser = (data) => {
85
- if (!isJSONObject(data)) {
86
- throw new TypeError(
87
- `Unmarshalling the type 'User' failed as data isn't a dictionary.`
88
- );
89
- }
90
- return {
91
- username: data.username
92
- };
59
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
60
+ return { username: data.username };
93
61
  };
94
62
  const unmarshalListClustersResponse = (data) => {
95
- if (!isJSONObject(data)) {
96
- throw new TypeError(
97
- `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`
98
- );
99
- }
100
- return {
101
- clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
102
- totalCount: data.total_count
103
- };
104
- };
105
- const unmarshalNodeTypeVolumeType = (data) => {
106
- if (!isJSONObject(data)) {
107
- throw new TypeError(
108
- `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`
109
- );
110
- }
111
- return {
112
- chunkSizeBytes: data.chunk_size_bytes,
113
- description: data.description,
114
- maxSizeBytes: data.max_size_bytes,
115
- minSizeBytes: data.min_size_bytes,
116
- type: data.type
117
- };
118
- };
119
- const unmarshalNodeType = (data) => {
120
- if (!isJSONObject(data)) {
121
- throw new TypeError(
122
- `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
123
- );
124
- }
125
- return {
126
- availableVolumeTypes: unmarshalArrayOfObject(
127
- data.available_volume_types,
128
- unmarshalNodeTypeVolumeType
129
- ),
130
- beta: data.beta,
131
- clusterRange: data.cluster_range,
132
- description: data.description,
133
- disabled: data.disabled,
134
- memoryBytes: data.memory_bytes,
135
- name: data.name,
136
- stockStatus: data.stock_status,
137
- vcpus: data.vcpus
138
- };
63
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`);
64
+ return {
65
+ clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
66
+ totalCount: data.total_count
67
+ };
68
+ };
69
+ var unmarshalNodeTypeVolumeType = (data) => {
70
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);
71
+ return {
72
+ chunkSizeBytes: data.chunk_size_bytes,
73
+ description: data.description,
74
+ maxSizeBytes: data.max_size_bytes,
75
+ minSizeBytes: data.min_size_bytes,
76
+ type: data.type
77
+ };
78
+ };
79
+ var unmarshalNodeType = (data) => {
80
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
81
+ return {
82
+ availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),
83
+ beta: data.beta,
84
+ clusterRange: data.cluster_range,
85
+ description: data.description,
86
+ disabled: data.disabled,
87
+ memoryBytes: data.memory_bytes,
88
+ name: data.name,
89
+ stockStatus: data.stock_status,
90
+ vcpus: data.vcpus
91
+ };
139
92
  };
140
93
  const unmarshalListNodeTypesResponse = (data) => {
141
- if (!isJSONObject(data)) {
142
- throw new TypeError(
143
- `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
144
- );
145
- }
146
- return {
147
- nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
148
- totalCount: data.total_count
149
- };
94
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
95
+ return {
96
+ nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
97
+ totalCount: data.total_count
98
+ };
150
99
  };
151
100
  const unmarshalListUsersResponse = (data) => {
152
- if (!isJSONObject(data)) {
153
- throw new TypeError(
154
- `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`
155
- );
156
- }
157
- return {
158
- totalCount: data.total_count,
159
- users: unmarshalArrayOfObject(data.users, unmarshalUser)
160
- };
161
- };
162
- const unmarshalVersionAvailableSettingBooleanProperty = (data) => {
163
- if (!isJSONObject(data)) {
164
- throw new TypeError(
165
- `Unmarshalling the type 'VersionAvailableSettingBooleanProperty' failed as data isn't a dictionary.`
166
- );
167
- }
168
- return {
169
- defaultValue: data.default_value
170
- };
171
- };
172
- const unmarshalVersionAvailableSettingFloatProperty = (data) => {
173
- if (!isJSONObject(data)) {
174
- throw new TypeError(
175
- `Unmarshalling the type 'VersionAvailableSettingFloatProperty' failed as data isn't a dictionary.`
176
- );
177
- }
178
- return {
179
- defaultValue: data.default_value,
180
- max: data.max,
181
- min: data.min,
182
- unit: data.unit
183
- };
184
- };
185
- const unmarshalVersionAvailableSettingIntegerProperty = (data) => {
186
- if (!isJSONObject(data)) {
187
- throw new TypeError(
188
- `Unmarshalling the type 'VersionAvailableSettingIntegerProperty' failed as data isn't a dictionary.`
189
- );
190
- }
191
- return {
192
- defaultValue: data.default_value,
193
- max: data.max,
194
- min: data.min,
195
- unit: data.unit
196
- };
197
- };
198
- const unmarshalVersionAvailableSettingStringProperty = (data) => {
199
- if (!isJSONObject(data)) {
200
- throw new TypeError(
201
- `Unmarshalling the type 'VersionAvailableSettingStringProperty' failed as data isn't a dictionary.`
202
- );
203
- }
204
- return {
205
- defaultValue: data.default_value,
206
- stringConstraint: data.string_constraint
207
- };
208
- };
209
- const unmarshalVersionAvailableSetting = (data) => {
210
- if (!isJSONObject(data)) {
211
- throw new TypeError(
212
- `Unmarshalling the type 'VersionAvailableSetting' failed as data isn't a dictionary.`
213
- );
214
- }
215
- return {
216
- boolProperty: data.bool_property ? unmarshalVersionAvailableSettingBooleanProperty(data.bool_property) : void 0,
217
- description: data.description,
218
- floatProperty: data.float_property ? unmarshalVersionAvailableSettingFloatProperty(data.float_property) : void 0,
219
- hotConfigurable: data.hot_configurable,
220
- intProperty: data.int_property ? unmarshalVersionAvailableSettingIntegerProperty(data.int_property) : void 0,
221
- name: data.name,
222
- stringProperty: data.string_property ? unmarshalVersionAvailableSettingStringProperty(data.string_property) : void 0
223
- };
224
- };
225
- const unmarshalVersion = (data) => {
226
- if (!isJSONObject(data)) {
227
- throw new TypeError(
228
- `Unmarshalling the type 'Version' failed as data isn't a dictionary.`
229
- );
230
- }
231
- return {
232
- availableSettings: unmarshalArrayOfObject(
233
- data.available_settings,
234
- unmarshalVersionAvailableSetting
235
- ),
236
- endOfLifeAt: unmarshalDate(data.end_of_life_at),
237
- version: data.version
238
- };
101
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
102
+ return {
103
+ totalCount: data.total_count,
104
+ users: unmarshalArrayOfObject(data.users, unmarshalUser)
105
+ };
106
+ };
107
+ var unmarshalVersionAvailableSettingBooleanProperty = (data) => {
108
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VersionAvailableSettingBooleanProperty' failed as data isn't a dictionary.`);
109
+ return { defaultValue: data.default_value };
110
+ };
111
+ var unmarshalVersionAvailableSettingFloatProperty = (data) => {
112
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VersionAvailableSettingFloatProperty' failed as data isn't a dictionary.`);
113
+ return {
114
+ defaultValue: data.default_value,
115
+ max: data.max,
116
+ min: data.min,
117
+ unit: data.unit
118
+ };
119
+ };
120
+ var unmarshalVersionAvailableSettingIntegerProperty = (data) => {
121
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VersionAvailableSettingIntegerProperty' failed as data isn't a dictionary.`);
122
+ return {
123
+ defaultValue: data.default_value,
124
+ max: data.max,
125
+ min: data.min,
126
+ unit: data.unit
127
+ };
128
+ };
129
+ var unmarshalVersionAvailableSettingStringProperty = (data) => {
130
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VersionAvailableSettingStringProperty' failed as data isn't a dictionary.`);
131
+ return {
132
+ defaultValue: data.default_value,
133
+ stringConstraint: data.string_constraint
134
+ };
135
+ };
136
+ var unmarshalVersionAvailableSetting = (data) => {
137
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VersionAvailableSetting' failed as data isn't a dictionary.`);
138
+ return {
139
+ boolProperty: data.bool_property ? unmarshalVersionAvailableSettingBooleanProperty(data.bool_property) : void 0,
140
+ description: data.description,
141
+ floatProperty: data.float_property ? unmarshalVersionAvailableSettingFloatProperty(data.float_property) : void 0,
142
+ hotConfigurable: data.hot_configurable,
143
+ intProperty: data.int_property ? unmarshalVersionAvailableSettingIntegerProperty(data.int_property) : void 0,
144
+ name: data.name,
145
+ stringProperty: data.string_property ? unmarshalVersionAvailableSettingStringProperty(data.string_property) : void 0
146
+ };
147
+ };
148
+ var unmarshalVersion = (data) => {
149
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
150
+ return {
151
+ availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalVersionAvailableSetting),
152
+ endOfLifeAt: unmarshalDate(data.end_of_life_at),
153
+ version: data.version
154
+ };
239
155
  };
240
156
  const unmarshalListVersionsResponse = (data) => {
241
- if (!isJSONObject(data)) {
242
- throw new TypeError(
243
- `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`
244
- );
245
- }
246
- return {
247
- totalCount: data.total_count,
248
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
249
- };
250
- };
251
- const marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({
252
- private_network_id: request.privateNetworkId
253
- });
254
- const marshalEndpointSpecPublicDetails = (request, defaults) => ({});
255
- const marshalCreateClusterRequestVolumeSpec = (request, defaults) => ({
256
- size_bytes: request.sizeBytes,
257
- type: request.type
258
- });
259
- const marshalEndpointSpec = (request, defaults) => ({
260
- ...resolveOneOf([
261
- {
262
- param: "public_network",
263
- value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicDetails(request.publicNetwork) : void 0
264
- },
265
- {
266
- param: "private_network",
267
- value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(
268
- request.privateNetwork
269
- ) : void 0
270
- }
271
- ])
157
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
158
+ return {
159
+ totalCount: data.total_count,
160
+ versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
161
+ };
162
+ };
163
+ var marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({ private_network_id: request.privateNetworkId });
164
+ var marshalEndpointSpecPublicDetails = (request, defaults) => ({});
165
+ var marshalCreateClusterRequestVolumeSpec = (request, defaults) => ({
166
+ size_bytes: request.sizeBytes,
167
+ type: request.type
272
168
  });
169
+ var marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
170
+ param: "public_network",
171
+ value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicDetails(request.publicNetwork, defaults) : void 0
172
+ }, {
173
+ param: "private_network",
174
+ value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
175
+ }]) });
273
176
  const marshalCreateClusterRequest = (request, defaults) => ({
274
- endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,
275
- name: request.name || randomName("kafk"),
276
- node_amount: request.nodeAmount,
277
- node_type: request.nodeType,
278
- password: request.password,
279
- project_id: request.projectId ?? defaults.defaultProjectId,
280
- tags: request.tags,
281
- user_name: request.userName,
282
- version: request.version,
283
- volume: request.volume !== void 0 ? marshalCreateClusterRequestVolumeSpec(request.volume) : void 0
177
+ endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
178
+ name: request.name || randomName("kafk"),
179
+ node_amount: request.nodeAmount,
180
+ node_type: request.nodeType,
181
+ password: request.password,
182
+ project_id: request.projectId ?? defaults.defaultProjectId,
183
+ tags: request.tags,
184
+ user_name: request.userName,
185
+ version: request.version,
186
+ volume: request.volume !== void 0 ? marshalCreateClusterRequestVolumeSpec(request.volume, defaults) : void 0
284
187
  });
285
188
  const marshalCreateEndpointRequest = (request, defaults) => ({
286
- cluster_id: request.clusterId,
287
- endpoint: marshalEndpointSpec(request.endpoint)
189
+ cluster_id: request.clusterId,
190
+ endpoint: marshalEndpointSpec(request.endpoint, defaults)
288
191
  });
289
192
  const marshalUpdateClusterRequest = (request, defaults) => ({
290
- name: request.name,
291
- tags: request.tags
292
- });
293
- const marshalUpdateUserRequest = (request, defaults) => ({
294
- password: request.password
193
+ name: request.name,
194
+ tags: request.tags
295
195
  });
296
- export {
297
- marshalCreateClusterRequest,
298
- marshalCreateEndpointRequest,
299
- marshalUpdateClusterRequest,
300
- marshalUpdateUserRequest,
301
- unmarshalCluster,
302
- unmarshalEndpoint,
303
- unmarshalListClustersResponse,
304
- unmarshalListNodeTypesResponse,
305
- unmarshalListUsersResponse,
306
- unmarshalListVersionsResponse,
307
- unmarshalUser
308
- };
196
+ const marshalUpdateUserRequest = (request, defaults) => ({ password: request.password });
197
+ export { marshalCreateClusterRequest, marshalCreateEndpointRequest, marshalUpdateClusterRequest, marshalUpdateUserRequest, unmarshalCluster, unmarshalEndpoint, unmarshalListClustersResponse, unmarshalListNodeTypesResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser };
@@ -1,104 +1,92 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
+ CreateClusterRequest: () => CreateClusterRequest,
4
+ ListClustersRequest: () => ListClustersRequest,
5
+ ListNodeTypesRequest: () => ListNodeTypesRequest,
6
+ ListUsersRequest: () => ListUsersRequest,
7
+ ListVersionsRequest: () => ListVersionsRequest,
8
+ UpdateClusterRequest: () => UpdateClusterRequest,
9
+ UpdateUserRequest: () => UpdateUserRequest
10
+ });
1
11
  const CreateClusterRequest = {
2
- name: {
3
- maxLength: 255,
4
- minLength: 1,
5
- pattern: /^[A-Za-z0-9\-_]+$/
6
- },
7
- nodeAmount: {
8
- greaterThanOrEqual: 1,
9
- lessThanOrEqual: 30
10
- },
11
- nodeType: {
12
- maxLength: 128,
13
- minLength: 1,
14
- pattern: /^[A-Za-z0-9\-_]+$/
15
- },
16
- password: {
17
- maxLength: 128,
18
- minLength: 12
19
- },
20
- userName: {
21
- maxLength: 63,
22
- minLength: 1,
23
- pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/
24
- },
25
- version: {
26
- pattern: /^[0-9]+\.[0-9]+\.[0-9]+$/
27
- }
12
+ name: {
13
+ maxLength: 255,
14
+ minLength: 1,
15
+ pattern: /^[A-Za-z0-9\-_]+$/
16
+ },
17
+ nodeAmount: {
18
+ greaterThanOrEqual: 1,
19
+ lessThanOrEqual: 30
20
+ },
21
+ nodeType: {
22
+ maxLength: 128,
23
+ minLength: 1,
24
+ pattern: /^[A-Za-z0-9\-_]+$/
25
+ },
26
+ password: {
27
+ maxLength: 128,
28
+ minLength: 12
29
+ },
30
+ userName: {
31
+ maxLength: 63,
32
+ minLength: 1,
33
+ pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/
34
+ },
35
+ version: { pattern: /^[0-9]+\.[0-9]+\.[0-9]+$/ }
28
36
  };
29
37
  const ListClustersRequest = {
30
- name: {
31
- maxLength: 255,
32
- minLength: 1,
33
- pattern: /^[A-Za-z0-9\-_]+$/
34
- },
35
- page: {
36
- greaterThanOrEqual: 1
37
- },
38
- pageSize: {
39
- greaterThanOrEqual: 1,
40
- lessThanOrEqual: 100
41
- }
38
+ name: {
39
+ maxLength: 255,
40
+ minLength: 1,
41
+ pattern: /^[A-Za-z0-9\-_]+$/
42
+ },
43
+ page: { greaterThanOrEqual: 1 },
44
+ pageSize: {
45
+ greaterThanOrEqual: 1,
46
+ lessThanOrEqual: 100
47
+ }
42
48
  };
43
49
  const ListNodeTypesRequest = {
44
- page: {
45
- greaterThanOrEqual: 1
46
- },
47
- pageSize: {
48
- greaterThanOrEqual: 1,
49
- lessThanOrEqual: 100
50
- }
50
+ page: { greaterThanOrEqual: 1 },
51
+ pageSize: {
52
+ greaterThanOrEqual: 1,
53
+ lessThanOrEqual: 100
54
+ }
51
55
  };
52
56
  const ListUsersRequest = {
53
- name: {
54
- maxLength: 63,
55
- minLength: 1,
56
- pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/
57
- },
58
- page: {
59
- greaterThanOrEqual: 1
60
- },
61
- pageSize: {
62
- greaterThanOrEqual: 1,
63
- lessThanOrEqual: 100
64
- }
57
+ name: {
58
+ maxLength: 63,
59
+ minLength: 1,
60
+ pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/
61
+ },
62
+ page: { greaterThanOrEqual: 1 },
63
+ pageSize: {
64
+ greaterThanOrEqual: 1,
65
+ lessThanOrEqual: 100
66
+ }
65
67
  };
66
68
  const ListVersionsRequest = {
67
- page: {
68
- greaterThanOrEqual: 1
69
- },
70
- pageSize: {
71
- greaterThanOrEqual: 1,
72
- lessThanOrEqual: 100
73
- },
74
- version: {
75
- pattern: /^[0-9]+\.[0-9]+\.[0-9]+$/
76
- }
77
- };
78
- const UpdateClusterRequest = {
79
- name: {
80
- maxLength: 255,
81
- minLength: 1,
82
- pattern: /^[A-Za-z0-9\-_]+$/
83
- }
69
+ page: { greaterThanOrEqual: 1 },
70
+ pageSize: {
71
+ greaterThanOrEqual: 1,
72
+ lessThanOrEqual: 100
73
+ },
74
+ version: { pattern: /^[0-9]+\.[0-9]+\.[0-9]+$/ }
84
75
  };
76
+ const UpdateClusterRequest = { name: {
77
+ maxLength: 255,
78
+ minLength: 1,
79
+ pattern: /^[A-Za-z0-9\-_]+$/
80
+ } };
85
81
  const UpdateUserRequest = {
86
- password: {
87
- maxLength: 128,
88
- minLength: 8
89
- },
90
- username: {
91
- maxLength: 63,
92
- minLength: 1,
93
- pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/
94
- }
95
- };
96
- export {
97
- CreateClusterRequest,
98
- ListClustersRequest,
99
- ListNodeTypesRequest,
100
- ListUsersRequest,
101
- ListVersionsRequest,
102
- UpdateClusterRequest,
103
- UpdateUserRequest
82
+ password: {
83
+ maxLength: 128,
84
+ minLength: 8
85
+ },
86
+ username: {
87
+ maxLength: 63,
88
+ minLength: 1,
89
+ pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/
90
+ }
104
91
  };
92
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-kafka",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "Scaleway SDK kafka",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.2.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@scaleway/sdk-client": "^2.1.0"
33
+ "@scaleway/sdk-client": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@scaleway/sdk-client": "^2.1.0"
36
+ "@scaleway/sdk-client": "^2.2.0"
37
37
  },
38
38
  "scripts": {
39
39
  "package:check": "pnpm publint",