@aws-sdk/client-sagemaker-runtime 3.183.0 → 3.186.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 +19 -0
- package/dist-cjs/protocols/Aws_restJson1.js +2 -2
- package/dist-es/SageMakerRuntime.js +17 -10
- package/dist-es/SageMakerRuntimeClient.js +28 -22
- package/dist-es/commands/InvokeEndpointAsyncCommand.js +28 -21
- package/dist-es/commands/InvokeEndpointCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/SageMakerRuntimeServiceException.js +10 -5
- package/dist-es/models/models_0.js +80 -92
- package/dist-es/protocols/Aws_restJson1.js +323 -241
- 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 +33 -33
|
@@ -1,266 +1,348 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { InternalDependencyException, InternalFailure, ModelError, ModelNotReadyException, ServiceUnavailable, ValidationError, } from "../models/models_0";
|
|
4
5
|
import { SageMakerRuntimeServiceException as __BaseException } from "../models/SageMakerRuntimeServiceException";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
export var serializeAws_restJson1InvokeEndpointCommand = 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 = map({}, isSerializableHeaderValue, {
|
|
14
|
+
"content-type": input.ContentType || "application/octet-stream",
|
|
15
|
+
accept: input.Accept,
|
|
16
|
+
"x-amzn-sagemaker-custom-attributes": input.CustomAttributes,
|
|
17
|
+
"x-amzn-sagemaker-target-model": input.TargetModel,
|
|
18
|
+
"x-amzn-sagemaker-target-variant": input.TargetVariant,
|
|
19
|
+
"x-amzn-sagemaker-target-container-hostname": input.TargetContainerHostname,
|
|
20
|
+
"x-amzn-sagemaker-inference-id": input.InferenceId,
|
|
21
|
+
"x-amzn-sagemaker-enable-explanations": input.EnableExplanations,
|
|
22
|
+
});
|
|
23
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/endpoints/{EndpointName}/invocations";
|
|
24
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "EndpointName", function () { return input.EndpointName; }, "{EndpointName}", false);
|
|
25
|
+
if (input.Body !== undefined) {
|
|
26
|
+
body = input.Body;
|
|
27
|
+
}
|
|
28
|
+
return [2, new __HttpRequest({
|
|
29
|
+
protocol: protocol,
|
|
30
|
+
hostname: hostname,
|
|
31
|
+
port: port,
|
|
32
|
+
method: "POST",
|
|
33
|
+
headers: headers,
|
|
34
|
+
path: resolvedPath,
|
|
35
|
+
body: body,
|
|
36
|
+
})];
|
|
37
|
+
}
|
|
16
38
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
}); };
|
|
40
|
+
export var serializeAws_restJson1InvokeEndpointAsyncCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
41
|
+
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
42
|
+
return __generator(this, function (_c) {
|
|
43
|
+
switch (_c.label) {
|
|
44
|
+
case 0: return [4, context.endpoint()];
|
|
45
|
+
case 1:
|
|
46
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
47
|
+
headers = map({}, isSerializableHeaderValue, {
|
|
48
|
+
"x-amzn-sagemaker-content-type": input.ContentType,
|
|
49
|
+
"x-amzn-sagemaker-accept": input.Accept,
|
|
50
|
+
"x-amzn-sagemaker-custom-attributes": input.CustomAttributes,
|
|
51
|
+
"x-amzn-sagemaker-inference-id": input.InferenceId,
|
|
52
|
+
"x-amzn-sagemaker-inputlocation": input.InputLocation,
|
|
53
|
+
"x-amzn-sagemaker-requestttlseconds": [
|
|
54
|
+
function () { return isSerializableHeaderValue(input.RequestTTLSeconds); },
|
|
55
|
+
function () { return input.RequestTTLSeconds.toString(); },
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") +
|
|
59
|
+
"/endpoints/{EndpointName}/async-invocations";
|
|
60
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "EndpointName", function () { return input.EndpointName; }, "{EndpointName}", false);
|
|
61
|
+
return [2, new __HttpRequest({
|
|
62
|
+
protocol: protocol,
|
|
63
|
+
hostname: hostname,
|
|
64
|
+
port: port,
|
|
65
|
+
method: "POST",
|
|
66
|
+
headers: headers,
|
|
67
|
+
path: resolvedPath,
|
|
68
|
+
body: body,
|
|
69
|
+
})];
|
|
70
|
+
}
|
|
31
71
|
});
|
|
32
|
-
};
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
}); };
|
|
73
|
+
export var deserializeAws_restJson1InvokeEndpointCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
+
var contents, data;
|
|
75
|
+
return __generator(this, function (_a) {
|
|
76
|
+
switch (_a.label) {
|
|
77
|
+
case 0:
|
|
78
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
79
|
+
return [2, deserializeAws_restJson1InvokeEndpointCommandError(output, context)];
|
|
80
|
+
}
|
|
81
|
+
contents = map({
|
|
82
|
+
$metadata: deserializeMetadata(output),
|
|
83
|
+
ContentType: [, output.headers["content-type"]],
|
|
84
|
+
InvokedProductionVariant: [, output.headers["x-amzn-invoked-production-variant"]],
|
|
85
|
+
CustomAttributes: [, output.headers["x-amzn-sagemaker-custom-attributes"]],
|
|
86
|
+
});
|
|
87
|
+
return [4, collectBody(output.body, context)];
|
|
88
|
+
case 1:
|
|
89
|
+
data = _a.sent();
|
|
90
|
+
contents.Body = data;
|
|
91
|
+
return [2, contents];
|
|
92
|
+
}
|
|
45
93
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
94
|
+
}); };
|
|
95
|
+
var deserializeAws_restJson1InvokeEndpointCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
96
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
97
|
+
var _c;
|
|
98
|
+
return __generator(this, function (_d) {
|
|
99
|
+
switch (_d.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
_a = [__assign({}, output)];
|
|
102
|
+
_c = {};
|
|
103
|
+
return [4, parseErrorBody(output.body, context)];
|
|
104
|
+
case 1:
|
|
105
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
106
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
107
|
+
_b = errorCode;
|
|
108
|
+
switch (_b) {
|
|
109
|
+
case "InternalDependencyException": return [3, 2];
|
|
110
|
+
case "com.amazonaws.sagemakerruntime#InternalDependencyException": return [3, 2];
|
|
111
|
+
case "InternalFailure": return [3, 4];
|
|
112
|
+
case "com.amazonaws.sagemakerruntime#InternalFailure": return [3, 4];
|
|
113
|
+
case "ModelError": return [3, 6];
|
|
114
|
+
case "com.amazonaws.sagemakerruntime#ModelError": return [3, 6];
|
|
115
|
+
case "ModelNotReadyException": return [3, 8];
|
|
116
|
+
case "com.amazonaws.sagemakerruntime#ModelNotReadyException": return [3, 8];
|
|
117
|
+
case "ServiceUnavailable": return [3, 10];
|
|
118
|
+
case "com.amazonaws.sagemakerruntime#ServiceUnavailable": return [3, 10];
|
|
119
|
+
case "ValidationError": return [3, 12];
|
|
120
|
+
case "com.amazonaws.sagemakerruntime#ValidationError": return [3, 12];
|
|
121
|
+
}
|
|
122
|
+
return [3, 14];
|
|
123
|
+
case 2: return [4, deserializeAws_restJson1InternalDependencyExceptionResponse(parsedOutput, context)];
|
|
124
|
+
case 3: throw _d.sent();
|
|
125
|
+
case 4: return [4, deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)];
|
|
126
|
+
case 5: throw _d.sent();
|
|
127
|
+
case 6: return [4, deserializeAws_restJson1ModelErrorResponse(parsedOutput, context)];
|
|
128
|
+
case 7: throw _d.sent();
|
|
129
|
+
case 8: return [4, deserializeAws_restJson1ModelNotReadyExceptionResponse(parsedOutput, context)];
|
|
130
|
+
case 9: throw _d.sent();
|
|
131
|
+
case 10: return [4, deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)];
|
|
132
|
+
case 11: throw _d.sent();
|
|
133
|
+
case 12: return [4, deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)];
|
|
134
|
+
case 13: throw _d.sent();
|
|
135
|
+
case 14:
|
|
136
|
+
parsedBody = parsedOutput.body;
|
|
137
|
+
throwDefaultError({
|
|
138
|
+
output: output,
|
|
139
|
+
parsedBody: parsedBody,
|
|
140
|
+
exceptionCtor: __BaseException,
|
|
141
|
+
errorCode: errorCode,
|
|
142
|
+
});
|
|
143
|
+
_d.label = 15;
|
|
144
|
+
case 15: return [2];
|
|
145
|
+
}
|
|
58
146
|
});
|
|
59
|
-
};
|
|
60
|
-
export
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
147
|
+
}); };
|
|
148
|
+
export var deserializeAws_restJson1InvokeEndpointAsyncCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
+
var contents, data, _a, _b;
|
|
150
|
+
return __generator(this, function (_c) {
|
|
151
|
+
switch (_c.label) {
|
|
152
|
+
case 0:
|
|
153
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
154
|
+
return [2, deserializeAws_restJson1InvokeEndpointAsyncCommandError(output, context)];
|
|
155
|
+
}
|
|
156
|
+
contents = map({
|
|
157
|
+
$metadata: deserializeMetadata(output),
|
|
158
|
+
OutputLocation: [, output.headers["x-amzn-sagemaker-outputlocation"]],
|
|
159
|
+
});
|
|
160
|
+
_a = __expectNonNull;
|
|
161
|
+
_b = __expectObject;
|
|
162
|
+
return [4, parseBody(output.body, context)];
|
|
163
|
+
case 1:
|
|
164
|
+
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
165
|
+
if (data.InferenceId != null) {
|
|
166
|
+
contents.InferenceId = __expectString(data.InferenceId);
|
|
167
|
+
}
|
|
168
|
+
return [2, contents];
|
|
169
|
+
}
|
|
69
170
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
throw
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
111
|
-
return deserializeAws_restJson1InvokeEndpointAsyncCommandError(output, context);
|
|
112
|
-
}
|
|
113
|
-
const contents = map({
|
|
114
|
-
$metadata: deserializeMetadata(output),
|
|
115
|
-
OutputLocation: [, output.headers["x-amzn-sagemaker-outputlocation"]],
|
|
171
|
+
}); };
|
|
172
|
+
var deserializeAws_restJson1InvokeEndpointAsyncCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
173
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
174
|
+
var _c;
|
|
175
|
+
return __generator(this, function (_d) {
|
|
176
|
+
switch (_d.label) {
|
|
177
|
+
case 0:
|
|
178
|
+
_a = [__assign({}, output)];
|
|
179
|
+
_c = {};
|
|
180
|
+
return [4, parseErrorBody(output.body, context)];
|
|
181
|
+
case 1:
|
|
182
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
183
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
184
|
+
_b = errorCode;
|
|
185
|
+
switch (_b) {
|
|
186
|
+
case "InternalFailure": return [3, 2];
|
|
187
|
+
case "com.amazonaws.sagemakerruntime#InternalFailure": return [3, 2];
|
|
188
|
+
case "ServiceUnavailable": return [3, 4];
|
|
189
|
+
case "com.amazonaws.sagemakerruntime#ServiceUnavailable": return [3, 4];
|
|
190
|
+
case "ValidationError": return [3, 6];
|
|
191
|
+
case "com.amazonaws.sagemakerruntime#ValidationError": return [3, 6];
|
|
192
|
+
}
|
|
193
|
+
return [3, 8];
|
|
194
|
+
case 2: return [4, deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)];
|
|
195
|
+
case 3: throw _d.sent();
|
|
196
|
+
case 4: return [4, deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)];
|
|
197
|
+
case 5: throw _d.sent();
|
|
198
|
+
case 6: return [4, deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)];
|
|
199
|
+
case 7: throw _d.sent();
|
|
200
|
+
case 8:
|
|
201
|
+
parsedBody = parsedOutput.body;
|
|
202
|
+
throwDefaultError({
|
|
203
|
+
output: output,
|
|
204
|
+
parsedBody: parsedBody,
|
|
205
|
+
exceptionCtor: __BaseException,
|
|
206
|
+
errorCode: errorCode,
|
|
207
|
+
});
|
|
208
|
+
_d.label = 9;
|
|
209
|
+
case 9: return [2];
|
|
210
|
+
}
|
|
116
211
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
switch (errorCode) {
|
|
130
|
-
case "InternalFailure":
|
|
131
|
-
case "com.amazonaws.sagemakerruntime#InternalFailure":
|
|
132
|
-
throw await deserializeAws_restJson1InternalFailureResponse(parsedOutput, context);
|
|
133
|
-
case "ServiceUnavailable":
|
|
134
|
-
case "com.amazonaws.sagemakerruntime#ServiceUnavailable":
|
|
135
|
-
throw await deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context);
|
|
136
|
-
case "ValidationError":
|
|
137
|
-
case "com.amazonaws.sagemakerruntime#ValidationError":
|
|
138
|
-
throw await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context);
|
|
139
|
-
default:
|
|
140
|
-
const parsedBody = parsedOutput.body;
|
|
141
|
-
throwDefaultError({
|
|
142
|
-
output,
|
|
143
|
-
parsedBody,
|
|
144
|
-
exceptionCtor: __BaseException,
|
|
145
|
-
errorCode,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
const map = __map;
|
|
150
|
-
const deserializeAws_restJson1InternalDependencyExceptionResponse = async (parsedOutput, context) => {
|
|
151
|
-
const contents = map({});
|
|
152
|
-
const data = parsedOutput.body;
|
|
153
|
-
if (data.Message != null) {
|
|
154
|
-
contents.Message = __expectString(data.Message);
|
|
155
|
-
}
|
|
156
|
-
const exception = new InternalDependencyException({
|
|
157
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
158
|
-
...contents,
|
|
212
|
+
}); };
|
|
213
|
+
var map = __map;
|
|
214
|
+
var deserializeAws_restJson1InternalDependencyExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
215
|
+
var contents, data, exception;
|
|
216
|
+
return __generator(this, function (_a) {
|
|
217
|
+
contents = map({});
|
|
218
|
+
data = parsedOutput.body;
|
|
219
|
+
if (data.Message != null) {
|
|
220
|
+
contents.Message = __expectString(data.Message);
|
|
221
|
+
}
|
|
222
|
+
exception = new InternalDependencyException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
223
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
159
224
|
});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
170
|
-
|
|
225
|
+
}); };
|
|
226
|
+
var deserializeAws_restJson1InternalFailureResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
227
|
+
var contents, data, exception;
|
|
228
|
+
return __generator(this, function (_a) {
|
|
229
|
+
contents = map({});
|
|
230
|
+
data = parsedOutput.body;
|
|
231
|
+
if (data.Message != null) {
|
|
232
|
+
contents.Message = __expectString(data.Message);
|
|
233
|
+
}
|
|
234
|
+
exception = new InternalFailure(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
235
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
171
236
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
191
|
-
|
|
237
|
+
}); };
|
|
238
|
+
var deserializeAws_restJson1ModelErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
239
|
+
var contents, data, exception;
|
|
240
|
+
return __generator(this, function (_a) {
|
|
241
|
+
contents = map({});
|
|
242
|
+
data = parsedOutput.body;
|
|
243
|
+
if (data.LogStreamArn != null) {
|
|
244
|
+
contents.LogStreamArn = __expectString(data.LogStreamArn);
|
|
245
|
+
}
|
|
246
|
+
if (data.Message != null) {
|
|
247
|
+
contents.Message = __expectString(data.Message);
|
|
248
|
+
}
|
|
249
|
+
if (data.OriginalMessage != null) {
|
|
250
|
+
contents.OriginalMessage = __expectString(data.OriginalMessage);
|
|
251
|
+
}
|
|
252
|
+
if (data.OriginalStatusCode != null) {
|
|
253
|
+
contents.OriginalStatusCode = __expectInt32(data.OriginalStatusCode);
|
|
254
|
+
}
|
|
255
|
+
exception = new ModelError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
256
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
192
257
|
});
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
203
|
-
|
|
258
|
+
}); };
|
|
259
|
+
var deserializeAws_restJson1ModelNotReadyExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
260
|
+
var contents, data, exception;
|
|
261
|
+
return __generator(this, function (_a) {
|
|
262
|
+
contents = map({});
|
|
263
|
+
data = parsedOutput.body;
|
|
264
|
+
if (data.Message != null) {
|
|
265
|
+
contents.Message = __expectString(data.Message);
|
|
266
|
+
}
|
|
267
|
+
exception = new ModelNotReadyException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
268
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
204
269
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
215
|
-
|
|
270
|
+
}); };
|
|
271
|
+
var deserializeAws_restJson1ServiceUnavailableResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
272
|
+
var contents, data, exception;
|
|
273
|
+
return __generator(this, function (_a) {
|
|
274
|
+
contents = map({});
|
|
275
|
+
data = parsedOutput.body;
|
|
276
|
+
if (data.Message != null) {
|
|
277
|
+
contents.Message = __expectString(data.Message);
|
|
278
|
+
}
|
|
279
|
+
exception = new ServiceUnavailable(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
280
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
216
281
|
});
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
227
|
-
|
|
282
|
+
}); };
|
|
283
|
+
var deserializeAws_restJson1ValidationErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
284
|
+
var contents, data, exception;
|
|
285
|
+
return __generator(this, function (_a) {
|
|
286
|
+
contents = map({});
|
|
287
|
+
data = parsedOutput.body;
|
|
288
|
+
if (data.Message != null) {
|
|
289
|
+
contents.Message = __expectString(data.Message);
|
|
290
|
+
}
|
|
291
|
+
exception = new ValidationError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
|
|
292
|
+
return [2, __decorateServiceException(exception, parsedOutput.body)];
|
|
293
|
+
});
|
|
294
|
+
}); };
|
|
295
|
+
var deserializeMetadata = function (output) {
|
|
296
|
+
var _a, _b;
|
|
297
|
+
return ({
|
|
298
|
+
httpStatusCode: output.statusCode,
|
|
299
|
+
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"],
|
|
300
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
301
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
228
302
|
});
|
|
229
|
-
return __decorateServiceException(exception, parsedOutput.body);
|
|
230
303
|
};
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
234
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
235
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
236
|
-
});
|
|
237
|
-
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
304
|
+
var collectBody = function (streamBody, context) {
|
|
305
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
238
306
|
if (streamBody instanceof Uint8Array) {
|
|
239
307
|
return Promise.resolve(streamBody);
|
|
240
308
|
}
|
|
241
309
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
242
310
|
};
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
value !== null &&
|
|
246
|
-
value !== "" &&
|
|
247
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
248
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
249
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
250
|
-
if (encoded.length) {
|
|
251
|
-
return JSON.parse(encoded);
|
|
252
|
-
}
|
|
253
|
-
return {};
|
|
254
|
-
});
|
|
255
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
256
|
-
const value = await parseBody(errorBody, context);
|
|
257
|
-
value.message = value.message ?? value.Message;
|
|
258
|
-
return value;
|
|
311
|
+
var collectBodyString = function (streamBody, context) {
|
|
312
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
259
313
|
};
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
314
|
+
var isSerializableHeaderValue = function (value) {
|
|
315
|
+
return value !== undefined &&
|
|
316
|
+
value !== null &&
|
|
317
|
+
value !== "" &&
|
|
318
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
319
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
320
|
+
};
|
|
321
|
+
var parseBody = function (streamBody, context) {
|
|
322
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
323
|
+
if (encoded.length) {
|
|
324
|
+
return JSON.parse(encoded);
|
|
325
|
+
}
|
|
326
|
+
return {};
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
330
|
+
var value;
|
|
331
|
+
var _a;
|
|
332
|
+
return __generator(this, function (_b) {
|
|
333
|
+
switch (_b.label) {
|
|
334
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
335
|
+
case 1:
|
|
336
|
+
value = _b.sent();
|
|
337
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
338
|
+
return [2, value];
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}); };
|
|
342
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
343
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
344
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
345
|
+
var cleanValue = rawValue;
|
|
264
346
|
if (typeof cleanValue === "number") {
|
|
265
347
|
cleanValue = cleanValue.toString();
|
|
266
348
|
}
|
|
@@ -275,7 +357,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
275
357
|
}
|
|
276
358
|
return cleanValue;
|
|
277
359
|
};
|
|
278
|
-
|
|
360
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
279
361
|
if (headerKey !== undefined) {
|
|
280
362
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
281
363
|
}
|