@aws-sdk/client-braket 3.137.0 → 3.145.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,11 +1,11 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, LazyJsonString as __LazyJsonString, parseRfc3339DateTime as __parseRfc3339DateTime, } from "@aws-sdk/smithy-client";
3
+ 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
4
  import { v4 as generateIdempotencyToken } from "uuid";
5
5
  import { BraketServiceException as __BaseException } from "../models/BraketServiceException";
6
6
  import { AccessDeniedException, ConflictException, DeviceOfflineException, DeviceRetiredException, InternalServiceException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
7
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, labelValue, body;
8
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
9
9
  return __generator(this, function (_c) {
10
10
  switch (_c.label) {
11
11
  case 0: return [4, context.endpoint()];
@@ -13,16 +13,7 @@ export var serializeAws_restJson1CancelJobCommand = function (input, context) {
13
13
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
14
14
  headers = {};
15
15
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/job/{jobArn}/cancel";
16
- if (input.jobArn !== undefined) {
17
- labelValue = input.jobArn;
18
- if (labelValue.length <= 0) {
19
- throw new Error("Empty value provided for input HTTP label: jobArn.");
20
- }
21
- resolvedPath = resolvedPath.replace("{jobArn}", __extendedEncodeURIComponent(labelValue));
22
- }
23
- else {
24
- throw new Error("No value provided for input HTTP label: jobArn.");
25
- }
16
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobArn", function () { return input.jobArn; }, "{jobArn}", false);
26
17
  return [2, new __HttpRequest({
27
18
  protocol: protocol,
28
19
  hostname: hostname,
@@ -36,7 +27,7 @@ export var serializeAws_restJson1CancelJobCommand = function (input, context) {
36
27
  });
37
28
  }); };
38
29
  export var serializeAws_restJson1CancelQuantumTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
39
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
30
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
40
31
  var _c;
41
32
  return __generator(this, function (_d) {
42
33
  switch (_d.label) {
@@ -47,16 +38,7 @@ export var serializeAws_restJson1CancelQuantumTaskCommand = function (input, con
47
38
  "content-type": "application/json",
48
39
  };
49
40
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/quantum-task/{quantumTaskArn}/cancel";
50
- if (input.quantumTaskArn !== undefined) {
51
- labelValue = input.quantumTaskArn;
52
- if (labelValue.length <= 0) {
53
- throw new Error("Empty value provided for input HTTP label: quantumTaskArn.");
54
- }
55
- resolvedPath = resolvedPath.replace("{quantumTaskArn}", __extendedEncodeURIComponent(labelValue));
56
- }
57
- else {
58
- throw new Error("No value provided for input HTTP label: quantumTaskArn.");
59
- }
41
+ resolvedPath = __resolvedPath(resolvedPath, input, "quantumTaskArn", function () { return input.quantumTaskArn; }, "{quantumTaskArn}", false);
60
42
  body = JSON.stringify({
61
43
  clientToken: (_c = input.clientToken) !== null && _c !== void 0 ? _c : generateIdempotencyToken(),
62
44
  });
@@ -139,7 +121,7 @@ export var serializeAws_restJson1CreateQuantumTaskCommand = function (input, con
139
121
  });
140
122
  }); };
141
123
  export var serializeAws_restJson1GetDeviceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
142
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
124
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
143
125
  return __generator(this, function (_c) {
144
126
  switch (_c.label) {
145
127
  case 0: return [4, context.endpoint()];
@@ -147,16 +129,7 @@ export var serializeAws_restJson1GetDeviceCommand = function (input, context) {
147
129
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
148
130
  headers = {};
149
131
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/device/{deviceArn}";
150
- if (input.deviceArn !== undefined) {
151
- labelValue = input.deviceArn;
152
- if (labelValue.length <= 0) {
153
- throw new Error("Empty value provided for input HTTP label: deviceArn.");
154
- }
155
- resolvedPath = resolvedPath.replace("{deviceArn}", __extendedEncodeURIComponent(labelValue));
156
- }
157
- else {
158
- throw new Error("No value provided for input HTTP label: deviceArn.");
159
- }
132
+ resolvedPath = __resolvedPath(resolvedPath, input, "deviceArn", function () { return input.deviceArn; }, "{deviceArn}", false);
160
133
  return [2, new __HttpRequest({
161
134
  protocol: protocol,
162
135
  hostname: hostname,
@@ -170,7 +143,7 @@ export var serializeAws_restJson1GetDeviceCommand = function (input, context) {
170
143
  });
171
144
  }); };
172
145
  export var serializeAws_restJson1GetJobCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
173
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
146
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
174
147
  return __generator(this, function (_c) {
175
148
  switch (_c.label) {
176
149
  case 0: return [4, context.endpoint()];
@@ -178,16 +151,7 @@ export var serializeAws_restJson1GetJobCommand = function (input, context) { ret
178
151
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
179
152
  headers = {};
180
153
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/job/{jobArn}";
181
- if (input.jobArn !== undefined) {
182
- labelValue = input.jobArn;
183
- if (labelValue.length <= 0) {
184
- throw new Error("Empty value provided for input HTTP label: jobArn.");
185
- }
186
- resolvedPath = resolvedPath.replace("{jobArn}", __extendedEncodeURIComponent(labelValue));
187
- }
188
- else {
189
- throw new Error("No value provided for input HTTP label: jobArn.");
190
- }
154
+ resolvedPath = __resolvedPath(resolvedPath, input, "jobArn", function () { return input.jobArn; }, "{jobArn}", false);
191
155
  return [2, new __HttpRequest({
192
156
  protocol: protocol,
193
157
  hostname: hostname,
@@ -201,7 +165,7 @@ export var serializeAws_restJson1GetJobCommand = function (input, context) { ret
201
165
  });
202
166
  }); };
203
167
  export var serializeAws_restJson1GetQuantumTaskCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
204
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
168
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
205
169
  return __generator(this, function (_c) {
206
170
  switch (_c.label) {
207
171
  case 0: return [4, context.endpoint()];
@@ -209,16 +173,7 @@ export var serializeAws_restJson1GetQuantumTaskCommand = function (input, contex
209
173
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
210
174
  headers = {};
211
175
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/quantum-task/{quantumTaskArn}";
212
- if (input.quantumTaskArn !== undefined) {
213
- labelValue = input.quantumTaskArn;
214
- if (labelValue.length <= 0) {
215
- throw new Error("Empty value provided for input HTTP label: quantumTaskArn.");
216
- }
217
- resolvedPath = resolvedPath.replace("{quantumTaskArn}", __extendedEncodeURIComponent(labelValue));
218
- }
219
- else {
220
- throw new Error("No value provided for input HTTP label: quantumTaskArn.");
221
- }
176
+ resolvedPath = __resolvedPath(resolvedPath, input, "quantumTaskArn", function () { return input.quantumTaskArn; }, "{quantumTaskArn}", false);
222
177
  return [2, new __HttpRequest({
223
178
  protocol: protocol,
224
179
  hostname: hostname,
@@ -232,7 +187,7 @@ export var serializeAws_restJson1GetQuantumTaskCommand = function (input, contex
232
187
  });
233
188
  }); };
234
189
  export var serializeAws_restJson1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
235
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
190
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
236
191
  return __generator(this, function (_c) {
237
192
  switch (_c.label) {
238
193
  case 0: return [4, context.endpoint()];
@@ -240,16 +195,7 @@ export var serializeAws_restJson1ListTagsForResourceCommand = function (input, c
240
195
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
241
196
  headers = {};
242
197
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
243
- if (input.resourceArn !== undefined) {
244
- labelValue = input.resourceArn;
245
- if (labelValue.length <= 0) {
246
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
247
- }
248
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
249
- }
250
- else {
251
- throw new Error("No value provided for input HTTP label: resourceArn.");
252
- }
198
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
253
199
  return [2, new __HttpRequest({
254
200
  protocol: protocol,
255
201
  hostname: hostname,
@@ -337,7 +283,7 @@ export var serializeAws_restJson1SearchQuantumTasksCommand = function (input, co
337
283
  });
338
284
  }); };
339
285
  export var serializeAws_restJson1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
340
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
286
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
341
287
  return __generator(this, function (_c) {
342
288
  switch (_c.label) {
343
289
  case 0: return [4, context.endpoint()];
@@ -347,16 +293,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
347
293
  "content-type": "application/json",
348
294
  };
349
295
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
350
- if (input.resourceArn !== undefined) {
351
- labelValue = input.resourceArn;
352
- if (labelValue.length <= 0) {
353
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
354
- }
355
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
356
- }
357
- else {
358
- throw new Error("No value provided for input HTTP label: resourceArn.");
359
- }
296
+ resolvedPath = __resolvedPath(resolvedPath, input, "resourceArn", function () { return input.resourceArn; }, "{resourceArn}", false);
360
297
  body = JSON.stringify(__assign({}, (input.tags != null && { tags: serializeAws_restJson1TagsMap(input.tags, context) })));
361
298
  return [2, new __HttpRequest({
362
299
  protocol: protocol,
@@ -371,7 +308,7 @@ export var serializeAws_restJson1TagResourceCommand = function (input, context)
371
308
  });
372
309
  }); };
373
310
  export var serializeAws_restJson1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
374
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
311
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
375
312
  return __generator(this, function (_c) {
376
313
  switch (_c.label) {
377
314
  case 0: return [4, context.endpoint()];
@@ -379,17 +316,10 @@ export var serializeAws_restJson1UntagResourceCommand = function (input, context
379
316
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
380
317
  headers = {};
381
318
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/tags/{resourceArn}";
382
- if (input.resourceArn !== undefined) {
383
- labelValue = input.resourceArn;
384
- if (labelValue.length <= 0) {
385
- throw new Error("Empty value provided for input HTTP label: resourceArn.");
386
- }
387
- resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
388
- }
389
- else {
390
- throw new Error("No value provided for input HTTP label: resourceArn.");
391
- }
392
- query = __assign({}, (input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map(function (_entry) { return _entry; }) }));
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
+ });
393
323
  return [2, new __HttpRequest({
394
324
  protocol: protocol,
395
325
  hostname: hostname,
@@ -411,28 +341,26 @@ export var deserializeAws_restJson1CancelJobCommand = function (output, context)
411
341
  if (output.statusCode !== 200 && output.statusCode >= 300) {
412
342
  return [2, deserializeAws_restJson1CancelJobCommandError(output, context)];
413
343
  }
414
- contents = {
344
+ contents = map({
415
345
  $metadata: deserializeMetadata(output),
416
- cancellationStatus: undefined,
417
- jobArn: undefined,
418
- };
346
+ });
419
347
  _a = __expectNonNull;
420
348
  _b = __expectObject;
421
349
  return [4, parseBody(output.body, context)];
422
350
  case 1:
423
351
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
424
- if (data.cancellationStatus !== undefined && data.cancellationStatus !== null) {
352
+ if (data.cancellationStatus != null) {
425
353
  contents.cancellationStatus = __expectString(data.cancellationStatus);
426
354
  }
427
- if (data.jobArn !== undefined && data.jobArn !== null) {
355
+ if (data.jobArn != null) {
428
356
  contents.jobArn = __expectString(data.jobArn);
429
357
  }
430
- return [2, Promise.resolve(contents)];
358
+ return [2, contents];
431
359
  }
432
360
  });
433
361
  }); };
434
362
  var deserializeAws_restJson1CancelJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
435
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
363
+ var parsedOutput, _a, errorCode, _b, parsedBody;
436
364
  var _c;
437
365
  return __generator(this, function (_d) {
438
366
  switch (_d.label) {
@@ -473,14 +401,14 @@ var deserializeAws_restJson1CancelJobCommandError = function (output, context) {
473
401
  case 13: throw _d.sent();
474
402
  case 14:
475
403
  parsedBody = parsedOutput.body;
476
- $metadata = deserializeMetadata(output);
477
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
478
- response = new __BaseException({
479
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
480
- $fault: "client",
481
- $metadata: $metadata,
404
+ throwDefaultError({
405
+ output: output,
406
+ parsedBody: parsedBody,
407
+ exceptionCtor: __BaseException,
408
+ errorCode: errorCode,
482
409
  });
483
- throw __decorateServiceException(response, parsedBody);
410
+ _d.label = 15;
411
+ case 15: return [2];
484
412
  }
485
413
  });
486
414
  }); };
@@ -492,28 +420,26 @@ export var deserializeAws_restJson1CancelQuantumTaskCommand = function (output,
492
420
  if (output.statusCode !== 200 && output.statusCode >= 300) {
493
421
  return [2, deserializeAws_restJson1CancelQuantumTaskCommandError(output, context)];
494
422
  }
495
- contents = {
423
+ contents = map({
496
424
  $metadata: deserializeMetadata(output),
497
- cancellationStatus: undefined,
498
- quantumTaskArn: undefined,
499
- };
425
+ });
500
426
  _a = __expectNonNull;
501
427
  _b = __expectObject;
502
428
  return [4, parseBody(output.body, context)];
503
429
  case 1:
504
430
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
505
- if (data.cancellationStatus !== undefined && data.cancellationStatus !== null) {
431
+ if (data.cancellationStatus != null) {
506
432
  contents.cancellationStatus = __expectString(data.cancellationStatus);
507
433
  }
508
- if (data.quantumTaskArn !== undefined && data.quantumTaskArn !== null) {
434
+ if (data.quantumTaskArn != null) {
509
435
  contents.quantumTaskArn = __expectString(data.quantumTaskArn);
510
436
  }
511
- return [2, Promise.resolve(contents)];
437
+ return [2, contents];
512
438
  }
513
439
  });
514
440
  }); };
515
441
  var deserializeAws_restJson1CancelQuantumTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
516
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
442
+ var parsedOutput, _a, errorCode, _b, parsedBody;
517
443
  var _c;
518
444
  return __generator(this, function (_d) {
519
445
  switch (_d.label) {
@@ -554,14 +480,14 @@ var deserializeAws_restJson1CancelQuantumTaskCommandError = function (output, co
554
480
  case 13: throw _d.sent();
555
481
  case 14:
556
482
  parsedBody = parsedOutput.body;
557
- $metadata = deserializeMetadata(output);
558
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
559
- response = new __BaseException({
560
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
561
- $fault: "client",
562
- $metadata: $metadata,
483
+ throwDefaultError({
484
+ output: output,
485
+ parsedBody: parsedBody,
486
+ exceptionCtor: __BaseException,
487
+ errorCode: errorCode,
563
488
  });
564
- throw __decorateServiceException(response, parsedBody);
489
+ _d.label = 15;
490
+ case 15: return [2];
565
491
  }
566
492
  });
567
493
  }); };
@@ -573,24 +499,23 @@ export var deserializeAws_restJson1CreateJobCommand = function (output, context)
573
499
  if (output.statusCode !== 201 && output.statusCode >= 300) {
574
500
  return [2, deserializeAws_restJson1CreateJobCommandError(output, context)];
575
501
  }
576
- contents = {
502
+ contents = map({
577
503
  $metadata: deserializeMetadata(output),
578
- jobArn: undefined,
579
- };
504
+ });
580
505
  _a = __expectNonNull;
581
506
  _b = __expectObject;
582
507
  return [4, parseBody(output.body, context)];
583
508
  case 1:
584
509
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
585
- if (data.jobArn !== undefined && data.jobArn !== null) {
510
+ if (data.jobArn != null) {
586
511
  contents.jobArn = __expectString(data.jobArn);
587
512
  }
588
- return [2, Promise.resolve(contents)];
513
+ return [2, contents];
589
514
  }
590
515
  });
591
516
  }); };
592
517
  var deserializeAws_restJson1CreateJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
593
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
518
+ var parsedOutput, _a, errorCode, _b, parsedBody;
594
519
  var _c;
595
520
  return __generator(this, function (_d) {
596
521
  switch (_d.label) {
@@ -635,14 +560,14 @@ var deserializeAws_restJson1CreateJobCommandError = function (output, context) {
635
560
  case 15: throw _d.sent();
636
561
  case 16:
637
562
  parsedBody = parsedOutput.body;
638
- $metadata = deserializeMetadata(output);
639
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
640
- response = new __BaseException({
641
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
642
- $fault: "client",
643
- $metadata: $metadata,
563
+ throwDefaultError({
564
+ output: output,
565
+ parsedBody: parsedBody,
566
+ exceptionCtor: __BaseException,
567
+ errorCode: errorCode,
644
568
  });
645
- throw __decorateServiceException(response, parsedBody);
569
+ _d.label = 17;
570
+ case 17: return [2];
646
571
  }
647
572
  });
648
573
  }); };
@@ -654,24 +579,23 @@ export var deserializeAws_restJson1CreateQuantumTaskCommand = function (output,
654
579
  if (output.statusCode !== 201 && output.statusCode >= 300) {
655
580
  return [2, deserializeAws_restJson1CreateQuantumTaskCommandError(output, context)];
656
581
  }
657
- contents = {
582
+ contents = map({
658
583
  $metadata: deserializeMetadata(output),
659
- quantumTaskArn: undefined,
660
- };
584
+ });
661
585
  _a = __expectNonNull;
662
586
  _b = __expectObject;
663
587
  return [4, parseBody(output.body, context)];
664
588
  case 1:
665
589
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
666
- if (data.quantumTaskArn !== undefined && data.quantumTaskArn !== null) {
590
+ if (data.quantumTaskArn != null) {
667
591
  contents.quantumTaskArn = __expectString(data.quantumTaskArn);
668
592
  }
669
- return [2, Promise.resolve(contents)];
593
+ return [2, contents];
670
594
  }
671
595
  });
672
596
  }); };
673
597
  var deserializeAws_restJson1CreateQuantumTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
674
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
598
+ var parsedOutput, _a, errorCode, _b, parsedBody;
675
599
  var _c;
676
600
  return __generator(this, function (_d) {
677
601
  switch (_d.label) {
@@ -716,14 +640,14 @@ var deserializeAws_restJson1CreateQuantumTaskCommandError = function (output, co
716
640
  case 15: throw _d.sent();
717
641
  case 16:
718
642
  parsedBody = parsedOutput.body;
719
- $metadata = deserializeMetadata(output);
720
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
721
- response = new __BaseException({
722
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
723
- $fault: "client",
724
- $metadata: $metadata,
643
+ throwDefaultError({
644
+ output: output,
645
+ parsedBody: parsedBody,
646
+ exceptionCtor: __BaseException,
647
+ errorCode: errorCode,
725
648
  });
726
- throw __decorateServiceException(response, parsedBody);
649
+ _d.label = 17;
650
+ case 17: return [2];
727
651
  }
728
652
  });
729
653
  }); };
@@ -735,44 +659,38 @@ export var deserializeAws_restJson1GetDeviceCommand = function (output, context)
735
659
  if (output.statusCode !== 200 && output.statusCode >= 300) {
736
660
  return [2, deserializeAws_restJson1GetDeviceCommandError(output, context)];
737
661
  }
738
- contents = {
662
+ contents = map({
739
663
  $metadata: deserializeMetadata(output),
740
- deviceArn: undefined,
741
- deviceCapabilities: undefined,
742
- deviceName: undefined,
743
- deviceStatus: undefined,
744
- deviceType: undefined,
745
- providerName: undefined,
746
- };
664
+ });
747
665
  _a = __expectNonNull;
748
666
  _b = __expectObject;
749
667
  return [4, parseBody(output.body, context)];
750
668
  case 1:
751
669
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
752
- if (data.deviceArn !== undefined && data.deviceArn !== null) {
670
+ if (data.deviceArn != null) {
753
671
  contents.deviceArn = __expectString(data.deviceArn);
754
672
  }
755
- if (data.deviceCapabilities !== undefined && data.deviceCapabilities !== null) {
673
+ if (data.deviceCapabilities != null) {
756
674
  contents.deviceCapabilities = new __LazyJsonString(data.deviceCapabilities);
757
675
  }
758
- if (data.deviceName !== undefined && data.deviceName !== null) {
676
+ if (data.deviceName != null) {
759
677
  contents.deviceName = __expectString(data.deviceName);
760
678
  }
761
- if (data.deviceStatus !== undefined && data.deviceStatus !== null) {
679
+ if (data.deviceStatus != null) {
762
680
  contents.deviceStatus = __expectString(data.deviceStatus);
763
681
  }
764
- if (data.deviceType !== undefined && data.deviceType !== null) {
682
+ if (data.deviceType != null) {
765
683
  contents.deviceType = __expectString(data.deviceType);
766
684
  }
767
- if (data.providerName !== undefined && data.providerName !== null) {
685
+ if (data.providerName != null) {
768
686
  contents.providerName = __expectString(data.providerName);
769
687
  }
770
- return [2, Promise.resolve(contents)];
688
+ return [2, contents];
771
689
  }
772
690
  });
773
691
  }); };
774
692
  var deserializeAws_restJson1GetDeviceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
775
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
693
+ var parsedOutput, _a, errorCode, _b, parsedBody;
776
694
  var _c;
777
695
  return __generator(this, function (_d) {
778
696
  switch (_d.label) {
@@ -809,14 +727,14 @@ var deserializeAws_restJson1GetDeviceCommandError = function (output, context) {
809
727
  case 11: throw _d.sent();
810
728
  case 12:
811
729
  parsedBody = parsedOutput.body;
812
- $metadata = deserializeMetadata(output);
813
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
814
- response = new __BaseException({
815
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
816
- $fault: "client",
817
- $metadata: $metadata,
730
+ throwDefaultError({
731
+ output: output,
732
+ parsedBody: parsedBody,
733
+ exceptionCtor: __BaseException,
734
+ errorCode: errorCode,
818
735
  });
819
- throw __decorateServiceException(response, parsedBody);
736
+ _d.label = 13;
737
+ case 13: return [2];
820
738
  }
821
739
  });
822
740
  }); };
@@ -828,96 +746,77 @@ export var deserializeAws_restJson1GetJobCommand = function (output, context) {
828
746
  if (output.statusCode !== 200 && output.statusCode >= 300) {
829
747
  return [2, deserializeAws_restJson1GetJobCommandError(output, context)];
830
748
  }
831
- contents = {
749
+ contents = map({
832
750
  $metadata: deserializeMetadata(output),
833
- algorithmSpecification: undefined,
834
- billableDuration: undefined,
835
- checkpointConfig: undefined,
836
- createdAt: undefined,
837
- deviceConfig: undefined,
838
- endedAt: undefined,
839
- events: undefined,
840
- failureReason: undefined,
841
- hyperParameters: undefined,
842
- inputDataConfig: undefined,
843
- instanceConfig: undefined,
844
- jobArn: undefined,
845
- jobName: undefined,
846
- outputDataConfig: undefined,
847
- roleArn: undefined,
848
- startedAt: undefined,
849
- status: undefined,
850
- stoppingCondition: undefined,
851
- tags: undefined,
852
- };
751
+ });
853
752
  _a = __expectNonNull;
854
753
  _b = __expectObject;
855
754
  return [4, parseBody(output.body, context)];
856
755
  case 1:
857
756
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
858
- if (data.algorithmSpecification !== undefined && data.algorithmSpecification !== null) {
757
+ if (data.algorithmSpecification != null) {
859
758
  contents.algorithmSpecification = deserializeAws_restJson1AlgorithmSpecification(data.algorithmSpecification, context);
860
759
  }
861
- if (data.billableDuration !== undefined && data.billableDuration !== null) {
760
+ if (data.billableDuration != null) {
862
761
  contents.billableDuration = __expectInt32(data.billableDuration);
863
762
  }
864
- if (data.checkpointConfig !== undefined && data.checkpointConfig !== null) {
763
+ if (data.checkpointConfig != null) {
865
764
  contents.checkpointConfig = deserializeAws_restJson1JobCheckpointConfig(data.checkpointConfig, context);
866
765
  }
867
- if (data.createdAt !== undefined && data.createdAt !== null) {
766
+ if (data.createdAt != null) {
868
767
  contents.createdAt = __expectNonNull(__parseRfc3339DateTime(data.createdAt));
869
768
  }
870
- if (data.deviceConfig !== undefined && data.deviceConfig !== null) {
769
+ if (data.deviceConfig != null) {
871
770
  contents.deviceConfig = deserializeAws_restJson1DeviceConfig(data.deviceConfig, context);
872
771
  }
873
- if (data.endedAt !== undefined && data.endedAt !== null) {
772
+ if (data.endedAt != null) {
874
773
  contents.endedAt = __expectNonNull(__parseRfc3339DateTime(data.endedAt));
875
774
  }
876
- if (data.events !== undefined && data.events !== null) {
775
+ if (data.events != null) {
877
776
  contents.events = deserializeAws_restJson1JobEvents(data.events, context);
878
777
  }
879
- if (data.failureReason !== undefined && data.failureReason !== null) {
778
+ if (data.failureReason != null) {
880
779
  contents.failureReason = __expectString(data.failureReason);
881
780
  }
882
- if (data.hyperParameters !== undefined && data.hyperParameters !== null) {
781
+ if (data.hyperParameters != null) {
883
782
  contents.hyperParameters = deserializeAws_restJson1HyperParameters(data.hyperParameters, context);
884
783
  }
885
- if (data.inputDataConfig !== undefined && data.inputDataConfig !== null) {
784
+ if (data.inputDataConfig != null) {
886
785
  contents.inputDataConfig = deserializeAws_restJson1InputConfigList(data.inputDataConfig, context);
887
786
  }
888
- if (data.instanceConfig !== undefined && data.instanceConfig !== null) {
787
+ if (data.instanceConfig != null) {
889
788
  contents.instanceConfig = deserializeAws_restJson1InstanceConfig(data.instanceConfig, context);
890
789
  }
891
- if (data.jobArn !== undefined && data.jobArn !== null) {
790
+ if (data.jobArn != null) {
892
791
  contents.jobArn = __expectString(data.jobArn);
893
792
  }
894
- if (data.jobName !== undefined && data.jobName !== null) {
793
+ if (data.jobName != null) {
895
794
  contents.jobName = __expectString(data.jobName);
896
795
  }
897
- if (data.outputDataConfig !== undefined && data.outputDataConfig !== null) {
796
+ if (data.outputDataConfig != null) {
898
797
  contents.outputDataConfig = deserializeAws_restJson1JobOutputDataConfig(data.outputDataConfig, context);
899
798
  }
900
- if (data.roleArn !== undefined && data.roleArn !== null) {
799
+ if (data.roleArn != null) {
901
800
  contents.roleArn = __expectString(data.roleArn);
902
801
  }
903
- if (data.startedAt !== undefined && data.startedAt !== null) {
802
+ if (data.startedAt != null) {
904
803
  contents.startedAt = __expectNonNull(__parseRfc3339DateTime(data.startedAt));
905
804
  }
906
- if (data.status !== undefined && data.status !== null) {
805
+ if (data.status != null) {
907
806
  contents.status = __expectString(data.status);
908
807
  }
909
- if (data.stoppingCondition !== undefined && data.stoppingCondition !== null) {
808
+ if (data.stoppingCondition != null) {
910
809
  contents.stoppingCondition = deserializeAws_restJson1JobStoppingCondition(data.stoppingCondition, context);
911
810
  }
912
- if (data.tags !== undefined && data.tags !== null) {
811
+ if (data.tags != null) {
913
812
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
914
813
  }
915
- return [2, Promise.resolve(contents)];
814
+ return [2, contents];
916
815
  }
917
816
  });
918
817
  }); };
919
818
  var deserializeAws_restJson1GetJobCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
920
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
819
+ var parsedOutput, _a, errorCode, _b, parsedBody;
921
820
  var _c;
922
821
  return __generator(this, function (_d) {
923
822
  switch (_d.label) {
@@ -954,14 +853,14 @@ var deserializeAws_restJson1GetJobCommandError = function (output, context) { re
954
853
  case 11: throw _d.sent();
955
854
  case 12:
956
855
  parsedBody = parsedOutput.body;
957
- $metadata = deserializeMetadata(output);
958
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
959
- response = new __BaseException({
960
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
961
- $fault: "client",
962
- $metadata: $metadata,
856
+ throwDefaultError({
857
+ output: output,
858
+ parsedBody: parsedBody,
859
+ exceptionCtor: __BaseException,
860
+ errorCode: errorCode,
963
861
  });
964
- throw __decorateServiceException(response, parsedBody);
862
+ _d.label = 13;
863
+ case 13: return [2];
965
864
  }
966
865
  });
967
866
  }); };
@@ -973,68 +872,56 @@ export var deserializeAws_restJson1GetQuantumTaskCommand = function (output, con
973
872
  if (output.statusCode !== 200 && output.statusCode >= 300) {
974
873
  return [2, deserializeAws_restJson1GetQuantumTaskCommandError(output, context)];
975
874
  }
976
- contents = {
875
+ contents = map({
977
876
  $metadata: deserializeMetadata(output),
978
- createdAt: undefined,
979
- deviceArn: undefined,
980
- deviceParameters: undefined,
981
- endedAt: undefined,
982
- failureReason: undefined,
983
- jobArn: undefined,
984
- outputS3Bucket: undefined,
985
- outputS3Directory: undefined,
986
- quantumTaskArn: undefined,
987
- shots: undefined,
988
- status: undefined,
989
- tags: undefined,
990
- };
877
+ });
991
878
  _a = __expectNonNull;
992
879
  _b = __expectObject;
993
880
  return [4, parseBody(output.body, context)];
994
881
  case 1:
995
882
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
996
- if (data.createdAt !== undefined && data.createdAt !== null) {
883
+ if (data.createdAt != null) {
997
884
  contents.createdAt = __expectNonNull(__parseRfc3339DateTime(data.createdAt));
998
885
  }
999
- if (data.deviceArn !== undefined && data.deviceArn !== null) {
886
+ if (data.deviceArn != null) {
1000
887
  contents.deviceArn = __expectString(data.deviceArn);
1001
888
  }
1002
- if (data.deviceParameters !== undefined && data.deviceParameters !== null) {
889
+ if (data.deviceParameters != null) {
1003
890
  contents.deviceParameters = new __LazyJsonString(data.deviceParameters);
1004
891
  }
1005
- if (data.endedAt !== undefined && data.endedAt !== null) {
892
+ if (data.endedAt != null) {
1006
893
  contents.endedAt = __expectNonNull(__parseRfc3339DateTime(data.endedAt));
1007
894
  }
1008
- if (data.failureReason !== undefined && data.failureReason !== null) {
895
+ if (data.failureReason != null) {
1009
896
  contents.failureReason = __expectString(data.failureReason);
1010
897
  }
1011
- if (data.jobArn !== undefined && data.jobArn !== null) {
898
+ if (data.jobArn != null) {
1012
899
  contents.jobArn = __expectString(data.jobArn);
1013
900
  }
1014
- if (data.outputS3Bucket !== undefined && data.outputS3Bucket !== null) {
901
+ if (data.outputS3Bucket != null) {
1015
902
  contents.outputS3Bucket = __expectString(data.outputS3Bucket);
1016
903
  }
1017
- if (data.outputS3Directory !== undefined && data.outputS3Directory !== null) {
904
+ if (data.outputS3Directory != null) {
1018
905
  contents.outputS3Directory = __expectString(data.outputS3Directory);
1019
906
  }
1020
- if (data.quantumTaskArn !== undefined && data.quantumTaskArn !== null) {
907
+ if (data.quantumTaskArn != null) {
1021
908
  contents.quantumTaskArn = __expectString(data.quantumTaskArn);
1022
909
  }
1023
- if (data.shots !== undefined && data.shots !== null) {
910
+ if (data.shots != null) {
1024
911
  contents.shots = __expectLong(data.shots);
1025
912
  }
1026
- if (data.status !== undefined && data.status !== null) {
913
+ if (data.status != null) {
1027
914
  contents.status = __expectString(data.status);
1028
915
  }
1029
- if (data.tags !== undefined && data.tags !== null) {
916
+ if (data.tags != null) {
1030
917
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1031
918
  }
1032
- return [2, Promise.resolve(contents)];
919
+ return [2, contents];
1033
920
  }
1034
921
  });
1035
922
  }); };
1036
923
  var deserializeAws_restJson1GetQuantumTaskCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1037
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
924
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1038
925
  var _c;
1039
926
  return __generator(this, function (_d) {
1040
927
  switch (_d.label) {
@@ -1071,14 +958,14 @@ var deserializeAws_restJson1GetQuantumTaskCommandError = function (output, conte
1071
958
  case 11: throw _d.sent();
1072
959
  case 12:
1073
960
  parsedBody = parsedOutput.body;
1074
- $metadata = deserializeMetadata(output);
1075
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1076
- response = new __BaseException({
1077
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1078
- $fault: "client",
1079
- $metadata: $metadata,
961
+ throwDefaultError({
962
+ output: output,
963
+ parsedBody: parsedBody,
964
+ exceptionCtor: __BaseException,
965
+ errorCode: errorCode,
1080
966
  });
1081
- throw __decorateServiceException(response, parsedBody);
967
+ _d.label = 13;
968
+ case 13: return [2];
1082
969
  }
1083
970
  });
1084
971
  }); };
@@ -1090,24 +977,23 @@ export var deserializeAws_restJson1ListTagsForResourceCommand = function (output
1090
977
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1091
978
  return [2, deserializeAws_restJson1ListTagsForResourceCommandError(output, context)];
1092
979
  }
1093
- contents = {
980
+ contents = map({
1094
981
  $metadata: deserializeMetadata(output),
1095
- tags: undefined,
1096
- };
982
+ });
1097
983
  _a = __expectNonNull;
1098
984
  _b = __expectObject;
1099
985
  return [4, parseBody(output.body, context)];
1100
986
  case 1:
1101
987
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1102
- if (data.tags !== undefined && data.tags !== null) {
988
+ if (data.tags != null) {
1103
989
  contents.tags = deserializeAws_restJson1TagsMap(data.tags, context);
1104
990
  }
1105
- return [2, Promise.resolve(contents)];
991
+ return [2, contents];
1106
992
  }
1107
993
  });
1108
994
  }); };
1109
995
  var deserializeAws_restJson1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1110
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
996
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1111
997
  var _c;
1112
998
  return __generator(this, function (_d) {
1113
999
  switch (_d.label) {
@@ -1136,14 +1022,14 @@ var deserializeAws_restJson1ListTagsForResourceCommandError = function (output,
1136
1022
  case 7: throw _d.sent();
1137
1023
  case 8:
1138
1024
  parsedBody = parsedOutput.body;
1139
- $metadata = deserializeMetadata(output);
1140
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1141
- response = new __BaseException({
1142
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1143
- $fault: "client",
1144
- $metadata: $metadata,
1025
+ throwDefaultError({
1026
+ output: output,
1027
+ parsedBody: parsedBody,
1028
+ exceptionCtor: __BaseException,
1029
+ errorCode: errorCode,
1145
1030
  });
1146
- throw __decorateServiceException(response, parsedBody);
1031
+ _d.label = 9;
1032
+ case 9: return [2];
1147
1033
  }
1148
1034
  });
1149
1035
  }); };
@@ -1155,28 +1041,26 @@ export var deserializeAws_restJson1SearchDevicesCommand = function (output, cont
1155
1041
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1156
1042
  return [2, deserializeAws_restJson1SearchDevicesCommandError(output, context)];
1157
1043
  }
1158
- contents = {
1044
+ contents = map({
1159
1045
  $metadata: deserializeMetadata(output),
1160
- devices: undefined,
1161
- nextToken: undefined,
1162
- };
1046
+ });
1163
1047
  _a = __expectNonNull;
1164
1048
  _b = __expectObject;
1165
1049
  return [4, parseBody(output.body, context)];
1166
1050
  case 1:
1167
1051
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1168
- if (data.devices !== undefined && data.devices !== null) {
1052
+ if (data.devices != null) {
1169
1053
  contents.devices = deserializeAws_restJson1DeviceSummaryList(data.devices, context);
1170
1054
  }
1171
- if (data.nextToken !== undefined && data.nextToken !== null) {
1055
+ if (data.nextToken != null) {
1172
1056
  contents.nextToken = __expectString(data.nextToken);
1173
1057
  }
1174
- return [2, Promise.resolve(contents)];
1058
+ return [2, contents];
1175
1059
  }
1176
1060
  });
1177
1061
  }); };
1178
1062
  var deserializeAws_restJson1SearchDevicesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1179
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1063
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1180
1064
  var _c;
1181
1065
  return __generator(this, function (_d) {
1182
1066
  switch (_d.label) {
@@ -1209,14 +1093,14 @@ var deserializeAws_restJson1SearchDevicesCommandError = function (output, contex
1209
1093
  case 9: throw _d.sent();
1210
1094
  case 10:
1211
1095
  parsedBody = parsedOutput.body;
1212
- $metadata = deserializeMetadata(output);
1213
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1214
- response = new __BaseException({
1215
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1216
- $fault: "client",
1217
- $metadata: $metadata,
1096
+ throwDefaultError({
1097
+ output: output,
1098
+ parsedBody: parsedBody,
1099
+ exceptionCtor: __BaseException,
1100
+ errorCode: errorCode,
1218
1101
  });
1219
- throw __decorateServiceException(response, parsedBody);
1102
+ _d.label = 11;
1103
+ case 11: return [2];
1220
1104
  }
1221
1105
  });
1222
1106
  }); };
@@ -1228,28 +1112,26 @@ export var deserializeAws_restJson1SearchJobsCommand = function (output, context
1228
1112
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1229
1113
  return [2, deserializeAws_restJson1SearchJobsCommandError(output, context)];
1230
1114
  }
1231
- contents = {
1115
+ contents = map({
1232
1116
  $metadata: deserializeMetadata(output),
1233
- jobs: undefined,
1234
- nextToken: undefined,
1235
- };
1117
+ });
1236
1118
  _a = __expectNonNull;
1237
1119
  _b = __expectObject;
1238
1120
  return [4, parseBody(output.body, context)];
1239
1121
  case 1:
1240
1122
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1241
- if (data.jobs !== undefined && data.jobs !== null) {
1123
+ if (data.jobs != null) {
1242
1124
  contents.jobs = deserializeAws_restJson1JobSummaryList(data.jobs, context);
1243
1125
  }
1244
- if (data.nextToken !== undefined && data.nextToken !== null) {
1126
+ if (data.nextToken != null) {
1245
1127
  contents.nextToken = __expectString(data.nextToken);
1246
1128
  }
1247
- return [2, Promise.resolve(contents)];
1129
+ return [2, contents];
1248
1130
  }
1249
1131
  });
1250
1132
  }); };
1251
1133
  var deserializeAws_restJson1SearchJobsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1252
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1134
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1253
1135
  var _c;
1254
1136
  return __generator(this, function (_d) {
1255
1137
  switch (_d.label) {
@@ -1282,14 +1164,14 @@ var deserializeAws_restJson1SearchJobsCommandError = function (output, context)
1282
1164
  case 9: throw _d.sent();
1283
1165
  case 10:
1284
1166
  parsedBody = parsedOutput.body;
1285
- $metadata = deserializeMetadata(output);
1286
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1287
- response = new __BaseException({
1288
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1289
- $fault: "client",
1290
- $metadata: $metadata,
1167
+ throwDefaultError({
1168
+ output: output,
1169
+ parsedBody: parsedBody,
1170
+ exceptionCtor: __BaseException,
1171
+ errorCode: errorCode,
1291
1172
  });
1292
- throw __decorateServiceException(response, parsedBody);
1173
+ _d.label = 11;
1174
+ case 11: return [2];
1293
1175
  }
1294
1176
  });
1295
1177
  }); };
@@ -1301,28 +1183,26 @@ export var deserializeAws_restJson1SearchQuantumTasksCommand = function (output,
1301
1183
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1302
1184
  return [2, deserializeAws_restJson1SearchQuantumTasksCommandError(output, context)];
1303
1185
  }
1304
- contents = {
1186
+ contents = map({
1305
1187
  $metadata: deserializeMetadata(output),
1306
- nextToken: undefined,
1307
- quantumTasks: undefined,
1308
- };
1188
+ });
1309
1189
  _a = __expectNonNull;
1310
1190
  _b = __expectObject;
1311
1191
  return [4, parseBody(output.body, context)];
1312
1192
  case 1:
1313
1193
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
1314
- if (data.nextToken !== undefined && data.nextToken !== null) {
1194
+ if (data.nextToken != null) {
1315
1195
  contents.nextToken = __expectString(data.nextToken);
1316
1196
  }
1317
- if (data.quantumTasks !== undefined && data.quantumTasks !== null) {
1197
+ if (data.quantumTasks != null) {
1318
1198
  contents.quantumTasks = deserializeAws_restJson1QuantumTaskSummaryList(data.quantumTasks, context);
1319
1199
  }
1320
- return [2, Promise.resolve(contents)];
1200
+ return [2, contents];
1321
1201
  }
1322
1202
  });
1323
1203
  }); };
1324
1204
  var deserializeAws_restJson1SearchQuantumTasksCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1325
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1205
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1326
1206
  var _c;
1327
1207
  return __generator(this, function (_d) {
1328
1208
  switch (_d.label) {
@@ -1355,14 +1235,14 @@ var deserializeAws_restJson1SearchQuantumTasksCommandError = function (output, c
1355
1235
  case 9: throw _d.sent();
1356
1236
  case 10:
1357
1237
  parsedBody = parsedOutput.body;
1358
- $metadata = deserializeMetadata(output);
1359
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1360
- response = new __BaseException({
1361
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1362
- $fault: "client",
1363
- $metadata: $metadata,
1238
+ throwDefaultError({
1239
+ output: output,
1240
+ parsedBody: parsedBody,
1241
+ exceptionCtor: __BaseException,
1242
+ errorCode: errorCode,
1364
1243
  });
1365
- throw __decorateServiceException(response, parsedBody);
1244
+ _d.label = 11;
1245
+ case 11: return [2];
1366
1246
  }
1367
1247
  });
1368
1248
  }); };
@@ -1374,18 +1254,18 @@ export var deserializeAws_restJson1TagResourceCommand = function (output, contex
1374
1254
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1375
1255
  return [2, deserializeAws_restJson1TagResourceCommandError(output, context)];
1376
1256
  }
1377
- contents = {
1257
+ contents = map({
1378
1258
  $metadata: deserializeMetadata(output),
1379
- };
1259
+ });
1380
1260
  return [4, collectBody(output.body, context)];
1381
1261
  case 1:
1382
1262
  _a.sent();
1383
- return [2, Promise.resolve(contents)];
1263
+ return [2, contents];
1384
1264
  }
1385
1265
  });
1386
1266
  }); };
