@scaleway/sdk-qaas 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v1alpha1/api.gen.cjs +56 -0
- package/dist/v1alpha1/api.gen.d.ts +27 -2
- package/dist/v1alpha1/api.gen.js +57 -1
- package/dist/v1alpha1/index.gen.cjs +3 -0
- package/dist/v1alpha1/index.gen.d.ts +1 -1
- package/dist/v1alpha1/index.gen.js +4 -1
- package/dist/v1alpha1/marshalling.gen.cjs +39 -0
- package/dist/v1alpha1/marshalling.gen.d.ts +4 -1
- package/dist/v1alpha1/marshalling.gen.js +39 -0
- package/dist/v1alpha1/types.gen.d.ts +95 -0
- package/package.json +6 -6
|
@@ -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
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
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, ListProcessesRequest, ListProcessesResponse, ListProcessResultsRequest, ListProcessResultsResponse, ListSessionACLsRequest, ListSessionACLsResponse, ListSessionsRequest, ListSessionsResponse, Model, Platform, Process, Session, TerminateSessionRequest, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen';
|
|
4
4
|
/**
|
|
5
5
|
* Quantum as a Service API.
|
|
6
6
|
|
|
@@ -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
|
}
|
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
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
|
|
@@ -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
1
|
export { API } from './api.gen';
|
|
2
2
|
export * from './content.gen';
|
|
3
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,
|
|
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, ListProcessesRequest, ListProcessesRequestOrderBy, ListProcessesResponse, ListProcessResultsRequest, ListProcessResultsRequestOrderBy, ListProcessResultsResponse, 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';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen';
|
|
@@ -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
|
|
@@ -53,7 +53,9 @@ const unmarshalJob = (data) => {
|
|
|
53
53
|
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
54
54
|
id: data.id,
|
|
55
55
|
jobDuration: data.job_duration,
|
|
56
|
+
modelId: data.model_id,
|
|
56
57
|
name: data.name,
|
|
58
|
+
parameters: data.parameters,
|
|
57
59
|
progressMessage: data.progress_message,
|
|
58
60
|
resultDistribution: data.result_distribution,
|
|
59
61
|
sessionId: data.session_id,
|
|
@@ -63,6 +65,19 @@ const unmarshalJob = (data) => {
|
|
|
63
65
|
updatedAt: sdkClient.unmarshalDate(data.updated_at)
|
|
64
66
|
};
|
|
65
67
|
};
|
|
68
|
+
const unmarshalModel = (data) => {
|
|
69
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
70
|
+
throw new TypeError(
|
|
71
|
+
`Unmarshalling the type 'Model' failed as data isn't a dictionary.`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
createdAt: sdkClient.unmarshalDate(data.created_at),
|
|
76
|
+
id: data.id,
|
|
77
|
+
projectId: data.project_id,
|
|
78
|
+
url: data.url
|
|
79
|
+
};
|
|
80
|
+
};
|
|
66
81
|
const unmarshalPlatformBookingRequirement = (data) => {
|
|
67
82
|
if (!sdkClient.isJSONObject(data)) {
|
|
68
83
|
throw new TypeError(
|
|
@@ -158,9 +173,11 @@ const unmarshalSession = (data) => {
|
|
|
158
173
|
id: data.id,
|
|
159
174
|
maxDuration: data.max_duration,
|
|
160
175
|
maxIdleDuration: data.max_idle_duration,
|
|
176
|
+
modelId: data.model_id,
|
|
161
177
|
name: data.name,
|
|
162
178
|
originId: data.origin_id,
|
|
163
179
|
originType: data.origin_type,
|
|
180
|
+
parameters: data.parameters,
|
|
164
181
|
platformId: data.platform_id,
|
|
165
182
|
progressMessage: data.progress_message,
|
|
166
183
|
projectId: data.project_id,
|
|
@@ -232,6 +249,17 @@ const unmarshalListJobsResponse = (data) => {
|
|
|
232
249
|
totalCount: data.total_count
|
|
233
250
|
};
|
|
234
251
|
};
|
|
252
|
+
const unmarshalListModelsResponse = (data) => {
|
|
253
|
+
if (!sdkClient.isJSONObject(data)) {
|
|
254
|
+
throw new TypeError(
|
|
255
|
+
`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
models: sdkClient.unmarshalArrayOfObject(data.models, unmarshalModel),
|
|
260
|
+
totalCount: data.total_count
|
|
261
|
+
};
|
|
262
|
+
};
|
|
235
263
|
const unmarshalListPlatformsResponse = (data) => {
|
|
236
264
|
if (!sdkClient.isJSONObject(data)) {
|
|
237
265
|
throw new TypeError(
|
|
@@ -311,10 +339,16 @@ const marshalJobCircuit = (request, defaults) => ({
|
|
|
311
339
|
const marshalCreateJobRequest = (request, defaults) => ({
|
|
312
340
|
circuit: marshalJobCircuit(request.circuit),
|
|
313
341
|
max_duration: request.maxDuration,
|
|
342
|
+
model_id: request.modelId,
|
|
314
343
|
name: request.name,
|
|
344
|
+
parameters: request.parameters,
|
|
315
345
|
session_id: request.sessionId,
|
|
316
346
|
tags: request.tags
|
|
317
347
|
});
|
|
348
|
+
const marshalCreateModelRequest = (request, defaults) => ({
|
|
349
|
+
payload: request.payload,
|
|
350
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
351
|
+
});
|
|
318
352
|
const marshalCreateProcessRequest = (request, defaults) => ({
|
|
319
353
|
application_id: request.applicationId,
|
|
320
354
|
input: request.input,
|
|
@@ -335,7 +369,9 @@ const marshalCreateSessionRequest = (request, defaults) => ({
|
|
|
335
369
|
deduplication_id: request.deduplicationId,
|
|
336
370
|
max_duration: request.maxDuration,
|
|
337
371
|
max_idle_duration: request.maxIdleDuration,
|
|
372
|
+
model_id: request.modelId,
|
|
338
373
|
name: request.name,
|
|
374
|
+
parameters: request.parameters,
|
|
339
375
|
platform_id: request.platformId,
|
|
340
376
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
341
377
|
tags: request.tags
|
|
@@ -358,6 +394,7 @@ const marshalUpdateSessionRequest = (request, defaults) => ({
|
|
|
358
394
|
tags: request.tags
|
|
359
395
|
});
|
|
360
396
|
exports.marshalCreateJobRequest = marshalCreateJobRequest;
|
|
397
|
+
exports.marshalCreateModelRequest = marshalCreateModelRequest;
|
|
361
398
|
exports.marshalCreateProcessRequest = marshalCreateProcessRequest;
|
|
362
399
|
exports.marshalCreateSessionRequest = marshalCreateSessionRequest;
|
|
363
400
|
exports.marshalUpdateBookingRequest = marshalUpdateBookingRequest;
|
|
@@ -372,11 +409,13 @@ exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;
|
|
|
372
409
|
exports.unmarshalListBookingsResponse = unmarshalListBookingsResponse;
|
|
373
410
|
exports.unmarshalListJobResultsResponse = unmarshalListJobResultsResponse;
|
|
374
411
|
exports.unmarshalListJobsResponse = unmarshalListJobsResponse;
|
|
412
|
+
exports.unmarshalListModelsResponse = unmarshalListModelsResponse;
|
|
375
413
|
exports.unmarshalListPlatformsResponse = unmarshalListPlatformsResponse;
|
|
376
414
|
exports.unmarshalListProcessResultsResponse = unmarshalListProcessResultsResponse;
|
|
377
415
|
exports.unmarshalListProcessesResponse = unmarshalListProcessesResponse;
|
|
378
416
|
exports.unmarshalListSessionACLsResponse = unmarshalListSessionACLsResponse;
|
|
379
417
|
exports.unmarshalListSessionsResponse = unmarshalListSessionsResponse;
|
|
418
|
+
exports.unmarshalModel = unmarshalModel;
|
|
380
419
|
exports.unmarshalPlatform = unmarshalPlatform;
|
|
381
420
|
exports.unmarshalProcess = unmarshalProcess;
|
|
382
421
|
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,
|
|
2
|
+
import type { Application, Booking, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, Job, JobCircuit, ListApplicationsResponse, ListBookingsResponse, ListJobResultsResponse, ListJobsResponse, ListModelsResponse, ListPlatformsResponse, ListProcessesResponse, ListProcessResultsResponse, ListSessionACLsResponse, ListSessionsResponse, Model, 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
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>;
|
|
@@ -51,7 +51,9 @@ const unmarshalJob = (data) => {
|
|
|
51
51
|
createdAt: unmarshalDate(data.created_at),
|
|
52
52
|
id: data.id,
|
|
53
53
|
jobDuration: data.job_duration,
|
|
54
|
+
modelId: data.model_id,
|
|
54
55
|
name: data.name,
|
|
56
|
+
parameters: data.parameters,
|
|
55
57
|
progressMessage: data.progress_message,
|
|
56
58
|
resultDistribution: data.result_distribution,
|
|
57
59
|
sessionId: data.session_id,
|
|
@@ -61,6 +63,19 @@ const unmarshalJob = (data) => {
|
|
|
61
63
|
updatedAt: unmarshalDate(data.updated_at)
|
|
62
64
|
};
|
|
63
65
|
};
|
|
66
|
+
const unmarshalModel = (data) => {
|
|
67
|
+
if (!isJSONObject(data)) {
|
|
68
|
+
throw new TypeError(
|
|
69
|
+
`Unmarshalling the type 'Model' failed as data isn't a dictionary.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
createdAt: unmarshalDate(data.created_at),
|
|
74
|
+
id: data.id,
|
|
75
|
+
projectId: data.project_id,
|
|
76
|
+
url: data.url
|
|
77
|
+
};
|
|
78
|
+
};
|
|
64
79
|
const unmarshalPlatformBookingRequirement = (data) => {
|
|
65
80
|
if (!isJSONObject(data)) {
|
|
66
81
|
throw new TypeError(
|
|
@@ -156,9 +171,11 @@ const unmarshalSession = (data) => {
|
|
|
156
171
|
id: data.id,
|
|
157
172
|
maxDuration: data.max_duration,
|
|
158
173
|
maxIdleDuration: data.max_idle_duration,
|
|
174
|
+
modelId: data.model_id,
|
|
159
175
|
name: data.name,
|
|
160
176
|
originId: data.origin_id,
|
|
161
177
|
originType: data.origin_type,
|
|
178
|
+
parameters: data.parameters,
|
|
162
179
|
platformId: data.platform_id,
|
|
163
180
|
progressMessage: data.progress_message,
|
|
164
181
|
projectId: data.project_id,
|
|
@@ -230,6 +247,17 @@ const unmarshalListJobsResponse = (data) => {
|
|
|
230
247
|
totalCount: data.total_count
|
|
231
248
|
};
|
|
232
249
|
};
|
|
250
|
+
const unmarshalListModelsResponse = (data) => {
|
|
251
|
+
if (!isJSONObject(data)) {
|
|
252
|
+
throw new TypeError(
|
|
253
|
+
`Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
models: unmarshalArrayOfObject(data.models, unmarshalModel),
|
|
258
|
+
totalCount: data.total_count
|
|
259
|
+
};
|
|
260
|
+
};
|
|
233
261
|
const unmarshalListPlatformsResponse = (data) => {
|
|
234
262
|
if (!isJSONObject(data)) {
|
|
235
263
|
throw new TypeError(
|
|
@@ -309,10 +337,16 @@ const marshalJobCircuit = (request, defaults) => ({
|
|
|
309
337
|
const marshalCreateJobRequest = (request, defaults) => ({
|
|
310
338
|
circuit: marshalJobCircuit(request.circuit),
|
|
311
339
|
max_duration: request.maxDuration,
|
|
340
|
+
model_id: request.modelId,
|
|
312
341
|
name: request.name,
|
|
342
|
+
parameters: request.parameters,
|
|
313
343
|
session_id: request.sessionId,
|
|
314
344
|
tags: request.tags
|
|
315
345
|
});
|
|
346
|
+
const marshalCreateModelRequest = (request, defaults) => ({
|
|
347
|
+
payload: request.payload,
|
|
348
|
+
project_id: request.projectId ?? defaults.defaultProjectId
|
|
349
|
+
});
|
|
316
350
|
const marshalCreateProcessRequest = (request, defaults) => ({
|
|
317
351
|
application_id: request.applicationId,
|
|
318
352
|
input: request.input,
|
|
@@ -333,7 +367,9 @@ const marshalCreateSessionRequest = (request, defaults) => ({
|
|
|
333
367
|
deduplication_id: request.deduplicationId,
|
|
334
368
|
max_duration: request.maxDuration,
|
|
335
369
|
max_idle_duration: request.maxIdleDuration,
|
|
370
|
+
model_id: request.modelId,
|
|
336
371
|
name: request.name,
|
|
372
|
+
parameters: request.parameters,
|
|
337
373
|
platform_id: request.platformId,
|
|
338
374
|
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
339
375
|
tags: request.tags
|
|
@@ -357,6 +393,7 @@ const marshalUpdateSessionRequest = (request, defaults) => ({
|
|
|
357
393
|
});
|
|
358
394
|
export {
|
|
359
395
|
marshalCreateJobRequest,
|
|
396
|
+
marshalCreateModelRequest,
|
|
360
397
|
marshalCreateProcessRequest,
|
|
361
398
|
marshalCreateSessionRequest,
|
|
362
399
|
marshalUpdateBookingRequest,
|
|
@@ -371,11 +408,13 @@ export {
|
|
|
371
408
|
unmarshalListBookingsResponse,
|
|
372
409
|
unmarshalListJobResultsResponse,
|
|
373
410
|
unmarshalListJobsResponse,
|
|
411
|
+
unmarshalListModelsResponse,
|
|
374
412
|
unmarshalListPlatformsResponse,
|
|
375
413
|
unmarshalListProcessResultsResponse,
|
|
376
414
|
unmarshalListProcessesResponse,
|
|
377
415
|
unmarshalListSessionACLsResponse,
|
|
378
416
|
unmarshalListSessionsResponse,
|
|
417
|
+
unmarshalModel,
|
|
379
418
|
unmarshalPlatform,
|
|
380
419
|
unmarshalProcess,
|
|
381
420
|
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';
|
|
@@ -200,6 +201,32 @@ export interface Job {
|
|
|
200
201
|
* Result of the job, if the job is finished.
|
|
201
202
|
*/
|
|
202
203
|
resultDistribution?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Computation model ID executed by the job.
|
|
206
|
+
*/
|
|
207
|
+
modelId?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Execution parameters for this job.
|
|
210
|
+
*/
|
|
211
|
+
parameters?: string;
|
|
212
|
+
}
|
|
213
|
+
export interface Model {
|
|
214
|
+
/**
|
|
215
|
+
* Unique ID of the model.
|
|
216
|
+
*/
|
|
217
|
+
id: string;
|
|
218
|
+
/**
|
|
219
|
+
* Time at which the model was created.
|
|
220
|
+
*/
|
|
221
|
+
createdAt?: Date;
|
|
222
|
+
/**
|
|
223
|
+
* Storage URL of the model.
|
|
224
|
+
*/
|
|
225
|
+
url?: string;
|
|
226
|
+
/**
|
|
227
|
+
* Project ID in which the model has been created.
|
|
228
|
+
*/
|
|
229
|
+
projectId: string;
|
|
203
230
|
}
|
|
204
231
|
export interface Platform {
|
|
205
232
|
/**
|
|
@@ -436,6 +463,14 @@ export interface Session {
|
|
|
436
463
|
* An optional booking unique ID of an attached booking.
|
|
437
464
|
*/
|
|
438
465
|
bookingId?: string;
|
|
466
|
+
/**
|
|
467
|
+
* Default computation model ID to be executed by job assigned to this session.
|
|
468
|
+
*/
|
|
469
|
+
modelId?: string;
|
|
470
|
+
/**
|
|
471
|
+
* Platform configuration parameters applied to this session.
|
|
472
|
+
*/
|
|
473
|
+
parameters?: string;
|
|
439
474
|
}
|
|
440
475
|
export type CancelJobRequest = {
|
|
441
476
|
/**
|
|
@@ -470,6 +505,24 @@ export type CreateJobRequest = {
|
|
|
470
505
|
* Maximum duration of the job.
|
|
471
506
|
*/
|
|
472
507
|
maxDuration?: string;
|
|
508
|
+
/**
|
|
509
|
+
* Computation model ID to be executed by the job.
|
|
510
|
+
*/
|
|
511
|
+
modelId?: string;
|
|
512
|
+
/**
|
|
513
|
+
* Execution parameters for this job.
|
|
514
|
+
*/
|
|
515
|
+
parameters?: string;
|
|
516
|
+
};
|
|
517
|
+
export type CreateModelRequest = {
|
|
518
|
+
/**
|
|
519
|
+
* Project ID to attach this model.
|
|
520
|
+
*/
|
|
521
|
+
projectId?: string;
|
|
522
|
+
/**
|
|
523
|
+
* The serialized model data.
|
|
524
|
+
*/
|
|
525
|
+
payload?: string;
|
|
473
526
|
};
|
|
474
527
|
export type CreateProcessRequest = {
|
|
475
528
|
/**
|
|
@@ -530,6 +583,14 @@ export type CreateSessionRequest = {
|
|
|
530
583
|
* A booking demand to schedule the session, only applicable if the platform is bookable.
|
|
531
584
|
*/
|
|
532
585
|
bookingDemand?: CreateSessionRequestBookingDemand;
|
|
586
|
+
/**
|
|
587
|
+
* Default computation model ID to be executed by job assigned to this session.
|
|
588
|
+
*/
|
|
589
|
+
modelId?: string;
|
|
590
|
+
/**
|
|
591
|
+
* Optional platform configuration parameters applied to this session.
|
|
592
|
+
*/
|
|
593
|
+
parameters?: string;
|
|
533
594
|
};
|
|
534
595
|
export type DeleteJobRequest = {
|
|
535
596
|
/**
|
|
@@ -573,6 +634,12 @@ export type GetJobRequest = {
|
|
|
573
634
|
*/
|
|
574
635
|
jobId: string;
|
|
575
636
|
};
|
|
637
|
+
export type GetModelRequest = {
|
|
638
|
+
/**
|
|
639
|
+
* Unique ID of the model.
|
|
640
|
+
*/
|
|
641
|
+
modelId: string;
|
|
642
|
+
};
|
|
576
643
|
export type GetPlatformRequest = {
|
|
577
644
|
/**
|
|
578
645
|
* Unique ID of the platform.
|
|
@@ -723,6 +790,34 @@ export interface ListJobsResponse {
|
|
|
723
790
|
*/
|
|
724
791
|
jobs: Job[];
|
|
725
792
|
}
|
|
793
|
+
export type ListModelsRequest = {
|
|
794
|
+
/**
|
|
795
|
+
* List models belonging to this project ID.
|
|
796
|
+
*/
|
|
797
|
+
projectId?: string;
|
|
798
|
+
/**
|
|
799
|
+
* Page number.
|
|
800
|
+
*/
|
|
801
|
+
page?: number;
|
|
802
|
+
/**
|
|
803
|
+
* Maximum number of results to return per page.
|
|
804
|
+
*/
|
|
805
|
+
pageSize?: number;
|
|
806
|
+
/**
|
|
807
|
+
* Sort order of the returned results.
|
|
808
|
+
*/
|
|
809
|
+
orderBy?: ListModelsRequestOrderBy;
|
|
810
|
+
};
|
|
811
|
+
export interface ListModelsResponse {
|
|
812
|
+
/**
|
|
813
|
+
* Total number of models.
|
|
814
|
+
*/
|
|
815
|
+
totalCount: number;
|
|
816
|
+
/**
|
|
817
|
+
* List of models.
|
|
818
|
+
*/
|
|
819
|
+
models: Model[];
|
|
820
|
+
}
|
|
726
821
|
export type ListPlatformsRequest = {
|
|
727
822
|
/**
|
|
728
823
|
* 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.
|
|
3
|
+
"version": "1.3.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.
|
|
29
|
+
"node": ">=20.19.4"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@scaleway/random-name": "5.1.
|
|
33
|
-
"@scaleway/sdk-std": "1.0.
|
|
32
|
+
"@scaleway/random-name": "5.1.2",
|
|
33
|
+
"@scaleway/sdk-std": "1.0.6"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.3.
|
|
36
|
+
"@scaleway/sdk-client": "^1.3.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.3.
|
|
39
|
+
"@scaleway/sdk-client": "^1.3.1"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"package:check": "pnpm publint",
|