@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.
@@ -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 var serializeAws_restJson1BatchGetRecordCommand = 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
- "content-type": "application/json",
15
- };
16
- resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/BatchGetRecord";
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
- export var serializeAws_restJson1DeleteRecordCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
33
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
34
- return __generator(this, function (_c) {
35
- switch (_c.label) {
36
- case 0: return [4, context.endpoint()];
37
- case 1:
38
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
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 var serializeAws_restJson1GetRecordCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
60
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
61
- return __generator(this, function (_c) {
62
- switch (_c.label) {
63
- case 0: return [4, context.endpoint()];
64
- case 1:
65
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
66
- headers = {};
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
- export var serializeAws_restJson1PutRecordCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
90
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
91
- return __generator(this, function (_c) {
92
- switch (_c.label) {
93
- case 0: return [4, context.endpoint()];
94
- case 1:
95
- _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
96
- headers = {
97
- "content-type": "application/json",
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 var deserializeAws_restJson1BatchGetRecordCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
115
- var contents, data, _a, _b;
116
- return __generator(this, function (_c) {
117
- switch (_c.label) {
118
- case 0:
119
- if (output.statusCode !== 200 && output.statusCode >= 300) {
120
- return [2, deserializeAws_restJson1BatchGetRecordCommandError(output, context)];
121
- }
122
- contents = map({
123
- $metadata: deserializeMetadata(output),
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
- var deserializeAws_restJson1BatchGetRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
144
- var parsedOutput, _a, errorCode, _b, parsedBody;
145
- var _c;
146
- return __generator(this, function (_d) {
147
- switch (_d.label) {
148
- case 0:
149
- _a = [__assign({}, output)];
150
- _c = {};
151
- return [4, parseErrorBody(output.body, context)];
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 var deserializeAws_restJson1DeleteRecordCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
189
- var contents;
190
- return __generator(this, function (_a) {
191
- switch (_a.label) {
192
- case 0:
193
- if (output.statusCode !== 200 && output.statusCode >= 300) {
194
- return [2, deserializeAws_restJson1DeleteRecordCommandError(output, context)];
195
- }
196
- contents = map({
197
- $metadata: deserializeMetadata(output),
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
- var deserializeAws_restJson1DeleteRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
207
- var parsedOutput, _a, errorCode, _b, parsedBody;
208
- var _c;
209
- return __generator(this, function (_d) {
210
- switch (_d.label) {
211
- case 0:
212
- _a = [__assign({}, output)];
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 var deserializeAws_restJson1GetRecordCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
252
- var contents, data, _a, _b;
253
- return __generator(this, function (_c) {
254
- switch (_c.label) {
255
- case 0:
256
- if (output.statusCode !== 200 && output.statusCode >= 300) {
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
- var deserializeAws_restJson1GetRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
275
- var parsedOutput, _a, errorCode, _b, parsedBody;
276
- var _c;
277
- return __generator(this, function (_d) {
278
- switch (_d.label) {
279
- case 0:
280
- _a = [__assign({}, output)];
281
- _c = {};
282
- return [4, parseErrorBody(output.body, context)];
283
- case 1:
284
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
285
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
286
- _b = errorCode;
287
- switch (_b) {
288
- case "AccessForbidden": return [3, 2];
289
- case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden": return [3, 2];
290
- case "InternalFailure": return [3, 4];
291
- case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure": return [3, 4];
292
- case "ResourceNotFound": return [3, 6];
293
- case "com.amazonaws.sagemakerfeaturestoreruntime#ResourceNotFound": return [3, 6];
294
- case "ServiceUnavailable": return [3, 8];
295
- case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable": return [3, 8];
296
- case "ValidationError": return [3, 10];
297
- case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError": return [3, 10];
298
- }
299
- return [3, 12];
300
- case 2: return [4, deserializeAws_restJson1AccessForbiddenResponse(parsedOutput, context)];
301
- case 3: throw _d.sent();
302
- case 4: return [4, deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)];
303
- case 5: throw _d.sent();
304
- case 6: return [4, deserializeAws_restJson1ResourceNotFoundResponse(parsedOutput, context)];
305
- case 7: throw _d.sent();
306
- case 8: return [4, deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)];
307
- case 9: throw _d.sent();
308
- case 10: return [4, deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)];
309
- case 11: throw _d.sent();
310
- case 12:
311
- parsedBody = parsedOutput.body;
312
- throwDefaultError({
313
- output: output,
314
- parsedBody: parsedBody,
315
- exceptionCtor: __BaseException,
316
- errorCode: errorCode,
317
- });
318
- _d.label = 13;
319
- case 13: return [2];
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
- export var deserializeAws_restJson1PutRecordCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
324
- var contents;
325
- return __generator(this, function (_a) {
326
- switch (_a.label) {
327
- case 0:
328
- if (output.statusCode !== 200 && output.statusCode >= 300) {
329
- return [2, deserializeAws_restJson1PutRecordCommandError(output, context)];
330
- }
331
- contents = map({
332
- $metadata: deserializeMetadata(output),
333
- });
334
- return [4, collectBody(output.body, context)];
335
- case 1:
336
- _a.sent();
337
- return [2, contents];
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
- var deserializeAws_restJson1PutRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
342
- var parsedOutput, _a, errorCode, _b, parsedBody;
343
- var _c;
344
- return __generator(this, function (_d) {
345
- switch (_d.label) {
346
- case 0:
347
- _a = [__assign({}, output)];
348
- _c = {};
349
- return [4, parseErrorBody(output.body, context)];
350
- case 1:
351
- parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
352
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
353
- _b = errorCode;
354
- switch (_b) {
355
- case "AccessForbidden": return [3, 2];
356
- case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden": return [3, 2];
357
- case "InternalFailure": return [3, 4];
358
- case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure": return [3, 4];
359
- case "ServiceUnavailable": return [3, 6];
360
- case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable": return [3, 6];
361
- case "ValidationError": return [3, 8];
362
- case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError": return [3, 8];
363
- }
364
- return [3, 10];
365
- case 2: return [4, deserializeAws_restJson1AccessForbiddenResponse(parsedOutput, context)];
366
- case 3: throw _d.sent();
367
- case 4: return [4, deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)];
368
- case 5: throw _d.sent();
369
- case 6: return [4, deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)];
370
- case 7: throw _d.sent();
371
- case 8: return [4, deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)];
372
- case 9: throw _d.sent();
373
- case 10:
374
- parsedBody = parsedOutput.body;
375
- throwDefaultError({
376
- output: output,
377
- parsedBody: parsedBody,
378
- exceptionCtor: __BaseException,
379
- errorCode: errorCode,
380
- });
381
- _d.label = 11;
382
- case 11: return [2];
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
- var map = __map;
387
- var deserializeAws_restJson1AccessForbiddenResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
388
- var contents, data, exception;
389
- return __generator(this, function (_a) {
390
- contents = map({});
391
- data = parsedOutput.body;
392
- if (data.Message != null) {
393
- contents.Message = __expectString(data.Message);
394
- }
395
- exception = new AccessForbidden(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
396
- return [2, __decorateServiceException(exception, parsedOutput.body)];
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
- var deserializeAws_restJson1InternalFailureResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
400
- var contents, data, exception;
401
- return __generator(this, function (_a) {
402
- contents = map({});
403
- data = parsedOutput.body;
404
- if (data.Message != null) {
405
- contents.Message = __expectString(data.Message);
406
- }
407
- exception = new InternalFailure(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
408
- return [2, __decorateServiceException(exception, parsedOutput.body)];
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
- var deserializeAws_restJson1ResourceNotFoundResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
412
- var contents, data, exception;
413
- return __generator(this, function (_a) {
414
- contents = map({});
415
- data = parsedOutput.body;
416
- if (data.Message != null) {
417
- contents.Message = __expectString(data.Message);
418
- }
419
- exception = new ResourceNotFound(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
420
- return [2, __decorateServiceException(exception, parsedOutput.body)];
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
- var deserializeAws_restJson1ServiceUnavailableResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
424
- var contents, data, exception;
425
- return __generator(this, function (_a) {
426
- contents = map({});
427
- data = parsedOutput.body;
428
- if (data.Message != null) {
429
- contents.Message = __expectString(data.Message);
430
- }
431
- exception = new ServiceUnavailable(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
432
- return [2, __decorateServiceException(exception, parsedOutput.body)];
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
- var deserializeAws_restJson1ValidationErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
436
- var contents, data, exception;
437
- return __generator(this, function (_a) {
438
- contents = map({});
439
- data = parsedOutput.body;
440
- if (data.Message != null) {
441
- contents.Message = __expectString(data.Message);
442
- }
443
- exception = new ValidationError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
444
- return [2, __decorateServiceException(exception, parsedOutput.body)];
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
- var serializeAws_restJson1BatchGetRecordIdentifier = function (input, context) {
448
- return __assign(__assign(__assign({}, (input.FeatureGroupName != null && { FeatureGroupName: input.FeatureGroupName })), (input.FeatureNames != null && {
449
- FeatureNames: serializeAws_restJson1FeatureNames(input.FeatureNames, context),
450
- })), (input.RecordIdentifiersValueAsString != null && {
451
- RecordIdentifiersValueAsString: serializeAws_restJson1RecordIdentifiers(input.RecordIdentifiersValueAsString, context),
452
- }));
453
- };
454
- var serializeAws_restJson1BatchGetRecordIdentifiers = function (input, context) {
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(function (e) { return e != null; })
457
- .map(function (entry) {
338
+ .filter((e) => e != null)
339
+ .map((entry) => {
458
340
  return serializeAws_restJson1BatchGetRecordIdentifier(entry, context);
459
341
  });
460
342
  };
461
- var serializeAws_restJson1FeatureNames = function (input, context) {
343
+ const serializeAws_restJson1FeatureNames = (input, context) => {
462
344
  return input
463
- .filter(function (e) { return e != null; })
464
- .map(function (entry) {
345
+ .filter((e) => e != null)
346
+ .map((entry) => {
465
347
  return entry;
466
348
  });
467
349
  };
468
- var serializeAws_restJson1FeatureValue = function (input, context) {
469
- return __assign(__assign({}, (input.FeatureName != null && { FeatureName: input.FeatureName })), (input.ValueAsString != null && { ValueAsString: input.ValueAsString }));
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
- var serializeAws_restJson1Record = function (input, context) {
356
+ const serializeAws_restJson1Record = (input, context) => {
472
357
  return input
473
- .filter(function (e) { return e != null; })
474
- .map(function (entry) {
358
+ .filter((e) => e != null)
359
+ .map((entry) => {
475
360
  return serializeAws_restJson1FeatureValue(entry, context);
476
361
  });
477
362
  };
478
- var serializeAws_restJson1RecordIdentifiers = function (input, context) {
363
+ const serializeAws_restJson1RecordIdentifiers = (input, context) => {
479
364
  return input
480
- .filter(function (e) { return e != null; })
481
- .map(function (entry) {
365
+ .filter((e) => e != null)
366
+ .map((entry) => {
482
367
  return entry;
483
368
  });
484
369
  };
485
- var deserializeAws_restJson1BatchGetRecordError = function (output, context) {
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
- var deserializeAws_restJson1BatchGetRecordErrors = function (output, context) {
494
- var retVal = (output || [])
495
- .filter(function (e) { return e != null; })
496
- .map(function (entry) {
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
- var deserializeAws_restJson1BatchGetRecordIdentifier = function (output, context) {
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
- var deserializeAws_restJson1BatchGetRecordResultDetail = function (output, context) {
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
- var deserializeAws_restJson1BatchGetRecordResultDetails = function (output, context) {
521
- var retVal = (output || [])
522
- .filter(function (e) { return e != null; })
523
- .map(function (entry) {
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
- var deserializeAws_restJson1FeatureNames = function (output, context) {
532
- var retVal = (output || [])
533
- .filter(function (e) { return e != null; })
534
- .map(function (entry) {
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
- var deserializeAws_restJson1FeatureValue = function (output, context) {
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
- var deserializeAws_restJson1Record = function (output, context) {
549
- var retVal = (output || [])
550
- .filter(function (e) { return e != null; })
551
- .map(function (entry) {
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
- var deserializeAws_restJson1RecordIdentifiers = function (output, context) {
560
- var retVal = (output || [])
561
- .filter(function (e) { return e != null; })
562
- .map(function (entry) {
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
- var deserializeAws_restJson1UnprocessedIdentifiers = function (output, context) {
571
- var retVal = (output || [])
572
- .filter(function (e) { return e != null; })
573
- .map(function (entry) {
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
- var deserializeMetadata = function (output) {
582
- var _a, _b;
583
- return ({
584
- httpStatusCode: output.statusCode,
585
- 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"],
586
- extendedRequestId: output.headers["x-amz-id-2"],
587
- cfId: output.headers["x-amz-cf-id"],
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
- var collectBodyString = function (streamBody, context) {
598
- return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
599
- };
600
- var isSerializableHeaderValue = function (value) {
601
- return value !== undefined &&
602
- value !== null &&
603
- value !== "" &&
604
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
605
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
606
- };
607
- var parseBody = function (streamBody, context) {
608
- return collectBodyString(streamBody, context).then(function (encoded) {
609
- if (encoded.length) {
610
- return JSON.parse(encoded);
611
- }
612
- return {};
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
- var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
616
- var value;
617
- var _a;
618
- return __generator(this, function (_b) {
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
- var headerKey = findKey(output.headers, "x-amzn-errortype");
513
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
647
514
  if (headerKey !== undefined) {
648
515
  return sanitizeErrorCode(output.headers[headerKey]);
649
516
  }