@aws-sdk/client-sagemaker-a2i-runtime 3.183.0 → 3.185.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.
- package/CHANGELOG.md +11 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2 -2
- package/dist-es/SageMakerA2IRuntime.js +29 -22
- package/dist-es/SageMakerA2IRuntimeClient.js +28 -22
- package/dist-es/commands/DeleteHumanLoopCommand.js +28 -21
- package/dist-es/commands/DescribeHumanLoopCommand.js +28 -21
- package/dist-es/commands/ListHumanLoopsCommand.js +28 -21
- package/dist-es/commands/StartHumanLoopCommand.js +28 -21
- package/dist-es/commands/StopHumanLoopCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/SageMakerA2IRuntimeServiceException.js +10 -5
- package/dist-es/models/models_0.js +87 -114
- package/dist-es/pagination/ListHumanLoopsPaginator.js +68 -25
- package/dist-es/protocols/Aws_restJson1.js +606 -441
- package/dist-es/runtimeConfig.browser.js +12 -26
- package/dist-es/runtimeConfig.js +12 -30
- package/dist-es/runtimeConfig.native.js +5 -8
- package/dist-es/runtimeConfig.shared.js +11 -8
- package/package.json +5 -5
|
@@ -1,448 +1,595 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
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";
|
|
3
4
|
import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
4
5
|
import { SageMakerA2IRuntimeServiceException as __BaseException } from "../models/SageMakerA2IRuntimeServiceException";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
}
|
|
19
26
|
});
|
|
20
|
-
};
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
+
}
|
|
35
48
|
});
|
|
36
|
-
};
|
|
37
|
-
export
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
+
}
|
|
54
84
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
}
|
|
65
112
|
});
|
|
66
|
-
};
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
}
|
|
83
136
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
+
}
|
|
92
154
|
});
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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, parseErrorBody(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
|
+
}
|
|
103
199
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
+
}
|
|
112
243
|
});
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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, parseErrorBody(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
|
+
}
|
|
120
288
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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),
|
|
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
|
+
}
|
|
159
314
|
});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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),
|
|
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, parseErrorBody(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
|
+
}
|
|
222
359
|
});
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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),
|
|
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
|
+
}
|
|
267
382
|
});
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
return
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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, parseErrorBody(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
|
+
}
|
|
312
431
|
});
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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,
|
|
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
|
+
}
|
|
355
449
|
});
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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, parseErrorBody(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
|
+
}
|
|
367
494
|
});
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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)];
|
|
379
507
|
});
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
390
|
-
|
|
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)];
|
|
391
519
|
});
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
402
|
-
|
|
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)];
|
|
403
531
|
});
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
414
|
-
|
|
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)];
|
|
415
543
|
});
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
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)];
|
|
555
|
+
});
|
|
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)];
|
|
567
|
+
});
|
|
568
|
+
}); };
|
|
569
|
+
var serializeAws_restJson1ContentClassifiers = function (input, context) {
|
|
419
570
|
return input
|
|
420
|
-
.filter((e)
|
|
421
|
-
.map((entry)
|
|
571
|
+
.filter(function (e) { return e != null; })
|
|
572
|
+
.map(function (entry) {
|
|
422
573
|
return entry;
|
|
423
574
|
});
|
|
424
575
|
};
|
|
425
|
-
|
|
426
|
-
return {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}),
|
|
430
|
-
};
|
|
576
|
+
var serializeAws_restJson1HumanLoopDataAttributes = function (input, context) {
|
|
577
|
+
return __assign({}, (input.ContentClassifiers != null && {
|
|
578
|
+
ContentClassifiers: serializeAws_restJson1ContentClassifiers(input.ContentClassifiers, context),
|
|
579
|
+
}));
|
|
431
580
|
};
|
|
432
|
-
|
|
433
|
-
return {
|
|
434
|
-
...(input.InputContent != null && { InputContent: input.InputContent }),
|
|
435
|
-
};
|
|
581
|
+
var serializeAws_restJson1HumanLoopInput = function (input, context) {
|
|
582
|
+
return __assign({}, (input.InputContent != null && { InputContent: input.InputContent }));
|
|
436
583
|
};
|
|
437
|
-
|
|
584
|
+
var deserializeAws_restJson1HumanLoopOutput = function (output, context) {
|
|
438
585
|
return {
|
|
439
586
|
OutputS3Uri: __expectString(output.OutputS3Uri),
|
|
440
587
|
};
|
|
441
588
|
};
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
.filter((e)
|
|
445
|
-
.map((entry)
|
|
589
|
+
var deserializeAws_restJson1HumanLoopSummaries = function (output, context) {
|
|
590
|
+
var retVal = (output || [])
|
|
591
|
+
.filter(function (e) { return e != null; })
|
|
592
|
+
.map(function (entry) {
|
|
446
593
|
if (entry === null) {
|
|
447
594
|
return null;
|
|
448
595
|
}
|
|
@@ -450,7 +597,7 @@ const deserializeAws_restJson1HumanLoopSummaries = (output, context) => {
|
|
|
450
597
|
});
|
|
451
598
|
return retVal;
|
|
452
599
|
};
|
|
453
|
-
|
|
600
|
+
var deserializeAws_restJson1HumanLoopSummary = function (output, context) {
|
|
454
601
|
return {
|
|
455
602
|
CreationTime: output.CreationTime != null ? __expectNonNull(__parseRfc3339DateTime(output.CreationTime)) : undefined,
|
|
456
603
|
FailureReason: __expectString(output.FailureReason),
|
|
@@ -459,39 +606,57 @@ const deserializeAws_restJson1HumanLoopSummary = (output, context) => {
|
|
|
459
606
|
HumanLoopStatus: __expectString(output.HumanLoopStatus),
|
|
460
607
|
};
|
|
461
608
|
};
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
609
|
+
var deserializeMetadata = function (output) {
|
|
610
|
+
var _a, _b;
|
|
611
|
+
return ({
|
|
612
|
+
httpStatusCode: output.statusCode,
|
|
613
|
+
requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
|
|
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(); }
|
|
469
620
|
if (streamBody instanceof Uint8Array) {
|
|
470
621
|
return Promise.resolve(streamBody);
|
|
471
622
|
}
|
|
472
623
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
473
624
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
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;
|
|
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);
|
|
490
634
|
};
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
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
|
+
});
|
|
642
|
+
};
|
|
643
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
644
|
+
var value;
|
|
645
|
+
var _a;
|
|
646
|
+
return __generator(this, function (_b) {
|
|
647
|
+
switch (_b.label) {
|
|
648
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
649
|
+
case 1:
|
|
650
|
+
value = _b.sent();
|
|
651
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
652
|
+
return [2, value];
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
}); };
|
|
656
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
657
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
658
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
659
|
+
var cleanValue = rawValue;
|
|
495
660
|
if (typeof cleanValue === "number") {
|
|
496
661
|
cleanValue = cleanValue.toString();
|
|
497
662
|
}
|
|
@@ -506,7 +671,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
506
671
|
}
|
|
507
672
|
return cleanValue;
|
|
508
673
|
};
|
|
509
|
-
|
|
674
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
510
675
|
if (headerKey !== undefined) {
|
|
511
676
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
512
677
|
}
|