@scaleway/sdk-datawarehouse 2.4.0 → 2.5.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.
@@ -1,13 +1,12 @@
1
+ /** Lists transient statutes of the enum {@link DeploymentStatus}. */
1
2
  const DEPLOYMENT_TRANSIENT_STATUSES = [
2
- "creating",
3
- "configuring",
4
- "deleting",
5
- "locking",
6
- "unlocking",
7
- "deploying",
8
- "stopping",
9
- "starting"
3
+ "creating",
4
+ "configuring",
5
+ "deleting",
6
+ "locking",
7
+ "unlocking",
8
+ "deploying",
9
+ "stopping",
10
+ "starting"
10
11
  ];
11
- export {
12
- DEPLOYMENT_TRANSIENT_STATUSES
13
- };
12
+ export { DEPLOYMENT_TRANSIENT_STATUSES };
@@ -1,24 +1,26 @@
1
- import { API } from "./api.gen.js";
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { DEPLOYMENT_TRANSIENT_STATUSES } from "./content.gen.js";
3
3
  import { marshalCreateDatabaseRequest, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, unmarshalDatabase, unmarshalDeployment, unmarshalEndpoint, unmarshalListDatabasesResponse, unmarshalListDeploymentsResponse, unmarshalListPresetsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser } from "./marshalling.gen.js";
4
- import * as validationRules_gen from "./validation-rules.gen.js";
5
- export {
6
- API,
7
- DEPLOYMENT_TRANSIENT_STATUSES,
8
- validationRules_gen as ValidationRules,
9
- marshalCreateDatabaseRequest,
10
- marshalCreateDeploymentRequest,
11
- marshalCreateEndpointRequest,
12
- marshalCreateUserRequest,
13
- marshalUpdateDeploymentRequest,
14
- marshalUpdateUserRequest,
15
- unmarshalDatabase,
16
- unmarshalDeployment,
17
- unmarshalEndpoint,
18
- unmarshalListDatabasesResponse,
19
- unmarshalListDeploymentsResponse,
20
- unmarshalListPresetsResponse,
21
- unmarshalListUsersResponse,
22
- unmarshalListVersionsResponse,
23
- unmarshalUser
24
- };
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
+ DEPLOYMENT_TRANSIENT_STATUSES: () => DEPLOYMENT_TRANSIENT_STATUSES,
9
+ ValidationRules: () => validation_rules_gen_exports,
10
+ marshalCreateDatabaseRequest: () => marshalCreateDatabaseRequest,
11
+ marshalCreateDeploymentRequest: () => marshalCreateDeploymentRequest,
12
+ marshalCreateEndpointRequest: () => marshalCreateEndpointRequest,
13
+ marshalCreateUserRequest: () => marshalCreateUserRequest,
14
+ marshalUpdateDeploymentRequest: () => marshalUpdateDeploymentRequest,
15
+ marshalUpdateUserRequest: () => marshalUpdateUserRequest,
16
+ unmarshalDatabase: () => unmarshalDatabase,
17
+ unmarshalDeployment: () => unmarshalDeployment,
18
+ unmarshalEndpoint: () => unmarshalEndpoint,
19
+ unmarshalListDatabasesResponse: () => unmarshalListDatabasesResponse,
20
+ unmarshalListDeploymentsResponse: () => unmarshalListDeploymentsResponse,
21
+ unmarshalListPresetsResponse: () => unmarshalListPresetsResponse,
22
+ unmarshalListUsersResponse: () => unmarshalListUsersResponse,
23
+ unmarshalListVersionsResponse: () => unmarshalListVersionsResponse,
24
+ unmarshalUser: () => unmarshalUser
25
+ });
26
+ export { index_gen_exports };
@@ -1,242 +1,159 @@
1
- import { resolveOneOf, isJSONObject, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
- const unmarshalEndpointPrivateNetworkDetails = (data) => {
3
- if (!isJSONObject(data)) {
4
- throw new TypeError(
5
- `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`
6
- );
7
- }
8
- return {
9
- privateNetworkId: data.private_network_id
10
- };
1
+ import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
2
+ var unmarshalEndpointPrivateNetworkDetails = (data) => {
3
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);
4
+ return { privateNetworkId: data.private_network_id };
11
5
  };
12
- const unmarshalEndpointPublicDetails = (data) => {
13
- if (!isJSONObject(data)) {
14
- throw new TypeError(
15
- `Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`
16
- );
17
- }
18
- return {};
6
+ var unmarshalEndpointPublicDetails = (data) => {
7
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`);
8
+ return {};
19
9
  };
20
- const unmarshalEndpointService = (data) => {
21
- if (!isJSONObject(data)) {
22
- throw new TypeError(
23
- `Unmarshalling the type 'EndpointService' failed as data isn't a dictionary.`
24
- );
25
- }
26
- return {
27
- port: data.port,
28
- protocol: data.protocol
29
- };
10
+ var unmarshalEndpointService = (data) => {
11
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EndpointService' failed as data isn't a dictionary.`);
12
+ return {
13
+ port: data.port,
14
+ protocol: data.protocol
15
+ };
30
16
  };
31
17
  const unmarshalEndpoint = (data) => {
32
- if (!isJSONObject(data)) {
33
- throw new TypeError(
34
- `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`
35
- );
36
- }
37
- return {
38
- dnsRecord: data.dns_record,
39
- id: data.id,
40
- privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
41
- public: data.public ? unmarshalEndpointPublicDetails(data.public) : void 0,
42
- services: unmarshalArrayOfObject(data.services, unmarshalEndpointService)
43
- };
18
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);
19
+ return {
20
+ dnsRecord: data.dns_record,
21
+ id: data.id,
22
+ privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,
23
+ public: data.public ? unmarshalEndpointPublicDetails(data.public) : void 0,
24
+ services: unmarshalArrayOfObject(data.services, unmarshalEndpointService)
25
+ };
44
26
  };
45
27
  const unmarshalDatabase = (data) => {
46
- if (!isJSONObject(data)) {
47
- throw new TypeError(
48
- `Unmarshalling the type 'Database' failed as data isn't a dictionary.`
49
- );
50
- }
51
- return {
52
- name: data.name,
53
- size: data.size
54
- };
28
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);
29
+ return {
30
+ name: data.name,
31
+ size: data.size
32
+ };
55
33
  };
