@scaleway/sdk-datalab 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -83,6 +83,7 @@ const api = new Datalab.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 "./v1beta1/index.gen.js";
2
- export {
3
- index_gen as Datalabv1beta1
4
- };
1
+ import { index_gen_exports } from "./v1beta1/index.gen.js";
2
+ export { index_gen_exports as Datalabv1beta1 };
@@ -1,175 +1,117 @@
1
- import { API as API$1, toApiLocality, validatePathParam, waitForResource, urlParams, enrichForPagination } from "@scaleway/sdk-client";
2
1
  import { DATALAB_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { marshalCreateDatalabRequest, unmarshalDatalab, unmarshalListDatalabsResponse, marshalUpdateDatalabRequest, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse, unmarshalListClusterVersionsResponse } 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: [
14
- "fr-par"
15
- ]
16
- });
17
- /**
18
- * Create a new Data Lab. In this call, one can personalize the node counts, add a notebook, choose the private network, define the persistent volume storage capacity.
19
- *
20
- * @param request - The request {@link CreateDatalabRequest}
21
- * @returns A Promise of Datalab
22
- */
23
- createDatalab = (request) => this.client.fetch(
24
- {
25
- body: JSON.stringify(
26
- marshalCreateDatalabRequest(request, this.client.settings)
27
- ),
28
- headers: jsonContentHeaders,
29
- method: "POST",
30
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`
31
- },
32
- unmarshalDatalab
33
- );
34
- /**
35
- * Retrieve information about a given Data Lab cluster, specified by the `region` and `datalab_id` parameters. Its full details, including name, status, node counts, are returned in the response object.
36
- *
37
- * @param request - The request {@link GetDatalabRequest}
38
- * @returns A Promise of Datalab
39
- */
40
- getDatalab = (request) => this.client.fetch(
41
- {
42
- method: "GET",
43
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
44
- },
45
- unmarshalDatalab
46
- );
47
- /**
48
- * Waits for {@link Datalab} to be in a final state.
49
- *
50
- * @param request - The request {@link GetDatalabRequest}
51
- * @param options - The waiting options
52
- * @returns A Promise of Datalab
53
- */
54
- waitForDatalab = (request, options) => waitForResource(
55
- options?.stop ?? ((res) => Promise.resolve(!DATALAB_TRANSIENT_STATUSES.includes(res.status))),
56
- this.getDatalab,
57
- request,
58
- options
59
- );
60
- pageOfListDatalabs = (request = {}) => this.client.fetch(
61
- {
62
- method: "GET",
63
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`,
64
- urlParams: urlParams(
65
- ["name", request.name],
66
- ["order_by", request.orderBy],
67
- ["organization_id", request.organizationId],
68
- ["page", request.page],
69
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
70
- ["project_id", request.projectId],
71
- ["tags", request.tags]
72
- )
73
- },
74
- unmarshalListDatalabsResponse
75
- );
76
- /**
77
- * List information about Data Lab cluster within a project or an organization.
78
- *
79
- * @param request - The request {@link ListDatalabsRequest}
80
- * @returns A Promise of ListDatalabsResponse
81
- */
82
- listDatalabs = (request = {}) => enrichForPagination("datalabs", this.pageOfListDatalabs, request);
83
- /**
84
- * Update a Data Labs node counts. Allows for up- and downscaling on demand, depending on the expected workload.
85
- *
86
- * @param request - The request {@link UpdateDatalabRequest}
87
- * @returns A Promise of Datalab
88
- */
89
- updateDatalab = (request) => this.client.fetch(
90
- {
91
- body: JSON.stringify(
92
- marshalUpdateDatalabRequest(request, this.client.settings)
93
- ),
94
- headers: jsonContentHeaders,
95
- method: "PATCH",
96
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
97
- },
98
- unmarshalDatalab
99
- );
100
- /**
101
- * Delete a Data Lab based on its region and id.
102
- *
103
- * @param request - The request {@link DeleteDatalabRequest}
104
- * @returns A Promise of Datalab
105
- */
106
- deleteDatalab = (request) => this.client.fetch(
107
- {
108
- method: "DELETE",
109
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
110
- },
111
- unmarshalDatalab
112
- );
113
- pageOfListNodeTypes = (request = {}) => this.client.fetch(
114
- {
115
- method: "GET",
116
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
117
- urlParams: urlParams(
118
- ["order_by", request.orderBy],
119
- ["page", request.page],
120
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
121
- ["resource_type", request.resourceType],
122
- ["targets", request.targets]
123
- )
124
- },
125
- unmarshalListNodeTypesResponse
126
- );
127
- /**
128
- * List the available compute node types for creating a Data Lab.
129
- *
130
- * @param request - The request {@link ListNodeTypesRequest}
131
- * @returns A Promise of ListNodeTypesResponse
132
- */
133
- listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
134
- pageOfListNotebookVersions = (request = {}) => this.client.fetch(
135
- {
136
- method: "GET",
137
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/notebook-versions`,
138
- urlParams: urlParams(
139
- ["order_by", request.orderBy],
140
- ["page", request.page],
141
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
142
- )
143
- },
144
- unmarshalListNotebookVersionsResponse
145
- );
146
- /**
147
- * Lists available notebook versions.
148
- *
149
- * @param request - The request {@link ListNotebookVersionsRequest}
150
- * @returns A Promise of ListNotebookVersionsResponse
151
- */
152
- listNotebookVersions = (request = {}) => enrichForPagination("notebooks", this.pageOfListNotebookVersions, request);
153
- pageOfListClusterVersions = (request = {}) => this.client.fetch(
154
- {
155
- method: "GET",
156
- path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-versions`,
157
- urlParams: urlParams(
158
- ["order_by", request.orderBy],
159
- ["page", request.page],
160
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
161
- )
162
- },
163
- unmarshalListClusterVersionsResponse
164
- );
165
- /**
166
- * List the Spark versions the product is compatible with.
167
- *
168
- * @param request - The request {@link ListClusterVersionsRequest}
169
- * @returns A Promise of ListClusterVersionsResponse
170
- */
171
- listClusterVersions = (request = {}) => enrichForPagination("clusters", this.pageOfListClusterVersions, request);
172
- }
173
- export {
174
- API
2
+ import { marshalCreateDatalabRequest, marshalUpdateDatalabRequest, unmarshalDatalab, unmarshalListClusterVersionsResponse, unmarshalListDatalabsResponse, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse } 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
+ * Data Lab API for Apache Spark™.
7
+
8
+ This API allows you to manage your Data Lab resources.
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
+ /**
17
+ * Create a new Data Lab. In this call, one can personalize the node counts, add a notebook, choose the private network, define the persistent volume storage capacity.
18
+ *
19
+ * @param request - The request {@link CreateDatalabRequest}
20
+ * @returns A Promise of Datalab
21
+ */
22
+ createDatalab = (request) => this.client.fetch({
23
+ body: JSON.stringify(marshalCreateDatalabRequest(request, this.client.settings)),
24
+ headers: jsonContentHeaders,
25
+ method: "POST",
26
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`
27
+ }, unmarshalDatalab);
28
+ /**
29
+ * Retrieve information about a given Data Lab cluster, specified by the `region` and `datalab_id` parameters. Its full details, including name, status, node counts, are returned in the response object.
30
+ *
31
+ * @param request - The request {@link GetDatalabRequest}
32
+ * @returns A Promise of Datalab
33
+ */
34
+ getDatalab = (request) => this.client.fetch({
35
+ method: "GET",
36
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
37
+ }, unmarshalDatalab);
38
+ /**
39
+ * Waits for {@link Datalab} to be in a final state.
40
+ *
41
+ * @param request - The request {@link GetDatalabRequest}
42
+ * @param options - The waiting options
43
+ * @returns A Promise of Datalab
44
+ */
45
+ waitForDatalab = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!DATALAB_TRANSIENT_STATUSES.includes(res.status))), this.getDatalab, request, options);
46
+ pageOfListDatalabs = (request = {}) => this.client.fetch({
47
+ method: "GET",
48
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs`,
49
+ 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])
50
+ }, unmarshalListDatalabsResponse);
51
+ /**
52
+ * List information about Data Lab cluster within a project or an organization.
53
+ *
54
+ * @param request - The request {@link ListDatalabsRequest}
55
+ * @returns A Promise of ListDatalabsResponse
56
+ */
57
+ listDatalabs = (request = {}) => enrichForPagination("datalabs", this.pageOfListDatalabs, request);
58
+ /**
59
+ * Update a Data Labs node counts. Allows for up- and downscaling on demand, depending on the expected workload.
60
+ *
61
+ * @param request - The request {@link UpdateDatalabRequest}
62
+ * @returns A Promise of Datalab
63
+ */
64
+ updateDatalab = (request) => this.client.fetch({
65
+ body: JSON.stringify(marshalUpdateDatalabRequest(request, this.client.settings)),
66
+ headers: jsonContentHeaders,
67
+ method: "PATCH",
68
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
69
+ }, unmarshalDatalab);
70
+ /**
71
+ * Delete a Data Lab based on its region and id.
72
+ *
73
+ * @param request - The request {@link DeleteDatalabRequest}
74
+ * @returns A Promise of Datalab
75
+ */
76
+ deleteDatalab = (request) => this.client.fetch({
77
+ method: "DELETE",
78
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/datalabs/${validatePathParam("datalabId", request.datalabId)}`
79
+ }, unmarshalDatalab);
80
+ pageOfListNodeTypes = (request = {}) => this.client.fetch({
81
+ method: "GET",
82
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`,
83
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["resource_type", request.resourceType], ["targets", request.targets])
84
+ }, unmarshalListNodeTypesResponse);
85
+ /**
86
+ * List the available compute node types for creating a Data Lab.
87
+ *
88
+ * @param request - The request {@link ListNodeTypesRequest}
89
+ * @returns A Promise of ListNodeTypesResponse
90
+ */
91
+ listNodeTypes = (request = {}) => enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request);
92
+ pageOfListNotebookVersions = (request = {}) => this.client.fetch({
93
+ method: "GET",
94
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/notebook-versions`,
95
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
96
+ }, unmarshalListNotebookVersionsResponse);
97
+ /**
98
+ * Lists available notebook versions.
99
+ *
100
+ * @param request - The request {@link ListNotebookVersionsRequest}
101
+ * @returns A Promise of ListNotebookVersionsResponse
102
+ */
103
+ listNotebookVersions = (request = {}) => enrichForPagination("notebooks", this.pageOfListNotebookVersions, request);
104
+ pageOfListClusterVersions = (request = {}) => this.client.fetch({
105
+ method: "GET",
106
+ path: `/datalab/v1beta1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-versions`,
107
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
108
+ }, unmarshalListClusterVersionsResponse);
109
+ /**
110
+ * List the Spark versions the product is compatible with.
111
+ *
112
+ * @param request - The request {@link ListClusterVersionsRequest}
113
+ * @returns A Promise of ListClusterVersionsResponse
114
+ */
115
+ listClusterVersions = (request = {}) => enrichForPagination("clusters", this.pageOfListClusterVersions, request);
175
116
  };
117
+ export { API$1 as API };
@@ -1,8 +1,7 @@
1
+ /** Lists transient statutes of the enum {@link DatalabStatus}. */
1
2
  const DATALAB_TRANSIENT_STATUSES = [
2
- "creating",
3
- "updating",
4
- "deleting"
3
+ "creating",
4
+ "updating",
5
+ "deleting"
5
6
  ];
6
- export {
7
- DATALAB_TRANSIENT_STATUSES
8
- };
7
+ export { DATALAB_TRANSIENT_STATUSES };
@@ -1,16 +1,18 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { DATALAB_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { marshalCreateDatalabRequest, marshalUpdateDatalabRequest, unmarshalDatalab, unmarshalListClusterVersionsResponse, unmarshalListDatalabsResponse, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse } from "./marshalling.gen.js";
4
- import * as validationRules_gen from "./validation-rules.gen.js";
5
- export {
6
- API,
7
- DATALAB_TRANSIENT_STATUSES,
8
- validationRules_gen as ValidationRules,
9
- marshalCreateDatalabRequest,
10
- marshalUpdateDatalabRequest,
11
- unmarshalDatalab,
12
- unmarshalListClusterVersionsResponse,
13
- unmarshalListDatalabsResponse,
14
- unmarshalListNodeTypesResponse,
15
- unmarshalListNotebookVersionsResponse
16
- };
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
+ DATALAB_TRANSIENT_STATUSES: () => DATALAB_TRANSIENT_STATUSES,
9
+ ValidationRules: () => validation_rules_gen_exports,
10
+ marshalCreateDatalabRequest: () => marshalCreateDatalabRequest,
11
+ marshalUpdateDatalabRequest: () => marshalUpdateDatalabRequest,
12
+ unmarshalDatalab: () => unmarshalDatalab,
13
+ unmarshalListClusterVersionsResponse: () => unmarshalListClusterVersionsResponse,
14
+ unmarshalListDatalabsResponse: () => unmarshalListDatalabsResponse,
15
+ unmarshalListNodeTypesResponse: () => unmarshalListNodeTypesResponse,
16
+ unmarshalListNotebookVersionsResponse: () => unmarshalListNotebookVersionsResponse
17
+ });
18
+ export { index_gen_exports };
@@ -1,220 +1,158 @@
1
- import { isJSONObject, unmarshalDate, unmarshalArrayOfObject } from "@scaleway/sdk-client";
2
- const unmarshalVolume = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- size: data.size,
10
- type: data.type
11
- };
1
+ import { isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalVolume = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);
4
+ return {
5
+ size: data.size,
6
+ type: data.type
7
+ };
12
8
  };
13
- const unmarshalDatalabSparkMain = (data) => {
14
- if (!isJSONObject(data)) {
15
- throw new TypeError(
16
- `Unmarshalling the type 'DatalabSparkMain' failed as data isn't a dictionary.`
17
- );
18
- }
19
- return {
20
- nodeType: data.node_type,
21
- rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0,
22
- sparkMasterUrl: data.spark_master_url,
23
- sparkUiUrl: data.spark_ui_url
24
- };
9
+ var unmarshalDatalabSparkMain = (data) => {
10
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatalabSparkMain' failed as data isn't a dictionary.`);
11
+ return {
12
+ nodeType: data.node_type,
13
+ rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0,
14
+ sparkMasterUrl: data.spark_master_url,
15
+ sparkUiUrl: data.spark_ui_url
16
+ };
25
17
  };
26
- const unmarshalDatalabSparkWorker = (data) => {
27
- if (!isJSONObject(data)) {
28
- throw new TypeError(
29
- `Unmarshalling the type 'DatalabSparkWorker' failed as data isn't a dictionary.`
30
- );
31
- }
32
- return {
33
- nodeCount: data.node_count,
34
- nodeType: data.node_type,
35
- rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0
36
- };
18
+ var unmarshalDatalabSparkWorker = (data) => {
19
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DatalabSparkWorker' failed as data isn't a dictionary.`);
20
+ return {
21
+ nodeCount: data.node_count,
22
+ nodeType: data.node_type,
23
+ rootVolume: data.root_volume ? unmarshalVolume(data.root_volume) : void 0
24
+ };
37
25
  };
38
26
  const unmarshalDatalab = (data) => {
39
- if (!isJSONObject(data)) {
40
- throw new TypeError(
41
- `Unmarshalling the type 'Datalab' failed as data isn't a dictionary.`
42
- );
43
- }
44
- return {
45
- createdAt: unmarshalDate(data.created_at),
46
- description: data.description,
47
- hasNotebook: data.has_notebook,
48
- id: data.id,
49
- main: data.main ? unmarshalDatalabSparkMain(data.main) : void 0,
50
- name: data.name,
51
- notebookMasterUrl: data.notebook_master_url,
52
- notebookUrl: data.notebook_url,
53
- privateNetworkId: data.private_network_id,
54
- projectId: data.project_id,
55
- region: data.region,
56
- sparkVersion: data.spark_version,
57
- status: data.status,
58
- tags: data.tags,
59
- totalStorage: data.total_storage ? unmarshalVolume(data.total_storage) : void 0,
60
- updatedAt: unmarshalDate(data.updated_at),
61
- worker: data.worker ? unmarshalDatalabSparkWorker(data.worker) : void 0
62
- };
27
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Datalab' failed as data isn't a dictionary.`);
28
+ return {
29
+ createdAt: unmarshalDate(data.created_at),
30
+ description: data.description,
31
+ hasNotebook: data.has_notebook,
32
+ id: data.id,
33
+ main: data.main ? unmarshalDatalabSparkMain(data.main) : void 0,
34
+ name: data.name,
35
+ notebookMasterUrl: data.notebook_master_url,
36
+ notebookUrl: data.notebook_url,
37
+ privateNetworkId: data.private_network_id,
38
+ projectId: data.project_id,
39
+ region: data.region,
40
+ sparkVersion: data.spark_version,
41
+ status: data.status,
42
+ tags: data.tags,
43
+ totalStorage: data.total_storage ? unmarshalVolume(data.total_storage) : void 0,
44
+ updatedAt: unmarshalDate(data.updated_at),
45
+ worker: data.worker ? unmarshalDatalabSparkWorker(data.worker) : void 0
46
+ };
63
47
  };
64
- const unmarshalClusterVersion = (data) => {
65
- if (!isJSONObject(data)) {
66
- throw new TypeError(
67
- `Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`
68
- );
69
- }
70
- return {
71
- beta: data.beta,
72
- createdAt: unmarshalDate(data.created_at),
73
- disabled: data.disabled,
74
- endOfLife: unmarshalDate(data.end_of_life),
75
- updatedAt: unmarshalDate(data.updated_at),
76
- version: data.version
77
- };
48
+ var unmarshalClusterVersion = (data) => {
49
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`);
50
+ return {
51
+ beta: data.beta,
52
+ createdAt: unmarshalDate(data.created_at),
53
+ disabled: data.disabled,
54
+ endOfLife: unmarshalDate(data.end_of_life),
55
+ updatedAt: unmarshalDate(data.updated_at),
56
+ version: data.version
57
+ };
78
58
  };
