@aws-sdk/client-sagemaker-a2i-runtime 3.52.0 → 3.53.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,4 +1,5 @@
1
- import { __assign } from "tslib";
1
+ import { __assign, __extends } from "tslib";
2
+ import { SageMakerA2IRuntimeServiceException as __BaseException } from "./SageMakerA2IRuntimeServiceException";
2
3
  export var DeleteHumanLoopRequest;
3
4
  (function (DeleteHumanLoopRequest) {
4
5
  DeleteHumanLoopRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -7,6 +8,58 @@ export var DeleteHumanLoopResponse;
7
8
  (function (DeleteHumanLoopResponse) {
8
9
  DeleteHumanLoopResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
9
10
  })(DeleteHumanLoopResponse || (DeleteHumanLoopResponse = {}));
11
+ var InternalServerException = (function (_super) {
12
+ __extends(InternalServerException, _super);
13
+ function InternalServerException(opts) {
14
+ var _this = _super.call(this, __assign({ name: "InternalServerException", $fault: "server" }, opts)) || this;
15
+ _this.name = "InternalServerException";
16
+ _this.$fault = "server";
17
+ Object.setPrototypeOf(_this, InternalServerException.prototype);
18
+ _this.Message = opts.Message;
19
+ return _this;
20
+ }
21
+ return InternalServerException;
22
+ }(__BaseException));
23
+ export { InternalServerException };
24
+ var ResourceNotFoundException = (function (_super) {
25
+ __extends(ResourceNotFoundException, _super);
26
+ function ResourceNotFoundException(opts) {
27
+ var _this = _super.call(this, __assign({ name: "ResourceNotFoundException", $fault: "client" }, opts)) || this;
28
+ _this.name = "ResourceNotFoundException";
29
+ _this.$fault = "client";
30
+ Object.setPrototypeOf(_this, ResourceNotFoundException.prototype);
31
+ _this.Message = opts.Message;
32
+ return _this;
33
+ }
34
+ return ResourceNotFoundException;
35
+ }(__BaseException));
36
+ export { ResourceNotFoundException };
37
+ var ThrottlingException = (function (_super) {
38
+ __extends(ThrottlingException, _super);
39
+ function ThrottlingException(opts) {
40
+ var _this = _super.call(this, __assign({ name: "ThrottlingException", $fault: "client" }, opts)) || this;
41
+ _this.name = "ThrottlingException";
42
+ _this.$fault = "client";
43
+ Object.setPrototypeOf(_this, ThrottlingException.prototype);
44
+ _this.Message = opts.Message;
45
+ return _this;
46
+ }
47
+ return ThrottlingException;
48
+ }(__BaseException));
49
+ export { ThrottlingException };
50
+ var ValidationException = (function (_super) {
51
+ __extends(ValidationException, _super);
52
+ function ValidationException(opts) {
53
+ var _this = _super.call(this, __assign({ name: "ValidationException", $fault: "client" }, opts)) || this;
54
+ _this.name = "ValidationException";
55
+ _this.$fault = "client";
56
+ Object.setPrototypeOf(_this, ValidationException.prototype);
57
+ _this.Message = opts.Message;
58
+ return _this;
59
+ }
60
+ return ValidationException;
61
+ }(__BaseException));
62
+ export { ValidationException };
10
63
  export var DescribeHumanLoopRequest;
11
64
  (function (DescribeHumanLoopRequest) {
12
65
  DescribeHumanLoopRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -44,6 +97,32 @@ export var ListHumanLoopsResponse;
44
97
  (function (ListHumanLoopsResponse) {
45
98
  ListHumanLoopsResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
46
99
  })(ListHumanLoopsResponse || (ListHumanLoopsResponse = {}));
100
+ var ConflictException = (function (_super) {
101
+ __extends(ConflictException, _super);
102
+ function ConflictException(opts) {
103
+ var _this = _super.call(this, __assign({ name: "ConflictException", $fault: "client" }, opts)) || this;
104
+ _this.name = "ConflictException";
105
+ _this.$fault = "client";
106
+ Object.setPrototypeOf(_this, ConflictException.prototype);
107
+ _this.Message = opts.Message;
108
+ return _this;
109
+ }
110
+ return ConflictException;
111
+ }(__BaseException));
112
+ export { ConflictException };
113
+ var ServiceQuotaExceededException = (function (_super) {
114
+ __extends(ServiceQuotaExceededException, _super);
115
+ function ServiceQuotaExceededException(opts) {
116
+ var _this = _super.call(this, __assign({ name: "ServiceQuotaExceededException", $fault: "client" }, opts)) || this;
117
+ _this.name = "ServiceQuotaExceededException";
118
+ _this.$fault = "client";
119
+ Object.setPrototypeOf(_this, ServiceQuotaExceededException.prototype);
120
+ _this.Message = opts.Message;
121
+ return _this;
122
+ }
123
+ return ServiceQuotaExceededException;
124
+ }(__BaseException));
125
+ export { ServiceQuotaExceededException };
47
126
  export var ContentClassifier;
48
127
  (function (ContentClassifier) {
49
128
  ContentClassifier["FREE_OF_ADULT_CONTENT"] = "FreeOfAdultContent";
@@ -1,6 +1,8 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
4
+ import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ import { SageMakerA2IRuntimeServiceException as __BaseException } from "../models/SageMakerA2IRuntimeServiceException";
4
6
  export var serializeAws_restJson1DeleteHumanLoopCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
5
7
  var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
6
8
  return __generator(this, function (_c) {
@@ -164,16 +166,16 @@ export var deserializeAws_restJson1DeleteHumanLoopCommand = function (output, co
164
166
  });
165
167
  }); };
166
168
  var deserializeAws_restJson1DeleteHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
167
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, parsedBody, message;
168
- var _g;
169
- return __generator(this, function (_h) {
170
- switch (_h.label) {
169
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
170
+ var _c;
171
+ return __generator(this, function (_d) {
172
+ switch (_d.label) {
171
173
  case 0:
172
174
  _a = [__assign({}, output)];
173
- _g = {};
175
+ _c = {};
174
176
  return [4, parseBody(output.body, context)];
175
177
  case 1:
176
- parsedOutput = __assign.apply(void 0, _a.concat([(_g.body = _h.sent(), _g)]));
178
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
177
179
  errorCode = "UnknownError";
178
180
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
179
181
  _b = errorCode;
@@ -188,40 +190,22 @@ var deserializeAws_restJson1DeleteHumanLoopCommandError = function (output, cont
188
190
  case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
189
191
  }
190
192
  return [3, 10];
191
- case 2:
192
- _c = [{}];
193
- return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
194
- case 3:
195
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
196
- return [3, 11];
197
- case 4:
198
- _d = [{}];
199
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
200
- case 5:
201
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
202
- return [3, 11];
203
- case 6:
204
- _e = [{}];
205
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
206
- case 7:
207
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
208
- return [3, 11];
209
- case 8:
210
- _f = [{}];
211
- return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
212
- case 9:
213
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
214
- return [3, 11];
193
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
194
+ case 3: throw _d.sent();
195
+ case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
196
+ case 5: throw _d.sent();
197
+ case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
198
+ case 7: throw _d.sent();
199
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
200
+ case 9: throw _d.sent();
215
201
  case 10:
216
202
  parsedBody = parsedOutput.body;
217
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
218
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
219
- _h.label = 11;
220
- case 11:
221
- message = response.message || response.Message || errorCode;
222
- response.message = message;
223
- delete response.Message;
224
- return [2, Promise.reject(Object.assign(new Error(message), response))];
203
+ response = new __BaseException({
204
+ name: parsedBody.code || parsedBody.Code || errorCode,
205
+ $fault: "client",
206
+ $metadata: deserializeMetadata(output),
207
+ });
208
+ throw __decorateServiceException(response, parsedBody);
225
209
  }
226
210
  });
227
211
  }); };
@@ -278,16 +262,16 @@ export var deserializeAws_restJson1DescribeHumanLoopCommand = function (output,
278
262
  });
279
263
  }); };
