@aws-sdk/client-iot-jobs-data-plane 3.52.0 → 3.54.1

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,4 +1,17 @@
1
- import { __assign } from "tslib";
1
+ import { __assign, __extends } from "tslib";
2
+ import { IoTJobsDataPlaneServiceException as __BaseException } from "./IoTJobsDataPlaneServiceException";
3
+ var CertificateValidationException = (function (_super) {
4
+ __extends(CertificateValidationException, _super);
5
+ function CertificateValidationException(opts) {
6
+ var _this = _super.call(this, __assign({ name: "CertificateValidationException", $fault: "client" }, opts)) || this;
7
+ _this.name = "CertificateValidationException";
8
+ _this.$fault = "client";
9
+ Object.setPrototypeOf(_this, CertificateValidationException.prototype);
10
+ return _this;
11
+ }
12
+ return CertificateValidationException;
13
+ }(__BaseException));
14
+ export { CertificateValidationException };
2
15
  export var DescribeJobExecutionRequest;
3
16
  (function (DescribeJobExecutionRequest) {
4
17
  DescribeJobExecutionRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -22,6 +35,67 @@ export var DescribeJobExecutionResponse;
22
35
  (function (DescribeJobExecutionResponse) {
23
36
  DescribeJobExecutionResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
24
37
  })(DescribeJobExecutionResponse || (DescribeJobExecutionResponse = {}));
38
+ var InvalidRequestException = (function (_super) {
39
+ __extends(InvalidRequestException, _super);
40
+ function InvalidRequestException(opts) {
41
+ var _this = _super.call(this, __assign({ name: "InvalidRequestException", $fault: "client" }, opts)) || this;
42
+ _this.name = "InvalidRequestException";
43
+ _this.$fault = "client";
44
+ Object.setPrototypeOf(_this, InvalidRequestException.prototype);
45
+ return _this;
46
+ }
47
+ return InvalidRequestException;
48
+ }(__BaseException));
49
+ export { InvalidRequestException };
50
+ var ResourceNotFoundException = (function (_super) {
51
+ __extends(ResourceNotFoundException, _super);
52
+ function ResourceNotFoundException(opts) {
53
+ var _this = _super.call(this, __assign({ name: "ResourceNotFoundException", $fault: "client" }, opts)) || this;
54
+ _this.name = "ResourceNotFoundException";
55
+ _this.$fault = "client";
56
+ Object.setPrototypeOf(_this, ResourceNotFoundException.prototype);
57
+ return _this;
58
+ }
59
+ return ResourceNotFoundException;
60
+ }(__BaseException));
61
+ export { ResourceNotFoundException };
62
+ var ServiceUnavailableException = (function (_super) {
63
+ __extends(ServiceUnavailableException, _super);
64
+ function ServiceUnavailableException(opts) {
65
+ var _this = _super.call(this, __assign({ name: "ServiceUnavailableException", $fault: "server" }, opts)) || this;
66
+ _this.name = "ServiceUnavailableException";
67
+ _this.$fault = "server";
68
+ Object.setPrototypeOf(_this, ServiceUnavailableException.prototype);
69
+ return _this;
70
+ }
71
+ return ServiceUnavailableException;
72
+ }(__BaseException));
73
+ export { ServiceUnavailableException };
74
+ var TerminalStateException = (function (_super) {
75
+ __extends(TerminalStateException, _super);
76
+ function TerminalStateException(opts) {
77
+ var _this = _super.call(this, __assign({ name: "TerminalStateException", $fault: "client" }, opts)) || this;
78
+ _this.name = "TerminalStateException";
79
+ _this.$fault = "client";
80
+ Object.setPrototypeOf(_this, TerminalStateException.prototype);
81
+ return _this;
82
+ }
83
+ return TerminalStateException;
84
+ }(__BaseException));
85
+ export { TerminalStateException };
86
+ var ThrottlingException = (function (_super) {
87
+ __extends(ThrottlingException, _super);
88
+ function ThrottlingException(opts) {
89
+ var _this = _super.call(this, __assign({ name: "ThrottlingException", $fault: "client" }, opts)) || this;
90
+ _this.name = "ThrottlingException";
91
+ _this.$fault = "client";
92
+ Object.setPrototypeOf(_this, ThrottlingException.prototype);
93
+ _this.payload = opts.payload;
94
+ return _this;
95
+ }
96
+ return ThrottlingException;
97
+ }(__BaseException));
98
+ export { ThrottlingException };
25
99
  export var GetPendingJobExecutionsRequest;
26
100
  (function (GetPendingJobExecutionsRequest) {
27
101
  GetPendingJobExecutionsRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -34,6 +108,18 @@ export var GetPendingJobExecutionsResponse;
34
108
  (function (GetPendingJobExecutionsResponse) {
35
109
  GetPendingJobExecutionsResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
36
110
  })(GetPendingJobExecutionsResponse || (GetPendingJobExecutionsResponse = {}));
111
+ var InvalidStateTransitionException = (function (_super) {
112
+ __extends(InvalidStateTransitionException, _super);
113
+ function InvalidStateTransitionException(opts) {
114
+ var _this = _super.call(this, __assign({ name: "InvalidStateTransitionException", $fault: "client" }, opts)) || this;
115
+ _this.name = "InvalidStateTransitionException";
116
+ _this.$fault = "client";
117
+ Object.setPrototypeOf(_this, InvalidStateTransitionException.prototype);
118
+ return _this;
119
+ }
120
+ return InvalidStateTransitionException;
121
+ }(__BaseException));
122
+ export { InvalidStateTransitionException };
37
123
  export var StartNextPendingJobExecutionRequest;
38
124
  (function (StartNextPendingJobExecutionRequest) {
39
125
  StartNextPendingJobExecutionRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -1,6 +1,8 @@
1
1
  import { __assign, __awaiter, __generator, __read } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, } from "@aws-sdk/smithy-client";
4
+ import { IoTJobsDataPlaneServiceException as __BaseException } from "../models/IoTJobsDataPlaneServiceException";
5
+ import { CertificateValidationException, InvalidRequestException, InvalidStateTransitionException, ResourceNotFoundException, ServiceUnavailableException, TerminalStateException, ThrottlingException, } from "../models/models_0";
4
6
  export var serializeAws_restJson1DescribeJobExecutionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
5
7
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, labelValue, query, body;
6
8
  return __generator(this, function (_c) {
@@ -190,16 +192,16 @@ export var deserializeAws_restJson1DescribeJobExecutionCommand = function (outpu
190
192
  });
191
193
  }); };
192
194
  var deserializeAws_restJson1DescribeJobExecutionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
193
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
194
- var _j;
195
- return __generator(this, function (_k) {
196
- switch (_k.label) {
195
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
196
+ var _c;
197
+ return __generator(this, function (_d) {
198
+ switch (_d.label) {
197
199
  case 0:
198
200
  _a = [__assign({}, output)];
199
- _j = {};
201
+ _c = {};
200
202
  return [4, parseBody(output.body, context)];
201
203
  case 1:
202
- parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
204
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
203
205
  errorCode = "UnknownError";
204
206
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
205
207
  _b = errorCode;
@@ -218,52 +220,26 @@ var deserializeAws_restJson1DescribeJobExecutionCommandError = function (output,
218
220
  case "com.amazonaws.iotjobsdataplane#ThrottlingException": return [3, 12];
219
221
  }
220
222
  return [3, 14];
221
- case 2:
222
- _c = [{}];
223
- return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
224
- case 3:
225
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
226
- return [3, 15];
227
- case 4:
228
- _d = [{}];
229
- return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
230
- case 5:
231
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
232
- return [3, 15];
233
- case 6:
234
- _e = [{}];
235
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
236
- case 7:
237
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
238
- return [3, 15];
239
- case 8:
240
- _f = [{}];
241
- return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
242
- case 9:
243
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
244
- return [3, 15];
245
- case 10:
246
- _g = [{}];
247
- return [4, deserializeAws_restJson1TerminalStateExceptionResponse(parsedOutput, context)];
248
- case 11:
249
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
250
- return [3, 15];
251
- case 12:
252
- _h = [{}];
253
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
254
- case 13:
255
- response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
256
- return [3, 15];
223
+ case 2: return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
224
+ case 3: throw _d.sent();
225
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
226
+ case 5: throw _d.sent();
227
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
228
+ case 7: throw _d.sent();
229
+ case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
230
+ case 9: throw _d.sent();
231
+ case 10: return [4, deserializeAws_restJson1TerminalStateExceptionResponse(parsedOutput, context)];
232
+ case 11: throw _d.sent();
233
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
234
+ case 13: throw _d.sent();
257
235
  case 14:
258
236
  parsedBody = parsedOutput.body;
259
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
260
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
261
- _k.label = 15;
262
- case 15:
263
- message = response.message || response.Message || errorCode;
264
- response.message = message;
265
- delete response.Message;
266
- return [2, Promise.reject(Object.assign(new Error(message), response))];
237
+ response = new __BaseException({
238
+ name: parsedBody.code || parsedBody.Code || errorCode,
239
+ $fault: "client",
240
+ $metadata: deserializeMetadata(output),
241
+ });
242
+ throw __decorateServiceException(response, parsedBody);
267
243
  }
268
244
  });
269
245
  }); };
@@ -296,16 +272,16 @@ export var deserializeAws_restJson1GetPendingJobExecutionsCommand = function (ou
296
272
  });
297
273
  }); };
