@aws-sdk/client-braket 3.186.0 → 3.188.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1582 +1,1237 @@
1
- import { __assign, __awaiter, __generator, __read } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, LazyJsonString as __LazyJsonString, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { v4 as generateIdempotencyToken } from "uuid";
5
4
  import { BraketServiceException as __BaseException } from "../models/BraketServiceException";
6
5
  import { AccessDeniedException, ConflictException, DeviceOfflineException, DeviceRetiredException, InternalServiceException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
7
- export var serializeAws_restJson1CancelJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
8
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
- return __generator(this, function (_c) {
10
- switch (_c.label) {
11
- case 0: return [4, context.endpoint()];
12
- case 1:
13
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
14
- headers = {};
15
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/job/{jobArn}/cancel";
16
- resolvedPath = __resolvedPath(resolvedPath, input, "jobArn", function () { return input.jobArn; }, "{jobArn}", false);
17
- return [2, new __HttpRequest({
18
- protocol: protocol,
19
- hostname: hostname,
20
- port: port,
21
- method: "PUT",
22
- headers: headers,
23
- path: resolvedPath,
24
- body: body,
25
- })];
26
- }
27
- });
28
- }); };
29
- export var serializeAws_restJson1CancelQuantumTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
30
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
31
- var _c;
32
- return __generator(this, function (_d) {
33
- switch (_d.label) {
34
- case 0: return [4, context.endpoint()];
35
- case 1:
36
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
37
- headers = {
38
- "content-type": "application/json",
39
- };
40
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/quantum-task/{quantumTaskArn}/cancel";
41
- resolvedPath = __resolvedPath(resolvedPath, input, "quantumTaskArn", function () { return input.quantumTaskArn; }, "{quantumTaskArn}", false);
42
- body = JSON.stringify({
43
- clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken(),
44
- });
45
- return [2, new __HttpRequest({
46
- protocol: protocol,
47
- hostname: hostname,
48
- port: port,
49
- method: "PUT",
50
- headers: headers,
51
- path: resolvedPath,
52
- body: body,
53
- })];
54
- }
55
- });
56
- }); };
57
- export var serializeAws_restJson1CreateJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
58
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
59
- var _c;
60
- return __generator(this, function (_d) {
61
- switch (_d.label) {
62
- case 0: return [4, context.endpoint()];
63
- case 1:
64
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
65
- headers = {
66
- "content-type": "application/json",
67
- };
68
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/job";
69
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.algorithmSpecification != null && {
70
- algorithmSpecification: serializeAws_restJson1AlgorithmSpecification(input.algorithmSpecification, context),
71
- })), (input.checkpointConfig != null && {
72
- checkpointConfig: serializeAws_restJson1JobCheckpointConfig(input.checkpointConfig, context),
73
- })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.deviceConfig != null && {
74
- deviceConfig: serializeAws_restJson1DeviceConfig(input.deviceConfig, context),
75
- })), (input.hyperParameters != null && {
76
- hyperParameters: serializeAws_restJson1HyperParameters(input.hyperParameters, context),
77
- })), (input.inputDataConfig != null && {
78
- inputDataConfig: serializeAws_restJson1InputConfigList(input.inputDataConfig, context),
79
- })), (input.instanceConfig != null && {
80
- instanceConfig: serializeAws_restJson1InstanceConfig(input.instanceConfig, context),
81
- })), (input.jobName != null && { jobName: input.jobName })), (input.outputDataConfig != null && {
82
- outputDataConfig: serializeAws_restJson1JobOutputDataConfig(input.outputDataConfig, context),
83
- })), (input.roleArn != null && { roleArn: input.roleArn })), (input.stoppingCondition != null && {
84
- stoppingCondition: serializeAws_restJson1JobStoppingCondition(input.stoppingCondition, context),
85
- })), (input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) })));
86
- return [2, new __HttpRequest({
87
- protocol: protocol,
88
- hostname: hostname,
89
- port: port,
90
- method: "POST",
91
- headers: headers,
92
- path: resolvedPath,
93
- body: body,
94
- })];
95
- }
96
- });
97
- }); };
98
- export var serializeAws_restJson1CreateQuantumTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
99
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
100
- var _c;
101
- return __generator(this, function (_d) {
102
- switch (_d.label) {
103
- case 0: return [4, context.endpoint()];
104
- case 1:
105
- _a = _d.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
106
- headers = {
107
- "content-type": "application/json",
108
- };
109
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/quantum-task";
110
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.action != null && { action: __LazyJsonString.fromObject(input.action) })), { clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken() }), (input.deviceArn != null && { deviceArn: input.deviceArn })), (input.deviceParameters != null && { deviceParameters: __LazyJsonString.fromObject(input.deviceParameters) })), (input.jobToken != null && { jobToken: input.jobToken })), (input.outputS3Bucket != null && { outputS3Bucket: input.outputS3Bucket })), (input.outputS3KeyPrefix != null && { outputS3KeyPrefix: input.outputS3KeyPrefix })), (input.shots != null && { shots: input.shots })), (input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) })));
111
- return [2, new __HttpRequest({
112
- protocol: protocol,
113
- hostname: hostname,
114
- port: port,
115
- method: "POST",
116
- headers: headers,
117
- path: resolvedPath,
118
- body: body,
119
- })];
120
- }
121
- });
122
- }); };
123
- export var serializeAws_restJson1GetDeviceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
124
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
125
- return __generator(this, function (_c) {
126
- switch (_c.label) {
127
- case 0: return [4, context.endpoint()];
128
- case 1:
129
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
130
- headers = {};
131
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/device/{deviceArn}";
132
- resolvedPath = __resolvedPath(resolvedPath, input, "deviceArn", function () { return input.deviceArn; }, "{deviceArn}", false);
133
- return [2, new __HttpRequest({
134
- protocol: protocol,
135
- hostname: hostname,
136
- port: port,
137
- method: "GET",
138
- headers: headers,
139
- path: resolvedPath,
140
- body: body,
141
- })];
142
- }
143
- });
144
- }); };
145
- export var serializeAws_restJson1GetJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
146
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
147
- return __generator(this, function (_c) {
148
- switch (_c.label) {
149
- case 0: return [4, context.endpoint()];
150
- case 1:
151
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
152
- headers = {};
153
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/job/{jobArn}";
154
- resolvedPath = __resolvedPath(resolvedPath, input, "jobArn", function () { return input.jobArn; }, "{jobArn}", false);
155
- return [2, new __HttpRequest({
156
- protocol: protocol,
157
- hostname: hostname,
158
- port: port,
159
- method: "GET",
160
- headers: headers,
161
- path: resolvedPath,
162
- body: body,
163
- })];
164
- }
6
+ export const serializeAws_restJson1CancelJobCommand = async (input, context) => {
7
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
+ const headers = {};
9
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/job/{jobArn}/cancel";
10
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobArn", () => input.jobArn, "{jobArn}", false);
11
+ let body;
12
+ return new __HttpRequest({
13
+ protocol,
14
+ hostname,
15
+ port,
16
+ method: "PUT",
17
+ headers,
18
+ path: resolvedPath,
19
+ body,
165
20
  });
166
- }); };
167
- export var serializeAws_restJson1GetQuantumTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
168
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
169
- return __generator(this, function (_c) {
170
- switch (_c.label) {
171
- case 0: return [4, context.endpoint()];
172
- case 1:
173
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
174
- headers = {};
175
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/quantum-task/{quantumTaskArn}";
176
- resolvedPath = __resolvedPath(resolvedPath, input, "quantumTaskArn", function () { return input.quantumTaskArn; }, "{quantumTaskArn}", false);
177
- return [2, new __HttpRequest({
178
- protocol: protocol,
179
- hostname: hostname,
180
- port: port,
181
- method: "GET",
182
- headers: headers,
183
- path: resolvedPath,
184
- body: body,
185
- })];
186
- }
21
+ };
22
+ export const serializeAws_restJson1CancelQuantumTaskCommand = async (input, context) => {
23
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
24
+ const headers = {
25
+ "content-type": "application/json",
26
+ };
27
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/quantum-task/{quantumTaskArn}/cancel";
28
+ resolvedPath = __resolvedPath(resolvedPath, input, "quantumTaskArn", () => input.quantumTaskArn, "{quantumTaskArn}", false);
29
+ let body;
30
+ body = JSON.stringify({
31
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
187
32
  });
188
- }); };
189
- export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
190
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
191
- return __generator(this, function (_c) {
192
- switch (_c.label) {
193
- case 0: return [4, context.endpoint()];
194
- case 1:
195
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
196
- headers = {};
197
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
198
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
199
- return [2, new __HttpRequest({
200
- protocol: protocol,
201
- hostname: hostname,
202
- port: port,
203
- method: "GET",
204
- headers: headers,
205
- path: resolvedPath,
206
- body: body,
207
- })];
208
- }
33
+ return new __HttpRequest({
34
+ protocol,
35
+ hostname,
36
+ port,
37
+ method: "PUT",
38
+ headers,
39
+ path: resolvedPath,
40
+ body,
209
41
  });
210
- }); };
211
- export var serializeAws_restJson1SearchDevicesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
212
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
213
- return __generator(this, function (_c) {
214
- switch (_c.label) {
215
- case 0: return [4, context.endpoint()];
216
- case 1:
217
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
218
- headers = {
219
- "content-type": "application/json",
220
- };
221
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/devices";
222
- body = JSON.stringify(__assign(__assign(__assign({}, (input.filters != null && { filters: serializeAws_restJson1SearchDevicesFilterList(input.filters, context) })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
223
- return [2, new __HttpRequest({
224
- protocol: protocol,
225
- hostname: hostname,
226
- port: port,
227
- method: "POST",
228
- headers: headers,
229
- path: resolvedPath,
230
- body: body,
231
- })];
232
- }
42
+ };
43
+ export const serializeAws_restJson1CreateJobCommand = async (input, context) => {
44
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
45
+ const headers = {
46
+ "content-type": "application/json",
47
+ };
48
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/job";
49
+ let body;
50
+ body = JSON.stringify({
51
+ ...(input.algorithmSpecification != null && {
52
+ algorithmSpecification: serializeAws_restJson1AlgorithmSpecification(input.algorithmSpecification, context),
53
+ }),
54
+ ...(input.checkpointConfig != null && {
55
+ checkpointConfig: serializeAws_restJson1JobCheckpointConfig(input.checkpointConfig, context),
56
+ }),
57
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
58
+ ...(input.deviceConfig != null && {
59
+ deviceConfig: serializeAws_restJson1DeviceConfig(input.deviceConfig, context),
60
+ }),
61
+ ...(input.hyperParameters != null && {
62
+ hyperParameters: serializeAws_restJson1HyperParameters(input.hyperParameters, context),
63
+ }),
64
+ ...(input.inputDataConfig != null && {
65
+ inputDataConfig: serializeAws_restJson1InputConfigList(input.inputDataConfig, context),
66
+ }),
67
+ ...(input.instanceConfig != null && {
68
+ instanceConfig: serializeAws_restJson1InstanceConfig(input.instanceConfig, context),
69
+ }),
70
+ ...(input.jobName != null && { jobName: input.jobName }),
71
+ ...(input.outputDataConfig != null && {
72
+ outputDataConfig: serializeAws_restJson1JobOutputDataConfig(input.outputDataConfig, context),
73
+ }),
74
+ ...(input.roleArn != null && { roleArn: input.roleArn }),
75
+ ...(input.stoppingCondition != null && {
76
+ stoppingCondition: serializeAws_restJson1JobStoppingCondition(input.stoppingCondition, context),
77
+ }),
78
+ ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
233
79
  });
234
- }); };
235
- export var serializeAws_restJson1SearchJobsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
236
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
237
- return __generator(this, function (_c) {
238
- switch (_c.label) {
239
- case 0: return [4, context.endpoint()];
240
- case 1:
241
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
242
- headers = {
243
- "content-type": "application/json",
244
- };
245
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/jobs";
246
- body = JSON.stringify(__assign(__assign(__assign({}, (input.filters != null && { filters: serializeAws_restJson1SearchJobsFilterList(input.filters, context) })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
247
- return [2, new __HttpRequest({
248
- protocol: protocol,
249
- hostname: hostname,
250
- port: port,
251
- method: "POST",
252
- headers: headers,
253
- path: resolvedPath,
254
- body: body,
255
- })];
256
- }
80
+ return new __HttpRequest({
81
+ protocol,
82
+ hostname,
83
+ port,
84
+ method: "POST",
85
+ headers,
86
+ path: resolvedPath,
87
+ body,
257
88
  });
258
- }); };
259
- export var serializeAws_restJson1SearchQuantumTasksCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
260
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
261
- return __generator(this, function (_c) {
262
- switch (_c.label) {
263
- case 0: return [4, context.endpoint()];
264
- case 1:
265
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
266
- headers = {
267
- "content-type": "application/json",
268
- };
269
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/quantum-tasks";
270
- body = JSON.stringify(__assign(__assign(__assign({}, (input.filters != null && {
271
- filters: serializeAws_restJson1SearchQuantumTasksFilterList(input.filters, context),
272
- })), (input.maxResults != null && { maxResults: input.maxResults })), (input.nextToken != null && { nextToken: input.nextToken })));
273
- return [2, new __HttpRequest({
274
- protocol: protocol,
275
- hostname: hostname,
276
- port: port,
277
- method: "POST",
278
- headers: headers,
279
- path: resolvedPath,
280
- body: body,
281
- })];
282
- }
89
+ };
90
+ export const serializeAws_restJson1CreateQuantumTaskCommand = async (input, context) => {
91
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
92
+ const headers = {
93
+ "content-type": "application/json",
94
+ };
95
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/quantum-task";
96
+ let body;
97
+ body = JSON.stringify({
98
+ ...(input.action != null && { action: __LazyJsonString.fromObject(input.action) }),
99
+ clientToken: input.clientToken ?? generateIdempotencyToken(),
100
+ ...(input.deviceArn != null && { deviceArn: input.deviceArn }),
101
+ ...(input.deviceParameters != null && { deviceParameters: __LazyJsonString.fromObject(input.deviceParameters) }),
102
+ ...(input.jobToken != null && { jobToken: input.jobToken }),
103
+ ...(input.outputS3Bucket != null && { outputS3Bucket: input.outputS3Bucket }),
104
+ ...(input.outputS3KeyPrefix != null && { outputS3KeyPrefix: input.outputS3KeyPrefix }),
105
+ ...(input.shots != null && { shots: input.shots }),
106
+ ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
283
107
  });
284
- }); };
285
- export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
286
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
287
- return __generator(this, function (_c) {
288
- switch (_c.label) {
289
- case 0: return [4, context.endpoint()];
290
- case 1:
291
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
292
- headers = {
293
- "content-type": "application/json",
294
- };
295
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
296
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
297
- body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) })));
298
- return [2, new __HttpRequest({
299
- protocol: protocol,
300
- hostname: hostname,
301
- port: port,
302
- method: "POST",
303
- headers: headers,
304
- path: resolvedPath,
305
- body: body,
306
- })];
307
- }
108
+ return new __HttpRequest({
109
+ protocol,
110
+ hostname,
111
+ port,
112
+ method: "POST",
113
+ headers,
114
+ path: resolvedPath,
115
+ body,
308
116
  });
309
- }); };
310
- export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
311
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
312
- return __generator(this, function (_c) {
313
- switch (_c.label) {
314
- case 0: return [4, context.endpoint()];
315
- case 1:
316
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
317
- headers = {};
318
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
319
- resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
320
- query = map({
321
- tagKeys: [function () { return input.tagKeys !== void 0; }, function () { return (input.tagKeys || []).map(function (_entry) { return _entry; }); }],
322
- });
323
- return [2, new __HttpRequest({
324
- protocol: protocol,
325
- hostname: hostname,
326
- port: port,
327
- method: "DELETE",
328
- headers: headers,
329
- path: resolvedPath,
330
- query: query,
331
- body: body,
332
- })];
333
- }
117
+ };
118
+ export const serializeAws_restJson1GetDeviceCommand = async (input, context) => {
119
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
120
+ const headers = {};
121
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/device/{deviceArn}";
122
+ resolvedPath = __resolvedPath(resolvedPath, input, "deviceArn", () => input.deviceArn, "{deviceArn}", false);
123
+ let body;
124
+ return new __HttpRequest({
125
+ protocol,
126
+ hostname,
127
+ port,
128
+ method: "GET",
129
+ headers,
130
+ path: resolvedPath,
131
+ body,
334
132
  });
335
- }); };
336
- export var deserializeAws_restJson1CancelJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
337
- var contents, data, _a, _b;
338
- return __generator(this, function (_c) {
339
- switch (_c.label) {
340
- case 0:
341
- if (output.statusCode !== 200 && output.statusCode >= 300) {
342
- return [2, deserializeAws_restJson1CancelJobCommandError(output, context)];
343
- }
344
- contents = map({
345
- $metadata: deserializeMetadata(output),
346
- });
347
- _a = __expectNonNull;
348
- _b = __expectObject;
349
- return [4, parseBody(output.body, context)];
350
- case 1:
351
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
352
- if (data.cancellationStatus != null) {
353
- contents.cancellationStatus = __expectString(data.cancellationStatus);
354
- }
355
- if (data.jobArn != null) {
356
- contents.jobArn = __expectString(data.jobArn);
357
- }
358
- return [2, contents];
359
- }
133
+ };
134
+ export const serializeAws_restJson1GetJobCommand = async (input, context) => {
135
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
136
+ const headers = {};
137
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/job/{jobArn}";
138
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobArn", () => input.jobArn, "{jobArn}", false);
139
+ let body;
140
+ return new __HttpRequest({
141
+ protocol,
142
+ hostname,
143
+ port,
144
+ method: "GET",
145
+ headers,
146
+ path: resolvedPath,
147
+ body,
360
148
  });
361
- }); };
362
- var deserializeAws_restJson1CancelJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
363
- var parsedOutput, _a, errorCode, _b, parsedBody;
364
- var _c;
365
- return __generator(this, function (_d) {
366
- switch (_d.label) {
367
- case 0:
368
- _a = [__assign({}, output)];
369
- _c = {};
370
- return [4, parseErrorBody(output.body, context)];
371
- case 1:
372
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
373
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
374
- _b = errorCode;
375
- switch (_b) {
376
- case "AccessDeniedException": return [3, 2];
377
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
378
- case "ConflictException": return [3, 4];
379
- case "com.amazonaws.braket#ConflictException": return [3, 4];
380
- case "InternalServiceException": return [3, 6];
381
- case "com.amazonaws.braket#InternalServiceException": return [3, 6];
382
- case "ResourceNotFoundException": return [3, 8];
383
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 8];
384
- case "ThrottlingException": return [3, 10];
385
- case "com.amazonaws.braket#ThrottlingException": return [3, 10];
386
- case "ValidationException": return [3, 12];
387
- case "com.amazonaws.braket#ValidationException": return [3, 12];
388
- }
389
- return [3, 14];
390
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
391
- case 3: throw _d.sent();
392
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
393
- case 5: throw _d.sent();
394
- case 6: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
395
- case 7: throw _d.sent();
396
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
397
- case 9: throw _d.sent();
398
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
399
- case 11: throw _d.sent();
400
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
401
- case 13: throw _d.sent();
402
- case 14:
403
- parsedBody = parsedOutput.body;
404
- throwDefaultError({
405
- output: output,
406
- parsedBody: parsedBody,
407
- exceptionCtor: __BaseException,
408
- errorCode: errorCode,
409
- });
410
- _d.label = 15;
411
- case 15: return [2];
412
- }
149
+ };
150
+ export const serializeAws_restJson1GetQuantumTaskCommand = async (input, context) => {
151
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
152
+ const headers = {};
153
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/quantum-task/{quantumTaskArn}";
154
+ resolvedPath = __resolvedPath(resolvedPath, input, "quantumTaskArn", () => input.quantumTaskArn, "{quantumTaskArn}", false);
155
+ let body;
156
+ return new __HttpRequest({
157
+ protocol,
158
+ hostname,
159
+ port,
160
+ method: "GET",
161
+ headers,
162
+ path: resolvedPath,
163
+ body,
413
164
  });
414
- }); };
415
- export var deserializeAws_restJson1CancelQuantumTaskCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
416
- var contents, data, _a, _b;
417
- return __generator(this, function (_c) {
418
- switch (_c.label) {
419
- case 0:
420
- if (output.statusCode !== 200 && output.statusCode >= 300) {
421
- return [2, deserializeAws_restJson1CancelQuantumTaskCommandError(output, context)];
422
- }
423
- contents = map({
424
- $metadata: deserializeMetadata(output),
425
- });
426
- _a = __expectNonNull;
427
- _b = __expectObject;
428
- return [4, parseBody(output.body, context)];
429
- case 1:
430
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
431
- if (data.cancellationStatus != null) {
432
- contents.cancellationStatus = __expectString(data.cancellationStatus);
433
- }
434
- if (data.quantumTaskArn != null) {
435
- contents.quantumTaskArn = __expectString(data.quantumTaskArn);
436
- }
437
- return [2, contents];
438
- }
165
+ };
166
+ export const serializeAws_restJson1ListTagsForResourceCommand = async (input, context) => {
167
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
168
+ const headers = {};
169
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
170
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
171
+ let body;
172
+ return new __HttpRequest({
173
+ protocol,
174
+ hostname,
175
+ port,
176
+ method: "GET",
177
+ headers,
178
+ path: resolvedPath,
179
+ body,
439
180
  });
440
- }); };
441
- var deserializeAws_restJson1CancelQuantumTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
442
- var parsedOutput, _a, errorCode, _b, parsedBody;
443
- var _c;
444
- return __generator(this, function (_d) {
445
- switch (_d.label) {
446
- case 0:
447
- _a = [__assign({}, output)];
448
- _c = {};
449
- return [4, parseErrorBody(output.body, context)];
450
- case 1:
451
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
452
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
453
- _b = errorCode;
454
- switch (_b) {
455
- case "AccessDeniedException": return [3, 2];
456
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
457
- case "ConflictException": return [3, 4];
458
- case "com.amazonaws.braket#ConflictException": return [3, 4];
459
- case "InternalServiceException": return [3, 6];
460
- case "com.amazonaws.braket#InternalServiceException": return [3, 6];
461
- case "ResourceNotFoundException": return [3, 8];
462
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 8];
463
- case "ThrottlingException": return [3, 10];
464
- case "com.amazonaws.braket#ThrottlingException": return [3, 10];
465
- case "ValidationException": return [3, 12];
466
- case "com.amazonaws.braket#ValidationException": return [3, 12];
467
- }
468
- return [3, 14];
469
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
470
- case 3: throw _d.sent();
471
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
472
- case 5: throw _d.sent();
473
- case 6: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
474
- case 7: throw _d.sent();
475
- case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
476
- case 9: throw _d.sent();
477
- case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
478
- case 11: throw _d.sent();
479
- case 12: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
480
- case 13: throw _d.sent();
481
- case 14:
482
- parsedBody = parsedOutput.body;
483
- throwDefaultError({
484
- output: output,
485
- parsedBody: parsedBody,
486
- exceptionCtor: __BaseException,
487
- errorCode: errorCode,
488
- });
489
- _d.label = 15;
490
- case 15: return [2];
491
- }
181
+ };
182
+ export const serializeAws_restJson1SearchDevicesCommand = async (input, context) => {
183
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
184
+ const headers = {
185
+ "content-type": "application/json",
186
+ };
187
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/devices";
188
+ let body;
189
+ body = JSON.stringify({
190
+ ...(input.filters != null && { filters: serializeAws_restJson1SearchDevicesFilterList(input.filters, context) }),
191
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
192
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
492
193
  });
493
- }); };
494
- export var deserializeAws_restJson1CreateJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
495
- var contents, data, _a, _b;
496
- return __generator(this, function (_c) {
497
- switch (_c.label) {
498
- case 0:
499
- if (output.statusCode !== 201 && output.statusCode >= 300) {
500
- return [2, deserializeAws_restJson1CreateJobCommandError(output, context)];
501
- }
502
- contents = map({
503
- $metadata: deserializeMetadata(output),
504
- });
505
- _a = __expectNonNull;
506
- _b = __expectObject;
507
- return [4, parseBody(output.body, context)];
508
- case 1:
509
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
510
- if (data.jobArn != null) {
511
- contents.jobArn = __expectString(data.jobArn);
512
- }
513
- return [2, contents];
514
- }
194
+ return new __HttpRequest({
195
+ protocol,
196
+ hostname,
197
+ port,
198
+ method: "POST",
199
+ headers,
200
+ path: resolvedPath,
201
+ body,
515
202
  });
516
- }); };
517
- var deserializeAws_restJson1CreateJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
518
- var parsedOutput, _a, errorCode, _b, parsedBody;
519
- var _c;
520
- return __generator(this, function (_d) {
521
- switch (_d.label) {
522
- case 0:
523
- _a = [__assign({}, output)];
524
- _c = {};
525
- return [4, parseErrorBody(output.body, context)];
526
- case 1:
527
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
528
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
529
- _b = errorCode;
530
- switch (_b) {
531
- case "AccessDeniedException": return [3, 2];
532
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
533
- case "ConflictException": return [3, 4];
534
- case "com.amazonaws.braket#ConflictException": return [3, 4];
535
- case "DeviceRetiredException": return [3, 6];
536
- case "com.amazonaws.braket#DeviceRetiredException": return [3, 6];
537
- case "InternalServiceException": return [3, 8];
538
- case "com.amazonaws.braket#InternalServiceException": return [3, 8];
539
- case "ServiceQuotaExceededException": return [3, 10];
540
- case "com.amazonaws.braket#ServiceQuotaExceededException": return [3, 10];
541
- case "ThrottlingException": return [3, 12];
542
- case "com.amazonaws.braket#ThrottlingException": return [3, 12];
543
- case "ValidationException": return [3, 14];
544
- case "com.amazonaws.braket#ValidationException": return [3, 14];
545
- }
546
- return [3, 16];
547
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
548
- case 3: throw _d.sent();
549
- case 4: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
550
- case 5: throw _d.sent();
551
- case 6: return [4, deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context)];
552
- case 7: throw _d.sent();
553
- case 8: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
554
- case 9: throw _d.sent();
555
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
556
- case 11: throw _d.sent();
557
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
558
- case 13: throw _d.sent();
559
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
560
- case 15: throw _d.sent();
561
- case 16:
562
- parsedBody = parsedOutput.body;
563
- throwDefaultError({
564
- output: output,
565
- parsedBody: parsedBody,
566
- exceptionCtor: __BaseException,
567
- errorCode: errorCode,
568
- });
569
- _d.label = 17;
570
- case 17: return [2];
571
- }
203
+ };
204
+ export const serializeAws_restJson1SearchJobsCommand = async (input, context) => {
205
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
206
+ const headers = {
207
+ "content-type": "application/json",
208
+ };
209
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/jobs";
210
+ let body;
211
+ body = JSON.stringify({
212
+ ...(input.filters != null && { filters: serializeAws_restJson1SearchJobsFilterList(input.filters, context) }),
213
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
214
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
572
215
  });
573
- }); };
574
- export var deserializeAws_restJson1CreateQuantumTaskCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
575
- var contents, data, _a, _b;
576
- return __generator(this, function (_c) {
577
- switch (_c.label) {
578
- case 0:
579
- if (output.statusCode !== 201 && output.statusCode >= 300) {
580
- return [2, deserializeAws_restJson1CreateQuantumTaskCommandError(output, context)];
581
- }
582
- contents = map({
583
- $metadata: deserializeMetadata(output),
584
- });
585
- _a = __expectNonNull;
586
- _b = __expectObject;
587
- return [4, parseBody(output.body, context)];
588
- case 1:
589
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
590
- if (data.quantumTaskArn != null) {
591
- contents.quantumTaskArn = __expectString(data.quantumTaskArn);
592
- }
593
- return [2, contents];
594
- }
216
+ return new __HttpRequest({
217
+ protocol,
218
+ hostname,
219
+ port,
220
+ method: "POST",
221
+ headers,
222
+ path: resolvedPath,
223
+ body,
595
224
  });
596
- }); };
597
- var deserializeAws_restJson1CreateQuantumTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
598
- var parsedOutput, _a, errorCode, _b, parsedBody;
599
- var _c;
600
- return __generator(this, function (_d) {
601
- switch (_d.label) {
602
- case 0:
603
- _a = [__assign({}, output)];
604
- _c = {};
605
- return [4, parseErrorBody(output.body, context)];
606
- case 1:
607
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
608
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
609
- _b = errorCode;
610
- switch (_b) {
611
- case "AccessDeniedException": return [3, 2];
612
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
613
- case "DeviceOfflineException": return [3, 4];
614
- case "com.amazonaws.braket#DeviceOfflineException": return [3, 4];
615
- case "DeviceRetiredException": return [3, 6];
616
- case "com.amazonaws.braket#DeviceRetiredException": return [3, 6];
617
- case "InternalServiceException": return [3, 8];
618
- case "com.amazonaws.braket#InternalServiceException": return [3, 8];
619
- case "ServiceQuotaExceededException": return [3, 10];
620
- case "com.amazonaws.braket#ServiceQuotaExceededException": return [3, 10];
621
- case "ThrottlingException": return [3, 12];
622
- case "com.amazonaws.braket#ThrottlingException": return [3, 12];
623
- case "ValidationException": return [3, 14];
624
- case "com.amazonaws.braket#ValidationException": return [3, 14];
625
- }
626
- return [3, 16];
627
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
628
- case 3: throw _d.sent();
629
- case 4: return [4, deserializeAws_restJson1DeviceOfflineExceptionResponse(parsedOutput, context)];
630
- case 5: throw _d.sent();
631
- case 6: return [4, deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context)];
632
- case 7: throw _d.sent();
633
- case 8: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
634
- case 9: throw _d.sent();
635
- case 10: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
636
- case 11: throw _d.sent();
637
- case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
638
- case 13: throw _d.sent();
639
- case 14: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
640
- case 15: throw _d.sent();
641
- case 16:
642
- parsedBody = parsedOutput.body;
643
- throwDefaultError({
644
- output: output,
645
- parsedBody: parsedBody,
646
- exceptionCtor: __BaseException,
647
- errorCode: errorCode,
648
- });
649
- _d.label = 17;
650
- case 17: return [2];
651
- }
225
+ };
226
+ export const serializeAws_restJson1SearchQuantumTasksCommand = async (input, context) => {
227
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
228
+ const headers = {
229
+ "content-type": "application/json",
230
+ };
231
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/quantum-tasks";
232
+ let body;
233
+ body = JSON.stringify({
234
+ ...(input.filters != null && {
235
+ filters: serializeAws_restJson1SearchQuantumTasksFilterList(input.filters, context),
236
+ }),
237
+ ...(input.maxResults != null && { maxResults: input.maxResults }),
238
+ ...(input.nextToken != null && { nextToken: input.nextToken }),
652
239
  });
653
- }); };
654
- export var deserializeAws_restJson1GetDeviceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
655
- var contents, data, _a, _b;
656
- return __generator(this, function (_c) {
657
- switch (_c.label) {
658
- case 0:
659
- if (output.statusCode !== 200 && output.statusCode >= 300) {
660
- return [2, deserializeAws_restJson1GetDeviceCommandError(output, context)];
661
- }
662
- contents = map({
663
- $metadata: deserializeMetadata(output),
664
- });
665
- _a = __expectNonNull;
666
- _b = __expectObject;
667
- return [4, parseBody(output.body, context)];
668
- case 1:
669
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
670
- if (data.deviceArn != null) {
671
- contents.deviceArn = __expectString(data.deviceArn);
672
- }
673
- if (data.deviceCapabilities != null) {
674
- contents.deviceCapabilities = new __LazyJsonString(data.deviceCapabilities);
675
- }
676
- if (data.deviceName != null) {
677
- contents.deviceName = __expectString(data.deviceName);
678
- }
679
- if (data.deviceStatus != null) {
680
- contents.deviceStatus = __expectString(data.deviceStatus);
681
- }
682
- if (data.deviceType != null) {
683
- contents.deviceType = __expectString(data.deviceType);
684
- }
685
- if (data.providerName != null) {
686
- contents.providerName = __expectString(data.providerName);
687
- }
688
- return [2, contents];
689
- }
240
+ return new __HttpRequest({
241
+ protocol,
242
+ hostname,
243
+ port,
244
+ method: "POST",
245
+ headers,
246
+ path: resolvedPath,
247
+ body,
690
248
  });
691
- }); };
692
- var deserializeAws_restJson1GetDeviceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
693
- var parsedOutput, _a, errorCode, _b, parsedBody;
694
- var _c;
695
- return __generator(this, function (_d) {
696
- switch (_d.label) {
697
- case 0:
698
- _a = [__assign({}, output)];
699
- _c = {};
700
- return [4, parseErrorBody(output.body, context)];
701
- case 1:
702
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
703
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
704
- _b = errorCode;
705
- switch (_b) {
706
- case "AccessDeniedException": return [3, 2];
707
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
708
- case "InternalServiceException": return [3, 4];
709
- case "com.amazonaws.braket#InternalServiceException": return [3, 4];
710
- case "ResourceNotFoundException": return [3, 6];
711
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 6];
712
- case "ThrottlingException": return [3, 8];
713
- case "com.amazonaws.braket#ThrottlingException": return [3, 8];
714
- case "ValidationException": return [3, 10];
715
- case "com.amazonaws.braket#ValidationException": return [3, 10];
716
- }
717
- return [3, 12];
718
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
719
- case 3: throw _d.sent();
720
- case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
721
- case 5: throw _d.sent();
722
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
723
- case 7: throw _d.sent();
724
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
725
- case 9: throw _d.sent();
726
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
727
- case 11: throw _d.sent();
728
- case 12:
729
- parsedBody = parsedOutput.body;
730
- throwDefaultError({
731
- output: output,
732
- parsedBody: parsedBody,
733
- exceptionCtor: __BaseException,
734
- errorCode: errorCode,
735
- });
736
- _d.label = 13;
737
- case 13: return [2];
738
- }
249
+ };
250
+ export const serializeAws_restJson1TagResourceCommand = async (input, context) => {
251
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
252
+ const headers = {
253
+ "content-type": "application/json",
254
+ };
255
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
256
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
257
+ let body;
258
+ body = JSON.stringify({
259
+ ...(input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) }),
739
260
  });