280
264
  var deserializeAws_restJson1DescribeHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
281
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, parsedBody, message;
282
- var _g;
283
- return __generator(this, function (_h) {
284
- switch (_h.label) {
265
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
266
+ var _c;
267
+ return __generator(this, function (_d) {
268
+ switch (_d.label) {
285
269
  case 0:
286
270
  _a = [__assign({}, output)];
287
- _g = {};
271
+ _c = {};
288
272
  return [4, parseBody(output.body, context)];
289
273
  case 1:
290
- parsedOutput = __assign.apply(void 0, _a.concat([(_g.body = _h.sent(), _g)]));
274
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
291
275
  errorCode = "UnknownError";
292
276
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
293
277
  _b = errorCode;
@@ -302,40 +286,22 @@ var deserializeAws_restJson1DescribeHumanLoopCommandError = function (output, co
302
286
  case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
303
287
  }
304
288
  return [3, 10];
305
- case 2:
306
- _c = [{}];
307
- return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
308
- case 3:
309
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
310
- return [3, 11];
311
- case 4:
312
- _d = [{}];
313
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
314
- case 5:
315
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
316
- return [3, 11];
317
- case 6:
318
- _e = [{}];
319
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
320
- case 7:
321
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
322
- return [3, 11];
323
- case 8:
324
- _f = [{}];
325
- return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
326
- case 9:
327
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
328
- return [3, 11];
289
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
290
+ case 3: throw _d.sent();
291
+ case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
292
+ case 5: throw _d.sent();
293
+ case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
294
+ case 7: throw _d.sent();
295
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
296
+ case 9: throw _d.sent();
329
297
  case 10:
330
298
  parsedBody = parsedOutput.body;
331
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
332
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
333
- _h.label = 11;
334
- case 11:
335
- message = response.message || response.Message || errorCode;
336
- response.message = message;
337
- delete response.Message;
338
- return [2, Promise.reject(Object.assign(new Error(message), response))];
299
+ response = new __BaseException({
300
+ name: parsedBody.code || parsedBody.Code || errorCode,
301
+ $fault: "client",
302
+ $metadata: deserializeMetadata(output),
303
+ });
304
+ throw __decorateServiceException(response, parsedBody);
339
305
  }
340
306
  });
341
307
  }); };