298
274
  var deserializeAws_restJson1GetPendingJobExecutionsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
299
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
300
- var _h;
301
- return __generator(this, function (_j) {
302
- switch (_j.label) {
275
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
276
+ var _c;
277
+ return __generator(this, function (_d) {
278
+ switch (_d.label) {
303
279
  case 0:
304
280
  _a = [__assign({}, output)];
305
- _h = {};
281
+ _c = {};
306
282
  return [4, parseBody(output.body, context)];
307
283
  case 1:
308
- parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
284
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
309
285
  errorCode = "UnknownError";
310
286
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
311
287
  _b = errorCode;
@@ -322,46 +298,24 @@ var deserializeAws_restJson1GetPendingJobExecutionsCommandError = function (outp
322
298
  case "com.amazonaws.iotjobsdataplane#ThrottlingException": return [3, 10];
323
299
  }
324
300
  return [3, 12];
325
- case 2:
326
- _c = [{}];
327
- return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
328
- case 3:
329
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
330
- return [3, 13];
331
- case 4:
332
- _d = [{}];
333
- return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
334
- case 5:
335
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
336
- return [3, 13];
337
- case 6:
338
- _e = [{}];
339
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
340
- case 7:
341
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
342
- return [3, 13];
343
- case 8:
344
- _f = [{}];
345
- return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
346
- case 9:
347
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
348
- return [3, 13];
349
- case 10:
350
- _g = [{}];
351
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
352
- case 11:
353
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
354
- return [3, 13];
301
+ case 2: return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
302
+ case 3: throw _d.sent();
303
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
304
+ case 5: throw _d.sent();
305
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
306
+ case 7: throw _d.sent();
307
+ case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
308
+ case 9: throw _d.sent();
309
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
310
+ case 11: throw _d.sent();
355
311
  case 12:
356
312
  parsedBody = parsedOutput.body;
357
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
358
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
359
- _j.label = 13;
360
- case 13:
361
- message = response.message || response.Message || errorCode;
362
- response.message = message;
363
- delete response.Message;
364
- return [2, Promise.reject(Object.assign(new Error(message), response))];
313
+ response = new __BaseException({
314
+ name: parsedBody.code || parsedBody.Code || errorCode,
315
+ $fault: "client",
316
+ $metadata: deserializeMetadata(output),
317
+ });
318
+ throw __decorateServiceException(response, parsedBody);
365
319
  }
366
320
  });
367
321
  }); };