1387
1267
  var deserializeAws_restJson1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1388
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1268
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1389
1269
  var _c;
1390
1270
  return __generator(this, function (_d) {
1391
1271
  switch (_d.label) {
@@ -1414,14 +1294,14 @@ var deserializeAws_restJson1TagResourceCommandError = function (output, context)
1414
1294
  case 7: throw _d.sent();
1415
1295
  case 8:
1416
1296
  parsedBody = parsedOutput.body;
1417
- $metadata = deserializeMetadata(output);
1418
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1419
- response = new __BaseException({
1420
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1421
- $fault: "client",
1422
- $metadata: $metadata,
1297
+ throwDefaultError({
1298
+ output: output,
1299
+ parsedBody: parsedBody,
1300
+ exceptionCtor: __BaseException,
1301
+ errorCode: errorCode,
1423
1302
  });
1424
- throw __decorateServiceException(response, parsedBody);
1303
+ _d.label = 9;
1304
+ case 9: return [2];
1425
1305
  }
1426
1306
  });
1427
1307
  }); };
@@ -1433,18 +1313,18 @@ export var deserializeAws_restJson1UntagResourceCommand = function (output, cont
1433
1313
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1434
1314
  return [2, deserializeAws_restJson1UntagResourceCommandError(output, context)];
1435
1315
  }