@@ -368,16 +334,16 @@ export var deserializeAws_restJson1ListHumanLoopsCommand = function (output, con
368
334
  });
369
335
  }); };
370
336
  var deserializeAws_restJson1ListHumanLoopsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
371
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, parsedBody, message;
372
- var _g;
373
- return __generator(this, function (_h) {
374
- switch (_h.label) {
337
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
338
+ var _c;
339
+ return __generator(this, function (_d) {
340
+ switch (_d.label) {
375
341
  case 0:
376
342
  _a = [__assign({}, output)];
377
- _g = {};
343
+ _c = {};
378
344
  return [4, parseBody(output.body, context)];
379
345
  case 1:
380
- parsedOutput = __assign.apply(void 0, _a.concat([(_g.body = _h.sent(), _g)]));
346
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
381
347
  errorCode = "UnknownError";
382
348
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
383
349
  _b = errorCode;
@@ -392,40 +358,22 @@ var deserializeAws_restJson1ListHumanLoopsCommandError = function (output, conte
392
358
  case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
393
359
  }
394
360
  return [3, 10];
395
- case 2:
396
- _c = [{}];
397
- return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
398
- case 3:
399
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
400
- return [3, 11];
401
- case 4:
402
- _d = [{}];
403
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
404
- case 5:
405
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
406
- return [3, 11];
407
- case 6:
408
- _e = [{}];
409
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
410
- case 7:
411
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
412
- return [3, 11];
413
- case 8:
414
- _f = [{}];
415
- return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
416
- case 9:
417
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
418
- return [3, 11];
361
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
362
+ case 3: throw _d.sent();
363
+ case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
364
+ case 5: throw _d.sent();
365
+ case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
366
+ case 7: throw _d.sent();
367
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
368
+ case 9: throw _d.sent();
419
369
  case 10:
420
370
  parsedBody = parsedOutput.body;
421
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
422
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
423
- _h.label = 11;
424
- case 11:
425
- message = response.message || response.Message || errorCode;
426
- response.message = message;
427
- delete response.Message;
428
- return [2, Promise.reject(Object.assign(new Error(message), response))];
371
+ response = new __BaseException({
372
+ name: parsedBody.code || parsedBody.Code || errorCode,
373
+ $fault: "client",
374
+ $metadata: deserializeMetadata(output),
375
+ });
376
+ throw __decorateServiceException(response, parsedBody);
429
377
  }
430
378
  });
431
379
  }); };
@@ -454,16 +402,16 @@ export var deserializeAws_restJson1StartHumanLoopCommand = function (output, con
454
402
  });
455
403
  }); };
456
404
  var deserializeAws_restJson1StartHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
