@scaleway/sdk-qaas 1.1.5 → 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/dist/v1alpha1/api.gen.cjs +73 -4
- package/dist/v1alpha1/api.gen.d.ts +38 -5
- package/dist/v1alpha1/api.gen.js +75 -6
- package/dist/v1alpha1/content.gen.cjs +6 -0
- package/dist/v1alpha1/content.gen.d.ts +3 -1
- package/dist/v1alpha1/content.gen.js +6 -0
- package/dist/v1alpha1/index.gen.cjs +4 -0
- package/dist/v1alpha1/index.gen.d.ts +1 -1
- package/dist/v1alpha1/index.gen.js +6 -2
- package/dist/v1alpha1/marshalling.gen.cjs +60 -0
- package/dist/v1alpha1/marshalling.gen.d.ts +4 -1
- package/dist/v1alpha1/marshalling.gen.js +60 -0
- package/dist/v1alpha1/types.gen.d.ts +133 -2
- package/package.json +1 -1
|
@@ -200,7 +200,7 @@ class API extends sdkClient.API {
|
|
|
200
200
|
*/
|
|
201
201
|
listPlatforms = (request = {}) => sdkClient.enrichForPagination("platforms", this.pageOfListPlatforms, request);
|
|
202
202
|
/**
|
|
203
|
-
* Get session
|
|
203
|
+
* Get session information. Retrieve information about the provided **session ID**, such as name, status, and number of executed jobs.
|
|
204
204
|
*
|
|
205
205
|
* @param request - The request {@link GetSessionRequest}
|
|
206
206
|
* @returns A Promise of Session
|
|
@@ -290,7 +290,7 @@ class API extends sdkClient.API {
|
|
|
290
290
|
marshalling_gen.unmarshalSession
|
|
291
291
|
);
|
|
292
292
|
/**
|
|
293
|
-
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs.
|
|
293
|
+
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and booking.
|
|
294
294
|
*
|
|
295
295
|
* @param request - The request {@link TerminateSessionRequest}
|
|
296
296
|
* @returns A Promise of Session
|
|
@@ -305,7 +305,7 @@ class API extends sdkClient.API {
|
|
|
305
305
|
marshalling_gen.unmarshalSession
|
|
306
306
|
);
|
|
307
307
|
/**
|
|
308
|
-
* Delete an existing session. Delete a session by its unique ID and delete all its attached
|
|
308
|
+
* Delete an existing session. Delete a session by its unique ID and delete all its attached job and booking.
|
|
309
309
|
*
|
|
310
310
|
* @param request - The request {@link DeleteSessionRequest}
|
|
311
311
|
*/
|
|
@@ -347,7 +347,7 @@ class API extends sdkClient.API {
|
|
|
347
347
|
marshalling_gen.unmarshalProcess
|
|
348
348
|
);
|
|
349
349
|
/**
|
|
350
|
-
* Get process
|
|
350
|
+
* Get process information. Retrieve information about the provided **process ID**, such as name, status and progress.
|
|
351
351
|
*
|
|
352
352
|
* @param request - The request {@link GetProcessRequest}
|
|
353
353
|
* @returns A Promise of Process
|
|
@@ -506,5 +506,74 @@ class API extends sdkClient.API {
|
|
|
506
506
|
* @returns A Promise of ListApplicationsResponse
|
|
507
507
|
*/
|
|
508
508
|
listApplications = (request = {}) => sdkClient.enrichForPagination("applications", this.pageOfListApplications, request);
|
|
509
|
+
/**
|
|
510
|
+
* Get booking information. Retrieve information about the provided **booking ID**, such as description, status and progress message.
|
|
511
|
+
*
|
|
512
|
+
* @param request - The request {@link GetBookingRequest}
|
|
513
|
+
* @returns A Promise of Booking
|
|
514
|
+
*/
|
|
515
|
+
getBooking = (request) => this.client.fetch(
|
|
516
|
+
{
|
|
517
|
+
method: "GET",
|
|
518
|
+
path: `/qaas/v1alpha1/bookings/${sdkClient.validatePathParam("bookingId", request.bookingId)}`
|
|
519
|
+
},
|
|
520
|
+
marshalling_gen.unmarshalBooking
|
|
521
|
+
);
|
|
522
|
+
/**
|
|
523
|
+
* Waits for {@link Booking} to be in a final state.
|
|
524
|
+
*
|
|
525
|
+
* @param request - The request {@link GetBookingRequest}
|
|
526
|
+
* @param options - The waiting options
|
|
527
|
+
* @returns A Promise of Booking
|
|
528
|
+
*/
|
|
529
|
+
waitForBooking = (request, options) => sdkClient.waitForResource(
|
|
530
|
+
options?.stop ?? ((res) => Promise.resolve(
|
|
531
|
+
!content_gen.BOOKING_TRANSIENT_STATUSES.includes(res.status)
|
|
532
|
+
)),
|
|
533
|
+
this.getBooking,
|
|
534
|
+
request,
|
|
535
|
+
options
|
|
536
|
+
);
|
|
537
|
+
pageOfListBookings = (request = {}) => this.client.fetch(
|
|
538
|
+
{
|
|
539
|
+
method: "GET",
|
|
540
|
+
path: `/qaas/v1alpha1/bookings`,
|
|
541
|
+
urlParams: sdkClient.urlParams(
|
|
542
|
+
["order_by", request.orderBy],
|
|
543
|
+
["page", request.page],
|
|
544
|
+
[
|
|
545
|
+
"page_size",
|
|
546
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
547
|
+
],
|
|
548
|
+
["platform_id", request.platformId],
|
|
549
|
+
["project_id", request.projectId]
|
|
550
|
+
)
|
|
551
|
+
},
|
|
552
|
+
marshalling_gen.unmarshalListBookingsResponse
|
|
553
|
+
);
|
|
554
|
+
/**
|
|
555
|
+
* List all bookings according the filter. Retrieve information about all bookings of the provided **project ID** or ** platform ID**.
|
|
556
|
+
*
|
|
557
|
+
* @param request - The request {@link ListBookingsRequest}
|
|
558
|
+
* @returns A Promise of ListBookingsResponse
|
|
559
|
+
*/
|
|
560
|
+
listBookings = (request = {}) => sdkClient.enrichForPagination("bookings", this.pageOfListBookings, request);
|
|
561
|
+
/**
|
|
562
|
+
* Update booking information. Update booking information of the provided **booking ID**.
|
|
563
|
+
*
|
|
564
|
+
* @param request - The request {@link UpdateBookingRequest}
|
|
565
|
+
* @returns A Promise of Booking
|
|
566
|
+
*/
|
|
567
|
+
updateBooking = (request) => this.client.fetch(
|
|
568
|
+
{
|
|
569
|
+
body: JSON.stringify(
|
|
570
|
+
marshalling_gen.marshalUpdateBookingRequest(request, this.client.settings)
|
|
571
|
+
),
|
|
572
|
+
headers: jsonContentHeaders,
|
|
573
|
+
method: "PATCH",
|
|
574
|
+
path: `/qaas/v1alpha1/bookings/${sdkClient.validatePathParam("bookingId", request.bookingId)}`
|
|
575
|
+
},
|
|
576
|
+
marshalling_gen.unmarshalBooking
|
|
577
|
+
);
|
|
509
578
|
}
|
|
510
579
|
exports.API = API;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
2
|
import type { WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import type { Application, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateProcessRequest, CreateSessionRequest, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetJobCircuitRequest, GetJobRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, ListApplicationsRequest, ListApplicationsResponse, ListJobResultsRequest, ListJobResultsResponse, ListJobsRequest, ListJobsResponse, ListPlatformsRequest, ListPlatformsResponse, ListProcessResultsRequest, ListProcessResultsResponse, ListProcessesRequest, ListProcessesResponse, ListSessionACLsRequest, ListSessionACLsResponse, ListSessionsRequest, ListSessionsResponse, Platform, Process, Session, TerminateSessionRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen';
|
|
3
|
+
import type { Application, Booking, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateProcessRequest, CreateSessionRequest, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetBookingRequest, GetJobCircuitRequest, GetJobRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, ListApplicationsRequest, ListApplicationsResponse, ListBookingsRequest, ListBookingsResponse, ListJobResultsRequest, ListJobResultsResponse, ListJobsRequest, ListJobsResponse, ListPlatformsRequest, ListPlatformsResponse, ListProcessResultsRequest, ListProcessResultsResponse, ListProcessesRequest, ListProcessesResponse, ListSessionACLsRequest, ListSessionACLsResponse, ListSessionsRequest, ListSessionsResponse, Platform, Process, Session, TerminateSessionRequest, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Quantum as a Service API.
|
|
6
6
|
|
|
@@ -97,7 +97,7 @@ export declare class API extends ParentAPI {
|
|
|
97
97
|
[Symbol.asyncIterator]: () => AsyncGenerator<Platform[], void, void>;
|
|
98
98
|
};
|
|
99
99
|
/**
|
|
100
|
-
* Get session
|
|
100
|
+
* Get session information. Retrieve information about the provided **session ID**, such as name, status, and number of executed jobs.
|
|
101
101
|
*
|
|
102
102
|
* @param request - The request {@link GetSessionRequest}
|
|
103
103
|
* @returns A Promise of Session
|
|
@@ -137,14 +137,14 @@ export declare class API extends ParentAPI {
|
|
|
137
137
|
*/
|
|
138
138
|
updateSession: (request: Readonly<UpdateSessionRequest>) => Promise<Session>;
|
|
139
139
|
/**
|
|
140
|
-
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs.
|
|
140
|
+
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and booking.
|
|
141
141
|
*
|
|
142
142
|
* @param request - The request {@link TerminateSessionRequest}
|
|
143
143
|
* @returns A Promise of Session
|
|
144
144
|
*/
|
|
145
145
|
terminateSession: (request: Readonly<TerminateSessionRequest>) => Promise<Session>;
|
|
146
146
|
/**
|
|
147
|
-
* Delete an existing session. Delete a session by its unique ID and delete all its attached
|
|
147
|
+
* Delete an existing session. Delete a session by its unique ID and delete all its attached job and booking.
|
|
148
148
|
*
|
|
149
149
|
* @param request - The request {@link DeleteSessionRequest}
|
|
150
150
|
*/
|
|
@@ -162,7 +162,7 @@ export declare class API extends ParentAPI {
|
|
|
162
162
|
*/
|
|
163
163
|
createProcess: (request: Readonly<CreateProcessRequest>) => Promise<Process>;
|
|
164
164
|
/**
|
|
165
|
-
* Get process
|
|
165
|
+
* Get process information. Retrieve information about the provided **process ID**, such as name, status and progress.
|
|
166
166
|
*
|
|
167
167
|
* @param request - The request {@link GetProcessRequest}
|
|
168
168
|
* @returns A Promise of Process
|
|
@@ -236,4 +236,37 @@ export declare class API extends ParentAPI {
|
|
|
236
236
|
all: () => Promise<Application[]>;
|
|
237
237
|
[Symbol.asyncIterator]: () => AsyncGenerator<Application[], void, void>;
|
|
238
238
|
};
|
|
239
|
+
/**
|
|
240
|
+
* Get booking information. Retrieve information about the provided **booking ID**, such as description, status and progress message.
|
|
241
|
+
*
|
|
242
|
+
* @param request - The request {@link GetBookingRequest}
|
|
243
|
+
* @returns A Promise of Booking
|
|
244
|
+
*/
|
|
245
|
+
getBooking: (request: Readonly<GetBookingRequest>) => Promise<Booking>;
|
|
246
|
+
/**
|
|
247
|
+
* Waits for {@link Booking} to be in a final state.
|
|
248
|
+
*
|
|
249
|
+
* @param request - The request {@link GetBookingRequest}
|
|
250
|
+
* @param options - The waiting options
|
|
251
|
+
* @returns A Promise of Booking
|
|
252
|
+
*/
|
|
253
|
+
waitForBooking: (request: Readonly<GetBookingRequest>, options?: Readonly<WaitForOptions<Booking>>) => Promise<Booking>;
|
|
254
|
+
protected pageOfListBookings: (request?: Readonly<ListBookingsRequest>) => Promise<ListBookingsResponse>;
|
|
255
|
+
/**
|
|
256
|
+
* List all bookings according the filter. Retrieve information about all bookings of the provided **project ID** or ** platform ID**.
|
|
257
|
+
*
|
|
258
|
+
* @param request - The request {@link ListBookingsRequest}
|
|
259
|
+
* @returns A Promise of ListBookingsResponse
|
|
260
|
+
*/
|
|
261
|
+
listBookings: (request?: Readonly<ListBookingsRequest>) => Promise<ListBookingsResponse> & {
|
|
262
|
+
all: () => Promise<Booking[]>;
|
|
263
|
+
[Symbol.asyncIterator]: () => AsyncGenerator<Booking[], void, void>;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Update booking information. Update booking information of the provided **booking ID**.
|
|
267
|
+
*
|
|
268
|
+
* @param request - The request {@link UpdateBookingRequest}
|
|
269
|
+
* @returns A Promise of Booking
|
|
270
|
+
*/
|
|
271
|
+
updateBooking: (request: Readonly<UpdateBookingRequest>) => Promise<Booking>;
|
|
239
272
|
}
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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 } 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 } from "./marshalling.gen.js";
|
|
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 } from "./marshalling.gen.js";
|
|
4
4
|
const jsonContentHeaders = {
|
|
5
5
|
"Content-Type": "application/json; charset=utf-8"
|
|
6
6
|
};
|
|
@@ -198,7 +198,7 @@ class API extends API$1 {
|
|
|
198
198
|
*/
|
|
199
199
|
listPlatforms = (request = {}) => enrichForPagination("platforms", this.pageOfListPlatforms, request);
|
|
200
200
|
/**
|
|
201
|
-
* Get session
|
|
201
|
+
* Get session information. Retrieve information about the provided **session ID**, such as name, status, and number of executed jobs.
|
|
202
202
|
*
|
|
203
203
|
* @param request - The request {@link GetSessionRequest}
|
|
204
204
|
* @returns A Promise of Session
|
|
@@ -288,7 +288,7 @@ class API extends API$1 {
|
|
|
288
288
|
unmarshalSession
|
|
289
289
|
);
|
|
290
290
|
/**
|
|
291
|
-
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs.
|
|
291
|
+
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and booking.
|
|
292
292
|
*
|
|
293
293
|
* @param request - The request {@link TerminateSessionRequest}
|
|
294
294
|
* @returns A Promise of Session
|
|
@@ -303,7 +303,7 @@ class API extends API$1 {
|
|
|
303
303
|
unmarshalSession
|
|
304
304
|
);
|
|
305
305
|
/**
|
|
306
|
-
* Delete an existing session. Delete a session by its unique ID and delete all its attached
|
|
306
|
+
* Delete an existing session. Delete a session by its unique ID and delete all its attached job and booking.
|
|
307
307
|
*
|
|
308
308
|
* @param request - The request {@link DeleteSessionRequest}
|
|
309
309
|
*/
|
|
@@ -345,7 +345,7 @@ class API extends API$1 {
|
|
|
345
345
|
unmarshalProcess
|
|
346
346
|
);
|
|
347
347
|
/**
|
|
348
|
-
* Get process
|
|
348
|
+
* Get process information. Retrieve information about the provided **process ID**, such as name, status and progress.
|
|
349
349
|
*
|
|
350
350
|
* @param request - The request {@link GetProcessRequest}
|
|
351
351
|
* @returns A Promise of Process
|
|
@@ -504,6 +504,75 @@ class API extends API$1 {
|
|
|
504
504
|
* @returns A Promise of ListApplicationsResponse
|
|
505
505
|
*/
|
|
506
506
|
listApplications = (request = {}) => enrichForPagination("applications", this.pageOfListApplications, request);
|
|
507
|
+
/**
|
|
508
|
+
* Get booking information. Retrieve information about the provided **booking ID**, such as description, status and progress message.
|
|
509
|
+
*
|
|
510
|
+
* @param request - The request {@link GetBookingRequest}
|
|
511
|
+
* @returns A Promise of Booking
|
|
512
|
+
*/
|
|
513
|
+
getBooking = (request) => this.client.fetch(
|
|
514
|
+
{
|
|
515
|
+
method: "GET",
|
|
516
|
+
path: `/qaas/v1alpha1/bookings/${validatePathParam("bookingId", request.bookingId)}`
|
|
517
|
+
},
|
|
518
|
+
unmarshalBooking
|
|
519
|
+
);
|
|
520
|
+
/**
|
|
521
|
+
* Waits for {@link Booking} to be in a final state.
|
|
522
|
+
*
|
|
523
|
+
* @param request - The request {@link GetBookingRequest}
|
|
524
|
+
* @param options - The waiting options
|
|
525
|
+
* @returns A Promise of Booking
|
|
526
|
+
*/
|
|
527
|
+
waitForBooking = (request, options) => waitForResource(
|
|
528
|
+
options?.stop ?? ((res) => Promise.resolve(
|
|
529
|
+
!BOOKING_TRANSIENT_STATUSES.includes(res.status)
|
|
530
|
+
)),
|
|
531
|
+
this.getBooking,
|
|
532
|
+
request,
|
|
533
|
+
options
|
|
534
|
+
);
|
|
535
|
+
pageOfListBookings = (request = {}) => this.client.fetch(
|
|
536
|
+
{
|
|
537
|
+
method: "GET",
|
|
538
|
+
path: `/qaas/v1alpha1/bookings`,
|
|
539
|
+
urlParams: urlParams(
|
|
540
|
+
["order_by", request.orderBy],
|
|
541
|
+
["page", request.page],
|
|
542
|
+
[
|
|
543
|
+
"page_size",
|
|
544
|
+
request.pageSize ?? this.client.settings.defaultPageSize
|
|
545
|
+
],
|
|
546
|
+
["platform_id", request.platformId],
|
|
547
|
+
["project_id", request.projectId]
|
|
548
|
+
)
|
|
549
|
+
},
|
|
550
|
+
unmarshalListBookingsResponse
|
|
551
|
+
);
|
|
552
|
+
/**
|
|
553
|
+
* List all bookings according the filter. Retrieve information about all bookings of the provided **project ID** or ** platform ID**.
|
|
554
|
+
*
|
|
555
|
+
* @param request - The request {@link ListBookingsRequest}
|
|
556
|
+
* @returns A Promise of ListBookingsResponse
|
|
557
|
+
*/
|
|
558
|
+
listBookings = (request = {}) => enrichForPagination("bookings", this.pageOfListBookings, request);
|
|
559
|
+
/**
|
|
560
|
+
* Update booking information. Update booking information of the provided **booking ID**.
|
|
561
|
+
*
|
|
562
|
+
* @param request - The request {@link UpdateBookingRequest}
|
|
563
|
+
* @returns A Promise of Booking
|
|
564
|
+
*/
|
|
565
|
+
updateBooking = (request) => this.client.fetch(
|
|
566
|
+
{
|
|
567
|
+
body: JSON.stringify(
|
|
568
|
+
marshalUpdateBookingRequest(request, this.client.settings)
|
|
569
|
+
),
|
|
570
|
+
headers: jsonContentHeaders,
|
|
571
|
+
method: "PATCH",
|
|
572
|
+
path: `/qaas/v1alpha1/bookings/${validatePathParam("bookingId", request.bookingId)}`
|
|
573
|
+
},
|
|
574
|
+
unmarshalBooking
|
|
575
|
+
);
|
|
507
576
|
}
|
|
508
577
|
export {
|
|
509
578
|
API
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const BOOKING_TRANSIENT_STATUSES = [
|
|
4
|
+
"waiting",
|
|
5
|
+
"validating",
|
|
6
|
+
"cancelling"
|
|
7
|
+
];
|
|
3
8
|
const JOB_TRANSIENT_STATUSES = [
|
|
4
9
|
"waiting",
|
|
5
10
|
"running",
|
|
@@ -14,6 +19,7 @@ const SESSION_TRANSIENT_STATUSES = [
|
|
|
14
19
|
"starting",
|
|
15
20
|
"stopping"
|
|
16
21
|
];
|
|
22
|
+
exports.BOOKING_TRANSIENT_STATUSES = BOOKING_TRANSIENT_STATUSES;
|
|
17
23
|
exports.JOB_TRANSIENT_STATUSES = JOB_TRANSIENT_STATUSES;
|
|
18
24
|
exports.PROCESS_TRANSIENT_STATUSES = PROCESS_TRANSIENT_STATUSES;
|
|
19
25
|
exports.SESSION_TRANSIENT_STATUSES = SESSION_TRANSIENT_STATUSES;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { JobStatus, ProcessStatus, SessionStatus } from './types.gen';
|
|
1
|
+
import type { BookingStatus, JobStatus, ProcessStatus, SessionStatus } from './types.gen';
|
|
2
|
+
/** Lists transient statutes of the enum {@link BookingStatus}. */
|
|
3
|
+
export declare const BOOKING_TRANSIENT_STATUSES: BookingStatus[];
|
|
2
4
|
/** Lists transient statutes of the enum {@link JobStatus}. */
|
|
3
5
|
export declare const JOB_TRANSIENT_STATUSES: JobStatus[];
|
|
4
6
|
/** Lists transient statutes of the enum {@link ProcessStatus}. */
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
const BOOKING_TRANSIENT_STATUSES = [
|
|
2
|
+
"waiting",
|
|
3
|
+
"validating",
|
|
4
|
+
"cancelling"
|
|
5
|
+
];
|
|
1
6
|
const JOB_TRANSIENT_STATUSES = [
|
|
2
7
|
"waiting",
|
|
3
8
|
"running",
|
|
@@ -13,6 +18,7 @@ const SESSION_TRANSIENT_STATUSES = [
|
|
|
13
18
|
"stopping"
|
|
14
19
|
];
|
|
15
20
|
export {
|
|
21
|
+
BOOKING_TRANSIENT_STATUSES,
|
|
16
22
|
JOB_TRANSIENT_STATUSES,
|
|
17
23
|
PROCESS_TRANSIENT_STATUSES,
|
|
18
24
|
SESSION_TRANSIENT_STATUSES
|
|
@@ -5,19 +5,23 @@ const content_gen = require("./content.gen.cjs");
|
|
|
5
5
|
const marshalling_gen = require("./marshalling.gen.cjs");
|
|
6
6
|
const validationRules_gen = require("./validation-rules.gen.cjs");
|
|
7
7
|
exports.API = api_gen.API;
|
|
8
|
+
exports.BOOKING_TRANSIENT_STATUSES = content_gen.BOOKING_TRANSIENT_STATUSES;
|
|
8
9
|
exports.JOB_TRANSIENT_STATUSES = content_gen.JOB_TRANSIENT_STATUSES;
|
|
9
10
|
exports.PROCESS_TRANSIENT_STATUSES = content_gen.PROCESS_TRANSIENT_STATUSES;
|
|
10
11
|
exports.SESSION_TRANSIENT_STATUSES = content_gen.SESSION_TRANSIENT_STATUSES;
|
|
11
12
|
exports.marshalCreateJobRequest = marshalling_gen.marshalCreateJobRequest;
|
|
12
13
|
exports.marshalCreateProcessRequest = marshalling_gen.marshalCreateProcessRequest;
|
|
13
14
|
exports.marshalCreateSessionRequest = marshalling_gen.marshalCreateSessionRequest;
|
|
15
|
+
exports.marshalUpdateBookingRequest = marshalling_gen.marshalUpdateBookingRequest;
|
|
14
16
|
exports.marshalUpdateJobRequest = marshalling_gen.marshalUpdateJobRequest;
|
|
15
17
|
exports.marshalUpdateProcessRequest = marshalling_gen.marshalUpdateProcessRequest;
|
|
16
18
|
exports.marshalUpdateSessionRequest = marshalling_gen.marshalUpdateSessionRequest;
|
|
17
19
|
exports.unmarshalApplication = marshalling_gen.unmarshalApplication;
|
|
20
|
+
exports.unmarshalBooking = marshalling_gen.unmarshalBooking;
|
|
18
21
|
exports.unmarshalJob = marshalling_gen.unmarshalJob;
|
|
19
22
|
exports.unmarshalJobCircuit = marshalling_gen.unmarshalJobCircuit;
|
|
20
23
|
exports.unmarshalListApplicationsResponse = marshalling_gen.unmarshalListApplicationsResponse;
|
|
24
|
+
exports.unmarshalListBookingsResponse = marshalling_gen.unmarshalListBookingsResponse;
|
|
21
25
|
exports.unmarshalListJobResultsResponse = marshalling_gen.unmarshalListJobResultsResponse;
|
|
22
26
|
exports.unmarshalListJobsResponse = marshalling_gen.unmarshalListJobsResponse;
|
|
23
27
|
exports.unmarshalListPlatformsResponse = marshalling_gen.unmarshalListPlatformsResponse;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
3
|
export * from './marshalling.gen';
|
|
4
|
-
export type { Application, ApplicationType, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateProcessRequest, CreateSessionRequest, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetJobCircuitRequest, GetJobRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, JobResult, JobStatus, ListApplicationsRequest, ListApplicationsRequestOrderBy, ListApplicationsResponse, ListJobResultsRequest, ListJobResultsRequestOrderBy, ListJobResultsResponse, ListJobsRequest, ListJobsRequestOrderBy, ListJobsResponse, ListPlatformsRequest, ListPlatformsRequestOrderBy, ListPlatformsResponse, ListProcessResultsRequest, ListProcessResultsRequestOrderBy, ListProcessResultsResponse, ListProcessesRequest, ListProcessesRequestOrderBy, ListProcessesResponse, ListSessionACLsRequest, ListSessionACLsRequestOrderBy, ListSessionACLsResponse, ListSessionsRequest, ListSessionsRequestOrderBy, ListSessionsResponse, Platform, PlatformAvailability, PlatformHardware, PlatformTechnology, PlatformType, Process, ProcessResult, ProcessStatus, Session, SessionAccess, SessionOriginType, SessionStatus, TerminateSessionRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest, } from './types.gen';
|
|
4
|
+
export type { Application, ApplicationType, Booking, BookingStatus, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateProcessRequest, CreateSessionRequest, CreateSessionRequestBookingDemand, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetBookingRequest, GetJobCircuitRequest, GetJobRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, JobResult, JobStatus, ListApplicationsRequest, ListApplicationsRequestOrderBy, ListApplicationsResponse, ListBookingsRequest, ListBookingsRequestOrderBy, ListBookingsResponse, ListJobResultsRequest, ListJobResultsRequestOrderBy, ListJobResultsResponse, ListJobsRequest, ListJobsRequestOrderBy, ListJobsResponse, ListPlatformsRequest, ListPlatformsRequestOrderBy, ListPlatformsResponse, ListProcessResultsRequest, ListProcessResultsRequestOrderBy, ListProcessResultsResponse, ListProcessesRequest, ListProcessesRequestOrderBy, ListProcessesResponse, ListSessionACLsRequest, ListSessionACLsRequestOrderBy, ListSessionACLsResponse, ListSessionsRequest, ListSessionsRequestOrderBy, ListSessionsResponse, Platform, PlatformAvailability, PlatformBookingRequirement, PlatformHardware, PlatformTechnology, PlatformType, Process, ProcessResult, ProcessStatus, Session, SessionAccess, SessionOriginType, SessionStatus, TerminateSessionRequest, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest, } from './types.gen';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { API } from "./api.gen.js";
|
|
2
|
-
import { JOB_TRANSIENT_STATUSES, PROCESS_TRANSIENT_STATUSES, SESSION_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
-
import { marshalCreateJobRequest, marshalCreateProcessRequest, marshalCreateSessionRequest, marshalUpdateJobRequest, marshalUpdateProcessRequest, marshalUpdateSessionRequest, unmarshalApplication, unmarshalJob, unmarshalJobCircuit, unmarshalListApplicationsResponse, unmarshalListJobResultsResponse, unmarshalListJobsResponse, unmarshalListPlatformsResponse, unmarshalListProcessResultsResponse, unmarshalListProcessesResponse, unmarshalListSessionACLsResponse, unmarshalListSessionsResponse, unmarshalPlatform, unmarshalProcess, unmarshalSession } from "./marshalling.gen.js";
|
|
2
|
+
import { BOOKING_TRANSIENT_STATUSES, JOB_TRANSIENT_STATUSES, PROCESS_TRANSIENT_STATUSES, SESSION_TRANSIENT_STATUSES } from "./content.gen.js";
|
|
3
|
+
import { marshalCreateJobRequest, marshalCreateProcessRequest, marshalCreateSessionRequest, marshalUpdateBookingRequest, marshalUpdateJobRequest, marshalUpdateProcessRequest, marshalUpdateSessionRequest, unmarshalApplication, unmarshalBooking, unmarshalJob, unmarshalJobCircuit, unmarshalListApplicationsResponse, unmarshalListBookingsResponse, unmarshalListJobResultsResponse, unmarshalListJobsResponse, unmarshalListPlatformsResponse, unmarshalListProcessResultsResponse, unmarshalListProcessesResponse, unmarshalListSessionACLsResponse, unmarshalListSessionsResponse, unmarshalPlatform, unmarshalProcess, unmarshalSession } from "./marshalling.gen.js";
|
|
4
4
|
import * as validationRules_gen from "./validation-rules.gen.js";
|
|
5
5
|
export {
|
|
6
6
|
API,
|
|
7
|
+
BOOKING_TRANSIENT_STATUSES,
|
|
7
8
|
JOB_TRANSIENT_STATUSES,
|
|
8
9
|
PROCESS_TRANSIENT_STATUSES,
|
|
9
10
|
SESSION_TRANSIENT_STATUSES,
|
|
@@ -11,13 +12,16 @@ export {
|
|
|
11
12
|
marshalCreateJobRequest,
|
|
12
13
|
marshalCreateProcessRequest,
|
|
13
14
|
marshalCreateSessionRequest,
|
|
15
|
+
marshalUpdateBookingRequest,
|
|
14
16
|
marshalUpdateJobRequest,
|
|
15
17
|
marshalUpdateProcessRequest,
|
|
16
18
|
marshalUpdateSessionRequest,
|
|
17
19
|
unmarshalApplication,
|
|
20
|
+
unmarshalBooking,
|
|
18
21
|
unmarshalJob,
|
|
19
22
|
unmarshalJobCircuit,
|
|
20
23
|
unmarshalListApplicationsResponse,
|
|
24
|
+
unmarshalListBookingsResponse,
|
|
21
25
|
unmarshalListJobResultsResponse,
|
|
22
26
|
unmarshalListJobsResponse,
|
|
23
27
|
unmarshalListPlatformsResponse,
|
|
@@ -26,6 +26,23 @@ const unmarshalApplication = (data) => {
|
|
|
26
26
|
type: data.type
|
|
27
27
|
};
|
|
28
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
|
+
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
44
|
+
};
|
|
45
|
+
};
|
|
29
46
|
const unmarshalJob = (data) => {
|
|
30
47
|
if (!sdkClient.isJSONObject(data)) {
|
|
31
48
|
throw new TypeError(
|
|
@@ -46,6 +63,19 @@ const unmarshalJob = (data) => {
|
|
|
46
63
|
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
47
64
|
};
|
|
48
65
|
};
|
|
66
|
+
const unmarshalPlatformBookingRequirement = (data) => {
|
|
67
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
68
|
+
throw new TypeError(
|
|
69
|
+
`Unmarshalling the type 'PlatformBookingRequirement' failed as data isn't a dictionary.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
maxCancellationDuration: data.max_cancellation_duration,
|
|
74
|
+
maxDuration: data.max_duration,
|
|
75
|
+
maxPlanificationDuration: data.max_planification_duration,
|
|
76
|
+
minDuration: data.min_duration
|
|
77
|
+
};
|
|
78
|
+
};
|
|
49
79
|
const unmarshalPlatformHardware = (data) => {
|
|
50
80
|
if (!sdkClient.isJSONObject(data)) {
|
|
51
81
|
throw new TypeError(
|
|
@@ -70,8 +100,12 @@ const unmarshalPlatform = (data) => {
|
|
|
70
100
|
return {
|
|
71
101
|
availability: data.availability,
|
|
72
102
|
backendName: data.backend_name,
|
|
103
|
+
bookingRequirement: data.booking_requirement ? unmarshalPlatformBookingRequirement(data.booking_requirement) : void 0,
|
|
104
|
+
description: data.description,
|
|
105
|
+
documentationUrl: data.documentation_url,
|
|
73
106
|
hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : void 0,
|
|
74
107
|
id: data.id,
|
|
108
|
+
isBookable: data.is_bookable,
|
|
75
109
|
maxCircuitCount: data.max_circuit_count,
|
|
76
110
|
maxQubitCount: data.max_qubit_count,
|
|
77
111
|
maxShotCount: data.max_shot_count,
|
|
@@ -117,6 +151,7 @@ const unmarshalSession = (data) => {
|
|
|
117
151
|
);
|
|
118
152
|
}
|
|
119
153
|
return {
|
|
154
|
+
bookingId: data.booking_id,
|
|
120
155
|
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
121
156
|
deduplicationId: data.deduplication_id,
|
|
122
157
|
finishedJobCount: data.finished_job_count,
|
|
@@ -151,6 +186,17 @@ const unmarshalListApplicationsResponse = (data) => {
|
|
|
151
186
|
totalCount: data.total_count
|
|
152
187
|
};
|
|
153
188
|
};
|
|
189
|
+
const unmarshalListBookingsResponse = (data) => {
|
|
190
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
191
|
+
throw new TypeError(
|
|
192
|
+
`Unmarshalling the type 'ListBookingsResponse' failed as data isn't a dictionary.`
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
bookings: sdkClient.unmarshalArrayOfObject(data.bookings, unmarshalBooking),
|
|
197
|
+
totalCount: data.total_count
|
|
198
|
+
};
|
|
199
|
+
};
|
|
154
200
|
const unmarshalJobResult = (data) => {
|
|
155
201
|
if (!sdkClient.isJSONObject(data)) {
|
|
156
202
|
throw new TypeError(
|
|
@@ -277,7 +323,15 @@ const marshalCreateProcessRequest = (request, defaults) => ({
|
|
|
277
323
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
278
324
|
tags: request.tags
|
|
279
325
|
});
|
|
326
|
+
const marshalCreateSessionRequestBookingDemand = (request, defaults) => ({
|
|
327
|
+
description: request.description,
|
|
328
|
+
finished_at: request.finishedAt,
|
|
329
|
+
started_at: request.startedAt
|
|
330
|
+
});
|
|
280
331
|
const marshalCreateSessionRequest = (request, defaults) => ({
|
|
332
|
+
booking_demand: request.bookingDemand !== void 0 ? marshalCreateSessionRequestBookingDemand(
|
|
333
|
+
request.bookingDemand
|
|
334
|
+
) : void 0,
|
|
281
335
|
deduplication_id: request.deduplicationId,
|
|
282
336
|
max_duration: request.maxDuration,
|
|
283
337
|
max_idle_duration: request.maxIdleDuration,
|
|
@@ -286,6 +340,9 @@ const marshalCreateSessionRequest = (request, defaults) => ({
|
|
|
286
340
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
287
341
|
tags: request.tags
|
|
288
342
|
});
|
|
343
|
+
const marshalUpdateBookingRequest = (request, defaults) => ({
|
|
344
|
+
description: request.description
|
|
345
|
+
});
|
|
289
346
|
const marshalUpdateJobRequest = (request, defaults) => ({
|
|
290
347
|
name: request.name,
|
|
291
348
|
tags: request.tags
|
|
@@ -303,13 +360,16 @@ const marshalUpdateSessionRequest = (request, defaults) => ({
|
|
|
303
360
|
exports.marshalCreateJobRequest = marshalCreateJobRequest;
|
|
304
361
|
exports.marshalCreateProcessRequest = marshalCreateProcessRequest;
|
|
305
362
|
exports.marshalCreateSessionRequest = marshalCreateSessionRequest;
|
|
363
|
+
exports.marshalUpdateBookingRequest = marshalUpdateBookingRequest;
|
|
306
364
|
exports.marshalUpdateJobRequest = marshalUpdateJobRequest;
|
|
307
365
|
exports.marshalUpdateProcessRequest = marshalUpdateProcessRequest;
|
|
308
366
|
exports.marshalUpdateSessionRequest = marshalUpdateSessionRequest;
|
|
309
367
|
exports.unmarshalApplication = unmarshalApplication;
|
|
368
|
+
exports.unmarshalBooking = unmarshalBooking;
|
|
310
369
|
exports.unmarshalJob = unmarshalJob;
|
|
311
370
|
exports.unmarshalJobCircuit = unmarshalJobCircuit;
|
|
312
371
|
exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;
|
|
372
|
+
exports.unmarshalListBookingsResponse = unmarshalListBookingsResponse;
|
|
313
373
|
exports.unmarshalListJobResultsResponse = unmarshalListJobResultsResponse;
|
|
314
374
|
exports.unmarshalListJobsResponse = unmarshalListJobsResponse;
|
|
315
375
|
exports.unmarshalListPlatformsResponse = unmarshalListPlatformsResponse;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { Application, CreateJobRequest, CreateProcessRequest, CreateSessionRequest, Job, JobCircuit, ListApplicationsResponse, ListJobResultsResponse, ListJobsResponse, ListPlatformsResponse, ListProcessResultsResponse, ListProcessesResponse, ListSessionACLsResponse, ListSessionsResponse, Platform, Process, Session, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen';
|
|
2
|
+
import type { Application, Booking, CreateJobRequest, CreateProcessRequest, CreateSessionRequest, Job, JobCircuit, ListApplicationsResponse, ListBookingsResponse, ListJobResultsResponse, ListJobsResponse, ListPlatformsResponse, ListProcessResultsResponse, ListProcessesResponse, ListSessionACLsResponse, ListSessionsResponse, Platform, Process, Session, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen';
|
|
3
3
|
export declare const unmarshalJobCircuit: (data: unknown) => JobCircuit;
|
|
4
4
|
export declare const unmarshalApplication: (data: unknown) => Application;
|
|
5
|
+
export declare const unmarshalBooking: (data: unknown) => Booking;
|
|
5
6
|
export declare const unmarshalJob: (data: unknown) => Job;
|
|
6
7
|
export declare const unmarshalPlatform: (data: unknown) => Platform;
|
|
7
8
|
export declare const unmarshalProcess: (data: unknown) => Process;
|
|
8
9
|
export declare const unmarshalSession: (data: unknown) => Session;
|
|
9
10
|
export declare const unmarshalListApplicationsResponse: (data: unknown) => ListApplicationsResponse;
|
|
11
|
+
export declare const unmarshalListBookingsResponse: (data: unknown) => ListBookingsResponse;
|
|
10
12
|
export declare const unmarshalListJobResultsResponse: (data: unknown) => ListJobResultsResponse;
|
|
11
13
|
export declare const unmarshalListJobsResponse: (data: unknown) => ListJobsResponse;
|
|
12
14
|
export declare const unmarshalListPlatformsResponse: (data: unknown) => ListPlatformsResponse;
|
|
@@ -17,6 +19,7 @@ export declare const unmarshalListSessionsResponse: (data: unknown) => ListSessi
|
|
|
17
19
|
export declare const marshalCreateJobRequest: (request: CreateJobRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
18
20
|
export declare const marshalCreateProcessRequest: (request: CreateProcessRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
19
21
|
export declare const marshalCreateSessionRequest: (request: CreateSessionRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
22
|
+
export declare const marshalUpdateBookingRequest: (request: UpdateBookingRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
20
23
|
export declare const marshalUpdateJobRequest: (request: UpdateJobRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
21
24
|
export declare const marshalUpdateProcessRequest: (request: UpdateProcessRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
22
25
|
export declare const marshalUpdateSessionRequest: (request: UpdateSessionRequest, defaults: DefaultValues) => Record<string, unknown>;
|
|
@@ -24,6 +24,23 @@ const unmarshalApplication = (data) => {
|
|
|
24
24
|
type: data.type
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
+
const unmarshalBooking = (data) => {
|
|
28
|
+
if (!isJSONObject(data)) {
|
|
29
|
+
throw new TypeError(
|
|
30
|
+
`Unmarshalling the type 'Booking' failed as data isn't a dictionary.`
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
createdAt: unmarshalDate(data.created_at),
|
|
35
|
+
description: data.description,
|
|
36
|
+
finishedAt: unmarshalDate(data.finished_at),
|
|
37
|
+
id: data.id,
|
|
38
|
+
progressMessage: data.progress_message,
|
|
39
|
+
startedAt: unmarshalDate(data.started_at),
|
|
40
|
+
status: data.status,
|
|
41
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
42
|
+
};
|
|
43
|
+
};
|
|
27
44
|
const unmarshalJob = (data) => {
|
|
28
45
|
if (!isJSONObject(data)) {
|
|
29
46
|
throw new TypeError(
|
|
@@ -44,6 +61,19 @@ const unmarshalJob = (data) => {
|
|
|
44
61
|
updatedAt: unmarshalDate(data.updated_at)
|
|
45
62
|
};
|
|
46
63
|
};
|
|
64
|
+
const unmarshalPlatformBookingRequirement = (data) => {
|
|
65
|
+
if (!isJSONObject(data)) {
|
|
66
|
+
throw new TypeError(
|
|
67
|
+
`Unmarshalling the type 'PlatformBookingRequirement' failed as data isn't a dictionary.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
maxCancellationDuration: data.max_cancellation_duration,
|
|
72
|
+
maxDuration: data.max_duration,
|
|
73
|
+
maxPlanificationDuration: data.max_planification_duration,
|
|
74
|
+
minDuration: data.min_duration
|
|
75
|
+
};
|
|
76
|
+
};
|
|
47
77
|
const unmarshalPlatformHardware = (data) => {
|
|
48
78
|
if (!isJSONObject(data)) {
|
|
49
79
|
throw new TypeError(
|
|
@@ -68,8 +98,12 @@ const unmarshalPlatform = (data) => {
|
|
|
68
98
|
return {
|
|
69
99
|
availability: data.availability,
|
|
70
100
|
backendName: data.backend_name,
|
|
101
|
+
bookingRequirement: data.booking_requirement ? unmarshalPlatformBookingRequirement(data.booking_requirement) : void 0,
|
|
102
|
+
description: data.description,
|
|
103
|
+
documentationUrl: data.documentation_url,
|
|
71
104
|
hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : void 0,
|
|
72
105
|
id: data.id,
|
|
106
|
+
isBookable: data.is_bookable,
|
|
73
107
|
maxCircuitCount: data.max_circuit_count,
|
|
74
108
|
maxQubitCount: data.max_qubit_count,
|
|
75
109
|
maxShotCount: data.max_shot_count,
|
|
@@ -115,6 +149,7 @@ const unmarshalSession = (data) => {
|
|
|
115
149
|
);
|
|
116
150
|
}
|
|
117
151
|
return {
|
|
152
|
+
bookingId: data.booking_id,
|
|
118
153
|
createdAt: unmarshalDate(data.created_at),
|
|
119
154
|
deduplicationId: data.deduplication_id,
|
|
120
155
|
finishedJobCount: data.finished_job_count,
|
|
@@ -149,6 +184,17 @@ const unmarshalListApplicationsResponse = (data) => {
|
|
|
149
184
|
totalCount: data.total_count
|
|
150
185
|
};
|
|
151
186
|
};
|
|
187
|
+
const unmarshalListBookingsResponse = (data) => {
|
|
188
|
+
if (!isJSONObject(data)) {
|
|
189
|
+
throw new TypeError(
|
|
190
|
+
`Unmarshalling the type 'ListBookingsResponse' failed as data isn't a dictionary.`
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
bookings: unmarshalArrayOfObject(data.bookings, unmarshalBooking),
|
|
195
|
+
totalCount: data.total_count
|
|
196
|
+
};
|
|
197
|
+
};
|
|
152
198
|
const unmarshalJobResult = (data) => {
|
|
153
199
|
if (!isJSONObject(data)) {
|
|
154
200
|
throw new TypeError(
|
|
@@ -275,7 +321,15 @@ const marshalCreateProcessRequest = (request, defaults) => ({
|
|
|
275
321
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
276
322
|
tags: request.tags
|
|
277
323
|
});
|
|
324
|
+
const marshalCreateSessionRequestBookingDemand = (request, defaults) => ({
|
|
325
|
+
description: request.description,
|
|
326
|
+
finished_at: request.finishedAt,
|
|
327
|
+
started_at: request.startedAt
|
|
328
|
+
});
|
|
278
329
|
const marshalCreateSessionRequest = (request, defaults) => ({
|
|
330
|
+
booking_demand: request.bookingDemand !== void 0 ? marshalCreateSessionRequestBookingDemand(
|
|
331
|
+
request.bookingDemand
|
|
332
|
+
) : void 0,
|
|
279
333
|
deduplication_id: request.deduplicationId,
|
|
280
334
|
max_duration: request.maxDuration,
|
|
281
335
|
max_idle_duration: request.maxIdleDuration,
|
|
@@ -284,6 +338,9 @@ const marshalCreateSessionRequest = (request, defaults) => ({
|
|
|
284
338
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
285
339
|
tags: request.tags
|
|
286
340
|
});
|
|
341
|
+
const marshalUpdateBookingRequest = (request, defaults) => ({
|
|
342
|
+
description: request.description
|
|
343
|
+
});
|
|
287
344
|
const marshalUpdateJobRequest = (request, defaults) => ({
|
|
288
345
|
name: request.name,
|
|
289
346
|
tags: request.tags
|
|
@@ -302,13 +359,16 @@ export {
|
|
|
302
359
|
marshalCreateJobRequest,
|
|
303
360
|
marshalCreateProcessRequest,
|
|
304
361
|
marshalCreateSessionRequest,
|
|
362
|
+
marshalUpdateBookingRequest,
|
|
305
363
|
marshalUpdateJobRequest,
|
|
306
364
|
marshalUpdateProcessRequest,
|
|
307
365
|
marshalUpdateSessionRequest,
|
|
308
366
|
unmarshalApplication,
|
|
367
|
+
unmarshalBooking,
|
|
309
368
|
unmarshalJob,
|
|
310
369
|
unmarshalJobCircuit,
|
|
311
370
|
unmarshalListApplicationsResponse,
|
|
371
|
+
unmarshalListBookingsResponse,
|
|
312
372
|
unmarshalListJobResultsResponse,
|
|
313
373
|
unmarshalListJobsResponse,
|
|
314
374
|
unmarshalListPlatformsResponse,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Money } from '@scaleway/sdk-client';
|
|
2
2
|
export type ApplicationType = 'unknown_type' | 'vqe';
|
|
3
|
+
export type BookingStatus = 'unknown_status' | 'waiting' | 'validating' | 'validated' | 'cancelling' | 'cancelled' | 'error';
|
|
3
4
|
export type JobStatus = 'unknown_status' | 'waiting' | 'error' | 'running' | 'completed' | 'cancelling' | 'cancelled';
|
|
4
5
|
export type ListApplicationsRequestOrderBy = 'name_asc' | 'name_desc' | 'type_asc' | 'type_desc';
|
|
6
|
+
export type ListBookingsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'started_at_desc' | 'started_at_asc';
|
|
5
7
|
export type ListJobResultsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
|
|
6
8
|
export type ListJobsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'status_asc' | 'status_desc' | 'platform_name_asc' | 'platform_name_desc' | 'name_asc' | 'name_desc' | 'session_name_asc' | 'session_name_desc';
|
|
7
9
|
export type ListPlatformsRequestOrderBy = 'name_asc' | 'name_desc' | 'provider_name_asc' | 'provider_name_desc' | 'type_asc' | 'type_desc' | 'technology_asc' | 'technology_desc' | 'backend_name_asc' | 'backend_name_desc';
|
|
@@ -10,12 +12,30 @@ export type ListProcessesRequestOrderBy = 'created_at_desc' | 'created_at_asc' |
|
|
|
10
12
|
export type ListSessionACLsRequestOrderBy = 'access_asc' | 'access_desc';
|
|
11
13
|
export type ListSessionsRequestOrderBy = 'name_asc' | 'name_desc' | 'started_at_asc' | 'started_at_desc' | 'status_asc' | 'status_desc' | 'created_at_desc' | 'created_at_asc';
|
|
12
14
|
export type PlatformAvailability = 'unknown_availability' | 'available' | 'shortage' | 'scarce' | 'maintenance';
|
|
13
|
-
export type PlatformTechnology = 'unknown_technology' | 'photonic' | 'general_purpose' | 'trapped_ion' | 'superconducting';
|
|
15
|
+
export type PlatformTechnology = 'unknown_technology' | 'photonic' | 'general_purpose' | 'trapped_ion' | 'superconducting' | 'neutral_atom';
|
|
14
16
|
export type PlatformType = 'unknown_type' | 'simulator' | 'qpu';
|
|
15
17
|
export type ProcessStatus = 'unknown_status' | 'error' | 'starting' | 'running' | 'completed' | 'cancelling' | 'cancelled';
|
|
16
18
|
export type SessionAccess = 'unknown_access' | 'full' | 'read_session' | 'read_write_session' | 'read_job_result' | 'read_job_circuit' | 'read_job' | 'read_write_job';
|
|
17
19
|
export type SessionOriginType = 'unknown_origin_type' | 'customer' | 'process';
|
|
18
20
|
export type SessionStatus = 'unknown_status' | 'running' | 'stopped' | 'starting' | 'stopping';
|
|
21
|
+
export interface PlatformBookingRequirement {
|
|
22
|
+
/**
|
|
23
|
+
* Minimal duration of any booking based on this platform.
|
|
24
|
+
*/
|
|
25
|
+
minDuration?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Maximal duration of any bookings based on this platform.
|
|
28
|
+
*/
|
|
29
|
+
maxDuration?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Allowed time to cancel a booking attached to this platform before the beginning of the session.
|
|
32
|
+
*/
|
|
33
|
+
maxCancellationDuration?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Allowed planification time from now where the platform can be booked in the future.
|
|
36
|
+
*/
|
|
37
|
+
maxPlanificationDuration?: string;
|
|
38
|
+
}
|
|
19
39
|
export interface PlatformHardware {
|
|
20
40
|
/**
|
|
21
41
|
* Product name of the hardware.
|
|
@@ -56,6 +76,11 @@ export interface JobCircuit {
|
|
|
56
76
|
*/
|
|
57
77
|
qiskitCircuit?: string;
|
|
58
78
|
}
|
|
79
|
+
export interface CreateSessionRequestBookingDemand {
|
|
80
|
+
startedAt?: Date;
|
|
81
|
+
finishedAt?: Date;
|
|
82
|
+
description?: string;
|
|
83
|
+
}
|
|
59
84
|
export interface Application {
|
|
60
85
|
/**
|
|
61
86
|
* Unique ID of the application.
|
|
@@ -78,6 +103,40 @@ export interface Application {
|
|
|
78
103
|
*/
|
|
79
104
|
inputTemplate: string;
|
|
80
105
|
}
|
|
106
|
+
export interface Booking {
|
|
107
|
+
/**
|
|
108
|
+
* Unique ID of the booking.
|
|
109
|
+
*/
|
|
110
|
+
id: string;
|
|
111
|
+
/**
|
|
112
|
+
* Time at which the booking was created.
|
|
113
|
+
*/
|
|
114
|
+
createdAt?: Date;
|
|
115
|
+
/**
|
|
116
|
+
* Time at which the booking starts.
|
|
117
|
+
*/
|
|
118
|
+
startedAt?: Date;
|
|
119
|
+
/**
|
|
120
|
+
* Time at which the booking was updated.
|
|
121
|
+
*/
|
|
122
|
+
updatedAt?: Date;
|
|
123
|
+
/**
|
|
124
|
+
* Time at which the booking finishes.
|
|
125
|
+
*/
|
|
126
|
+
finishedAt?: Date;
|
|
127
|
+
/**
|
|
128
|
+
* Status of the booking.
|
|
129
|
+
*/
|
|
130
|
+
status: BookingStatus;
|
|
131
|
+
/**
|
|
132
|
+
* Description of the booking slot.
|
|
133
|
+
*/
|
|
134
|
+
description: string;
|
|
135
|
+
/**
|
|
136
|
+
* Any progress message of the booking.
|
|
137
|
+
*/
|
|
138
|
+
progressMessage: string;
|
|
139
|
+
}
|
|
81
140
|
export interface JobResult {
|
|
82
141
|
/**
|
|
83
142
|
* ID of the parent job.
|
|
@@ -207,6 +266,22 @@ export interface Platform {
|
|
|
207
266
|
* Specifications of the underlying hardware.
|
|
208
267
|
*/
|
|
209
268
|
hardware?: PlatformHardware;
|
|
269
|
+
/**
|
|
270
|
+
* Booking constraints to fit if the platform is bookable.
|
|
271
|
+
*/
|
|
272
|
+
bookingRequirement?: PlatformBookingRequirement;
|
|
273
|
+
/**
|
|
274
|
+
* English description of the platform.
|
|
275
|
+
*/
|
|
276
|
+
description: string;
|
|
277
|
+
/**
|
|
278
|
+
* Documentation link to external documentation to learn more on this platform.
|
|
279
|
+
*/
|
|
280
|
+
documentationUrl: string;
|
|
281
|
+
/**
|
|
282
|
+
* Specify if the platform is bookable.
|
|
283
|
+
*/
|
|
284
|
+
isBookable: boolean;
|
|
210
285
|
}
|
|
211
286
|
export interface ProcessResult {
|
|
212
287
|
/**
|
|
@@ -244,7 +319,7 @@ export interface Process {
|
|
|
244
319
|
*/
|
|
245
320
|
attachedSessionIds: string[];
|
|
246
321
|
/**
|
|
247
|
-
*
|
|
322
|
+
* Time at which the process was created.
|
|
248
323
|
*/
|
|
249
324
|
createdAt?: Date;
|
|
250
325
|
/**
|
|
@@ -357,6 +432,10 @@ export interface Session {
|
|
|
357
432
|
* Any progress of the session.
|
|
358
433
|
*/
|
|
359
434
|
progressMessage?: string;
|
|
435
|
+
/**
|
|
436
|
+
* An optional booking unique ID of an attached booking.
|
|
437
|
+
*/
|
|
438
|
+
bookingId?: string;
|
|
360
439
|
}
|
|
361
440
|
export type CancelJobRequest = {
|
|
362
441
|
/**
|
|
@@ -447,6 +526,10 @@ export type CreateSessionRequest = {
|
|
|
447
526
|
* Deduplication ID of the session.
|
|
448
527
|
*/
|
|
449
528
|
deduplicationId?: string;
|
|
529
|
+
/**
|
|
530
|
+
* A booking demand to schedule the session, only applicable if the platform is bookable.
|
|
531
|
+
*/
|
|
532
|
+
bookingDemand?: CreateSessionRequestBookingDemand;
|
|
450
533
|
};
|
|
451
534
|
export type DeleteJobRequest = {
|
|
452
535
|
/**
|
|
@@ -472,6 +555,12 @@ export type GetApplicationRequest = {
|
|
|
472
555
|
*/
|
|
473
556
|
applicationId: string;
|
|
474
557
|
};
|
|
558
|
+
export type GetBookingRequest = {
|
|
559
|
+
/**
|
|
560
|
+
* Unique ID of the booking.
|
|
561
|
+
*/
|
|
562
|
+
bookingId: string;
|
|
563
|
+
};
|
|
475
564
|
export type GetJobCircuitRequest = {
|
|
476
565
|
/**
|
|
477
566
|
* Unique ID of the job.
|
|
@@ -534,6 +623,38 @@ export interface ListApplicationsResponse {
|
|
|
534
623
|
*/
|
|
535
624
|
applications: Application[];
|
|
536
625
|
}
|
|
626
|
+
export type ListBookingsRequest = {
|
|
627
|
+
/**
|
|
628
|
+
* List bookings belonging to this project ID.
|
|
629
|
+
*/
|
|
630
|
+
projectId?: string;
|
|
631
|
+
/**
|
|
632
|
+
* List bookings attached to this platform ID.
|
|
633
|
+
*/
|
|
634
|
+
platformId?: string;
|
|
635
|
+
/**
|
|
636
|
+
* Page number.
|
|
637
|
+
*/
|
|
638
|
+
page?: number;
|
|
639
|
+
/**
|
|
640
|
+
* Maximum number of results to return per page.
|
|
641
|
+
*/
|
|
642
|
+
pageSize?: number;
|
|
643
|
+
/**
|
|
644
|
+
* Sort order of the returned results.
|
|
645
|
+
*/
|
|
646
|
+
orderBy?: ListBookingsRequestOrderBy;
|
|
647
|
+
};
|
|
648
|
+
export interface ListBookingsResponse {
|
|
649
|
+
/**
|
|
650
|
+
* Total number of bookings.
|
|
651
|
+
*/
|
|
652
|
+
totalCount: number;
|
|
653
|
+
/**
|
|
654
|
+
* List of bookings.
|
|
655
|
+
*/
|
|
656
|
+
bookings: Booking[];
|
|
657
|
+
}
|
|
537
658
|
export type ListJobResultsRequest = {
|
|
538
659
|
/**
|
|
539
660
|
* ID of the job.
|
|
@@ -762,6 +883,16 @@ export type TerminateSessionRequest = {
|
|
|
762
883
|
*/
|
|
763
884
|
sessionId: string;
|
|
764
885
|
};
|
|
886
|
+
export type UpdateBookingRequest = {
|
|
887
|
+
/**
|
|
888
|
+
* Unique ID of the booking.
|
|
889
|
+
*/
|
|
890
|
+
bookingId: string;
|
|
891
|
+
/**
|
|
892
|
+
* Description of the booking slot.
|
|
893
|
+
*/
|
|
894
|
+
description?: string;
|
|
895
|
+
};
|
|
765
896
|
export type UpdateJobRequest = {
|
|
766
897
|
/**
|
|
767
898
|
* Unique ID of the job.
|