@@ -390,16 +344,16 @@ export var deserializeAws_restJson1StartNextPendingJobExecutionCommand = functio
390
344
  });
391
345
  }); };
392
346
  var deserializeAws_restJson1StartNextPendingJobExecutionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
393
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
394
- var _h;
395
- return __generator(this, function (_j) {
396
- switch (_j.label) {
347
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
348
+ var _c;
349
+ return __generator(this, function (_d) {
350
+ switch (_d.label) {
397
351
  case 0:
398
352
  _a = [__assign({}, output)];
399
- _h = {};
353
+ _c = {};
400
354
  return [4, parseBody(output.body, context)];
401
355
  case 1:
402
- parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
356
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
403
357
  errorCode = "UnknownError";
404
358
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
405
359
  _b = errorCode;
@@ -416,46 +370,24 @@ var deserializeAws_restJson1StartNextPendingJobExecutionCommandError = function
416
370
  case "com.amazonaws.iotjobsdataplane#ThrottlingException": return [3, 10];
417
371
  }
418
372
  return [3, 12];
419
- case 2:
420
- _c = [{}];
421
- return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
422
- case 3:
423
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
424
- return [3, 13];
425
- case 4:
426
- _d = [{}];
427
- return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
428
- case 5:
429
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
430
- return [3, 13];
431
- case 6:
432
- _e = [{}];
433
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
434
- case 7:
435
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
436
- return [3, 13];
437
- case 8:
438
- _f = [{}];
439
- return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
440
- case 9:
441
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
442
- return [3, 13];
443
- case 10:
444
- _g = [{}];
445
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
446
- case 11:
447
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
448
- return [3, 13];
373
+ case 2: return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
374
+ case 3: throw _d.sent();
375
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
376
+ case 5: throw _d.sent();
377
+ case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
378
+ case 7: throw _d.sent();
379
+ case 8: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
380
+ case 9: throw _d.sent();
381
+ case 10: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
382
+ case 11: throw _d.sent();
449
383
  case 12:
450
384
  parsedBody = parsedOutput.body;
451
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
452
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
453
- _j.label = 13;
454
- case 13:
455
- message = response.message || response.Message || errorCode;
456
- response.message = message;
457
- delete response.Message;
458
- return [2, Promise.reject(Object.assign(new Error(message), response))];
385
+ response = new __BaseException({
386
+ name: parsedBody.code || parsedBody.Code || errorCode,
387
+ $fault: "client",
388
+ $metadata: deserializeMetadata(output),
389
+ });
390
+ throw __decorateServiceException(response, parsedBody);
459
391
  }
460
392
  });
461
393
  }); };