457
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
458
- var _h;
459
- return __generator(this, function (_j) {
460
- switch (_j.label) {
405
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
406
+ var _c;
407
+ return __generator(this, function (_d) {
408
+ switch (_d.label) {
461
409
  case 0:
462
410
  _a = [__assign({}, output)];
463
- _h = {};
411
+ _c = {};
464
412
  return [4, parseBody(output.body, context)];
465
413
  case 1:
466
- parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
414
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
467
415
  errorCode = "UnknownError";
468
416
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
469
417
  _b = errorCode;
@@ -480,46 +428,24 @@ var deserializeAws_restJson1StartHumanLoopCommandError = function (output, conte
480
428
  case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 10];
481
429
  }
482
430
  return [3, 12];
483
- case 2:
484
- _c = [{}];
485
- return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
486
- case 3:
487
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
488
- return [3, 13];
489
- case 4:
490
- _d = [{}];
491
- return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
492
- case 5:
493
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
494
- return [3, 13];
495
- case 6:
496
- _e = [{}];
497
- return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
498
- case 7:
499
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
500
- return [3, 13];
501
- case 8:
502
- _f = [{}];
503
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
504
- case 9:
505
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
506
- return [3, 13];
507
- case 10:
508
- _g = [{}];
509
- return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
510
- case 11:
511
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
512
- return [3, 13];
431
+ case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
432
+ case 3: throw _d.sent();
433
+ case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
434
+ case 5: throw _d.sent();
435
+ case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
436
+ case 7: throw _d.sent();
437
+ case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
438
+ case 9: throw _d.sent();
439
+ case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
440
+ case 11: throw _d.sent();
513
441
  case 12:
514
442
  parsedBody = parsedOutput.body;
515
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
516
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
517
- _j.label = 13;
518
- case 13:
519
- message = response.message || response.Message || errorCode;
520
- response.message = message;
521
- delete response.Message;
522
- return [2, Promise.reject(Object.assign(new Error(message), response))];
443
+ response = new __BaseException({
444
+ name: parsedBody.code || parsedBody.Code || errorCode,
445
+ $fault: "client",
446
+ $metadata: deserializeMetadata(output),
447
+ });
448
+ throw __decorateServiceException(response, parsedBody);
523
449
  }
524
450
  });
525
451
  }); };
@@ -542,16 +468,16 @@ export var deserializeAws_restJson1StopHumanLoopCommand = function (output, cont
542
468
  });
543
469
  }); };
544
470
  var deserializeAws_restJson1StopHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
545
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, parsedBody, message;
546
- var _g;
547
- return __generator(this, function (_h) {
548
- switch (_h.label) {
471
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
472
+ var _c;
473
+ return __generator(this, function (_d) {
474
+ switch (_d.label) {
549
475
  case 0:
550
476
  _a = [__assign({}, output)];
551
- _g = {};
477
+ _c = {};
552
478
  return [4, parseBody(output.body, context)];
553
479
  case 1:
554
- parsedOutput = __assign.apply(void 0, _a.concat([(_g.body = _h.sent(), _g)]));
480
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
555
481
  errorCode = "UnknownError";
556
482
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
557
483
  _b = errorCode;
@@ -566,137 +492,95 @@ var deserializeAws_restJson1StopHumanLoopCommandError = function (output, contex
566
492
  case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
567
493
  }
568
494
  return [3, 10];
569
- case 2:
570
- _c = [{}];
571
- return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
572
- case 3:
573
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
574
- return [3, 11];
575
- case 4:
576
- _d = [{}];
577
- return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
578
- case 5:
579
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
580
- return [3, 11];
581
- case 6:
582
- _e = [{}];
583
- return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
584
- case 7:
585
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
586
- return [3, 11];
587
- case 8:
588
- _f = [{}];
589
- return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
590
- case 9:
591
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_h.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
592
- return [3, 11];
495
+ case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
496
+ case 3: throw _d.sent();
497
+ case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
498
+ case 5: throw _d.sent();
499
+ case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
500
+ case 7: throw _d.sent();
501
+ case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
502
+ case 9: throw _d.sent();
593
503
  case 10:
594
504
  parsedBody = parsedOutput.body;
595
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
596
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
597
- _h.label = 11;
598
- case 11:
599
- message = response.message || response.Message || errorCode;
600
- response.message = message;
601
- delete response.Message;
602
- return [2, Promise.reject(Object.assign(new Error(message), response))];
505
+ response = new __BaseException({
506
+ name: parsedBody.code || parsedBody.Code || errorCode,
507
+ $fault: "client",
508
+ $metadata: deserializeMetadata(output),
509
+ });
510
+ throw __decorateServiceException(response, parsedBody);
603
511
  }
604
512
  });
605
513
  }); };
606
514
  var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
607
- var contents, data;
515
+ var contents, data, exception;
608
516
  return __generator(this, function (_a) {
609
- contents = {
610
- name: "ConflictException",
611
- $fault: "client",
612
- $metadata: deserializeMetadata(parsedOutput),
613
- Message: undefined,
614
- };
517
+ contents = {};
615
518
  data = parsedOutput.body;
616
519
  if (data.Message !== undefined && data.Message !== null) {
617
520
  contents.Message = __expectString(data.Message);
618
521
  }
619
- return [2, contents];
522
+ exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
523
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
620
524
  });