79
- const unmarshalCluster = (data) => {
80
- if (!isJSONObject(data)) {
81
- throw new TypeError(
82
- `Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`
83
- );
84
- }
85
- return {
86
- description: data.description,
87
- name: data.name,
88
- versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
89
- };
59
+ var unmarshalCluster = (data) => {
60
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);
61
+ return {
62
+ description: data.description,
63
+ name: data.name,
64
+ versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)
65
+ };
90
66
  };
91
67
  const unmarshalListClusterVersionsResponse = (data) => {
92
- if (!isJSONObject(data)) {
93
- throw new TypeError(
94
- `Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`
95
- );
96
- }
97
- return {
98
- clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
99
- totalCount: data.total_count
100
- };
68
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`);
69
+ return {
70
+ clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),
71
+ totalCount: data.total_count
72
+ };
101
73
  };
102
74
  const unmarshalListDatalabsResponse = (data) => {
103
- if (!isJSONObject(data)) {
104
- throw new TypeError(
105
- `Unmarshalling the type 'ListDatalabsResponse' failed as data isn't a dictionary.`
106
- );
107
- }
108
- return {
109
- datalabs: unmarshalArrayOfObject(data.datalabs, unmarshalDatalab),
110
- totalCount: data.total_count
111
- };
75
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatalabsResponse' failed as data isn't a dictionary.`);
76
+ return {
77
+ datalabs: unmarshalArrayOfObject(data.datalabs, unmarshalDatalab),
78
+ totalCount: data.total_count
79
+ };
112
80
  };
113
- const unmarshalNodeType = (data) => {
114
- if (!isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- beta: data.beta,
121
- createdAt: unmarshalDate(data.created_at),
122
- description: data.description,
123
- disabled: data.disabled,
124
- gpus: data.gpus,
125
- memoryGigabytes: data.memory_gigabytes,
126
- name: data.name,
127
- stockStatus: data.stock_status,
128
- targets: data.targets,
129
- updatedAt: unmarshalDate(data.updated_at),
130
- vcpus: data.vcpus,
131
- vramGigabytes: data.vram_gigabytes
132
- };
81
+ var unmarshalNodeType = (data) => {
82
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);
83
+ return {
84
+ beta: data.beta,
85
+ createdAt: unmarshalDate(data.created_at),
86
+ description: data.description,
87
+ disabled: data.disabled,
88
+ gpus: data.gpus,
89
+ memoryGigabytes: data.memory_gigabytes,
90
+ name: data.name,
91
+ stockStatus: data.stock_status,
92
+ targets: data.targets,
93
+ updatedAt: unmarshalDate(data.updated_at),
94
+ vcpus: data.vcpus,
95
+ vramGigabytes: data.vram_gigabytes
96
+ };
133
97
  };
134
98
  const unmarshalListNodeTypesResponse = (data) => {
135
- if (!isJSONObject(data)) {
136
- throw new TypeError(
137
- `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`
138
- );
139
- }
140
- return {
141
- nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
142
- totalCount: data.total_count
143
- };
99
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);
100
+ return {
101
+ nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),
102
+ totalCount: data.total_count
103
+ };
144
104
  };
145
- const unmarshalNotebookVersion = (data) => {
146
- if (!isJSONObject(data)) {
147
- throw new TypeError(
148
- `Unmarshalling the type 'NotebookVersion' failed as data isn't a dictionary.`
149
- );
150
- }
151
- return {
152
- beta: data.beta,
153
- createdAt: unmarshalDate(data.created_at),
154
- disabled: data.disabled,
155
- endOfLife: unmarshalDate(data.end_of_life),
156
- updatedAt: unmarshalDate(data.updated_at),
157
- version: data.version
158
- };
105
+ var unmarshalNotebookVersion = (data) => {
106
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'NotebookVersion' failed as data isn't a dictionary.`);
107
+ return {
108
+ beta: data.beta,
109
+ createdAt: unmarshalDate(data.created_at),
110
+ disabled: data.disabled,
111
+ endOfLife: unmarshalDate(data.end_of_life),
112
+ updatedAt: unmarshalDate(data.updated_at),
113
+ version: data.version
114
+ };
159
115
  };
