@scaleway/sdk-qaas 1.2.0 → 1.4.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.
@@ -2,4 +2,4 @@
2
2
  * This file is automatically generated
3
3
  * PLEASE DO NOT EDIT HERE
4
4
  */
5
- export * as Qaasv1alpha1 from './v1alpha1/index.gen';
5
+ export * as Qaasv1alpha1 from './v1alpha1/index.gen.js';
@@ -575,5 +575,61 @@ class API extends sdkClient.API {
575
575
  },
576
576
  marshalling_gen.unmarshalBooking
577
577
  );
578
+ /**
579
+ * 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.
580
+ *
581
+ * @param request - The request {@link CreateModelRequest}
582
+ * @returns A Promise of Model
583
+ */
584
+ createModel = (request = {}) => this.client.fetch(
585
+ {
586
+ body: JSON.stringify(
587
+ marshalling_gen.marshalCreateModelRequest(request, this.client.settings)
588
+ ),
589
+ headers: jsonContentHeaders,
590
+ method: "POST",
591
+ path: `/qaas/v1alpha1/models`
592
+ },
593
+ marshalling_gen.unmarshalModel
594
+ );
595
+ /**
596
+ * Get model information. Retrieve information about of the provided **model ID**.
597
+ *
598
+ * @param request - The request {@link GetModelRequest}
599
+ * @returns A Promise of Model
600
+ */
601
+ getModel = (request) => this.client.fetch(
602
+ {
603
+ method: "GET",
604
+ path: `/qaas/v1alpha1/models/${sdkClient.validatePathParam("modelId", request.modelId)}`
605
+ },
606
+ marshalling_gen.unmarshalModel
607
+ );
608
+ pageOfListModels = (request = {}) => this.client.fetch(
609
+ {
610
+ method: "GET",
611
+ path: `/qaas/v1alpha1/models`,
612
+ urlParams: sdkClient.urlParams(
613
+ ["order_by", request.orderBy],
614
+ ["page", request.page],
615
+ [
616
+ "page_size",
617
+ request.pageSize ?? this.client.settings.defaultPageSize
618
+ ],
619
+ [
620
+ "project_id",
621
+ request.projectId ?? this.client.settings.defaultProjectId
622
+ ]
623
+ )
624
+ },
625
+ marshalling_gen.unmarshalListModelsResponse
626
+ );
627
+ /**
628
+ * List all models attached to the **project ID**. Retrieve information about all models of the provided **project ID**.
629
+ *
630
+ * @param request - The request {@link ListModelsRequest}
631
+ * @returns A Promise of ListModelsResponse
632
+ */
633
+ listModels = (request = {}) => sdkClient.enrichForPagination("models", this.pageOfListModels, request);
578
634
  }
579
635
  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, 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';