1436
- contents = {
1316
+ contents = map({
1437
1317
  $metadata: deserializeMetadata(output),
1438
- };
1318
+ });
1439
1319
  return [4, collectBody(output.body, context)];
1440
1320
  case 1:
1441
1321
  _a.sent();
1442
- return [2, Promise.resolve(contents)];
1322
+ return [2, contents];
1443
1323
  }
1444
1324
  });
1445
1325
  }); };
1446
1326
  var deserializeAws_restJson1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
1447
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
1327
+ var parsedOutput, _a, errorCode, _b, parsedBody;
1448
1328
  var _c;
1449
1329
  return __generator(this, function (_d) {
1450
1330
  switch (_d.label) {
@@ -1473,23 +1353,24 @@ var deserializeAws_restJson1UntagResourceCommandError = function (output, contex
1473
1353
  case 7: throw _d.sent();
1474
1354
  case 8:
1475
1355
  parsedBody = parsedOutput.body;
1476
- $metadata = deserializeMetadata(output);
1477
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1478
- response = new __BaseException({
1479
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1480
- $fault: "client",
1481
- $metadata: $metadata,
1356
+ throwDefaultError({
1357
+ output: output,
1358
+ parsedBody: parsedBody,
1359
+ exceptionCtor: __BaseException,
1360
+ errorCode: errorCode,
1482
1361
  });
1483
- throw __decorateServiceException(response, parsedBody);
1362
+ _d.label = 9;
1363
+ case 9: return [2];
1484
1364
  }
1485
1365
  });
1486
1366
  }); };
