@aws-sdk/client-sagemaker-a2i-runtime 3.180.0 → 3.183.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,595 +1,448 @@
1
- import { __assign, __awaiter, __generator } from "tslib";
2
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
2
  import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
4
3
  import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
4
  import { SageMakerA2IRuntimeServiceException as __BaseException } from "../models/SageMakerA2IRuntimeServiceException";
6
- export var serializeAws_restJson1DeleteHumanLoopCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
8
- return __generator(this, function (_c) {
9
- switch (_c.label) {
10
- case 0: return [4, context.endpoint()];
11
- case 1:
12
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
13
- headers = {};
14
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/human-loops/{HumanLoopName}";
15
- resolvedPath = __resolvedPath(resolvedPath, input, "HumanLoopName", function () { return input.HumanLoopName; }, "{HumanLoopName}", false);
16
- return [2, new __HttpRequest({
17
- protocol: protocol,
18
- hostname: hostname,
19
- port: port,
20
- method: "DELETE",
21
- headers: headers,
22
- path: resolvedPath,
23
- body: body,
24
- })];
25
- }
26
- });
27
- }); };
28
- export var serializeAws_restJson1DescribeHumanLoopCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
30
- return __generator(this, function (_c) {
31
- switch (_c.label) {
32
- case 0: return [4, context.endpoint()];
33
- case 1:
34
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
35
- headers = {};
36
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/human-loops/{HumanLoopName}";
37
- resolvedPath = __resolvedPath(resolvedPath, input, "HumanLoopName", function () { return input.HumanLoopName; }, "{HumanLoopName}", false);
38
- return [2, new __HttpRequest({
39
- protocol: protocol,
40
- hostname: hostname,
41
- port: port,
42
- method: "GET",
43
- headers: headers,
44
- path: resolvedPath,
45
- body: body,
46
- })];
47
- }
5
+ export const serializeAws_restJson1DeleteHumanLoopCommand = async (input, context) => {
6
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const headers = {};
8
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/human-loops/{HumanLoopName}";
9
+ resolvedPath = __resolvedPath(resolvedPath, input, "HumanLoopName", () => input.HumanLoopName, "{HumanLoopName}", false);
10
+ let body;
11
+ return new __HttpRequest({
12
+ protocol,
13
+ hostname,
14
+ port,
15
+ method: "DELETE",
16
+ headers,
17
+ path: resolvedPath,
18
+ body,
48
19
  });
49
- }); };
50
- export var serializeAws_restJson1ListHumanLoopsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
51
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
52
- return __generator(this, function (_c) {
53
- switch (_c.label) {
54
- case 0: return [4, context.endpoint()];
55
- case 1:
56
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
57
- headers = {};
58
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/human-loops";
59
- query = map({
60
- CreationTimeAfter: [
61
- function () { return input.CreationTimeAfter !== void 0; },
62
- function () { return (input.CreationTimeAfter.toISOString().split(".")[0] + "Z").toString(); },
63
- ],
64
- CreationTimeBefore: [
65
- function () { return input.CreationTimeBefore !== void 0; },
66
- function () { return (input.CreationTimeBefore.toISOString().split(".")[0] + "Z").toString(); },
67
- ],
68
- FlowDefinitionArn: [, input.FlowDefinitionArn],
69
- SortOrder: [, input.SortOrder],
70
- NextToken: [, input.NextToken],
71
- MaxResults: [function () { return input.MaxResults !== void 0; }, function () { return input.MaxResults.toString(); }],
72
- });
73
- return [2, new __HttpRequest({
74
- protocol: protocol,
75
- hostname: hostname,
76
- port: port,
77
- method: "GET",
78
- headers: headers,
79
- path: resolvedPath,
80
- query: query,
81
- body: body,
82
- })];
83
- }
84
- });
85
- }); };
86
- export var serializeAws_restJson1StartHumanLoopCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
87
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
88
- return __generator(this, function (_c) {
89
- switch (_c.label) {
90
- case 0: return [4, context.endpoint()];
91
- case 1:
92
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
93
- headers = {
94
- "content-type": "application/json",
95
- };
96
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/human-loops";
97
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.DataAttributes != null && {
98
- DataAttributes: serializeAws_restJson1HumanLoopDataAttributes(input.DataAttributes, context),
99
- })), (input.FlowDefinitionArn != null && { FlowDefinitionArn: input.FlowDefinitionArn })), (input.HumanLoopInput != null && {
100
- HumanLoopInput: serializeAws_restJson1HumanLoopInput(input.HumanLoopInput, context),
101
- })), (input.HumanLoopName != null && { HumanLoopName: input.HumanLoopName })));
102
- return [2, new __HttpRequest({
103
- protocol: protocol,
104
- hostname: hostname,
105
- port: port,
106
- method: "POST",
107
- headers: headers,
108
- path: resolvedPath,
109
- body: body,
110
- })];
111
- }
20
+ };
21
+ export const serializeAws_restJson1DescribeHumanLoopCommand = async (input, context) => {
22
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
23
+ const headers = {};
24
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/human-loops/{HumanLoopName}";
25
+ resolvedPath = __resolvedPath(resolvedPath, input, "HumanLoopName", () => input.HumanLoopName, "{HumanLoopName}", false);
26
+ let body;
27
+ return new __HttpRequest({
28
+ protocol,
29
+ hostname,
30
+ port,
31
+ method: "GET",
32
+ headers,
33
+ path: resolvedPath,
34
+ body,
112
35
  });
113
- }); };
114
- export var serializeAws_restJson1StopHumanLoopCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
115
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
116
- return __generator(this, function (_c) {
117
- switch (_c.label) {
118
- case 0: return [4, context.endpoint()];
119
- case 1:
120
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
121
- headers = {
122
- "content-type": "application/json",
123
- };
124
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/human-loops/stop";
125
- body = JSON.stringify(__assign({}, (input.HumanLoopName != null && { HumanLoopName: input.HumanLoopName })));
126
- return [2, new __HttpRequest({
127
- protocol: protocol,
128
- hostname: hostname,
129
- port: port,
130
- method: "POST",
131
- headers: headers,
132
- path: resolvedPath,
133
- body: body,
134
- })];
135
- }
36
+ };
37
+ export const serializeAws_restJson1ListHumanLoopsCommand = async (input, context) => {
38
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
39
+ const headers = {};
40
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/human-loops";
41
+ const query = map({
42
+ CreationTimeAfter: [
43
+ () => input.CreationTimeAfter !== void 0,
44
+ () => (input.CreationTimeAfter.toISOString().split(".")[0] + "Z").toString(),
45
+ ],
46
+ CreationTimeBefore: [
47
+ () => input.CreationTimeBefore !== void 0,
48
+ () => (input.CreationTimeBefore.toISOString().split(".")[0] + "Z").toString(),
49
+ ],
50
+ FlowDefinitionArn: [, input.FlowDefinitionArn],
51
+ SortOrder: [, input.SortOrder],
52
+ NextToken: [, input.NextToken],
53
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
136
54
  });
137
- }); };
138
- export var deserializeAws_restJson1DeleteHumanLoopCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
139
- var contents;
140
- return __generator(this, function (_a) {
141
- switch (_a.label) {
142
- case 0:
143
- if (output.statusCode !== 200 && output.statusCode >= 300) {
144
- return [2, deserializeAws_restJson1DeleteHumanLoopCommandError(output, context)];
145
- }
146
- contents = map({
147
- $metadata: deserializeMetadata(output),
148
- });
149
- return [4, collectBody(output.body, context)];
150
- case 1:
151
- _a.sent();
152
- return [2, contents];
153
- }
55
+ let body;
56
+ return new __HttpRequest({
57
+ protocol,
58
+ hostname,
59
+ port,
60
+ method: "GET",
61
+ headers,
62
+ path: resolvedPath,
63
+ query,
64
+ body,
154
65
  });
155
- }); };
156
- var deserializeAws_restJson1DeleteHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
157
- var parsedOutput, _a, errorCode, _b, parsedBody;
158
- var _c;
159
- return __generator(this, function (_d) {
160
- switch (_d.label) {
161
- case 0:
162
- _a = [__assign({}, output)];
163
- _c = {};
164
- return [4, parseBody(output.body, context)];
165
- case 1:
166
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
167
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
168
- _b = errorCode;
169
- switch (_b) {
170
- case "InternalServerException": return [3, 2];
171
- case "com.amazonaws.sagemakera2iruntime#InternalServerException": return [3, 2];
172
- case "ResourceNotFoundException": return [3, 4];
173
- case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException": return [3, 4];
174
- case "ThrottlingException": return [3, 6];
175
- case "com.amazonaws.sagemakera2iruntime#ThrottlingException": return [3, 6];
176
- case "ValidationException": return [3, 8];
177
- case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
178
- }
179
- return [3, 10];
180
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
181
- case 3: throw _d.sent();
182
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
183
- case 5: throw _d.sent();
184
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
185
- case 7: throw _d.sent();
186
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
187
- case 9: throw _d.sent();
188
- case 10:
189
- parsedBody = parsedOutput.body;
190
- throwDefaultError({
191
- output: output,
192
- parsedBody: parsedBody,
193
- exceptionCtor: __BaseException,
194
- errorCode: errorCode,
195
- });
196
- _d.label = 11;
197
- case 11: return [2];
198
- }
66
+ };
67
+ export const serializeAws_restJson1StartHumanLoopCommand = async (input, context) => {
68
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
69
+ const headers = {
70
+ "content-type": "application/json",
71
+ };
72
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/human-loops";
73
+ let body;
74
+ body = JSON.stringify({
75
+ ...(input.DataAttributes != null && {
76
+ DataAttributes: serializeAws_restJson1HumanLoopDataAttributes(input.DataAttributes, context),
77
+ }),
78
+ ...(input.FlowDefinitionArn != null && { FlowDefinitionArn: input.FlowDefinitionArn }),
79
+ ...(input.HumanLoopInput != null && {
80
+ HumanLoopInput: serializeAws_restJson1HumanLoopInput(input.HumanLoopInput, context),
81
+ }),
82
+ ...(input.HumanLoopName != null && { HumanLoopName: input.HumanLoopName }),
199
83
  });
200
- }); };
201
- export var deserializeAws_restJson1DescribeHumanLoopCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
202
- var contents, data, _a, _b;
203
- return __generator(this, function (_c) {
204
- switch (_c.label) {
205
- case 0:
206
- if (output.statusCode !== 200 && output.statusCode >= 300) {
207
- return [2, deserializeAws_restJson1DescribeHumanLoopCommandError(output, context)];
208
- }
209
- contents = map({
210
- $metadata: deserializeMetadata(output),
211
- });
212
- _a = __expectNonNull;
213
- _b = __expectObject;
214
- return [4, parseBody(output.body, context)];
215
- case 1:
216
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
217
- if (data.CreationTime != null) {
218
- contents.CreationTime = __expectNonNull(__parseRfc3339DateTime(data.CreationTime));
219
- }
220
- if (data.FailureCode != null) {
221
- contents.FailureCode = __expectString(data.FailureCode);
222
- }
223
- if (data.FailureReason != null) {
224
- contents.FailureReason = __expectString(data.FailureReason);
225
- }
226
- if (data.FlowDefinitionArn != null) {
227
- contents.FlowDefinitionArn = __expectString(data.FlowDefinitionArn);
228
- }
229
- if (data.HumanLoopArn != null) {
230
- contents.HumanLoopArn = __expectString(data.HumanLoopArn);
231
- }
232
- if (data.HumanLoopName != null) {
233
- contents.HumanLoopName = __expectString(data.HumanLoopName);
234
- }
235
- if (data.HumanLoopOutput != null) {
236
- contents.HumanLoopOutput = deserializeAws_restJson1HumanLoopOutput(data.HumanLoopOutput, context);
237
- }
238
- if (data.HumanLoopStatus != null) {
239
- contents.HumanLoopStatus = __expectString(data.HumanLoopStatus);
240
- }
241
- return [2, contents];
242
- }
84
+ return new __HttpRequest({
85
+ protocol,
86
+ hostname,
87
+ port,
88
+ method: "POST",
89
+ headers,
90
+ path: resolvedPath,
91
+ body,
243
92
  });
244
- }); };
245
- var deserializeAws_restJson1DescribeHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
246
- var parsedOutput, _a, errorCode, _b, parsedBody;
247
- var _c;
248
- return __generator(this, function (_d) {
249
- switch (_d.label) {
250
- case 0:
251
- _a = [__assign({}, output)];
252
- _c = {};
253
- return [4, parseBody(output.body, context)];
254
- case 1:
255
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
256
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
257
- _b = errorCode;
258
- switch (_b) {
259
- case "InternalServerException": return [3, 2];
260
- case "com.amazonaws.sagemakera2iruntime#InternalServerException": return [3, 2];
261
- case "ResourceNotFoundException": return [3, 4];
262
- case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException": return [3, 4];
263
- case "ThrottlingException": return [3, 6];
264
- case "com.amazonaws.sagemakera2iruntime#ThrottlingException": return [3, 6];
265
- case "ValidationException": return [3, 8];
266
- case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
267
- }
268
- return [3, 10];
269
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
270
- case 3: throw _d.sent();
271
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
272
- case 5: throw _d.sent();
273
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
274
- case 7: throw _d.sent();
275
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
276
- case 9: throw _d.sent();
277
- case 10:
278
- parsedBody = parsedOutput.body;
279
- throwDefaultError({
280
- output: output,
281
- parsedBody: parsedBody,
282
- exceptionCtor: __BaseException,
283
- errorCode: errorCode,
284
- });
285
- _d.label = 11;
286
- case 11: return [2];
287
- }
93
+ };
94
+ export const serializeAws_restJson1StopHumanLoopCommand = async (input, context) => {
95
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
96
+ const headers = {
97
+ "content-type": "application/json",
98
+ };
99
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/human-loops/stop";
100
+ let body;
101
+ body = JSON.stringify({
102
+ ...(input.HumanLoopName != null && { HumanLoopName: input.HumanLoopName }),
288
103
  });
289
- }); };
290
- export var deserializeAws_restJson1ListHumanLoopsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
291
- var contents, data, _a, _b;
292
- return __generator(this, function (_c) {
293
- switch (_c.label) {
294
- case 0:
295
- if (output.statusCode !== 200 && output.statusCode >= 300) {
296
- return [2, deserializeAws_restJson1ListHumanLoopsCommandError(output, context)];
297
- }
298
- contents = map({
299
- $metadata: deserializeMetadata(output),
300
- });
301
- _a = __expectNonNull;
302
- _b = __expectObject;
303
- return [4, parseBody(output.body, context)];
304
- case 1:
305
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
306
- if (data.HumanLoopSummaries != null) {
307
- contents.HumanLoopSummaries = deserializeAws_restJson1HumanLoopSummaries(data.HumanLoopSummaries, context);
308
- }
309
- if (data.NextToken != null) {
310
- contents.NextToken = __expectString(data.NextToken);
311
- }
312
- return [2, contents];
313
- }
104
+ return new __HttpRequest({
105
+ protocol,
106
+ hostname,
107
+ port,
108
+ method: "POST",
109
+ headers,
110
+ path: resolvedPath,
111
+ body,
314
112
  });
315
- }); };
316
- var deserializeAws_restJson1ListHumanLoopsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
317
- var parsedOutput, _a, errorCode, _b, parsedBody;
318
- var _c;
319
- return __generator(this, function (_d) {
320
- switch (_d.label) {
321
- case 0:
322
- _a = [__assign({}, output)];
323
- _c = {};
324
- return [4, parseBody(output.body, context)];
325
- case 1:
326
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
327
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
328
- _b = errorCode;
329
- switch (_b) {
330
- case "InternalServerException": return [3, 2];
331
- case "com.amazonaws.sagemakera2iruntime#InternalServerException": return [3, 2];
332
- case "ResourceNotFoundException": return [3, 4];
333
- case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException": return [3, 4];
334
- case "ThrottlingException": return [3, 6];
335
- case "com.amazonaws.sagemakera2iruntime#ThrottlingException": return [3, 6];
336
- case "ValidationException": return [3, 8];
337
- case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
338
- }
339
- return [3, 10];
340
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
341
- case 3: throw _d.sent();
342
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
343
- case 5: throw _d.sent();
344
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
345
- case 7: throw _d.sent();
346
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
347
- case 9: throw _d.sent();
348
- case 10:
349
- parsedBody = parsedOutput.body;
350
- throwDefaultError({
351
- output: output,
352
- parsedBody: parsedBody,
353
- exceptionCtor: __BaseException,
354
- errorCode: errorCode,
355
- });
356
- _d.label = 11;
357
- case 11: return [2];
358
- }
113
+ };
114
+ export const deserializeAws_restJson1DeleteHumanLoopCommand = async (output, context) => {
115
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
116
+ return deserializeAws_restJson1DeleteHumanLoopCommandError(output, context);
117
+ }
118
+ const contents = map({
119
+ $metadata: deserializeMetadata(output),
359
120
  });
360
- }); };
361
- export var deserializeAws_restJson1StartHumanLoopCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
362
- var contents, data, _a, _b;
363
- return __generator(this, function (_c) {
364
- switch (_c.label) {
365
- case 0:
366
- if (output.statusCode !== 200 && output.statusCode >= 300) {
367
- return [2, deserializeAws_restJson1StartHumanLoopCommandError(output, context)];
368
- }
369
- contents = map({
370
- $metadata: deserializeMetadata(output),
371
- });
372
- _a = __expectNonNull;
373
- _b = __expectObject;
374
- return [4, parseBody(output.body, context)];
375
- case 1:
376
- data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
377
- if (data.HumanLoopArn != null) {
378
- contents.HumanLoopArn = __expectString(data.HumanLoopArn);
379
- }
380
- return [2, contents];
381
- }
121
+ await collectBody(output.body, context);
122
+ return contents;
123
+ };
124
+ const deserializeAws_restJson1DeleteHumanLoopCommandError = async (output, context) => {
125
+ const parsedOutput = {
126
+ ...output,
127
+ body: await parseErrorBody(output.body, context),
128
+ };
129
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
130
+ switch (errorCode) {
131
+ case "InternalServerException":
132
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
133
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
134
+ case "ResourceNotFoundException":
135
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
136
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
137
+ case "ThrottlingException":
138
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
139
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
140
+ case "ValidationException":
141
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
142
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
143
+ default:
144
+ const parsedBody = parsedOutput.body;
145
+ throwDefaultError({
146
+ output,
147
+ parsedBody,
148
+ exceptionCtor: __BaseException,
149
+ errorCode,
150
+ });
151
+ }
152
+ };
153
+ export const deserializeAws_restJson1DescribeHumanLoopCommand = async (output, context) => {
154
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
155
+ return deserializeAws_restJson1DescribeHumanLoopCommandError(output, context);
156
+ }
157
+ const contents = map({
158
+ $metadata: deserializeMetadata(output),
382
159
  });
383
- }); };
384
- var deserializeAws_restJson1StartHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
385
- var parsedOutput, _a, errorCode, _b, parsedBody;
386
- var _c;
387
- return __generator(this, function (_d) {
388
- switch (_d.label) {
389
- case 0:
390
- _a = [__assign({}, output)];
391
- _c = {};
392
- return [4, parseBody(output.body, context)];
393
- case 1:
394
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
395
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
396
- _b = errorCode;
397
- switch (_b) {
398
- case "ConflictException": return [3, 2];
399
- case "com.amazonaws.sagemakera2iruntime#ConflictException": return [3, 2];
400
- case "InternalServerException": return [3, 4];
401
- case "com.amazonaws.sagemakera2iruntime#InternalServerException": return [3, 4];
402
- case "ServiceQuotaExceededException": return [3, 6];
403
- case "com.amazonaws.sagemakera2iruntime#ServiceQuotaExceededException": return [3, 6];
404
- case "ThrottlingException": return [3, 8];
405
- case "com.amazonaws.sagemakera2iruntime#ThrottlingException": return [3, 8];
406
- case "ValidationException": return [3, 10];
407
- case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 10];
408
- }
409
- return [3, 12];
410
- case 2: return [4, deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context)];
411
- case 3: throw _d.sent();
412
- case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
413
- case 5: throw _d.sent();
414
- case 6: return [4, deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)];
415
- case 7: throw _d.sent();
416
- case 8: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
417
- case 9: throw _d.sent();
418
- case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
419
- case 11: throw _d.sent();
420
- case 12:
421
- parsedBody = parsedOutput.body;
422
- throwDefaultError({
423
- output: output,
424
- parsedBody: parsedBody,
425
- exceptionCtor: __BaseException,
426
- errorCode: errorCode,
427
- });
428
- _d.label = 13;
429
- case 13: return [2];
430
- }
160
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
161
+ if (data.CreationTime != null) {
162
+ contents.CreationTime = __expectNonNull(__parseRfc3339DateTime(data.CreationTime));
163
+ }
164
+ if (data.FailureCode != null) {
165
+ contents.FailureCode = __expectString(data.FailureCode);
166
+ }
167
+ if (data.FailureReason != null) {
168
+ contents.FailureReason = __expectString(data.FailureReason);
169
+ }
170
+ if (data.FlowDefinitionArn != null) {
171
+ contents.FlowDefinitionArn = __expectString(data.FlowDefinitionArn);
172
+ }
173
+ if (data.HumanLoopArn != null) {
174
+ contents.HumanLoopArn = __expectString(data.HumanLoopArn);
175
+ }
176
+ if (data.HumanLoopName != null) {
177
+ contents.HumanLoopName = __expectString(data.HumanLoopName);
178
+ }
179
+ if (data.HumanLoopOutput != null) {
180
+ contents.HumanLoopOutput = deserializeAws_restJson1HumanLoopOutput(data.HumanLoopOutput, context);
181
+ }
182
+ if (data.HumanLoopStatus != null) {
183
+ contents.HumanLoopStatus = __expectString(data.HumanLoopStatus);
184
+ }
185
+ return contents;
186
+ };
187
+ const deserializeAws_restJson1DescribeHumanLoopCommandError = async (output, context) => {
188
+ const parsedOutput = {
189
+ ...output,
190
+ body: await parseErrorBody(output.body, context),
191
+ };
192
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
193
+ switch (errorCode) {
194
+ case "InternalServerException":
195
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
196
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
197
+ case "ResourceNotFoundException":
198
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
199
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
200
+ case "ThrottlingException":
201
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
202
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
203
+ case "ValidationException":
204
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
205
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
206
+ default:
207
+ const parsedBody = parsedOutput.body;
208
+ throwDefaultError({
209
+ output,
210
+ parsedBody,
211
+ exceptionCtor: __BaseException,
212
+ errorCode,
213
+ });
214
+ }
215
+ };
216
+ export const deserializeAws_restJson1ListHumanLoopsCommand = async (output, context) => {
217
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
218
+ return deserializeAws_restJson1ListHumanLoopsCommandError(output, context);
219
+ }
220
+ const contents = map({
221
+ $metadata: deserializeMetadata(output),
431
222
  });
