@aws-sdk/client-machine-learning 3.927.0 → 3.929.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 (52) hide show
  1. package/dist-cjs/index.js +828 -1209
  2. package/dist-cjs/runtimeConfig.shared.js +7 -0
  3. package/dist-es/MachineLearningClient.js +2 -0
  4. package/dist-es/commands/AddTagsCommand.js +3 -9
  5. package/dist-es/commands/CreateBatchPredictionCommand.js +3 -9
  6. package/dist-es/commands/CreateDataSourceFromRDSCommand.js +3 -10
  7. package/dist-es/commands/CreateDataSourceFromRedshiftCommand.js +3 -10
  8. package/dist-es/commands/CreateDataSourceFromS3Command.js +3 -9
  9. package/dist-es/commands/CreateEvaluationCommand.js +3 -9
  10. package/dist-es/commands/CreateMLModelCommand.js +3 -9
  11. package/dist-es/commands/CreateRealtimeEndpointCommand.js +3 -9
  12. package/dist-es/commands/DeleteBatchPredictionCommand.js +3 -9
  13. package/dist-es/commands/DeleteDataSourceCommand.js +3 -9
  14. package/dist-es/commands/DeleteEvaluationCommand.js +3 -9
  15. package/dist-es/commands/DeleteMLModelCommand.js +3 -9
  16. package/dist-es/commands/DeleteRealtimeEndpointCommand.js +3 -9
  17. package/dist-es/commands/DeleteTagsCommand.js +3 -9
  18. package/dist-es/commands/DescribeBatchPredictionsCommand.js +3 -9
  19. package/dist-es/commands/DescribeDataSourcesCommand.js +3 -9
  20. package/dist-es/commands/DescribeEvaluationsCommand.js +3 -9
  21. package/dist-es/commands/DescribeMLModelsCommand.js +3 -9
  22. package/dist-es/commands/DescribeTagsCommand.js +3 -9
  23. package/dist-es/commands/GetBatchPredictionCommand.js +3 -9
  24. package/dist-es/commands/GetDataSourceCommand.js +3 -9
  25. package/dist-es/commands/GetEvaluationCommand.js +3 -9
  26. package/dist-es/commands/GetMLModelCommand.js +3 -9
  27. package/dist-es/commands/PredictCommand.js +3 -10
  28. package/dist-es/commands/UpdateBatchPredictionCommand.js +3 -9
  29. package/dist-es/commands/UpdateDataSourceCommand.js +3 -9
  30. package/dist-es/commands/UpdateEvaluationCommand.js +3 -9
  31. package/dist-es/commands/UpdateMLModelCommand.js +3 -9
  32. package/dist-es/models/models_0.js +0 -29
  33. package/dist-es/runtimeConfig.shared.js +7 -0
  34. package/dist-es/schemas/schemas_0.js +754 -0
  35. package/dist-types/MachineLearningClient.d.ts +10 -1
  36. package/dist-types/models/models_0.d.ts +0 -24
  37. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  38. package/dist-types/runtimeConfig.d.ts +1 -0
  39. package/dist-types/runtimeConfig.native.d.ts +1 -0
  40. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  41. package/dist-types/schemas/schemas_0.d.ts +126 -0
  42. package/dist-types/ts3.4/MachineLearningClient.d.ts +4 -0
  43. package/dist-types/ts3.4/models/models_0.d.ts +0 -16
  44. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  45. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  46. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  47. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  48. package/dist-types/ts3.4/schemas/schemas_0.d.ts +132 -0
  49. package/package.json +5 -5
  50. package/dist-es/protocols/Aws_json1_1.js +0 -958
  51. package/dist-types/protocols/Aws_json1_1.d.ts +0 -254
  52. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +0 -341