1367
+ var map = __map;
1487
1368
  var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1488
1369
  var contents, data, exception;
1489
1370
  return __generator(this, function (_a) {
1490
- contents = {};
1371
+ contents = map({});
1491
1372
  data = parsedOutput.body;
1492
- if (data.message !== undefined && data.message !== null) {
1373
+ if (data.message != null) {
1493
1374
  contents.message = __expectString(data.message);
1494
1375
  }
1495
1376
  exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1499,9 +1380,9 @@ var deserializeAws_restJson1AccessDeniedExceptionResponse = function (parsedOutp
1499
1380
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1500
1381
  var contents, data, exception;
1501
1382
  return __generator(this, function (_a) {
1502
- contents = {};
1383
+ contents = map({});
1503
1384
  data = parsedOutput.body;
1504
- if (data.message !== undefined && data.message !== null) {
1385
+ if (data.message != null) {
1505
1386
  contents.message = __expectString(data.message);
1506
1387
  }
1507
1388
  exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1511,9 +1392,9 @@ var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput,
1511
1392
  var deserializeAws_restJson1DeviceOfflineExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1512
1393
  var contents, data, exception;
1513
1394
  return __generator(this, function (_a) {
1514
- contents = {};
1395
+ contents = map({});
1515
1396
  data = parsedOutput.body;
1516
- if (data.message !== undefined && data.message !== null) {
1397
+ if (data.message != null) {
1517
1398
  contents.message = __expectString(data.message);
1518
1399
  }
1519
1400
  exception = new DeviceOfflineException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1523,9 +1404,9 @@ var deserializeAws_restJson1DeviceOfflineExceptionResponse = function (parsedOut
1523
1404
  var deserializeAws_restJson1DeviceRetiredExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1524
1405
  var contents, data, exception;
1525
1406
  return __generator(this, function (_a) {
1526
- contents = {};
1407
+ contents = map({});
1527
1408
  data = parsedOutput.body;
1528
- if (data.message !== undefined && data.message !== null) {
1409
+ if (data.message != null) {
1529
1410
  contents.message = __expectString(data.message);
1530
1411
  }
1531
1412
  exception = new DeviceRetiredException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1535,9 +1416,9 @@ var deserializeAws_restJson1DeviceRetiredExceptionResponse = function (parsedOut
1535
1416
  var deserializeAws_restJson1InternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1536
1417
  var contents, data, exception;
1537
1418
  return __generator(this, function (_a) {
1538
- contents = {};
1419
+ contents = map({});
1539
1420
  data = parsedOutput.body;
1540
- if (data.message !== undefined && data.message !== null) {
1421
+ if (data.message != null) {
1541
1422
  contents.message = __expectString(data.message);
1542
1423
  }
1543
1424
  exception = new InternalServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1547,9 +1428,9 @@ var deserializeAws_restJson1InternalServiceExceptionResponse = function (parsedO
1547
1428
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1548
1429
  var contents, data, exception;
1549
1430
  return __generator(this, function (_a) {
1550
- contents = {};
1431
+ contents = map({});
1551
1432
  data = parsedOutput.body;
1552
- if (data.message !== undefined && data.message !== null) {
1433
+ if (data.message != null) {
1553
1434
  contents.message = __expectString(data.message);
1554
1435
  }
1555
1436
  exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1559,9 +1440,9 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
1559
1440
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1560
1441
  var contents, data, exception;
1561
1442
  return __generator(this, function (_a) {
1562
- contents = {};
1443
+ contents = map({});
1563
1444
  data = parsedOutput.body;
1564
- if (data.message !== undefined && data.message !== null) {
1445
+ if (data.message != null) {
1565
1446
  contents.message = __expectString(data.message);
1566
1447
  }
1567
1448
  exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1571,9 +1452,9 @@ var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (pa
1571
1452
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1572
1453
  var contents, data, exception;
1573
1454
  return __generator(this, function (_a) {
1574
- contents = {};
1455
+ contents = map({});
1575
1456
  data = parsedOutput.body;
1576
- if (data.message !== undefined && data.message !== null) {
1457
+ if (data.message != null) {
1577
1458
  contents.message = __expectString(data.message);
1578
1459
  }
1579
1460
  exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1583,9 +1464,9 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
1583
1464
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
1584
1465
  var contents, data, exception;
1585
1466
  return __generator(this, function (_a) {
1586
- contents = {};
1467
+ contents = map({});
1587
1468
  data = parsedOutput.body;
1588
- if (data.message !== undefined && data.message !== null) {
1469
+ if (data.message != null) {
1589
1470
  contents.message = __expectString(data.message);
1590
1471
  }
1591
1472
  exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -1624,9 +1505,6 @@ var serializeAws_restJson1InputConfigList = function (input, context) {
1624
1505
  return input
1625
1506
  .filter(function (e) { return e != null; })
1626
1507
  .map(function (entry) {
1627
- if (entry === null) {
1628
- return null;
1629
- }
1630
1508
  return serializeAws_restJson1InputFileConfig(entry, context);
1631
1509
  });
1632
1510
  };
@@ -1658,9 +1536,6 @@ var serializeAws_restJson1SearchDevicesFilterList = function (input, context) {
1658
1536
  return input
1659
1537
  .filter(function (e) { return e != null; })
1660
1538
  .map(function (entry) {
1661
- if (entry === null) {
1662
- return null;
1663
- }
1664
1539
  return serializeAws_restJson1SearchDevicesFilter(entry, context);
1665
1540
  });
1666
1541
  };
@@ -1671,9 +1546,6 @@ var serializeAws_restJson1SearchJobsFilterList = function (input, context) {
1671
1546
  return input
1672
1547
  .filter(function (e) { return e != null; })
1673
1548
  .map(function (entry) {
1674
- if (entry === null) {
1675
- return null;
1676
- }
1677
1549
  return serializeAws_restJson1SearchJobsFilter(entry, context);
1678
1550
  });
1679
1551
  };
@@ -1684,9 +1556,6 @@ var serializeAws_restJson1SearchQuantumTasksFilterList = function (input, contex
1684
1556
  return input
1685
1557
  .filter(function (e) { return e != null; })
1686
1558
  .map(function (entry) {
1687
- if (entry === null) {
1688
- return null;
1689
- }
1690
1559
  return serializeAws_restJson1SearchQuantumTasksFilter(entry, context);
1691
1560
  });
1692
1561
  };
@@ -1694,9 +1563,6 @@ var serializeAws_restJson1String256List = function (input, context) {
1694
1563
  return input
1695
1564
  .filter(function (e) { return e != null; })
1696
1565
  .map(function (entry) {
1697
- if (entry === null) {
1698
- return null;
1699
- }
1700
1566
  return entry;
1701
1567
  });
1702
1568
  };