432
- }); };
433
- export var deserializeAws_restJson1StopHumanLoopCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
434
- var contents;
435
- return __generator(this, function (_a) {
436
- switch (_a.label) {
437
- case 0:
438
- if (output.statusCode !== 200 && output.statusCode >= 300) {
439
- return [2, deserializeAws_restJson1StopHumanLoopCommandError(output, context)];
440
- }
441
- contents = map({
442
- $metadata: deserializeMetadata(output),
443
- });
444
- return [4, collectBody(output.body, context)];
445
- case 1:
446
- _a.sent();
447
- return [2, contents];
448
- }
223
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
224
+ if (data.HumanLoopSummaries != null) {
225
+ contents.HumanLoopSummaries = deserializeAws_restJson1HumanLoopSummaries(data.HumanLoopSummaries, context);
226
+ }
227
+ if (data.NextToken != null) {
228
+ contents.NextToken = __expectString(data.NextToken);
229
+ }
230
+ return contents;
231
+ };
232
+ const deserializeAws_restJson1ListHumanLoopsCommandError = async (output, context) => {
233
+ const parsedOutput = {
234
+ ...output,
235
+ body: await parseErrorBody(output.body, context),
236
+ };
237
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
238
+ switch (errorCode) {
239
+ case "InternalServerException":
240
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
241
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
242
+ case "ResourceNotFoundException":
243
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
244
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
245
+ case "ThrottlingException":
246
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
247
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
248
+ case "ValidationException":
249
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
250
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
251
+ default:
252
+ const parsedBody = parsedOutput.body;
253
+ throwDefaultError({
254
+ output,
255
+ parsedBody,
256
+ exceptionCtor: __BaseException,
257
+ errorCode,
258
+ });
259
+ }
260
+ };
261
+ export const deserializeAws_restJson1StartHumanLoopCommand = async (output, context) => {
262
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
263
+ return deserializeAws_restJson1StartHumanLoopCommandError(output, context);
264
+ }
265
+ const contents = map({
266
+ $metadata: deserializeMetadata(output),
449
267
  });
450
- }); };
451
- var deserializeAws_restJson1StopHumanLoopCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
452
- var parsedOutput, _a, errorCode, _b, parsedBody;
453
- var _c;
454
- return __generator(this, function (_d) {
455
- switch (_d.label) {
456
- case 0:
457
- _a = [__assign({}, output)];
458
- _c = {};
459
- return [4, parseBody(output.body, context)];
460
- case 1:
461
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
462
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
463
- _b = errorCode;
464
- switch (_b) {
465
- case "InternalServerException": return [3, 2];
466
- case "com.amazonaws.sagemakera2iruntime#InternalServerException": return [3, 2];
467
- case "ResourceNotFoundException": return [3, 4];
468
- case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException": return [3, 4];
469
- case "ThrottlingException": return [3, 6];
470
- case "com.amazonaws.sagemakera2iruntime#ThrottlingException": return [3, 6];
471
- case "ValidationException": return [3, 8];
472
- case "com.amazonaws.sagemakera2iruntime#ValidationException": return [3, 8];
473
- }
474
- return [3, 10];
475
- case 2: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
476
- case 3: throw _d.sent();
477
- case 4: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
478
- case 5: throw _d.sent();
479
- case 6: return [4, deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)];
480
- case 7: throw _d.sent();
481
- case 8: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
482
- case 9: throw _d.sent();
483
- case 10:
484
- parsedBody = parsedOutput.body;
485
- throwDefaultError({
486
- output: output,
487
- parsedBody: parsedBody,
488
- exceptionCtor: __BaseException,
489
- errorCode: errorCode,
490
- });
491
- _d.label = 11;
492
- case 11: return [2];
493
- }
268
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
269
+ if (data.HumanLoopArn != null) {
270
+ contents.HumanLoopArn = __expectString(data.HumanLoopArn);
271
+ }
272
+ return contents;
273
+ };
274
+ const deserializeAws_restJson1StartHumanLoopCommandError = async (output, context) => {
275
+ const parsedOutput = {
276
+ ...output,
277
+ body: await parseErrorBody(output.body, context),
278
+ };
279
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
280
+ switch (errorCode) {
281
+ case "ConflictException":
282
+ case "com.amazonaws.sagemakera2iruntime#ConflictException":
283
+ throw await deserializeAws_restJson1ConflictExceptionResponse(parsedOutput, context);
284
+ case "InternalServerException":
285
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
286
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
287
+ case "ServiceQuotaExceededException":
288
+ case "com.amazonaws.sagemakera2iruntime#ServiceQuotaExceededException":
289
+ throw await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context);
290
+ case "ThrottlingException":
291
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
292
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
293
+ case "ValidationException":
294
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
295
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
296
+ default:
297
+ const parsedBody = parsedOutput.body;
298
+ throwDefaultError({
299
+ output,
300
+ parsedBody,
301
+ exceptionCtor: __BaseException,
302
+ errorCode,
303
+ });
304
+ }
305
+ };
306
+ export const deserializeAws_restJson1StopHumanLoopCommand = async (output, context) => {
307
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
308
+ return deserializeAws_restJson1StopHumanLoopCommandError(output, context);
309
+ }
310
+ const contents = map({
311
+ $metadata: deserializeMetadata(output),
494
312
  });
