@scaleway/sdk-qaas 2.2.1 → 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.
@@ -1,593 +1,404 @@
1
- import { API as API$1, validatePathParam, waitForResource, urlParams, resolveOneOf, enrichForPagination } from "@scaleway/sdk-client";
2
- import { JOB_TRANSIENT_STATUSES, SESSION_TRANSIENT_STATUSES, PROCESS_TRANSIENT_STATUSES, BOOKING_TRANSIENT_STATUSES } from "./content.gen.js";
3
- import { unmarshalJob, unmarshalListJobsResponse, unmarshalListJobResultsResponse, marshalCreateJobRequest, marshalUpdateJobRequest, unmarshalJobCircuit, unmarshalPlatform, unmarshalListPlatformsResponse, unmarshalSession, unmarshalListSessionsResponse, marshalCreateSessionRequest, marshalUpdateSessionRequest, unmarshalListSessionACLsResponse, marshalCreateProcessRequest, unmarshalProcess, unmarshalListProcessesResponse, marshalUpdateProcessRequest, unmarshalListProcessResultsResponse, unmarshalApplication, unmarshalListApplicationsResponse, unmarshalBooking, unmarshalListBookingsResponse, marshalUpdateBookingRequest, marshalCreateModelRequest, unmarshalModel, unmarshalListModelsResponse } from "./marshalling.gen.js";
4
- const jsonContentHeaders = {
5
- "Content-Type": "application/json; charset=utf-8"
6
- };
7
- class API extends API$1 {
8
- /**
9
- * Get job information. Retrieve information about the provided **job ID**, mainly used to get the current status.
10
- *
11
- * @param request - The request {@link GetJobRequest}
12
- * @returns A Promise of Job
13
- */
14
- getJob = (request) => this.client.fetch(
15
- {
16
- method: "GET",
17
- path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}`
18
- },
19
- unmarshalJob
20
- );
21
- /**
22
- * Waits for {@link Job} to be in a final state.
23
- *
24
- * @param request - The request {@link GetJobRequest}
25
- * @param options - The waiting options
26
- * @returns A Promise of Job
27
- */
28
- waitForJob = (request, options) => waitForResource(
29
- options?.stop ?? ((res) => Promise.resolve(!JOB_TRANSIENT_STATUSES.includes(res.status))),
30
- this.getJob,
31
- request,
32
- options
33
- );
34
- pageOfListJobs = (request = {}) => this.client.fetch(
35
- {
36
- method: "GET",
37
- path: `/qaas/v1alpha1/jobs`,
38
- urlParams: urlParams(
39
- ["order_by", request.orderBy],
40
- ["page", request.page],
41
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
42
- ["tags", request.tags],
43
- ...Object.entries(resolveOneOf([
44
- {
45
- param: "session_id",
46
- value: request.sessionId
47
- },
48
- {
49
- default: this.client.settings.defaultProjectId,
50
- param: "project_id",
51
- value: request.projectId
52
- }
53
- ]))
54
- )
55
- },
56
- unmarshalListJobsResponse
57
- );
58
- /**
59
- * List all jobs within a project or session. Retrieve information about all jobs within a given session.
60
- *
61
- * @param request - The request {@link ListJobsRequest}
62
- * @returns A Promise of ListJobsResponse
63
- */
64
- listJobs = (request = {}) => enrichForPagination("jobs", this.pageOfListJobs, request);
65
- pageOfListJobResults = (request) => this.client.fetch(
66
- {
67
- method: "GET",
68
- path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}/results`,
69
- urlParams: urlParams(
70
- ["order_by", request.orderBy],
71
- ["page", request.page],
72
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
73
- )
74
- },
75
- unmarshalListJobResultsResponse
76
- );
77
- /**
78
- * List all results of a job. Retrieve all intermediate and final results of a job.
79
- *
80
- * @param request - The request {@link ListJobResultsRequest}
81
- * @returns A Promise of ListJobResultsResponse
82
- */
83
- listJobResults = (request) => enrichForPagination("jobResults", this.pageOfListJobResults, request);
84
- /**
85
- * Create a job. Create a job to be executed inside a QPU session.
86
- *
87
- * @param request - The request {@link CreateJobRequest}
88
- * @returns A Promise of Job
89
- */
90
- createJob = (request) => this.client.fetch(
91
- {
92
- body: JSON.stringify(
93
- marshalCreateJobRequest(request, this.client.settings)
94
- ),
95
- headers: jsonContentHeaders,
96
- method: "POST",
97
- path: `/qaas/v1alpha1/jobs`
98
- },
99
- unmarshalJob
100
- );
101
- /**
102
- * Update job information. Update job information about the provided **job ID**.
103
- *
104
- * @param request - The request {@link UpdateJobRequest}
105
- * @returns A Promise of Job
106
- */
107
- updateJob = (request) => this.client.fetch(
108
- {
109
- body: JSON.stringify(
110
- marshalUpdateJobRequest(request, this.client.settings)
111
- ),
112
- headers: jsonContentHeaders,
113
- method: "PATCH",
114
- path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}`
115
- },
116
- unmarshalJob
117
- );
118
- /**
119
- * Cancel a job. Cancel the job corresponding to the provided **job ID**.
120
- *
121
- * @param request - The request {@link CancelJobRequest}
122
- * @returns A Promise of Job
123
- */
124
- cancelJob = (request) => this.client.fetch(
125
- {
126
- body: "{}",
127
- headers: jsonContentHeaders,
128
- method: "POST",
129
- path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}/cancel`
130
- },
131
- unmarshalJob
132
- );
133
- /**
134
- * Delete a job. Delete the job corresponding to the provided **job ID**.
135
- *
136
- * @param request - The request {@link DeleteJobRequest}
137
- */
138
- deleteJob = (request) => this.client.fetch(
139
- {
140
- method: "DELETE",
141
- path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}`
142
- }
143
- );
144
- /**
145
- * Get a job circuit. Retrieve the circuit of the provided **job ID**.
146
- *
147
- * @param request - The request {@link GetJobCircuitRequest}
148
- * @returns A Promise of JobCircuit
149
- */
150
- getJobCircuit = (request) => this.client.fetch(
151
- {
152
- method: "GET",
153
- path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}/circuit`
154
- },
155
- unmarshalJobCircuit
156
- );
157
- /**
158
- * Get platform information. Retrieve information about the provided **platform ID**, such as provider name, technology, and type.
159
- *
160
- * @param request - The request {@link GetPlatformRequest}
161
- * @returns A Promise of Platform
162
- */
163
- getPlatform = (request) => this.client.fetch(
164
- {
165
- method: "GET",
166
- path: `/qaas/v1alpha1/platforms/${validatePathParam("platformId", request.platformId)}`
167
- },
168
- unmarshalPlatform
169
- );
170
- pageOfListPlatforms = (request = {}) => this.client.fetch(
171
- {
172
- method: "GET",
173
- path: `/qaas/v1alpha1/platforms`,
174
- urlParams: urlParams(
175
- ["backend_name", request.backendName],
176
- ["name", request.name],
177
- ["order_by", request.orderBy],
178
- ["page", request.page],
179
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
180
- ["platform_technology", request.platformTechnology],
181
- ["platform_type", request.platformType],
182
- ["provider_name", request.providerName]
183
- )
184
- },
185
- unmarshalListPlatformsResponse
186
- );
187
- /**
188
- * List all available platforms. Retrieve information about all platforms.
189
- *
190
- * @param request - The request {@link ListPlatformsRequest}
191
- * @returns A Promise of ListPlatformsResponse
192
- */
193
- listPlatforms = (request = {}) => enrichForPagination("platforms", this.pageOfListPlatforms, request);
194
- /**
195
- * Get session information. Retrieve information about the provided **session ID**, such as name and status.
196
- *
197
- * @param request - The request {@link GetSessionRequest}
198
- * @returns A Promise of Session
199
- */
200
- getSession = (request) => this.client.fetch(
201
- {
202
- method: "GET",
203
- path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}`
204
- },
205
- unmarshalSession
206
- );
207
- /**
208
- * Waits for {@link Session} to be in a final state.
209
- *
210
- * @param request - The request {@link GetSessionRequest}
211
- * @param options - The waiting options
212
- * @returns A Promise of Session
213
- */
214
- waitForSession = (request, options) => waitForResource(
215
- options?.stop ?? ((res) => Promise.resolve(!SESSION_TRANSIENT_STATUSES.includes(res.status))),
216
- this.getSession,
217
- request,
218
- options
219
- );
220
- pageOfListSessions = (request = {}) => this.client.fetch(
221
- {
222
- method: "GET",
223
- path: `/qaas/v1alpha1/sessions`,
224
- urlParams: urlParams(
225
- ["order_by", request.orderBy],
226
- ["page", request.page],
227
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
228
- ["platform_id", request.platformId],
229
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId],
230
- ["tags", request.tags]
231
- )
232
- },
233
- unmarshalListSessionsResponse
234
- );
235
- /**
236
- * List all sessions. Retrieve information about all QPU sessions.
237
- *
238
- * @param request - The request {@link ListSessionsRequest}
239
- * @returns A Promise of ListSessionsResponse
240
- */
241
- listSessions = (request = {}) => enrichForPagination("sessions", this.pageOfListSessions, request);
242
- /**
243
- * Create a session. Create a new QPU session for the specified platform. Once ready, jobs can be sent to this session.
244
- *
245
- * @param request - The request {@link CreateSessionRequest}
246
- * @returns A Promise of Session
247
- */
248
- createSession = (request) => this.client.fetch(
249
- {
250
- body: JSON.stringify(
251
- marshalCreateSessionRequest(request, this.client.settings)
252
- ),
253
- headers: jsonContentHeaders,
254
- method: "POST",
255
- path: `/qaas/v1alpha1/sessions`
256
- },
257
- unmarshalSession
258
- );
259
- /**
260
- * Update session information. Update session information of the provided **session ID**.
261
- *
262
- * @param request - The request {@link UpdateSessionRequest}
263
- * @returns A Promise of Session
264
- */
265
- updateSession = (request) => this.client.fetch(
266
- {
267
- body: JSON.stringify(
268
- marshalUpdateSessionRequest(request, this.client.settings)
269
- ),
270
- headers: jsonContentHeaders,
271
- method: "PATCH",
272
- path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}`
273
- },
274
- unmarshalSession
275
- );
276
- /**
277
- * Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and bookings.
278
- *
279
- * @param request - The request {@link TerminateSessionRequest}
280
- * @returns A Promise of Session
281
- */
282
- terminateSession = (request) => this.client.fetch(
283
- {
284
- body: "{}",
285
- headers: jsonContentHeaders,
286
- method: "POST",
287
- path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}/terminate`
288
- },
289
- unmarshalSession
290
- );
291
- /**
292
- * Delete an existing session. Delete a session by its unique ID and delete all its attached jobs and bookings.
293
- *
294
- * @param request - The request {@link DeleteSessionRequest}
295
- */
296
- deleteSession = (request) => this.client.fetch(
297
- {
298
- method: "DELETE",
299
- path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}`
300
- }
301
- );
302
- pageOfListSessionACLs = (request) => this.client.fetch(
303
- {
304
- method: "GET",
305
- path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}/acls`,
306
- urlParams: urlParams(
307
- ["order_by", request.orderBy],
308
- ["page", request.page],
309
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
310
- )
311
- },
312
- unmarshalListSessionACLsResponse
313
- );
314
- listSessionACLs = (request) => enrichForPagination("acls", this.pageOfListSessionACLs, request);
315
- /**
316
- * Create a process. Create a new process for the specified application on a specified platform.
317
- *
318
- * @param request - The request {@link CreateProcessRequest}
319
- * @returns A Promise of Process
320
- */
321
- createProcess = (request) => this.client.fetch(
322
- {
323
- body: JSON.stringify(
324
- marshalCreateProcessRequest(request, this.client.settings)
325
- ),
326
- headers: jsonContentHeaders,
327
- method: "POST",
328
- path: `/qaas/v1alpha1/processes`
329
- },
330
- unmarshalProcess
331
- );
332
- /**
333
- * Get process information. Retrieve information about the provided **process ID**, such as name, status and progress.
334
- *
335
- * @param request - The request {@link GetProcessRequest}
336
- * @returns A Promise of Process
337
- */
338
- getProcess = (request) => this.client.fetch(
339
- {
340
- method: "GET",
341
- path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}`
342
- },
343
- unmarshalProcess
344
- );
345
- /**
346
- * Waits for {@link Process} to be in a final state.
347
- *
348
- * @param request - The request {@link GetProcessRequest}
349
- * @param options - The waiting options
350
- * @returns A Promise of Process
351
- */
352
- waitForProcess = (request, options) => waitForResource(
353
- options?.stop ?? ((res) => Promise.resolve(!PROCESS_TRANSIENT_STATUSES.includes(res.status))),
354
- this.getProcess,
355
- request,
356
- options
357
- );
358
- pageOfListProcesses = (request = {}) => this.client.fetch(
359
- {
360
- method: "GET",
361
- path: `/qaas/v1alpha1/processes`,
362
- urlParams: urlParams(
363
- ["application_id", request.applicationId],
364
- ["order_by", request.orderBy],
365
- ["page", request.page],
366
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
367
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId],
368
- ["tags", request.tags]
369
- )
370
- },
371
- unmarshalListProcessesResponse
372
- );
373
- /**
374
- * List all processes. Retrieve information about all processes.
375
- *
376
- * @param request - The request {@link ListProcessesRequest}
377
- * @returns A Promise of ListProcessesResponse
378
- */
379
- listProcesses = (request = {}) => enrichForPagination("processes", this.pageOfListProcesses, request);
380
- /**
381
- * Update process information. Update process information of the provided **process ID**.
382
- *
383
- * @param request - The request {@link UpdateProcessRequest}
384
- * @returns A Promise of Process
385
- */
386
- updateProcess = (request) => this.client.fetch(
387
- {
388
- body: JSON.stringify(
389
- marshalUpdateProcessRequest(request, this.client.settings)
390
- ),
391
- headers: jsonContentHeaders,
392
- method: "PATCH",
393
- path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}`
394
- },
395
- unmarshalProcess
396
- );
397
- /**
398
- * Cancel a running process. Cancel a process by its unique ID. Intermediate results are still available.
399
- *
400
- * @param request - The request {@link CancelProcessRequest}
401
- * @returns A Promise of Process
402
- */
403
- cancelProcess = (request) => this.client.fetch(
404
- {
405
- body: "{}",
406
- headers: jsonContentHeaders,
407
- method: "POST",
408
- path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}/cancel`
409
- },
410
- unmarshalProcess
411
- );
412
- /**
413
- * Delete an existing process. Delete a process by its unique ID and delete all its data.
414
- *
415
- * @param request - The request {@link DeleteProcessRequest}
416
- */
417
- deleteProcess = (request) => this.client.fetch(
418
- {
419
- method: "DELETE",
420
- path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}`
421
- }
422
- );
423
- pageOfListProcessResults = (request) => this.client.fetch(
424
- {
425
- method: "GET",
426
- path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}/results`,
427
- urlParams: urlParams(
428
- ["order_by", request.orderBy],
429
- ["page", request.page],
430
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
431
- )
432
- },
433
- unmarshalListProcessResultsResponse
434
- );
435
- /**
436
- * List all results of a process. Retrieve all intermediate and final result of a process.
437
- *
438
- * @param request - The request {@link ListProcessResultsRequest}
439
- * @returns A Promise of ListProcessResultsResponse
440
- */
441
- listProcessResults = (request) => enrichForPagination("processResults", this.pageOfListProcessResults, request);
442
- /**
443
- * Get application information. Retrieve information about the provided **application ID**, such as name, type and compatible platforms.
444
- *
445
- * @param request - The request {@link GetApplicationRequest}
446
- * @returns A Promise of Application
447
- */
448
- getApplication = (request) => this.client.fetch(
449
- {
450
- method: "GET",
451
- path: `/qaas/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
452
- },
453
- unmarshalApplication
454
- );
455
- pageOfListApplications = (request = {}) => this.client.fetch(
456
- {
457
- method: "GET",
458
- path: `/qaas/v1alpha1/applications`,
459
- urlParams: urlParams(
460
- ["application_type", request.applicationType],
461
- ["name", request.name],
462
- ["order_by", request.orderBy],
463
- ["page", request.page],
464
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
465
- )
466
- },
467
- unmarshalListApplicationsResponse
468
- );
469
- /**
470
- * List all available applications. Retrieve information about all applications.
471
- *
472
- * @param request - The request {@link ListApplicationsRequest}
473
- * @returns A Promise of ListApplicationsResponse
474
- */
475
- listApplications = (request = {}) => enrichForPagination("applications", this.pageOfListApplications, request);
476
- /**
477
- * Get booking information. Retrieve information about the provided **booking ID**, such as description, status and progress message.
478
- *
479
- * @param request - The request {@link GetBookingRequest}
480
- * @returns A Promise of Booking
481
- */
482
- getBooking = (request) => this.client.fetch(
483
- {
484
- method: "GET",
485
- path: `/qaas/v1alpha1/bookings/${validatePathParam("bookingId", request.bookingId)}`
486
- },
487
- unmarshalBooking
488
- );
489
- /**
490
- * Waits for {@link Booking} to be in a final state.
491
- *
492
- * @param request - The request {@link GetBookingRequest}
493
- * @param options - The waiting options
494
- * @returns A Promise of Booking
495
- */
496
- waitForBooking = (request, options) => waitForResource(
497
- options?.stop ?? ((res) => Promise.resolve(!BOOKING_TRANSIENT_STATUSES.includes(res.status))),
498
- this.getBooking,
499
- request,
500
- options
501
- );
502
- pageOfListBookings = (request = {}) => this.client.fetch(
503
- {
504
- method: "GET",
505
- path: `/qaas/v1alpha1/bookings`,
506
- urlParams: urlParams(
507
- ["order_by", request.orderBy],
508
- ["page", request.page],
509
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
510
- ["platform_id", request.platformId],
511
- ["project_id", request.projectId]
512
- )
513
- },
514
- unmarshalListBookingsResponse
515
- );
516
- /**
517
- * List all bookings according the filter. Retrieve information about all bookings of the provided **project ID** or ** platform ID**.
518
- *
519
- * @param request - The request {@link ListBookingsRequest}
520
- * @returns A Promise of ListBookingsResponse
521
- */
522
- listBookings = (request = {}) => enrichForPagination("bookings", this.pageOfListBookings, request);
523
- /**
524
- * Update booking information. Update booking information of the provided **booking ID**.
525
- *
526
- * @param request - The request {@link UpdateBookingRequest}
527
- * @returns A Promise of Booking
528
- */
529
- updateBooking = (request) => this.client.fetch(
530
- {
531
- body: JSON.stringify(
532
- marshalUpdateBookingRequest(request, this.client.settings)
533
- ),
534
- headers: jsonContentHeaders,
535
- method: "PATCH",
536
- path: `/qaas/v1alpha1/bookings/${validatePathParam("bookingId", request.bookingId)}`
537
- },
538
- unmarshalBooking
539
- );
540
- /**
541
- * Create a new model. Create and register a new model that can be executed through next jobs. A model can also be assigned to a Session.
542
- *
543
- * @param request - The request {@link CreateModelRequest}
544
- * @returns A Promise of Model
545
- */
546
- createModel = (request = {}) => this.client.fetch(
547
- {
548
- body: JSON.stringify(
549
- marshalCreateModelRequest(request, this.client.settings)
550
- ),
551
- headers: jsonContentHeaders,
552
- method: "POST",
553
- path: `/qaas/v1alpha1/models`
554
- },
555
- unmarshalModel
556
- );
557
- /**
558
- * Get model information. Retrieve information about of the provided **model ID**.
559
- *
560
- * @param request - The request {@link GetModelRequest}
561
- * @returns A Promise of Model
562
- */
563
- getModel = (request) => this.client.fetch(
564
- {
565
- method: "GET",
566
- path: `/qaas/v1alpha1/models/${validatePathParam("modelId", request.modelId)}`
567
- },
568
- unmarshalModel
569
- );
570
- pageOfListModels = (request = {}) => this.client.fetch(
571
- {
572
- method: "GET",
573
- path: `/qaas/v1alpha1/models`,
574
- urlParams: urlParams(
575
- ["order_by", request.orderBy],
576
- ["page", request.page],
577
- ["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
578
- ["project_id", request.projectId ?? this.client.settings.defaultProjectId]
579
- )
580
- },
581
- unmarshalListModelsResponse
582
- );
583
- /**
584
- * List all models attached to the **project ID**. Retrieve information about all models of the provided **project ID**.
585
- *
586
- * @param request - The request {@link ListModelsRequest}
587
- * @returns A Promise of ListModelsResponse
588
- */
589
- listModels = (request = {}) => enrichForPagination("models", this.pageOfListModels, request);
590
- }
591
- export {
592
- API
1
+ import { BOOKING_TRANSIENT_STATUSES, JOB_TRANSIENT_STATUSES, PROCESS_TRANSIENT_STATUSES, SESSION_TRANSIENT_STATUSES } from "./content.gen.js";
2
+ import { marshalCreateJobRequest, marshalCreateModelRequest, marshalCreateProcessRequest, marshalCreateSessionRequest, marshalUpdateBookingRequest, marshalUpdateJobRequest, marshalUpdateProcessRequest, marshalUpdateSessionRequest, unmarshalApplication, unmarshalBooking, unmarshalJob, unmarshalJobCircuit, unmarshalListApplicationsResponse, unmarshalListBookingsResponse, unmarshalListJobResultsResponse, unmarshalListJobsResponse, unmarshalListModelsResponse, unmarshalListPlatformsResponse, unmarshalListProcessResultsResponse, unmarshalListProcessesResponse, unmarshalListSessionACLsResponse, unmarshalListSessionsResponse, unmarshalModel, unmarshalPlatform, unmarshalProcess, unmarshalSession } from "./marshalling.gen.js";
3
+ import { API, enrichForPagination, resolveOneOf, urlParams, validatePathParam, waitForResource } from "@scaleway/sdk-client";
4
+ var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
5
+ /**
6
+ * Quantum as a Service API.
7
+
8
+ This API allows you to allocate and program Quantum Processing Units (QPUs) to run quantum algorithms.
9
+ */
10
+ var API$1 = class extends API {
11
+ /**
12
+ * Get job information. Retrieve information about the provided **job ID**, mainly used to get the current status.
13
+ *
14
+ * @param request - The request {@link GetJobRequest}
15
+ * @returns A Promise of Job
16
+ */
17
+ getJob = (request) => this.client.fetch({
18
+ method: "GET",
19
+ path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}`
20
+ }, unmarshalJob);
21
+ /**
22
+ * Waits for {@link Job} to be in a final state.
23
+ *
24
+ * @param request - The request {@link GetJobRequest}
25
+ * @param options - The waiting options
26
+ * @returns A Promise of Job
27
+ */
28
+ waitForJob = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!JOB_TRANSIENT_STATUSES.includes(res.status))), this.getJob, request, options);
29
+ pageOfListJobs = (request = {}) => this.client.fetch({
30
+ method: "GET",
31
+ path: `/qaas/v1alpha1/jobs`,
32
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["tags", request.tags], ...Object.entries(resolveOneOf([{
33
+ param: "session_id",
34
+ value: request.sessionId
35
+ }, {
36
+ default: this.client.settings.defaultProjectId,
37
+ param: "project_id",
38
+ value: request.projectId
39
+ }])))
40
+ }, unmarshalListJobsResponse);
41
+ /**
42
+ * List all jobs within a project or session. Retrieve information about all jobs within a given session.
43
+ *
44
+ * @param request - The request {@link ListJobsRequest}
45
+ * @returns A Promise of ListJobsResponse
46
+ */
47
+ listJobs = (request = {}) => enrichForPagination("jobs", this.pageOfListJobs, request);
48
+ pageOfListJobResults = (request) => this.client.fetch({
49
+ method: "GET",
50
+ path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}/results`,
51
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
52
+ }, unmarshalListJobResultsResponse);
53
+ /**
54
+ * List all results of a job. Retrieve all intermediate and final results of a job.
55
+ *
56
+ * @param request - The request {@link ListJobResultsRequest}
57
+ * @returns A Promise of ListJobResultsResponse
58
+ */
59
+ listJobResults = (request) => enrichForPagination("jobResults", this.pageOfListJobResults, request);
60
+ /**
61
+ * Create a job. Create a job to be executed inside a QPU session.
62
+ *
63
+ * @param request - The request {@link CreateJobRequest}
64
+ * @returns A Promise of Job
65
+ */
66
+ createJob = (request) => this.client.fetch({
67
+ body: JSON.stringify(marshalCreateJobRequest(request, this.client.settings)),
68
+ headers: jsonContentHeaders,
69
+ method: "POST",
70
+ path: `/qaas/v1alpha1/jobs`
71
+ }, unmarshalJob);
72
+ /**
73
+ * Update job information. Update job information about the provided **job ID**.
74
+ *
75
+ * @param request - The request {@link UpdateJobRequest}
76
+ * @returns A Promise of Job
77
+ */
78
+ updateJob = (request) => this.client.fetch({
79
+ body: JSON.stringify(marshalUpdateJobRequest(request, this.client.settings)),
80
+ headers: jsonContentHeaders,
81
+ method: "PATCH",
82
+ path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}`
83
+ }, unmarshalJob);
84
+ /**
85
+ * Cancel a job. Cancel the job corresponding to the provided **job ID**.
86
+ *
87
+ * @param request - The request {@link CancelJobRequest}
88
+ * @returns A Promise of Job
89
+ */
90
+ cancelJob = (request) => this.client.fetch({
91
+ body: "{}",
92
+ headers: jsonContentHeaders,
93
+ method: "POST",
94
+ path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}/cancel`
95
+ }, unmarshalJob);
96
+ /**
97
+ * Delete a job. Delete the job corresponding to the provided **job ID**.
98
+ *
99
+ * @param request - The request {@link DeleteJobRequest}
100
+ */
101
+ deleteJob = (request) => this.client.fetch({
102
+ method: "DELETE",
103
+ path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}`
104
+ });
105
+ /**
106
+ * Get a job circuit. Retrieve the circuit of the provided **job ID**.
107
+ *
108
+ * @param request - The request {@link GetJobCircuitRequest}
109
+ * @returns A Promise of JobCircuit
110
+ */
111
+ getJobCircuit = (request) => this.client.fetch({
112
+ method: "GET",
113
+ path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}/circuit`
114
+ }, unmarshalJobCircuit);
115
+ /**
116
+ * Get platform information. Retrieve information about the provided **platform ID**, such as provider name, technology, and type.
117
+ *
118
+ * @param request - The request {@link GetPlatformRequest}
119
+ * @returns A Promise of Platform
120
+ */
121
+ getPlatform = (request) => this.client.fetch({
122
+ method: "GET",
123
+ path: `/qaas/v1alpha1/platforms/${validatePathParam("platformId", request.platformId)}`
124
+ }, unmarshalPlatform);
125
+ pageOfListPlatforms = (request = {}) => this.client.fetch({
126
+ method: "GET",
127
+ path: `/qaas/v1alpha1/platforms`,
128
+ urlParams: urlParams(["backend_name", request.backendName], ["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["platform_technology", request.platformTechnology], ["platform_type", request.platformType], ["provider_name", request.providerName])
129
+ }, unmarshalListPlatformsResponse);
130
+ /**
131
+ * List all available platforms. Retrieve information about all platforms.
132
+ *
133
+ * @param request - The request {@link ListPlatformsRequest}
134
+ * @returns A Promise of ListPlatformsResponse
135
+ */
136
+ listPlatforms = (request = {}) => enrichForPagination("platforms", this.pageOfListPlatforms, request);
137
+ /**
138
+ * Get session information. Retrieve information about the provided **session ID**, such as name and status.
139
+ *
140
+ * @param request - The request {@link GetSessionRequest}
141
+ * @returns A Promise of Session
142
+ */
143
+ getSession = (request) => this.client.fetch({
144
+ method: "GET",
145
+ path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}`
146
+ }, unmarshalSession);
147
+ /**
148
+ * Waits for {@link Session} to be in a final state.
149
+ *
150
+ * @param request - The request {@link GetSessionRequest}
151
+ * @param options - The waiting options
152
+ * @returns A Promise of Session
153
+ */
154
+ waitForSession = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!SESSION_TRANSIENT_STATUSES.includes(res.status))), this.getSession, request, options);
155
+ pageOfListSessions = (request = {}) => this.client.fetch({
156
+ method: "GET",
157
+ path: `/qaas/v1alpha1/sessions`,
158
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["platform_id", request.platformId], ["project_id", request.projectId ?? this.client.settings.defaultProjectId], ["tags", request.tags])
159
+ }, unmarshalListSessionsResponse);
160
+ /**
161
+ * List all sessions. Retrieve information about all QPU sessions.
162
+ *
163
+ * @param request - The request {@link ListSessionsRequest}
164
+ * @returns A Promise of ListSessionsResponse
165
+ */
166
+ listSessions = (request = {}) => enrichForPagination("sessions", this.pageOfListSessions, request);
167
+ /**
168
+ * Create a session. Create a new QPU session for the specified platform. Once ready, jobs can be sent to this session.
169
+ *
170
+ * @param request - The request {@link CreateSessionRequest}
171
+ * @returns A Promise of Session
172
+ */
173
+ createSession = (request) => this.client.fetch({
174
+ body: JSON.stringify(marshalCreateSessionRequest(request, this.client.settings)),
175
+ headers: jsonContentHeaders,
176
+ method: "POST",
177
+ path: `/qaas/v1alpha1/sessions`
178
+ }, unmarshalSession);
179
+ /**
180
+ * Update session information. Update session information of the provided **session ID**.
181
+ *
182
+ * @param request - The request {@link UpdateSessionRequest}
183
+ * @returns A Promise of Session
184
+ */
185
+ updateSession = (request) => this.client.fetch({
186
+ body: JSON.stringify(marshalUpdateSessionRequest(request, this.client.settings)),
187
+ headers: jsonContentHeaders,
188
+ method: "PATCH",
189
+ path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}`
190
+ }, unmarshalSession);
191
+ /**
192
+ * Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and bookings.
193
+ *
194
+ * @param request - The request {@link TerminateSessionRequest}
195
+ * @returns A Promise of Session
196
+ */
197
+ terminateSession = (request) => this.client.fetch({
198
+ body: "{}",
199
+ headers: jsonContentHeaders,
200
+ method: "POST",
201
+ path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}/terminate`
202
+ }, unmarshalSession);
203
+ /**
204
+ * Delete an existing session. Delete a session by its unique ID and delete all its attached jobs and bookings.
205
+ *
206
+ * @param request - The request {@link DeleteSessionRequest}
207
+ */
208
+ deleteSession = (request) => this.client.fetch({
209
+ method: "DELETE",
210
+ path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}`
211
+ });
212
+ pageOfListSessionACLs = (request) => this.client.fetch({
213
+ method: "GET",
214
+ path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}/acls`,
215
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
216
+ }, unmarshalListSessionACLsResponse);
217
+ listSessionACLs = (request) => enrichForPagination("acls", this.pageOfListSessionACLs, request);
218
+ /**
219
+ * Create a process. Create a new process for the specified application on a specified platform.
220
+ *
221
+ * @param request - The request {@link CreateProcessRequest}
222
+ * @returns A Promise of Process
223
+ */
224
+ createProcess = (request) => this.client.fetch({
225
+ body: JSON.stringify(marshalCreateProcessRequest(request, this.client.settings)),
226
+ headers: jsonContentHeaders,
227
+ method: "POST",
228
+ path: `/qaas/v1alpha1/processes`
229
+ }, unmarshalProcess);
230
+ /**
231
+ * Get process information. Retrieve information about the provided **process ID**, such as name, status and progress.
232
+ *
233
+ * @param request - The request {@link GetProcessRequest}
234
+ * @returns A Promise of Process
235
+ */
236
+ getProcess = (request) => this.client.fetch({
237
+ method: "GET",
238
+ path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}`
239
+ }, unmarshalProcess);
240
+ /**
241
+ * Waits for {@link Process} to be in a final state.
242
+ *
243
+ * @param request - The request {@link GetProcessRequest}
244
+ * @param options - The waiting options
245
+ * @returns A Promise of Process
246
+ */
247
+ waitForProcess = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!PROCESS_TRANSIENT_STATUSES.includes(res.status))), this.getProcess, request, options);
248
+ pageOfListProcesses = (request = {}) => this.client.fetch({
249
+ method: "GET",
250
+ path: `/qaas/v1alpha1/processes`,
251
+ urlParams: urlParams(["application_id", request.applicationId], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId], ["tags", request.tags])
252
+ }, unmarshalListProcessesResponse);
253
+ /**
254
+ * List all processes. Retrieve information about all processes.
255
+ *
256
+ * @param request - The request {@link ListProcessesRequest}
257
+ * @returns A Promise of ListProcessesResponse
258
+ */
259
+ listProcesses = (request = {}) => enrichForPagination("processes", this.pageOfListProcesses, request);
260
+ /**
261
+ * Update process information. Update process information of the provided **process ID**.
262
+ *
263
+ * @param request - The request {@link UpdateProcessRequest}
264
+ * @returns A Promise of Process
265
+ */
266
+ updateProcess = (request) => this.client.fetch({
267
+ body: JSON.stringify(marshalUpdateProcessRequest(request, this.client.settings)),
268
+ headers: jsonContentHeaders,
269
+ method: "PATCH",
270
+ path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}`
271
+ }, unmarshalProcess);
272
+ /**
273
+ * Cancel a running process. Cancel a process by its unique ID. Intermediate results are still available.
274
+ *
275
+ * @param request - The request {@link CancelProcessRequest}
276
+ * @returns A Promise of Process
277
+ */
278
+ cancelProcess = (request) => this.client.fetch({
279
+ body: "{}",
280
+ headers: jsonContentHeaders,
281
+ method: "POST",
282
+ path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}/cancel`
283
+ }, unmarshalProcess);
284
+ /**
285
+ * Delete an existing process. Delete a process by its unique ID and delete all its data.
286
+ *
287
+ * @param request - The request {@link DeleteProcessRequest}
288
+ */
289
+ deleteProcess = (request) => this.client.fetch({
290
+ method: "DELETE",
291
+ path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}`
292
+ });
293
+ pageOfListProcessResults = (request) => this.client.fetch({
294
+ method: "GET",
295
+ path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}/results`,
296
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
297
+ }, unmarshalListProcessResultsResponse);
298
+ /**
299
+ * List all results of a process. Retrieve all intermediate and final result of a process.
300
+ *
301
+ * @param request - The request {@link ListProcessResultsRequest}
302
+ * @returns A Promise of ListProcessResultsResponse
303
+ */
304
+ listProcessResults = (request) => enrichForPagination("processResults", this.pageOfListProcessResults, request);
305
+ /**
306
+ * Get application information. Retrieve information about the provided **application ID**, such as name, type and compatible platforms.
307
+ *
308
+ * @param request - The request {@link GetApplicationRequest}
309
+ * @returns A Promise of Application
310
+ */
311
+ getApplication = (request) => this.client.fetch({
312
+ method: "GET",
313
+ path: `/qaas/v1alpha1/applications/${validatePathParam("applicationId", request.applicationId)}`
314
+ }, unmarshalApplication);
315
+ pageOfListApplications = (request = {}) => this.client.fetch({
316
+ method: "GET",
317
+ path: `/qaas/v1alpha1/applications`,
318
+ urlParams: urlParams(["application_type", request.applicationType], ["name", request.name], ["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize])
319
+ }, unmarshalListApplicationsResponse);
320
+ /**
321
+ * List all available applications. Retrieve information about all applications.
322
+ *
323
+ * @param request - The request {@link ListApplicationsRequest}
324
+ * @returns A Promise of ListApplicationsResponse
325
+ */
326
+ listApplications = (request = {}) => enrichForPagination("applications", this.pageOfListApplications, request);
327
+ /**
328
+ * Get booking information. Retrieve information about the provided **booking ID**, such as description, status and progress message.
329
+ *
330
+ * @param request - The request {@link GetBookingRequest}
331
+ * @returns A Promise of Booking
332
+ */
333
+ getBooking = (request) => this.client.fetch({
334
+ method: "GET",
335
+ path: `/qaas/v1alpha1/bookings/${validatePathParam("bookingId", request.bookingId)}`
336
+ }, unmarshalBooking);
337
+ /**
338
+ * Waits for {@link Booking} to be in a final state.
339
+ *
340
+ * @param request - The request {@link GetBookingRequest}
341
+ * @param options - The waiting options
342
+ * @returns A Promise of Booking
343
+ */
344
+ waitForBooking = (request, options) => waitForResource(options?.stop ?? ((res) => Promise.resolve(!BOOKING_TRANSIENT_STATUSES.includes(res.status))), this.getBooking, request, options);
345
+ pageOfListBookings = (request = {}) => this.client.fetch({
346
+ method: "GET",
347
+ path: `/qaas/v1alpha1/bookings`,
348
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["platform_id", request.platformId], ["project_id", request.projectId])
349
+ }, unmarshalListBookingsResponse);
350
+ /**
351
+ * List all bookings according the filter. Retrieve information about all bookings of the provided **project ID** or ** platform ID**.
352
+ *
353
+ * @param request - The request {@link ListBookingsRequest}
354
+ * @returns A Promise of ListBookingsResponse
355
+ */
356
+ listBookings = (request = {}) => enrichForPagination("bookings", this.pageOfListBookings, request);
357
+ /**
358
+ * Update booking information. Update booking information of the provided **booking ID**.
359
+ *
360
+ * @param request - The request {@link UpdateBookingRequest}
361
+ * @returns A Promise of Booking
362
+ */
363
+ updateBooking = (request) => this.client.fetch({
364
+ body: JSON.stringify(marshalUpdateBookingRequest(request, this.client.settings)),
365
+ headers: jsonContentHeaders,
366
+ method: "PATCH",
367
+ path: `/qaas/v1alpha1/bookings/${validatePathParam("bookingId", request.bookingId)}`
368
+ }, unmarshalBooking);
369
+ /**
370
+ * Create a new model. Create and register a new model that can be executed through next jobs. A model can also be assigned to a Session.
371
+ *
372
+ * @param request - The request {@link CreateModelRequest}
373
+ * @returns A Promise of Model
374
+ */
375
+ createModel = (request = {}) => this.client.fetch({
376
+ body: JSON.stringify(marshalCreateModelRequest(request, this.client.settings)),
377
+ headers: jsonContentHeaders,
378
+ method: "POST",
379
+ path: `/qaas/v1alpha1/models`
380
+ }, unmarshalModel);
381
+ /**
382
+ * Get model information. Retrieve information about of the provided **model ID**.
383
+ *
384
+ * @param request - The request {@link GetModelRequest}
385
+ * @returns A Promise of Model
386
+ */
387
+ getModel = (request) => this.client.fetch({
388
+ method: "GET",
389
+ path: `/qaas/v1alpha1/models/${validatePathParam("modelId", request.modelId)}`
390
+ }, unmarshalModel);
391
+ pageOfListModels = (request = {}) => this.client.fetch({
392
+ method: "GET",
393
+ path: `/qaas/v1alpha1/models`,
394
+ urlParams: urlParams(["order_by", request.orderBy], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId ?? this.client.settings.defaultProjectId])
395
+ }, unmarshalListModelsResponse);
396
+ /**
397
+ * List all models attached to the **project ID**. Retrieve information about all models of the provided **project ID**.
398
+ *
399
+ * @param request - The request {@link ListModelsRequest}
400
+ * @returns A Promise of ListModelsResponse
401
+ */
402
+ listModels = (request = {}) => enrichForPagination("models", this.pageOfListModels, request);
593
403
  };
404
+ export { API$1 as API };