740
- }); };
741
- export var deserializeAws_restJson1GetJobCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
742
- var contents, data, _a, _b;
743
- return __generator(this, function (_c) {
744
- switch (_c.label) {
745
- case 0:
746
- if (output.statusCode !== 200 && output.statusCode >= 300) {
747
- return [2, deserializeAws_restJson1GetJobCommandError(output, context)];
748
- }
749
- contents = map({
750
- $metadata: deserializeMetadata(output),
751
- });
752
- _a = __expectNonNull;
753
- _b = __expectObject;
754
- return [4, parseBody(output.body, context)];
755
- case 1:
756
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
757
- if (data.algorithmSpecification != null) {
758
- contents.algorithmSpecification = deserializeAws_restJson1AlgorithmSpecification(data.algorithmSpecification, context);
759
- }
760
- if (data.billableDuration != null) {
761
- contents.billableDuration = __expectInt32(data.billableDuration);
762
- }
763
- if (data.checkpointConfig != null) {
764
- contents.checkpointConfig = deserializeAws_restJson1JobCheckpointConfig(data.checkpointConfig, context);
765
- }
766
- if (data.createdAt != null) {
767
- contents.createdAt = __expectNonNull(__parseRfc3339DateTime(data.createdAt));
768
- }
769
- if (data.deviceConfig != null) {
770
- contents.deviceConfig = deserializeAws_restJson1DeviceConfig(data.deviceConfig, context);
771
- }
772
- if (data.endedAt != null) {
773
- contents.endedAt = __expectNonNull(__parseRfc3339DateTime(data.endedAt));
774
- }
775
- if (data.events != null) {
776
- contents.events = deserializeAws_restJson1JobEvents(data.events, context);
777
- }
778
- if (data.failureReason != null) {
779
- contents.failureReason = __expectString(data.failureReason);
780
- }
781
- if (data.hyperParameters != null) {
782
- contents.hyperParameters = deserializeAws_restJson1HyperParameters(data.hyperParameters, context);
783
- }
784
- if (data.inputDataConfig != null) {
785
- contents.inputDataConfig = deserializeAws_restJson1InputConfigList(data.inputDataConfig, context);
786
- }
787
- if (data.instanceConfig != null) {
788
- contents.instanceConfig = deserializeAws_restJson1InstanceConfig(data.instanceConfig, context);
789
- }
790
- if (data.jobArn != null) {
791
- contents.jobArn = __expectString(data.jobArn);
792
- }
793
- if (data.jobName != null) {
794
- contents.jobName = __expectString(data.jobName);
795
- }
796
- if (data.outputDataConfig != null) {
797
- contents.outputDataConfig = deserializeAws_restJson1JobOutputDataConfig(data.outputDataConfig, context);
798
- }
799
- if (data.roleArn != null) {
800
- contents.roleArn = __expectString(data.roleArn);
801
- }
802
- if (data.startedAt != null) {
803
- contents.startedAt = __expectNonNull(__parseRfc3339DateTime(data.startedAt));
804
- }
805
- if (data.status != null) {
806
- contents.status = __expectString(data.status);
807
- }
808
- if (data.stoppingCondition != null) {
809
- contents.stoppingCondition = deserializeAws_restJson1JobStoppingCondition(data.stoppingCondition, context);
810
- }
811
- if (data.tags != null) {
812
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
813
- }
814
- return [2, contents];
815
- }
261
+ return new __HttpRequest({
262
+ protocol,
263
+ hostname,
264
+ port,
265
+ method: "POST",
266
+ headers,
267
+ path: resolvedPath,
268
+ body,
816
269
  });
817
- }); };
818
- var deserializeAws_restJson1GetJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
819
- var parsedOutput, _a, errorCode, _b, parsedBody;
820
- var _c;
821
- return __generator(this, function (_d) {
822
- switch (_d.label) {
823
- case 0:
824
- _a = [__assign({}, output)];
825
- _c = {};
826
- return [4, parseErrorBody(output.body, context)];
827
- case 1:
828
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
829
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
830
- _b = errorCode;
831
- switch (_b) {
832
- case "AccessDeniedException": return [3, 2];
833
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
834
- case "InternalServiceException": return [3, 4];
835
- case "com.amazonaws.braket#InternalServiceException": return [3, 4];
836
- case "ResourceNotFoundException": return [3, 6];
837
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 6];
838
- case "ThrottlingException": return [3, 8];
839
- case "com.amazonaws.braket#ThrottlingException": return [3, 8];
840
- case "ValidationException": return [3, 10];
841
- case "com.amazonaws.braket#ValidationException": return [3, 10];
842
- }
843
- return [3, 12];
844
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
845
- case 3: throw _d.sent();
846
- case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
847
- case 5: throw _d.sent();
848
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
849
- case 7: throw _d.sent();
850
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
851
- case 9: throw _d.sent();
852
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
853
- case 11: throw _d.sent();
854
- case 12:
855
- parsedBody = parsedOutput.body;
856
- throwDefaultError({
857
- output: output,
858
- parsedBody: parsedBody,
859
- exceptionCtor: __BaseException,
860
- errorCode: errorCode,
861
- });
862
- _d.label = 13;
863
- case 13: return [2];
864
- }
270
+ };
271
+ export const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
272
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
273
+ const headers = {};
274
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
275
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", () => input.resourceArn, "{resourceArn}", false);
276
+ const query = map({
277
+ tagKeys: [() => input.tagKeys !== void 0, () => (input.tagKeys || []).map((_entry) => _entry)],
865
278
  });