621
525
  }); };
622
526
  var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
623
- var contents, data;
527
+ var contents, data, exception;
624
528
  return __generator(this, function (_a) {
625
- contents = {
626
- name: "InternalServerException",
627
- $fault: "server",
628
- $metadata: deserializeMetadata(parsedOutput),
629
- Message: undefined,
630
- };
529
+ contents = {};
631
530
  data = parsedOutput.body;
632
531
  if (data.Message !== undefined && data.Message !== null) {
633
532
  contents.Message = __expectString(data.Message);
634
533
  }
635
- return [2, contents];
534
+ exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
535
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
636
536
  });
637
537
  }); };
638
538
  var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
639
- var contents, data;
539
+ var contents, data, exception;
640
540
  return __generator(this, function (_a) {
641
- contents = {
642
- name: "ResourceNotFoundException",
643
- $fault: "client",
644
- $metadata: deserializeMetadata(parsedOutput),
645
- Message: undefined,
646
- };
541
+ contents = {};
647
542
  data = parsedOutput.body;
648
543
  if (data.Message !== undefined && data.Message !== null) {
649
544
  contents.Message = __expectString(data.Message);
650
545
  }
651
- return [2, contents];
546
+ exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
547
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
652
548
  });
653
549
  }); };
654
550
  var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
655
- var contents, data;
551
+ var contents, data, exception;
656
552
  return __generator(this, function (_a) {
657
- contents = {
658
- name: "ServiceQuotaExceededException",
659
- $fault: "client",
660
- $metadata: deserializeMetadata(parsedOutput),
661
- Message: undefined,
662
- };
553
+ contents = {};
663
554
  data = parsedOutput.body;
664
555
  if (data.Message !== undefined && data.Message !== null) {
665
556
  contents.Message = __expectString(data.Message);
666
557
  }
667
- return [2, contents];
558
+ exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
559
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
668
560
  });
669
561
  }); };
670
562
  var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
671
- var contents, data;
563
+ var contents, data, exception;
672
564
  return __generator(this, function (_a) {
673
- contents = {
674
- name: "ThrottlingException",
675
- $fault: "client",
676
- $metadata: deserializeMetadata(parsedOutput),
677
- Message: undefined,
678
- };
565
+ contents = {};
679
566
  data = parsedOutput.body;
680
567
  if (data.Message !== undefined && data.Message !== null) {
681
568
  contents.Message = __expectString(data.Message);
682
569
  }
683
- return [2, contents];
570
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
571
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
684
572
  });
685
573
  }); };
686
574
  var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
687
- var contents, data;
575
+ var contents, data, exception;
688
576
  return __generator(this, function (_a) {
689
- contents = {
690
- name: "ValidationException",
691
- $fault: "client",
692
- $metadata: deserializeMetadata(parsedOutput),
693
- Message: undefined,
694
- };
577
+ contents = {};
695
578
  data = parsedOutput.body;
696
579
  if (data.Message !== undefined && data.Message !== null) {
697
580
  contents.Message = __expectString(data.Message);
698
581
  }
699
- return [2, contents];
582
+ exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
583
+ return [2, __decorateServiceException(exception, parsedOutput.body)];
700
584
  });
701
585
  }); };
702
586
  var serializeAws_restJson1ContentClassifiers = function (input, context) {
@@ -724,7 +608,7 @@ var deserializeAws_restJson1HumanLoopOutput = function (output, context) {
724
608
  };
725
609
  };
726
610
  var deserializeAws_restJson1HumanLoopSummaries = function (output, context) {
727
- return (output || [])
611
+ var retVal = (output || [])
728
612
  .filter(function (e) { return e != null; })
729
613
  .map(function (entry) {
730
614
  if (entry === null) {
@@ -732,6 +616,7 @@ var deserializeAws_restJson1HumanLoopSummaries = function (output, context) {
732
616
  }
733
617
  return deserializeAws_restJson1HumanLoopSummary(entry, context);
734
618
  });
619
+ return retVal;
735
620
  };
736
621
  var deserializeAws_restJson1HumanLoopSummary = function (output, context) {
737
622
  return {
@@ -3,3 +3,4 @@ export * from "./SageMakerA2IRuntimeClient";
3
3
  export * from "./commands";
4
4
  export * from "./models";
5
5
  export * from "./pagination";
6
+ export { SageMakerA2IRuntimeServiceException } from "./models/SageMakerA2IRuntimeServiceException";