@scaleway/sdk 2.46.0 → 2.47.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/api/baremetal/v1/api.gen.cjs +3 -1
- package/dist/api/baremetal/v1/api.gen.js +3 -1
- package/dist/api/edge_services/v1alpha1/api.gen.cjs +599 -0
- package/dist/api/edge_services/v1alpha1/api.gen.js +599 -0
- package/dist/api/edge_services/v1alpha1/content.gen.cjs +8 -0
- package/dist/api/edge_services/v1alpha1/content.gen.js +8 -0
- package/dist/api/edge_services/v1alpha1/index.gen.cjs +7 -0
- package/dist/api/edge_services/v1alpha1/index.gen.js +7 -0
- package/dist/api/edge_services/v1alpha1/marshalling.gen.cjs +434 -0
- package/dist/api/edge_services/v1alpha1/marshalling.gen.js +434 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.cjs +1 -0
- package/dist/api/iam/v1alpha1/marshalling.gen.js +1 -0
- package/dist/api/iam/v1alpha1/types.gen.d.ts +2 -0
- package/dist/api/index.d.ts +65 -35
- package/dist/api/inference/v1beta1/api.gen.cjs +306 -0
- package/dist/api/inference/v1beta1/api.gen.js +306 -0
- package/dist/api/inference/v1beta1/content.gen.cjs +8 -0
- package/dist/api/inference/v1beta1/content.gen.js +8 -0
- package/dist/api/inference/v1beta1/index.gen.cjs +8 -0
- package/dist/api/inference/v1beta1/index.gen.js +8 -0
- package/dist/api/inference/v1beta1/marshalling.gen.cjs +273 -0
- package/dist/api/inference/v1beta1/marshalling.gen.js +273 -0
- package/dist/api/inference/v1beta1/validation-rules.gen.cjs +56 -0
- package/dist/api/inference/v1beta1/validation-rules.gen.js +56 -0
- package/dist/api/k8s/v1/validation-rules.gen.cjs +65 -0
- package/dist/api/k8s/v1/validation-rules.gen.d.ts +62 -0
- package/dist/api/k8s/v1/validation-rules.gen.js +66 -1
- package/dist/api/mnq/index.gen.cjs +4 -0
- package/dist/api/mnq/index.gen.js +4 -0
- package/dist/api/qaas/v1alpha1/api.gen.cjs +527 -0
- package/dist/api/qaas/v1alpha1/api.gen.js +527 -0
- package/dist/api/qaas/v1alpha1/content.gen.cjs +19 -0
- package/dist/api/qaas/v1alpha1/content.gen.js +19 -0
- package/dist/api/qaas/v1alpha1/index.gen.cjs +10 -0
- package/dist/api/qaas/v1alpha1/index.gen.js +10 -0
- package/dist/api/qaas/v1alpha1/marshalling.gen.cjs +320 -0
- package/dist/api/qaas/v1alpha1/marshalling.gen.js +320 -0
- package/dist/api/qaas/v1alpha1/validation-rules.gen.cjs +14 -0
- package/dist/api/qaas/v1alpha1/validation-rules.gen.js +14 -0
- package/dist/api/tem/index.gen.cjs +4 -0
- package/dist/api/tem/index.gen.js +4 -0
- package/dist/api/tem/v1alpha1/api.gen.cjs +32 -0
- package/dist/api/tem/v1alpha1/api.gen.d.ts +17 -1
- package/dist/api/tem/v1alpha1/api.gen.js +33 -1
- package/dist/api/tem/v1alpha1/index.gen.d.ts +1 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.cjs +36 -0
- package/dist/api/tem/v1alpha1/marshalling.gen.d.ts +3 -1
- package/dist/api/tem/v1alpha1/marshalling.gen.js +36 -0
- package/dist/api/tem/v1alpha1/types.gen.d.ts +51 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.cjs +11 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.d.ts +10 -0
- package/dist/api/tem/v1alpha1/validation-rules.gen.js +11 -0
- package/dist/api/webhosting/index.gen.cjs +6 -0
- package/dist/api/webhosting/index.gen.js +6 -0
- package/dist/api/webhosting/v1/api.gen.cjs +620 -0
- package/dist/api/webhosting/v1/api.gen.js +620 -0
- package/dist/api/webhosting/v1/content.gen.cjs +14 -0
- package/dist/api/webhosting/v1/content.gen.js +14 -0
- package/dist/api/webhosting/v1/index.gen.cjs +15 -0
- package/dist/api/webhosting/v1/index.gen.js +15 -0
- package/dist/api/webhosting/v1/marshalling.gen.cjs +391 -0
- package/dist/api/webhosting/v1/marshalling.gen.js +391 -0
- package/dist/api/webhosting/v1/types.gen.d.ts +5 -0
- package/dist/api/webhosting/v1/validation-rules.gen.cjs +82 -0
- package/dist/api/webhosting/v1/validation-rules.gen.js +82 -0
- package/dist/index.cjs +92 -70
- package/dist/index.js +92 -70
- package/dist/scw/constants.cjs +1 -1
- package/dist/scw/constants.d.ts +2 -2
- package/dist/scw/constants.js +1 -1
- package/package.json +2 -2
- package/dist/api/account/index.d.ts +0 -2
- package/dist/api/applesilicon/index.d.ts +0 -1
- package/dist/api/baremetal/index.d.ts +0 -1
- package/dist/api/billing/index.d.ts +0 -2
- package/dist/api/block/index.d.ts +0 -1
- package/dist/api/cockpit/index.d.ts +0 -2
- package/dist/api/container/index.d.ts +0 -1
- package/dist/api/dedibox/index.d.ts +0 -1
- package/dist/api/document_db/index.d.ts +0 -1
- package/dist/api/domain/index.d.ts +0 -1
- package/dist/api/edge_services/index.d.ts +0 -1
- package/dist/api/flexibleip/index.d.ts +0 -1
- package/dist/api/function/index.d.ts +0 -1
- package/dist/api/iam/index.d.ts +0 -1
- package/dist/api/instance/index.d.ts +0 -1
- package/dist/api/iot/index.d.ts +0 -1
- package/dist/api/ipam/index.d.ts +0 -1
- package/dist/api/ipfs/index.d.ts +0 -1
- package/dist/api/jobs/index.d.ts +0 -1
- package/dist/api/k8s/index.d.ts +0 -1
- package/dist/api/key_manager/index.d.ts +0 -1
- package/dist/api/lb/index.d.ts +0 -1
- package/dist/api/llm_inference/index.d.ts +0 -1
- package/dist/api/marketplace/index.d.ts +0 -1
- package/dist/api/mnq/index.d.ts +0 -1
- package/dist/api/rdb/index.d.ts +0 -1
- package/dist/api/redis/index.d.ts +0 -1
- package/dist/api/registry/index.d.ts +0 -1
- package/dist/api/secret/index.d.ts +0 -2
- package/dist/api/serverless_sqldb/index.d.ts +0 -1
- package/dist/api/tem/index.d.ts +0 -1
- package/dist/api/test/index.d.ts +0 -1
- package/dist/api/vpc/index.d.ts +0 -2
- package/dist/api/vpcgw/index.d.ts +0 -1
- package/dist/api/webhosting/index.d.ts +0 -1
- /package/dist/api/account/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/account/{index.js → index.gen.js} +0 -0
- /package/dist/api/applesilicon/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/applesilicon/{index.js → index.gen.js} +0 -0
- /package/dist/api/baremetal/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/baremetal/{index.js → index.gen.js} +0 -0
- /package/dist/api/billing/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/billing/{index.js → index.gen.js} +0 -0
- /package/dist/api/block/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/block/{index.js → index.gen.js} +0 -0
- /package/dist/api/cockpit/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/cockpit/{index.js → index.gen.js} +0 -0
- /package/dist/api/container/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/container/{index.js → index.gen.js} +0 -0
- /package/dist/api/dedibox/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/dedibox/{index.js → index.gen.js} +0 -0
- /package/dist/api/document_db/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/document_db/{index.js → index.gen.js} +0 -0
- /package/dist/api/domain/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/domain/{index.js → index.gen.js} +0 -0
- /package/dist/api/{flexibleip/index.cjs → edge_services/index.gen.cjs} +0 -0
- /package/dist/api/{flexibleip/index.js → edge_services/index.gen.js} +0 -0
- /package/dist/api/{iam/index.cjs → flexibleip/index.gen.cjs} +0 -0
- /package/dist/api/{iam/index.js → flexibleip/index.gen.js} +0 -0
- /package/dist/api/function/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/function/{index.js → index.gen.js} +0 -0
- /package/dist/api/{ipfs/index.cjs → iam/index.gen.cjs} +0 -0
- /package/dist/api/{ipfs/index.js → iam/index.gen.js} +0 -0
- /package/dist/api/{llm_inference/index.cjs → inference/index.gen.cjs} +0 -0
- /package/dist/api/{llm_inference/index.js → inference/index.gen.js} +0 -0
- /package/dist/api/instance/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/instance/{index.js → index.gen.js} +0 -0
- /package/dist/api/iot/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/iot/{index.js → index.gen.js} +0 -0
- /package/dist/api/ipam/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/ipam/{index.js → index.gen.js} +0 -0
- /package/dist/api/{jobs/index.cjs → ipfs/index.gen.cjs} +0 -0
- /package/dist/api/{jobs/index.js → ipfs/index.gen.js} +0 -0
- /package/dist/api/{key_manager/index.cjs → jobs/index.gen.cjs} +0 -0
- /package/dist/api/{key_manager/index.js → jobs/index.gen.js} +0 -0
- /package/dist/api/k8s/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/k8s/{index.js → index.gen.js} +0 -0
- /package/dist/api/{serverless_sqldb/index.cjs → key_manager/index.gen.cjs} +0 -0
- /package/dist/api/{serverless_sqldb/index.js → key_manager/index.gen.js} +0 -0
- /package/dist/api/lb/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/lb/{index.js → index.gen.js} +0 -0
- /package/dist/api/{mnq/index.cjs → llm_inference/index.gen.cjs} +0 -0
- /package/dist/api/{mnq/index.js → llm_inference/index.gen.js} +0 -0
- /package/dist/api/marketplace/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/marketplace/{index.js → index.gen.js} +0 -0
- /package/dist/api/{tem/index.cjs → qaas/index.gen.cjs} +0 -0
- /package/dist/api/{tem/index.js → qaas/index.gen.js} +0 -0
- /package/dist/api/rdb/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/rdb/{index.js → index.gen.js} +0 -0
- /package/dist/api/redis/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/redis/{index.js → index.gen.js} +0 -0
- /package/dist/api/registry/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/registry/{index.js → index.gen.js} +0 -0
- /package/dist/api/secret/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/secret/{index.js → index.gen.js} +0 -0
- /package/dist/api/{webhosting/index.cjs → serverless_sqldb/index.gen.cjs} +0 -0
- /package/dist/api/{webhosting/index.js → serverless_sqldb/index.gen.js} +0 -0
- /package/dist/api/test/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/test/{index.js → index.gen.js} +0 -0
- /package/dist/api/vpc/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/vpc/{index.js → index.gen.js} +0 -0
- /package/dist/api/vpcgw/{index.cjs → index.gen.cjs} +0 -0
- /package/dist/api/vpcgw/{index.js → index.gen.js} +0 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const json = require("../../../helpers/json.cjs");
|
|
4
|
+
const customMarshalling = require("../../../scw/custom-marshalling.cjs");
|
|
5
|
+
const marshalling = require("../../../helpers/marshalling.cjs");
|
|
6
|
+
const unmarshalJobCircuit = (data) => {
|
|
7
|
+
if (!json.isJSONObject(data)) {
|
|
8
|
+
throw new TypeError(
|
|
9
|
+
`Unmarshalling the type 'JobCircuit' failed as data isn't a dictionary.`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
percevalCircuit: data.perceval_circuit,
|
|
14
|
+
qiskitCircuit: data.qiskit_circuit
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const unmarshalApplication = (data) => {
|
|
18
|
+
if (!json.isJSONObject(data)) {
|
|
19
|
+
throw new TypeError(
|
|
20
|
+
`Unmarshalling the type 'Application' failed as data isn't a dictionary.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
compatiblePlatformIds: data.compatible_platform_ids,
|
|
25
|
+
id: data.id,
|
|
26
|
+
inputTemplate: data.input_template,
|
|
27
|
+
name: data.name,
|
|
28
|
+
type: data.type
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const unmarshalJob = (data) => {
|
|
32
|
+
if (!json.isJSONObject(data)) {
|
|
33
|
+
throw new TypeError(
|
|
34
|
+
`Unmarshalling the type 'Job' failed as data isn't a dictionary.`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
39
|
+
id: data.id,
|
|
40
|
+
jobDuration: data.job_duration,
|
|
41
|
+
name: data.name,
|
|
42
|
+
progressMessage: data.progress_message,
|
|
43
|
+
resultDistribution: data.result_distribution,
|
|
44
|
+
sessionId: data.session_id,
|
|
45
|
+
startedAt: marshalling.unmarshalDate(data.started_at),
|
|
46
|
+
status: data.status,
|
|
47
|
+
tags: data.tags,
|
|
48
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const unmarshalPlatformHardware = (data) => {
|
|
52
|
+
if (!json.isJSONObject(data)) {
|
|
53
|
+
throw new TypeError(
|
|
54
|
+
`Unmarshalling the type 'PlatformHardware' failed as data isn't a dictionary.`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
gpus: data.gpus,
|
|
59
|
+
gpusNetwork: data.gpus_network,
|
|
60
|
+
name: data.name,
|
|
61
|
+
ram: data.ram,
|
|
62
|
+
vcpus: data.vcpus,
|
|
63
|
+
vram: data.vram
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const unmarshalPlatform = (data) => {
|
|
67
|
+
if (!json.isJSONObject(data)) {
|
|
68
|
+
throw new TypeError(
|
|
69
|
+
`Unmarshalling the type 'Platform' failed as data isn't a dictionary.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
availability: data.availability,
|
|
74
|
+
backendName: data.backend_name,
|
|
75
|
+
hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : void 0,
|
|
76
|
+
id: data.id,
|
|
77
|
+
maxQubitCount: data.max_qubit_count,
|
|
78
|
+
metadata: data.metadata,
|
|
79
|
+
name: data.name,
|
|
80
|
+
pricePerHour: data.price_per_hour ? customMarshalling.unmarshalMoney(data.price_per_hour) : void 0,
|
|
81
|
+
providerName: data.provider_name,
|
|
82
|
+
technology: data.technology,
|
|
83
|
+
type: data.type,
|
|
84
|
+
version: data.version
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const unmarshalProcess = (data) => {
|
|
88
|
+
if (!json.isJSONObject(data)) {
|
|
89
|
+
throw new TypeError(
|
|
90
|
+
`Unmarshalling the type 'Process' failed as data isn't a dictionary.`
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
applicationId: data.application_id,
|
|
95
|
+
attachedSessionIds: data.attached_session_ids,
|
|
96
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
97
|
+
finishedAt: marshalling.unmarshalDate(data.finished_at),
|
|
98
|
+
id: data.id,
|
|
99
|
+
input: data.input,
|
|
100
|
+
name: data.name,
|
|
101
|
+
platformId: data.platform_id,
|
|
102
|
+
progress: data.progress,
|
|
103
|
+
progressMessage: data.progress_message,
|
|
104
|
+
projectId: data.project_id,
|
|
105
|
+
startedAt: marshalling.unmarshalDate(data.started_at),
|
|
106
|
+
status: data.status,
|
|
107
|
+
tags: data.tags,
|
|
108
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at)
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const unmarshalSession = (data) => {
|
|
112
|
+
if (!json.isJSONObject(data)) {
|
|
113
|
+
throw new TypeError(
|
|
114
|
+
`Unmarshalling the type 'Session' failed as data isn't a dictionary.`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
119
|
+
deduplicationId: data.deduplication_id,
|
|
120
|
+
finishedJobCount: data.finished_job_count,
|
|
121
|
+
id: data.id,
|
|
122
|
+
maxDuration: data.max_duration,
|
|
123
|
+
maxIdleDuration: data.max_idle_duration,
|
|
124
|
+
name: data.name,
|
|
125
|
+
originId: data.origin_id,
|
|
126
|
+
originType: data.origin_type,
|
|
127
|
+
platformId: data.platform_id,
|
|
128
|
+
progressMessage: data.progress_message,
|
|
129
|
+
projectId: data.project_id,
|
|
130
|
+
startedAt: marshalling.unmarshalDate(data.started_at),
|
|
131
|
+
status: data.status,
|
|
132
|
+
tags: data.tags,
|
|
133
|
+
terminatedAt: marshalling.unmarshalDate(data.terminated_at),
|
|
134
|
+
updatedAt: marshalling.unmarshalDate(data.updated_at),
|
|
135
|
+
waitingJobCount: data.waiting_job_count
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
const unmarshalListApplicationsResponse = (data) => {
|
|
139
|
+
if (!json.isJSONObject(data)) {
|
|
140
|
+
throw new TypeError(
|
|
141
|
+
`Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
applications: marshalling.unmarshalArrayOfObject(
|
|
146
|
+
data.applications,
|
|
147
|
+
unmarshalApplication
|
|
148
|
+
),
|
|
149
|
+
totalCount: data.total_count
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
const unmarshalJobResult = (data) => {
|
|
153
|
+
if (!json.isJSONObject(data)) {
|
|
154
|
+
throw new TypeError(
|
|
155
|
+
`Unmarshalling the type 'JobResult' failed as data isn't a dictionary.`
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
160
|
+
jobId: data.job_id,
|
|
161
|
+
result: data.result,
|
|
162
|
+
url: data.url
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
const unmarshalListJobResultsResponse = (data) => {
|
|
166
|
+
if (!json.isJSONObject(data)) {
|
|
167
|
+
throw new TypeError(
|
|
168
|
+
`Unmarshalling the type 'ListJobResultsResponse' failed as data isn't a dictionary.`
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
jobResults: marshalling.unmarshalArrayOfObject(data.job_results, unmarshalJobResult),
|
|
173
|
+
totalCount: data.total_count
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
const unmarshalListJobsResponse = (data) => {
|
|
177
|
+
if (!json.isJSONObject(data)) {
|
|
178
|
+
throw new TypeError(
|
|
179
|
+
`Unmarshalling the type 'ListJobsResponse' failed as data isn't a dictionary.`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
jobs: marshalling.unmarshalArrayOfObject(data.jobs, unmarshalJob),
|
|
184
|
+
totalCount: data.total_count
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
const unmarshalListPlatformsResponse = (data) => {
|
|
188
|
+
if (!json.isJSONObject(data)) {
|
|
189
|
+
throw new TypeError(
|
|
190
|
+
`Unmarshalling the type 'ListPlatformsResponse' failed as data isn't a dictionary.`
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
platforms: marshalling.unmarshalArrayOfObject(data.platforms, unmarshalPlatform),
|
|
195
|
+
totalCount: data.total_count
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
const unmarshalProcessResult = (data) => {
|
|
199
|
+
if (!json.isJSONObject(data)) {
|
|
200
|
+
throw new TypeError(
|
|
201
|
+
`Unmarshalling the type 'ProcessResult' failed as data isn't a dictionary.`
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
createdAt: marshalling.unmarshalDate(data.created_at),
|
|
206
|
+
processId: data.process_id,
|
|
207
|
+
result: data.result
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
const unmarshalListProcessResultsResponse = (data) => {
|
|
211
|
+
if (!json.isJSONObject(data)) {
|
|
212
|
+
throw new TypeError(
|
|
213
|
+
`Unmarshalling the type 'ListProcessResultsResponse' failed as data isn't a dictionary.`
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
processResults: marshalling.unmarshalArrayOfObject(
|
|
218
|
+
data.process_results,
|
|
219
|
+
unmarshalProcessResult
|
|
220
|
+
),
|
|
221
|
+
totalCount: data.total_count
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
const unmarshalListProcessesResponse = (data) => {
|
|
225
|
+
if (!json.isJSONObject(data)) {
|
|
226
|
+
throw new TypeError(
|
|
227
|
+
`Unmarshalling the type 'ListProcessesResponse' failed as data isn't a dictionary.`
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
processes: marshalling.unmarshalArrayOfObject(data.processes, unmarshalProcess),
|
|
232
|
+
totalCount: data.total_count
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
const unmarshalListSessionACLsResponse = (data) => {
|
|
236
|
+
if (!json.isJSONObject(data)) {
|
|
237
|
+
throw new TypeError(
|
|
238
|
+
`Unmarshalling the type 'ListSessionACLsResponse' failed as data isn't a dictionary.`
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
acls: data.acls,
|
|
243
|
+
totalCount: data.total_count
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
const unmarshalListSessionsResponse = (data) => {
|
|
247
|
+
if (!json.isJSONObject(data)) {
|
|
248
|
+
throw new TypeError(
|
|
249
|
+
`Unmarshalling the type 'ListSessionsResponse' failed as data isn't a dictionary.`
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
sessions: marshalling.unmarshalArrayOfObject(data.sessions, unmarshalSession),
|
|
254
|
+
totalCount: data.total_count
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
const marshalJobCircuit = (request, defaults) => ({
|
|
258
|
+
...marshalling.resolveOneOf([
|
|
259
|
+
{ param: "perceval_circuit", value: request.percevalCircuit },
|
|
260
|
+
{ param: "qiskit_circuit", value: request.qiskitCircuit }
|
|
261
|
+
])
|
|
262
|
+
});
|
|
263
|
+
const marshalCreateJobRequest = (request, defaults) => ({
|
|
264
|
+
circuit: marshalJobCircuit(request.circuit),
|
|
265
|
+
max_duration: request.maxDuration,
|
|
266
|
+
name: request.name,
|
|
267
|
+
session_id: request.sessionId,
|
|
268
|
+
tags: request.tags
|
|
269
|
+
});
|
|
270
|
+
const marshalCreateProcessRequest = (request, defaults) => ({
|
|
271
|
+
application_id: request.applicationId,
|
|
272
|
+
input: request.input,
|
|
273
|
+
name: request.name,
|
|
274
|
+
platform_id: request.platformId,
|
|
275
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
276
|
+
tags: request.tags
|
|
277
|
+
});
|
|
278
|
+
const marshalCreateSessionRequest = (request, defaults) => ({
|
|
279
|
+
deduplication_id: request.deduplicationId,
|
|
280
|
+
max_duration: request.maxDuration,
|
|
281
|
+
max_idle_duration: request.maxIdleDuration,
|
|
282
|
+
name: request.name,
|
|
283
|
+
platform_id: request.platformId,
|
|
284
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
285
|
+
tags: request.tags
|
|
286
|
+
});
|
|
287
|
+
const marshalUpdateJobRequest = (request, defaults) => ({
|
|
288
|
+
name: request.name,
|
|
289
|
+
tags: request.tags
|
|
290
|
+
});
|
|
291
|
+
const marshalUpdateProcessRequest = (request, defaults) => ({
|
|
292
|
+
name: request.name,
|
|
293
|
+
tags: request.tags
|
|
294
|
+
});
|
|
295
|
+
const marshalUpdateSessionRequest = (request, defaults) => ({
|
|
296
|
+
max_duration: request.maxDuration,
|
|
297
|
+
max_idle_duration: request.maxIdleDuration,
|
|
298
|
+
name: request.name,
|
|
299
|
+
tags: request.tags
|
|
300
|
+
});
|
|
301
|
+
exports.marshalCreateJobRequest = marshalCreateJobRequest;
|
|
302
|
+
exports.marshalCreateProcessRequest = marshalCreateProcessRequest;
|
|
303
|
+
exports.marshalCreateSessionRequest = marshalCreateSessionRequest;
|
|
304
|
+
exports.marshalUpdateJobRequest = marshalUpdateJobRequest;
|
|
305
|
+
exports.marshalUpdateProcessRequest = marshalUpdateProcessRequest;
|
|
306
|
+
exports.marshalUpdateSessionRequest = marshalUpdateSessionRequest;
|
|
307
|
+
exports.unmarshalApplication = unmarshalApplication;
|
|
308
|
+
exports.unmarshalJob = unmarshalJob;
|
|
309
|
+
exports.unmarshalJobCircuit = unmarshalJobCircuit;
|
|
310
|
+
exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;
|
|
311
|
+
exports.unmarshalListJobResultsResponse = unmarshalListJobResultsResponse;
|
|
312
|
+
exports.unmarshalListJobsResponse = unmarshalListJobsResponse;
|
|
313
|
+
exports.unmarshalListPlatformsResponse = unmarshalListPlatformsResponse;
|
|
314
|
+
exports.unmarshalListProcessResultsResponse = unmarshalListProcessResultsResponse;
|
|
315
|
+
exports.unmarshalListProcessesResponse = unmarshalListProcessesResponse;
|
|
316
|
+
exports.unmarshalListSessionACLsResponse = unmarshalListSessionACLsResponse;
|
|
317
|
+
exports.unmarshalListSessionsResponse = unmarshalListSessionsResponse;
|
|
318
|
+
exports.unmarshalPlatform = unmarshalPlatform;
|
|
319
|
+
exports.unmarshalProcess = unmarshalProcess;
|
|
320
|
+
exports.unmarshalSession = unmarshalSession;
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { isJSONObject } from "../../../helpers/json.js";
|
|
2
|
+
import { unmarshalMoney } from "../../../scw/custom-marshalling.js";
|
|
3
|
+
import { unmarshalDate, unmarshalArrayOfObject, resolveOneOf } from "../../../helpers/marshalling.js";
|
|
4
|
+
const unmarshalJobCircuit = (data) => {
|
|
5
|
+
if (!isJSONObject(data)) {
|
|
6
|
+
throw new TypeError(
|
|
7
|
+
`Unmarshalling the type 'JobCircuit' failed as data isn't a dictionary.`
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
percevalCircuit: data.perceval_circuit,
|
|
12
|
+
qiskitCircuit: data.qiskit_circuit
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const unmarshalApplication = (data) => {
|
|
16
|
+
if (!isJSONObject(data)) {
|
|
17
|
+
throw new TypeError(
|
|
18
|
+
`Unmarshalling the type 'Application' failed as data isn't a dictionary.`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
compatiblePlatformIds: data.compatible_platform_ids,
|
|
23
|
+
id: data.id,
|
|
24
|
+
inputTemplate: data.input_template,
|
|
25
|
+
name: data.name,
|
|
26
|
+
type: data.type
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
const unmarshalJob = (data) => {
|
|
30
|
+
if (!isJSONObject(data)) {
|
|
31
|
+
throw new TypeError(
|
|
32
|
+
`Unmarshalling the type 'Job' failed as data isn't a dictionary.`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
createdAt: unmarshalDate(data.created_at),
|
|
37
|
+
id: data.id,
|
|
38
|
+
jobDuration: data.job_duration,
|
|
39
|
+
name: data.name,
|
|
40
|
+
progressMessage: data.progress_message,
|
|
41
|
+
resultDistribution: data.result_distribution,
|
|
42
|
+
sessionId: data.session_id,
|
|
43
|
+
startedAt: unmarshalDate(data.started_at),
|
|
44
|
+
status: data.status,
|
|
45
|
+
tags: data.tags,
|
|
46
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const unmarshalPlatformHardware = (data) => {
|
|
50
|
+
if (!isJSONObject(data)) {
|
|
51
|
+
throw new TypeError(
|
|
52
|
+
`Unmarshalling the type 'PlatformHardware' failed as data isn't a dictionary.`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
gpus: data.gpus,
|
|
57
|
+
gpusNetwork: data.gpus_network,
|
|
58
|
+
name: data.name,
|
|
59
|
+
ram: data.ram,
|
|
60
|
+
vcpus: data.vcpus,
|
|
61
|
+
vram: data.vram
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const unmarshalPlatform = (data) => {
|
|
65
|
+
if (!isJSONObject(data)) {
|
|
66
|
+
throw new TypeError(
|
|
67
|
+
`Unmarshalling the type 'Platform' failed as data isn't a dictionary.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
availability: data.availability,
|
|
72
|
+
backendName: data.backend_name,
|
|
73
|
+
hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : void 0,
|
|
74
|
+
id: data.id,
|
|
75
|
+
maxQubitCount: data.max_qubit_count,
|
|
76
|
+
metadata: data.metadata,
|
|
77
|
+
name: data.name,
|
|
78
|
+
pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : void 0,
|
|
79
|
+
providerName: data.provider_name,
|
|
80
|
+
technology: data.technology,
|
|
81
|
+
type: data.type,
|
|
82
|
+
version: data.version
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
const unmarshalProcess = (data) => {
|
|
86
|
+
if (!isJSONObject(data)) {
|
|
87
|
+
throw new TypeError(
|
|
88
|
+
`Unmarshalling the type 'Process' failed as data isn't a dictionary.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
applicationId: data.application_id,
|
|
93
|
+
attachedSessionIds: data.attached_session_ids,
|
|
94
|
+
createdAt: unmarshalDate(data.created_at),
|
|
95
|
+
finishedAt: unmarshalDate(data.finished_at),
|
|
96
|
+
id: data.id,
|
|
97
|
+
input: data.input,
|
|
98
|
+
name: data.name,
|
|
99
|
+
platformId: data.platform_id,
|
|
100
|
+
progress: data.progress,
|
|
101
|
+
progressMessage: data.progress_message,
|
|
102
|
+
projectId: data.project_id,
|
|
103
|
+
startedAt: unmarshalDate(data.started_at),
|
|
104
|
+
status: data.status,
|
|
105
|
+
tags: data.tags,
|
|
106
|
+
updatedAt: unmarshalDate(data.updated_at)
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const unmarshalSession = (data) => {
|
|
110
|
+
if (!isJSONObject(data)) {
|
|
111
|
+
throw new TypeError(
|
|
112
|
+
`Unmarshalling the type 'Session' failed as data isn't a dictionary.`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
createdAt: unmarshalDate(data.created_at),
|
|
117
|
+
deduplicationId: data.deduplication_id,
|
|
118
|
+
finishedJobCount: data.finished_job_count,
|
|
119
|
+
id: data.id,
|
|
120
|
+
maxDuration: data.max_duration,
|
|
121
|
+
maxIdleDuration: data.max_idle_duration,
|
|
122
|
+
name: data.name,
|
|
123
|
+
originId: data.origin_id,
|
|
124
|
+
originType: data.origin_type,
|
|
125
|
+
platformId: data.platform_id,
|
|
126
|
+
progressMessage: data.progress_message,
|
|
127
|
+
projectId: data.project_id,
|
|
128
|
+
startedAt: unmarshalDate(data.started_at),
|
|
129
|
+
status: data.status,
|
|
130
|
+
tags: data.tags,
|
|
131
|
+
terminatedAt: unmarshalDate(data.terminated_at),
|
|
132
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
133
|
+
waitingJobCount: data.waiting_job_count
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
const unmarshalListApplicationsResponse = (data) => {
|
|
137
|
+
if (!isJSONObject(data)) {
|
|
138
|
+
throw new TypeError(
|
|
139
|
+
`Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
applications: unmarshalArrayOfObject(
|
|
144
|
+
data.applications,
|
|
145
|
+
unmarshalApplication
|
|
146
|
+
),
|
|
147
|
+
totalCount: data.total_count
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
const unmarshalJobResult = (data) => {
|
|
151
|
+
if (!isJSONObject(data)) {
|
|
152
|
+
throw new TypeError(
|
|
153
|
+
`Unmarshalling the type 'JobResult' failed as data isn't a dictionary.`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
createdAt: unmarshalDate(data.created_at),
|
|
158
|
+
jobId: data.job_id,
|
|
159
|
+
result: data.result,
|
|
160
|
+
url: data.url
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const unmarshalListJobResultsResponse = (data) => {
|
|
164
|
+
if (!isJSONObject(data)) {
|
|
165
|
+
throw new TypeError(
|
|
166
|
+
`Unmarshalling the type 'ListJobResultsResponse' failed as data isn't a dictionary.`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
jobResults: unmarshalArrayOfObject(data.job_results, unmarshalJobResult),
|
|
171
|
+
totalCount: data.total_count
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
const unmarshalListJobsResponse = (data) => {
|
|
175
|
+
if (!isJSONObject(data)) {
|
|
176
|
+
throw new TypeError(
|
|
177
|
+
`Unmarshalling the type 'ListJobsResponse' failed as data isn't a dictionary.`
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
jobs: unmarshalArrayOfObject(data.jobs, unmarshalJob),
|
|
182
|
+
totalCount: data.total_count
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
const unmarshalListPlatformsResponse = (data) => {
|
|
186
|
+
if (!isJSONObject(data)) {
|
|
187
|
+
throw new TypeError(
|
|
188
|
+
`Unmarshalling the type 'ListPlatformsResponse' failed as data isn't a dictionary.`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
platforms: unmarshalArrayOfObject(data.platforms, unmarshalPlatform),
|
|
193
|
+
totalCount: data.total_count
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
const unmarshalProcessResult = (data) => {
|
|
197
|
+
if (!isJSONObject(data)) {
|
|
198
|
+
throw new TypeError(
|
|
199
|
+
`Unmarshalling the type 'ProcessResult' failed as data isn't a dictionary.`
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
return {
|
|
203
|
+
createdAt: unmarshalDate(data.created_at),
|
|
204
|
+
processId: data.process_id,
|
|
205
|
+
result: data.result
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
const unmarshalListProcessResultsResponse = (data) => {
|
|
209
|
+
if (!isJSONObject(data)) {
|
|
210
|
+
throw new TypeError(
|
|
211
|
+
`Unmarshalling the type 'ListProcessResultsResponse' failed as data isn't a dictionary.`
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
processResults: unmarshalArrayOfObject(
|
|
216
|
+
data.process_results,
|
|
217
|
+
unmarshalProcessResult
|
|
218
|
+
),
|
|
219
|
+
totalCount: data.total_count
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
const unmarshalListProcessesResponse = (data) => {
|
|
223
|
+
if (!isJSONObject(data)) {
|
|
224
|
+
throw new TypeError(
|
|
225
|
+
`Unmarshalling the type 'ListProcessesResponse' failed as data isn't a dictionary.`
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
processes: unmarshalArrayOfObject(data.processes, unmarshalProcess),
|
|
230
|
+
totalCount: data.total_count
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
const unmarshalListSessionACLsResponse = (data) => {
|
|
234
|
+
if (!isJSONObject(data)) {
|
|
235
|
+
throw new TypeError(
|
|
236
|
+
`Unmarshalling the type 'ListSessionACLsResponse' failed as data isn't a dictionary.`
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
acls: data.acls,
|
|
241
|
+
totalCount: data.total_count
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
const unmarshalListSessionsResponse = (data) => {
|
|
245
|
+
if (!isJSONObject(data)) {
|
|
246
|
+
throw new TypeError(
|
|
247
|
+
`Unmarshalling the type 'ListSessionsResponse' failed as data isn't a dictionary.`
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
sessions: unmarshalArrayOfObject(data.sessions, unmarshalSession),
|
|
252
|
+
totalCount: data.total_count
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
const marshalJobCircuit = (request, defaults) => ({
|
|
256
|
+
...resolveOneOf([
|
|
257
|
+
{ param: "perceval_circuit", value: request.percevalCircuit },
|
|
258
|
+
{ param: "qiskit_circuit", value: request.qiskitCircuit }
|
|
259
|
+
])
|
|
260
|
+
});
|
|
261
|
+
const marshalCreateJobRequest = (request, defaults) => ({
|
|
262
|
+
circuit: marshalJobCircuit(request.circuit),
|
|
263
|
+
max_duration: request.maxDuration,
|
|
264
|
+
name: request.name,
|
|
265
|
+
session_id: request.sessionId,
|
|
266
|
+
tags: request.tags
|
|
267
|
+
});
|
|
268
|
+
const marshalCreateProcessRequest = (request, defaults) => ({
|
|
269
|
+
application_id: request.applicationId,
|
|
270
|
+
input: request.input,
|
|
271
|
+
name: request.name,
|
|
272
|
+
platform_id: request.platformId,
|
|
273
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
274
|
+
tags: request.tags
|
|
275
|
+
});
|
|
276
|
+
const marshalCreateSessionRequest = (request, defaults) => ({
|
|
277
|
+
deduplication_id: request.deduplicationId,
|
|
278
|
+
max_duration: request.maxDuration,
|
|
279
|
+
max_idle_duration: request.maxIdleDuration,
|
|
280
|
+
name: request.name,
|
|
281
|
+
platform_id: request.platformId,
|
|
282
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
283
|
+
tags: request.tags
|
|
284
|
+
});
|
|
285
|
+
const marshalUpdateJobRequest = (request, defaults) => ({
|
|
286
|
+
name: request.name,
|
|
287
|
+
tags: request.tags
|
|
288
|
+
});
|
|
289
|
+
const marshalUpdateProcessRequest = (request, defaults) => ({
|
|
290
|
+
name: request.name,
|
|
291
|
+
tags: request.tags
|
|
292
|
+
});
|
|
293
|
+
const marshalUpdateSessionRequest = (request, defaults) => ({
|
|
294
|
+
max_duration: request.maxDuration,
|
|
295
|
+
max_idle_duration: request.maxIdleDuration,
|
|
296
|
+
name: request.name,
|
|
297
|
+
tags: request.tags
|
|
298
|
+
});
|
|
299
|
+
export {
|
|
300
|
+
marshalCreateJobRequest,
|
|
301
|
+
marshalCreateProcessRequest,
|
|
302
|
+
marshalCreateSessionRequest,
|
|
303
|
+
marshalUpdateJobRequest,
|
|
304
|
+
marshalUpdateProcessRequest,
|
|
305
|
+
marshalUpdateSessionRequest,
|
|
306
|
+
unmarshalApplication,
|
|
307
|
+
unmarshalJob,
|
|
308
|
+
unmarshalJobCircuit,
|
|
309
|
+
unmarshalListApplicationsResponse,
|
|
310
|
+
unmarshalListJobResultsResponse,
|
|
311
|
+
unmarshalListJobsResponse,
|
|
312
|
+
unmarshalListPlatformsResponse,
|
|
313
|
+
unmarshalListProcessResultsResponse,
|
|
314
|
+
unmarshalListProcessesResponse,
|
|
315
|
+
unmarshalListSessionACLsResponse,
|
|
316
|
+
unmarshalListSessionsResponse,
|
|
317
|
+
unmarshalPlatform,
|
|
318
|
+
unmarshalProcess,
|
|
319
|
+
unmarshalSession
|
|
320
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const CreateJobRequest = {
|
|
4
|
+
name: {
|
|
5
|
+
minLength: 1
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
const CreateProcessRequest = {
|
|
9
|
+
name: {
|
|
10
|
+
minLength: 1
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.CreateJobRequest = CreateJobRequest;
|
|
14
|
+
exports.CreateProcessRequest = CreateProcessRequest;
|