866
- }); };
867
- export var deserializeAws_restJson1GetQuantumTaskCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
868
- var contents, data, _a, _b;
869
- return __generator(this, function (_c) {
870
- switch (_c.label) {
871
- case 0:
872
- if (output.statusCode !== 200 && output.statusCode >= 300) {
873
- return [2, deserializeAws_restJson1GetQuantumTaskCommandError(output, context)];
874
- }
875
- contents = map({
876
- $metadata: deserializeMetadata(output),
877
- });
878
- _a = __expectNonNull;
879
- _b = __expectObject;
880
- return [4, parseBody(output.body, context)];
881
- case 1:
882
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
883
- if (data.createdAt != null) {
884
- contents.createdAt = __expectNonNull(__parseRfc3339DateTime(data.createdAt));
885
- }
886
- if (data.deviceArn != null) {
887
- contents.deviceArn = __expectString(data.deviceArn);
888
- }
889
- if (data.deviceParameters != null) {
890
- contents.deviceParameters = new __LazyJsonString(data.deviceParameters);
891
- }
892
- if (data.endedAt != null) {
893
- contents.endedAt = __expectNonNull(__parseRfc3339DateTime(data.endedAt));
894
- }
895
- if (data.failureReason != null) {
896
- contents.failureReason = __expectString(data.failureReason);
897
- }
898
- if (data.jobArn != null) {
899
- contents.jobArn = __expectString(data.jobArn);
900
- }
901
- if (data.outputS3Bucket != null) {
902
- contents.outputS3Bucket = __expectString(data.outputS3Bucket);
903
- }
904
- if (data.outputS3Directory != null) {
905
- contents.outputS3Directory = __expectString(data.outputS3Directory);
906
- }
907
- if (data.quantumTaskArn != null) {
908
- contents.quantumTaskArn = __expectString(data.quantumTaskArn);
909
- }
910
- if (data.shots != null) {
911
- contents.shots = __expectLong(data.shots);
912
- }
913
- if (data.status != null) {
914
- contents.status = __expectString(data.status);
915
- }
916
- if (data.tags != null) {
917
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
918
- }
919
- return [2, contents];
920
- }
279
+ let body;
280
+ return new __HttpRequest({
281
+ protocol,
282
+ hostname,
283
+ port,
284
+ method: "DELETE",
285
+ headers,
286
+ path: resolvedPath,
287
+ query,
288
+ body,
921
289
  });
922
- }); };
923
- var deserializeAws_restJson1GetQuantumTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
924
- var parsedOutput, _a, errorCode, _b, parsedBody;
925
- var _c;
926
- return __generator(this, function (_d) {
927
- switch (_d.label) {
928
- case 0:
929
- _a = [__assign({}, output)];
930
- _c = {};
931
- return [4, parseErrorBody(output.body, context)];
932
- case 1:
933
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
934
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
935
- _b = errorCode;
936
- switch (_b) {
937
- case "AccessDeniedException": return [3, 2];
938
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
939
- case "InternalServiceException": return [3, 4];
940
- case "com.amazonaws.braket#InternalServiceException": return [3, 4];
941
- case "ResourceNotFoundException": return [3, 6];
942
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 6];
943
- case "ThrottlingException": return [3, 8];
944
- case "com.amazonaws.braket#ThrottlingException": return [3, 8];
945
- case "ValidationException": return [3, 10];
946
- case "com.amazonaws.braket#ValidationException": return [3, 10];
947
- }
948
- return [3, 12];
949
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
950
- case 3: throw _d.sent();
951
- case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
952
- case 5: throw _d.sent();
953
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
954
- case 7: throw _d.sent();
955
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
956
- case 9: throw _d.sent();
957
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
958
- case 11: throw _d.sent();
959
- case 12:
960
- parsedBody = parsedOutput.body;
961
- throwDefaultError({
962
- output: output,
963
- parsedBody: parsedBody,
964
- exceptionCtor: __BaseException,
965
- errorCode: errorCode,
966
- });
967
- _d.label = 13;
968
- case 13: return [2];
969
- }
290
+ };
291
+ export const deserializeAws_restJson1CancelJobCommand = async (output, context) => {
292
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
293
+ return deserializeAws_restJson1CancelJobCommandError(output, context);
294
+ }
295
+ const contents = map({
296
+ $metadata: deserializeMetadata(output),
970
297
  });