@@ -488,16 +420,16 @@ export var deserializeAws_restJson1UpdateJobExecutionCommand = function (output,
488
420
  });
489
421
  }); };
490
422
  var deserializeAws_restJson1UpdateJobExecutionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
491
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
492
- var _j;
493
- return __generator(this, function (_k) {
494
- switch (_k.label) {
423
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
424
+ var _c;
425
+ return __generator(this, function (_d) {
426
+ switch (_d.label) {
495
427
  case 0:
496
428
  _a = [__assign({}, output)];
497
- _j = {};
429
+ _c = {};
498
430
  return [4, parseBody(output.body, context)];
499
431
  case 1:
500
- parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
432
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
501
433
  errorCode = "UnknownError";
502
434
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
503
435
  _b = errorCode;
@@ -516,161 +448,105 @@ var deserializeAws_restJson1UpdateJobExecutionCommandError = function (output, c
516
448
  case "com.amazonaws.iotjobsdataplane#ThrottlingException": return [3, 12];
517
449
  }
518
450
  return [3, 14];
519
- case 2:
520
- _c = [{}];
521
- return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
522
- case 3:
523
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
524
- return [3, 15];
525
- case 4:
526
- _d = [{}];
527
- return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
528
- case 5:
529
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
530
- return [3, 15];
531
- case 6:
532
- _e = [{}];
533
- return [4, deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context)];
534
- case 7:
535
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
536
- return [3, 15];
537
- case 8:
538
- _f = [{}];
539
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
540
- case 9:
541
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
542
- return [3, 15];
543
- case 10:
544
- _g = [{}];
545
- return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
546
- case 11:
547
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
548
- return [3, 15];
549
- case 12:
550
- _h = [{}];
551
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
552
- case 13:
553
- response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
554
- return [3, 15];
451
+ case 2: return [4, deserializeAws_restJson1CertificateValidationExceptionResponse(parsedOutput, context)];
452
+ case 3: throw _d.sent();
453
+ case 4: return [4, deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)];
454
+ case 5: throw _d.sent();
455
+ case 6: return [4, deserializeAws_restJson1InvalidStateTransitionExceptionResponse(parsedOutput, context)];
456
+ case 7: throw _d.sent();
457
+ case 8: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
458
+ case 9: throw _d.sent();
459
+ case 10: return [4, deserializeAws_restJson1ServiceUnavailableExceptionResponse(parsedOutput, context)];
460
+ case 11: throw _d.sent();
461
+ case 12: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
462
+ case 13: throw _d.sent();
555
463
  case 14:
556
464
  parsedBody = parsedOutput.body;
557
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
558
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
559
- _k.label = 15;
560
- case 15:
561
- message = response.message || response.Message || errorCode;
562
- response.message = message;
563
- delete response.Message;
564
- return [2, Promise.reject(Object.assign(new Error(message), response))];
465
+ response = new __BaseException({
466
+ name: parsedBody.code || parsedBody.Code || errorCode,
467
+ $fault: "client",
468
+ $metadata: deserializeMetadata(output),
469
+ });
470
+ throw __decorateServiceException(response, parsedBody);
565
471
  }
566
472
  });
567
473
  }); };