160
- const unmarshalNotebook = (data) => {
161
- if (!isJSONObject(data)) {
162
- throw new TypeError(
163
- `Unmarshalling the type 'Notebook' failed as data isn't a dictionary.`
164
- );
165
- }
166
- return {
167
- description: data.description,
168
- name: data.name,
169
- versions: unmarshalArrayOfObject(data.versions, unmarshalNotebookVersion)
170
- };
116
+ var unmarshalNotebook = (data) => {
117
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Notebook' failed as data isn't a dictionary.`);
118
+ return {
119
+ description: data.description,
120
+ name: data.name,
121
+ versions: unmarshalArrayOfObject(data.versions, unmarshalNotebookVersion)
122
+ };
171
123
  };
172
124
  const unmarshalListNotebookVersionsResponse = (data) => {
173
- if (!isJSONObject(data)) {
174
- throw new TypeError(
175
- `Unmarshalling the type 'ListNotebookVersionsResponse' failed as data isn't a dictionary.`
176
- );
177
- }
178
- return {
179
- notebooks: unmarshalArrayOfObject(data.notebooks, unmarshalNotebook),
180
- totalCount: data.total_count
181
- };
125
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListNotebookVersionsResponse' failed as data isn't a dictionary.`);
126
+ return {
127
+ notebooks: unmarshalArrayOfObject(data.notebooks, unmarshalNotebook),
128
+ totalCount: data.total_count
129
+ };
182
130
  };
183
- const marshalCreateDatalabRequestSparkMain = (request, defaults) => ({
184
- node_type: request.nodeType
131
+ var marshalCreateDatalabRequestSparkMain = (request, defaults) => ({ node_type: request.nodeType });
132
+ var marshalCreateDatalabRequestSparkWorker = (request, defaults) => ({
133
+ node_count: request.nodeCount,
134
+ node_type: request.nodeType
185
135
  });
186
- const marshalCreateDatalabRequestSparkWorker = (request, defaults) => ({
187
- node_count: request.nodeCount,
188
- node_type: request.nodeType
189
- });
190
- const marshalVolume = (request, defaults) => ({
191
- size: request.size,
192
- type: request.type
136
+ var marshalVolume = (request, defaults) => ({
137
+ size: request.size,
138
+ type: request.type
193
139
  });
194
140
  const marshalCreateDatalabRequest = (request, defaults) => ({
195
- description: request.description,
196
- has_notebook: request.hasNotebook,
197
- main: request.main !== void 0 ? marshalCreateDatalabRequestSparkMain(request.main) : void 0,
198
- name: request.name,
199
- private_network_id: request.privateNetworkId,
200
- project_id: request.projectId ?? defaults.defaultProjectId,
201
- spark_version: request.sparkVersion,
202
- tags: request.tags,
203
- total_storage: request.totalStorage !== void 0 ? marshalVolume(request.totalStorage) : void 0,
204
- worker: request.worker !== void 0 ? marshalCreateDatalabRequestSparkWorker(request.worker) : void 0
141
+ description: request.description,
142
+ has_notebook: request.hasNotebook,
143
+ main: request.main !== void 0 ? marshalCreateDatalabRequestSparkMain(request.main, defaults) : void 0,
144
+ name: request.name,
145
+ private_network_id: request.privateNetworkId,
146
+ project_id: request.projectId ?? defaults.defaultProjectId,
147
+ spark_version: request.sparkVersion,
148
+ tags: request.tags,
149
+ total_storage: request.totalStorage !== void 0 ? marshalVolume(request.totalStorage, defaults) : void 0,
150
+ worker: request.worker !== void 0 ? marshalCreateDatalabRequestSparkWorker(request.worker, defaults) : void 0
205
151
  });
206
152
  const marshalUpdateDatalabRequest = (request, defaults) => ({
207
- description: request.description,
208
- name: request.name,
209
- node_count: request.nodeCount,
210
- tags: request.tags
153
+ description: request.description,
154
+ name: request.name,
155
+ node_count: request.nodeCount,
156
+ tags: request.tags
211
157
  });
212
- export {
213
- marshalCreateDatalabRequest,
214
- marshalUpdateDatalabRequest,
215
- unmarshalDatalab,
216
- unmarshalListClusterVersionsResponse,
217
- unmarshalListDatalabsResponse,
218
- unmarshalListNodeTypesResponse,
219
- unmarshalListNotebookVersionsResponse
220
- };
158
+ export { marshalCreateDatalabRequest, marshalUpdateDatalabRequest, unmarshalDatalab, unmarshalListClusterVersionsResponse, unmarshalListDatalabsResponse, unmarshalListNodeTypesResponse, unmarshalListNotebookVersionsResponse };
@@ -1,69 +1,57 @@
1
- const CreateDatalabRequest = {
2
- name: {
3
- maxLength: 100,
4
- minLength: 3,
5
- pattern: /^[A-Za-z0-9-_. ]+$/
6
- }
7
- };
8
- const CreateDatalabRequestSparkWorker = {
9
- nodeCount: {
10
- greaterThanOrEqual: 1,
11
- lessThanOrEqual: 150
12
- }
13
- };
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
+ var validation_rules_gen_exports = /* @__PURE__ */ __exportAll({
3
+ CreateDatalabRequest: () => CreateDatalabRequest,
4
+ CreateDatalabRequestSparkWorker: () => CreateDatalabRequestSparkWorker,
5
+ ListClusterVersionsRequest: () => ListClusterVersionsRequest,
6
+ ListDatalabsRequest: () => ListDatalabsRequest,
7
+ ListNodeTypesRequest: () => ListNodeTypesRequest,
8
+ ListNotebookVersionsRequest: () => ListNotebookVersionsRequest,
9
+ UpdateDatalabRequest: () => UpdateDatalabRequest
10
+ });
11
+ const CreateDatalabRequest = { name: {
12
+ maxLength: 100,
13
+ minLength: 3,
14
+ pattern: /^[A-Za-z0-9-_. ]+$/
15
+ } };
16
+ const CreateDatalabRequestSparkWorker = { nodeCount: {
17
+ greaterThanOrEqual: 1,
18
+ lessThanOrEqual: 150
19
+ } };
14
20
  const ListClusterVersionsRequest = {
15
- page: {
16
- greaterThanOrEqual: 1
17
- },
18
- pageSize: {
19
- greaterThanOrEqual: 0,
20
- lessThanOrEqual: 100
21
- }
21
+ page: { greaterThanOrEqual: 1 },
22
+ pageSize: {
23
+ greaterThanOrEqual: 0,
24
+ lessThanOrEqual: 100
25
+ }
22
26
  };
23
27
  const ListDatalabsRequest = {
24
- name: {
25
- maxLength: 100,
26
- minLength: 3,
27
- pattern: /^[A-Za-z0-9-_. ]+$/
28
- },
29
- page: {
30
- greaterThanOrEqual: 1
31
- },
32
- pageSize: {
33
- greaterThanOrEqual: 1,
34
- lessThanOrEqual: 100
35
- }
28
+ name: {
29
+ maxLength: 100,
30
+ minLength: 3,
31
+ pattern: /^[A-Za-z0-9-_. ]+$/
32
+ },
33
+ page: { greaterThanOrEqual: 1 },
34
+ pageSize: {
35
+ greaterThanOrEqual: 1,
36
+ lessThanOrEqual: 100
37
+ }
36
38
  };
37
39
  const ListNodeTypesRequest = {
38
- page: {
39
- greaterThanOrEqual: 1
40
- },
41
- pageSize: {
42
- greaterThanOrEqual: 0,
43
- lessThanOrEqual: 100
44
- }
40
+ page: { greaterThanOrEqual: 1 },
41
+ pageSize: {
42
+ greaterThanOrEqual: 0,
43
+ lessThanOrEqual: 100
44
+ }
45
45
  };
46
46
  const ListNotebookVersionsRequest = {
47
- page: {
48
- greaterThanOrEqual: 1
49
- },
50
- pageSize: {
51
- greaterThanOrEqual: 1,
52
- lessThanOrEqual: 100
53
- }
54
- };
55
- const UpdateDatalabRequest = {
56
- nodeCount: {
57
- greaterThanOrEqual: 0,
58
- lessThanOrEqual: 150
59
- }
60
- };
61
- export {
62
- CreateDatalabRequest,
63
- CreateDatalabRequestSparkWorker,
64
- ListClusterVersionsRequest,
65
- ListDatalabsRequest,
66
- ListNodeTypesRequest,
67
- ListNotebookVersionsRequest,
68
- UpdateDatalabRequest
69
- };
47
+ page: { greaterThanOrEqual: 1 },
48
+ pageSize: {
49
+ greaterThanOrEqual: 1,
50
+ lessThanOrEqual: 100
51
+ }
52
+ };
53
+ const UpdateDatalabRequest = { nodeCount: {
54
+ greaterThanOrEqual: 0,
55
+ lessThanOrEqual: 150
56
+ } };
57
+ export { validation_rules_gen_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-datalab",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Scaleway SDK datalab",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "node": ">=20.18.3"
27
27
  },
28
28
  "dependencies": {
29
- "@scaleway/random-name": "5.1.1",
30
- "@scaleway/sdk-std": "2.1.1"
29
+ "@scaleway/random-name": "5.1.2",
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",