56
34
  const unmarshalDeployment = (data) => {
57
- if (!isJSONObject(data)) {
58
- throw new TypeError(
59
- `Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`
60
- );
61
- }
62
- return {
63
- cpuMax: data.cpu_max,
64
- cpuMin: data.cpu_min,
65
- createdAt: unmarshalDate(data.created_at),
66
- endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
67
- id: data.id,
68
- name: data.name,
69
- organizationId: data.organization_id,
70
- projectId: data.project_id,
71
- ramPerCpu: data.ram_per_cpu,
72
- region: data.region,
73
- replicaCount: data.replica_count,
74
- shardCount: data.shard_count,
75
- status: data.status,
76
- tags: data.tags,
77
- updatedAt: unmarshalDate(data.updated_at),
78
- version: data.version
79
- };
35
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`);
36
+ return {
37
+ cpuMax: data.cpu_max,
38
+ cpuMin: data.cpu_min,
39
+ createdAt: unmarshalDate(data.created_at),
40
+ endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
41
+ id: data.id,
42
+ name: data.name,
43
+ organizationId: data.organization_id,
44
+ projectId: data.project_id,
45
+ ramPerCpu: data.ram_per_cpu,
46
+ region: data.region,
47
+ replicaCount: data.replica_count,
48
+ shardCount: data.shard_count,
49
+ status: data.status,
50
+ tags: data.tags,
51
+ updatedAt: unmarshalDate(data.updated_at),
52
+ version: data.version
53
+ };
80
54
  };
81
55
  const unmarshalUser = (data) => {
82
- if (!isJSONObject(data)) {
83
- throw new TypeError(
84
- `Unmarshalling the type 'User' failed as data isn't a dictionary.`
85
- );
86
- }
87
- return {
88
- isAdmin: data.is_admin,
89
- name: data.name
90
- };
56
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);
57
+ return {
58
+ isAdmin: data.is_admin,
59
+ name: data.name
60
+ };
91
61
  };
92
62
  const unmarshalListDatabasesResponse = (data) => {
93
- if (!isJSONObject(data)) {
94
- throw new TypeError(
95
- `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`
96
- );
97
- }
98
- return {
99
- databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
100
- totalCount: data.total_count
101
- };
63
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);
64
+ return {
65
+ databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),
66
+ totalCount: data.total_count
67
+ };
102
68
  };