971
- }); };
972
- export var deserializeAws_restJson1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
973
- var contents, data, _a, _b;
974
- return __generator(this, function (_c) {
975
- switch (_c.label) {
976
- case 0:
977
- if (output.statusCode !== 200 && output.statusCode >= 300) {
978
- return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
979
- }
980
- contents = map({
981
- $metadata: deserializeMetadata(output),
982
- });
983
- _a = __expectNonNull;
984
- _b = __expectObject;
985
- return [4, parseBody(output.body, context)];
986
- case 1:
987
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
988
- if (data.tags != null) {
989
- contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
990
- }
991
- return [2, contents];
992
- }
298
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
299
+ if (data.cancellationStatus != null) {
300
+ contents.cancellationStatus = __expectString(data.cancellationStatus);
301
+ }
302
+ if (data.jobArn != null) {
303
+ contents.jobArn = __expectString(data.jobArn);
304
+ }
305
+ return contents;
306
+ };
307
+ const deserializeAws_restJson1CancelJobCommandError = async (output, context) => {
308
+ const parsedOutput = {
309
+ ...output,
310
+ body: await parseErrorBody(output.body, context),
311
+ };
312
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
313
+ switch (errorCode) {
314
+ case "AccessDeniedException":
315
+ case "com.amazonaws.braket#AccessDeniedException":
316
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
317
+ case "ConflictException":
318
+ case "com.amazonaws.braket#ConflictException":
319
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
320
+ case "InternalServiceException":
321
+ case "com.amazonaws.braket#InternalServiceException":
322
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
323
+ case "ResourceNotFoundException":
324
+ case "com.amazonaws.braket#ResourceNotFoundException":
325
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
326
+ case "ThrottlingException":
327
+ case "com.amazonaws.braket#ThrottlingException":
328
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
329
+ case "ValidationException":
330
+ case "com.amazonaws.braket#ValidationException":
331
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
332
+ default:
333
+ const parsedBody = parsedOutput.body;
334
+ throwDefaultError({
335
+ output,
336
+ parsedBody,
337
+ exceptionCtor: __BaseException,
338
+ errorCode,
339
+ });
340
+ }
341
+ };
342
+ export const deserializeAws_restJson1CancelQuantumTaskCommand = async (output, context) => {
343
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
344
+ return deserializeAws_restJson1CancelQuantumTaskCommandError(output, context);
345
+ }
346
+ const contents = map({
347
+ $metadata: deserializeMetadata(output),
993
348
  });
994
- }); };
995
- var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
996
- var parsedOutput, _a, errorCode, _b, parsedBody;
997
- var _c;
998
- return __generator(this, function (_d) {
999
- switch (_d.label) {
1000
- case 0:
1001
- _a = [__assign({}, output)];
1002
- _c = {};
1003
- return [4, parseErrorBody(output.body, context)];
1004
- case 1:
1005
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1006
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1007
- _b = errorCode;
1008
- switch (_b) {
1009
- case "InternalServiceException": return [3, 2];
1010
- case "com.amazonaws.braket#InternalServiceException": return [3, 2];
1011
- case "ResourceNotFoundException": return [3, 4];
1012
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 4];
1013
- case "ValidationException": return [3, 6];
1014
- case "com.amazonaws.braket#ValidationException": return [3, 6];
1015
- }
1016
- return [3, 8];
1017
- case 2: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
1018
- case 3: throw _d.sent();
1019
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1020
- case 5: throw _d.sent();
1021
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1022
- case 7: throw _d.sent();
1023
- case 8:
1024
- parsedBody = parsedOutput.body;
1025
- throwDefaultError({
1026
- output: output,
1027
- parsedBody: parsedBody,
1028
- exceptionCtor: __BaseException,
1029
- errorCode: errorCode,
1030
- });
1031
- _d.label = 9;
1032
- case 9: return [2];
1033
- }
349
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
350
+ if (data.cancellationStatus != null) {
351
+ contents.cancellationStatus = __expectString(data.cancellationStatus);
352
+ }
353
+ if (data.quantumTaskArn != null) {
354
+ contents.quantumTaskArn = __expectString(data.quantumTaskArn);
355
+ }
356
+ return contents;
357
+ };
358
+ const deserializeAws_restJson1CancelQuantumTaskCommandError = async (output, context) => {
359
+ const parsedOutput = {
360
+ ...output,
361
+ body: await parseErrorBody(output.body, context),
362
+ };
363
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
364
+ switch (errorCode) {
365
+ case "AccessDeniedException":
366
+ case "com.amazonaws.braket#AccessDeniedException":
367
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
368
+ case "ConflictException":
369
+ case "com.amazonaws.braket#ConflictException":
370
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
371
+ case "InternalServiceException":
372
+ case "com.amazonaws.braket#InternalServiceException":
373
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
374
+ case "ResourceNotFoundException":
375
+ case "com.amazonaws.braket#ResourceNotFoundException":
376
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
377
+ case "ThrottlingException":
378
+ case "com.amazonaws.braket#ThrottlingException":
379
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
380
+ case "ValidationException":
381
+ case "com.amazonaws.braket#ValidationException":
382
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
383
+ default:
384
+ const parsedBody = parsedOutput.body;
385
+ throwDefaultError({
386
+ output,
387
+ parsedBody,
388
+ exceptionCtor: __BaseException,
389
+ errorCode,
390
+ });
391
+ }
392
+ };
393
+ export const deserializeAws_restJson1CreateJobCommand = async (output, context) => {
394
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
395
+ return deserializeAws_restJson1CreateJobCommandError(output, context);
396
+ }
397
+ const contents = map({
398
+ $metadata: deserializeMetadata(output),
1034
399
  });
1035
- }); };
1036
- export var deserializeAws_restJson1SearchDevicesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1037
- var contents, data, _a, _b;
1038
- return __generator(this, function (_c) {
1039
- switch (_c.label) {
1040
- case 0:
1041
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1042
- return [2, deserializeAws_restJson1SearchDevicesCommandError(output, context)];
1043
- }
1044
- contents = map({
1045
- $metadata: deserializeMetadata(output),
1046
- });
1047
- _a = __expectNonNull;
1048
- _b = __expectObject;
1049
- return [4, parseBody(output.body, context)];
1050
- case 1:
1051
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1052
- if (data.devices != null) {
1053
- contents.devices = deserializeAws_restJson1DeviceSummaryList(data.devices, context);
1054
- }
1055
- if (data.nextToken != null) {
1056
- contents.nextToken = __expectString(data.nextToken);
1057
- }
1058
- return [2, contents];
1059
- }
400
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
401
+ if (data.jobArn != null) {
402
+ contents.jobArn = __expectString(data.jobArn);
403
+ }
404
+ return contents;
405
+ };
406
+ const deserializeAws_restJson1CreateJobCommandError = async (output, context) => {
407
+ const parsedOutput = {
408
+ ...output,
409
+ body: await parseErrorBody(output.body, context),
410
+ };
411
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
412
+ switch (errorCode) {
413
+ case "AccessDeniedException":
414
+ case "com.amazonaws.braket#AccessDeniedException":
415
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
416
+ case "ConflictException":
417
+ case "com.amazonaws.braket#ConflictException":
418
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
419
+ case "DeviceRetiredException":
420
+ case "com.amazonaws.braket#DeviceRetiredException":
421
+ throw await deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context);
422
+ case "InternalServiceException":
423
+ case "com.amazonaws.braket#InternalServiceException":
424
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
425
+ case "ServiceQuotaExceededException":
426
+ case "com.amazonaws.braket#ServiceQuotaExceededException":
427
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
428
+ case "ThrottlingException":
429
+ case "com.amazonaws.braket#ThrottlingException":
430
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
431
+ case "ValidationException":
432
+ case "com.amazonaws.braket#ValidationException":
433
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
434
+ default:
435
+ const parsedBody = parsedOutput.body;
436
+ throwDefaultError({
437
+ output,
438
+ parsedBody,
439
+ exceptionCtor: __BaseException,
440
+ errorCode,
441
+ });
442
+ }
443
+ };
444
+ export const deserializeAws_restJson1CreateQuantumTaskCommand = async (output, context) => {
445
+ if (output.statusCode !== 201 && output.statusCode >= 300) {
446
+ return deserializeAws_restJson1CreateQuantumTaskCommandError(output, context);
447
+ }
448
+ const contents = map({
449
+ $metadata: deserializeMetadata(output),
1060
450
  });
1061
- }); };
1062
- var deserializeAws_restJson1SearchDevicesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1063
- var parsedOutput, _a, errorCode, _b, parsedBody;
1064
- var _c;
1065
- return __generator(this, function (_d) {
1066
- switch (_d.label) {
1067
- case 0:
1068
- _a = [__assign({}, output)];
1069
- _c = {};
1070
- return [4, parseErrorBody(output.body, context)];
1071
- case 1:
1072
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1073
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1074
- _b = errorCode;
1075
- switch (_b) {
1076
- case "AccessDeniedException": return [3, 2];
1077
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
1078
- case "InternalServiceException": return [3, 4];
1079
- case "com.amazonaws.braket#InternalServiceException": return [3, 4];
1080
- case "ThrottlingException": return [3, 6];
1081
- case "com.amazonaws.braket#ThrottlingException": return [3, 6];
1082
- case "ValidationException": return [3, 8];
1083
- case "com.amazonaws.braket#ValidationException": return [3, 8];
1084
- }
1085
- return [3, 10];
1086
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1087
- case 3: throw _d.sent();
1088
- case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
1089
- case 5: throw _d.sent();
1090
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1091
- case 7: throw _d.sent();
1092
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1093
- case 9: throw _d.sent();
1094
- case 10:
1095
- parsedBody = parsedOutput.body;
1096
- throwDefaultError({
1097
- output: output,
1098
- parsedBody: parsedBody,
1099
- exceptionCtor: __BaseException,
1100
- errorCode: errorCode,
1101
- });
1102
- _d.label = 11;
1103
- case 11: return [2];
1104
- }
451
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
452
+ if (data.quantumTaskArn != null) {
453
+ contents.quantumTaskArn = __expectString(data.quantumTaskArn);
454
+ }
455
+ return contents;
456
+ };
457
+ const deserializeAws_restJson1CreateQuantumTaskCommandError = async (output, context) => {
458
+ const parsedOutput = {
459
+ ...output,
460
+ body: await parseErrorBody(output.body, context),
461
+ };
462
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
463
+ switch (errorCode) {
464
+ case "AccessDeniedException":
465
+ case "com.amazonaws.braket#AccessDeniedException":
466
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
467
+ case "DeviceOfflineException":
468
+ case "com.amazonaws.braket#DeviceOfflineException":
469
+ throw await deserializeAws_restJson1DeviceOfflineExceptionResponse(parsedOutput, context);
470
+ case "DeviceRetiredException":
471
+ case "com.amazonaws.braket#DeviceRetiredException":
472
+ throw await deserializeAws_restJson1DeviceRetiredExceptionResponse(parsedOutput, context);
473
+ case "InternalServiceException":
474
+ case "com.amazonaws.braket#InternalServiceException":
475
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
476
+ case "ServiceQuotaExceededException":
477
+ case "com.amazonaws.braket#ServiceQuotaExceededException":
478
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
479
+ case "ThrottlingException":
480
+ case "com.amazonaws.braket#ThrottlingException":
481
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
482
+ case "ValidationException":
483
+ case "com.amazonaws.braket#ValidationException":
484
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
485
+ default:
486
+ const parsedBody = parsedOutput.body;
487
+ throwDefaultError({
488
+ output,
489
+ parsedBody,
490
+ exceptionCtor: __BaseException,
491
+ errorCode,
492
+ });
493
+ }
494
+ };
495
+ export const deserializeAws_restJson1GetDeviceCommand = async (output, context) => {
496
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
497
+ return deserializeAws_restJson1GetDeviceCommandError(output, context);
498
+ }
499
+ const contents = map({
500
+ $metadata: deserializeMetadata(output),
1105
501
  });
1106
- }); };
1107
- export var deserializeAws_restJson1SearchJobsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1108
- var contents, data, _a, _b;
1109
- return __generator(this, function (_c) {
1110
- switch (_c.label) {
1111
- case 0:
1112
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1113
- return [2, deserializeAws_restJson1SearchJobsCommandError(output, context)];
1114
- }
1115
- contents = map({
1116
- $metadata: deserializeMetadata(output),
1117
- });
1118
- _a = __expectNonNull;
1119
- _b = __expectObject;
1120
- return [4, parseBody(output.body, context)];
1121
- case 1:
1122
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1123
- if (data.jobs != null) {
1124
- contents.jobs = deserializeAws_restJson1JobSummaryList(data.jobs, context);
1125
- }
1126
- if (data.nextToken != null) {
1127
- contents.nextToken = __expectString(data.nextToken);
1128
- }
1129
- return [2, contents];
1130
- }
502
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
503
+ if (data.deviceArn != null) {
504
+ contents.deviceArn = __expectString(data.deviceArn);
505
+ }
506
+ if (data.deviceCapabilities != null) {
507
+ contents.deviceCapabilities = new __LazyJsonString(data.deviceCapabilities);
508
+ }
509
+ if (data.deviceName != null) {
510
+ contents.deviceName = __expectString(data.deviceName);
511
+ }
512
+ if (data.deviceStatus != null) {
513
+ contents.deviceStatus = __expectString(data.deviceStatus);
514
+ }
515
+ if (data.deviceType != null) {
516
+ contents.deviceType = __expectString(data.deviceType);
517
+ }
518
+ if (data.providerName != null) {
519
+ contents.providerName = __expectString(data.providerName);
520
+ }
521
+ return contents;
522
+ };
523
+ const deserializeAws_restJson1GetDeviceCommandError = async (output, context) => {
524
+ const parsedOutput = {
525
+ ...output,
526
+ body: await parseErrorBody(output.body, context),
527
+ };
528
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
529
+ switch (errorCode) {
530
+ case "AccessDeniedException":
531
+ case "com.amazonaws.braket#AccessDeniedException":
532
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
533
+ case "InternalServiceException":
534
+ case "com.amazonaws.braket#InternalServiceException":
535
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
536
+ case "ResourceNotFoundException":
537
+ case "com.amazonaws.braket#ResourceNotFoundException":
538
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
539
+ case "ThrottlingException":
540
+ case "com.amazonaws.braket#ThrottlingException":
541
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
542
+ case "ValidationException":
543
+ case "com.amazonaws.braket#ValidationException":
544
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
545
+ default:
546
+ const parsedBody = parsedOutput.body;
547
+ throwDefaultError({
548
+ output,
549
+ parsedBody,
550
+ exceptionCtor: __BaseException,
551
+ errorCode,
552
+ });
553
+ }
554
+ };
555
+ export const deserializeAws_restJson1GetJobCommand = async (output, context) => {
556
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
557
+ return deserializeAws_restJson1GetJobCommandError(output, context);
558
+ }
559
+ const contents = map({
560
+ $metadata: deserializeMetadata(output),
1131
561
  });