495
- }); };
496
- var map = __map;
497
- var deserializeAws_restJson1ConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
498
- var contents, data, exception;
499
- return __generator(this, function (_a) {
500
- contents = map({});
501
- data = parsedOutput.body;
502
- if (data.Message != null) {
503
- contents.Message = __expectString(data.Message);
504
- }
505
- exception = new ConflictException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
506
- return [2, __decorateServiceException(exception, parsedOutput.body)];
313
+ await collectBody(output.body, context);
314
+ return contents;
315
+ };
316
+ const deserializeAws_restJson1StopHumanLoopCommandError = async (output, context) => {
317
+ const parsedOutput = {
318
+ ...output,
319
+ body: await parseErrorBody(output.body, context),
320
+ };
321
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
322
+ switch (errorCode) {
323
+ case "InternalServerException":
324
+ case "com.amazonaws.sagemakera2iruntime#InternalServerException":
325
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
326
+ case "ResourceNotFoundException":
327
+ case "com.amazonaws.sagemakera2iruntime#ResourceNotFoundException":
328
+ throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
329
+ case "ThrottlingException":
330
+ case "com.amazonaws.sagemakera2iruntime#ThrottlingException":
331
+ throw await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context);
332
+ case "ValidationException":
333
+ case "com.amazonaws.sagemakera2iruntime#ValidationException":
334
+ throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
335
+ default:
336
+ const parsedBody = parsedOutput.body;
337
+ throwDefaultError({
338
+ output,
339
+ parsedBody,
340
+ exceptionCtor: __BaseException,
341
+ errorCode,
342
+ });
343
+ }
344
+ };
345
+ const map = __map;
346
+ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
347
+ const contents = map({});
348
+ const data = parsedOutput.body;
349
+ if (data.Message != null) {
350
+ contents.Message = __expectString(data.Message);
351
+ }
352
+ const exception = new ConflictException({
353
+ $metadata: deserializeMetadata(parsedOutput),
354
+ ...contents,
507
355
  });