568
474
  var deserializeAws_restJson1CertificateValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
569
- var contents, data;
475
+ var contents, data, exception;
570
476
  return __generator(this, function (_a) {
571
- contents = {
572
- name: "CertificateValidationException",
573
- $fault: "client",
574
- $metadata: deserializeMetadata(parsedOutput),
575
- message: undefined,
576
- };
477
+ contents = {};
577
478
  data = parsedOutput.body;
578
479
  if (data.message !== undefined && data.message !== null) {
579
480
  contents.message = __expectString(data.message);
580
481
  }
581
- return [2, contents];
482
+ exception = new CertificateValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
483
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
582
484
  });
583
485
  }); };
584
486
  var deserializeAws_restJson1InvalidRequestExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
585
- var contents, data;
487
+ var contents, data, exception;
586
488
  return __generator(this, function (_a) {
587
- contents = {
588
- name: "InvalidRequestException",
589
- $fault: "client",
590
- $metadata: deserializeMetadata(parsedOutput),
591
- message: undefined,
592
- };
489
+ contents = {};
593
490
  data = parsedOutput.body;
594
491
  if (data.message !== undefined && data.message !== null) {
595
492
  contents.message = __expectString(data.message);
596
493
  }
597
- return [2, contents];
494
+ exception = new InvalidRequestException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
495
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
598
496
  });
599
497
  }); };
600
498
  var deserializeAws_restJson1InvalidStateTransitionExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
601
- var contents, data;
499
+ var contents, data, exception;
602
500
  return __generator(this, function (_a) {
603
- contents = {
604
- name: "InvalidStateTransitionException",
605
- $fault: "client",
606
- $metadata: deserializeMetadata(parsedOutput),
607
- message: undefined,
608
- };
501
+ contents = {};
609
502
  data = parsedOutput.body;
610
503
  if (data.message !== undefined && data.message !== null) {
611
504
  contents.message = __expectString(data.message);
612
505
  }
613
- return [2, contents];
506
+ exception = new InvalidStateTransitionException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
507
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
614
508
  });