1132
- }); };
1133
- var deserializeAws_restJson1SearchJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1134
- var parsedOutput, _a, errorCode, _b, parsedBody;
1135
- var _c;
1136
- return __generator(this, function (_d) {
1137
- switch (_d.label) {
1138
- case 0:
1139
- _a = [__assign({}, output)];
1140
- _c = {};
1141
- return [4, parseErrorBody(output.body, context)];
1142
- case 1:
1143
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1144
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1145
- _b = errorCode;
1146
- switch (_b) {
1147
- case "AccessDeniedException": return [3, 2];
1148
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
1149
- case "InternalServiceException": return [3, 4];
1150
- case "com.amazonaws.braket#InternalServiceException": return [3, 4];
1151
- case "ThrottlingException": return [3, 6];
1152
- case "com.amazonaws.braket#ThrottlingException": return [3, 6];
1153
- case "ValidationException": return [3, 8];
1154
- case "com.amazonaws.braket#ValidationException": return [3, 8];
1155
- }
1156
- return [3, 10];
1157
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1158
- case 3: throw _d.sent();
1159
- case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
1160
- case 5: throw _d.sent();
1161
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1162
- case 7: throw _d.sent();
1163
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1164
- case 9: throw _d.sent();
1165
- case 10:
1166
- parsedBody = parsedOutput.body;
1167
- throwDefaultError({
1168
- output: output,
1169
- parsedBody: parsedBody,
1170
- exceptionCtor: __BaseException,
1171
- errorCode: errorCode,
1172
- });
1173
- _d.label = 11;
1174
- case 11: return [2];
1175
- }
562
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
563
+ if (data.algorithmSpecification != null) {
564
+ contents.algorithmSpecification = deserializeAws_restJson1AlgorithmSpecification(data.algorithmSpecification, context);
565
+ }
566
+ if (data.billableDuration != null) {
567
+ contents.billableDuration = __expectInt32(data.billableDuration);
568
+ }
569
+ if (data.checkpointConfig != null) {
570
+ contents.checkpointConfig = deserializeAws_restJson1JobCheckpointConfig(data.checkpointConfig, context);
571
+ }
572
+ if (data.createdAt != null) {
573
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTime(data.createdAt));
574
+ }
575
+ if (data.deviceConfig != null) {
576
+ contents.deviceConfig = deserializeAws_restJson1DeviceConfig(data.deviceConfig, context);
577
+ }
578
+ if (data.endedAt != null) {
579
+ contents.endedAt = __expectNonNull(__parseRfc3339DateTime(data.endedAt));
580
+ }
581
+ if (data.events != null) {
582
+ contents.events = deserializeAws_restJson1JobEvents(data.events, context);
583
+ }
584
+ if (data.failureReason != null) {
585
+ contents.failureReason = __expectString(data.failureReason);
586
+ }
587
+ if (data.hyperParameters != null) {
588
+ contents.hyperParameters = deserializeAws_restJson1HyperParameters(data.hyperParameters, context);
589
+ }
590
+ if (data.inputDataConfig != null) {
591
+ contents.inputDataConfig = deserializeAws_restJson1InputConfigList(data.inputDataConfig, context);
592
+ }
593
+ if (data.instanceConfig != null) {
594
+ contents.instanceConfig = deserializeAws_restJson1InstanceConfig(data.instanceConfig, context);
595
+ }
596
+ if (data.jobArn != null) {
597
+ contents.jobArn = __expectString(data.jobArn);
598
+ }
599
+ if (data.jobName != null) {
600
+ contents.jobName = __expectString(data.jobName);
601
+ }
602
+ if (data.outputDataConfig != null) {
603
+ contents.outputDataConfig = deserializeAws_restJson1JobOutputDataConfig(data.outputDataConfig, context);
604
+ }
605
+ if (data.roleArn != null) {
606
+ contents.roleArn = __expectString(data.roleArn);
607
+ }
608
+ if (data.startedAt != null) {
609
+ contents.startedAt = __expectNonNull(__parseRfc3339DateTime(data.startedAt));
610
+ }
611
+ if (data.status != null) {
612
+ contents.status = __expectString(data.status);
613
+ }
614
+ if (data.stoppingCondition != null) {
615
+ contents.stoppingCondition = deserializeAws_restJson1JobStoppingCondition(data.stoppingCondition, context);
616
+ }
617
+ if (data.tags != null) {
618
+ contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
619
+ }
620
+ return contents;
621
+ };
622
+ const deserializeAws_restJson1GetJobCommandError = async (output, context) => {
623
+ const parsedOutput = {
624
+ ...output,
625
+ body: await parseErrorBody(output.body, context),
626
+ };
627
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
628
+ switch (errorCode) {
629
+ case "AccessDeniedException":
630
+ case "com.amazonaws.braket#AccessDeniedException":
631
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
632
+ case "InternalServiceException":
633
+ case "com.amazonaws.braket#InternalServiceException":
634
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
635
+ case "ResourceNotFoundException":
636
+ case "com.amazonaws.braket#ResourceNotFoundException":
637
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
638
+ case "ThrottlingException":
639
+ case "com.amazonaws.braket#ThrottlingException":
640
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
641
+ case "ValidationException":
642
+ case "com.amazonaws.braket#ValidationException":
643
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
644
+ default:
645
+ const parsedBody = parsedOutput.body;
646
+ throwDefaultError({
647
+ output,
648
+ parsedBody,
649
+ exceptionCtor: __BaseException,
650
+ errorCode,
651
+ });
652
+ }
653
+ };
654
+ export const deserializeAws_restJson1GetQuantumTaskCommand = async (output, context) => {
655
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
656
+ return deserializeAws_restJson1GetQuantumTaskCommandError(output, context);
657
+ }
658
+ const contents = map({
659
+ $metadata: deserializeMetadata(output),
1176
660
  });
1177
- }); };
1178
- export var deserializeAws_restJson1SearchQuantumTasksCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1179
- var contents, data, _a, _b;
1180
- return __generator(this, function (_c) {
1181
- switch (_c.label) {
1182
- case 0:
1183
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1184
- return [2, deserializeAws_restJson1SearchQuantumTasksCommandError(output, context)];
1185
- }
1186
- contents = map({
1187
- $metadata: deserializeMetadata(output),
1188
- });
1189
- _a = __expectNonNull;
1190
- _b = __expectObject;
1191
- return [4, parseBody(output.body, context)];
1192
- case 1:
1193
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1194
- if (data.nextToken != null) {
1195
- contents.nextToken = __expectString(data.nextToken);
1196
- }
1197
- if (data.quantumTasks != null) {
1198
- contents.quantumTasks = deserializeAws_restJson1QuantumTaskSummaryList(data.quantumTasks, context);
1199
- }
1200
- return [2, contents];
1201
- }
661
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
662
+ if (data.createdAt != null) {
663
+ contents.createdAt = __expectNonNull(__parseRfc3339DateTime(data.createdAt));
664
+ }
665
+ if (data.deviceArn != null) {
666
+ contents.deviceArn = __expectString(data.deviceArn);
667
+ }
668
+ if (data.deviceParameters != null) {
669
+ contents.deviceParameters = new __LazyJsonString(data.deviceParameters);
670
+ }
671
+ if (data.endedAt != null) {
672
+ contents.endedAt = __expectNonNull(__parseRfc3339DateTime(data.endedAt));
673
+ }
674
+ if (data.failureReason != null) {
675
+ contents.failureReason = __expectString(data.failureReason);
676
+ }
677
+ if (data.jobArn != null) {
678
+ contents.jobArn = __expectString(data.jobArn);
679
+ }
680
+ if (data.outputS3Bucket != null) {
681
+ contents.outputS3Bucket = __expectString(data.outputS3Bucket);
682
+ }
683
+ if (data.outputS3Directory != null) {
684
+ contents.outputS3Directory = __expectString(data.outputS3Directory);
685
+ }
686
+ if (data.quantumTaskArn != null) {
687
+ contents.quantumTaskArn = __expectString(data.quantumTaskArn);
688
+ }
689
+ if (data.shots != null) {
690
+ contents.shots = __expectLong(data.shots);
691
+ }
692
+ if (data.status != null) {
693
+ contents.status = __expectString(data.status);
694
+ }
695
+ if (data.tags != null) {
696
+ contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
697
+ }
698
+ return contents;
699
+ };
700
+ const deserializeAws_restJson1GetQuantumTaskCommandError = async (output, context) => {
701
+ const parsedOutput = {
702
+ ...output,
703
+ body: await parseErrorBody(output.body, context),
704
+ };
705
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
706
+ switch (errorCode) {
707
+ case "AccessDeniedException":
708
+ case "com.amazonaws.braket#AccessDeniedException":
709
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
710
+ case "InternalServiceException":
711
+ case "com.amazonaws.braket#InternalServiceException":
712
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
713
+ case "ResourceNotFoundException":
714
+ case "com.amazonaws.braket#ResourceNotFoundException":
715
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
716
+ case "ThrottlingException":
717
+ case "com.amazonaws.braket#ThrottlingException":
718
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
719
+ case "ValidationException":
720
+ case "com.amazonaws.braket#ValidationException":
721
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
722
+ default:
723
+ const parsedBody = parsedOutput.body;
724
+ throwDefaultError({
725
+ output,
726
+ parsedBody,
727
+ exceptionCtor: __BaseException,
728
+ errorCode,
729
+ });
730
+ }
731
+ };
732
+ export const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
733
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
734
+ return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
735
+ }
736
+ const contents = map({
737
+ $metadata: deserializeMetadata(output),
1202
738
  });
1203
- }); };
1204
- var deserializeAws_restJson1SearchQuantumTasksCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1205
- var parsedOutput, _a, errorCode, _b, parsedBody;
1206
- var _c;
1207
- return __generator(this, function (_d) {
1208
- switch (_d.label) {
1209
- case 0:
1210
- _a = [__assign({}, output)];
1211
- _c = {};
1212
- return [4, parseErrorBody(output.body, context)];
1213
- case 1:
1214
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1215
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1216
- _b = errorCode;
1217
- switch (_b) {
1218
- case "AccessDeniedException": return [3, 2];
1219
- case "com.amazonaws.braket#AccessDeniedException": return [3, 2];
1220
- case "InternalServiceException": return [3, 4];
1221
- case "com.amazonaws.braket#InternalServiceException": return [3, 4];
1222
- case "ThrottlingException": return [3, 6];
1223
- case "com.amazonaws.braket#ThrottlingException": return [3, 6];
1224
- case "ValidationException": return [3, 8];
1225
- case "com.amazonaws.braket#ValidationException": return [3, 8];
1226
- }
1227
- return [3, 10];
1228
- case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
1229
- case 3: throw _d.sent();
1230
- case 4: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
1231
- case 5: throw _d.sent();
1232
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
1233
- case 7: throw _d.sent();
1234
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1235
- case 9: throw _d.sent();
1236
- case 10:
1237
- parsedBody = parsedOutput.body;
1238
- throwDefaultError({
1239
- output: output,
1240
- parsedBody: parsedBody,
1241
- exceptionCtor: __BaseException,
1242
- errorCode: errorCode,
1243
- });
1244
- _d.label = 11;
1245
- case 11: return [2];
1246
- }
739
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
740
+ if (data.tags != null) {
741
+ contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
742
+ }
743
+ return contents;
744
+ };
745
+ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
746
+ const parsedOutput = {
747
+ ...output,
748
+ body: await parseErrorBody(output.body, context),
749
+ };
750
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
751
+ switch (errorCode) {
752
+ case "InternalServiceException":
753
+ case "com.amazonaws.braket#InternalServiceException":
754
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
755
+ case "ResourceNotFoundException":
756
+ case "com.amazonaws.braket#ResourceNotFoundException":
757
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
758
+ case "ValidationException":
759
+ case "com.amazonaws.braket#ValidationException":
760
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
761
+ default:
762
+ const parsedBody = parsedOutput.body;
763
+ throwDefaultError({
764
+ output,
765
+ parsedBody,
766
+ exceptionCtor: __BaseException,
767
+ errorCode,
768
+ });
769
+ }
770
+ };
771
+ export const deserializeAws_restJson1SearchDevicesCommand = async (output, context) => {
772
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
773
+ return deserializeAws_restJson1SearchDevicesCommandError(output, context);
774
+ }
775
+ const contents = map({
776
+ $metadata: deserializeMetadata(output),
1247
777
  });
