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