103
69
  const unmarshalListDeploymentsResponse = (data) => {
104
- if (!isJSONObject(data)) {
105
- throw new TypeError(
106
- `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`
107
- );
108
- }
109
- return {
110
- deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
111
- totalCount: data.total_count
112
- };
70
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`);
71
+ return {
72
+ deployments: unmarshalArrayOfObject(data.deployments, unmarshalDeployment),
73
+ totalCount: data.total_count
74
+ };
113
75
  };
114
- const unmarshalPreset = (data) => {
115
- if (!isJSONObject(data)) {
116
- throw new TypeError(
117
- `Unmarshalling the type 'Preset' failed as data isn't a dictionary.`
118
- );
119
- }
120
- return {
121
- category: data.category,
122
- cpuMax: data.cpu_max,
123
- cpuMin: data.cpu_min,
124
- name: data.name,
125
- ramPerCpu: data.ram_per_cpu,
126
- replicaCount: data.replica_count,
127
- shardCount: data.shard_count
128
- };
76
+ var unmarshalPreset = (data) => {
77
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Preset' failed as data isn't a dictionary.`);
78
+ return {
79
+ category: data.category,
80
+ cpuMax: data.cpu_max,
81
+ cpuMin: data.cpu_min,
82
+ name: data.name,
83
+ ramPerCpu: data.ram_per_cpu,
84
+ replicaCount: data.replica_count,
85
+ shardCount: data.shard_count
86
+ };
129
87
  };
130
88
  const unmarshalListPresetsResponse = (data) => {
131
- if (!isJSONObject(data)) {
132
- throw new TypeError(
133
- `Unmarshalling the type 'ListPresetsResponse' failed as data isn't a dictionary.`
134
- );
135
- }
136
- return {
137
- presets: unmarshalArrayOfObject(data.presets, unmarshalPreset),
138
- totalCount: data.total_count
139
- };
89
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListPresetsResponse' failed as data isn't a dictionary.`);
90
+ return {
91
+ presets: unmarshalArrayOfObject(data.presets, unmarshalPreset),
92
+ totalCount: data.total_count
93
+ };
140
94
  };
141
95
  const unmarshalListUsersResponse = (data) => {
142
- if (!isJSONObject(data)) {
143
- throw new TypeError(
144
- `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`
145
- );
146
- }
147
- return {
148
- totalCount: data.total_count,
149
- users: unmarshalArrayOfObject(data.users, unmarshalUser)
150
- };
96
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);
97
+ return {
98
+ totalCount: data.total_count,
99
+ users: unmarshalArrayOfObject(data.users, unmarshalUser)
100
+ };
151
101
  };
152
- const unmarshalVersion = (data) => {
153
- if (!isJSONObject(data)) {
154
- throw new TypeError(
155
- `Unmarshalling the type 'Version' failed as data isn't a dictionary.`
156
- );
157
- }
158
- return {
159
- endOfLifeAt: unmarshalDate(data.end_of_life_at),
160
- version: data.version
161
- };
102
+ var unmarshalVersion = (data) => {
103
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);
104
+ return {
105
+ endOfLifeAt: unmarshalDate(data.end_of_life_at),
106
+ version: data.version
107
+ };
162
108
  };
163
109
  const unmarshalListVersionsResponse = (data) => {
164
- if (!isJSONObject(data)) {
165
- throw new TypeError(
166
- `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`
167
- );
168
- }
169
- return {
170
- totalCount: data.total_count,
171
- versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
172
- };
110
+ if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);
111
+ return {
112
+ totalCount: data.total_count,
113
+ versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)
114
+ };
173
115
  };