3
+ import type { Application, Booking, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetBookingRequest, GetJobCircuitRequest, GetJobRequest, GetModelRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, ListApplicationsRequest, ListApplicationsResponse, ListBookingsRequest, ListBookingsResponse, ListJobResultsRequest, ListJobResultsResponse, ListJobsRequest, ListJobsResponse, ListModelsRequest, ListModelsResponse, ListPlatformsRequest, ListPlatformsResponse, ListProcessResultsRequest, ListProcessResultsResponse, ListProcessesRequest, ListProcessesResponse, ListSessionACLsRequest, ListSessionACLsResponse, ListSessionsRequest, ListSessionsResponse, Model, Platform, Process, Session, TerminateSessionRequest, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen.js';
4
4
  /**
5
5
  * Quantum as a Service API.
6
6
 
@@ -41,8 +41,8 @@ export declare class API extends ParentAPI {
41
41
  * @returns A Promise of ListJobResultsResponse
42
42
  */
43
43
  listJobResults: (request: Readonly<ListJobResultsRequest>) => Promise<ListJobResultsResponse> & {
44
- all: () => Promise<import("./types.gen").JobResult[]>;
45
- [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").JobResult[], void, void>;
44
+ all: () => Promise<import("./types.gen.js").JobResult[]>;
45
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").JobResult[], void, void>;
46
46
  };
47
47
  /**
48
48
  * Create a job. Create a job to be executed inside a session.
@@ -151,8 +151,8 @@ export declare class API extends ParentAPI {
151
151
  deleteSession: (request: Readonly<DeleteSessionRequest>) => Promise<void>;
152
152
  protected pageOfListSessionACLs: (request: Readonly<ListSessionACLsRequest>) => Promise<ListSessionACLsResponse>;
153
153
  listSessionACLs: (request: Readonly<ListSessionACLsRequest>) => Promise<ListSessionACLsResponse> & {
154
- all: () => Promise<import("./types.gen").SessionAccess[]>;
155
- [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").SessionAccess[], void, void>;
154
+ all: () => Promise<import("./types.gen.js").SessionAccess[]>;
155
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").SessionAccess[], void, void>;
156
156
  };
157
157
  /**
158
158
  * Create a process. Create a new process for the specified application on a specified platform.
@@ -215,8 +215,8 @@ export declare class API extends ParentAPI {
215
215
  * @returns A Promise of ListProcessResultsResponse
216
216
  */
217
217
  listProcessResults: (request: Readonly<ListProcessResultsRequest>) => Promise<ListProcessResultsResponse> & {
218
- all: () => Promise<import("./types.gen").ProcessResult[]>;
219
- [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen").ProcessResult[], void, void>;
218
+ all: () => Promise<import("./types.gen.js").ProcessResult[]>;
219
+ [Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").ProcessResult[], void, void>;
220
220
  };
221
221
  /**
222
222
  * Get application information. Retrieve information about the provided **applcation ID**, such as name, type and compatible platforms.
@@ -269,4 +269,29 @@ export declare class API extends ParentAPI {
269
269
  * @returns A Promise of Booking
270
270
  */
271
271
  updateBooking: (request: Readonly<UpdateBookingRequest>) => Promise<Booking>;
272
+ /**
273
+ * 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.
274
+ *
275
+ * @param request - The request {@link CreateModelRequest}
276
+ * @returns A Promise of Model
277
+ */
278
+ createModel: (request?: Readonly<CreateModelRequest>) => Promise<Model>;
279
+ /**
280
+ * Get model information. Retrieve information about of the provided **model ID**.
281
+ *
282
+ * @param request - The request {@link GetModelRequest}
283
+ * @returns A Promise of Model
284
+ */
285
+ getModel: (request: Readonly<GetModelRequest>) => Promise<Model>;
286
+ protected pageOfListModels: (request?: Readonly<ListModelsRequest>) => Promise<ListModelsResponse>;
287
+ /**
288
+ * List all models attached to the **project ID**. Retrieve information about all models of the provided **project ID**.
289
+ *
290
+ * @param request - The request {@link ListModelsRequest}
291
+ * @returns A Promise of ListModelsResponse
292
+ */
293
+ listModels: (request?: Readonly<ListModelsRequest>) => Promise<ListModelsResponse> & {
294
+ all: () => Promise<Model[]>;
295
+ [Symbol.asyncIterator]: () => AsyncGenerator<Model[], void, void>;
296
+ };
272
297
  }
@@ -1,6 +1,6 @@
1
1
  import { API as API$1, validatePathParam, waitForResource, urlParams, resolveOneOf, enrichForPagination } from "@scaleway/sdk-client";
2
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";
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
4
  const jsonContentHeaders = {
5
5
  "Content-Type": "application/json; charset=utf-8"
6
6
  };
@@ -573,6 +573,62 @@ class API extends API$1 {
573
573
  },
574
574
  unmarshalBooking
575
575
  );
576
+ /**
577
+ * 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.
578
+ *
579
+ * @param request - The request {@link CreateModelRequest}
580
+ * @returns A Promise of Model
581
+ */
582
+ createModel = (request = {}) => this.client.fetch(
583
+ {
584
+ body: JSON.stringify(
585
+ marshalCreateModelRequest(request, this.client.settings)
586
+ ),
587
+ headers: jsonContentHeaders,
588
+ method: "POST",
589
+ path: `/qaas/v1alpha1/models`
590
+ },
591
+ unmarshalModel
592
+ );
593
+ /**
594
+ * Get model information. Retrieve information about of the provided **model ID**.
595
+ *
596
+ * @param request - The request {@link GetModelRequest}
597
+ * @returns A Promise of Model
598
+ */
599
+ getModel = (request) => this.client.fetch(
600
+ {
601
+ method: "GET",
602
+ path: `/qaas/v1alpha1/models/${validatePathParam("modelId", request.modelId)}`
603
+ },
604
+ unmarshalModel
605
+ );
606
+ pageOfListModels = (request = {}) => this.client.fetch(
607
+ {
608
+ method: "GET",
609
+ path: `/qaas/v1alpha1/models`,
610
+ urlParams: urlParams(
611
+ ["order_by", request.orderBy],
612
+ ["page", request.page],
613
+ [
614
+ "page_size",
615
+ request.pageSize ?? this.client.settings.defaultPageSize
616
+ ],
617
+ [
618
+ "project_id",
619
+ request.projectId ?? this.client.settings.defaultProjectId
620
+ ]
621
+ )
622
+ },
623
+ unmarshalListModelsResponse
624
+ );
625
+ /**
626
+ * List all models attached to the **project ID**. Retrieve information about all models of the provided **project ID**.
627
+ *
628
+ * @param request - The request {@link ListModelsRequest}
629
+ * @returns A Promise of ListModelsResponse
630
+ */
631
+ listModels = (request = {}) => enrichForPagination("models", this.pageOfListModels, request);
576
632
  }
577
633
  export {
578
634
  API
@@ -1,4 +1,4 @@
1
- import type { BookingStatus, JobStatus, ProcessStatus, SessionStatus } from './types.gen';
1
+ import type { BookingStatus, JobStatus, ProcessStatus, SessionStatus } from './types.gen.js';
2
2
  /** Lists transient statutes of the enum {@link BookingStatus}. */
3
3
  export declare const BOOKING_TRANSIENT_STATUSES: BookingStatus[];
4
4
  /** Lists transient statutes of the enum {@link JobStatus}. */
@@ -10,6 +10,7 @@ exports.JOB_TRANSIENT_STATUSES = content_gen.JOB_TRANSIENT_STATUSES;
10
10
  exports.PROCESS_TRANSIENT_STATUSES = content_gen.PROCESS_TRANSIENT_STATUSES;
11
11
  exports.SESSION_TRANSIENT_STATUSES = content_gen.SESSION_TRANSIENT_STATUSES;
12
12
  exports.marshalCreateJobRequest = marshalling_gen.marshalCreateJobRequest;
13
+ exports.marshalCreateModelRequest = marshalling_gen.marshalCreateModelRequest;
13
14
  exports.marshalCreateProcessRequest = marshalling_gen.marshalCreateProcessRequest;
14
15
  exports.marshalCreateSessionRequest = marshalling_gen.marshalCreateSessionRequest;
15
16
  exports.marshalUpdateBookingRequest = marshalling_gen.marshalUpdateBookingRequest;
@@ -24,11 +25,13 @@ exports.unmarshalListApplicationsResponse = marshalling_gen.unmarshalListApplica
24
25
  exports.unmarshalListBookingsResponse = marshalling_gen.unmarshalListBookingsResponse;
25
26
  exports.unmarshalListJobResultsResponse = marshalling_gen.unmarshalListJobResultsResponse;
26
27
  exports.unmarshalListJobsResponse = marshalling_gen.unmarshalListJobsResponse;
28
+ exports.unmarshalListModelsResponse = marshalling_gen.unmarshalListModelsResponse;
27
29
  exports.unmarshalListPlatformsResponse = marshalling_gen.unmarshalListPlatformsResponse;
28
30
  exports.unmarshalListProcessResultsResponse = marshalling_gen.unmarshalListProcessResultsResponse;
29
31
  exports.unmarshalListProcessesResponse = marshalling_gen.unmarshalListProcessesResponse;
30
32
  exports.unmarshalListSessionACLsResponse = marshalling_gen.unmarshalListSessionACLsResponse;
31
33
  exports.unmarshalListSessionsResponse = marshalling_gen.unmarshalListSessionsResponse;
34
+ exports.unmarshalModel = marshalling_gen.unmarshalModel;
32
35
  exports.unmarshalPlatform = marshalling_gen.unmarshalPlatform;
33
36
  exports.unmarshalProcess = marshalling_gen.unmarshalProcess;
34
37
  exports.unmarshalSession = marshalling_gen.unmarshalSession;
@@ -1,5 +1,5 @@
1
- export { API } from './api.gen';
2
- export * from './content.gen';
3
- export * from './marshalling.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
- export * as ValidationRules from './validation-rules.gen';
1
+ export { API } from './api.gen.js';
2
+ export * from './content.gen.js';
3
+ export * from './marshalling.gen.js';
4
+ export type { Application, ApplicationType, Booking, BookingStatus, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, CreateSessionRequestBookingDemand, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetBookingRequest, GetJobCircuitRequest, GetJobRequest, GetModelRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, JobResult, JobStatus, ListApplicationsRequest, ListApplicationsRequestOrderBy, ListApplicationsResponse, ListBookingsRequest, ListBookingsRequestOrderBy, ListBookingsResponse, ListJobResultsRequest, ListJobResultsRequestOrderBy, ListJobResultsResponse, ListJobsRequest, ListJobsRequestOrderBy, ListJobsResponse, ListModelsRequest, ListModelsRequestOrderBy, ListModelsResponse, ListPlatformsRequest, ListPlatformsRequestOrderBy, ListPlatformsResponse, ListProcessResultsRequest, ListProcessResultsRequestOrderBy, ListProcessResultsResponse, ListProcessesRequest, ListProcessesRequestOrderBy, ListProcessesResponse, ListSessionACLsRequest, ListSessionACLsRequestOrderBy, ListSessionACLsResponse, ListSessionsRequest, ListSessionsRequestOrderBy, ListSessionsResponse, Model, Platform, PlatformAvailability, PlatformBookingRequirement, PlatformHardware, PlatformTechnology, PlatformType, Process, ProcessResult, ProcessStatus, Session, SessionAccess, SessionOriginType, SessionStatus, TerminateSessionRequest, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest, } from './types.gen.js';
5
+ export * as ValidationRules from './validation-rules.gen.js';
@@ -1,6 +1,6 @@
1
1
  import { API } from "./api.gen.js";
2
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";
3
+ 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";
4
4
  import * as validationRules_gen from "./validation-rules.gen.js";
5
5
  export {
6
6
  API,
@@ -10,6 +10,7 @@ export {
10
10
  SESSION_TRANSIENT_STATUSES,
11
11
  validationRules_gen as ValidationRules,
12
12
  marshalCreateJobRequest,
13
+ marshalCreateModelRequest,
13
14
  marshalCreateProcessRequest,
14
15
  marshalCreateSessionRequest,
15
16
  marshalUpdateBookingRequest,
@@ -24,11 +25,13 @@ export {
24
25
  unmarshalListBookingsResponse,
25
26
  unmarshalListJobResultsResponse,
26
27
  unmarshalListJobsResponse,
28
+ unmarshalListModelsResponse,
27
29
  unmarshalListPlatformsResponse,
28
30
  unmarshalListProcessResultsResponse,
29
31
  unmarshalListProcessesResponse,
30
32
  unmarshalListSessionACLsResponse,
31
33
  unmarshalListSessionsResponse,
34
+ unmarshalModel,
32
35
  unmarshalPlatform,
33
36
  unmarshalProcess,
34
37
  unmarshalSession
@@ -40,6 +40,7 @@ const unmarshalBooking = (data) => {
40
40
  progressMessage: data.progress_message,
41
41
  startedAt: sdkClient.unmarshalDate(data.started_at),
42
42
  status: data.status,
43
+ timeZone: data.time_zone,
43
44
  updatedAt: sdkClient.unmarshalDate(data.updated_at)
44
45
  };
45
46
  };
@@ -53,7 +54,9 @@ const unmarshalJob = (data) => {
53
54
  createdAt: sdkClient.unmarshalDate(data.created_at),
54
55
  id: data.id,
55
56
  jobDuration: data.job_duration,
57
+ modelId: data.model_id,
56
58
  name: data.name,
59
+ parameters: data.parameters,
57
60
  progressMessage: data.progress_message,
58
61
  resultDistribution: data.result_distribution,
59
62
  sessionId: data.session_id,
@@ -63,6 +66,19 @@ const unmarshalJob = (data) => {
63
66
  updatedAt: sdkClient.unmarshalDate(data.updated_at)
64
67
  };
65
68
  };
69
+ const unmarshalModel = (data) => {
70
+ if (!sdkClient.isJSONObject(data)) {
71
+ throw new TypeError(
72
+ `Unmarshalling the type 'Model' failed as data isn't a dictionary.`
73
+ );
74
+ }
75
+ return {
76
+ createdAt: sdkClient.unmarshalDate(data.created_at),
77
+ id: data.id,
78
+ projectId: data.project_id,
79
+ url: data.url
80
+ };
81
+ };
66
82
  const unmarshalPlatformBookingRequirement = (data) => {
67
83
  if (!sdkClient.isJSONObject(data)) {
68
84
  throw new TypeError(
@@ -70,10 +86,13 @@ const unmarshalPlatformBookingRequirement = (data) => {
70
86
  );
71
87
  }
72
88
  return {
89
+ maxBookingPerDay: data.max_booking_per_day,
90
+ maxBookingPerWeek: data.max_booking_per_week,
73
91
  maxCancellationDuration: data.max_cancellation_duration,
74
92
  maxDuration: data.max_duration,
75
93
  maxPlanificationDuration: data.max_planification_duration,
76
- minDuration: data.min_duration
94
+ minDuration: data.min_duration,
95
+ minPlanificationDuration: data.min_planification_duration
77
96
  };
78
97
  };
79
98
  const unmarshalPlatformHardware = (data) => {
@@ -158,9 +177,11 @@ const unmarshalSession = (data) => {
158
177
  id: data.id,
159
178
  maxDuration: data.max_duration,
160
179
  maxIdleDuration: data.max_idle_duration,
180
+ modelId: data.model_id,
161
181
  name: data.name,
162
182
  originId: data.origin_id,
163
183
  originType: data.origin_type,
184
+ parameters: data.parameters,
164
185
  platformId: data.platform_id,
165
186
  progressMessage: data.progress_message,
166
187
  projectId: data.project_id,
@@ -232,6 +253,17 @@ const unmarshalListJobsResponse = (data) => {
232
253
  totalCount: data.total_count
233
254
  };
234
255
  };
256
+ const unmarshalListModelsResponse = (data) => {
257
+ if (!sdkClient.isJSONObject(data)) {
258
+ throw new TypeError(
259
+ `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
260
+ );
261
+ }
262
+ return {
263
+ models: sdkClient.unmarshalArrayOfObject(data.models, unmarshalModel),
264
+ totalCount: data.total_count
265
+ };
266
+ };
235
267
  const unmarshalListPlatformsResponse = (data) => {
236
268
  if (!sdkClient.isJSONObject(data)) {
237
269
  throw new TypeError(
@@ -311,10 +343,16 @@ const marshalJobCircuit = (request, defaults) => ({
311
343
  const marshalCreateJobRequest = (request, defaults) => ({
312
344
  circuit: marshalJobCircuit(request.circuit),
313
345
  max_duration: request.maxDuration,
346
+ model_id: request.modelId,
314
347
  name: request.name,
348
+ parameters: request.parameters,
315
349
  session_id: request.sessionId,
316
350
  tags: request.tags
317
351
  });
352
+ const marshalCreateModelRequest = (request, defaults) => ({
353
+ payload: request.payload,
354
+ project_id: request.projectId ?? defaults.defaultProjectId
355
+ });
318
356
  const marshalCreateProcessRequest = (request, defaults) => ({
319
357
  application_id: request.applicationId,
320
358
  input: request.input,
@@ -326,7 +364,8 @@ const marshalCreateProcessRequest = (request, defaults) => ({
326
364
  const marshalCreateSessionRequestBookingDemand = (request, defaults) => ({
327
365
  description: request.description,
328
366
  finished_at: request.finishedAt,
329
- started_at: request.startedAt
367
+ started_at: request.startedAt,
368
+ time_zone: request.timeZone
330
369
  });
331
370
  const marshalCreateSessionRequest = (request, defaults) => ({
332
371
  booking_demand: request.bookingDemand !== void 0 ? marshalCreateSessionRequestBookingDemand(
@@ -335,7 +374,9 @@ const marshalCreateSessionRequest = (request, defaults) => ({
335
374
  deduplication_id: request.deduplicationId,
336
375
  max_duration: request.maxDuration,
337
376
  max_idle_duration: request.maxIdleDuration,
377
+ model_id: request.modelId,
338
378
  name: request.name,
379
+ parameters: request.parameters,
339
380
  platform_id: request.platformId,
340
381
  project_id: request.projectId ?? defaults.defaultProjectId,
341
382
  tags: request.tags
@@ -358,6 +399,7 @@ const marshalUpdateSessionRequest = (request, defaults) => ({
358
399
  tags: request.tags
359
400
  });
360
401
  exports.marshalCreateJobRequest = marshalCreateJobRequest;
402
+ exports.marshalCreateModelRequest = marshalCreateModelRequest;
361
403
  exports.marshalCreateProcessRequest = marshalCreateProcessRequest;
362
404
  exports.marshalCreateSessionRequest = marshalCreateSessionRequest;
363
405
  exports.marshalUpdateBookingRequest = marshalUpdateBookingRequest;
@@ -372,11 +414,13 @@ exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;
372
414
  exports.unmarshalListBookingsResponse = unmarshalListBookingsResponse;
373
415
  exports.unmarshalListJobResultsResponse = unmarshalListJobResultsResponse;
374
416
  exports.unmarshalListJobsResponse = unmarshalListJobsResponse;
417
+ exports.unmarshalListModelsResponse = unmarshalListModelsResponse;
375
418
  exports.unmarshalListPlatformsResponse = unmarshalListPlatformsResponse;
376
419
  exports.unmarshalListProcessResultsResponse = unmarshalListProcessResultsResponse;
377
420
  exports.unmarshalListProcessesResponse = unmarshalListProcessesResponse;
378
421
  exports.unmarshalListSessionACLsResponse = unmarshalListSessionACLsResponse;
379
422
  exports.unmarshalListSessionsResponse = unmarshalListSessionsResponse;
423
+ exports.unmarshalModel = unmarshalModel;
380
424
  exports.unmarshalPlatform = unmarshalPlatform;
381
425
  exports.unmarshalProcess = unmarshalProcess;
382
426
  exports.unmarshalSession = unmarshalSession;
@@ -1,9 +1,10 @@
1
1
  import type { DefaultValues } from '@scaleway/sdk-client';
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';
2
+ import type { Application, Booking, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, Job, JobCircuit, ListApplicationsResponse, ListBookingsResponse, ListJobResultsResponse, ListJobsResponse, ListModelsResponse, ListPlatformsResponse, ListProcessResultsResponse, ListProcessesResponse, ListSessionACLsResponse, ListSessionsResponse, Model, Platform, Process, Session, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen.js';
3
3
  export declare const unmarshalJobCircuit: (data: unknown) => JobCircuit;
4
4
  export declare const unmarshalApplication: (data: unknown) => Application;
5
5
  export declare const unmarshalBooking: (data: unknown) => Booking;
6
6
  export declare const unmarshalJob: (data: unknown) => Job;
7
+ export declare const unmarshalModel: (data: unknown) => Model;
7
8
  export declare const unmarshalPlatform: (data: unknown) => Platform;
8
9
  export declare const unmarshalProcess: (data: unknown) => Process;
9
10
  export declare const unmarshalSession: (data: unknown) => Session;
@@ -11,12 +12,14 @@ export declare const unmarshalListApplicationsResponse: (data: unknown) => ListA
11
12
  export declare const unmarshalListBookingsResponse: (data: unknown) => ListBookingsResponse;
12
13
  export declare const unmarshalListJobResultsResponse: (data: unknown) => ListJobResultsResponse;
13
14
  export declare const unmarshalListJobsResponse: (data: unknown) => ListJobsResponse;
15
+ export declare const unmarshalListModelsResponse: (data: unknown) => ListModelsResponse;
14
16
  export declare const unmarshalListPlatformsResponse: (data: unknown) => ListPlatformsResponse;
15
17
  export declare const unmarshalListProcessResultsResponse: (data: unknown) => ListProcessResultsResponse;
16
18
  export declare const unmarshalListProcessesResponse: (data: unknown) => ListProcessesResponse;
17
19
  export declare const unmarshalListSessionACLsResponse: (data: unknown) => ListSessionACLsResponse;
18
20
  export declare const unmarshalListSessionsResponse: (data: unknown) => ListSessionsResponse;
19
21
  export declare const marshalCreateJobRequest: (request: CreateJobRequest, defaults: DefaultValues) => Record<string, unknown>;
22
+ export declare const marshalCreateModelRequest: (request: CreateModelRequest, defaults: DefaultValues) => Record<string, unknown>;
20
23
  export declare const marshalCreateProcessRequest: (request: CreateProcessRequest, defaults: DefaultValues) => Record<string, unknown>;
21
24
  export declare const marshalCreateSessionRequest: (request: CreateSessionRequest, defaults: DefaultValues) => Record<string, unknown>;
22
25
  export declare const marshalUpdateBookingRequest: (request: UpdateBookingRequest, defaults: DefaultValues) => Record<string, unknown>;
@@ -38,6 +38,7 @@ const unmarshalBooking = (data) => {
38
38
  progressMessage: data.progress_message,
39
39
  startedAt: unmarshalDate(data.started_at),
40
40
  status: data.status,
41
+ timeZone: data.time_zone,
41
42
  updatedAt: unmarshalDate(data.updated_at)
42
43
  };
43
44
  };
@@ -51,7 +52,9 @@ const unmarshalJob = (data) => {
51
52
  createdAt: unmarshalDate(data.created_at),
52
53
  id: data.id,
53
54
  jobDuration: data.job_duration,
55
+ modelId: data.model_id,
54
56
  name: data.name,
57
+ parameters: data.parameters,
55
58
  progressMessage: data.progress_message,
56
59
  resultDistribution: data.result_distribution,
57
60
  sessionId: data.session_id,
@@ -61,6 +64,19 @@ const unmarshalJob = (data) => {
61
64
  updatedAt: unmarshalDate(data.updated_at)
62
65
  };
63
66
  };
67
+ const unmarshalModel = (data) => {
68
+ if (!isJSONObject(data)) {
69
+ throw new TypeError(
70
+ `Unmarshalling the type 'Model' failed as data isn't a dictionary.`
71
+ );
72
+ }
73
+ return {
74
+ createdAt: unmarshalDate(data.created_at),
75
+ id: data.id,
76
+ projectId: data.project_id,
77
+ url: data.url
78
+ };
79
+ };
64
80
  const unmarshalPlatformBookingRequirement = (data) => {
65
81
  if (!isJSONObject(data)) {
66
82
  throw new TypeError(
@@ -68,10 +84,13 @@ const unmarshalPlatformBookingRequirement = (data) => {
68
84
  );
69
85
  }
70
86
  return {
87
+ maxBookingPerDay: data.max_booking_per_day,
88
+ maxBookingPerWeek: data.max_booking_per_week,
71
89
  maxCancellationDuration: data.max_cancellation_duration,
72
90
  maxDuration: data.max_duration,
73
91
  maxPlanificationDuration: data.max_planification_duration,
74
- minDuration: data.min_duration
92
+ minDuration: data.min_duration,
93
+ minPlanificationDuration: data.min_planification_duration
75
94
  };
76
95
  };
77
96
  const unmarshalPlatformHardware = (data) => {
@@ -156,9 +175,11 @@ const unmarshalSession = (data) => {
156
175
  id: data.id,
157
176
  maxDuration: data.max_duration,
158
177
  maxIdleDuration: data.max_idle_duration,
178
+ modelId: data.model_id,
159
179
  name: data.name,
160
180
  originId: data.origin_id,
161
181
  originType: data.origin_type,
182
+ parameters: data.parameters,
162
183
  platformId: data.platform_id,
163
184
  progressMessage: data.progress_message,
164
185
  projectId: data.project_id,
@@ -230,6 +251,17 @@ const unmarshalListJobsResponse = (data) => {
230
251
  totalCount: data.total_count
231
252
  };
232
253
  };
254
+ const unmarshalListModelsResponse = (data) => {
255
+ if (!isJSONObject(data)) {
256
+ throw new TypeError(
257
+ `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
258
+ );
259
+ }
260
+ return {
261
+ models: unmarshalArrayOfObject(data.models, unmarshalModel),
262
+ totalCount: data.total_count
263
+ };
264
+ };
233
265
  const unmarshalListPlatformsResponse = (data) => {
234
266
  if (!isJSONObject(data)) {
235
267
  throw new TypeError(
@@ -309,10 +341,16 @@ const marshalJobCircuit = (request, defaults) => ({
309
341
  const marshalCreateJobRequest = (request, defaults) => ({
310
342
  circuit: marshalJobCircuit(request.circuit),
311
343
  max_duration: request.maxDuration,
344
+ model_id: request.modelId,
312
345
  name: request.name,
346
+ parameters: request.parameters,
313
347
  session_id: request.sessionId,
314
348
  tags: request.tags
315
349
  });
350
+ const marshalCreateModelRequest = (request, defaults) => ({
351
+ payload: request.payload,
352
+ project_id: request.projectId ?? defaults.defaultProjectId
353
+ });
316
354
  const marshalCreateProcessRequest = (request, defaults) => ({
317
355
  application_id: request.applicationId,
318
356
  input: request.input,
@@ -324,7 +362,8 @@ const marshalCreateProcessRequest = (request, defaults) => ({
324
362
  const marshalCreateSessionRequestBookingDemand = (request, defaults) => ({
325
363
  description: request.description,
326
364
  finished_at: request.finishedAt,
327
- started_at: request.startedAt
365
+ started_at: request.startedAt,
366
+ time_zone: request.timeZone
328
367
  });
329
368
  const marshalCreateSessionRequest = (request, defaults) => ({
330
369
  booking_demand: request.bookingDemand !== void 0 ? marshalCreateSessionRequestBookingDemand(
@@ -333,7 +372,9 @@ const marshalCreateSessionRequest = (request, defaults) => ({
333
372
  deduplication_id: request.deduplicationId,
334
373
  max_duration: request.maxDuration,
335
374
  max_idle_duration: request.maxIdleDuration,
375
+ model_id: request.modelId,
336
376
  name: request.name,
377
+ parameters: request.parameters,
337
378
  platform_id: request.platformId,
338
379
  project_id: request.projectId ?? defaults.defaultProjectId,
339
380
  tags: request.tags
@@ -357,6 +398,7 @@ const marshalUpdateSessionRequest = (request, defaults) => ({
357
398
  });
358
399
  export {
359
400
  marshalCreateJobRequest,
401
+ marshalCreateModelRequest,
360
402
  marshalCreateProcessRequest,
361
403
  marshalCreateSessionRequest,
362
404
  marshalUpdateBookingRequest,
@@ -371,11 +413,13 @@ export {
371
413
  unmarshalListBookingsResponse,
372
414
  unmarshalListJobResultsResponse,
373
415
  unmarshalListJobsResponse,
416
+ unmarshalListModelsResponse,
374
417
  unmarshalListPlatformsResponse,
375
418
  unmarshalListProcessResultsResponse,
376
419
  unmarshalListProcessesResponse,
377
420
  unmarshalListSessionACLsResponse,
378
421
  unmarshalListSessionsResponse,
422
+ unmarshalModel,
379
423
  unmarshalPlatform,
380
424
  unmarshalProcess,
381
425
  unmarshalSession
@@ -6,6 +6,7 @@ export type ListApplicationsRequestOrderBy = 'name_asc' | 'name_desc' | 'type_as
6
6
  export type ListBookingsRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'started_at_desc' | 'started_at_asc';
7
7
  export type ListJobResultsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
8
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';
9
+ export type ListModelsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
9
10
  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
11
  export type ListProcessResultsRequestOrderBy = 'created_at_desc' | 'created_at_asc';
11
12
  export type ListProcessesRequestOrderBy = 'created_at_desc' | 'created_at_asc' | 'name_asc' | 'name_desc' | 'started_at_asc' | 'started_at_desc' | 'status_asc' | 'status_desc';
@@ -35,6 +36,18 @@ export interface PlatformBookingRequirement {
35
36
  * Allowed planification time from now where the platform can be booked in the future.
36
37
  */
37
38
  maxPlanificationDuration?: string;
39
+ /**
40
+ * Minimum planification time before a platform can be booked.
41
+ */
42
+ minPlanificationDuration?: string;
43
+ /**
44
+ * Maximum amount of booking allowed for one organization per week.
45
+ */
46
+ maxBookingPerWeek: number;
47
+ /**
48
+ * Maximum amount of booking allowed for one organization per day.
49
+ */
50
+ maxBookingPerDay: number;
38
51
  }
39
52
  export interface PlatformHardware {
40
53
  /**
@@ -80,6 +93,7 @@ export interface CreateSessionRequestBookingDemand {
80
93
  startedAt?: Date;
81
94
  finishedAt?: Date;
82
95
  description?: string;
96
+ timeZone?: string;
83
97
  }
84
98
  export interface Application {
85
99
  /**
@@ -136,6 +150,10 @@ export interface Booking {
136
150
  * Any progress message of the booking.
137
151
  */
138
152
  progressMessage: string;
153
+ /**
154
+ * Time zone for the booking schedule, in tz database format (e.g. 'Europe/Paris').
155
+ */
156
+ timeZone?: string;
139
157
  }
140
158
  export interface JobResult {
141
159
  /**
@@ -200,6 +218,32 @@ export interface Job {
200
218
  * Result of the job, if the job is finished.
201
219
  */
202
220
  resultDistribution?: string;
221
+ /**
222
+ * Computation model ID executed by the job.
223
+ */
224
+ modelId?: string;
225
+ /**
226
+ * Execution parameters for this job.
227
+ */
228
+ parameters?: string;
229
+ }
230
+ export interface Model {
231
+ /**
232
+ * Unique ID of the model.
233
+ */
234
+ id: string;
235
+ /**
236
+ * Time at which the model was created.
237
+ */
238
+ createdAt?: Date;
239
+ /**
240
+ * Storage URL of the model.
241
+ */
242
+ url?: string;
243
+ /**
244
+ * Project ID in which the model has been created.
245
+ */
246
+ projectId: string;
203
247
  }
204
248
  export interface Platform {
205
249
  /**
@@ -436,6 +480,14 @@ export interface Session {
436
480
  * An optional booking unique ID of an attached booking.
437
481
  */
438
482
  bookingId?: string;
483
+ /**
484
+ * Default computation model ID to be executed by job assigned to this session.
485
+ */
486
+ modelId?: string;
487
+ /**
488
+ * Platform configuration parameters applied to this session.
489
+ */
490
+ parameters?: string;
439
491
  }
440
492
  export type CancelJobRequest = {
441
493
  /**
@@ -470,6 +522,24 @@ export type CreateJobRequest = {
470
522
  * Maximum duration of the job.
471
523
  */
472
524
  maxDuration?: string;
525
+ /**
526
+ * Computation model ID to be executed by the job.
527
+ */
528
+ modelId?: string;
529
+ /**
530
+ * Execution parameters for this job.
531
+ */
532
+ parameters?: string;
533
+ };
534
+ export type CreateModelRequest = {
535
+ /**
536
+ * Project ID to attach this model.
537
+ */
538
+ projectId?: string;
539
+ /**
540
+ * The serialized model data.
541
+ */
542
+ payload?: string;
473
543
  };
474
544
  export type CreateProcessRequest = {
475
545
  /**
@@ -530,6 +600,14 @@ export type CreateSessionRequest = {
530
600
  * A booking demand to schedule the session, only applicable if the platform is bookable.
531
601
  */
532
602
  bookingDemand?: CreateSessionRequestBookingDemand;
603
+ /**
604
+ * Default computation model ID to be executed by job assigned to this session.
605
+ */
606
+ modelId?: string;
607
+ /**
608
+ * Optional platform configuration parameters applied to this session.
609
+ */
610
+ parameters?: string;
533
611
  };
534
612
  export type DeleteJobRequest = {
535
613
  /**
@@ -573,6 +651,12 @@ export type GetJobRequest = {
573
651
  */
574
652
  jobId: string;
575
653
  };
654
+ export type GetModelRequest = {
655
+ /**
656
+ * Unique ID of the model.
657
+ */
658
+ modelId: string;
659
+ };
576
660
  export type GetPlatformRequest = {
577
661
  /**
578
662
  * Unique ID of the platform.
@@ -723,6 +807,34 @@ export interface ListJobsResponse {
723
807
  */
724
808
  jobs: Job[];
725
809
  }
810
+ export type ListModelsRequest = {
811
+ /**
812
+ * List models belonging to this project ID.
813
+ */
814
+ projectId?: string;
815
+ /**
816
+ * Page number.
817
+ */
818
+ page?: number;
819
+ /**
820
+ * Maximum number of results to return per page.
821
+ */
822
+ pageSize?: number;
823
+ /**
824
+ * Sort order of the returned results.
825
+ */
826
+ orderBy?: ListModelsRequestOrderBy;
827
+ };
828
+ export interface ListModelsResponse {
829
+ /**
830
+ * Total number of models.
831
+ */
832
+ totalCount: number;
833
+ /**
834
+ * List of models.
835
+ */
836
+ models: Model[];
837
+ }
726
838
  export type ListPlatformsRequest = {
727
839
  /**
728
840
  * List platforms with this provider name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-qaas",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Scaleway SDK qaas",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -26,17 +26,17 @@
26
26
  "directory": "packages_generated/qaas"
27
27
  },
28
28
  "engines": {
29
- "node": ">=20.19.1"
29
+ "node": ">=20.19.4"
30
30
  },
31
31
  "dependencies": {
32
- "@scaleway/random-name": "5.1.1",
33
- "@scaleway/sdk-std": "1.0.5"
32
+ "@scaleway/random-name": "5.1.2",
33
+ "@scaleway/sdk-std": "1.1.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@scaleway/sdk-client": "^1.3.0"
36
+ "@scaleway/sdk-client": "^1.3.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@scaleway/sdk-client": "^1.3.0"
39
+ "@scaleway/sdk-client": "^1.3.2"
40
40
  },
41
41
  "scripts": {
42
42
  "package:check": "pnpm publint",