1248
- }); };
1249
- export var deserializeAws_restJson1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1250
- var contents;
1251
- return __generator(this, function (_a) {
1252
- switch (_a.label) {
1253
- case 0:
1254
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1255
- return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1256
- }
1257
- contents = map({
1258
- $metadata: deserializeMetadata(output),
1259
- });
1260
- return [4, collectBody(output.body, context)];
1261
- case 1:
1262
- _a.sent();
1263
- return [2, contents];
1264
- }
778
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
779
+ if (data.devices != null) {
780
+ contents.devices = deserializeAws_restJson1DeviceSummaryList(data.devices, context);
781
+ }
782
+ if (data.nextToken != null) {
783
+ contents.nextToken = __expectString(data.nextToken);
784
+ }
785
+ return contents;
786
+ };
787
+ const deserializeAws_restJson1SearchDevicesCommandError = async (output, context) => {
788
+ const parsedOutput = {
789
+ ...output,
790
+ body: await parseErrorBody(output.body, context),
791
+ };
792
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
793
+ switch (errorCode) {
794
+ case "AccessDeniedException":
795
+ case "com.amazonaws.braket#AccessDeniedException":
796
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
797
+ case "InternalServiceException":
798
+ case "com.amazonaws.braket#InternalServiceException":
799
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
800
+ case "ThrottlingException":
801
+ case "com.amazonaws.braket#ThrottlingException":
802
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
803
+ case "ValidationException":
804
+ case "com.amazonaws.braket#ValidationException":
805
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
806
+ default:
807
+ const parsedBody = parsedOutput.body;
808
+ throwDefaultError({
809
+ output,
810
+ parsedBody,
811
+ exceptionCtor: __BaseException,
812
+ errorCode,
813
+ });
814
+ }
815
+ };
816
+ export const deserializeAws_restJson1SearchJobsCommand = async (output, context) => {
817
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
818
+ return deserializeAws_restJson1SearchJobsCommandError(output, context);
819
+ }
820
+ const contents = map({
821
+ $metadata: deserializeMetadata(output),
1265
822
  });
1266
- }); };
1267
- var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1268
- var parsedOutput, _a, errorCode, _b, parsedBody;
1269
- var _c;
1270
- return __generator(this, function (_d) {
1271
- switch (_d.label) {
1272
- case 0:
1273
- _a = [__assign({}, output)];
1274
- _c = {};
1275
- return [4, parseErrorBody(output.body, context)];
1276
- case 1:
1277
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1278
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1279
- _b = errorCode;
1280
- switch (_b) {
1281
- case "InternalServiceException": return [3, 2];
1282
- case "com.amazonaws.braket#InternalServiceException": return [3, 2];
1283
- case "ResourceNotFoundException": return [3, 4];
1284
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 4];
1285
- case "ValidationException": return [3, 6];
1286
- case "com.amazonaws.braket#ValidationException": return [3, 6];
1287
- }
1288
- return [3, 8];
1289
- case 2: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
1290
- case 3: throw _d.sent();
1291
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1292
- case 5: throw _d.sent();
1293
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1294
- case 7: throw _d.sent();
1295
- case 8:
1296
- parsedBody = parsedOutput.body;
1297
- throwDefaultError({
1298
- output: output,
1299
- parsedBody: parsedBody,
1300
- exceptionCtor: __BaseException,
1301
- errorCode: errorCode,
1302
- });
1303
- _d.label = 9;
1304
- case 9: return [2];
1305
- }
823
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
824
+ if (data.jobs != null) {
825
+ contents.jobs = deserializeAws_restJson1JobSummaryList(data.jobs, context);
826
+ }
827
+ if (data.nextToken != null) {
828
+ contents.nextToken = __expectString(data.nextToken);
829
+ }
830
+ return contents;
831
+ };
832
+ const deserializeAws_restJson1SearchJobsCommandError = async (output, context) => {
833
+ const parsedOutput = {
834
+ ...output,
835
+ body: await parseErrorBody(output.body, context),
836
+ };
837
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
838
+ switch (errorCode) {
839
+ case "AccessDeniedException":
840
+ case "com.amazonaws.braket#AccessDeniedException":
841
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
842
+ case "InternalServiceException":
843
+ case "com.amazonaws.braket#InternalServiceException":
844
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
845
+ case "ThrottlingException":
846
+ case "com.amazonaws.braket#ThrottlingException":
847
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
848
+ case "ValidationException":
849
+ case "com.amazonaws.braket#ValidationException":
850
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
851
+ default:
852
+ const parsedBody = parsedOutput.body;
853
+ throwDefaultError({
854
+ output,
855
+ parsedBody,
856
+ exceptionCtor: __BaseException,
857
+ errorCode,
858
+ });
859
+ }
860
+ };
861
+ export const deserializeAws_restJson1SearchQuantumTasksCommand = async (output, context) => {
862
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
863
+ return deserializeAws_restJson1SearchQuantumTasksCommandError(output, context);
864
+ }
865
+ const contents = map({
866
+ $metadata: deserializeMetadata(output),
1306
867
  });
1307
- }); };
1308
- export var deserializeAws_restJson1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1309
- var contents;
1310
- return __generator(this, function (_a) {
1311
- switch (_a.label) {
1312
- case 0:
1313
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1314
- return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1315
- }
1316
- contents = map({
1317
- $metadata: deserializeMetadata(output),
1318
- });
1319
- return [4, collectBody(output.body, context)];
1320
- case 1:
1321
- _a.sent();
1322
- return [2, contents];
1323
- }
868
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
869
+ if (data.nextToken != null) {
870
+ contents.nextToken = __expectString(data.nextToken);
871
+ }
872
+ if (data.quantumTasks != null) {
873
+ contents.quantumTasks = deserializeAws_restJson1QuantumTaskSummaryList(data.quantumTasks, context);
874
+ }
875
+ return contents;
876
+ };
877
+ const deserializeAws_restJson1SearchQuantumTasksCommandError = async (output, context) => {
878
+ const parsedOutput = {
879
+ ...output,
880
+ body: await parseErrorBody(output.body, context),
881
+ };
882
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
883
+ switch (errorCode) {
884
+ case "AccessDeniedException":
885
+ case "com.amazonaws.braket#AccessDeniedException":
886
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
887
+ case "InternalServiceException":
888
+ case "com.amazonaws.braket#InternalServiceException":
889
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
890
+ case "ThrottlingException":
891
+ case "com.amazonaws.braket#ThrottlingException":
892
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
893
+ case "ValidationException":
894
+ case "com.amazonaws.braket#ValidationException":
895
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
896
+ default:
897
+ const parsedBody = parsedOutput.body;
898
+ throwDefaultError({
899
+ output,
900
+ parsedBody,
901
+ exceptionCtor: __BaseException,
902
+ errorCode,
903
+ });
904
+ }
905
+ };
906
+ export const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
907
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
908
+ return deserializeAws_restJson1TagResourceCommandError(output, context);
909
+ }
910
+ const contents = map({
911
+ $metadata: deserializeMetadata(output),
1324
912
  });
1325
- }); };
1326
- var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1327
- var parsedOutput, _a, errorCode, _b, parsedBody;
1328
- var _c;
1329
- return __generator(this, function (_d) {
1330
- switch (_d.label) {
1331
- case 0:
1332
- _a = [__assign({}, output)];
1333
- _c = {};
1334
- return [4, parseErrorBody(output.body, context)];
1335
- case 1:
1336
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
1337
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1338
- _b = errorCode;
1339
- switch (_b) {
1340
- case "InternalServiceException": return [3, 2];
1341
- case "com.amazonaws.braket#InternalServiceException": return [3, 2];
1342
- case "ResourceNotFoundException": return [3, 4];
1343
- case "com.amazonaws.braket#ResourceNotFoundException": return [3, 4];
1344
- case "ValidationException": return [3, 6];
1345
- case "com.amazonaws.braket#ValidationException": return [3, 6];
1346
- }
1347
- return [3, 8];
1348
- case 2: return [4, deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context)];
1349
- case 3: throw _d.sent();
1350
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
1351
- case 5: throw _d.sent();
1352
- case 6: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
1353
- case 7: throw _d.sent();
1354
- case 8:
1355
- parsedBody = parsedOutput.body;
1356
- throwDefaultError({
1357
- output: output,
1358
- parsedBody: parsedBody,
1359
- exceptionCtor: __BaseException,
1360
- errorCode: errorCode,
1361
- });
1362
- _d.label = 9;
1363
- case 9: return [2];
1364
- }
913
+ await collectBody(output.body, context);
914
+ return contents;
915
+ };
916
+ const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
917
+ const parsedOutput = {
918
+ ...output,
919
+ body: await parseErrorBody(output.body, context),
920
+ };
921
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
922
+ switch (errorCode) {
923
+ case "InternalServiceException":
924
+ case "com.amazonaws.braket#InternalServiceException":
925
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
926
+ case "ResourceNotFoundException":
927
+ case "com.amazonaws.braket#ResourceNotFoundException":
928
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
929
+ case "ValidationException":
930
+ case "com.amazonaws.braket#ValidationException":
931
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
932
+ default:
933
+ const parsedBody = parsedOutput.body;
934
+ throwDefaultError({
935
+ output,
936
+ parsedBody,
937
+ exceptionCtor: __BaseException,
938
+ errorCode,
939
+ });
940
+ }
941
+ };
942
+ export const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
943
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
944
+ return deserializeAws_restJson1UntagResourceCommandError(output, context);
945
+ }
946
+ const contents = map({
947
+ $metadata: deserializeMetadata(output),
1365
948
  });
1366
- }); };
1367
- var map = __map;
1368
- var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1369
- var contents, data, exception;
1370
- return __generator(this, function (_a) {
1371
- contents = map({});
1372
- data = parsedOutput.body;
1373
- if (data.message != null) {
1374
- contents.message = __expectString(data.message);
1375
- }
1376
- exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1377
- return [2, __decorateServiceException(exception, parsedOutput.body)];
949
+ await collectBody(output.body, context);
950
+ return contents;
951
+ };
952
+ const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
953
+ const parsedOutput = {
954
+ ...output,
955
+ body: await parseErrorBody(output.body, context),
956
+ };
957
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
958
+ switch (errorCode) {
959
+ case "InternalServiceException":
960
+ case "com.amazonaws.braket#InternalServiceException":
961
+ throw await deserializeAws_restJson1InternalServiceExceptionResponse(parsedOutput, context);
962
+ case "ResourceNotFoundException":
963
+ case "com.amazonaws.braket#ResourceNotFoundException":
964
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
965
+ case "ValidationException":
966
+ case "com.amazonaws.braket#ValidationException":
967
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
968
+ default:
969
+ const parsedBody = parsedOutput.body;
970
+ throwDefaultError({
971
+ output,
972
+ parsedBody,
973
+ exceptionCtor: __BaseException,
974
+ errorCode,
975
+ });
976
+ }
977
+ };
978
+ const map = __map;
979
+ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
980
+ const contents = map({});
981
+ const data = parsedOutput.body;
982
+ if (data.message != null) {
983
+ contents.message = __expectString(data.message);
984
+ }
985
+ const exception = new AccessDeniedException({
986
+ $metadata: deserializeMetadata(parsedOutput),
987
+ ...contents,
1378
988
  });