174
- const marshalCreateDatabaseRequest = (request, defaults) => ({
175
- name: request.name
176
- });
177
- const marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({
178
- private_network_id: request.privateNetworkId
179
- });
180
- const marshalEndpointSpecPublicDetails = (request, defaults) => ({});
181
- const marshalEndpointSpec = (request, defaults) => ({
182
- ...resolveOneOf([
183
- {
184
- param: "public",
185
- value: request.public !== void 0 ? marshalEndpointSpecPublicDetails(request.public) : void 0
186
- },
187
- {
188
- param: "private_network",
189
- value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork) : void 0
190
- }
191
- ])
192
- });
116
+ const marshalCreateDatabaseRequest = (request, defaults) => ({ name: request.name });
117
+ var marshalEndpointSpecPrivateNetworkDetails = (request, defaults) => ({ private_network_id: request.privateNetworkId });
118
+ var marshalEndpointSpecPublicDetails = (request, defaults) => ({});
119
+ var marshalEndpointSpec = (request, defaults) => ({ ...resolveOneOf([{
120
+ param: "public",
121
+ value: request.public !== void 0 ? marshalEndpointSpecPublicDetails(request.public, defaults) : void 0
122
+ }, {
123
+ param: "private_network",
124
+ value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) : void 0
125
+ }]) });
193
126
  const marshalCreateDeploymentRequest = (request, defaults) => ({
194
- cpu_max: request.cpuMax,
195
- cpu_min: request.cpuMin,
196
- endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,
197
- name: request.name,
198
- password: request.password,
199
- project_id: request.projectId ?? defaults.defaultProjectId,
200
- ram_per_cpu: request.ramPerCpu,
201
- replica_count: request.replicaCount,
202
- shard_count: request.shardCount,
203
- tags: request.tags,
204
- version: request.version
127
+ cpu_max: request.cpuMax,
128
+ cpu_min: request.cpuMin,
129
+ endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt, defaults)) : void 0,
130
+ name: request.name,
131
+ password: request.password,
132
+ project_id: request.projectId ?? defaults.defaultProjectId,
133
+ ram_per_cpu: request.ramPerCpu,
134
+ replica_count: request.replicaCount,
135
+ shard_count: request.shardCount,
136
+ tags: request.tags,
137
+ version: request.version
205
138
  });
206
139
  const marshalCreateEndpointRequest = (request, defaults) => ({
207
- deployment_id: request.deploymentId,
208
- endpoint: request.endpoint !== void 0 ? marshalEndpointSpec(request.endpoint) : void 0
140
+ deployment_id: request.deploymentId,
141
+ endpoint: request.endpoint !== void 0 ? marshalEndpointSpec(request.endpoint, defaults) : void 0
209
142
  });
210
143
  const marshalCreateUserRequest = (request, defaults) => ({
211
- is_admin: request.isAdmin,
212
- name: request.name,
213
- password: request.password
144
+ is_admin: request.isAdmin,
145
+ name: request.name,
146
+ password: request.password
214
147
  });
215
148
  const marshalUpdateDeploymentRequest = (request, defaults) => ({
216
- cpu_max: request.cpuMax,
217
- cpu_min: request.cpuMin,
218
- name: request.name,
219
- replica_count: request.replicaCount,
220
- tags: request.tags
149
+ cpu_max: request.cpuMax,
150
+ cpu_min: request.cpuMin,
151
+ name: request.name,
152
+ replica_count: request.replicaCount,
153
+ tags: request.tags
221
154
  });
222
155
  const marshalUpdateUserRequest = (request, defaults) => ({
223
- is_admin: request.isAdmin,
224
- password: request.password
156
+ is_admin: request.isAdmin,
157
+ password: request.password
225
158
  });
226
- export {
227
- marshalCreateDatabaseRequest,
228
- marshalCreateDeploymentRequest,
229
- marshalCreateEndpointRequest,
230
- marshalCreateUserRequest,
231
- marshalUpdateDeploymentRequest,
232
- marshalUpdateUserRequest,
233
- unmarshalDatabase,
234
- unmarshalDeployment,
235
- unmarshalEndpoint,
236
- unmarshalListDatabasesResponse,
237
- unmarshalListDeploymentsResponse,
238
- unmarshalListPresetsResponse,
239
- unmarshalListUsersResponse,
240
- unmarshalListVersionsResponse,
241
- unmarshalUser
242
- };
159
+ export { marshalCreateDatabaseRequest, marshalCreateDeploymentRequest, marshalCreateEndpointRequest, marshalCreateUserRequest, marshalUpdateDeploymentRequest, marshalUpdateUserRequest, unmarshalDatabase, unmarshalDeployment, unmarshalEndpoint, unmarshalListDatabasesResponse, unmarshalListDeploymentsResponse, unmarshalListPresetsResponse, unmarshalListUsersResponse, unmarshalListVersionsResponse, unmarshalUser };