@scaleway/sdk-qaas 1.5.0 → 2.1.1

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,426 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdkClient = require("@scaleway/sdk-client");
4
- const unmarshalJobCircuit = (data) => {
5
- if (!sdkClient.isJSONObject(data)) {
6
- throw new TypeError(
7
- `Unmarshalling the type 'JobCircuit' failed as data isn't a dictionary.`
8
- );
9
- }
10
- return {
11
- percevalCircuit: data.perceval_circuit,
12
- qiskitCircuit: data.qiskit_circuit
13
- };
14
- };
15
- const unmarshalApplication = (data) => {
16
- if (!sdkClient.isJSONObject(data)) {
17
- throw new TypeError(
18
- `Unmarshalling the type 'Application' failed as data isn't a dictionary.`
19
- );
20
- }
21
- return {
22
- compatiblePlatformIds: data.compatible_platform_ids,
23
- id: data.id,
24
- inputTemplate: data.input_template,
25
- name: data.name,
26
- type: data.type
27
- };
28
- };
29
- const unmarshalBooking = (data) => {
30
- if (!sdkClient.isJSONObject(data)) {
31
- throw new TypeError(
32
- `Unmarshalling the type 'Booking' failed as data isn't a dictionary.`
33
- );
34
- }
35
- return {
36
- createdAt: sdkClient.unmarshalDate(data.created_at),
37
- description: data.description,
38
- finishedAt: sdkClient.unmarshalDate(data.finished_at),
39
- id: data.id,
40
- progressMessage: data.progress_message,
41
- startedAt: sdkClient.unmarshalDate(data.started_at),
42
- status: data.status,
43
- timeZone: data.time_zone,
44
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
45
- };
46
- };
47
- const unmarshalJob = (data) => {
48
- if (!sdkClient.isJSONObject(data)) {
49
- throw new TypeError(
50
- `Unmarshalling the type 'Job' failed as data isn't a dictionary.`
51
- );
52
- }
53
- return {
54
- createdAt: sdkClient.unmarshalDate(data.created_at),
55
- id: data.id,
56
- jobDuration: data.job_duration,
57
- modelId: data.model_id,
58
- name: data.name,
59
- parameters: data.parameters,
60
- progressMessage: data.progress_message,
61
- resultDistribution: data.result_distribution,
62
- sessionId: data.session_id,
63
- startedAt: sdkClient.unmarshalDate(data.started_at),
64
- status: data.status,
65
- tags: data.tags,
66
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
67
- };
68
- };
69
- const unmarshalModel = (data) => {
70
- if (!sdkClient.isJSONObject(data)) {
71
- throw new TypeError(
72
- `Unmarshalling the type 'Model' failed as data isn't a dictionary.`
73
- );
74
- }
75
- return {
76
- createdAt: sdkClient.unmarshalDate(data.created_at),
77
- id: data.id,
78
- projectId: data.project_id,
79
- url: data.url
80
- };
81
- };
82
- const unmarshalPlatformBookingRequirement = (data) => {
83
- if (!sdkClient.isJSONObject(data)) {
84
- throw new TypeError(
85
- `Unmarshalling the type 'PlatformBookingRequirement' failed as data isn't a dictionary.`
86
- );
87
- }
88
- return {
89
- maxBookingPerDay: data.max_booking_per_day,
90
- maxBookingPerWeek: data.max_booking_per_week,
91
- maxCancellationDuration: data.max_cancellation_duration,
92
- maxDuration: data.max_duration,
93
- maxPlanificationDuration: data.max_planification_duration,
94
- minDuration: data.min_duration,
95
- minPlanificationDuration: data.min_planification_duration
96
- };
97
- };
98
- const unmarshalPlatformHardware = (data) => {
99
- if (!sdkClient.isJSONObject(data)) {
100
- throw new TypeError(
101
- `Unmarshalling the type 'PlatformHardware' failed as data isn't a dictionary.`
102
- );
103
- }
104
- return {
105
- gpus: data.gpus,
106
- gpusNetwork: data.gpus_network,
107
- name: data.name,
108
- ram: data.ram,
109
- vcpus: data.vcpus,
110
- vram: data.vram
111
- };
112
- };
113
- const unmarshalPlatform = (data) => {
114
- if (!sdkClient.isJSONObject(data)) {
115
- throw new TypeError(
116
- `Unmarshalling the type 'Platform' failed as data isn't a dictionary.`
117
- );
118
- }
119
- return {
120
- availability: data.availability,
121
- backendName: data.backend_name,
122
- bookingRequirement: data.booking_requirement ? unmarshalPlatformBookingRequirement(data.booking_requirement) : void 0,
123
- description: data.description,
124
- documentationUrl: data.documentation_url,
125
- hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : void 0,
126
- id: data.id,
127
- isBookable: data.is_bookable,
128
- maxCircuitCount: data.max_circuit_count,
129
- maxQubitCount: data.max_qubit_count,
130
- maxShotCount: data.max_shot_count,
131
- metadata: data.metadata,
132
- name: data.name,
133
- pricePerCircuit: data.price_per_circuit ? sdkClient.unmarshalMoney(data.price_per_circuit) : void 0,
134
- pricePerHour: data.price_per_hour ? sdkClient.unmarshalMoney(data.price_per_hour) : void 0,
135
- pricePerShot: data.price_per_shot ? sdkClient.unmarshalMoney(data.price_per_shot) : void 0,
136
- providerName: data.provider_name,
137
- technology: data.technology,
138
- type: data.type,
139
- version: data.version
140
- };
141
- };
142
- const unmarshalProcess = (data) => {
143
- if (!sdkClient.isJSONObject(data)) {
144
- throw new TypeError(
145
- `Unmarshalling the type 'Process' failed as data isn't a dictionary.`
146
- );
147
- }
148
- return {
149
- applicationId: data.application_id,
150
- attachedSessionIds: data.attached_session_ids,
151
- createdAt: sdkClient.unmarshalDate(data.created_at),
152
- finishedAt: sdkClient.unmarshalDate(data.finished_at),
153
- id: data.id,
154
- input: data.input,
155
- name: data.name,
156
- platformId: data.platform_id,
157
- progress: data.progress,
158
- progressMessage: data.progress_message,
159
- projectId: data.project_id,
160
- startedAt: sdkClient.unmarshalDate(data.started_at),
161
- status: data.status,
162
- tags: data.tags,
163
- updatedAt: sdkClient.unmarshalDate(data.updated_at)
164
- };
165
- };
166
- const unmarshalSession = (data) => {
167
- if (!sdkClient.isJSONObject(data)) {
168
- throw new TypeError(
169
- `Unmarshalling the type 'Session' failed as data isn't a dictionary.`
170
- );
171
- }
172
- return {
173
- bookingId: data.booking_id,
174
- createdAt: sdkClient.unmarshalDate(data.created_at),
175
- deduplicationId: data.deduplication_id,
176
- finishedJobCount: data.finished_job_count,
177
- id: data.id,
178
- maxDuration: data.max_duration,
179
- maxIdleDuration: data.max_idle_duration,
180
- modelId: data.model_id,
181
- name: data.name,
182
- originId: data.origin_id,
183
- originType: data.origin_type,
184
- parameters: data.parameters,
185
- platformId: data.platform_id,
186
- progressMessage: data.progress_message,
187
- projectId: data.project_id,
188
- startedAt: sdkClient.unmarshalDate(data.started_at),
189
- status: data.status,
190
- tags: data.tags,
191
- terminatedAt: sdkClient.unmarshalDate(data.terminated_at),
192
- updatedAt: sdkClient.unmarshalDate(data.updated_at),
193
- waitingJobCount: data.waiting_job_count
194
- };
195
- };
196
- const unmarshalListApplicationsResponse = (data) => {
197
- if (!sdkClient.isJSONObject(data)) {
198
- throw new TypeError(
199
- `Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`
200
- );
201
- }
202
- return {
203
- applications: sdkClient.unmarshalArrayOfObject(
204
- data.applications,
205
- unmarshalApplication
206
- ),
207
- totalCount: data.total_count
208
- };
209
- };
210
- const unmarshalListBookingsResponse = (data) => {
211
- if (!sdkClient.isJSONObject(data)) {
212
- throw new TypeError(
213
- `Unmarshalling the type 'ListBookingsResponse' failed as data isn't a dictionary.`
214
- );
215
- }
216
- return {
217
- bookings: sdkClient.unmarshalArrayOfObject(data.bookings, unmarshalBooking),
218
- totalCount: data.total_count
219
- };
220
- };
221
- const unmarshalJobResult = (data) => {
222
- if (!sdkClient.isJSONObject(data)) {
223
- throw new TypeError(
224
- `Unmarshalling the type 'JobResult' failed as data isn't a dictionary.`
225
- );
226
- }
227
- return {
228
- createdAt: sdkClient.unmarshalDate(data.created_at),
229
- jobId: data.job_id,
230
- result: data.result,
231
- url: data.url
232
- };
233
- };
234
- const unmarshalListJobResultsResponse = (data) => {
235
- if (!sdkClient.isJSONObject(data)) {
236
- throw new TypeError(
237
- `Unmarshalling the type 'ListJobResultsResponse' failed as data isn't a dictionary.`
238
- );
239
- }
240
- return {
241
- jobResults: sdkClient.unmarshalArrayOfObject(data.job_results, unmarshalJobResult),
242
- totalCount: data.total_count
243
- };
244
- };
245
- const unmarshalListJobsResponse = (data) => {
246
- if (!sdkClient.isJSONObject(data)) {
247
- throw new TypeError(
248
- `Unmarshalling the type 'ListJobsResponse' failed as data isn't a dictionary.`
249
- );
250
- }
251
- return {
252
- jobs: sdkClient.unmarshalArrayOfObject(data.jobs, unmarshalJob),
253
- totalCount: data.total_count
254
- };
255
- };
256
- const unmarshalListModelsResponse = (data) => {
257
- if (!sdkClient.isJSONObject(data)) {
258
- throw new TypeError(
259
- `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
260
- );
261
- }
262
- return {
263
- models: sdkClient.unmarshalArrayOfObject(data.models, unmarshalModel),
264
- totalCount: data.total_count
265
- };
266
- };
267
- const unmarshalListPlatformsResponse = (data) => {
268
- if (!sdkClient.isJSONObject(data)) {
269
- throw new TypeError(
270
- `Unmarshalling the type 'ListPlatformsResponse' failed as data isn't a dictionary.`
271
- );
272
- }
273
- return {
274
- platforms: sdkClient.unmarshalArrayOfObject(data.platforms, unmarshalPlatform),
275
- totalCount: data.total_count
276
- };
277
- };
278
- const unmarshalProcessResult = (data) => {
279
- if (!sdkClient.isJSONObject(data)) {
280
- throw new TypeError(
281
- `Unmarshalling the type 'ProcessResult' failed as data isn't a dictionary.`
282
- );
283
- }
284
- return {
285
- createdAt: sdkClient.unmarshalDate(data.created_at),
286
- processId: data.process_id,
287
- result: data.result
288
- };
289
- };
290
- const unmarshalListProcessResultsResponse = (data) => {
291
- if (!sdkClient.isJSONObject(data)) {
292
- throw new TypeError(
293
- `Unmarshalling the type 'ListProcessResultsResponse' failed as data isn't a dictionary.`
294
- );
295
- }
296
- return {
297
- processResults: sdkClient.unmarshalArrayOfObject(
298
- data.process_results,
299
- unmarshalProcessResult
300
- ),
301
- totalCount: data.total_count
302
- };
303
- };
304
- const unmarshalListProcessesResponse = (data) => {
305
- if (!sdkClient.isJSONObject(data)) {
306
- throw new TypeError(
307
- `Unmarshalling the type 'ListProcessesResponse' failed as data isn't a dictionary.`
308
- );
309
- }
310
- return {
311
- processes: sdkClient.unmarshalArrayOfObject(data.processes, unmarshalProcess),
312
- totalCount: data.total_count
313
- };
314
- };
315
- const unmarshalListSessionACLsResponse = (data) => {
316
- if (!sdkClient.isJSONObject(data)) {
317
- throw new TypeError(
318
- `Unmarshalling the type 'ListSessionACLsResponse' failed as data isn't a dictionary.`
319
- );
320
- }
321
- return {
322
- acls: data.acls,
323
- totalCount: data.total_count
324
- };
325
- };
326
- const unmarshalListSessionsResponse = (data) => {
327
- if (!sdkClient.isJSONObject(data)) {
328
- throw new TypeError(
329
- `Unmarshalling the type 'ListSessionsResponse' failed as data isn't a dictionary.`
330
- );
331
- }
332
- return {
333
- sessions: sdkClient.unmarshalArrayOfObject(data.sessions, unmarshalSession),
334
- totalCount: data.total_count
335
- };
336
- };
337
- const marshalJobCircuit = (request, defaults) => ({
338
- ...sdkClient.resolveOneOf([
339
- { param: "perceval_circuit", value: request.percevalCircuit },
340
- { param: "qiskit_circuit", value: request.qiskitCircuit }
341
- ])
342
- });
343
- const marshalCreateJobRequest = (request, defaults) => ({
344
- circuit: marshalJobCircuit(request.circuit),
345
- max_duration: request.maxDuration,
346
- model_id: request.modelId,
347
- name: request.name,
348
- parameters: request.parameters,
349
- session_id: request.sessionId,
350
- tags: request.tags
351
- });
352
- const marshalCreateModelRequest = (request, defaults) => ({
353
- payload: request.payload,
354
- project_id: request.projectId ?? defaults.defaultProjectId
355
- });
356
- const marshalCreateProcessRequest = (request, defaults) => ({
357
- application_id: request.applicationId,
358
- input: request.input,
359
- name: request.name,
360
- platform_id: request.platformId,
361
- project_id: request.projectId ?? defaults.defaultProjectId,
362
- tags: request.tags
363
- });
364
- const marshalCreateSessionRequestBookingDemand = (request, defaults) => ({
365
- description: request.description,
366
- finished_at: request.finishedAt,
367
- started_at: request.startedAt,
368
- time_zone: request.timeZone
369
- });
370
- const marshalCreateSessionRequest = (request, defaults) => ({
371
- booking_demand: request.bookingDemand !== void 0 ? marshalCreateSessionRequestBookingDemand(
372
- request.bookingDemand
373
- ) : void 0,
374
- deduplication_id: request.deduplicationId,
375
- max_duration: request.maxDuration,
376
- max_idle_duration: request.maxIdleDuration,
377
- model_id: request.modelId,
378
- name: request.name,
379
- parameters: request.parameters,
380
- platform_id: request.platformId,
381
- project_id: request.projectId ?? defaults.defaultProjectId,
382
- tags: request.tags
383
- });
384
- const marshalUpdateBookingRequest = (request, defaults) => ({
385
- description: request.description
386
- });
387
- const marshalUpdateJobRequest = (request, defaults) => ({
388
- name: request.name,
389
- tags: request.tags
390
- });
391
- const marshalUpdateProcessRequest = (request, defaults) => ({
392
- name: request.name,
393
- tags: request.tags
394
- });
395
- const marshalUpdateSessionRequest = (request, defaults) => ({
396
- max_duration: request.maxDuration,
397
- max_idle_duration: request.maxIdleDuration,
398
- name: request.name,
399
- tags: request.tags
400
- });
401
- exports.marshalCreateJobRequest = marshalCreateJobRequest;
402
- exports.marshalCreateModelRequest = marshalCreateModelRequest;
403
- exports.marshalCreateProcessRequest = marshalCreateProcessRequest;
404
- exports.marshalCreateSessionRequest = marshalCreateSessionRequest;
405
- exports.marshalUpdateBookingRequest = marshalUpdateBookingRequest;
406
- exports.marshalUpdateJobRequest = marshalUpdateJobRequest;
407
- exports.marshalUpdateProcessRequest = marshalUpdateProcessRequest;
408
- exports.marshalUpdateSessionRequest = marshalUpdateSessionRequest;
409
- exports.unmarshalApplication = unmarshalApplication;
410
- exports.unmarshalBooking = unmarshalBooking;
411
- exports.unmarshalJob = unmarshalJob;
412
- exports.unmarshalJobCircuit = unmarshalJobCircuit;
413
- exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;
414
- exports.unmarshalListBookingsResponse = unmarshalListBookingsResponse;
415
- exports.unmarshalListJobResultsResponse = unmarshalListJobResultsResponse;
416
- exports.unmarshalListJobsResponse = unmarshalListJobsResponse;
417
- exports.unmarshalListModelsResponse = unmarshalListModelsResponse;
418
- exports.unmarshalListPlatformsResponse = unmarshalListPlatformsResponse;
419
- exports.unmarshalListProcessResultsResponse = unmarshalListProcessResultsResponse;
420
- exports.unmarshalListProcessesResponse = unmarshalListProcessesResponse;
421
- exports.unmarshalListSessionACLsResponse = unmarshalListSessionACLsResponse;
422
- exports.unmarshalListSessionsResponse = unmarshalListSessionsResponse;
423
- exports.unmarshalModel = unmarshalModel;
424
- exports.unmarshalPlatform = unmarshalPlatform;
425
- exports.unmarshalProcess = unmarshalProcess;
426
- exports.unmarshalSession = unmarshalSession;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const CreateJobRequest = {
4
- name: {
5
- minLength: 1
6
- }
7
- };
8
- const CreateProcessRequest = {
9
- name: {
10
- minLength: 1
11
- }
12
- };
13
- exports.CreateJobRequest = CreateJobRequest;
14
- exports.CreateProcessRequest = CreateProcessRequest;