@aws-sdk/client-sagemaker-featurestore-runtime 3.32.0 → 3.36.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/{dist/cjs → dist-cjs}/SageMakerFeatureStoreRuntime.js +1 -2
  3. package/{dist/cjs → dist-cjs}/SageMakerFeatureStoreRuntimeClient.js +8 -9
  4. package/{dist/cjs → dist-cjs}/commands/BatchGetRecordCommand.js +2 -3
  5. package/{dist/cjs → dist-cjs}/commands/DeleteRecordCommand.js +2 -3
  6. package/{dist/cjs → dist-cjs}/commands/GetRecordCommand.js +2 -3
  7. package/{dist/cjs → dist-cjs}/commands/PutRecordCommand.js +2 -3
  8. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  9. package/{dist/cjs → dist-cjs}/index.js +0 -1
  10. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  11. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -1
  12. package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +1 -2
  13. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +2 -2
  14. package/{dist/cjs → dist-cjs}/runtimeConfig.js +2 -2
  15. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -1
  16. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -2
  17. package/{dist/es → dist-es}/SageMakerFeatureStoreRuntime.js +2 -32
  18. package/{dist/es → dist-es}/SageMakerFeatureStoreRuntimeClient.js +2 -37
  19. package/{dist/es → dist-es}/commands/BatchGetRecordCommand.js +4 -30
  20. package/{dist/es → dist-es}/commands/DeleteRecordCommand.js +4 -32
  21. package/{dist/es → dist-es}/commands/GetRecordCommand.js +4 -32
  22. package/{dist/es → dist-es}/commands/PutRecordCommand.js +4 -34
  23. package/{dist/es → dist-es}/endpoints.js +1 -2
  24. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  25. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  26. package/{dist/es → dist-es}/models/models_0.js +0 -46
  27. package/{dist/es → dist-es}/protocols/Aws_restJson1.js +105 -111
  28. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  29. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  30. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  31. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  32. package/{dist/types → dist-types}/SageMakerFeatureStoreRuntime.d.ts +2 -2
  33. package/{dist/types → dist-types}/SageMakerFeatureStoreRuntimeClient.d.ts +5 -5
  34. package/{dist/types → dist-types}/commands/BatchGetRecordCommand.d.ts +3 -3
  35. package/{dist/types → dist-types}/commands/DeleteRecordCommand.d.ts +3 -3
  36. package/{dist/types → dist-types}/commands/GetRecordCommand.d.ts +3 -3
  37. package/{dist/types → dist-types}/commands/PutRecordCommand.d.ts +3 -3
  38. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  39. package/{index.ts → dist-types/index.d.ts} +0 -0
  40. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  41. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  42. package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
  43. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +1 -0
  44. package/{dist/types/ts3.4 → dist-types}/runtimeConfig.d.ts +37 -36
  45. package/{dist/types/ts3.4 → dist-types}/runtimeConfig.native.d.ts +36 -35
  46. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  47. package/{dist/types → dist-types}/ts3.4/SageMakerFeatureStoreRuntime.d.ts +2 -2
  48. package/{dist/types → dist-types}/ts3.4/SageMakerFeatureStoreRuntimeClient.d.ts +5 -5
  49. package/{dist/types → dist-types}/ts3.4/commands/BatchGetRecordCommand.d.ts +3 -3
  50. package/{dist/types → dist-types}/ts3.4/commands/DeleteRecordCommand.d.ts +3 -3
  51. package/{dist/types → dist-types}/ts3.4/commands/GetRecordCommand.d.ts +3 -3
  52. package/{dist/types → dist-types}/ts3.4/commands/PutRecordCommand.d.ts +3 -3
  53. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  54. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  55. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  56. package/{dist/types → dist-types}/ts3.4/models/models_0.d.ts +0 -0
  57. package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
  58. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -0
  59. package/{dist/types → dist-types/ts3.4}/runtimeConfig.d.ts +37 -36
  60. package/{dist/types → dist-types/ts3.4}/runtimeConfig.native.d.ts +36 -35
  61. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +0 -0
  62. package/package.json +52 -49
  63. package/SageMakerFeatureStoreRuntime.ts +0 -166
  64. package/SageMakerFeatureStoreRuntimeClient.ts +0 -274
  65. package/commands/BatchGetRecordCommand.ts +0 -98
  66. package/commands/DeleteRecordCommand.ts +0 -100
  67. package/commands/GetRecordCommand.ts +0 -100
  68. package/commands/PutRecordCommand.ts +0 -102
  69. package/dist/cjs/SageMakerFeatureStoreRuntime.js.map +0 -1
  70. package/dist/cjs/SageMakerFeatureStoreRuntimeClient.js.map +0 -1
  71. package/dist/cjs/commands/BatchGetRecordCommand.js.map +0 -1
  72. package/dist/cjs/commands/DeleteRecordCommand.js.map +0 -1
  73. package/dist/cjs/commands/GetRecordCommand.js.map +0 -1
  74. package/dist/cjs/commands/PutRecordCommand.js.map +0 -1
  75. package/dist/cjs/endpoints.js.map +0 -1
  76. package/dist/cjs/index.js.map +0 -1
  77. package/dist/cjs/models/index.js.map +0 -1
  78. package/dist/cjs/models/models_0.js.map +0 -1
  79. package/dist/cjs/package.json +0 -91
  80. package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
  81. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  82. package/dist/cjs/runtimeConfig.js.map +0 -1
  83. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  84. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  85. package/dist/es/SageMakerFeatureStoreRuntime.js.map +0 -1
  86. package/dist/es/SageMakerFeatureStoreRuntimeClient.js.map +0 -1
  87. package/dist/es/commands/BatchGetRecordCommand.js.map +0 -1
  88. package/dist/es/commands/DeleteRecordCommand.js.map +0 -1
  89. package/dist/es/commands/GetRecordCommand.js.map +0 -1
  90. package/dist/es/commands/PutRecordCommand.js.map +0 -1
  91. package/dist/es/endpoints.js.map +0 -1
  92. package/dist/es/index.js +0 -8
  93. package/dist/es/index.js.map +0 -1
  94. package/dist/es/models/index.js +0 -2
  95. package/dist/es/models/index.js.map +0 -1
  96. package/dist/es/models/models_0.js.map +0 -1
  97. package/dist/es/package.json +0 -91
  98. package/dist/es/protocols/Aws_restJson1.js.map +0 -1
  99. package/dist/es/runtimeConfig.browser.js.map +0 -1
  100. package/dist/es/runtimeConfig.js.map +0 -1
  101. package/dist/es/runtimeConfig.native.js.map +0 -1
  102. package/dist/es/runtimeConfig.shared.js.map +0 -1
  103. package/endpoints.ts +0 -57
  104. package/jest.config.js +0 -4
  105. package/models/models_0.ts +0 -360
  106. package/protocols/Aws_restJson1.ts +0 -834
  107. package/runtimeConfig.browser.ts +0 -40
  108. package/runtimeConfig.native.ts +0 -16
  109. package/runtimeConfig.shared.ts +0 -16
  110. package/runtimeConfig.ts +0 -45
  111. package/tsconfig.es.json +0 -12
  112. package/tsconfig.json +0 -32