1379
- }); };
1380
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1381
- var contents, data, exception;
1382
- return __generator(this, function (_a) {
1383
- contents = map({});
1384
- data = parsedOutput.body;
1385
- if (data.message != null) {
1386
- contents.message = __expectString(data.message);
1387
- }
1388
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1389
- return [2, __decorateServiceException(exception, parsedOutput.body)];
989
+ return __decorateServiceException(exception, parsedOutput.body);
990
+ };
991
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
992
+ const contents = map({});
993
+ const data = parsedOutput.body;
994
+ if (data.message != null) {
995
+ contents.message = __expectString(data.message);
996
+ }
997
+ const exception = new ConflictException({
998
+ $metadata: deserializeMetadata(parsedOutput),
999
+ ...contents,
1390
1000
  });
1391
- }); };
1392
- var deserializeAws_restJson1DeviceOfflineExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1393
- var contents, data, exception;
1394
- return __generator(this, function (_a) {
1395
- contents = map({});
1396
- data = parsedOutput.body;
1397
- if (data.message != null) {
1398
- contents.message = __expectString(data.message);
1399
- }
1400
- exception = new DeviceOfflineException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1401
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1001
+ return __decorateServiceException(exception, parsedOutput.body);
1002
+ };
1003
+ const deserializeAws_restJson1DeviceOfflineExceptionResponse = async (parsedOutput, context) => {
1004
+ const contents = map({});
1005
+ const data = parsedOutput.body;
1006
+ if (data.message != null) {
1007
+ contents.message = __expectString(data.message);
1008
+ }
1009
+ const exception = new DeviceOfflineException({
1010
+ $metadata: deserializeMetadata(parsedOutput),
1011
+ ...contents,
1402
1012
  });
1403
- }); };
1404
- var deserializeAws_restJson1DeviceRetiredExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1405
- var contents, data, exception;
1406
- return __generator(this, function (_a) {
1407
- contents = map({});
1408
- data = parsedOutput.body;
1409
- if (data.message != null) {
1410
- contents.message = __expectString(data.message);
1411
- }
1412
- exception = new DeviceRetiredException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1413
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1013
+ return __decorateServiceException(exception, parsedOutput.body);
1014
+ };
1015
+ const deserializeAws_restJson1DeviceRetiredExceptionResponse = async (parsedOutput, context) => {
1016
+ const contents = map({});
1017
+ const data = parsedOutput.body;
1018
+ if (data.message != null) {
1019
+ contents.message = __expectString(data.message);
1020
+ }
1021
+ const exception = new DeviceRetiredException({
1022
+ $metadata: deserializeMetadata(parsedOutput),
1023
+ ...contents,
1414
1024
  });
1415
- }); };
1416
- var deserializeAws_restJson1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1417
- var contents, data, exception;
1418
- return __generator(this, function (_a) {
1419
- contents = map({});
1420
- data = parsedOutput.body;
1421
- if (data.message != null) {
1422
- contents.message = __expectString(data.message);
1423
- }
1424
- exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1425
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1025
+ return __decorateServiceException(exception, parsedOutput.body);
1026
+ };
1027
+ const deserializeAws_restJson1InternalServiceExceptionResponse = async (parsedOutput, context) => {
1028
+ const contents = map({});
1029
+ const data = parsedOutput.body;
1030
+ if (data.message != null) {
1031
+ contents.message = __expectString(data.message);
1032
+ }
1033
+ const exception = new InternalServiceException({
1034
+ $metadata: deserializeMetadata(parsedOutput),
1035
+ ...contents,
1426
1036
  });
1427
- }); };
1428
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1429
- var contents, data, exception;
1430
- return __generator(this, function (_a) {
1431
- contents = map({});
1432
- data = parsedOutput.body;
1433
- if (data.message != null) {
1434
- contents.message = __expectString(data.message);
1435
- }
1436
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1437
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1037
+ return __decorateServiceException(exception, parsedOutput.body);
1038
+ };
1039
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1040
+ const contents = map({});
1041
+ const data = parsedOutput.body;
1042
+ if (data.message != null) {
1043
+ contents.message = __expectString(data.message);
1044
+ }
1045
+ const exception = new ResourceNotFoundException({
1046
+ $metadata: deserializeMetadata(parsedOutput),
1047
+ ...contents,
1438
1048
  });
1439
- }); };
1440
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1441
- var contents, data, exception;
1442
- return __generator(this, function (_a) {
1443
- contents = map({});
1444
- data = parsedOutput.body;
1445
- if (data.message != null) {
1446
- contents.message = __expectString(data.message);
1447
- }
1448
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1449
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1049
+ return __decorateServiceException(exception, parsedOutput.body);
1050
+ };
1051
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
1052
+ const contents = map({});
1053
+ const data = parsedOutput.body;
1054
+ if (data.message != null) {
1055
+ contents.message = __expectString(data.message);
1056
+ }
1057
+ const exception = new ServiceQuotaExceededException({
1058
+ $metadata: deserializeMetadata(parsedOutput),
1059
+ ...contents,
1450
1060
  });
1451
- }); };
1452
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1453
- var contents, data, exception;
1454
- return __generator(this, function (_a) {
1455
- contents = map({});
1456
- data = parsedOutput.body;
1457
- if (data.message != null) {
1458
- contents.message = __expectString(data.message);
1459
- }
1460
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1461
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1061
+ return __decorateServiceException(exception, parsedOutput.body);
1062
+ };
1063
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
1064
+ const contents = map({});
1065
+ const data = parsedOutput.body;
1066
+ if (data.message != null) {
1067
+ contents.message = __expectString(data.message);
1068
+ }
1069
+ const exception = new ThrottlingException({
1070
+ $metadata: deserializeMetadata(parsedOutput),
1071
+ ...contents,
1462
1072
  });
1463
- }); };
1464
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1465
- var contents, data, exception;
1466
- return __generator(this, function (_a) {
1467
- contents = map({});
1468
- data = parsedOutput.body;
1469
- if (data.message != null) {
1470
- contents.message = __expectString(data.message);
1471
- }
1472
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
1473
- return [2, __decorateServiceException(exception, parsedOutput.body)];
1073
+ return __decorateServiceException(exception, parsedOutput.body);
1074
+ };
1075
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
1076
+ const contents = map({});
1077
+ const data = parsedOutput.body;
1078
+ if (data.message != null) {
1079
+ contents.message = __expectString(data.message);
1080
+ }
1081
+ const exception = new ValidationException({
1082
+ $metadata: deserializeMetadata(parsedOutput),
1083
+ ...contents,
1474
1084
  });
1475
- }); };
1476
- var serializeAws_restJson1AlgorithmSpecification = function (input, context) {
1477
- return __assign(__assign({}, (input.containerImage != null && {
1478
- containerImage: serializeAws_restJson1ContainerImage(input.containerImage, context),
1479
- })), (input.scriptModeConfig != null && {
1480
- scriptModeConfig: serializeAws_restJson1ScriptModeConfig(input.scriptModeConfig, context),
1481
- }));
1482
- };
1483
- var serializeAws_restJson1ContainerImage = function (input, context) {
1484
- return __assign({}, (input.uri != null && { uri: input.uri }));
1485
- };
1486
- var serializeAws_restJson1DataSource = function (input, context) {
1487
- return __assign({}, (input.s3DataSource != null && {
1488
- s3DataSource: serializeAws_restJson1S3DataSource(input.s3DataSource, context),
1489
- }));
1490
- };
1491
- var serializeAws_restJson1DeviceConfig = function (input, context) {
1492
- return __assign({}, (input.device != null && { device: input.device }));
1493
- };
1494
- var serializeAws_restJson1HyperParameters = function (input, context) {
1495
- return Object.entries(input).reduce(function (acc, _a) {
1496
- var _b;
1497
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1085
+ return __decorateServiceException(exception, parsedOutput.body);
1086
+ };
1087
+ const serializeAws_restJson1AlgorithmSpecification = (input, context) => {
1088
+ return {
1089
+ ...(input.containerImage != null && {
1090
+ containerImage: serializeAws_restJson1ContainerImage(input.containerImage, context),
1091
+ }),
1092
+ ...(input.scriptModeConfig != null && {
1093
+ scriptModeConfig: serializeAws_restJson1ScriptModeConfig(input.scriptModeConfig, context),
1094
+ }),
1095
+ };
1096
+ };
1097
+ const serializeAws_restJson1ContainerImage = (input, context) => {
1098
+ return {
1099
+ ...(input.uri != null && { uri: input.uri }),
1100
+ };
1101
+ };
1102
+ const serializeAws_restJson1DataSource = (input, context) => {
1103
+ return {
1104
+ ...(input.s3DataSource != null && {
1105
+ s3DataSource: serializeAws_restJson1S3DataSource(input.s3DataSource, context),
1106
+ }),
1107
+ };
1108
+ };
1109
+ const serializeAws_restJson1DeviceConfig = (input, context) => {
1110
+ return {
1111
+ ...(input.device != null && { device: input.device }),
1112
+ };
1113
+ };
1114
+ const serializeAws_restJson1HyperParameters = (input, context) => {
1115
+ return Object.entries(input).reduce((acc, [key, value]) => {
1498
1116
  if (value === null) {
1499
1117
  return acc;
1500
1118
  }
1501
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1119
+ return {
1120
+ ...acc,
1121
+ [key]: value,
1122
+ };
1502
1123
  }, {});
1503
1124
  };
1504
- var serializeAws_restJson1InputConfigList = function (input, context) {
1125
+ const serializeAws_restJson1InputConfigList = (input, context) => {
1505
1126
  return input
1506
- .filter(function (e) { return e != null; })
1507
- .map(function (entry) {
1127
+ .filter((e) => e != null)
1128
+ .map((entry) => {
1508
1129
  return serializeAws_restJson1InputFileConfig(entry, context);
1509
1130
  });
1510
1131
  };
1511
- var serializeAws_restJson1InputFileConfig = function (input, context) {
1512
- return __assign(__assign(__assign({}, (input.channelName != null && { channelName: input.channelName })), (input.contentType != null && { contentType: input.contentType })), (input.dataSource != null && { dataSource: serializeAws_restJson1DataSource(input.dataSource, context) }));
1132
+ const serializeAws_restJson1InputFileConfig = (input, context) => {
1133
+ return {
1134
+ ...(input.channelName != null && { channelName: input.channelName }),
1135
+ ...(input.contentType != null && { contentType: input.contentType }),
1136
+ ...(input.dataSource != null && { dataSource: serializeAws_restJson1DataSource(input.dataSource, context) }),
1137
+ };
1513
1138
  };
1514
- var serializeAws_restJson1InstanceConfig = function (input, context) {
1515
- return __assign(__assign(__assign({}, (input.instanceCount != null && { instanceCount: input.instanceCount })), (input.instanceType != null && { instanceType: input.instanceType })), (input.volumeSizeInGb != null && { volumeSizeInGb: input.volumeSizeInGb }));
1139
+ const serializeAws_restJson1InstanceConfig = (input, context) => {
1140
+ return {
1141
+ ...(input.instanceCount != null && { instanceCount: input.instanceCount }),
1142
+ ...(input.instanceType != null && { instanceType: input.instanceType }),
1143
+ ...(input.volumeSizeInGb != null && { volumeSizeInGb: input.volumeSizeInGb }),
1144
+ };
1516
1145
  };
1517
- var serializeAws_restJson1JobCheckpointConfig = function (input, context) {
1518
- return __assign(__assign({}, (input.localPath != null && { localPath: input.localPath })), (input.s3Uri != null && { s3Uri: input.s3Uri }));
1146
+ const serializeAws_restJson1JobCheckpointConfig = (input, context) => {
1147
+ return {
1148
+ ...(input.localPath != null && { localPath: input.localPath }),
1149
+ ...(input.s3Uri != null && { s3Uri: input.s3Uri }),
1150
+ };
1519
1151
  };
1520
- var serializeAws_restJson1JobOutputDataConfig = function (input, context) {
1521
- return __assign(__assign({}, (input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId })), (input.s3Path != null && { s3Path: input.s3Path }));
1152
+ const serializeAws_restJson1JobOutputDataConfig = (input, context) => {
1153
+ return {
1154
+ ...(input.kmsKeyId != null && { kmsKeyId: input.kmsKeyId }),
1155
+ ...(input.s3Path != null && { s3Path: input.s3Path }),
1156
+ };
1522
1157
  };
1523
- var serializeAws_restJson1JobStoppingCondition = function (input, context) {
1524
- return __assign({}, (input.maxRuntimeInSeconds != null && { maxRuntimeInSeconds: input.maxRuntimeInSeconds }));
1158
+ const serializeAws_restJson1JobStoppingCondition = (input, context) => {
1159
+ return {
1160
+ ...(input.maxRuntimeInSeconds != null && { maxRuntimeInSeconds: input.maxRuntimeInSeconds }),
1161
+ };
1525
1162
  };
1526
- var serializeAws_restJson1S3DataSource = function (input, context) {
1527
- return __assign({}, (input.s3Uri != null && { s3Uri: input.s3Uri }));
1163
+ const serializeAws_restJson1S3DataSource = (input, context) => {
1164
+ return {
1165
+ ...(input.s3Uri != null && { s3Uri: input.s3Uri }),
1166
+ };
1528
1167
  };
1529
- var serializeAws_restJson1ScriptModeConfig = function (input, context) {
1530
- return __assign(__assign(__assign({}, (input.compressionType != null && { compressionType: input.compressionType })), (input.entryPoint != null && { entryPoint: input.entryPoint })), (input.s3Uri != null && { s3Uri: input.s3Uri }));
1168
+ const serializeAws_restJson1ScriptModeConfig = (input, context) => {
1169
+ return {
1170
+ ...(input.compressionType != null && { compressionType: input.compressionType }),
1171
+ ...(input.entryPoint != null && { entryPoint: input.entryPoint }),
1172
+ ...(input.s3Uri != null && { s3Uri: input.s3Uri }),
1173
+ };
1531
1174
  };
1532
- var serializeAws_restJson1SearchDevicesFilter = function (input, context) {
1533
- return __assign(__assign({}, (input.name != null && { name: input.name })), (input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }));
1175
+ const serializeAws_restJson1SearchDevicesFilter = (input, context) => {
1176
+ return {
1177
+ ...(input.name != null && { name: input.name }),
1178
+ ...(input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }),
1179
+ };
1534
1180
  };
1535
- var serializeAws_restJson1SearchDevicesFilterList = function (input, context) {
1181
+ const serializeAws_restJson1SearchDevicesFilterList = (input, context) => {
1536
1182
  return input
1537
- .filter(function (e) { return e != null; })
1538
- .map(function (entry) {
1183
+ .filter((e) => e != null)
1184
+ .map((entry) => {
1539
1185
  return serializeAws_restJson1SearchDevicesFilter(entry, context);
1540
1186
  });
1541
1187
  };
1542
- var serializeAws_restJson1SearchJobsFilter = function (input, context) {
1543
- return __assign(__assign(__assign({}, (input.name != null && { name: input.name })), (input.operator != null && { operator: input.operator })), (input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }));
1188
+ const serializeAws_restJson1SearchJobsFilter = (input, context) => {
1189
+ return {
1190
+ ...(input.name != null && { name: input.name }),
1191
+ ...(input.operator != null && { operator: input.operator }),
1192
+ ...(input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }),
1193
+ };
1544
1194
  };
1545
- var serializeAws_restJson1SearchJobsFilterList = function (input, context) {
1195
+ const serializeAws_restJson1SearchJobsFilterList = (input, context) => {
1546
1196
  return input
1547
- .filter(function (e) { return e != null; })
1548
- .map(function (entry) {
1197
+ .filter((e) => e != null)
1198
+ .map((entry) => {
1549
1199
  return serializeAws_restJson1SearchJobsFilter(entry, context);
1550
1200
  });
1551
1201
  };
1552
- var serializeAws_restJson1SearchQuantumTasksFilter = function (input, context) {
1553
- return __assign(__assign(__assign({}, (input.name != null && { name: input.name })), (input.operator != null && { operator: input.operator })), (input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }));
1202
+ const serializeAws_restJson1SearchQuantumTasksFilter = (input, context) => {
1203
+ return {
1204
+ ...(input.name != null && { name: input.name }),
1205
+ ...(input.operator != null && { operator: input.operator }),
1206
+ ...(input.values != null && { values: serializeAws_restJson1String256List(input.values, context) }),
1207
+ };
1554
1208
  };
1555
- var serializeAws_restJson1SearchQuantumTasksFilterList = function (input, context) {
1209
+ const serializeAws_restJson1SearchQuantumTasksFilterList = (input, context) => {
1556
1210
  return input
1557
- .filter(function (e) { return e != null; })
1558
- .map(function (entry) {
1211
+ .filter((e) => e != null)
1212
+ .map((entry) => {
1559
1213
  return serializeAws_restJson1SearchQuantumTasksFilter(entry, context);
1560
1214
  });
1561
1215
  };
1562
- var serializeAws_restJson1String256List = function (input, context) {
1216
+ const serializeAws_restJson1String256List = (input, context) => {
1563
1217
  return input
1564
- .filter(function (e) { return e != null; })
1565
- .map(function (entry) {
1218
+ .filter((e) => e != null)
1219
+ .map((entry) => {
1566
1220
  return entry;
1567
1221
  });
1568
1222
  };
1569
- var serializeAws_restJson1TagsMap = function (input, context) {
1570
- return Object.entries(input).reduce(function (acc, _a) {
1571
- var _b;
1572
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1223
+ const serializeAws_restJson1TagsMap = (input, context) => {
1224
+ return Object.entries(input).reduce((acc, [key, value]) => {
1573
1225
  if (value === null) {
1574
1226
  return acc;
1575
1227
  }
1576
- return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));
1228
+ return {
1229
+ ...acc,
1230
+ [key]: value,
1231
+ };
1577
1232
  }, {});
1578
1233
  };
1579
- var deserializeAws_restJson1AlgorithmSpecification = function (output, context) {
1234
+ const deserializeAws_restJson1AlgorithmSpecification = (output, context) => {
1580
1235
  return {
1581
1236
  containerImage: output.containerImage != null
1582
1237
  ? deserializeAws_restJson1ContainerImage(output.containerImage, context)
@@ -1586,22 +1241,22 @@ var deserializeAws_restJson1AlgorithmSpecification = function (output, context)
1586
1241
  : undefined,
1587
1242
  };
1588
1243
  };
1589
- var deserializeAws_restJson1ContainerImage = function (output, context) {
1244
+ const deserializeAws_restJson1ContainerImage = (output, context) => {
1590
1245
  return {
1591
1246
  uri: __expectString(output.uri),
1592
1247
  };
1593
1248
  };
1594
- var deserializeAws_restJson1DataSource = function (output, context) {
1249
+ const deserializeAws_restJson1DataSource = (output, context) => {
1595
1250
  return {
1596
1251
  s3DataSource: output.s3DataSource != null ? deserializeAws_restJson1S3DataSource(output.s3DataSource, context) : undefined,
1597
1252
  };
1598
1253
  };
1599
- var deserializeAws_restJson1DeviceConfig = function (output, context) {
1254
+ const deserializeAws_restJson1DeviceConfig = (output, context) => {
1600
1255
  return {
1601
1256
  device: __expectString(output.device),
1602
1257
  };
1603
1258
  };
1604
- var deserializeAws_restJson1DeviceSummary = function (output, context) {
1259
+ const deserializeAws_restJson1DeviceSummary = (output, context) => {
1605
1260
  return {
1606
1261
  deviceArn: __expectString(output.deviceArn),
1607
1262
  deviceName: __expectString(output.deviceName),
@@ -1610,10 +1265,10 @@ var deserializeAws_restJson1DeviceSummary = function (output, context) {
1610
1265
  providerName: __expectString(output.providerName),
1611
1266
  };
1612
1267
  };
1613
- var deserializeAws_restJson1DeviceSummaryList = function (output, context) {
1614
- var retVal = (output || [])
1615
- .filter(function (e) { return e != null; })
1616
- .map(function (entry) {
1268
+ const deserializeAws_restJson1DeviceSummaryList = (output, context) => {
1269
+ const retVal = (output || [])
1270
+ .filter((e) => e != null)
1271
+ .map((entry) => {
1617
1272
  if (entry === null) {
1618
1273
  return null;
1619
1274
  }
@@ -1621,20 +1276,21 @@ var deserializeAws_restJson1DeviceSummaryList = function (output, context) {
1621
1276
  });
1622
1277
  return retVal;
1623
1278
  };
1624
- var deserializeAws_restJson1HyperParameters = function (output, context) {
1625
- return Object.entries(output).reduce(function (acc, _a) {
1626
- var _b;
1627
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1279
+ const deserializeAws_restJson1HyperParameters = (output, context) => {
1280
+ return Object.entries(output).reduce((acc, [key, value]) => {
1628
1281
  if (value === null) {
1629
1282
  return acc;
1630
1283
  }
1631
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1284
+ return {
1285
+ ...acc,
1286
+ [key]: __expectString(value),
1287
+ };
1632
1288
  }, {});
1633
1289
  };
1634
- var deserializeAws_restJson1InputConfigList = function (output, context) {
1635
- var retVal = (output || [])
1636
- .filter(function (e) { return e != null; })
1637
- .map(function (entry) {
1290
+ const deserializeAws_restJson1InputConfigList = (output, context) => {
1291
+ const retVal = (output || [])
1292
+ .filter((e) => e != null)
1293
+ .map((entry) => {
1638
1294
  if (entry === null) {
1639
1295
  return null;
1640
1296
  }
@@ -1642,37 +1298,37 @@ var deserializeAws_restJson1InputConfigList = function (output, context) {
1642
1298
  });
1643
1299
  return retVal;
1644
1300
  };
1645
- var deserializeAws_restJson1InputFileConfig = function (output, context) {
1301
+ const deserializeAws_restJson1InputFileConfig = (output, context) => {
1646
1302
  return {
1647
1303
  channelName: __expectString(output.channelName),
1648
1304
  contentType: __expectString(output.contentType),
1649
1305
  dataSource: output.dataSource != null ? deserializeAws_restJson1DataSource(output.dataSource, context) : undefined,
1650
1306
  };
1651
1307
  };
1652
- var deserializeAws_restJson1InstanceConfig = function (output, context) {
1308
+ const deserializeAws_restJson1InstanceConfig = (output, context) => {
1653
1309
  return {
1654
1310
  instanceCount: __expectInt32(output.instanceCount),
1655
1311
  instanceType: __expectString(output.instanceType),
1656
1312
  volumeSizeInGb: __expectInt32(output.volumeSizeInGb),
1657
1313
  };
1658
1314
  };
1659
- var deserializeAws_restJson1JobCheckpointConfig = function (output, context) {
1315
+ const deserializeAws_restJson1JobCheckpointConfig = (output, context) => {
1660
1316
  return {
1661
1317
  localPath: __expectString(output.localPath),
1662
1318
  s3Uri: __expectString(output.s3Uri),
1663
1319
  };
1664
1320
  };
1665
- var deserializeAws_restJson1JobEventDetails = function (output, context) {
1321
+ const deserializeAws_restJson1JobEventDetails = (output, context) => {
1666
1322
  return {
1667
1323
  eventType: __expectString(output.eventType),
1668
1324
  message: __expectString(output.message),
1669
1325
  timeOfEvent: output.timeOfEvent != null ? __expectNonNull(__parseRfc3339DateTime(output.timeOfEvent)) : undefined,
1670
1326
  };
1671
1327
  };
1672
- var deserializeAws_restJson1JobEvents = function (output, context) {
1673
- var retVal = (output || [])
1674
- .filter(function (e) { return e != null; })
1675
- .map(function (entry) {
1328
+ const deserializeAws_restJson1JobEvents = (output, context) => {
1329
+ const retVal = (output || [])
1330
+ .filter((e) => e != null)
1331
+ .map((entry) => {
1676
1332
  if (entry === null) {
1677
1333
  return null;
1678
1334
  }
@@ -1680,18 +1336,18 @@ var deserializeAws_restJson1JobEvents = function (output, context) {
1680
1336
  });
1681
1337
  return retVal;
1682
1338
  };
1683
- var deserializeAws_restJson1JobOutputDataConfig = function (output, context) {
1339
+ const deserializeAws_restJson1JobOutputDataConfig = (output, context) => {
1684
1340
  return {
1685
1341
  kmsKeyId: __expectString(output.kmsKeyId),
1686
1342
  s3Path: __expectString(output.s3Path),
1687
1343
  };
1688
1344
  };
1689
- var deserializeAws_restJson1JobStoppingCondition = function (output, context) {
1345
+ const deserializeAws_restJson1JobStoppingCondition = (output, context) => {
1690
1346
  return {
1691
1347
  maxRuntimeInSeconds: __expectInt32(output.maxRuntimeInSeconds),
1692
1348
  };
1693
1349
  };
1694
- var deserializeAws_restJson1JobSummary = function (output, context) {
1350
+ const deserializeAws_restJson1JobSummary = (output, context) => {
1695
1351
  return {
1696
1352
  createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
1697
1353
  device: __expectString(output.device),
@@ -1703,10 +1359,10 @@ var deserializeAws_restJson1JobSummary = function (output, context) {
1703
1359
  tags: output.tags != null ? deserializeAws_restJson1TagsMap(output.tags, context) : undefined,
1704
1360
  };
1705
1361
  };
1706
- var deserializeAws_restJson1JobSummaryList = function (output, context) {
1707
- var retVal = (output || [])
1708
- .filter(function (e) { return e != null; })
1709
- .map(function (entry) {
1362
+ const deserializeAws_restJson1JobSummaryList = (output, context) => {
1363
+ const retVal = (output || [])
1364
+ .filter((e) => e != null)
1365
+ .map((entry) => {
1710
1366
  if (entry === null) {
1711
1367
  return null;
1712
1368
  }
@@ -1714,7 +1370,7 @@ var deserializeAws_restJson1JobSummaryList = function (output, context) {
1714
1370
  });
1715
1371
  return retVal;
1716
1372
  };
1717
- var deserializeAws_restJson1QuantumTaskSummary = function (output, context) {
1373
+ const deserializeAws_restJson1QuantumTaskSummary = (output, context) => {
1718
1374
  return {
1719
1375
  createdAt: output.createdAt != null ? __expectNonNull(__parseRfc3339DateTime(output.createdAt)) : undefined,
1720
1376
  deviceArn: __expectString(output.deviceArn),
@@ -1727,10 +1383,10 @@ var deserializeAws_restJson1QuantumTaskSummary = function (output, context) {
1727
1383
  tags: output.tags != null ? deserializeAws_restJson1TagsMap(output.tags, context) : undefined,
1728
1384
  };
1729
1385
  };
1730
- var deserializeAws_restJson1QuantumTaskSummaryList = function (output, context) {
1731
- var retVal = (output || [])
1732
- .filter(function (e) { return e != null; })
1733
- .map(function (entry) {
1386
+ const deserializeAws_restJson1QuantumTaskSummaryList = (output, context) => {
1387
+ const retVal = (output || [])
1388
+ .filter((e) => e != null)
1389
+ .map((entry) => {
1734
1390
  if (entry === null) {
1735
1391
  return null;
1736
1392
  }
@@ -1738,79 +1394,62 @@ var deserializeAws_restJson1QuantumTaskSummaryList = function (output, context)
1738
1394
  });
1739
1395
  return retVal;
1740
1396
  };
1741
- var deserializeAws_restJson1S3DataSource = function (output, context) {
1397
+ const deserializeAws_restJson1S3DataSource = (output, context) => {
1742
1398
  return {
1743
1399
  s3Uri: __expectString(output.s3Uri),
1744
1400
  };
1745
1401
  };
1746
- var deserializeAws_restJson1ScriptModeConfig = function (output, context) {
1402
+ const deserializeAws_restJson1ScriptModeConfig = (output, context) => {
1747
1403
  return {
1748
1404
  compressionType: __expectString(output.compressionType),
1749
1405
  entryPoint: __expectString(output.entryPoint),
1750
1406
  s3Uri: __expectString(output.s3Uri),
1751
1407
  };
1752
1408
  };
1753
- var deserializeAws_restJson1TagsMap = function (output, context) {
1754
- return Object.entries(output).reduce(function (acc, _a) {
1755
- var _b;
1756
- var _c = __read(_a, 2), key = _c[0], value = _c[1];
1409
+ const deserializeAws_restJson1TagsMap = (output, context) => {
1410
+ return Object.entries(output).reduce((acc, [key, value]) => {
1757
1411
  if (value === null) {
1758
1412
  return acc;
1759
1413
  }
1760
- return __assign(__assign({}, acc), (_b = {}, _b[key] = __expectString(value), _b));
1414
+ return {
1415
+ ...acc,
1416
+ [key]: __expectString(value),
1417
+ };
1761
1418
  }, {});
1762
1419
  };
1763
- var deserializeMetadata = function (output) {
1764
- var _a, _b;
1765
- return ({
1766
- httpStatusCode: output.statusCode,
1767
- requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
1768
- extendedRequestId: output.headers["x-amz-id-2"],
1769
- cfId: output.headers["x-amz-cf-id"],
1770
- });
1771
- };
1772
- var collectBody = function (streamBody, context) {
1773
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
1420
+ const deserializeMetadata = (output) => ({
1421
+ httpStatusCode: output.statusCode,
1422
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1423
+ extendedRequestId: output.headers["x-amz-id-2"],
1424
+ cfId: output.headers["x-amz-cf-id"],
1425
+ });
1426
+ const collectBody = (streamBody = new Uint8Array(), context) => {
1774
1427
  if (streamBody instanceof Uint8Array) {
1775
1428
  return Promise.resolve(streamBody);
1776
1429
  }
1777
1430
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1778
1431
  };
1779
- var collectBodyString = function (streamBody, context) {
1780
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
1781
- };
1782
- var isSerializableHeaderValue = function (value) {
1783
- return value !== undefined &&
1784
- value !== null &&
1785
- value !== "" &&
1786
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1787
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1788
- };
1789
- var parseBody = function (streamBody, context) {
1790
- return collectBodyString(streamBody, context).then(function (encoded) {
1791
- if (encoded.length) {
1792
- return JSON.parse(encoded);
1793
- }
1794
- return {};
1795
- });
1432
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1433
+ const isSerializableHeaderValue = (value) => value !== undefined &&
1434
+ value !== null &&
1435
+ value !== "" &&
1436
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1437
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1438
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1439
+ if (encoded.length) {
1440
+ return JSON.parse(encoded);
1441
+ }
1442
+ return {};
1443
+ });
1444
+ const parseErrorBody = async (errorBody, context) => {
1445
+ const value = await parseBody(errorBody, context);
1446
+ value.message = value.message ?? value.Message;
1447
+ return value;
1796
1448
  };
1797
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
1798
- var value;
1799
- var _a;
1800
- return __generator(this, function (_b) {
1801
- switch (_b.label) {
1802
- case 0: return [4, parseBody(errorBody, context)];
1803
- case 1:
1804
- value = _b.sent();
1805
- value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
1806
- return [2, value];
1807
- }
1808
- });
1809
- }); };
1810
- var loadRestJsonErrorCode = function (output, data) {
1811
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
1812
- var sanitizeErrorCode = function (rawValue) {
1813
- var cleanValue = rawValue;
1449
+ const loadRestJsonErrorCode = (output, data) => {
1450
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1451
+ const sanitizeErrorCode = (rawValue) => {
1452
+ let cleanValue = rawValue;
1814
1453
  if (typeof cleanValue === "number") {
1815
1454
  cleanValue = cleanValue.toString();
1816
1455
  }
@@ -1825,7 +1464,7 @@ var loadRestJsonErrorCode = function (output, data) {
1825
1464
  }
1826
1465
  return cleanValue;
1827
1466
  };
1828
- var headerKey = findKey(output.headers, "x-amzn-errortype");
1467
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
1829
1468
  if (headerKey !== undefined) {
1830
1469
  return sanitizeErrorCode(output.headers[headerKey]);
1831
1470
  }