615
509
  }); };
616
510
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
617
- var contents, data;
511
+ var contents, data, exception;
618
512
  return __generator(this, function (_a) {
619
- contents = {
620
- name: "ResourceNotFoundException",
621
- $fault: "client",
622
- $metadata: deserializeMetadata(parsedOutput),
623
- message: undefined,
624
- };
513
+ contents = {};
625
514
  data = parsedOutput.body;
626
515
  if (data.message !== undefined && data.message !== null) {
627
516
  contents.message = __expectString(data.message);
628
517
  }
629
- return [2, contents];
518
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
519
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
630
520
  });
631
521
  }); };
632
522
  var deserializeAws_restJson1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
633
- var contents, data;
523
+ var contents, data, exception;
634
524
  return __generator(this, function (_a) {
635
- contents = {
636
- name: "ServiceUnavailableException",
637
- $fault: "server",
638
- $metadata: deserializeMetadata(parsedOutput),
639
- message: undefined,
640
- };
525
+ contents = {};
641
526
  data = parsedOutput.body;
642
527
  if (data.message !== undefined && data.message !== null) {
643
528
  contents.message = __expectString(data.message);
644
529
  }
645
- return [2, contents];
530
+ exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
531
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
646
532
  });
647
533
  }); };
648
534
  var deserializeAws_restJson1TerminalStateExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
649
- var contents, data;
535
+ var contents, data, exception;
650
536
  return __generator(this, function (_a) {
651
- contents = {
652
- name: "TerminalStateException",
653
- $fault: "client",
654
- $metadata: deserializeMetadata(parsedOutput),
655
- message: undefined,
656
- };
537
+ contents = {};
657
538
  data = parsedOutput.body;
658
539
  if (data.message !== undefined && data.message !== null) {
659
540
  contents.message = __expectString(data.message);
660
541
  }
661
- return [2, contents];
542
+ exception = new TerminalStateException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
543
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
662
544
  });
663
545
  }); };
664
546
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
665
- var contents, data;
547
+ var contents, data, exception;
666
548
  return __generator(this, function (_a) {
667
- contents = {
668
- name: "ThrottlingException",
669
- $fault: "client",
670
- $metadata: deserializeMetadata(parsedOutput),
671
- message: undefined,
672
- payload: undefined,
673
- };
549
+ contents = {};
674
550
  data = parsedOutput.body;
675
551
  if (data.message !== undefined && data.message !== null) {
676
552
  contents.message = __expectString(data.message);
@@ -678,7 +554,8 @@ var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput
678
554
  if (data.payload !== undefined && data.payload !== null) {
679
555
  contents.payload = context.base64Decoder(data.payload);
680
556
  }
681
- return [2, contents];
557
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
558
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
682
559
  });
683
560
  }); };
684
561
  var serializeAws_restJson1DetailsMap = function (input, context) {
@@ -738,7 +615,7 @@ var deserializeAws_restJson1JobExecutionSummary = function (output, context) {
738
615
  };
739
616
  };
740
617
  var deserializeAws_restJson1JobExecutionSummaryList = function (output, context) {
741
- return (output || [])
618
+ var retVal = (output || [])
742
619
  .filter(function (e) { return e != null; })
743
620
  .map(function (entry) {
744
621
  if (entry === null) {
@@ -746,6 +623,7 @@ var deserializeAws_restJson1JobExecutionSummaryList = function (output, context)
746
623
  }
747
624
  return deserializeAws_restJson1JobExecutionSummary(entry, context);
748
625
  });
626
+ return retVal;
749
627
  };
750
628
  var deserializeMetadata = function (output) {
751
629
  var _a;