@@ -1,958 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, parseEpochTimestamp as __parseEpochTimestamp, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
4
- import { MachineLearningServiceException as __BaseException } from "../models/MachineLearningServiceException";
5
- import { IdempotentParameterMismatchException, InternalServerException, InvalidInputException, InvalidTagException, LimitExceededException, PredictorNotMountedException, ResourceNotFoundException, TagLimitExceededException, } from "../models/models_0";
6
- export const se_AddTagsCommand = async (input, context) => {
7
- const headers = sharedHeaders("AddTags");
8
- let body;
9
- body = JSON.stringify(_json(input));
10
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
11
- };
12
- export const se_CreateBatchPredictionCommand = async (input, context) => {
13
- const headers = sharedHeaders("CreateBatchPrediction");
14
- let body;
15
- body = JSON.stringify(_json(input));
16
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
17
- };
18
- export const se_CreateDataSourceFromRDSCommand = async (input, context) => {
19
- const headers = sharedHeaders("CreateDataSourceFromRDS");
20
- let body;
21
- body = JSON.stringify(_json(input));
22
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
- };
24
- export const se_CreateDataSourceFromRedshiftCommand = async (input, context) => {
25
- const headers = sharedHeaders("CreateDataSourceFromRedshift");
26
- let body;
27
- body = JSON.stringify(_json(input));
28
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
29
- };
30
- export const se_CreateDataSourceFromS3Command = async (input, context) => {
31
- const headers = sharedHeaders("CreateDataSourceFromS3");
32
- let body;
33
- body = JSON.stringify(_json(input));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- export const se_CreateEvaluationCommand = async (input, context) => {
37
- const headers = sharedHeaders("CreateEvaluation");
38
- let body;
39
- body = JSON.stringify(_json(input));
40
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
- };
42
- export const se_CreateMLModelCommand = async (input, context) => {
43
- const headers = sharedHeaders("CreateMLModel");
44
- let body;
45
- body = JSON.stringify(_json(input));
46
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
47
- };
48
- export const se_CreateRealtimeEndpointCommand = async (input, context) => {
49
- const headers = sharedHeaders("CreateRealtimeEndpoint");
50
- let body;
51
- body = JSON.stringify(_json(input));
52
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
53
- };
54
- export const se_DeleteBatchPredictionCommand = async (input, context) => {
55
- const headers = sharedHeaders("DeleteBatchPrediction");
56
- let body;
57
- body = JSON.stringify(_json(input));
58
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
- };
60
- export const se_DeleteDataSourceCommand = async (input, context) => {
61
- const headers = sharedHeaders("DeleteDataSource");
62
- let body;
63
- body = JSON.stringify(_json(input));
64
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
65
- };
66
- export const se_DeleteEvaluationCommand = async (input, context) => {
67
- const headers = sharedHeaders("DeleteEvaluation");
68
- let body;
69
- body = JSON.stringify(_json(input));
70
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
71
- };
72
- export const se_DeleteMLModelCommand = async (input, context) => {
73
- const headers = sharedHeaders("DeleteMLModel");
74
- let body;
75
- body = JSON.stringify(_json(input));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- export const se_DeleteRealtimeEndpointCommand = async (input, context) => {
79
- const headers = sharedHeaders("DeleteRealtimeEndpoint");
80
- let body;
81
- body = JSON.stringify(_json(input));
82
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
83
- };
84
- export const se_DeleteTagsCommand = async (input, context) => {
85
- const headers = sharedHeaders("DeleteTags");
86
- let body;
87
- body = JSON.stringify(_json(input));
88
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
89
- };
90
- export const se_DescribeBatchPredictionsCommand = async (input, context) => {
91
- const headers = sharedHeaders("DescribeBatchPredictions");
92
- let body;
93
- body = JSON.stringify(_json(input));
94
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
95
- };
96
- export const se_DescribeDataSourcesCommand = async (input, context) => {
97
- const headers = sharedHeaders("DescribeDataSources");
98
- let body;
99
- body = JSON.stringify(_json(input));
100
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
101
- };
102
- export const se_DescribeEvaluationsCommand = async (input, context) => {
103
- const headers = sharedHeaders("DescribeEvaluations");
104
- let body;
105
- body = JSON.stringify(_json(input));
106
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
107
- };
108
- export const se_DescribeMLModelsCommand = async (input, context) => {
109
- const headers = sharedHeaders("DescribeMLModels");
110
- let body;
111
- body = JSON.stringify(_json(input));
112
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
113
- };
114
- export const se_DescribeTagsCommand = async (input, context) => {
115
- const headers = sharedHeaders("DescribeTags");
116
- let body;
117
- body = JSON.stringify(_json(input));
118
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
119
- };
120
- export const se_GetBatchPredictionCommand = async (input, context) => {
121
- const headers = sharedHeaders("GetBatchPrediction");
122
- let body;
123
- body = JSON.stringify(_json(input));
124
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
125
- };
126
- export const se_GetDataSourceCommand = async (input, context) => {
127
- const headers = sharedHeaders("GetDataSource");
128
- let body;
129
- body = JSON.stringify(_json(input));
130
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
131
- };
132
- export const se_GetEvaluationCommand = async (input, context) => {
133
- const headers = sharedHeaders("GetEvaluation");
134
- let body;
135
- body = JSON.stringify(_json(input));
136
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
137
- };
138
- export const se_GetMLModelCommand = async (input, context) => {
139
- const headers = sharedHeaders("GetMLModel");
140
- let body;
141
- body = JSON.stringify(_json(input));
142
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
143
- };
144
- export const se_PredictCommand = async (input, context) => {
145
- const headers = sharedHeaders("Predict");
146
- let body;
147
- body = JSON.stringify(_json(input));
148
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
149
- };
150
- export const se_UpdateBatchPredictionCommand = async (input, context) => {
151
- const headers = sharedHeaders("UpdateBatchPrediction");
152
- let body;
153
- body = JSON.stringify(_json(input));
154
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
155
- };
156
- export const se_UpdateDataSourceCommand = async (input, context) => {
157
- const headers = sharedHeaders("UpdateDataSource");
158
- let body;
159
- body = JSON.stringify(_json(input));
160
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
161
- };
162
- export const se_UpdateEvaluationCommand = async (input, context) => {
163
- const headers = sharedHeaders("UpdateEvaluation");
164
- let body;
165
- body = JSON.stringify(_json(input));
166
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
167
- };
168
- export const se_UpdateMLModelCommand = async (input, context) => {
169
- const headers = sharedHeaders("UpdateMLModel");
170
- let body;
171
- body = JSON.stringify(se_UpdateMLModelInput(input, context));
172
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
173
- };
174
- export const de_AddTagsCommand = async (output, context) => {
175
- if (output.statusCode >= 300) {
176
- return de_CommandError(output, context);
177
- }
178
- const data = await parseBody(output.body, context);
179
- let contents = {};
180
- contents = _json(data);
181
- const response = {
182
- $metadata: deserializeMetadata(output),
183
- ...contents,
184
- };
185
- return response;
186
- };
187
- export const de_CreateBatchPredictionCommand = async (output, context) => {
188
- if (output.statusCode >= 300) {
189
- return de_CommandError(output, context);
190
- }
191
- const data = await parseBody(output.body, context);
192
- let contents = {};
193
- contents = _json(data);
194
- const response = {
195
- $metadata: deserializeMetadata(output),
196
- ...contents,
197
- };
198
- return response;
199
- };
200
- export const de_CreateDataSourceFromRDSCommand = async (output, context) => {
201
- if (output.statusCode >= 300) {
202
- return de_CommandError(output, context);
203
- }
204
- const data = await parseBody(output.body, context);
205
- let contents = {};
206
- contents = _json(data);
207
- const response = {
208
- $metadata: deserializeMetadata(output),
209
- ...contents,
210
- };
211
- return response;
212
- };
213
- export const de_CreateDataSourceFromRedshiftCommand = async (output, context) => {
214
- if (output.statusCode >= 300) {
215
- return de_CommandError(output, context);
216
- }
217
- const data = await parseBody(output.body, context);
218
- let contents = {};
219
- contents = _json(data);
220
- const response = {
221
- $metadata: deserializeMetadata(output),
222
- ...contents,
223
- };
224
- return response;
225
- };
226
- export const de_CreateDataSourceFromS3Command = async (output, context) => {
227
- if (output.statusCode >= 300) {
228
- return de_CommandError(output, context);
229
- }
230
- const data = await parseBody(output.body, context);
231
- let contents = {};
232
- contents = _json(data);
233
- const response = {
234
- $metadata: deserializeMetadata(output),
235
- ...contents,
236
- };
237
- return response;
238
- };
239
- export const de_CreateEvaluationCommand = async (output, context) => {
240
- if (output.statusCode >= 300) {
241
- return de_CommandError(output, context);
242
- }
243
- const data = await parseBody(output.body, context);
244
- let contents = {};
245
- contents = _json(data);
246
- const response = {
247
- $metadata: deserializeMetadata(output),
248
- ...contents,
249
- };
250
- return response;
251
- };
252
- export const de_CreateMLModelCommand = async (output, context) => {
253
- if (output.statusCode >= 300) {
254
- return de_CommandError(output, context);
255
- }
256
- const data = await parseBody(output.body, context);
257
- let contents = {};
258
- contents = _json(data);
259
- const response = {
260
- $metadata: deserializeMetadata(output),
261
- ...contents,
262
- };
263
- return response;
264
- };
265
- export const de_CreateRealtimeEndpointCommand = async (output, context) => {
266
- if (output.statusCode >= 300) {
267
- return de_CommandError(output, context);
268
- }
269
- const data = await parseBody(output.body, context);
270
- let contents = {};
271
- contents = de_CreateRealtimeEndpointOutput(data, context);
272
- const response = {
273
- $metadata: deserializeMetadata(output),
274
- ...contents,
275
- };
276
- return response;
277
- };
278
- export const de_DeleteBatchPredictionCommand = async (output, context) => {
279
- if (output.statusCode >= 300) {
280
- return de_CommandError(output, context);
281
- }
282
- const data = await parseBody(output.body, context);
283
- let contents = {};
284
- contents = _json(data);
285
- const response = {
286
- $metadata: deserializeMetadata(output),
287
- ...contents,
288
- };
289
- return response;
290
- };
291
- export const de_DeleteDataSourceCommand = async (output, context) => {
292
- if (output.statusCode >= 300) {
293
- return de_CommandError(output, context);
294
- }
295
- const data = await parseBody(output.body, context);
296
- let contents = {};
297
- contents = _json(data);
298
- const response = {
299
- $metadata: deserializeMetadata(output),
300
- ...contents,
301
- };
302
- return response;
303
- };
304
- export const de_DeleteEvaluationCommand = async (output, context) => {
305
- if (output.statusCode >= 300) {
306
- return de_CommandError(output, context);
307
- }
308
- const data = await parseBody(output.body, context);
309
- let contents = {};
310
- contents = _json(data);
311
- const response = {
312
- $metadata: deserializeMetadata(output),
313
- ...contents,
314
- };
315
- return response;
316
- };
317
- export const de_DeleteMLModelCommand = async (output, context) => {
318
- if (output.statusCode >= 300) {
319
- return de_CommandError(output, context);
320
- }
321
- const data = await parseBody(output.body, context);
322
- let contents = {};
323
- contents = _json(data);
324
- const response = {
325
- $metadata: deserializeMetadata(output),
326
- ...contents,
327
- };
328
- return response;
329
- };
330
- export const de_DeleteRealtimeEndpointCommand = async (output, context) => {
331
- if (output.statusCode >= 300) {
332
- return de_CommandError(output, context);
333
- }
334
- const data = await parseBody(output.body, context);
335
- let contents = {};
336
- contents = de_DeleteRealtimeEndpointOutput(data, context);
337
- const response = {
338
- $metadata: deserializeMetadata(output),
339
- ...contents,
340
- };
341
- return response;
342
- };
343
- export const de_DeleteTagsCommand = async (output, context) => {
344
- if (output.statusCode >= 300) {
345
- return de_CommandError(output, context);
346
- }
347
- const data = await parseBody(output.body, context);
348
- let contents = {};
349
- contents = _json(data);
350
- const response = {
351
- $metadata: deserializeMetadata(output),
352
- ...contents,
353
- };
354
- return response;
355
- };
356
- export const de_DescribeBatchPredictionsCommand = async (output, context) => {
357
- if (output.statusCode >= 300) {
358
- return de_CommandError(output, context);
359
- }
360
- const data = await parseBody(output.body, context);
361
- let contents = {};
362
- contents = de_DescribeBatchPredictionsOutput(data, context);
363
- const response = {
364
- $metadata: deserializeMetadata(output),
365
- ...contents,
366
- };
367
- return response;
368
- };
369
- export const de_DescribeDataSourcesCommand = async (output, context) => {
370
- if (output.statusCode >= 300) {
371
- return de_CommandError(output, context);
372
- }
373
- const data = await parseBody(output.body, context);
374
- let contents = {};
375
- contents = de_DescribeDataSourcesOutput(data, context);
376
- const response = {
377
- $metadata: deserializeMetadata(output),
378
- ...contents,
379
- };
380
- return response;
381
- };
382
- export const de_DescribeEvaluationsCommand = async (output, context) => {
383
- if (output.statusCode >= 300) {
384
- return de_CommandError(output, context);
385
- }
386
- const data = await parseBody(output.body, context);
387
- let contents = {};
388
- contents = de_DescribeEvaluationsOutput(data, context);
389
- const response = {
390
- $metadata: deserializeMetadata(output),
391
- ...contents,
392
- };
393
- return response;
394
- };
395
- export const de_DescribeMLModelsCommand = async (output, context) => {
396
- if (output.statusCode >= 300) {
397
- return de_CommandError(output, context);
398
- }
399
- const data = await parseBody(output.body, context);
400
- let contents = {};
401
- contents = de_DescribeMLModelsOutput(data, context);
402
- const response = {
403
- $metadata: deserializeMetadata(output),
404
- ...contents,
405
- };
406
- return response;
407
- };
408
- export const de_DescribeTagsCommand = async (output, context) => {
409
- if (output.statusCode >= 300) {
410
- return de_CommandError(output, context);
411
- }
412
- const data = await parseBody(output.body, context);
413
- let contents = {};
414
- contents = _json(data);
415
- const response = {
416
- $metadata: deserializeMetadata(output),
417
- ...contents,
418
- };
419
- return response;
420
- };
421
- export const de_GetBatchPredictionCommand = async (output, context) => {
422
- if (output.statusCode >= 300) {
423
- return de_CommandError(output, context);
424
- }
425
- const data = await parseBody(output.body, context);
426
- let contents = {};
427
- contents = de_GetBatchPredictionOutput(data, context);
428
- const response = {
429
- $metadata: deserializeMetadata(output),
430
- ...contents,
431
- };
432
- return response;
433
- };
434
- export const de_GetDataSourceCommand = async (output, context) => {
435
- if (output.statusCode >= 300) {
436
- return de_CommandError(output, context);
437
- }
438
- const data = await parseBody(output.body, context);
439
- let contents = {};
440
- contents = de_GetDataSourceOutput(data, context);
441
- const response = {
442
- $metadata: deserializeMetadata(output),
443
- ...contents,
444
- };
445
- return response;
446
- };
447
- export const de_GetEvaluationCommand = async (output, context) => {
448
- if (output.statusCode >= 300) {
449
- return de_CommandError(output, context);
450
- }
451
- const data = await parseBody(output.body, context);
452
- let contents = {};
453
- contents = de_GetEvaluationOutput(data, context);
454
- const response = {
455
- $metadata: deserializeMetadata(output),
456
- ...contents,
457
- };
458
- return response;
459
- };
460
- export const de_GetMLModelCommand = async (output, context) => {
461
- if (output.statusCode >= 300) {
462
- return de_CommandError(output, context);
463
- }
464
- const data = await parseBody(output.body, context);
465
- let contents = {};
466
- contents = de_GetMLModelOutput(data, context);
467
- const response = {
468
- $metadata: deserializeMetadata(output),
469
- ...contents,
470
- };
471
- return response;
472
- };
473
- export const de_PredictCommand = async (output, context) => {
474
- if (output.statusCode >= 300) {
475
- return de_CommandError(output, context);
476
- }
477
- const data = await parseBody(output.body, context);
478
- let contents = {};
479
- contents = de_PredictOutput(data, context);
480
- const response = {
481
- $metadata: deserializeMetadata(output),
482
- ...contents,
483
- };
484
- return response;
485
- };
486
- export const de_UpdateBatchPredictionCommand = async (output, context) => {
487
- if (output.statusCode >= 300) {
488
- return de_CommandError(output, context);
489
- }
490
- const data = await parseBody(output.body, context);
491
- let contents = {};
492
- contents = _json(data);
493
- const response = {
494
- $metadata: deserializeMetadata(output),
495
- ...contents,
496
- };
497
- return response;
498
- };
499
- export const de_UpdateDataSourceCommand = async (output, context) => {
500
- if (output.statusCode >= 300) {
501
- return de_CommandError(output, context);
502
- }
503
- const data = await parseBody(output.body, context);
504
- let contents = {};
505
- contents = _json(data);
506
- const response = {
507
- $metadata: deserializeMetadata(output),
508
- ...contents,
509
- };
510
- return response;
511
- };
512
- export const de_UpdateEvaluationCommand = async (output, context) => {
513
- if (output.statusCode >= 300) {
514
- return de_CommandError(output, context);
515
- }
516
- const data = await parseBody(output.body, context);
517
- let contents = {};
518
- contents = _json(data);
519
- const response = {
520
- $metadata: deserializeMetadata(output),
521
- ...contents,
522
- };
523
- return response;
524
- };
525
- export const de_UpdateMLModelCommand = async (output, context) => {
526
- if (output.statusCode >= 300) {
527
- return de_CommandError(output, context);
528
- }
529
- const data = await parseBody(output.body, context);
530
- let contents = {};
531
- contents = _json(data);
532
- const response = {
533
- $metadata: deserializeMetadata(output),
534
- ...contents,
535
- };
536
- return response;
537
- };
538
- const de_CommandError = async (output, context) => {
539
- const parsedOutput = {
540
- ...output,
541
- body: await parseErrorBody(output.body, context),
542
- };
543
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
544
- switch (errorCode) {
545
- case "InternalServerException":
546
- case "com.amazonaws.machinelearning#InternalServerException":
547
- throw await de_InternalServerExceptionRes(parsedOutput, context);
548
- case "InvalidInputException":
549
- case "com.amazonaws.machinelearning#InvalidInputException":
550
- throw await de_InvalidInputExceptionRes(parsedOutput, context);
551
- case "InvalidTagException":
552
- case "com.amazonaws.machinelearning#InvalidTagException":
553
- throw await de_InvalidTagExceptionRes(parsedOutput, context);
554
- case "ResourceNotFoundException":
555
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
556
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
557
- case "TagLimitExceededException":
558
- case "com.amazonaws.machinelearning#TagLimitExceededException":
559
- throw await de_TagLimitExceededExceptionRes(parsedOutput, context);
560
- case "IdempotentParameterMismatchException":
561
- case "com.amazonaws.machinelearning#IdempotentParameterMismatchException":
562
- throw await de_IdempotentParameterMismatchExceptionRes(parsedOutput, context);
563
- case "LimitExceededException":
564
- case "com.amazonaws.machinelearning#LimitExceededException":
565
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
566
- case "PredictorNotMountedException":
567
- case "com.amazonaws.machinelearning#PredictorNotMountedException":
568
- throw await de_PredictorNotMountedExceptionRes(parsedOutput, context);
569
- default:
570
- const parsedBody = parsedOutput.body;
571
- return throwDefaultError({
572
- output,
573
- parsedBody,
574
- errorCode,
575
- });
576
- }
577
- };
578
- const de_IdempotentParameterMismatchExceptionRes = async (parsedOutput, context) => {
579
- const body = parsedOutput.body;
580
- const deserialized = _json(body);
581
- const exception = new IdempotentParameterMismatchException({
582
- $metadata: deserializeMetadata(parsedOutput),
583
- ...deserialized,
584
- });
585
- return __decorateServiceException(exception, body);
586
- };
587
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
588
- const body = parsedOutput.body;
589
- const deserialized = _json(body);
590
- const exception = new InternalServerException({
591
- $metadata: deserializeMetadata(parsedOutput),
592
- ...deserialized,
593
- });
594
- return __decorateServiceException(exception, body);
595
- };
596
- const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
597
- const body = parsedOutput.body;
598
- const deserialized = _json(body);
599
- const exception = new InvalidInputException({
600
- $metadata: deserializeMetadata(parsedOutput),
601
- ...deserialized,
602
- });
603
- return __decorateServiceException(exception, body);
604
- };
605
- const de_InvalidTagExceptionRes = async (parsedOutput, context) => {
606
- const body = parsedOutput.body;
607
- const deserialized = _json(body);
608
- const exception = new InvalidTagException({
609
- $metadata: deserializeMetadata(parsedOutput),
610
- ...deserialized,
611
- });
612
- return __decorateServiceException(exception, body);
613
- };
614
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
615
- const body = parsedOutput.body;
616
- const deserialized = _json(body);
617
- const exception = new LimitExceededException({
618
- $metadata: deserializeMetadata(parsedOutput),
619
- ...deserialized,
620
- });
621
- return __decorateServiceException(exception, body);
622
- };
623
- const de_PredictorNotMountedExceptionRes = async (parsedOutput, context) => {
624
- const body = parsedOutput.body;
625
- const deserialized = _json(body);
626
- const exception = new PredictorNotMountedException({
627
- $metadata: deserializeMetadata(parsedOutput),
628
- ...deserialized,
629
- });
630
- return __decorateServiceException(exception, body);
631
- };
632
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
633
- const body = parsedOutput.body;
634
- const deserialized = _json(body);
635
- const exception = new ResourceNotFoundException({
636
- $metadata: deserializeMetadata(parsedOutput),
637
- ...deserialized,
638
- });
639
- return __decorateServiceException(exception, body);
640
- };
641
- const de_TagLimitExceededExceptionRes = async (parsedOutput, context) => {
642
- const body = parsedOutput.body;
643
- const deserialized = _json(body);
644
- const exception = new TagLimitExceededException({
645
- $metadata: deserializeMetadata(parsedOutput),
646
- ...deserialized,
647
- });
648
- return __decorateServiceException(exception, body);
649
- };
650
- const se_UpdateMLModelInput = (input, context) => {
651
- return take(input, {
652
- MLModelId: [],
653
- MLModelName: [],
654
- ScoreThreshold: __serializeFloat,
655
- });
656
- };
657
- const de_BatchPrediction = (output, context) => {
658
- return take(output, {
659
- BatchPredictionDataSourceId: __expectString,
660
- BatchPredictionId: __expectString,
661
- ComputeTime: __expectLong,
662
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
663
- CreatedByIamUser: __expectString,
664
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
665
- InputDataLocationS3: __expectString,
666
- InvalidRecordCount: __expectLong,
667
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
668
- MLModelId: __expectString,
669
- Message: __expectString,
670
- Name: __expectString,
671
- OutputUri: __expectString,
672
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
673
- Status: __expectString,
674
- TotalRecordCount: __expectLong,
675
- });
676
- };
677
- const de_BatchPredictions = (output, context) => {
678
- const retVal = (output || [])
679
- .filter((e) => e != null)
680
- .map((entry) => {
681
- return de_BatchPrediction(entry, context);
682
- });
683
- return retVal;
684
- };
685
- const de_CreateRealtimeEndpointOutput = (output, context) => {
686
- return take(output, {
687
- MLModelId: __expectString,
688
- RealtimeEndpointInfo: (_) => de_RealtimeEndpointInfo(_, context),
689
- });
690
- };
691
- const de_DataSource = (output, context) => {
692
- return take(output, {
693
- ComputeStatistics: __expectBoolean,
694
- ComputeTime: __expectLong,
695
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
696
- CreatedByIamUser: __expectString,
697
- DataLocationS3: __expectString,
698
- DataRearrangement: __expectString,
699
- DataSizeInBytes: __expectLong,
700
- DataSourceId: __expectString,
701
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
702
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
703
- Message: __expectString,
704
- Name: __expectString,
705
- NumberOfFiles: __expectLong,
706
- RDSMetadata: _json,
707
- RedshiftMetadata: _json,
708
- RoleARN: __expectString,
709
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
710
- Status: __expectString,
711
- });
712
- };
713
- const de_DataSources = (output, context) => {
714
- const retVal = (output || [])
715
- .filter((e) => e != null)
716
- .map((entry) => {
717
- return de_DataSource(entry, context);
718
- });
719
- return retVal;
720
- };
721
- const de_DeleteRealtimeEndpointOutput = (output, context) => {
722
- return take(output, {
723
- MLModelId: __expectString,
724
- RealtimeEndpointInfo: (_) => de_RealtimeEndpointInfo(_, context),
725
- });
726
- };
727
- const de_DescribeBatchPredictionsOutput = (output, context) => {
728
- return take(output, {
729
- NextToken: __expectString,
730
- Results: (_) => de_BatchPredictions(_, context),
731
- });
732
- };
733
- const de_DescribeDataSourcesOutput = (output, context) => {
734
- return take(output, {
735
- NextToken: __expectString,
736
- Results: (_) => de_DataSources(_, context),
737
- });
738
- };
739
- const de_DescribeEvaluationsOutput = (output, context) => {
740
- return take(output, {
741
- NextToken: __expectString,
742
- Results: (_) => de_Evaluations(_, context),
743
- });
744
- };
745
- const de_DescribeMLModelsOutput = (output, context) => {
746
- return take(output, {
747
- NextToken: __expectString,
748
- Results: (_) => de_MLModels(_, context),
749
- });
750
- };
751
- const de_Evaluation = (output, context) => {
752
- return take(output, {
753
- ComputeTime: __expectLong,
754
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
755
- CreatedByIamUser: __expectString,
756
- EvaluationDataSourceId: __expectString,
757
- EvaluationId: __expectString,
758
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
759
- InputDataLocationS3: __expectString,
760
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
761
- MLModelId: __expectString,
762
- Message: __expectString,
763
- Name: __expectString,
764
- PerformanceMetrics: _json,
765
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
766
- Status: __expectString,
767
- });
768
- };
769
- const de_Evaluations = (output, context) => {
770
- const retVal = (output || [])
771
- .filter((e) => e != null)
772
- .map((entry) => {
773
- return de_Evaluation(entry, context);
774
- });
775
- return retVal;
776
- };
777
- const de_GetBatchPredictionOutput = (output, context) => {
778
- return take(output, {
779
- BatchPredictionDataSourceId: __expectString,
780
- BatchPredictionId: __expectString,
781
- ComputeTime: __expectLong,
782
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
783
- CreatedByIamUser: __expectString,
784
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
785
- InputDataLocationS3: __expectString,
786
- InvalidRecordCount: __expectLong,
787
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
788
- LogUri: __expectString,
789
- MLModelId: __expectString,
790
- Message: __expectString,
791
- Name: __expectString,
792
- OutputUri: __expectString,
793
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
794
- Status: __expectString,
795
- TotalRecordCount: __expectLong,
796
- });
797
- };
798
- const de_GetDataSourceOutput = (output, context) => {
799
- return take(output, {
800
- ComputeStatistics: __expectBoolean,
801
- ComputeTime: __expectLong,
802
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
803
- CreatedByIamUser: __expectString,
804
- DataLocationS3: __expectString,
805
- DataRearrangement: __expectString,
806
- DataSizeInBytes: __expectLong,
807
- DataSourceId: __expectString,
808
- DataSourceSchema: __expectString,
809
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
810
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
811
- LogUri: __expectString,
812
- Message: __expectString,
813
- Name: __expectString,
814
- NumberOfFiles: __expectLong,
815
- RDSMetadata: _json,
816
- RedshiftMetadata: _json,
817
- RoleARN: __expectString,
818
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
819
- Status: __expectString,
820
- });
821
- };
822
- const de_GetEvaluationOutput = (output, context) => {
823
- return take(output, {
824
- ComputeTime: __expectLong,
825
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
826
- CreatedByIamUser: __expectString,
827
- EvaluationDataSourceId: __expectString,
828
- EvaluationId: __expectString,
829
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
830
- InputDataLocationS3: __expectString,
831
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
832
- LogUri: __expectString,
833
- MLModelId: __expectString,
834
- Message: __expectString,
835
- Name: __expectString,
836
- PerformanceMetrics: _json,
837
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
838
- Status: __expectString,
839
- });
840
- };
841
- const de_GetMLModelOutput = (output, context) => {
842
- return take(output, {
843
- ComputeTime: __expectLong,
844
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
845
- CreatedByIamUser: __expectString,
846
- EndpointInfo: (_) => de_RealtimeEndpointInfo(_, context),
847
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
848
- InputDataLocationS3: __expectString,
849
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
850
- LogUri: __expectString,
851
- MLModelId: __expectString,
852
- MLModelType: __expectString,
853
- Message: __expectString,
854
- Name: __expectString,
855
- Recipe: __expectString,
856
- Schema: __expectString,
857
- ScoreThreshold: __limitedParseFloat32,
858
- ScoreThresholdLastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
859
- SizeInBytes: __expectLong,
860
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
861
- Status: __expectString,
862
- TrainingDataSourceId: __expectString,
863
- TrainingParameters: _json,
864
- });
865
- };
866
- const de_MLModel = (output, context) => {
867
- return take(output, {
868
- Algorithm: __expectString,
869
- ComputeTime: __expectLong,
870
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
871
- CreatedByIamUser: __expectString,
872
- EndpointInfo: (_) => de_RealtimeEndpointInfo(_, context),
873
- FinishedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
874
- InputDataLocationS3: __expectString,
875
- LastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
876
- MLModelId: __expectString,
877
- MLModelType: __expectString,
878
- Message: __expectString,
879
- Name: __expectString,
880
- ScoreThreshold: __limitedParseFloat32,
881
- ScoreThresholdLastUpdatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
882
- SizeInBytes: __expectLong,
883
- StartedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
884
- Status: __expectString,
885
- TrainingDataSourceId: __expectString,
886
- TrainingParameters: _json,
887
- });
888
- };
889
- const de_MLModels = (output, context) => {
890
- const retVal = (output || [])
891
- .filter((e) => e != null)
892
- .map((entry) => {
893
- return de_MLModel(entry, context);
894
- });
895
- return retVal;
896
- };
897
- const de_Prediction = (output, context) => {
898
- return take(output, {
899
- details: _json,
900
- predictedLabel: __expectString,
901
- predictedScores: (_) => de_ScoreValuePerLabelMap(_, context),
902
- predictedValue: __limitedParseFloat32,
903
- });
904
- };
905
- const de_PredictOutput = (output, context) => {
906
- return take(output, {
907
- Prediction: (_) => de_Prediction(_, context),
908
- });
909
- };
910
- const de_RealtimeEndpointInfo = (output, context) => {
911
- return take(output, {
912
- CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
913
- EndpointStatus: __expectString,
914
- EndpointUrl: __expectString,
915
- PeakRequestsPerSecond: __expectInt32,
916
- });
917
- };
918
- const de_ScoreValuePerLabelMap = (output, context) => {
919
- return Object.entries(output).reduce((acc, [key, value]) => {
920
- if (value === null) {
921
- return acc;
922
- }
923
- acc[key] = __limitedParseFloat32(value);
924
- return acc;
925
- }, {});
926
- };
927
- const deserializeMetadata = (output) => ({
928
- httpStatusCode: output.statusCode,
929
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
930
- extendedRequestId: output.headers["x-amz-id-2"],
931
- cfId: output.headers["x-amz-cf-id"],
932
- });
933
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
934
- const throwDefaultError = withBaseException(__BaseException);
935
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
936
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
937
- const contents = {
938
- protocol,
939
- hostname,
940
- port,
941
- method: "POST",
942
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
943
- headers,
944
- };
945
- if (resolvedHostname !== undefined) {
946
- contents.hostname = resolvedHostname;
947
- }
948
- if (body !== undefined) {
949
- contents.body = body;
950
- }
951
- return new __HttpRequest(contents);
952
- };
953
- function sharedHeaders(operation) {
954
- return {
955
- "content-type": "application/x-amz-json-1.1",
956
- "x-amz-target": `AmazonML_20141212.${operation}`,
957
- };
958
- }