@@ -1,834 +0,0 @@
1
- import { BatchGetRecordCommandInput, BatchGetRecordCommandOutput } from "../commands/BatchGetRecordCommand";
2
- import { DeleteRecordCommandInput, DeleteRecordCommandOutput } from "../commands/DeleteRecordCommand";
3
- import { GetRecordCommandInput, GetRecordCommandOutput } from "../commands/GetRecordCommand";
4
- import { PutRecordCommandInput, PutRecordCommandOutput } from "../commands/PutRecordCommand";
5
- import {
6
- AccessForbidden,
7
- BatchGetRecordError,
8
- BatchGetRecordIdentifier,
9
- BatchGetRecordResultDetail,
10
- FeatureValue,
11
- InternalFailure,
12
- ResourceNotFound,
13
- ServiceUnavailable,
14
- ValidationError,
15
- } from "../models/models_0";
16
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
17
- import {
18
- expectNonNull as __expectNonNull,
19
- expectObject as __expectObject,
20
- expectString as __expectString,
21
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
22
- } from "@aws-sdk/smithy-client";
23
- import {
24
- Endpoint as __Endpoint,
25
- MetadataBearer as __MetadataBearer,
26
- ResponseMetadata as __ResponseMetadata,
27
- SerdeContext as __SerdeContext,
28
- SmithyException as __SmithyException,
29
- } from "@aws-sdk/types";
30
-
31
- export const serializeAws_restJson1BatchGetRecordCommand = async (
32
- input: BatchGetRecordCommandInput,
33
- context: __SerdeContext
34
- ): Promise<__HttpRequest> => {
35
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
36
- const headers: any = {
37
- "content-type": "application/json",
38
- };
39
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/BatchGetRecord";
40
- let body: any;
41
- body = JSON.stringify({
42
- ...(input.Identifiers !== undefined &&
43
- input.Identifiers !== null && {
44
- Identifiers: serializeAws_restJson1BatchGetRecordIdentifiers(input.Identifiers, context),
45
- }),
46
- });
47
- return new __HttpRequest({
48
- protocol,
49
- hostname,
50
- port,
51
- method: "POST",
52
- headers,
53
- path: resolvedPath,
54
- body,
55
- });
56
- };
57
-
58
- export const serializeAws_restJson1DeleteRecordCommand = async (
59
- input: DeleteRecordCommandInput,
60
- context: __SerdeContext
61
- ): Promise<__HttpRequest> => {
62
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
63
- const headers: any = {};
64
- let resolvedPath =
65
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/FeatureGroup/{FeatureGroupName}";
66
- if (input.FeatureGroupName !== undefined) {
67
- const labelValue: string = input.FeatureGroupName;
68
- if (labelValue.length <= 0) {
69
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
70
- }
71
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", __extendedEncodeURIComponent(labelValue));
72
- } else {
73
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
74
- }
75
- const query: any = {
76
- ...(input.RecordIdentifierValueAsString !== undefined && {
77
- RecordIdentifierValueAsString: input.RecordIdentifierValueAsString,
78
- }),
79
- ...(input.EventTime !== undefined && { EventTime: input.EventTime }),
80
- };
81
- let body: any;
82
- return new __HttpRequest({
83
- protocol,
84
- hostname,
85
- port,
86
- method: "DELETE",
87
- headers,
88
- path: resolvedPath,
89
- query,
90
- body,
91
- });
92
- };
93
-
94
- export const serializeAws_restJson1GetRecordCommand = async (
95
- input: GetRecordCommandInput,
96
- context: __SerdeContext
97
- ): Promise<__HttpRequest> => {
98
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
99
- const headers: any = {};
100
- let resolvedPath =
101
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/FeatureGroup/{FeatureGroupName}";
102
- if (input.FeatureGroupName !== undefined) {
103
- const labelValue: string = input.FeatureGroupName;
104
- if (labelValue.length <= 0) {
105
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
106
- }
107
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", __extendedEncodeURIComponent(labelValue));
108
- } else {
109
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
110
- }
111
- const query: any = {
112
- ...(input.RecordIdentifierValueAsString !== undefined && {
113
- RecordIdentifierValueAsString: input.RecordIdentifierValueAsString,
114
- }),
115
- ...(input.FeatureNames !== undefined && { FeatureName: (input.FeatureNames || []).map((_entry) => _entry as any) }),
116
- };
117
- let body: any;
118
- return new __HttpRequest({
119
- protocol,
120
- hostname,
121
- port,
122
- method: "GET",
123
- headers,
124
- path: resolvedPath,
125
- query,
126
- body,
127
- });
128
- };
129
-
130
- export const serializeAws_restJson1PutRecordCommand = async (
131
- input: PutRecordCommandInput,
132
- context: __SerdeContext
133
- ): Promise<__HttpRequest> => {
134
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
135
- const headers: any = {
136
- "content-type": "application/json",
137
- };
138
- let resolvedPath =
139
- `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/FeatureGroup/{FeatureGroupName}";
140
- if (input.FeatureGroupName !== undefined) {
141
- const labelValue: string = input.FeatureGroupName;
142
- if (labelValue.length <= 0) {
143
- throw new Error("Empty value provided for input HTTP label: FeatureGroupName.");
144
- }
145
- resolvedPath = resolvedPath.replace("{FeatureGroupName}", __extendedEncodeURIComponent(labelValue));
146
- } else {
147
- throw new Error("No value provided for input HTTP label: FeatureGroupName.");
148
- }
149
- let body: any;
150
- body = JSON.stringify({
151
- ...(input.Record !== undefined &&
152
- input.Record !== null && { Record: serializeAws_restJson1Record(input.Record, context) }),
153
- });
154
- return new __HttpRequest({
155
- protocol,
156
- hostname,
157
- port,
158
- method: "PUT",
159
- headers,
160
- path: resolvedPath,
161
- body,
162
- });
163
- };
164
-
165
- export const deserializeAws_restJson1BatchGetRecordCommand = async (
166
- output: __HttpResponse,
167
- context: __SerdeContext
168
- ): Promise<BatchGetRecordCommandOutput> => {
169
- if (output.statusCode !== 200 && output.statusCode >= 300) {
170
- return deserializeAws_restJson1BatchGetRecordCommandError(output, context);
171
- }
172
- const contents: BatchGetRecordCommandOutput = {
173
- $metadata: deserializeMetadata(output),
174
- Errors: undefined,
175
- Records: undefined,
176
- UnprocessedIdentifiers: undefined,
177
- };
178
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
179
- if (data.Errors !== undefined && data.Errors !== null) {
180
- contents.Errors = deserializeAws_restJson1BatchGetRecordErrors(data.Errors, context);
181
- }
182
- if (data.Records !== undefined && data.Records !== null) {
183
- contents.Records = deserializeAws_restJson1BatchGetRecordResultDetails(data.Records, context);
184
- }
185
- if (data.UnprocessedIdentifiers !== undefined && data.UnprocessedIdentifiers !== null) {
186
- contents.UnprocessedIdentifiers = deserializeAws_restJson1UnprocessedIdentifiers(
187
- data.UnprocessedIdentifiers,
188
- context
189
- );
190
- }
191
- return Promise.resolve(contents);
192
- };
193
-
194
- const deserializeAws_restJson1BatchGetRecordCommandError = async (
195
- output: __HttpResponse,
196
- context: __SerdeContext
197
- ): Promise<BatchGetRecordCommandOutput> => {
198
- const parsedOutput: any = {
199
- ...output,
200
- body: await parseBody(output.body, context),
201
- };
202
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
203
- let errorCode: string = "UnknownError";
204
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
205
- switch (errorCode) {
206
- case "AccessForbidden":
207
- case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden":
208
- response = {
209
- ...(await deserializeAws_restJson1AccessForbiddenResponse(parsedOutput, context)),
210
- name: errorCode,
211
- $metadata: deserializeMetadata(output),
212
- };
213
- break;
214
- case "InternalFailure":
215
- case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure":
216
- response = {
217
- ...(await deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)),
218
- name: errorCode,
219
- $metadata: deserializeMetadata(output),
220
- };
221
- break;
222
- case "ServiceUnavailable":
223
- case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable":
224
- response = {
225
- ...(await deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)),
226
- name: errorCode,
227
- $metadata: deserializeMetadata(output),
228
- };
229
- break;
230
- case "ValidationError":
231
- case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError":
232
- response = {
233
- ...(await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)),
234
- name: errorCode,
235
- $metadata: deserializeMetadata(output),
236
- };
237
- break;
238
- default:
239
- const parsedBody = parsedOutput.body;
240
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
241
- response = {
242
- ...parsedBody,
243
- name: `${errorCode}`,
244
- message: parsedBody.message || parsedBody.Message || errorCode,
245
- $fault: "client",
246
- $metadata: deserializeMetadata(output),
247
- } as any;
248
- }
249
- const message = response.message || response.Message || errorCode;
250
- response.message = message;
251
- delete response.Message;
252
- return Promise.reject(Object.assign(new Error(message), response));
253
- };
254
-
255
- export const deserializeAws_restJson1DeleteRecordCommand = async (
256
- output: __HttpResponse,
257
- context: __SerdeContext
258
- ): Promise<DeleteRecordCommandOutput> => {
259
- if (output.statusCode !== 200 && output.statusCode >= 300) {
260
- return deserializeAws_restJson1DeleteRecordCommandError(output, context);
261
- }
262
- const contents: DeleteRecordCommandOutput = {
263
- $metadata: deserializeMetadata(output),
264
- };
265
- await collectBody(output.body, context);
266
- return Promise.resolve(contents);
267
- };
268
-
269
- const deserializeAws_restJson1DeleteRecordCommandError = async (
270
- output: __HttpResponse,
271
- context: __SerdeContext
272
- ): Promise<DeleteRecordCommandOutput> => {
273
- const parsedOutput: any = {
274
- ...output,
275
- body: await parseBody(output.body, context),
276
- };
277
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
278
- let errorCode: string = "UnknownError";
279
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
280
- switch (errorCode) {
281
- case "AccessForbidden":
282
- case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden":
283
- response = {
284
- ...(await deserializeAws_restJson1AccessForbiddenResponse(parsedOutput, context)),
285
- name: errorCode,
286
- $metadata: deserializeMetadata(output),
287
- };
288
- break;
289
- case "InternalFailure":
290
- case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure":
291
- response = {
292
- ...(await deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)),
293
- name: errorCode,
294
- $metadata: deserializeMetadata(output),
295
- };
296
- break;
297
- case "ServiceUnavailable":
298
- case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable":
299
- response = {
300
- ...(await deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)),
301
- name: errorCode,
302
- $metadata: deserializeMetadata(output),
303
- };
304
- break;
305
- case "ValidationError":
306
- case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError":
307
- response = {
308
- ...(await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)),
309
- name: errorCode,
310
- $metadata: deserializeMetadata(output),
311
- };
312
- break;
313
- default:
314
- const parsedBody = parsedOutput.body;
315
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
316
- response = {
317
- ...parsedBody,
318
- name: `${errorCode}`,
319
- message: parsedBody.message || parsedBody.Message || errorCode,
320
- $fault: "client",
321
- $metadata: deserializeMetadata(output),
322
- } as any;
323
- }
324
- const message = response.message || response.Message || errorCode;
325
- response.message = message;
326
- delete response.Message;
327
- return Promise.reject(Object.assign(new Error(message), response));
328
- };
329
-
330
- export const deserializeAws_restJson1GetRecordCommand = async (
331
- output: __HttpResponse,
332
- context: __SerdeContext
333
- ): Promise<GetRecordCommandOutput> => {
334
- if (output.statusCode !== 200 && output.statusCode >= 300) {
335
- return deserializeAws_restJson1GetRecordCommandError(output, context);
336
- }
337
- const contents: GetRecordCommandOutput = {
338
- $metadata: deserializeMetadata(output),
339
- Record: undefined,
340
- };
341
- const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
342
- if (data.Record !== undefined && data.Record !== null) {
343
- contents.Record = deserializeAws_restJson1Record(data.Record, context);
344
- }
345
- return Promise.resolve(contents);
346
- };
347
-
348
- const deserializeAws_restJson1GetRecordCommandError = async (
349
- output: __HttpResponse,
350
- context: __SerdeContext
351
- ): Promise<GetRecordCommandOutput> => {
352
- const parsedOutput: any = {
353
- ...output,
354
- body: await parseBody(output.body, context),
355
- };
356
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
357
- let errorCode: string = "UnknownError";
358
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
359
- switch (errorCode) {
360
- case "AccessForbidden":
361
- case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden":
362
- response = {
363
- ...(await deserializeAws_restJson1AccessForbiddenResponse(parsedOutput, context)),
364
- name: errorCode,
365
- $metadata: deserializeMetadata(output),
366
- };
367
- break;
368
- case "InternalFailure":
369
- case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure":
370
- response = {
371
- ...(await deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)),
372
- name: errorCode,
373
- $metadata: deserializeMetadata(output),
374
- };
375
- break;
376
- case "ResourceNotFound":
377
- case "com.amazonaws.sagemakerfeaturestoreruntime#ResourceNotFound":
378
- response = {
379
- ...(await deserializeAws_restJson1ResourceNotFoundResponse(parsedOutput, context)),
380
- name: errorCode,
381
- $metadata: deserializeMetadata(output),
382
- };
383
- break;
384
- case "ServiceUnavailable":
385
- case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable":
386
- response = {
387
- ...(await deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)),
388
- name: errorCode,
389
- $metadata: deserializeMetadata(output),
390
- };
391
- break;
392
- case "ValidationError":
393
- case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError":
394
- response = {
395
- ...(await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)),
396
- name: errorCode,
397
- $metadata: deserializeMetadata(output),
398
- };
399
- break;
400
- default:
401
- const parsedBody = parsedOutput.body;
402
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
403
- response = {
404
- ...parsedBody,
405
- name: `${errorCode}`,
406
- message: parsedBody.message || parsedBody.Message || errorCode,
407
- $fault: "client",
408
- $metadata: deserializeMetadata(output),
409
- } as any;
410
- }
411
- const message = response.message || response.Message || errorCode;
412
- response.message = message;
413
- delete response.Message;
414
- return Promise.reject(Object.assign(new Error(message), response));
415
- };
416
-
417
- export const deserializeAws_restJson1PutRecordCommand = async (
418
- output: __HttpResponse,
419
- context: __SerdeContext
420
- ): Promise<PutRecordCommandOutput> => {
421
- if (output.statusCode !== 200 && output.statusCode >= 300) {
422
- return deserializeAws_restJson1PutRecordCommandError(output, context);
423
- }
424
- const contents: PutRecordCommandOutput = {
425
- $metadata: deserializeMetadata(output),
426
- };
427
- await collectBody(output.body, context);
428
- return Promise.resolve(contents);
429
- };
430
-
431
- const deserializeAws_restJson1PutRecordCommandError = async (
432
- output: __HttpResponse,
433
- context: __SerdeContext
434
- ): Promise<PutRecordCommandOutput> => {
435
- const parsedOutput: any = {
436
- ...output,
437
- body: await parseBody(output.body, context),
438
- };
439
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
440
- let errorCode: string = "UnknownError";
441
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
442
- switch (errorCode) {
443
- case "AccessForbidden":
444
- case "com.amazonaws.sagemakerfeaturestoreruntime#AccessForbidden":
445
- response = {
446
- ...(await deserializeAws_restJson1AccessForbiddenResponse(parsedOutput, context)),
447
- name: errorCode,
448
- $metadata: deserializeMetadata(output),
449
- };
450
- break;
451
- case "InternalFailure":
452
- case "com.amazonaws.sagemakerfeaturestoreruntime#InternalFailure":
453
- response = {
454
- ...(await deserializeAws_restJson1InternalFailureResponse(parsedOutput, context)),
455
- name: errorCode,
456
- $metadata: deserializeMetadata(output),
457
- };
458
- break;
459
- case "ServiceUnavailable":
460
- case "com.amazonaws.sagemakerfeaturestoreruntime#ServiceUnavailable":
461
- response = {
462
- ...(await deserializeAws_restJson1ServiceUnavailableResponse(parsedOutput, context)),
463
- name: errorCode,
464
- $metadata: deserializeMetadata(output),
465
- };
466
- break;
467
- case "ValidationError":
468
- case "com.amazonaws.sagemakerfeaturestoreruntime#ValidationError":
469
- response = {
470
- ...(await deserializeAws_restJson1ValidationErrorResponse(parsedOutput, context)),
471
- name: errorCode,
472
- $metadata: deserializeMetadata(output),
473
- };
474
- break;
475
- default:
476
- const parsedBody = parsedOutput.body;
477
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
478
- response = {
479
- ...parsedBody,
480
- name: `${errorCode}`,
481
- message: parsedBody.message || parsedBody.Message || errorCode,
482
- $fault: "client",
483
- $metadata: deserializeMetadata(output),
484
- } as any;
485
- }
486
- const message = response.message || response.Message || errorCode;
487
- response.message = message;
488
- delete response.Message;
489
- return Promise.reject(Object.assign(new Error(message), response));
490
- };
491
-
492
- const deserializeAws_restJson1AccessForbiddenResponse = async (
493
- parsedOutput: any,
494
- context: __SerdeContext
495
- ): Promise<AccessForbidden> => {
496
- const contents: AccessForbidden = {
497
- name: "AccessForbidden",
498
- $fault: "client",
499
- $metadata: deserializeMetadata(parsedOutput),
500
- Message: undefined,
501
- };
502
- const data: any = parsedOutput.body;
503
- if (data.Message !== undefined && data.Message !== null) {
504
- contents.Message = __expectString(data.Message);
505
- }
506
- return contents;
507
- };
508
-
509
- const deserializeAws_restJson1InternalFailureResponse = async (
510
- parsedOutput: any,
511
- context: __SerdeContext
512
- ): Promise<InternalFailure> => {
513
- const contents: InternalFailure = {
514
- name: "InternalFailure",
515
- $fault: "server",
516
- $metadata: deserializeMetadata(parsedOutput),
517
- Message: undefined,
518
- };
519
- const data: any = parsedOutput.body;
520
- if (data.Message !== undefined && data.Message !== null) {
521
- contents.Message = __expectString(data.Message);
522
- }
523
- return contents;
524
- };
525
-
526
- const deserializeAws_restJson1ResourceNotFoundResponse = async (
527
- parsedOutput: any,
528
- context: __SerdeContext
529
- ): Promise<ResourceNotFound> => {
530
- const contents: ResourceNotFound = {
531
- name: "ResourceNotFound",
532
- $fault: "client",
533
- $metadata: deserializeMetadata(parsedOutput),
534
- Message: undefined,
535
- };
536
- const data: any = parsedOutput.body;
537
- if (data.Message !== undefined && data.Message !== null) {
538
- contents.Message = __expectString(data.Message);
539
- }
540
- return contents;
541
- };
542
-
543
- const deserializeAws_restJson1ServiceUnavailableResponse = async (
544
- parsedOutput: any,
545
- context: __SerdeContext
546
- ): Promise<ServiceUnavailable> => {
547
- const contents: ServiceUnavailable = {
548
- name: "ServiceUnavailable",
549
- $fault: "server",
550
- $metadata: deserializeMetadata(parsedOutput),
551
- Message: undefined,
552
- };
553
- const data: any = parsedOutput.body;
554
- if (data.Message !== undefined && data.Message !== null) {
555
- contents.Message = __expectString(data.Message);
556
- }
557
- return contents;
558
- };
559
-
560
- const deserializeAws_restJson1ValidationErrorResponse = async (
561
- parsedOutput: any,
562
- context: __SerdeContext
563
- ): Promise<ValidationError> => {
564
- const contents: ValidationError = {
565
- name: "ValidationError",
566
- $fault: "client",
567
- $metadata: deserializeMetadata(parsedOutput),
568
- Message: undefined,
569
- };
570
- const data: any = parsedOutput.body;
571
- if (data.Message !== undefined && data.Message !== null) {
572
- contents.Message = __expectString(data.Message);
573
- }
574
- return contents;
575
- };
576
-
577
- const serializeAws_restJson1BatchGetRecordIdentifier = (
578
- input: BatchGetRecordIdentifier,
579
- context: __SerdeContext
580
- ): any => {
581
- return {
582
- ...(input.FeatureGroupName !== undefined &&
583
- input.FeatureGroupName !== null && { FeatureGroupName: input.FeatureGroupName }),
584
- ...(input.FeatureNames !== undefined &&
585
- input.FeatureNames !== null && { FeatureNames: serializeAws_restJson1FeatureNames(input.FeatureNames, context) }),
586
- ...(input.RecordIdentifiersValueAsString !== undefined &&
587
- input.RecordIdentifiersValueAsString !== null && {
588
- RecordIdentifiersValueAsString: serializeAws_restJson1RecordIdentifiers(
589
- input.RecordIdentifiersValueAsString,
590
- context
591
- ),
592
- }),
593
- };
594
- };
595
-
596
- const serializeAws_restJson1BatchGetRecordIdentifiers = (
597
- input: BatchGetRecordIdentifier[],
598
- context: __SerdeContext
599
- ): any => {
600
- return input
601
- .filter((e: any) => e != null)
602
- .map((entry) => {
603
- if (entry === null) {
604
- return null as any;
605
- }
606
- return serializeAws_restJson1BatchGetRecordIdentifier(entry, context);
607
- });
608
- };
609
-
610
- const serializeAws_restJson1FeatureNames = (input: string[], context: __SerdeContext): any => {
611
- return input
612
- .filter((e: any) => e != null)
613
- .map((entry) => {
614
- if (entry === null) {
615
- return null as any;
616
- }
617
- return entry;
618
- });
619
- };
620
-
621
- const serializeAws_restJson1FeatureValue = (input: FeatureValue, context: __SerdeContext): any => {
622
- return {
623
- ...(input.FeatureName !== undefined && input.FeatureName !== null && { FeatureName: input.FeatureName }),
624
- ...(input.ValueAsString !== undefined && input.ValueAsString !== null && { ValueAsString: input.ValueAsString }),
625
- };
626
- };
627
-
628
- const serializeAws_restJson1Record = (input: FeatureValue[], context: __SerdeContext): any => {
629
- return input
630
- .filter((e: any) => e != null)
631
- .map((entry) => {
632
- if (entry === null) {
633
- return null as any;
634
- }
635
- return serializeAws_restJson1FeatureValue(entry, context);
636
- });
637
- };
638
-
639
- const serializeAws_restJson1RecordIdentifiers = (input: string[], context: __SerdeContext): any => {
640
- return input
641
- .filter((e: any) => e != null)
642
- .map((entry) => {
643
- if (entry === null) {
644
- return null as any;
645
- }
646
- return entry;
647
- });
648
- };
649
-
650
- const deserializeAws_restJson1BatchGetRecordError = (output: any, context: __SerdeContext): BatchGetRecordError => {
651
- return {
652
- ErrorCode: __expectString(output.ErrorCode),
653
- ErrorMessage: __expectString(output.ErrorMessage),
654
- FeatureGroupName: __expectString(output.FeatureGroupName),
655
- RecordIdentifierValueAsString: __expectString(output.RecordIdentifierValueAsString),
656
- } as any;
657
- };
658
-
659
- const deserializeAws_restJson1BatchGetRecordErrors = (output: any, context: __SerdeContext): BatchGetRecordError[] => {
660
- return (output || [])
661
- .filter((e: any) => e != null)
662
- .map((entry: any) => {
663
- if (entry === null) {
664
- return null as any;
665
- }
666
- return deserializeAws_restJson1BatchGetRecordError(entry, context);
667
- });
668
- };
669
-
670
- const deserializeAws_restJson1BatchGetRecordIdentifier = (
671
- output: any,
672
- context: __SerdeContext
673
- ): BatchGetRecordIdentifier => {
674
- return {
675
- FeatureGroupName: __expectString(output.FeatureGroupName),
676
- FeatureNames:
677
- output.FeatureNames !== undefined && output.FeatureNames !== null
678
- ? deserializeAws_restJson1FeatureNames(output.FeatureNames, context)
679
- : undefined,
680
- RecordIdentifiersValueAsString:
681
- output.RecordIdentifiersValueAsString !== undefined && output.RecordIdentifiersValueAsString !== null
682
- ? deserializeAws_restJson1RecordIdentifiers(output.RecordIdentifiersValueAsString, context)
683
- : undefined,
684
- } as any;
685
- };
686
-
687
- const deserializeAws_restJson1BatchGetRecordResultDetail = (
688
- output: any,
689
- context: __SerdeContext
690
- ): BatchGetRecordResultDetail => {
691
- return {
692
- FeatureGroupName: __expectString(output.FeatureGroupName),
693
- Record:
694
- output.Record !== undefined && output.Record !== null
695
- ? deserializeAws_restJson1Record(output.Record, context)
696
- : undefined,
697
- RecordIdentifierValueAsString: __expectString(output.RecordIdentifierValueAsString),
698
- } as any;
699
- };
700
-
701
- const deserializeAws_restJson1BatchGetRecordResultDetails = (
702
- output: any,
703
- context: __SerdeContext
704
- ): BatchGetRecordResultDetail[] => {
705
- return (output || [])
706
- .filter((e: any) => e != null)
707
- .map((entry: any) => {
708
- if (entry === null) {
709
- return null as any;
710
- }
711
- return deserializeAws_restJson1BatchGetRecordResultDetail(entry, context);
712
- });
713
- };
714
-
715
- const deserializeAws_restJson1FeatureNames = (output: any, context: __SerdeContext): string[] => {
716
- return (output || [])
717
- .filter((e: any) => e != null)
718
- .map((entry: any) => {
719
- if (entry === null) {
720
- return null as any;
721
- }
722
- return __expectString(entry) as any;
723
- });
724
- };
725
-
726
- const deserializeAws_restJson1FeatureValue = (output: any, context: __SerdeContext): FeatureValue => {
727
- return {
728
- FeatureName: __expectString(output.FeatureName),
729
- ValueAsString: __expectString(output.ValueAsString),
730
- } as any;
731
- };
732
-
733
- const deserializeAws_restJson1Record = (output: any, context: __SerdeContext): FeatureValue[] => {
734
- return (output || [])
735
- .filter((e: any) => e != null)
736
- .map((entry: any) => {
737
- if (entry === null) {
738
- return null as any;
739
- }
740
- return deserializeAws_restJson1FeatureValue(entry, context);
741
- });
742
- };
743
-
744
- const deserializeAws_restJson1RecordIdentifiers = (output: any, context: __SerdeContext): string[] => {
745
- return (output || [])
746
- .filter((e: any) => e != null)
747
- .map((entry: any) => {
748
- if (entry === null) {
749
- return null as any;
750
- }
751
- return __expectString(entry) as any;
752
- });
753
- };
754
-
755
- const deserializeAws_restJson1UnprocessedIdentifiers = (
756
- output: any,
757
- context: __SerdeContext
758
- ): BatchGetRecordIdentifier[] => {
759
- return (output || [])
760
- .filter((e: any) => e != null)
761
- .map((entry: any) => {
762
- if (entry === null) {
763
- return null as any;
764
- }
765
- return deserializeAws_restJson1BatchGetRecordIdentifier(entry, context);
766
- });
767
- };
768
-
769
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
770
- httpStatusCode: output.statusCode,
771
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
772
- extendedRequestId: output.headers["x-amz-id-2"],
773
- cfId: output.headers["x-amz-cf-id"],
774
- });
775
-
776
- // Collect low-level response body stream to Uint8Array.
777
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
778
- if (streamBody instanceof Uint8Array) {
779
- return Promise.resolve(streamBody);
780
- }
781
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
782
- };
783
-
784
- // Encode Uint8Array data into string with utf-8.
785
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
786
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
787
-
788
- const isSerializableHeaderValue = (value: any): boolean =>
789
- value !== undefined &&
790
- value !== null &&
791
- value !== "" &&
792
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
793
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
794
-
795
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
796
- collectBodyString(streamBody, context).then((encoded) => {
797
- if (encoded.length) {
798
- return JSON.parse(encoded);
799
- }
800
- return {};
801
- });
802
-
803
- /**
804
- * Load an error code for the aws.rest-json-1.1 protocol.
805
- */
806
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
807
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
808
-
809
- const sanitizeErrorCode = (rawValue: string): string => {
810
- let cleanValue = rawValue;
811
- if (cleanValue.indexOf(":") >= 0) {
812
- cleanValue = cleanValue.split(":")[0];
813
- }
814
- if (cleanValue.indexOf("#") >= 0) {
815
- cleanValue = cleanValue.split("#")[1];
816
- }
817
- return cleanValue;
818
- };
819
-
820
- const headerKey = findKey(output.headers, "x-amzn-errortype");
821
- if (headerKey !== undefined) {
822
- return sanitizeErrorCode(output.headers[headerKey]);
823
- }
824
-
825
- if (data.code !== undefined) {
826
- return sanitizeErrorCode(data.code);
827
- }
828
-
829
- if (data["__type"] !== undefined) {
830
- return sanitizeErrorCode(data["__type"]);
831
- }
832
-
833
- return "";
834
- };