@aws-sdk/client-sagemaker-featurestore-runtime 3.141.0 → 3.142.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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **codegen:** general data mapping function ([#3830](https://github.com/aws/aws-sdk-js-v3/issues/3830)) ([9417eae](https://github.com/aws/aws-sdk-js-v3/commit/9417eae722806799fb4c15c07921574268c1165c))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.141.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.140.0...v3.141.0) (2022-08-01)
7
18
 
8
19
 
@@ -32,22 +32,11 @@ const serializeAws_restJson1DeleteRecordCommand = async (input, context) => {
32
32
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
33
33
  const headers = {};
34
34
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/FeatureGroup/{FeatureGroupName}";
35
- if (input.FeatureGroupName !== undefined) {
36
- const labelValue = input.FeatureGroupName;
37
- if (labelValue.length <= 0) {
38
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
39
- }
40
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
41
- }
42
- else {
43
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
44
- }
45
- const query = {
46
- ...(input.RecordIdentifierValueAsString !== undefined && {
47
- RecordIdentifierValueAsString: input.RecordIdentifierValueAsString,
48
- }),
49
- ...(input.EventTime !== undefined && { EventTime: input.EventTime }),
50
- };
35
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FeatureGroupName", () => input.FeatureGroupName, "{FeatureGroupName}", false);
36
+ const query = map({
37
+ RecordIdentifierValueAsString: [, input.RecordIdentifierValueAsString],
38
+ EventTime: [, input.EventTime],
39
+ });
51
40
  let body;
52
41
  return new protocol_http_1.HttpRequest({
53
42
  protocol,
@@ -65,22 +54,14 @@ const serializeAws_restJson1GetRecordCommand = async (input, context) => {
65
54
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
66
55
  const headers = {};
67
56
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/FeatureGroup/{FeatureGroupName}";
68
- if (input.FeatureGroupName !== undefined) {
69
- const labelValue = input.FeatureGroupName;
70
- if (labelValue.length <= 0) {
71
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
72
- }
73
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
74
- }
75
- else {
76
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
77
- }
78
- const query = {
79
- ...(input.RecordIdentifierValueAsString !== undefined && {
80
- RecordIdentifierValueAsString: input.RecordIdentifierValueAsString,
81
- }),
82
- ...(input.FeatureNames !== undefined && { FeatureName: (input.FeatureNames || []).map((_entry) => _entry) }),
83
- };
57
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FeatureGroupName", () => input.FeatureGroupName, "{FeatureGroupName}", false);
58
+ const query = map({
59
+ RecordIdentifierValueAsString: [, input.RecordIdentifierValueAsString],
60
+ FeatureName: [
61
+ () => input.FeatureNames !== void 0,
62
+ () => (input.FeatureNames || []).map((_entry) => _entry),
63
+ ],
64
+ });
84
65
  let body;
85
66
  return new protocol_http_1.HttpRequest({
86
67
  protocol,
@@ -100,16 +81,7 @@ const serializeAws_restJson1PutRecordCommand = async (input, context) => {
100
81
  "content-type": "application/json",
101
82
  };
102
83
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/FeatureGroup/{FeatureGroupName}";
103
- if (input.FeatureGroupName !== undefined) {
104
- const labelValue = input.FeatureGroupName;
105
- if (labelValue.length <= 0) {
106
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
107
- }
108
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
109
- }
110
- else {
111
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
112
- }
84
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "FeatureGroupName", () => input.FeatureGroupName, "{FeatureGroupName}", false);
113
85
  let body;
114
86
  body = JSON.stringify({
115
87
  ...(input.Record != null && { Record: serializeAws_restJson1Record(input.Record, context) }),
@@ -129,23 +101,20 @@ const deserializeAws_restJson1BatchGetRecordCommand = async (output, context) =>
129
101
  if (output.statusCode !== 200 && output.statusCode >= 300) {
130
102
  return deserializeAws_restJson1BatchGetRecordCommandError(output, context);
131
103
  }
132
- const contents = {
104
+ const contents = map({
133
105
  $metadata: deserializeMetadata(output),
134
- Errors: undefined,
135
- Records: undefined,
136
- UnprocessedIdentifiers: undefined,
137
- };
106
+ });
138
107
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
139
- if (data.Errors !== undefined && data.Errors !== null) {
108
+ if (data.Errors != null) {
140
109
  contents.Errors = deserializeAws_restJson1BatchGetRecordErrors(data.Errors, context);
141
110
  }
142
- if (data.Records !== undefined && data.Records !== null) {
111
+ if (data.Records != null) {
143
112
  contents.Records = deserializeAws_restJson1BatchGetRecordResultDetails(data.Records, context);
144
113
  }
145
- if (data.UnprocessedIdentifiers !== undefined && data.UnprocessedIdentifiers !== null) {
114
+ if (data.UnprocessedIdentifiers != null) {
146
115
  contents.UnprocessedIdentifiers = deserializeAws_restJson1UnprocessedIdentifiers(data.UnprocessedIdentifiers, context);
147
116
  }
148
- return Promise.resolve(contents);
117
+ return contents;
149
118
  };
150
119
  exports.deserializeAws_restJson1BatchGetRecordCommand = deserializeAws_restJson1BatchGetRecordCommand;
151
120
  const deserializeAws_restJson1BatchGetRecordCommandError = async (output, context) => {
@@ -153,7 +122,6 @@ const deserializeAws_restJson1BatchGetRecordCommandError = async (output, contex
153
122
  ...output,
154
123
  body: await parseBody(output.body, context),
155
124
  };
156
- let response;
157
125
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
158
126
  switch (errorCode) {
159
127
  case "AccessForbidden":
@@ -170,25 +138,23 @@ const deserializeAws_restJson1BatchGetRecordCommandError = async (output, contex
170
138
  throw await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context);
171
139
  default:
172
140
  const parsedBody = parsedOutput.body;
173
- const $metadata = deserializeMetadata(output);
174
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
175
- response = new SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException({
176
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
177
- $fault: "client",
178
- $metadata,
141
+ (0, smithy_client_1.throwDefaultError)({
142
+ output,
143
+ parsedBody,
144
+ exceptionCtor: SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException,
145
+ errorCode,
179
146
  });
180
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
181
147
  }
182
148
  };
183
149
  const deserializeAws_restJson1DeleteRecordCommand = async (output, context) => {
184
150
  if (output.statusCode !== 200 && output.statusCode >= 300) {
185
151
  return deserializeAws_restJson1DeleteRecordCommandError(output, context);
186
152
  }
187
- const contents = {
153
+ const contents = map({
188
154
  $metadata: deserializeMetadata(output),
189
- };
155
+ });
190
156
  await collectBody(output.body, context);
191
- return Promise.resolve(contents);
157
+ return contents;
192
158
  };
193
159
  exports.deserializeAws_restJson1DeleteRecordCommand = deserializeAws_restJson1DeleteRecordCommand;
194
160
  const deserializeAws_restJson1DeleteRecordCommandError = async (output, context) => {
@@ -196,7 +162,6 @@ const deserializeAws_restJson1DeleteRecordCommandError = async (output, context)
196
162
  ...output,
197
163
  body: await parseBody(output.body, context),
198
164
  };
199
- let response;
200
165
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
201
166
  switch (errorCode) {
202
167
  case "AccessForbidden":
@@ -213,29 +178,26 @@ const deserializeAws_restJson1DeleteRecordCommandError = async (output, context)
213
178
  throw await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context);
214
179
  default:
215
180
  const parsedBody = parsedOutput.body;
216
- const $metadata = deserializeMetadata(output);
217
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
218
- response = new SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException({
219
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
220
- $fault: "client",
221
- $metadata,
181
+ (0, smithy_client_1.throwDefaultError)({
182
+ output,
183
+ parsedBody,
184
+ exceptionCtor: SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException,
185
+ errorCode,
222
186
  });
223
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
224
187
  }
225
188
  };
226
189
  const deserializeAws_restJson1GetRecordCommand = async (output, context) => {
227
190
  if (output.statusCode !== 200 && output.statusCode >= 300) {
228
191
  return deserializeAws_restJson1GetRecordCommandError(output, context);
229
192
  }
230
- const contents = {
193
+ const contents = map({
231
194
  $metadata: deserializeMetadata(output),
232
- Record: undefined,
233
- };
195
+ });
234
196
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
235
- if (data.Record !== undefined && data.Record !== null) {
197
+ if (data.Record != null) {
236
198
  contents.Record = deserializeAws_restJson1Record(data.Record, context);
237
199
  }
238
- return Promise.resolve(contents);
200
+ return contents;
239
201
  };
240
202
  exports.deserializeAws_restJson1GetRecordCommand = deserializeAws_restJson1GetRecordCommand;
241
203
  const deserializeAws_restJson1GetRecordCommandError = async (output, context) => {
@@ -243,7 +205,6 @@ const deserializeAws_restJson1GetRecordCommandError = async (output, context) =>
243
205
  ...output,
244
206
  body: await parseBody(output.body, context),
245
207
  };
246
- let response;
247
208
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
248
209
  switch (errorCode) {
249
210
  case "AccessForbidden":
@@ -263,25 +224,23 @@ const deserializeAws_restJson1GetRecordCommandError = async (output, context) =>
263
224
  throw await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context);
264
225
  default:
265
226
  const parsedBody = parsedOutput.body;
266
- const $metadata = deserializeMetadata(output);
267
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
268
- response = new SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException({
269
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
270
- $fault: "client",
271
- $metadata,
227
+ (0, smithy_client_1.throwDefaultError)({
228
+ output,
229
+ parsedBody,
230
+ exceptionCtor: SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException,
231
+ errorCode,
272
232
  });
273
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
274
233
  }
275
234
  };
276
235
  const deserializeAws_restJson1PutRecordCommand = async (output, context) => {
277
236
  if (output.statusCode !== 200 && output.statusCode >= 300) {
278
237
  return deserializeAws_restJson1PutRecordCommandError(output, context);
279
238
  }
280
- const contents = {
239
+ const contents = map({
281
240
  $metadata: deserializeMetadata(output),
282
- };
241
+ });
283
242
  await collectBody(output.body, context);
284
- return Promise.resolve(contents);
243
+ return contents;
285
244
  };
286
245
  exports.deserializeAws_restJson1PutRecordCommand = deserializeAws_restJson1PutRecordCommand;
287
246
  const deserializeAws_restJson1PutRecordCommandError = async (output, context) => {
@@ -289,7 +248,6 @@ const deserializeAws_restJson1PutRecordCommandError = async (output, context) =>
289
248
  ...output,
290
249
  body: await parseBody(output.body, context),
291
250
  };
292
- let response;
293
251
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
294
252
  switch (errorCode) {
295
253
  case "AccessForbidden":
@@ -306,20 +264,19 @@ const deserializeAws_restJson1PutRecordCommandError = async (output, context) =>
306
264
  throw await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context);
307
265
  default:
308
266
  const parsedBody = parsedOutput.body;
309
- const $metadata = deserializeMetadata(output);
310
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
311
- response = new SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException({
312
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
313
- $fault: "client",
314
- $metadata,
267
+ (0, smithy_client_1.throwDefaultError)({
268
+ output,
269
+ parsedBody,
270
+ exceptionCtor: SageMakerFeatureStoreRuntimeServiceException_1.SageMakerFeatureStoreRuntimeServiceException,
271
+ errorCode,
315
272
  });
316
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
317
273
  }
318
274
  };
275
+ const map = smithy_client_1.map;
319
276
  const deserializeAws_restJson1AccessForbiddenResponse = async (parsedOutput, context) => {
320
- const contents = {};
277
+ const contents = map({});
321
278
  const data = parsedOutput.body;
322
- if (data.Message !== undefined && data.Message !== null) {
279
+ if (data.Message != null) {
323
280
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
324
281
  }
325
282
  const exception = new models_0_1.AccessForbidden({
@@ -329,9 +286,9 @@ const deserializeAws_restJson1AccessForbiddenResponse = async (parsedOutput, con
329
286
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
330
287
  };
331
288
  const deserializeAws_restJson1InternalFailureResponse = async (parsedOutput, context) => {
332
- const contents = {};
289
+ const contents = map({});
333
290
  const data = parsedOutput.body;
334
- if (data.Message !== undefined && data.Message !== null) {
291
+ if (data.Message != null) {
335
292
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
336
293
  }
337
294
  const exception = new models_0_1.InternalFailure({
@@ -341,9 +298,9 @@ const deserializeAws_restJson1InternalFailureResponse = async (parsedOutput, con
341
298
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
342
299
  };
343
300
  const deserializeAws_restJson1ResourceNotFoundResponse = async (parsedOutput, context) => {
344
- const contents = {};
301
+ const contents = map({});
345
302
  const data = parsedOutput.body;
346
- if (data.Message !== undefined && data.Message !== null) {
303
+ if (data.Message != null) {
347
304
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
348
305
  }
349
306
  const exception = new models_0_1.ResourceNotFound({
@@ -353,9 +310,9 @@ const deserializeAws_restJson1ResourceNotFoundResponse = async (parsedOutput, co
353
310
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
354
311
  };
355
312
  const deserializeAws_restJson1ServiceUnavailableResponse = async (parsedOutput, context) => {
356
- const contents = {};
313
+ const contents = map({});
357
314
  const data = parsedOutput.body;
358
- if (data.Message !== undefined && data.Message !== null) {
315
+ if (data.Message != null) {
359
316
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
360
317
  }
361
318
  const exception = new models_0_1.ServiceUnavailable({
@@ -365,9 +322,9 @@ const deserializeAws_restJson1ServiceUnavailableResponse = async (parsedOutput,
365
322
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
366
323
  };
367
324
  const deserializeAws_restJson1ValidationErrorResponse = async (parsedOutput, context) => {
368
- const contents = {};
325
+ const contents = map({});
369
326
  const data = parsedOutput.body;
370
- if (data.Message !== undefined && data.Message !== null) {
327
+ if (data.Message != null) {
371
328
  contents.Message = (0, smithy_client_1.expectString)(data.Message);
372
329
  }
373
330
  const exception = new models_0_1.ValidationError({
@@ -391,9 +348,6 @@ const serializeAws_restJson1BatchGetRecordIdentifiers = (input, context) => {
391
348
  return input
392
349
  .filter((e) => e != null)
393
350
  .map((entry) => {
394
- if (entry === null) {
395
- return null;
396
- }
397
351
  return serializeAws_restJson1BatchGetRecordIdentifier(entry, context);
398
352
  });
399
353
  };
@@ -401,9 +355,6 @@ const serializeAws_restJson1FeatureNames = (input, context) => {
401
355
  return input
402
356
  .filter((e) => e != null)
403
357
  .map((entry) => {
404
- if (entry === null) {
405
- return null;
406
- }
407
358
  return entry;
408
359
  });
409
360
  };
@@ -417,9 +368,6 @@ const serializeAws_restJson1Record = (input, context) => {
417
368
  return input
418
369
  .filter((e) => e != null)
419
370
  .map((entry) => {
420
- if (entry === null) {
421
- return null;
422
- }
423
371
  return serializeAws_restJson1FeatureValue(entry, context);
424
372
  });
425
373
  };
@@ -427,9 +375,6 @@ const serializeAws_restJson1RecordIdentifiers = (input, context) => {
427
375
  return input
428
376
  .filter((e) => e != null)
429
377
  .map((entry) => {
430
- if (entry === null) {
431
- return null;
432
- }
433
378
  return entry;
434
379
  });
435
380
  };
@@ -1,6 +1,6 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, } from "@aws-sdk/smithy-client";
3
+ 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
4
  import { AccessForbidden, InternalFailure, ResourceNotFound, ServiceUnavailable, ValidationError, } from "../models/models_0";
5
5
  import { SageMakerFeatureStoreRuntimeServiceException as __BaseException } from "../models/SageMakerFeatureStoreRuntimeServiceException";
6
6
  export var serializeAws_restJson1BatchGetRecordCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
@@ -30,7 +30,7 @@ export var serializeAws_restJson1BatchGetRecordCommand = function (input, contex
30
30
  });
31
31
  }); };
32
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, labelValue, query, body;
33
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
34
34
  return __generator(this, function (_c) {
35
35
  switch (_c.label) {
36
36
  case 0: return [4, context.endpoint()];
@@ -38,19 +38,11 @@ export var serializeAws_restJson1DeleteRecordCommand = function (input, context)
38
38
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
39
39
  headers = {};
40
40
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/FeatureGroup/{FeatureGroupName}";
41
- if (input.FeatureGroupName !== undefined) {
42
- labelValue = input.FeatureGroupName;
43
- if (labelValue.length <= 0) {
44
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
45
- }
46
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", __extendedEncodeURIComponent(labelValue));
47
- }
48
- else {
49
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
50
- }
51
- query = __assign(__assign({}, (input.RecordIdentifierValueAsString !== undefined && {
52
- RecordIdentifierValueAsString: input.RecordIdentifierValueAsString,
53
- })), (input.EventTime !== undefined && { EventTime: input.EventTime }));
41
+ resolvedPath = __resolvedPath(resolvedPath, input, "FeatureGroupName", function () { return input.FeatureGroupName; }, "{FeatureGroupName}", false);
42
+ query = map({
43
+ RecordIdentifierValueAsString: [, input.RecordIdentifierValueAsString],
44
+ EventTime: [, input.EventTime],
45
+ });
54
46
  return [2, new __HttpRequest({
55
47
  protocol: protocol,
56
48
  hostname: hostname,
@@ -65,7 +57,7 @@ export var serializeAws_restJson1DeleteRecordCommand = function (input, context)
65
57
  });
66
58
  }); };
67
59
  export var serializeAws_restJson1GetRecordCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
68
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, query, body;
60
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, query, body;
69
61
  return __generator(this, function (_c) {
70
62
  switch (_c.label) {
71
63
  case 0: return [4, context.endpoint()];
@@ -73,19 +65,14 @@ export var serializeAws_restJson1GetRecordCommand = function (input, context) {
73
65
  _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
74
66
  headers = {};
75
67
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/FeatureGroup/{FeatureGroupName}";
76
- if (input.FeatureGroupName !== undefined) {
77
- labelValue = input.FeatureGroupName;
78
- if (labelValue.length <= 0) {
79
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
80
- }
81
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", __extendedEncodeURIComponent(labelValue));
82
- }
83
- else {
84
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
85
- }
86
- query = __assign(__assign({}, (input.RecordIdentifierValueAsString !== undefined && {
87
- RecordIdentifierValueAsString: input.RecordIdentifierValueAsString,
88
- })), (input.FeatureNames !== undefined && { FeatureName: (input.FeatureNames || []).map(function (_entry) { return _entry; }) }));
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
+ });
89
76
  return [2, new __HttpRequest({
90
77
  protocol: protocol,
91
78
  hostname: hostname,
@@ -100,7 +87,7 @@ export var serializeAws_restJson1GetRecordCommand = function (input, context) {
100
87
  });
101
88
  }); };
102
89
  export var serializeAws_restJson1PutRecordCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
103
- var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, labelValue, body;
90
+ var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
104
91
  return __generator(this, function (_c) {
105
92
  switch (_c.label) {
106
93
  case 0: return [4, context.endpoint()];
@@ -110,16 +97,7 @@ export var serializeAws_restJson1PutRecordCommand = function (input, context) {
110
97
  "content-type": "application/json",
111
98
  };
112
99
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/FeatureGroup/{FeatureGroupName}";
113
- if (input.FeatureGroupName !== undefined) {
114
- labelValue = input.FeatureGroupName;
115
- if (labelValue.length <= 0) {
116
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
117
- }
118
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", __extendedEncodeURIComponent(labelValue));
119
- }
120
- else {
121
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
122
- }
100
+ resolvedPath = __resolvedPath(resolvedPath, input, "FeatureGroupName", function () { return input.FeatureGroupName; }, "{FeatureGroupName}", false);
123
101
  body = JSON.stringify(__assign({}, (input.Record != null && { Record: serializeAws_restJson1Record(input.Record, context) })));
124
102
  return [2, new __HttpRequest({
125
103
  protocol: protocol,
@@ -141,32 +119,29 @@ export var deserializeAws_restJson1BatchGetRecordCommand = function (output, con
141
119
  if (output.statusCode !== 200 && output.statusCode >= 300) {
142
120
  return [2, deserializeAws_restJson1BatchGetRecordCommandError(output, context)];
143
121
  }
144
- contents = {
122
+ contents = map({
145
123
  $metadata: deserializeMetadata(output),
146
- Errors: undefined,
147
- Records: undefined,
148
- UnprocessedIdentifiers: undefined,
149
- };
124
+ });
150
125
  _a = __expectNonNull;
151
126
  _b = __expectObject;
152
127
  return [4, parseBody(output.body, context)];
153
128
  case 1:
154
129
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
155
- if (data.Errors !== undefined && data.Errors !== null) {
130
+ if (data.Errors != null) {
156
131
  contents.Errors = deserializeAws_restJson1BatchGetRecordErrors(data.Errors, context);
157
132
  }
158
- if (data.Records !== undefined && data.Records !== null) {
133
+ if (data.Records != null) {
159
134
  contents.Records = deserializeAws_restJson1BatchGetRecordResultDetails(data.Records, context);
160
135
  }
161
- if (data.UnprocessedIdentifiers !== undefined && data.UnprocessedIdentifiers !== null) {
136
+ if (data.UnprocessedIdentifiers != null) {
162
137
  contents.UnprocessedIdentifiers = deserializeAws_restJson1UnprocessedIdentifiers(data.UnprocessedIdentifiers, context);
163
138
  }
164
- return [2, Promise.resolve(contents)];
139
+ return [2, contents];
165
140
  }
166
141
  });
167
142
  }); };
168
143
  var deserializeAws_restJson1BatchGetRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
169
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
144
+ var parsedOutput, _a, errorCode, _b, parsedBody;
170
145
  var _c;
171
146
  return __generator(this, function (_d) {
172
147
  switch (_d.label) {
@@ -199,14 +174,14 @@ var deserializeAws_restJson1BatchGetRecordCommandError = function (output, conte
199
174
  case 9: throw _d.sent();
200
175
  case 10:
201
176
  parsedBody = parsedOutput.body;
202
- $metadata = deserializeMetadata(output);
203
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
204
- response = new __BaseException({
205
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
206
- $fault: "client",
207
- $metadata: $metadata,
177
+ throwDefaultError({
178
+ output: output,
179
+ parsedBody: parsedBody,
180
+ exceptionCtor: __BaseException,
181
+ errorCode: errorCode,
208
182
  });
209
- throw __decorateServiceException(response, parsedBody);
183
+ _d.label = 11;
184
+ case 11: return [2];
210
185
  }
211
186
  });
212
187
  }); };
@@ -218,18 +193,18 @@ export var deserializeAws_restJson1DeleteRecordCommand = function (output, conte
218
193
  if (output.statusCode !== 200 && output.statusCode >= 300) {
219
194
  return [2, deserializeAws_restJson1DeleteRecordCommandError(output, context)];
220
195
  }
221
- contents = {
196
+ contents = map({
222
197
  $metadata: deserializeMetadata(output),
223
- };
198
+ });
224
199
  return [4, collectBody(output.body, context)];
225
200
  case 1:
226
201
  _a.sent();
227
- return [2, Promise.resolve(contents)];
202
+ return [2, contents];
228
203
  }
229
204
  });
230
205
  }); };
231
206
  var deserializeAws_restJson1DeleteRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
232
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
207
+ var parsedOutput, _a, errorCode, _b, parsedBody;
233
208
  var _c;
234
209
  return __generator(this, function (_d) {
235
210
  switch (_d.label) {
@@ -262,14 +237,14 @@ var deserializeAws_restJson1DeleteRecordCommandError = function (output, context
262
237
  case 9: throw _d.sent();
263
238
  case 10:
264
239
  parsedBody = parsedOutput.body;
265
- $metadata = deserializeMetadata(output);
266
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
267
- response = new __BaseException({
268
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
269
- $fault: "client",
270
- $metadata: $metadata,
240
+ throwDefaultError({
241
+ output: output,
242
+ parsedBody: parsedBody,
243
+ exceptionCtor: __BaseException,
244
+ errorCode: errorCode,
271
245
  });
272
- throw __decorateServiceException(response, parsedBody);
246
+ _d.label = 11;
247
+ case 11: return [2];
273
248
  }
274
249
  });
275
250
  }); };
@@ -281,24 +256,23 @@ export var deserializeAws_restJson1GetRecordCommand = function (output, context)
281
256
  if (output.statusCode !== 200 && output.statusCode >= 300) {
282
257
  return [2, deserializeAws_restJson1GetRecordCommandError(output, context)];
283
258
  }
284
- contents = {
259
+ contents = map({
285
260
  $metadata: deserializeMetadata(output),
286
- Record: undefined,
287
- };
261
+ });
288
262
  _a = __expectNonNull;
289
263
  _b = __expectObject;
290
264
  return [4, parseBody(output.body, context)];
291
265
  case 1:
292
266
  data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
293
- if (data.Record !== undefined && data.Record !== null) {
267
+ if (data.Record != null) {
294
268
  contents.Record = deserializeAws_restJson1Record(data.Record, context);
295
269
  }
296
- return [2, Promise.resolve(contents)];
270
+ return [2, contents];
297
271
  }
298
272
  });
299
273
  }); };
300
274
  var deserializeAws_restJson1GetRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
301
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
275
+ var parsedOutput, _a, errorCode, _b, parsedBody;
302
276
  var _c;
303
277
  return __generator(this, function (_d) {
304
278
  switch (_d.label) {
@@ -335,14 +309,14 @@ var deserializeAws_restJson1GetRecordCommandError = function (output, context) {
335
309
  case 11: throw _d.sent();
336
310
  case 12:
337
311
  parsedBody = parsedOutput.body;
338
- $metadata = deserializeMetadata(output);
339
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
340
- response = new __BaseException({
341
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
342
- $fault: "client",
343
- $metadata: $metadata,
312
+ throwDefaultError({
313
+ output: output,
314
+ parsedBody: parsedBody,
315
+ exceptionCtor: __BaseException,
316
+ errorCode: errorCode,
344
317
  });
345
- throw __decorateServiceException(response, parsedBody);
318
+ _d.label = 13;
319
+ case 13: return [2];
346
320
  }
347
321
  });
348
322
  }); };
@@ -354,18 +328,18 @@ export var deserializeAws_restJson1PutRecordCommand = function (output, context)
354
328
  if (output.statusCode !== 200 && output.statusCode >= 300) {
355
329
  return [2, deserializeAws_restJson1PutRecordCommandError(output, context)];
356
330
  }
357
- contents = {
331
+ contents = map({
358
332
  $metadata: deserializeMetadata(output),
359
- };
333
+ });
360
334
  return [4, collectBody(output.body, context)];
361
335
  case 1:
362
336
  _a.sent();
363
- return [2, Promise.resolve(contents)];
337
+ return [2, contents];
364
338
  }
365
339
  });
366
340
  }); };
367
341
  var deserializeAws_restJson1PutRecordCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
368
- var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
342
+ var parsedOutput, _a, errorCode, _b, parsedBody;
369
343
  var _c;
370
344
  return __generator(this, function (_d) {
371
345
  switch (_d.label) {
@@ -398,23 +372,24 @@ var deserializeAws_restJson1PutRecordCommandError = function (output, context) {
398
372
  case 9: throw _d.sent();
399
373
  case 10:
400
374
  parsedBody = parsedOutput.body;
401
- $metadata = deserializeMetadata(output);
402
- statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
403
- response = new __BaseException({
404
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
405
- $fault: "client",
406
- $metadata: $metadata,
375
+ throwDefaultError({
376
+ output: output,
377
+ parsedBody: parsedBody,
378
+ exceptionCtor: __BaseException,
379
+ errorCode: errorCode,
407
380
  });
408
- throw __decorateServiceException(response, parsedBody);
381
+ _d.label = 11;
382
+ case 11: return [2];
409
383
  }
410
384
  });
411
385
  }); };
386
+ var map = __map;
412
387
  var deserializeAws_restJson1AccessForbiddenResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
413
388
  var contents, data, exception;
414
389
  return __generator(this, function (_a) {
415
- contents = {};
390
+ contents = map({});
416
391
  data = parsedOutput.body;
417
- if (data.Message !== undefined && data.Message !== null) {
392
+ if (data.Message != null) {
418
393
  contents.Message = __expectString(data.Message);
419
394
  }
420
395
  exception = new AccessForbidden(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -424,9 +399,9 @@ var deserializeAws_restJson1AccessForbiddenResponse = function (parsedOutput, co
424
399
  var deserializeAws_restJson1InternalFailureResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
425
400
  var contents, data, exception;
426
401
  return __generator(this, function (_a) {
427
- contents = {};
402
+ contents = map({});
428
403
  data = parsedOutput.body;
429
- if (data.Message !== undefined && data.Message !== null) {
404
+ if (data.Message != null) {
430
405
  contents.Message = __expectString(data.Message);
431
406
  }
432
407
  exception = new InternalFailure(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -436,9 +411,9 @@ var deserializeAws_restJson1InternalFailureResponse = function (parsedOutput, co
436
411
  var deserializeAws_restJson1ResourceNotFoundResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
437
412
  var contents, data, exception;
438
413
  return __generator(this, function (_a) {
439
- contents = {};
414
+ contents = map({});
440
415
  data = parsedOutput.body;
441
- if (data.Message !== undefined && data.Message !== null) {
416
+ if (data.Message != null) {
442
417
  contents.Message = __expectString(data.Message);
443
418
  }
444
419
  exception = new ResourceNotFound(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -448,9 +423,9 @@ var deserializeAws_restJson1ResourceNotFoundResponse = function (parsedOutput, c
448
423
  var deserializeAws_restJson1ServiceUnavailableResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
449
424
  var contents, data, exception;
450
425
  return __generator(this, function (_a) {
451
- contents = {};
426
+ contents = map({});
452
427
  data = parsedOutput.body;
453
- if (data.Message !== undefined && data.Message !== null) {
428
+ if (data.Message != null) {
454
429
  contents.Message = __expectString(data.Message);
455
430
  }
456
431
  exception = new ServiceUnavailable(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -460,9 +435,9 @@ var deserializeAws_restJson1ServiceUnavailableResponse = function (parsedOutput,
460
435
  var deserializeAws_restJson1ValidationErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
461
436
  var contents, data, exception;
462
437
  return __generator(this, function (_a) {
463
- contents = {};
438
+ contents = map({});
464
439
  data = parsedOutput.body;
465
- if (data.Message !== undefined && data.Message !== null) {
440
+ if (data.Message != null) {
466
441
  contents.Message = __expectString(data.Message);
467
442
  }
468
443
  exception = new ValidationError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, contents));
@@ -480,9 +455,6 @@ var serializeAws_restJson1BatchGetRecordIdentifiers = function (input, context)
480
455
  return input
481
456
  .filter(function (e) { return e != null; })
482
457
  .map(function (entry) {
483
- if (entry === null) {
484
- return null;
485
- }
486
458
  return serializeAws_restJson1BatchGetRecordIdentifier(entry, context);
487
459
  });
488
460
  };
@@ -490,9 +462,6 @@ var serializeAws_restJson1FeatureNames = function (input, context) {
490
462
  return input
491
463
  .filter(function (e) { return e != null; })
492
464
  .map(function (entry) {
493
- if (entry === null) {
494
- return null;
495
- }
496
465
  return entry;
497
466
  });
498
467
  };
@@ -503,9 +472,6 @@ var serializeAws_restJson1Record = function (input, context) {
503
472
  return input
504
473
  .filter(function (e) { return e != null; })
505
474
  .map(function (entry) {
506
- if (entry === null) {
507
- return null;
508
- }
509
475
  return serializeAws_restJson1FeatureValue(entry, context);
510
476
  });
511
477
  };
@@ -513,9 +479,6 @@ var serializeAws_restJson1RecordIdentifiers = function (input, context) {
513
479
  return input
514
480
  .filter(function (e) { return e != null; })
515
481
  .map(function (entry) {
516
- if (entry === null) {
517
- return null;
518
- }
519
482
  return entry;
520
483
  });
521
484
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-featurestore-runtime",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Featurestore Runtime Client for Node.js, Browser and React Native",
4
- "version": "3.141.0",
4
+ "version": "3.142.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -18,9 +18,9 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.141.0",
21
+ "@aws-sdk/client-sts": "3.142.0",
22
22
  "@aws-sdk/config-resolver": "3.130.0",
23
- "@aws-sdk/credential-provider-node": "3.141.0",
23
+ "@aws-sdk/credential-provider-node": "3.142.0",
24
24
  "@aws-sdk/fetch-http-handler": "3.131.0",
25
25
  "@aws-sdk/hash-node": "3.127.0",
26
26
  "@aws-sdk/invalid-dependency": "3.127.0",
@@ -36,15 +36,15 @@
36
36
  "@aws-sdk/node-config-provider": "3.127.0",
37
37
  "@aws-sdk/node-http-handler": "3.127.0",
38
38
  "@aws-sdk/protocol-http": "3.127.0",
39
- "@aws-sdk/smithy-client": "3.137.0",
39
+ "@aws-sdk/smithy-client": "3.142.0",
40
40
  "@aws-sdk/types": "3.127.0",
41
41
  "@aws-sdk/url-parser": "3.127.0",
42
42
  "@aws-sdk/util-base64-browser": "3.109.0",
43
43
  "@aws-sdk/util-base64-node": "3.55.0",
44
44
  "@aws-sdk/util-body-length-browser": "3.55.0",
45
45
  "@aws-sdk/util-body-length-node": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-browser": "3.137.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.137.0",
46
+ "@aws-sdk/util-defaults-mode-browser": "3.142.0",
47
+ "@aws-sdk/util-defaults-mode-node": "3.142.0",
48
48
  "@aws-sdk/util-user-agent-browser": "3.127.0",
49
49
  "@aws-sdk/util-user-agent-node": "3.127.0",
50
50
  "@aws-sdk/util-utf8-browser": "3.109.0",