508
- }); };
509
- var deserializeAws_restJson1InternalServerExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
510
- var contents, data, exception;
511
- return __generator(this, function (_a) {
512
- contents = map({});
513
- data = parsedOutput.body;
514
- if (data.Message != null) {
515
- contents.Message = __expectString(data.Message);
516
- }
517
- exception = new InternalServerException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
518
- return [2, __decorateServiceException(exception, parsedOutput.body)];
356
+ return __decorateServiceException(exception, parsedOutput.body);
357
+ };
358
+ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
359
+ const contents = map({});
360
+ const data = parsedOutput.body;
361
+ if (data.Message != null) {
362
+ contents.Message = __expectString(data.Message);
363
+ }
364
+ const exception = new InternalServerException({
365
+ $metadata: deserializeMetadata(parsedOutput),
366
+ ...contents,
519
367
  });
520
- }); };
521
- var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
522
- var contents, data, exception;
523
- return __generator(this, function (_a) {
524
- contents = map({});
525
- data = parsedOutput.body;
526
- if (data.Message != null) {
527
- contents.Message = __expectString(data.Message);
528
- }
529
- exception = new ResourceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
530
- return [2, __decorateServiceException(exception, parsedOutput.body)];
368
+ return __decorateServiceException(exception, parsedOutput.body);
369
+ };
370
+ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
371
+ const contents = map({});
372
+ const data = parsedOutput.body;
373
+ if (data.Message != null) {
374
+ contents.Message = __expectString(data.Message);
375
+ }
376
+ const exception = new ResourceNotFoundException({
377
+ $metadata: deserializeMetadata(parsedOutput),
378
+ ...contents,
531
379
  });
532
- }); };
533
- var deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
534
- var contents, data, exception;
535
- return __generator(this, function (_a) {
536
- contents = map({});
537
- data = parsedOutput.body;
538
- if (data.Message != null) {
539
- contents.Message = __expectString(data.Message);
540
- }
541
- exception = new ServiceQuotaExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
542
- return [2, __decorateServiceException(exception, parsedOutput.body)];
380
+ return __decorateServiceException(exception, parsedOutput.body);
381
+ };
382
+ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
383
+ const contents = map({});
384
+ const data = parsedOutput.body;
385
+ if (data.Message != null) {
386
+ contents.Message = __expectString(data.Message);
387
+ }
388
+ const exception = new ServiceQuotaExceededException({
389
+ $metadata: deserializeMetadata(parsedOutput),
390
+ ...contents,
543
391
  });
544
- }); };
545
- var deserializeAws_restJson1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
546
- var contents, data, exception;
547
- return __generator(this, function (_a) {
548
- contents = map({});
549
- data = parsedOutput.body;
550
- if (data.Message != null) {
551
- contents.Message = __expectString(data.Message);
552
- }
553
- exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
554
- return [2, __decorateServiceException(exception, parsedOutput.body)];
392
+ return __decorateServiceException(exception, parsedOutput.body);
393
+ };
394
+ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
395
+ const contents = map({});
396
+ const data = parsedOutput.body;
397
+ if (data.Message != null) {
398
+ contents.Message = __expectString(data.Message);
399
+ }
400
+ const exception = new ThrottlingException({
401
+ $metadata: deserializeMetadata(parsedOutput),
402
+ ...contents,
555
403
  });
556
- }); };
557
- var deserializeAws_restJson1ValidationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
558
- var contents, data, exception;
559
- return __generator(this, function (_a) {
560
- contents = map({});
561
- data = parsedOutput.body;
562
- if (data.Message != null) {
563
- contents.Message = __expectString(data.Message);
564
- }
565
- exception = new ValidationException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
566
- return [2, __decorateServiceException(exception, parsedOutput.body)];
404
+ return __decorateServiceException(exception, parsedOutput.body);
405
+ };
406
+ const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
407
+ const contents = map({});
408
+ const data = parsedOutput.body;
409
+ if (data.Message != null) {
410
+ contents.Message = __expectString(data.Message);
411
+ }
412
+ const exception = new ValidationException({
413
+ $metadata: deserializeMetadata(parsedOutput),
414
+ ...contents,
567
415
  });
568
- }); };
569
- var serializeAws_restJson1ContentClassifiers = function (input, context) {
416
+ return __decorateServiceException(exception, parsedOutput.body);
417
+ };
418
+ const serializeAws_restJson1ContentClassifiers = (input, context) => {
570
419
  return input
571
- .filter(function (e) { return e != null; })
572
- .map(function (entry) {
420
+ .filter((e) => e != null)
421
+ .map((entry) => {
573
422
  return entry;
574
423
  });
575
424
  };
576
- var serializeAws_restJson1HumanLoopDataAttributes = function (input, context) {
577
- return __assign({}, (input.ContentClassifiers != null && {
578
- ContentClassifiers: serializeAws_restJson1ContentClassifiers(input.ContentClassifiers, context),
579
- }));
425
+ const serializeAws_restJson1HumanLoopDataAttributes = (input, context) => {
426
+ return {
427
+ ...(input.ContentClassifiers != null && {
428
+ ContentClassifiers: serializeAws_restJson1ContentClassifiers(input.ContentClassifiers, context),
429
+ }),
430
+ };
580
431
  };
581
- var serializeAws_restJson1HumanLoopInput = function (input, context) {
582
- return __assign({}, (input.InputContent != null && { InputContent: input.InputContent }));
432
+ const serializeAws_restJson1HumanLoopInput = (input, context) => {
433
+ return {
434
+ ...(input.InputContent != null && { InputContent: input.InputContent }),
435
+ };
583
436
  };
584
- var deserializeAws_restJson1HumanLoopOutput = function (output, context) {
437
+ const deserializeAws_restJson1HumanLoopOutput = (output, context) => {
585
438
  return {
586
439
  OutputS3Uri: __expectString(output.OutputS3Uri),
587
440
  };
588
441
  };
589
- var deserializeAws_restJson1HumanLoopSummaries = function (output, context) {
590
- var retVal = (output || [])
591
- .filter(function (e) { return e != null; })
592
- .map(function (entry) {
442
+ const deserializeAws_restJson1HumanLoopSummaries = (output, context) => {
443
+ const retVal = (output || [])
444
+ .filter((e) => e != null)
445
+ .map((entry) => {
593
446
  if (entry === null) {
594
447
  return null;
595
448
  }
@@ -597,7 +450,7 @@ var deserializeAws_restJson1HumanLoopSummaries = function (output, context) {
597
450
  });
598
451
  return retVal;
599
452
  };
600
- var deserializeAws_restJson1HumanLoopSummary = function (output, context) {
453
+ const deserializeAws_restJson1HumanLoopSummary = (output, context) => {
601
454
  return {
602
455
  CreationTime: output.CreationTime != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationTime)) : undefined,
603
456
  FailureReason: __expectString(output.FailureReason),
@@ -606,44 +459,39 @@ var deserializeAws_restJson1HumanLoopSummary = function (output, context) {
606
459
  HumanLoopStatus: __expectString(output.HumanLoopStatus),
607
460
  };
608
461
  };
609
- var deserializeMetadata = function (output) {
610
- var _a;
611
- return ({
612
- httpStatusCode: output.statusCode,
613
- requestId: (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"],
614
- extendedRequestId: output.headers["x-amz-id-2"],
615
- cfId: output.headers["x-amz-cf-id"],
616
- });
617
- };
618
- var collectBody = function (streamBody, context) {
619
- if (streamBody === void 0) { streamBody = new Uint8Array(); }
462
+ const deserializeMetadata = (output) => ({
463
+ httpStatusCode: output.statusCode,
464
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
465
+ extendedRequestId: output.headers["x-amz-id-2"],
466
+ cfId: output.headers["x-amz-cf-id"],
467
+ });
468
+ const collectBody = (streamBody = new Uint8Array(), context) => {
620
469
  if (streamBody instanceof Uint8Array) {
621
470
  return Promise.resolve(streamBody);
622
471
  }
623
472
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
624
473
  };
625
- var collectBodyString = function (streamBody, context) {
626
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
627
- };
628
- var isSerializableHeaderValue = function (value) {
629
- return value !== undefined &&
630
- value !== null &&
631
- value !== "" &&
632
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
633
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
634
- };
635
- var parseBody = function (streamBody, context) {
636
- return collectBodyString(streamBody, context).then(function (encoded) {
637
- if (encoded.length) {
638
- return JSON.parse(encoded);
639
- }
640
- return {};
641
- });
474
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
475
+ const isSerializableHeaderValue = (value) => value !== undefined &&
476
+ value !== null &&
477
+ value !== "" &&
478
+ (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
479
+ (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
480
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
481
+ if (encoded.length) {
482
+ return JSON.parse(encoded);
483
+ }
484
+ return {};
485
+ });
486
+ const parseErrorBody = async (errorBody, context) => {
487
+ const value = await parseBody(errorBody, context);
488
+ value.message = value.message ?? value.Message;
489
+ return value;
642
490
  };
643
- var loadRestJsonErrorCode = function (output, data) {
644
- var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
645
- var sanitizeErrorCode = function (rawValue) {
646
- var cleanValue = rawValue;
491
+ const loadRestJsonErrorCode = (output, data) => {
492
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
493
+ const sanitizeErrorCode = (rawValue) => {
494
+ let cleanValue = rawValue;
647
495
  if (typeof cleanValue === "number") {
648
496
  cleanValue = cleanValue.toString();
649
497
  }
@@ -658,7 +506,7 @@ var loadRestJsonErrorCode = function (output, data) {
658
506
  }
659
507
  return cleanValue;
660
508
  };
661
- var headerKey = findKey(output.headers, "x-amzn-errortype");
509
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
662
510
  if (headerKey !== undefined) {
663
511
  return sanitizeErrorCode(output.headers[headerKey]);
664
512
  }