@aws-sdk/client-machine-learning 3.35.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 (246) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist-cjs/MachineLearning.js +0 -1
  3. package/dist-cjs/MachineLearningClient.js +0 -1
  4. package/dist-cjs/commands/AddTagsCommand.js +0 -1
  5. package/dist-cjs/commands/CreateBatchPredictionCommand.js +0 -1
  6. package/dist-cjs/commands/CreateDataSourceFromRDSCommand.js +0 -1
  7. package/dist-cjs/commands/CreateDataSourceFromRedshiftCommand.js +0 -1
  8. package/dist-cjs/commands/CreateDataSourceFromS3Command.js +0 -1
  9. package/dist-cjs/commands/CreateEvaluationCommand.js +0 -1
  10. package/dist-cjs/commands/CreateMLModelCommand.js +0 -1
  11. package/dist-cjs/commands/CreateRealtimeEndpointCommand.js +0 -1
  12. package/dist-cjs/commands/DeleteBatchPredictionCommand.js +0 -1
  13. package/dist-cjs/commands/DeleteDataSourceCommand.js +0 -1
  14. package/dist-cjs/commands/DeleteEvaluationCommand.js +0 -1
  15. package/dist-cjs/commands/DeleteMLModelCommand.js +0 -1
  16. package/dist-cjs/commands/DeleteRealtimeEndpointCommand.js +0 -1
  17. package/dist-cjs/commands/DeleteTagsCommand.js +0 -1
  18. package/dist-cjs/commands/DescribeBatchPredictionsCommand.js +0 -1
  19. package/dist-cjs/commands/DescribeDataSourcesCommand.js +0 -1
  20. package/dist-cjs/commands/DescribeEvaluationsCommand.js +0 -1
  21. package/dist-cjs/commands/DescribeMLModelsCommand.js +0 -1
  22. package/dist-cjs/commands/DescribeTagsCommand.js +0 -1
  23. package/dist-cjs/commands/GetBatchPredictionCommand.js +0 -1
  24. package/dist-cjs/commands/GetDataSourceCommand.js +0 -1
  25. package/dist-cjs/commands/GetEvaluationCommand.js +0 -1
  26. package/dist-cjs/commands/GetMLModelCommand.js +0 -1
  27. package/dist-cjs/commands/PredictCommand.js +0 -1
  28. package/dist-cjs/commands/UpdateBatchPredictionCommand.js +0 -1
  29. package/dist-cjs/commands/UpdateDataSourceCommand.js +0 -1
  30. package/dist-cjs/commands/UpdateEvaluationCommand.js +0 -1
  31. package/dist-cjs/commands/UpdateMLModelCommand.js +0 -1
  32. package/dist-cjs/endpoints.js +0 -1
  33. package/dist-cjs/index.js +0 -1
  34. package/dist-cjs/models/index.js +0 -1
  35. package/dist-cjs/models/models_0.js +0 -1
  36. package/dist-cjs/pagination/DescribeBatchPredictionsPaginator.js +0 -1
  37. package/dist-cjs/pagination/DescribeDataSourcesPaginator.js +0 -1
  38. package/dist-cjs/pagination/DescribeEvaluationsPaginator.js +0 -1
  39. package/dist-cjs/pagination/DescribeMLModelsPaginator.js +0 -1
  40. package/dist-cjs/pagination/Interfaces.js +0 -1
  41. package/dist-cjs/protocols/Aws_json1_1.js +0 -1
  42. package/dist-cjs/runtimeConfig.browser.js +2 -3
  43. package/dist-cjs/runtimeConfig.js +3 -4
  44. package/dist-cjs/runtimeConfig.native.js +0 -1
  45. package/dist-cjs/runtimeConfig.shared.js +0 -1
  46. package/dist-cjs/waiters/waitForBatchPredictionAvailable.js +0 -1
  47. package/dist-cjs/waiters/waitForDataSourceAvailable.js +0 -1
  48. package/dist-cjs/waiters/waitForEvaluationAvailable.js +0 -1
  49. package/dist-cjs/waiters/waitForMLModelAvailable.js +0 -1
  50. package/dist-es/MachineLearning.js +0 -1
  51. package/dist-es/MachineLearningClient.js +0 -1
  52. package/dist-es/commands/AddTagsCommand.js +0 -1
  53. package/dist-es/commands/CreateBatchPredictionCommand.js +0 -1
  54. package/dist-es/commands/CreateDataSourceFromRDSCommand.js +0 -1
  55. package/dist-es/commands/CreateDataSourceFromRedshiftCommand.js +0 -1
  56. package/dist-es/commands/CreateDataSourceFromS3Command.js +0 -1
  57. package/dist-es/commands/CreateEvaluationCommand.js +0 -1
  58. package/dist-es/commands/CreateMLModelCommand.js +0 -1
  59. package/dist-es/commands/CreateRealtimeEndpointCommand.js +0 -1
  60. package/dist-es/commands/DeleteBatchPredictionCommand.js +0 -1
  61. package/dist-es/commands/DeleteDataSourceCommand.js +0 -1
  62. package/dist-es/commands/DeleteEvaluationCommand.js +0 -1
  63. package/dist-es/commands/DeleteMLModelCommand.js +0 -1
  64. package/dist-es/commands/DeleteRealtimeEndpointCommand.js +0 -1
  65. package/dist-es/commands/DeleteTagsCommand.js +0 -1
  66. package/dist-es/commands/DescribeBatchPredictionsCommand.js +0 -1
  67. package/dist-es/commands/DescribeDataSourcesCommand.js +0 -1
  68. package/dist-es/commands/DescribeEvaluationsCommand.js +0 -1
  69. package/dist-es/commands/DescribeMLModelsCommand.js +0 -1
  70. package/dist-es/commands/DescribeTagsCommand.js +0 -1
  71. package/dist-es/commands/GetBatchPredictionCommand.js +0 -1
  72. package/dist-es/commands/GetDataSourceCommand.js +0 -1
  73. package/dist-es/commands/GetEvaluationCommand.js +0 -1
  74. package/dist-es/commands/GetMLModelCommand.js +0 -1
  75. package/dist-es/commands/PredictCommand.js +0 -1
  76. package/dist-es/commands/UpdateBatchPredictionCommand.js +0 -1
  77. package/dist-es/commands/UpdateDataSourceCommand.js +0 -1
  78. package/dist-es/commands/UpdateEvaluationCommand.js +0 -1
  79. package/dist-es/commands/UpdateMLModelCommand.js +0 -1
  80. package/dist-es/endpoints.js +0 -1
  81. package/dist-es/index.js +0 -1
  82. package/dist-es/models/index.js +0 -1
  83. package/dist-es/models/models_0.js +0 -1
  84. package/dist-es/pagination/DescribeBatchPredictionsPaginator.js +0 -1
  85. package/dist-es/pagination/DescribeDataSourcesPaginator.js +0 -1
  86. package/dist-es/pagination/DescribeEvaluationsPaginator.js +0 -1
  87. package/dist-es/pagination/DescribeMLModelsPaginator.js +0 -1
  88. package/dist-es/pagination/Interfaces.js +0 -1
  89. package/dist-es/protocols/Aws_json1_1.js +0 -1
  90. package/dist-es/runtimeConfig.browser.js +1 -2
  91. package/dist-es/runtimeConfig.js +2 -3
  92. package/dist-es/runtimeConfig.native.js +0 -1
  93. package/dist-es/runtimeConfig.shared.js +0 -1
  94. package/dist-es/waiters/waitForBatchPredictionAvailable.js +0 -1
  95. package/dist-es/waiters/waitForDataSourceAvailable.js +0 -1
  96. package/dist-es/waiters/waitForEvaluationAvailable.js +0 -1
  97. package/dist-es/waiters/waitForMLModelAvailable.js +0 -1
  98. package/package.json +35 -32
  99. package/dist-cjs/MachineLearning.js.map +0 -1
  100. package/dist-cjs/MachineLearningClient.js.map +0 -1
  101. package/dist-cjs/commands/AddTagsCommand.js.map +0 -1
  102. package/dist-cjs/commands/CreateBatchPredictionCommand.js.map +0 -1
  103. package/dist-cjs/commands/CreateDataSourceFromRDSCommand.js.map +0 -1
  104. package/dist-cjs/commands/CreateDataSourceFromRedshiftCommand.js.map +0 -1
  105. package/dist-cjs/commands/CreateDataSourceFromS3Command.js.map +0 -1
  106. package/dist-cjs/commands/CreateEvaluationCommand.js.map +0 -1
  107. package/dist-cjs/commands/CreateMLModelCommand.js.map +0 -1
  108. package/dist-cjs/commands/CreateRealtimeEndpointCommand.js.map +0 -1
  109. package/dist-cjs/commands/DeleteBatchPredictionCommand.js.map +0 -1
  110. package/dist-cjs/commands/DeleteDataSourceCommand.js.map +0 -1
  111. package/dist-cjs/commands/DeleteEvaluationCommand.js.map +0 -1
  112. package/dist-cjs/commands/DeleteMLModelCommand.js.map +0 -1
  113. package/dist-cjs/commands/DeleteRealtimeEndpointCommand.js.map +0 -1
  114. package/dist-cjs/commands/DeleteTagsCommand.js.map +0 -1
  115. package/dist-cjs/commands/DescribeBatchPredictionsCommand.js.map +0 -1
  116. package/dist-cjs/commands/DescribeDataSourcesCommand.js.map +0 -1
  117. package/dist-cjs/commands/DescribeEvaluationsCommand.js.map +0 -1
  118. package/dist-cjs/commands/DescribeMLModelsCommand.js.map +0 -1
  119. package/dist-cjs/commands/DescribeTagsCommand.js.map +0 -1
  120. package/dist-cjs/commands/GetBatchPredictionCommand.js.map +0 -1
  121. package/dist-cjs/commands/GetDataSourceCommand.js.map +0 -1
  122. package/dist-cjs/commands/GetEvaluationCommand.js.map +0 -1
  123. package/dist-cjs/commands/GetMLModelCommand.js.map +0 -1
  124. package/dist-cjs/commands/PredictCommand.js.map +0 -1
  125. package/dist-cjs/commands/UpdateBatchPredictionCommand.js.map +0 -1
  126. package/dist-cjs/commands/UpdateDataSourceCommand.js.map +0 -1
  127. package/dist-cjs/commands/UpdateEvaluationCommand.js.map +0 -1
  128. package/dist-cjs/commands/UpdateMLModelCommand.js.map +0 -1
  129. package/dist-cjs/endpoints.js.map +0 -1
  130. package/dist-cjs/index.js.map +0 -1
  131. package/dist-cjs/models/index.js.map +0 -1
  132. package/dist-cjs/models/models_0.js.map +0 -1
  133. package/dist-cjs/pagination/DescribeBatchPredictionsPaginator.js.map +0 -1
  134. package/dist-cjs/pagination/DescribeDataSourcesPaginator.js.map +0 -1
  135. package/dist-cjs/pagination/DescribeEvaluationsPaginator.js.map +0 -1
  136. package/dist-cjs/pagination/DescribeMLModelsPaginator.js.map +0 -1
  137. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  138. package/dist-cjs/protocols/Aws_json1_1.js.map +0 -1
  139. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  140. package/dist-cjs/runtimeConfig.js.map +0 -1
  141. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  142. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  143. package/dist-cjs/waiters/waitForBatchPredictionAvailable.js.map +0 -1
  144. package/dist-cjs/waiters/waitForDataSourceAvailable.js.map +0 -1
  145. package/dist-cjs/waiters/waitForEvaluationAvailable.js.map +0 -1
  146. package/dist-cjs/waiters/waitForMLModelAvailable.js.map +0 -1
  147. package/dist-es/MachineLearning.js.map +0 -1
  148. package/dist-es/MachineLearningClient.js.map +0 -1
  149. package/dist-es/commands/AddTagsCommand.js.map +0 -1
  150. package/dist-es/commands/CreateBatchPredictionCommand.js.map +0 -1
  151. package/dist-es/commands/CreateDataSourceFromRDSCommand.js.map +0 -1
  152. package/dist-es/commands/CreateDataSourceFromRedshiftCommand.js.map +0 -1
  153. package/dist-es/commands/CreateDataSourceFromS3Command.js.map +0 -1
  154. package/dist-es/commands/CreateEvaluationCommand.js.map +0 -1
  155. package/dist-es/commands/CreateMLModelCommand.js.map +0 -1
  156. package/dist-es/commands/CreateRealtimeEndpointCommand.js.map +0 -1
  157. package/dist-es/commands/DeleteBatchPredictionCommand.js.map +0 -1
  158. package/dist-es/commands/DeleteDataSourceCommand.js.map +0 -1
  159. package/dist-es/commands/DeleteEvaluationCommand.js.map +0 -1
  160. package/dist-es/commands/DeleteMLModelCommand.js.map +0 -1
  161. package/dist-es/commands/DeleteRealtimeEndpointCommand.js.map +0 -1
  162. package/dist-es/commands/DeleteTagsCommand.js.map +0 -1
  163. package/dist-es/commands/DescribeBatchPredictionsCommand.js.map +0 -1
  164. package/dist-es/commands/DescribeDataSourcesCommand.js.map +0 -1
  165. package/dist-es/commands/DescribeEvaluationsCommand.js.map +0 -1
  166. package/dist-es/commands/DescribeMLModelsCommand.js.map +0 -1
  167. package/dist-es/commands/DescribeTagsCommand.js.map +0 -1
  168. package/dist-es/commands/GetBatchPredictionCommand.js.map +0 -1
  169. package/dist-es/commands/GetDataSourceCommand.js.map +0 -1
  170. package/dist-es/commands/GetEvaluationCommand.js.map +0 -1
  171. package/dist-es/commands/GetMLModelCommand.js.map +0 -1
  172. package/dist-es/commands/PredictCommand.js.map +0 -1
  173. package/dist-es/commands/UpdateBatchPredictionCommand.js.map +0 -1
  174. package/dist-es/commands/UpdateDataSourceCommand.js.map +0 -1
  175. package/dist-es/commands/UpdateEvaluationCommand.js.map +0 -1
  176. package/dist-es/commands/UpdateMLModelCommand.js.map +0 -1
  177. package/dist-es/endpoints.js.map +0 -1
  178. package/dist-es/index.js.map +0 -1
  179. package/dist-es/models/index.js.map +0 -1
  180. package/dist-es/models/models_0.js.map +0 -1
  181. package/dist-es/pagination/DescribeBatchPredictionsPaginator.js.map +0 -1
  182. package/dist-es/pagination/DescribeDataSourcesPaginator.js.map +0 -1
  183. package/dist-es/pagination/DescribeEvaluationsPaginator.js.map +0 -1
  184. package/dist-es/pagination/DescribeMLModelsPaginator.js.map +0 -1
  185. package/dist-es/pagination/Interfaces.js.map +0 -1
  186. package/dist-es/protocols/Aws_json1_1.js.map +0 -1
  187. package/dist-es/runtimeConfig.browser.js.map +0 -1
  188. package/dist-es/runtimeConfig.js.map +0 -1
  189. package/dist-es/runtimeConfig.native.js.map +0 -1
  190. package/dist-es/runtimeConfig.shared.js.map +0 -1
  191. package/dist-es/waiters/waitForBatchPredictionAvailable.js.map +0 -1
  192. package/dist-es/waiters/waitForDataSourceAvailable.js.map +0 -1
  193. package/dist-es/waiters/waitForEvaluationAvailable.js.map +0 -1
  194. package/dist-es/waiters/waitForMLModelAvailable.js.map +0 -1
  195. package/jest.config.js +0 -4
  196. package/src/MachineLearning.ts +0 -1150
  197. package/src/MachineLearningClient.ts +0 -354
  198. package/src/commands/AddTagsCommand.ts +0 -94
  199. package/src/commands/CreateBatchPredictionCommand.ts +0 -106
  200. package/src/commands/CreateDataSourceFromRDSCommand.ts +0 -106
  201. package/src/commands/CreateDataSourceFromRedshiftCommand.ts +0 -132
  202. package/src/commands/CreateDataSourceFromS3Command.ts +0 -125
  203. package/src/commands/CreateEvaluationCommand.ts +0 -106
  204. package/src/commands/CreateMLModelCommand.ts +0 -114
  205. package/src/commands/CreateRealtimeEndpointCommand.ts +0 -95
  206. package/src/commands/DeleteBatchPredictionCommand.ts +0 -100
  207. package/src/commands/DeleteDataSourceCommand.ts +0 -98
  208. package/src/commands/DeleteEvaluationCommand.ts +0 -100
  209. package/src/commands/DeleteMLModelCommand.ts +0 -100
  210. package/src/commands/DeleteRealtimeEndpointCommand.ts +0 -95
  211. package/src/commands/DeleteTagsCommand.ts +0 -96
  212. package/src/commands/DescribeBatchPredictionsCommand.ts +0 -95
  213. package/src/commands/DescribeDataSourcesCommand.ts +0 -95
  214. package/src/commands/DescribeEvaluationsCommand.ts +0 -95
  215. package/src/commands/DescribeMLModelsCommand.ts +0 -95
  216. package/src/commands/DescribeTagsCommand.ts +0 -95
  217. package/src/commands/GetBatchPredictionCommand.ts +0 -96
  218. package/src/commands/GetDataSourceCommand.ts +0 -98
  219. package/src/commands/GetEvaluationCommand.ts +0 -95
  220. package/src/commands/GetMLModelCommand.ts +0 -97
  221. package/src/commands/PredictCommand.ts +0 -97
  222. package/src/commands/UpdateBatchPredictionCommand.ts +0 -96
  223. package/src/commands/UpdateDataSourceCommand.ts +0 -96
  224. package/src/commands/UpdateEvaluationCommand.ts +0 -96
  225. package/src/commands/UpdateMLModelCommand.ts +0 -96
  226. package/src/endpoints.ts +0 -57
  227. package/src/index.ts +0 -40
  228. package/src/models/index.ts +0 -1
  229. package/src/models/models_0.ts +0 -4066
  230. package/src/pagination/DescribeBatchPredictionsPaginator.ts +0 -59
  231. package/src/pagination/DescribeDataSourcesPaginator.ts +0 -59
  232. package/src/pagination/DescribeEvaluationsPaginator.ts +0 -59
  233. package/src/pagination/DescribeMLModelsPaginator.ts +0 -59
  234. package/src/pagination/Interfaces.ts +0 -8
  235. package/src/protocols/Aws_json1_1.ts +0 -3958
  236. package/src/runtimeConfig.browser.ts +0 -41
  237. package/src/runtimeConfig.native.ts +0 -17
  238. package/src/runtimeConfig.shared.ts +0 -17
  239. package/src/runtimeConfig.ts +0 -46
  240. package/src/waiters/waitForBatchPredictionAvailable.ts +0 -75
  241. package/src/waiters/waitForDataSourceAvailable.ts +0 -72
  242. package/src/waiters/waitForEvaluationAvailable.ts +0 -72
  243. package/src/waiters/waitForMLModelAvailable.ts +0 -72
  244. package/tsconfig.es.json +0 -10
  245. package/tsconfig.json +0 -33
  246. package/tsconfig.types.json +0 -9
@@ -1,3958 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectBoolean as __expectBoolean,
4
- expectInt32 as __expectInt32,
5
- expectLong as __expectLong,
6
- expectNonNull as __expectNonNull,
7
- expectNumber as __expectNumber,
8
- expectString as __expectString,
9
- limitedParseFloat32 as __limitedParseFloat32,
10
- parseEpochTimestamp as __parseEpochTimestamp,
11
- serializeFloat as __serializeFloat,
12
- } from "@aws-sdk/smithy-client";
13
- import {
14
- Endpoint as __Endpoint,
15
- HeaderBag as __HeaderBag,
16
- MetadataBearer as __MetadataBearer,
17
- ResponseMetadata as __ResponseMetadata,
18
- SerdeContext as __SerdeContext,
19
- SmithyException as __SmithyException,
20
- } from "@aws-sdk/types";
21
-
22
- import { AddTagsCommandInput, AddTagsCommandOutput } from "../commands/AddTagsCommand";
23
- import {
24
- CreateBatchPredictionCommandInput,
25
- CreateBatchPredictionCommandOutput,
26
- } from "../commands/CreateBatchPredictionCommand";
27
- import {
28
- CreateDataSourceFromRDSCommandInput,
29
- CreateDataSourceFromRDSCommandOutput,
30
- } from "../commands/CreateDataSourceFromRDSCommand";
31
- import {
32
- CreateDataSourceFromRedshiftCommandInput,
33
- CreateDataSourceFromRedshiftCommandOutput,
34
- } from "../commands/CreateDataSourceFromRedshiftCommand";
35
- import {
36
- CreateDataSourceFromS3CommandInput,
37
- CreateDataSourceFromS3CommandOutput,
38
- } from "../commands/CreateDataSourceFromS3Command";
39
- import { CreateEvaluationCommandInput, CreateEvaluationCommandOutput } from "../commands/CreateEvaluationCommand";
40
- import { CreateMLModelCommandInput, CreateMLModelCommandOutput } from "../commands/CreateMLModelCommand";
41
- import {
42
- CreateRealtimeEndpointCommandInput,
43
- CreateRealtimeEndpointCommandOutput,
44
- } from "../commands/CreateRealtimeEndpointCommand";
45
- import {
46
- DeleteBatchPredictionCommandInput,
47
- DeleteBatchPredictionCommandOutput,
48
- } from "../commands/DeleteBatchPredictionCommand";
49
- import { DeleteDataSourceCommandInput, DeleteDataSourceCommandOutput } from "../commands/DeleteDataSourceCommand";
50
- import { DeleteEvaluationCommandInput, DeleteEvaluationCommandOutput } from "../commands/DeleteEvaluationCommand";
51
- import { DeleteMLModelCommandInput, DeleteMLModelCommandOutput } from "../commands/DeleteMLModelCommand";
52
- import {
53
- DeleteRealtimeEndpointCommandInput,
54
- DeleteRealtimeEndpointCommandOutput,
55
- } from "../commands/DeleteRealtimeEndpointCommand";
56
- import { DeleteTagsCommandInput, DeleteTagsCommandOutput } from "../commands/DeleteTagsCommand";
57
- import {
58
- DescribeBatchPredictionsCommandInput,
59
- DescribeBatchPredictionsCommandOutput,
60
- } from "../commands/DescribeBatchPredictionsCommand";
61
- import {
62
- DescribeDataSourcesCommandInput,
63
- DescribeDataSourcesCommandOutput,
64
- } from "../commands/DescribeDataSourcesCommand";
65
- import {
66
- DescribeEvaluationsCommandInput,
67
- DescribeEvaluationsCommandOutput,
68
- } from "../commands/DescribeEvaluationsCommand";
69
- import { DescribeMLModelsCommandInput, DescribeMLModelsCommandOutput } from "../commands/DescribeMLModelsCommand";
70
- import { DescribeTagsCommandInput, DescribeTagsCommandOutput } from "../commands/DescribeTagsCommand";
71
- import { GetBatchPredictionCommandInput, GetBatchPredictionCommandOutput } from "../commands/GetBatchPredictionCommand";
72
- import { GetDataSourceCommandInput, GetDataSourceCommandOutput } from "../commands/GetDataSourceCommand";
73
- import { GetEvaluationCommandInput, GetEvaluationCommandOutput } from "../commands/GetEvaluationCommand";
74
- import { GetMLModelCommandInput, GetMLModelCommandOutput } from "../commands/GetMLModelCommand";
75
- import { PredictCommandInput, PredictCommandOutput } from "../commands/PredictCommand";
76
- import {
77
- UpdateBatchPredictionCommandInput,
78
- UpdateBatchPredictionCommandOutput,
79
- } from "../commands/UpdateBatchPredictionCommand";
80
- import { UpdateDataSourceCommandInput, UpdateDataSourceCommandOutput } from "../commands/UpdateDataSourceCommand";
81
- import { UpdateEvaluationCommandInput, UpdateEvaluationCommandOutput } from "../commands/UpdateEvaluationCommand";
82
- import { UpdateMLModelCommandInput, UpdateMLModelCommandOutput } from "../commands/UpdateMLModelCommand";
83
- import {
84
- AddTagsInput,
85
- AddTagsOutput,
86
- BatchPrediction,
87
- CreateBatchPredictionInput,
88
- CreateBatchPredictionOutput,
89
- CreateDataSourceFromRDSInput,
90
- CreateDataSourceFromRDSOutput,
91
- CreateDataSourceFromRedshiftInput,
92
- CreateDataSourceFromRedshiftOutput,
93
- CreateDataSourceFromS3Input,
94
- CreateDataSourceFromS3Output,
95
- CreateEvaluationInput,
96
- CreateEvaluationOutput,
97
- CreateMLModelInput,
98
- CreateMLModelOutput,
99
- CreateRealtimeEndpointInput,
100
- CreateRealtimeEndpointOutput,
101
- DataSource,
102
- DeleteBatchPredictionInput,
103
- DeleteBatchPredictionOutput,
104
- DeleteDataSourceInput,
105
- DeleteDataSourceOutput,
106
- DeleteEvaluationInput,
107
- DeleteEvaluationOutput,
108
- DeleteMLModelInput,
109
- DeleteMLModelOutput,
110
- DeleteRealtimeEndpointInput,
111
- DeleteRealtimeEndpointOutput,
112
- DeleteTagsInput,
113
- DeleteTagsOutput,
114
- DescribeBatchPredictionsInput,
115
- DescribeBatchPredictionsOutput,
116
- DescribeDataSourcesInput,
117
- DescribeDataSourcesOutput,
118
- DescribeEvaluationsInput,
119
- DescribeEvaluationsOutput,
120
- DescribeMLModelsInput,
121
- DescribeMLModelsOutput,
122
- DescribeTagsInput,
123
- DescribeTagsOutput,
124
- DetailsAttributes,
125
- Evaluation,
126
- GetBatchPredictionInput,
127
- GetBatchPredictionOutput,
128
- GetDataSourceInput,
129
- GetDataSourceOutput,
130
- GetEvaluationInput,
131
- GetEvaluationOutput,
132
- GetMLModelInput,
133
- GetMLModelOutput,
134
- IdempotentParameterMismatchException,
135
- InternalServerException,
136
- InvalidInputException,
137
- InvalidTagException,
138
- LimitExceededException,
139
- MLModel,
140
- PerformanceMetrics,
141
- PredictInput,
142
- Prediction,
143
- PredictorNotMountedException,
144
- PredictOutput,
145
- RDSDatabase,
146
- RDSDatabaseCredentials,
147
- RDSDataSpec,
148
- RDSMetadata,
149
- RealtimeEndpointInfo,
150
- RedshiftDatabase,
151
- RedshiftDatabaseCredentials,
152
- RedshiftDataSpec,
153
- RedshiftMetadata,
154
- ResourceNotFoundException,
155
- S3DataSpec,
156
- Tag,
157
- TagLimitExceededException,
158
- UpdateBatchPredictionInput,
159
- UpdateBatchPredictionOutput,
160
- UpdateDataSourceInput,
161
- UpdateDataSourceOutput,
162
- UpdateEvaluationInput,
163
- UpdateEvaluationOutput,
164
- UpdateMLModelInput,
165
- UpdateMLModelOutput,
166
- } from "../models/models_0";
167
-
168
- export const serializeAws_json1_1AddTagsCommand = async (
169
- input: AddTagsCommandInput,
170
- context: __SerdeContext
171
- ): Promise<__HttpRequest> => {
172
- const headers: __HeaderBag = {
173
- "content-type": "application/x-amz-json-1.1",
174
- "x-amz-target": "AmazonML_20141212.AddTags",
175
- };
176
- let body: any;
177
- body = JSON.stringify(serializeAws_json1_1AddTagsInput(input, context));
178
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
179
- };
180
-
181
- export const serializeAws_json1_1CreateBatchPredictionCommand = async (
182
- input: CreateBatchPredictionCommandInput,
183
- context: __SerdeContext
184
- ): Promise<__HttpRequest> => {
185
- const headers: __HeaderBag = {
186
- "content-type": "application/x-amz-json-1.1",
187
- "x-amz-target": "AmazonML_20141212.CreateBatchPrediction",
188
- };
189
- let body: any;
190
- body = JSON.stringify(serializeAws_json1_1CreateBatchPredictionInput(input, context));
191
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
192
- };
193
-
194
- export const serializeAws_json1_1CreateDataSourceFromRDSCommand = async (
195
- input: CreateDataSourceFromRDSCommandInput,
196
- context: __SerdeContext
197
- ): Promise<__HttpRequest> => {
198
- const headers: __HeaderBag = {
199
- "content-type": "application/x-amz-json-1.1",
200
- "x-amz-target": "AmazonML_20141212.CreateDataSourceFromRDS",
201
- };
202
- let body: any;
203
- body = JSON.stringify(serializeAws_json1_1CreateDataSourceFromRDSInput(input, context));
204
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
205
- };
206
-
207
- export const serializeAws_json1_1CreateDataSourceFromRedshiftCommand = async (
208
- input: CreateDataSourceFromRedshiftCommandInput,
209
- context: __SerdeContext
210
- ): Promise<__HttpRequest> => {
211
- const headers: __HeaderBag = {
212
- "content-type": "application/x-amz-json-1.1",
213
- "x-amz-target": "AmazonML_20141212.CreateDataSourceFromRedshift",
214
- };
215
- let body: any;
216
- body = JSON.stringify(serializeAws_json1_1CreateDataSourceFromRedshiftInput(input, context));
217
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
218
- };
219
-
220
- export const serializeAws_json1_1CreateDataSourceFromS3Command = async (
221
- input: CreateDataSourceFromS3CommandInput,
222
- context: __SerdeContext
223
- ): Promise<__HttpRequest> => {
224
- const headers: __HeaderBag = {
225
- "content-type": "application/x-amz-json-1.1",
226
- "x-amz-target": "AmazonML_20141212.CreateDataSourceFromS3",
227
- };
228
- let body: any;
229
- body = JSON.stringify(serializeAws_json1_1CreateDataSourceFromS3Input(input, context));
230
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
231
- };
232
-
233
- export const serializeAws_json1_1CreateEvaluationCommand = async (
234
- input: CreateEvaluationCommandInput,
235
- context: __SerdeContext
236
- ): Promise<__HttpRequest> => {
237
- const headers: __HeaderBag = {
238
- "content-type": "application/x-amz-json-1.1",
239
- "x-amz-target": "AmazonML_20141212.CreateEvaluation",
240
- };
241
- let body: any;
242
- body = JSON.stringify(serializeAws_json1_1CreateEvaluationInput(input, context));
243
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
244
- };
245
-
246
- export const serializeAws_json1_1CreateMLModelCommand = async (
247
- input: CreateMLModelCommandInput,
248
- context: __SerdeContext
249
- ): Promise<__HttpRequest> => {
250
- const headers: __HeaderBag = {
251
- "content-type": "application/x-amz-json-1.1",
252
- "x-amz-target": "AmazonML_20141212.CreateMLModel",
253
- };
254
- let body: any;
255
- body = JSON.stringify(serializeAws_json1_1CreateMLModelInput(input, context));
256
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
257
- };
258
-
259
- export const serializeAws_json1_1CreateRealtimeEndpointCommand = async (
260
- input: CreateRealtimeEndpointCommandInput,
261
- context: __SerdeContext
262
- ): Promise<__HttpRequest> => {
263
- const headers: __HeaderBag = {
264
- "content-type": "application/x-amz-json-1.1",
265
- "x-amz-target": "AmazonML_20141212.CreateRealtimeEndpoint",
266
- };
267
- let body: any;
268
- body = JSON.stringify(serializeAws_json1_1CreateRealtimeEndpointInput(input, context));
269
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
270
- };
271
-
272
- export const serializeAws_json1_1DeleteBatchPredictionCommand = async (
273
- input: DeleteBatchPredictionCommandInput,
274
- context: __SerdeContext
275
- ): Promise<__HttpRequest> => {
276
- const headers: __HeaderBag = {
277
- "content-type": "application/x-amz-json-1.1",
278
- "x-amz-target": "AmazonML_20141212.DeleteBatchPrediction",
279
- };
280
- let body: any;
281
- body = JSON.stringify(serializeAws_json1_1DeleteBatchPredictionInput(input, context));
282
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
283
- };
284
-
285
- export const serializeAws_json1_1DeleteDataSourceCommand = async (
286
- input: DeleteDataSourceCommandInput,
287
- context: __SerdeContext
288
- ): Promise<__HttpRequest> => {
289
- const headers: __HeaderBag = {
290
- "content-type": "application/x-amz-json-1.1",
291
- "x-amz-target": "AmazonML_20141212.DeleteDataSource",
292
- };
293
- let body: any;
294
- body = JSON.stringify(serializeAws_json1_1DeleteDataSourceInput(input, context));
295
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
296
- };
297
-
298
- export const serializeAws_json1_1DeleteEvaluationCommand = async (
299
- input: DeleteEvaluationCommandInput,
300
- context: __SerdeContext
301
- ): Promise<__HttpRequest> => {
302
- const headers: __HeaderBag = {
303
- "content-type": "application/x-amz-json-1.1",
304
- "x-amz-target": "AmazonML_20141212.DeleteEvaluation",
305
- };
306
- let body: any;
307
- body = JSON.stringify(serializeAws_json1_1DeleteEvaluationInput(input, context));
308
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
309
- };
310
-
311
- export const serializeAws_json1_1DeleteMLModelCommand = async (
312
- input: DeleteMLModelCommandInput,
313
- context: __SerdeContext
314
- ): Promise<__HttpRequest> => {
315
- const headers: __HeaderBag = {
316
- "content-type": "application/x-amz-json-1.1",
317
- "x-amz-target": "AmazonML_20141212.DeleteMLModel",
318
- };
319
- let body: any;
320
- body = JSON.stringify(serializeAws_json1_1DeleteMLModelInput(input, context));
321
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
322
- };
323
-
324
- export const serializeAws_json1_1DeleteRealtimeEndpointCommand = async (
325
- input: DeleteRealtimeEndpointCommandInput,
326
- context: __SerdeContext
327
- ): Promise<__HttpRequest> => {
328
- const headers: __HeaderBag = {
329
- "content-type": "application/x-amz-json-1.1",
330
- "x-amz-target": "AmazonML_20141212.DeleteRealtimeEndpoint",
331
- };
332
- let body: any;
333
- body = JSON.stringify(serializeAws_json1_1DeleteRealtimeEndpointInput(input, context));
334
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
335
- };
336
-
337
- export const serializeAws_json1_1DeleteTagsCommand = async (
338
- input: DeleteTagsCommandInput,
339
- context: __SerdeContext
340
- ): Promise<__HttpRequest> => {
341
- const headers: __HeaderBag = {
342
- "content-type": "application/x-amz-json-1.1",
343
- "x-amz-target": "AmazonML_20141212.DeleteTags",
344
- };
345
- let body: any;
346
- body = JSON.stringify(serializeAws_json1_1DeleteTagsInput(input, context));
347
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
348
- };
349
-
350
- export const serializeAws_json1_1DescribeBatchPredictionsCommand = async (
351
- input: DescribeBatchPredictionsCommandInput,
352
- context: __SerdeContext
353
- ): Promise<__HttpRequest> => {
354
- const headers: __HeaderBag = {
355
- "content-type": "application/x-amz-json-1.1",
356
- "x-amz-target": "AmazonML_20141212.DescribeBatchPredictions",
357
- };
358
- let body: any;
359
- body = JSON.stringify(serializeAws_json1_1DescribeBatchPredictionsInput(input, context));
360
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
361
- };
362
-
363
- export const serializeAws_json1_1DescribeDataSourcesCommand = async (
364
- input: DescribeDataSourcesCommandInput,
365
- context: __SerdeContext
366
- ): Promise<__HttpRequest> => {
367
- const headers: __HeaderBag = {
368
- "content-type": "application/x-amz-json-1.1",
369
- "x-amz-target": "AmazonML_20141212.DescribeDataSources",
370
- };
371
- let body: any;
372
- body = JSON.stringify(serializeAws_json1_1DescribeDataSourcesInput(input, context));
373
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
374
- };
375
-
376
- export const serializeAws_json1_1DescribeEvaluationsCommand = async (
377
- input: DescribeEvaluationsCommandInput,
378
- context: __SerdeContext
379
- ): Promise<__HttpRequest> => {
380
- const headers: __HeaderBag = {
381
- "content-type": "application/x-amz-json-1.1",
382
- "x-amz-target": "AmazonML_20141212.DescribeEvaluations",
383
- };
384
- let body: any;
385
- body = JSON.stringify(serializeAws_json1_1DescribeEvaluationsInput(input, context));
386
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
387
- };
388
-
389
- export const serializeAws_json1_1DescribeMLModelsCommand = async (
390
- input: DescribeMLModelsCommandInput,
391
- context: __SerdeContext
392
- ): Promise<__HttpRequest> => {
393
- const headers: __HeaderBag = {
394
- "content-type": "application/x-amz-json-1.1",
395
- "x-amz-target": "AmazonML_20141212.DescribeMLModels",
396
- };
397
- let body: any;
398
- body = JSON.stringify(serializeAws_json1_1DescribeMLModelsInput(input, context));
399
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
400
- };
401
-
402
- export const serializeAws_json1_1DescribeTagsCommand = async (
403
- input: DescribeTagsCommandInput,
404
- context: __SerdeContext
405
- ): Promise<__HttpRequest> => {
406
- const headers: __HeaderBag = {
407
- "content-type": "application/x-amz-json-1.1",
408
- "x-amz-target": "AmazonML_20141212.DescribeTags",
409
- };
410
- let body: any;
411
- body = JSON.stringify(serializeAws_json1_1DescribeTagsInput(input, context));
412
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
413
- };
414
-
415
- export const serializeAws_json1_1GetBatchPredictionCommand = async (
416
- input: GetBatchPredictionCommandInput,
417
- context: __SerdeContext
418
- ): Promise<__HttpRequest> => {
419
- const headers: __HeaderBag = {
420
- "content-type": "application/x-amz-json-1.1",
421
- "x-amz-target": "AmazonML_20141212.GetBatchPrediction",
422
- };
423
- let body: any;
424
- body = JSON.stringify(serializeAws_json1_1GetBatchPredictionInput(input, context));
425
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
426
- };
427
-
428
- export const serializeAws_json1_1GetDataSourceCommand = async (
429
- input: GetDataSourceCommandInput,
430
- context: __SerdeContext
431
- ): Promise<__HttpRequest> => {
432
- const headers: __HeaderBag = {
433
- "content-type": "application/x-amz-json-1.1",
434
- "x-amz-target": "AmazonML_20141212.GetDataSource",
435
- };
436
- let body: any;
437
- body = JSON.stringify(serializeAws_json1_1GetDataSourceInput(input, context));
438
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
439
- };
440
-
441
- export const serializeAws_json1_1GetEvaluationCommand = async (
442
- input: GetEvaluationCommandInput,
443
- context: __SerdeContext
444
- ): Promise<__HttpRequest> => {
445
- const headers: __HeaderBag = {
446
- "content-type": "application/x-amz-json-1.1",
447
- "x-amz-target": "AmazonML_20141212.GetEvaluation",
448
- };
449
- let body: any;
450
- body = JSON.stringify(serializeAws_json1_1GetEvaluationInput(input, context));
451
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
452
- };
453
-
454
- export const serializeAws_json1_1GetMLModelCommand = async (
455
- input: GetMLModelCommandInput,
456
- context: __SerdeContext
457
- ): Promise<__HttpRequest> => {
458
- const headers: __HeaderBag = {
459
- "content-type": "application/x-amz-json-1.1",
460
- "x-amz-target": "AmazonML_20141212.GetMLModel",
461
- };
462
- let body: any;
463
- body = JSON.stringify(serializeAws_json1_1GetMLModelInput(input, context));
464
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
465
- };
466
-
467
- export const serializeAws_json1_1PredictCommand = async (
468
- input: PredictCommandInput,
469
- context: __SerdeContext
470
- ): Promise<__HttpRequest> => {
471
- const headers: __HeaderBag = {
472
- "content-type": "application/x-amz-json-1.1",
473
- "x-amz-target": "AmazonML_20141212.Predict",
474
- };
475
- let body: any;
476
- body = JSON.stringify(serializeAws_json1_1PredictInput(input, context));
477
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
478
- };
479
-
480
- export const serializeAws_json1_1UpdateBatchPredictionCommand = async (
481
- input: UpdateBatchPredictionCommandInput,
482
- context: __SerdeContext
483
- ): Promise<__HttpRequest> => {
484
- const headers: __HeaderBag = {
485
- "content-type": "application/x-amz-json-1.1",
486
- "x-amz-target": "AmazonML_20141212.UpdateBatchPrediction",
487
- };
488
- let body: any;
489
- body = JSON.stringify(serializeAws_json1_1UpdateBatchPredictionInput(input, context));
490
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
491
- };
492
-
493
- export const serializeAws_json1_1UpdateDataSourceCommand = async (
494
- input: UpdateDataSourceCommandInput,
495
- context: __SerdeContext
496
- ): Promise<__HttpRequest> => {
497
- const headers: __HeaderBag = {
498
- "content-type": "application/x-amz-json-1.1",
499
- "x-amz-target": "AmazonML_20141212.UpdateDataSource",
500
- };
501
- let body: any;
502
- body = JSON.stringify(serializeAws_json1_1UpdateDataSourceInput(input, context));
503
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
504
- };
505
-
506
- export const serializeAws_json1_1UpdateEvaluationCommand = async (
507
- input: UpdateEvaluationCommandInput,
508
- context: __SerdeContext
509
- ): Promise<__HttpRequest> => {
510
- const headers: __HeaderBag = {
511
- "content-type": "application/x-amz-json-1.1",
512
- "x-amz-target": "AmazonML_20141212.UpdateEvaluation",
513
- };
514
- let body: any;
515
- body = JSON.stringify(serializeAws_json1_1UpdateEvaluationInput(input, context));
516
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
517
- };
518
-
519
- export const serializeAws_json1_1UpdateMLModelCommand = async (
520
- input: UpdateMLModelCommandInput,
521
- context: __SerdeContext
522
- ): Promise<__HttpRequest> => {
523
- const headers: __HeaderBag = {
524
- "content-type": "application/x-amz-json-1.1",
525
- "x-amz-target": "AmazonML_20141212.UpdateMLModel",
526
- };
527
- let body: any;
528
- body = JSON.stringify(serializeAws_json1_1UpdateMLModelInput(input, context));
529
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
530
- };
531
-
532
- export const deserializeAws_json1_1AddTagsCommand = async (
533
- output: __HttpResponse,
534
- context: __SerdeContext
535
- ): Promise<AddTagsCommandOutput> => {
536
- if (output.statusCode >= 300) {
537
- return deserializeAws_json1_1AddTagsCommandError(output, context);
538
- }
539
- const data: any = await parseBody(output.body, context);
540
- let contents: any = {};
541
- contents = deserializeAws_json1_1AddTagsOutput(data, context);
542
- const response: AddTagsCommandOutput = {
543
- $metadata: deserializeMetadata(output),
544
- ...contents,
545
- };
546
- return Promise.resolve(response);
547
- };
548
-
549
- const deserializeAws_json1_1AddTagsCommandError = async (
550
- output: __HttpResponse,
551
- context: __SerdeContext
552
- ): Promise<AddTagsCommandOutput> => {
553
- const parsedOutput: any = {
554
- ...output,
555
- body: await parseBody(output.body, context),
556
- };
557
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
558
- let errorCode = "UnknownError";
559
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
560
- switch (errorCode) {
561
- case "InternalServerException":
562
- case "com.amazonaws.machinelearning#InternalServerException":
563
- response = {
564
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
565
- name: errorCode,
566
- $metadata: deserializeMetadata(output),
567
- };
568
- break;
569
- case "InvalidInputException":
570
- case "com.amazonaws.machinelearning#InvalidInputException":
571
- response = {
572
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
573
- name: errorCode,
574
- $metadata: deserializeMetadata(output),
575
- };
576
- break;
577
- case "InvalidTagException":
578
- case "com.amazonaws.machinelearning#InvalidTagException":
579
- response = {
580
- ...(await deserializeAws_json1_1InvalidTagExceptionResponse(parsedOutput, context)),
581
- name: errorCode,
582
- $metadata: deserializeMetadata(output),
583
- };
584
- break;
585
- case "ResourceNotFoundException":
586
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
587
- response = {
588
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
589
- name: errorCode,
590
- $metadata: deserializeMetadata(output),
591
- };
592
- break;
593
- case "TagLimitExceededException":
594
- case "com.amazonaws.machinelearning#TagLimitExceededException":
595
- response = {
596
- ...(await deserializeAws_json1_1TagLimitExceededExceptionResponse(parsedOutput, context)),
597
- name: errorCode,
598
- $metadata: deserializeMetadata(output),
599
- };
600
- break;
601
- default:
602
- const parsedBody = parsedOutput.body;
603
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
604
- response = {
605
- ...parsedBody,
606
- name: `${errorCode}`,
607
- message: parsedBody.message || parsedBody.Message || errorCode,
608
- $fault: "client",
609
- $metadata: deserializeMetadata(output),
610
- } as any;
611
- }
612
- const message = response.message || response.Message || errorCode;
613
- response.message = message;
614
- delete response.Message;
615
- return Promise.reject(Object.assign(new Error(message), response));
616
- };
617
-
618
- export const deserializeAws_json1_1CreateBatchPredictionCommand = async (
619
- output: __HttpResponse,
620
- context: __SerdeContext
621
- ): Promise<CreateBatchPredictionCommandOutput> => {
622
- if (output.statusCode >= 300) {
623
- return deserializeAws_json1_1CreateBatchPredictionCommandError(output, context);
624
- }
625
- const data: any = await parseBody(output.body, context);
626
- let contents: any = {};
627
- contents = deserializeAws_json1_1CreateBatchPredictionOutput(data, context);
628
- const response: CreateBatchPredictionCommandOutput = {
629
- $metadata: deserializeMetadata(output),
630
- ...contents,
631
- };
632
- return Promise.resolve(response);
633
- };
634
-
635
- const deserializeAws_json1_1CreateBatchPredictionCommandError = async (
636
- output: __HttpResponse,
637
- context: __SerdeContext
638
- ): Promise<CreateBatchPredictionCommandOutput> => {
639
- const parsedOutput: any = {
640
- ...output,
641
- body: await parseBody(output.body, context),
642
- };
643
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
644
- let errorCode = "UnknownError";
645
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
646
- switch (errorCode) {
647
- case "IdempotentParameterMismatchException":
648
- case "com.amazonaws.machinelearning#IdempotentParameterMismatchException":
649
- response = {
650
- ...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
651
- name: errorCode,
652
- $metadata: deserializeMetadata(output),
653
- };
654
- break;
655
- case "InternalServerException":
656
- case "com.amazonaws.machinelearning#InternalServerException":
657
- response = {
658
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
659
- name: errorCode,
660
- $metadata: deserializeMetadata(output),
661
- };
662
- break;
663
- case "InvalidInputException":
664
- case "com.amazonaws.machinelearning#InvalidInputException":
665
- response = {
666
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
667
- name: errorCode,
668
- $metadata: deserializeMetadata(output),
669
- };
670
- break;
671
- default:
672
- const parsedBody = parsedOutput.body;
673
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
674
- response = {
675
- ...parsedBody,
676
- name: `${errorCode}`,
677
- message: parsedBody.message || parsedBody.Message || errorCode,
678
- $fault: "client",
679
- $metadata: deserializeMetadata(output),
680
- } as any;
681
- }
682
- const message = response.message || response.Message || errorCode;
683
- response.message = message;
684
- delete response.Message;
685
- return Promise.reject(Object.assign(new Error(message), response));
686
- };
687
-
688
- export const deserializeAws_json1_1CreateDataSourceFromRDSCommand = async (
689
- output: __HttpResponse,
690
- context: __SerdeContext
691
- ): Promise<CreateDataSourceFromRDSCommandOutput> => {
692
- if (output.statusCode >= 300) {
693
- return deserializeAws_json1_1CreateDataSourceFromRDSCommandError(output, context);
694
- }
695
- const data: any = await parseBody(output.body, context);
696
- let contents: any = {};
697
- contents = deserializeAws_json1_1CreateDataSourceFromRDSOutput(data, context);
698
- const response: CreateDataSourceFromRDSCommandOutput = {
699
- $metadata: deserializeMetadata(output),
700
- ...contents,
701
- };
702
- return Promise.resolve(response);
703
- };
704
-
705
- const deserializeAws_json1_1CreateDataSourceFromRDSCommandError = async (
706
- output: __HttpResponse,
707
- context: __SerdeContext
708
- ): Promise<CreateDataSourceFromRDSCommandOutput> => {
709
- const parsedOutput: any = {
710
- ...output,
711
- body: await parseBody(output.body, context),
712
- };
713
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
714
- let errorCode = "UnknownError";
715
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
716
- switch (errorCode) {
717
- case "IdempotentParameterMismatchException":
718
- case "com.amazonaws.machinelearning#IdempotentParameterMismatchException":
719
- response = {
720
- ...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
721
- name: errorCode,
722
- $metadata: deserializeMetadata(output),
723
- };
724
- break;
725
- case "InternalServerException":
726
- case "com.amazonaws.machinelearning#InternalServerException":
727
- response = {
728
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
729
- name: errorCode,
730
- $metadata: deserializeMetadata(output),
731
- };
732
- break;
733
- case "InvalidInputException":
734
- case "com.amazonaws.machinelearning#InvalidInputException":
735
- response = {
736
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
737
- name: errorCode,
738
- $metadata: deserializeMetadata(output),
739
- };
740
- break;
741
- default:
742
- const parsedBody = parsedOutput.body;
743
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
744
- response = {
745
- ...parsedBody,
746
- name: `${errorCode}`,
747
- message: parsedBody.message || parsedBody.Message || errorCode,
748
- $fault: "client",
749
- $metadata: deserializeMetadata(output),
750
- } as any;
751
- }
752
- const message = response.message || response.Message || errorCode;
753
- response.message = message;
754
- delete response.Message;
755
- return Promise.reject(Object.assign(new Error(message), response));
756
- };
757
-
758
- export const deserializeAws_json1_1CreateDataSourceFromRedshiftCommand = async (
759
- output: __HttpResponse,
760
- context: __SerdeContext
761
- ): Promise<CreateDataSourceFromRedshiftCommandOutput> => {
762
- if (output.statusCode >= 300) {
763
- return deserializeAws_json1_1CreateDataSourceFromRedshiftCommandError(output, context);
764
- }
765
- const data: any = await parseBody(output.body, context);
766
- let contents: any = {};
767
- contents = deserializeAws_json1_1CreateDataSourceFromRedshiftOutput(data, context);
768
- const response: CreateDataSourceFromRedshiftCommandOutput = {
769
- $metadata: deserializeMetadata(output),
770
- ...contents,
771
- };
772
- return Promise.resolve(response);
773
- };
774
-
775
- const deserializeAws_json1_1CreateDataSourceFromRedshiftCommandError = async (
776
- output: __HttpResponse,
777
- context: __SerdeContext
778
- ): Promise<CreateDataSourceFromRedshiftCommandOutput> => {
779
- const parsedOutput: any = {
780
- ...output,
781
- body: await parseBody(output.body, context),
782
- };
783
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
784
- let errorCode = "UnknownError";
785
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
786
- switch (errorCode) {
787
- case "IdempotentParameterMismatchException":
788
- case "com.amazonaws.machinelearning#IdempotentParameterMismatchException":
789
- response = {
790
- ...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
791
- name: errorCode,
792
- $metadata: deserializeMetadata(output),
793
- };
794
- break;
795
- case "InternalServerException":
796
- case "com.amazonaws.machinelearning#InternalServerException":
797
- response = {
798
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
799
- name: errorCode,
800
- $metadata: deserializeMetadata(output),
801
- };
802
- break;
803
- case "InvalidInputException":
804
- case "com.amazonaws.machinelearning#InvalidInputException":
805
- response = {
806
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
807
- name: errorCode,
808
- $metadata: deserializeMetadata(output),
809
- };
810
- break;
811
- default:
812
- const parsedBody = parsedOutput.body;
813
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
814
- response = {
815
- ...parsedBody,
816
- name: `${errorCode}`,
817
- message: parsedBody.message || parsedBody.Message || errorCode,
818
- $fault: "client",
819
- $metadata: deserializeMetadata(output),
820
- } as any;
821
- }
822
- const message = response.message || response.Message || errorCode;
823
- response.message = message;
824
- delete response.Message;
825
- return Promise.reject(Object.assign(new Error(message), response));
826
- };
827
-
828
- export const deserializeAws_json1_1CreateDataSourceFromS3Command = async (
829
- output: __HttpResponse,
830
- context: __SerdeContext
831
- ): Promise<CreateDataSourceFromS3CommandOutput> => {
832
- if (output.statusCode >= 300) {
833
- return deserializeAws_json1_1CreateDataSourceFromS3CommandError(output, context);
834
- }
835
- const data: any = await parseBody(output.body, context);
836
- let contents: any = {};
837
- contents = deserializeAws_json1_1CreateDataSourceFromS3Output(data, context);
838
- const response: CreateDataSourceFromS3CommandOutput = {
839
- $metadata: deserializeMetadata(output),
840
- ...contents,
841
- };
842
- return Promise.resolve(response);
843
- };
844
-
845
- const deserializeAws_json1_1CreateDataSourceFromS3CommandError = async (
846
- output: __HttpResponse,
847
- context: __SerdeContext
848
- ): Promise<CreateDataSourceFromS3CommandOutput> => {
849
- const parsedOutput: any = {
850
- ...output,
851
- body: await parseBody(output.body, context),
852
- };
853
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
854
- let errorCode = "UnknownError";
855
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
856
- switch (errorCode) {
857
- case "IdempotentParameterMismatchException":
858
- case "com.amazonaws.machinelearning#IdempotentParameterMismatchException":
859
- response = {
860
- ...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
861
- name: errorCode,
862
- $metadata: deserializeMetadata(output),
863
- };
864
- break;
865
- case "InternalServerException":
866
- case "com.amazonaws.machinelearning#InternalServerException":
867
- response = {
868
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
869
- name: errorCode,
870
- $metadata: deserializeMetadata(output),
871
- };
872
- break;
873
- case "InvalidInputException":
874
- case "com.amazonaws.machinelearning#InvalidInputException":
875
- response = {
876
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
877
- name: errorCode,
878
- $metadata: deserializeMetadata(output),
879
- };
880
- break;
881
- default:
882
- const parsedBody = parsedOutput.body;
883
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
884
- response = {
885
- ...parsedBody,
886
- name: `${errorCode}`,
887
- message: parsedBody.message || parsedBody.Message || errorCode,
888
- $fault: "client",
889
- $metadata: deserializeMetadata(output),
890
- } as any;
891
- }
892
- const message = response.message || response.Message || errorCode;
893
- response.message = message;
894
- delete response.Message;
895
- return Promise.reject(Object.assign(new Error(message), response));
896
- };
897
-
898
- export const deserializeAws_json1_1CreateEvaluationCommand = async (
899
- output: __HttpResponse,
900
- context: __SerdeContext
901
- ): Promise<CreateEvaluationCommandOutput> => {
902
- if (output.statusCode >= 300) {
903
- return deserializeAws_json1_1CreateEvaluationCommandError(output, context);
904
- }
905
- const data: any = await parseBody(output.body, context);
906
- let contents: any = {};
907
- contents = deserializeAws_json1_1CreateEvaluationOutput(data, context);
908
- const response: CreateEvaluationCommandOutput = {
909
- $metadata: deserializeMetadata(output),
910
- ...contents,
911
- };
912
- return Promise.resolve(response);
913
- };
914
-
915
- const deserializeAws_json1_1CreateEvaluationCommandError = async (
916
- output: __HttpResponse,
917
- context: __SerdeContext
918
- ): Promise<CreateEvaluationCommandOutput> => {
919
- const parsedOutput: any = {
920
- ...output,
921
- body: await parseBody(output.body, context),
922
- };
923
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
924
- let errorCode = "UnknownError";
925
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
926
- switch (errorCode) {
927
- case "IdempotentParameterMismatchException":
928
- case "com.amazonaws.machinelearning#IdempotentParameterMismatchException":
929
- response = {
930
- ...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
931
- name: errorCode,
932
- $metadata: deserializeMetadata(output),
933
- };
934
- break;
935
- case "InternalServerException":
936
- case "com.amazonaws.machinelearning#InternalServerException":
937
- response = {
938
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
939
- name: errorCode,
940
- $metadata: deserializeMetadata(output),
941
- };
942
- break;
943
- case "InvalidInputException":
944
- case "com.amazonaws.machinelearning#InvalidInputException":
945
- response = {
946
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
947
- name: errorCode,
948
- $metadata: deserializeMetadata(output),
949
- };
950
- break;
951
- default:
952
- const parsedBody = parsedOutput.body;
953
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
954
- response = {
955
- ...parsedBody,
956
- name: `${errorCode}`,
957
- message: parsedBody.message || parsedBody.Message || errorCode,
958
- $fault: "client",
959
- $metadata: deserializeMetadata(output),
960
- } as any;
961
- }
962
- const message = response.message || response.Message || errorCode;
963
- response.message = message;
964
- delete response.Message;
965
- return Promise.reject(Object.assign(new Error(message), response));
966
- };
967
-
968
- export const deserializeAws_json1_1CreateMLModelCommand = async (
969
- output: __HttpResponse,
970
- context: __SerdeContext
971
- ): Promise<CreateMLModelCommandOutput> => {
972
- if (output.statusCode >= 300) {
973
- return deserializeAws_json1_1CreateMLModelCommandError(output, context);
974
- }
975
- const data: any = await parseBody(output.body, context);
976
- let contents: any = {};
977
- contents = deserializeAws_json1_1CreateMLModelOutput(data, context);
978
- const response: CreateMLModelCommandOutput = {
979
- $metadata: deserializeMetadata(output),
980
- ...contents,
981
- };
982
- return Promise.resolve(response);
983
- };
984
-
985
- const deserializeAws_json1_1CreateMLModelCommandError = async (
986
- output: __HttpResponse,
987
- context: __SerdeContext
988
- ): Promise<CreateMLModelCommandOutput> => {
989
- const parsedOutput: any = {
990
- ...output,
991
- body: await parseBody(output.body, context),
992
- };
993
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
994
- let errorCode = "UnknownError";
995
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
996
- switch (errorCode) {
997
- case "IdempotentParameterMismatchException":
998
- case "com.amazonaws.machinelearning#IdempotentParameterMismatchException":
999
- response = {
1000
- ...(await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse(parsedOutput, context)),
1001
- name: errorCode,
1002
- $metadata: deserializeMetadata(output),
1003
- };
1004
- break;
1005
- case "InternalServerException":
1006
- case "com.amazonaws.machinelearning#InternalServerException":
1007
- response = {
1008
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1009
- name: errorCode,
1010
- $metadata: deserializeMetadata(output),
1011
- };
1012
- break;
1013
- case "InvalidInputException":
1014
- case "com.amazonaws.machinelearning#InvalidInputException":
1015
- response = {
1016
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1017
- name: errorCode,
1018
- $metadata: deserializeMetadata(output),
1019
- };
1020
- break;
1021
- default:
1022
- const parsedBody = parsedOutput.body;
1023
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1024
- response = {
1025
- ...parsedBody,
1026
- name: `${errorCode}`,
1027
- message: parsedBody.message || parsedBody.Message || errorCode,
1028
- $fault: "client",
1029
- $metadata: deserializeMetadata(output),
1030
- } as any;
1031
- }
1032
- const message = response.message || response.Message || errorCode;
1033
- response.message = message;
1034
- delete response.Message;
1035
- return Promise.reject(Object.assign(new Error(message), response));
1036
- };
1037
-
1038
- export const deserializeAws_json1_1CreateRealtimeEndpointCommand = async (
1039
- output: __HttpResponse,
1040
- context: __SerdeContext
1041
- ): Promise<CreateRealtimeEndpointCommandOutput> => {
1042
- if (output.statusCode >= 300) {
1043
- return deserializeAws_json1_1CreateRealtimeEndpointCommandError(output, context);
1044
- }
1045
- const data: any = await parseBody(output.body, context);
1046
- let contents: any = {};
1047
- contents = deserializeAws_json1_1CreateRealtimeEndpointOutput(data, context);
1048
- const response: CreateRealtimeEndpointCommandOutput = {
1049
- $metadata: deserializeMetadata(output),
1050
- ...contents,
1051
- };
1052
- return Promise.resolve(response);
1053
- };
1054
-
1055
- const deserializeAws_json1_1CreateRealtimeEndpointCommandError = async (
1056
- output: __HttpResponse,
1057
- context: __SerdeContext
1058
- ): Promise<CreateRealtimeEndpointCommandOutput> => {
1059
- const parsedOutput: any = {
1060
- ...output,
1061
- body: await parseBody(output.body, context),
1062
- };
1063
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1064
- let errorCode = "UnknownError";
1065
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1066
- switch (errorCode) {
1067
- case "InternalServerException":
1068
- case "com.amazonaws.machinelearning#InternalServerException":
1069
- response = {
1070
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1071
- name: errorCode,
1072
- $metadata: deserializeMetadata(output),
1073
- };
1074
- break;
1075
- case "InvalidInputException":
1076
- case "com.amazonaws.machinelearning#InvalidInputException":
1077
- response = {
1078
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1079
- name: errorCode,
1080
- $metadata: deserializeMetadata(output),
1081
- };
1082
- break;
1083
- case "ResourceNotFoundException":
1084
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1085
- response = {
1086
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1087
- name: errorCode,
1088
- $metadata: deserializeMetadata(output),
1089
- };
1090
- break;
1091
- default:
1092
- const parsedBody = parsedOutput.body;
1093
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1094
- response = {
1095
- ...parsedBody,
1096
- name: `${errorCode}`,
1097
- message: parsedBody.message || parsedBody.Message || errorCode,
1098
- $fault: "client",
1099
- $metadata: deserializeMetadata(output),
1100
- } as any;
1101
- }
1102
- const message = response.message || response.Message || errorCode;
1103
- response.message = message;
1104
- delete response.Message;
1105
- return Promise.reject(Object.assign(new Error(message), response));
1106
- };
1107
-
1108
- export const deserializeAws_json1_1DeleteBatchPredictionCommand = async (
1109
- output: __HttpResponse,
1110
- context: __SerdeContext
1111
- ): Promise<DeleteBatchPredictionCommandOutput> => {
1112
- if (output.statusCode >= 300) {
1113
- return deserializeAws_json1_1DeleteBatchPredictionCommandError(output, context);
1114
- }
1115
- const data: any = await parseBody(output.body, context);
1116
- let contents: any = {};
1117
- contents = deserializeAws_json1_1DeleteBatchPredictionOutput(data, context);
1118
- const response: DeleteBatchPredictionCommandOutput = {
1119
- $metadata: deserializeMetadata(output),
1120
- ...contents,
1121
- };
1122
- return Promise.resolve(response);
1123
- };
1124
-
1125
- const deserializeAws_json1_1DeleteBatchPredictionCommandError = async (
1126
- output: __HttpResponse,
1127
- context: __SerdeContext
1128
- ): Promise<DeleteBatchPredictionCommandOutput> => {
1129
- const parsedOutput: any = {
1130
- ...output,
1131
- body: await parseBody(output.body, context),
1132
- };
1133
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1134
- let errorCode = "UnknownError";
1135
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1136
- switch (errorCode) {
1137
- case "InternalServerException":
1138
- case "com.amazonaws.machinelearning#InternalServerException":
1139
- response = {
1140
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1141
- name: errorCode,
1142
- $metadata: deserializeMetadata(output),
1143
- };
1144
- break;
1145
- case "InvalidInputException":
1146
- case "com.amazonaws.machinelearning#InvalidInputException":
1147
- response = {
1148
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1149
- name: errorCode,
1150
- $metadata: deserializeMetadata(output),
1151
- };
1152
- break;
1153
- case "ResourceNotFoundException":
1154
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1155
- response = {
1156
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1157
- name: errorCode,
1158
- $metadata: deserializeMetadata(output),
1159
- };
1160
- break;
1161
- default:
1162
- const parsedBody = parsedOutput.body;
1163
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1164
- response = {
1165
- ...parsedBody,
1166
- name: `${errorCode}`,
1167
- message: parsedBody.message || parsedBody.Message || errorCode,
1168
- $fault: "client",
1169
- $metadata: deserializeMetadata(output),
1170
- } as any;
1171
- }
1172
- const message = response.message || response.Message || errorCode;
1173
- response.message = message;
1174
- delete response.Message;
1175
- return Promise.reject(Object.assign(new Error(message), response));
1176
- };
1177
-
1178
- export const deserializeAws_json1_1DeleteDataSourceCommand = async (
1179
- output: __HttpResponse,
1180
- context: __SerdeContext
1181
- ): Promise<DeleteDataSourceCommandOutput> => {
1182
- if (output.statusCode >= 300) {
1183
- return deserializeAws_json1_1DeleteDataSourceCommandError(output, context);
1184
- }
1185
- const data: any = await parseBody(output.body, context);
1186
- let contents: any = {};
1187
- contents = deserializeAws_json1_1DeleteDataSourceOutput(data, context);
1188
- const response: DeleteDataSourceCommandOutput = {
1189
- $metadata: deserializeMetadata(output),
1190
- ...contents,
1191
- };
1192
- return Promise.resolve(response);
1193
- };
1194
-
1195
- const deserializeAws_json1_1DeleteDataSourceCommandError = async (
1196
- output: __HttpResponse,
1197
- context: __SerdeContext
1198
- ): Promise<DeleteDataSourceCommandOutput> => {
1199
- const parsedOutput: any = {
1200
- ...output,
1201
- body: await parseBody(output.body, context),
1202
- };
1203
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1204
- let errorCode = "UnknownError";
1205
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1206
- switch (errorCode) {
1207
- case "InternalServerException":
1208
- case "com.amazonaws.machinelearning#InternalServerException":
1209
- response = {
1210
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1211
- name: errorCode,
1212
- $metadata: deserializeMetadata(output),
1213
- };
1214
- break;
1215
- case "InvalidInputException":
1216
- case "com.amazonaws.machinelearning#InvalidInputException":
1217
- response = {
1218
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1219
- name: errorCode,
1220
- $metadata: deserializeMetadata(output),
1221
- };
1222
- break;
1223
- case "ResourceNotFoundException":
1224
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1225
- response = {
1226
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1227
- name: errorCode,
1228
- $metadata: deserializeMetadata(output),
1229
- };
1230
- break;
1231
- default:
1232
- const parsedBody = parsedOutput.body;
1233
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1234
- response = {
1235
- ...parsedBody,
1236
- name: `${errorCode}`,
1237
- message: parsedBody.message || parsedBody.Message || errorCode,
1238
- $fault: "client",
1239
- $metadata: deserializeMetadata(output),
1240
- } as any;
1241
- }
1242
- const message = response.message || response.Message || errorCode;
1243
- response.message = message;
1244
- delete response.Message;
1245
- return Promise.reject(Object.assign(new Error(message), response));
1246
- };
1247
-
1248
- export const deserializeAws_json1_1DeleteEvaluationCommand = async (
1249
- output: __HttpResponse,
1250
- context: __SerdeContext
1251
- ): Promise<DeleteEvaluationCommandOutput> => {
1252
- if (output.statusCode >= 300) {
1253
- return deserializeAws_json1_1DeleteEvaluationCommandError(output, context);
1254
- }
1255
- const data: any = await parseBody(output.body, context);
1256
- let contents: any = {};
1257
- contents = deserializeAws_json1_1DeleteEvaluationOutput(data, context);
1258
- const response: DeleteEvaluationCommandOutput = {
1259
- $metadata: deserializeMetadata(output),
1260
- ...contents,
1261
- };
1262
- return Promise.resolve(response);
1263
- };
1264
-
1265
- const deserializeAws_json1_1DeleteEvaluationCommandError = async (
1266
- output: __HttpResponse,
1267
- context: __SerdeContext
1268
- ): Promise<DeleteEvaluationCommandOutput> => {
1269
- const parsedOutput: any = {
1270
- ...output,
1271
- body: await parseBody(output.body, context),
1272
- };
1273
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1274
- let errorCode = "UnknownError";
1275
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1276
- switch (errorCode) {
1277
- case "InternalServerException":
1278
- case "com.amazonaws.machinelearning#InternalServerException":
1279
- response = {
1280
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1281
- name: errorCode,
1282
- $metadata: deserializeMetadata(output),
1283
- };
1284
- break;
1285
- case "InvalidInputException":
1286
- case "com.amazonaws.machinelearning#InvalidInputException":
1287
- response = {
1288
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1289
- name: errorCode,
1290
- $metadata: deserializeMetadata(output),
1291
- };
1292
- break;
1293
- case "ResourceNotFoundException":
1294
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1295
- response = {
1296
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1297
- name: errorCode,
1298
- $metadata: deserializeMetadata(output),
1299
- };
1300
- break;
1301
- default:
1302
- const parsedBody = parsedOutput.body;
1303
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1304
- response = {
1305
- ...parsedBody,
1306
- name: `${errorCode}`,
1307
- message: parsedBody.message || parsedBody.Message || errorCode,
1308
- $fault: "client",
1309
- $metadata: deserializeMetadata(output),
1310
- } as any;
1311
- }
1312
- const message = response.message || response.Message || errorCode;
1313
- response.message = message;
1314
- delete response.Message;
1315
- return Promise.reject(Object.assign(new Error(message), response));
1316
- };
1317
-
1318
- export const deserializeAws_json1_1DeleteMLModelCommand = async (
1319
- output: __HttpResponse,
1320
- context: __SerdeContext
1321
- ): Promise<DeleteMLModelCommandOutput> => {
1322
- if (output.statusCode >= 300) {
1323
- return deserializeAws_json1_1DeleteMLModelCommandError(output, context);
1324
- }
1325
- const data: any = await parseBody(output.body, context);
1326
- let contents: any = {};
1327
- contents = deserializeAws_json1_1DeleteMLModelOutput(data, context);
1328
- const response: DeleteMLModelCommandOutput = {
1329
- $metadata: deserializeMetadata(output),
1330
- ...contents,
1331
- };
1332
- return Promise.resolve(response);
1333
- };
1334
-
1335
- const deserializeAws_json1_1DeleteMLModelCommandError = async (
1336
- output: __HttpResponse,
1337
- context: __SerdeContext
1338
- ): Promise<DeleteMLModelCommandOutput> => {
1339
- const parsedOutput: any = {
1340
- ...output,
1341
- body: await parseBody(output.body, context),
1342
- };
1343
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1344
- let errorCode = "UnknownError";
1345
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1346
- switch (errorCode) {
1347
- case "InternalServerException":
1348
- case "com.amazonaws.machinelearning#InternalServerException":
1349
- response = {
1350
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1351
- name: errorCode,
1352
- $metadata: deserializeMetadata(output),
1353
- };
1354
- break;
1355
- case "InvalidInputException":
1356
- case "com.amazonaws.machinelearning#InvalidInputException":
1357
- response = {
1358
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1359
- name: errorCode,
1360
- $metadata: deserializeMetadata(output),
1361
- };
1362
- break;
1363
- case "ResourceNotFoundException":
1364
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1365
- response = {
1366
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1367
- name: errorCode,
1368
- $metadata: deserializeMetadata(output),
1369
- };
1370
- break;
1371
- default:
1372
- const parsedBody = parsedOutput.body;
1373
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1374
- response = {
1375
- ...parsedBody,
1376
- name: `${errorCode}`,
1377
- message: parsedBody.message || parsedBody.Message || errorCode,
1378
- $fault: "client",
1379
- $metadata: deserializeMetadata(output),
1380
- } as any;
1381
- }
1382
- const message = response.message || response.Message || errorCode;
1383
- response.message = message;
1384
- delete response.Message;
1385
- return Promise.reject(Object.assign(new Error(message), response));
1386
- };
1387
-
1388
- export const deserializeAws_json1_1DeleteRealtimeEndpointCommand = async (
1389
- output: __HttpResponse,
1390
- context: __SerdeContext
1391
- ): Promise<DeleteRealtimeEndpointCommandOutput> => {
1392
- if (output.statusCode >= 300) {
1393
- return deserializeAws_json1_1DeleteRealtimeEndpointCommandError(output, context);
1394
- }
1395
- const data: any = await parseBody(output.body, context);
1396
- let contents: any = {};
1397
- contents = deserializeAws_json1_1DeleteRealtimeEndpointOutput(data, context);
1398
- const response: DeleteRealtimeEndpointCommandOutput = {
1399
- $metadata: deserializeMetadata(output),
1400
- ...contents,
1401
- };
1402
- return Promise.resolve(response);
1403
- };
1404
-
1405
- const deserializeAws_json1_1DeleteRealtimeEndpointCommandError = async (
1406
- output: __HttpResponse,
1407
- context: __SerdeContext
1408
- ): Promise<DeleteRealtimeEndpointCommandOutput> => {
1409
- const parsedOutput: any = {
1410
- ...output,
1411
- body: await parseBody(output.body, context),
1412
- };
1413
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1414
- let errorCode = "UnknownError";
1415
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1416
- switch (errorCode) {
1417
- case "InternalServerException":
1418
- case "com.amazonaws.machinelearning#InternalServerException":
1419
- response = {
1420
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1421
- name: errorCode,
1422
- $metadata: deserializeMetadata(output),
1423
- };
1424
- break;
1425
- case "InvalidInputException":
1426
- case "com.amazonaws.machinelearning#InvalidInputException":
1427
- response = {
1428
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1429
- name: errorCode,
1430
- $metadata: deserializeMetadata(output),
1431
- };
1432
- break;
1433
- case "ResourceNotFoundException":
1434
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1435
- response = {
1436
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1437
- name: errorCode,
1438
- $metadata: deserializeMetadata(output),
1439
- };
1440
- break;
1441
- default:
1442
- const parsedBody = parsedOutput.body;
1443
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1444
- response = {
1445
- ...parsedBody,
1446
- name: `${errorCode}`,
1447
- message: parsedBody.message || parsedBody.Message || errorCode,
1448
- $fault: "client",
1449
- $metadata: deserializeMetadata(output),
1450
- } as any;
1451
- }
1452
- const message = response.message || response.Message || errorCode;
1453
- response.message = message;
1454
- delete response.Message;
1455
- return Promise.reject(Object.assign(new Error(message), response));
1456
- };
1457
-
1458
- export const deserializeAws_json1_1DeleteTagsCommand = async (
1459
- output: __HttpResponse,
1460
- context: __SerdeContext
1461
- ): Promise<DeleteTagsCommandOutput> => {
1462
- if (output.statusCode >= 300) {
1463
- return deserializeAws_json1_1DeleteTagsCommandError(output, context);
1464
- }
1465
- const data: any = await parseBody(output.body, context);
1466
- let contents: any = {};
1467
- contents = deserializeAws_json1_1DeleteTagsOutput(data, context);
1468
- const response: DeleteTagsCommandOutput = {
1469
- $metadata: deserializeMetadata(output),
1470
- ...contents,
1471
- };
1472
- return Promise.resolve(response);
1473
- };
1474
-
1475
- const deserializeAws_json1_1DeleteTagsCommandError = async (
1476
- output: __HttpResponse,
1477
- context: __SerdeContext
1478
- ): Promise<DeleteTagsCommandOutput> => {
1479
- const parsedOutput: any = {
1480
- ...output,
1481
- body: await parseBody(output.body, context),
1482
- };
1483
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1484
- let errorCode = "UnknownError";
1485
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1486
- switch (errorCode) {
1487
- case "InternalServerException":
1488
- case "com.amazonaws.machinelearning#InternalServerException":
1489
- response = {
1490
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1491
- name: errorCode,
1492
- $metadata: deserializeMetadata(output),
1493
- };
1494
- break;
1495
- case "InvalidInputException":
1496
- case "com.amazonaws.machinelearning#InvalidInputException":
1497
- response = {
1498
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1499
- name: errorCode,
1500
- $metadata: deserializeMetadata(output),
1501
- };
1502
- break;
1503
- case "InvalidTagException":
1504
- case "com.amazonaws.machinelearning#InvalidTagException":
1505
- response = {
1506
- ...(await deserializeAws_json1_1InvalidTagExceptionResponse(parsedOutput, context)),
1507
- name: errorCode,
1508
- $metadata: deserializeMetadata(output),
1509
- };
1510
- break;
1511
- case "ResourceNotFoundException":
1512
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1513
- response = {
1514
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1515
- name: errorCode,
1516
- $metadata: deserializeMetadata(output),
1517
- };
1518
- break;
1519
- default:
1520
- const parsedBody = parsedOutput.body;
1521
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1522
- response = {
1523
- ...parsedBody,
1524
- name: `${errorCode}`,
1525
- message: parsedBody.message || parsedBody.Message || errorCode,
1526
- $fault: "client",
1527
- $metadata: deserializeMetadata(output),
1528
- } as any;
1529
- }
1530
- const message = response.message || response.Message || errorCode;
1531
- response.message = message;
1532
- delete response.Message;
1533
- return Promise.reject(Object.assign(new Error(message), response));
1534
- };
1535
-
1536
- export const deserializeAws_json1_1DescribeBatchPredictionsCommand = async (
1537
- output: __HttpResponse,
1538
- context: __SerdeContext
1539
- ): Promise<DescribeBatchPredictionsCommandOutput> => {
1540
- if (output.statusCode >= 300) {
1541
- return deserializeAws_json1_1DescribeBatchPredictionsCommandError(output, context);
1542
- }
1543
- const data: any = await parseBody(output.body, context);
1544
- let contents: any = {};
1545
- contents = deserializeAws_json1_1DescribeBatchPredictionsOutput(data, context);
1546
- const response: DescribeBatchPredictionsCommandOutput = {
1547
- $metadata: deserializeMetadata(output),
1548
- ...contents,
1549
- };
1550
- return Promise.resolve(response);
1551
- };
1552
-
1553
- const deserializeAws_json1_1DescribeBatchPredictionsCommandError = async (
1554
- output: __HttpResponse,
1555
- context: __SerdeContext
1556
- ): Promise<DescribeBatchPredictionsCommandOutput> => {
1557
- const parsedOutput: any = {
1558
- ...output,
1559
- body: await parseBody(output.body, context),
1560
- };
1561
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1562
- let errorCode = "UnknownError";
1563
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1564
- switch (errorCode) {
1565
- case "InternalServerException":
1566
- case "com.amazonaws.machinelearning#InternalServerException":
1567
- response = {
1568
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1569
- name: errorCode,
1570
- $metadata: deserializeMetadata(output),
1571
- };
1572
- break;
1573
- case "InvalidInputException":
1574
- case "com.amazonaws.machinelearning#InvalidInputException":
1575
- response = {
1576
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1577
- name: errorCode,
1578
- $metadata: deserializeMetadata(output),
1579
- };
1580
- break;
1581
- default:
1582
- const parsedBody = parsedOutput.body;
1583
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1584
- response = {
1585
- ...parsedBody,
1586
- name: `${errorCode}`,
1587
- message: parsedBody.message || parsedBody.Message || errorCode,
1588
- $fault: "client",
1589
- $metadata: deserializeMetadata(output),
1590
- } as any;
1591
- }
1592
- const message = response.message || response.Message || errorCode;
1593
- response.message = message;
1594
- delete response.Message;
1595
- return Promise.reject(Object.assign(new Error(message), response));
1596
- };
1597
-
1598
- export const deserializeAws_json1_1DescribeDataSourcesCommand = async (
1599
- output: __HttpResponse,
1600
- context: __SerdeContext
1601
- ): Promise<DescribeDataSourcesCommandOutput> => {
1602
- if (output.statusCode >= 300) {
1603
- return deserializeAws_json1_1DescribeDataSourcesCommandError(output, context);
1604
- }
1605
- const data: any = await parseBody(output.body, context);
1606
- let contents: any = {};
1607
- contents = deserializeAws_json1_1DescribeDataSourcesOutput(data, context);
1608
- const response: DescribeDataSourcesCommandOutput = {
1609
- $metadata: deserializeMetadata(output),
1610
- ...contents,
1611
- };
1612
- return Promise.resolve(response);
1613
- };
1614
-
1615
- const deserializeAws_json1_1DescribeDataSourcesCommandError = async (
1616
- output: __HttpResponse,
1617
- context: __SerdeContext
1618
- ): Promise<DescribeDataSourcesCommandOutput> => {
1619
- const parsedOutput: any = {
1620
- ...output,
1621
- body: await parseBody(output.body, context),
1622
- };
1623
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1624
- let errorCode = "UnknownError";
1625
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1626
- switch (errorCode) {
1627
- case "InternalServerException":
1628
- case "com.amazonaws.machinelearning#InternalServerException":
1629
- response = {
1630
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1631
- name: errorCode,
1632
- $metadata: deserializeMetadata(output),
1633
- };
1634
- break;
1635
- case "InvalidInputException":
1636
- case "com.amazonaws.machinelearning#InvalidInputException":
1637
- response = {
1638
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1639
- name: errorCode,
1640
- $metadata: deserializeMetadata(output),
1641
- };
1642
- break;
1643
- default:
1644
- const parsedBody = parsedOutput.body;
1645
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1646
- response = {
1647
- ...parsedBody,
1648
- name: `${errorCode}`,
1649
- message: parsedBody.message || parsedBody.Message || errorCode,
1650
- $fault: "client",
1651
- $metadata: deserializeMetadata(output),
1652
- } as any;
1653
- }
1654
- const message = response.message || response.Message || errorCode;
1655
- response.message = message;
1656
- delete response.Message;
1657
- return Promise.reject(Object.assign(new Error(message), response));
1658
- };
1659
-
1660
- export const deserializeAws_json1_1DescribeEvaluationsCommand = async (
1661
- output: __HttpResponse,
1662
- context: __SerdeContext
1663
- ): Promise<DescribeEvaluationsCommandOutput> => {
1664
- if (output.statusCode >= 300) {
1665
- return deserializeAws_json1_1DescribeEvaluationsCommandError(output, context);
1666
- }
1667
- const data: any = await parseBody(output.body, context);
1668
- let contents: any = {};
1669
- contents = deserializeAws_json1_1DescribeEvaluationsOutput(data, context);
1670
- const response: DescribeEvaluationsCommandOutput = {
1671
- $metadata: deserializeMetadata(output),
1672
- ...contents,
1673
- };
1674
- return Promise.resolve(response);
1675
- };
1676
-
1677
- const deserializeAws_json1_1DescribeEvaluationsCommandError = async (
1678
- output: __HttpResponse,
1679
- context: __SerdeContext
1680
- ): Promise<DescribeEvaluationsCommandOutput> => {
1681
- const parsedOutput: any = {
1682
- ...output,
1683
- body: await parseBody(output.body, context),
1684
- };
1685
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1686
- let errorCode = "UnknownError";
1687
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1688
- switch (errorCode) {
1689
- case "InternalServerException":
1690
- case "com.amazonaws.machinelearning#InternalServerException":
1691
- response = {
1692
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1693
- name: errorCode,
1694
- $metadata: deserializeMetadata(output),
1695
- };
1696
- break;
1697
- case "InvalidInputException":
1698
- case "com.amazonaws.machinelearning#InvalidInputException":
1699
- response = {
1700
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1701
- name: errorCode,
1702
- $metadata: deserializeMetadata(output),
1703
- };
1704
- break;
1705
- default:
1706
- const parsedBody = parsedOutput.body;
1707
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1708
- response = {
1709
- ...parsedBody,
1710
- name: `${errorCode}`,
1711
- message: parsedBody.message || parsedBody.Message || errorCode,
1712
- $fault: "client",
1713
- $metadata: deserializeMetadata(output),
1714
- } as any;
1715
- }
1716
- const message = response.message || response.Message || errorCode;
1717
- response.message = message;
1718
- delete response.Message;
1719
- return Promise.reject(Object.assign(new Error(message), response));
1720
- };
1721
-
1722
- export const deserializeAws_json1_1DescribeMLModelsCommand = async (
1723
- output: __HttpResponse,
1724
- context: __SerdeContext
1725
- ): Promise<DescribeMLModelsCommandOutput> => {
1726
- if (output.statusCode >= 300) {
1727
- return deserializeAws_json1_1DescribeMLModelsCommandError(output, context);
1728
- }
1729
- const data: any = await parseBody(output.body, context);
1730
- let contents: any = {};
1731
- contents = deserializeAws_json1_1DescribeMLModelsOutput(data, context);
1732
- const response: DescribeMLModelsCommandOutput = {
1733
- $metadata: deserializeMetadata(output),
1734
- ...contents,
1735
- };
1736
- return Promise.resolve(response);
1737
- };
1738
-
1739
- const deserializeAws_json1_1DescribeMLModelsCommandError = async (
1740
- output: __HttpResponse,
1741
- context: __SerdeContext
1742
- ): Promise<DescribeMLModelsCommandOutput> => {
1743
- const parsedOutput: any = {
1744
- ...output,
1745
- body: await parseBody(output.body, context),
1746
- };
1747
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1748
- let errorCode = "UnknownError";
1749
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1750
- switch (errorCode) {
1751
- case "InternalServerException":
1752
- case "com.amazonaws.machinelearning#InternalServerException":
1753
- response = {
1754
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1755
- name: errorCode,
1756
- $metadata: deserializeMetadata(output),
1757
- };
1758
- break;
1759
- case "InvalidInputException":
1760
- case "com.amazonaws.machinelearning#InvalidInputException":
1761
- response = {
1762
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1763
- name: errorCode,
1764
- $metadata: deserializeMetadata(output),
1765
- };
1766
- break;
1767
- default:
1768
- const parsedBody = parsedOutput.body;
1769
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1770
- response = {
1771
- ...parsedBody,
1772
- name: `${errorCode}`,
1773
- message: parsedBody.message || parsedBody.Message || errorCode,
1774
- $fault: "client",
1775
- $metadata: deserializeMetadata(output),
1776
- } as any;
1777
- }
1778
- const message = response.message || response.Message || errorCode;
1779
- response.message = message;
1780
- delete response.Message;
1781
- return Promise.reject(Object.assign(new Error(message), response));
1782
- };
1783
-
1784
- export const deserializeAws_json1_1DescribeTagsCommand = async (
1785
- output: __HttpResponse,
1786
- context: __SerdeContext
1787
- ): Promise<DescribeTagsCommandOutput> => {
1788
- if (output.statusCode >= 300) {
1789
- return deserializeAws_json1_1DescribeTagsCommandError(output, context);
1790
- }
1791
- const data: any = await parseBody(output.body, context);
1792
- let contents: any = {};
1793
- contents = deserializeAws_json1_1DescribeTagsOutput(data, context);
1794
- const response: DescribeTagsCommandOutput = {
1795
- $metadata: deserializeMetadata(output),
1796
- ...contents,
1797
- };
1798
- return Promise.resolve(response);
1799
- };
1800
-
1801
- const deserializeAws_json1_1DescribeTagsCommandError = async (
1802
- output: __HttpResponse,
1803
- context: __SerdeContext
1804
- ): Promise<DescribeTagsCommandOutput> => {
1805
- const parsedOutput: any = {
1806
- ...output,
1807
- body: await parseBody(output.body, context),
1808
- };
1809
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1810
- let errorCode = "UnknownError";
1811
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1812
- switch (errorCode) {
1813
- case "InternalServerException":
1814
- case "com.amazonaws.machinelearning#InternalServerException":
1815
- response = {
1816
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1817
- name: errorCode,
1818
- $metadata: deserializeMetadata(output),
1819
- };
1820
- break;
1821
- case "InvalidInputException":
1822
- case "com.amazonaws.machinelearning#InvalidInputException":
1823
- response = {
1824
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1825
- name: errorCode,
1826
- $metadata: deserializeMetadata(output),
1827
- };
1828
- break;
1829
- case "ResourceNotFoundException":
1830
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1831
- response = {
1832
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1833
- name: errorCode,
1834
- $metadata: deserializeMetadata(output),
1835
- };
1836
- break;
1837
- default:
1838
- const parsedBody = parsedOutput.body;
1839
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1840
- response = {
1841
- ...parsedBody,
1842
- name: `${errorCode}`,
1843
- message: parsedBody.message || parsedBody.Message || errorCode,
1844
- $fault: "client",
1845
- $metadata: deserializeMetadata(output),
1846
- } as any;
1847
- }
1848
- const message = response.message || response.Message || errorCode;
1849
- response.message = message;
1850
- delete response.Message;
1851
- return Promise.reject(Object.assign(new Error(message), response));
1852
- };
1853
-
1854
- export const deserializeAws_json1_1GetBatchPredictionCommand = async (
1855
- output: __HttpResponse,
1856
- context: __SerdeContext
1857
- ): Promise<GetBatchPredictionCommandOutput> => {
1858
- if (output.statusCode >= 300) {
1859
- return deserializeAws_json1_1GetBatchPredictionCommandError(output, context);
1860
- }
1861
- const data: any = await parseBody(output.body, context);
1862
- let contents: any = {};
1863
- contents = deserializeAws_json1_1GetBatchPredictionOutput(data, context);
1864
- const response: GetBatchPredictionCommandOutput = {
1865
- $metadata: deserializeMetadata(output),
1866
- ...contents,
1867
- };
1868
- return Promise.resolve(response);
1869
- };
1870
-
1871
- const deserializeAws_json1_1GetBatchPredictionCommandError = async (
1872
- output: __HttpResponse,
1873
- context: __SerdeContext
1874
- ): Promise<GetBatchPredictionCommandOutput> => {
1875
- const parsedOutput: any = {
1876
- ...output,
1877
- body: await parseBody(output.body, context),
1878
- };
1879
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1880
- let errorCode = "UnknownError";
1881
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1882
- switch (errorCode) {
1883
- case "InternalServerException":
1884
- case "com.amazonaws.machinelearning#InternalServerException":
1885
- response = {
1886
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1887
- name: errorCode,
1888
- $metadata: deserializeMetadata(output),
1889
- };
1890
- break;
1891
- case "InvalidInputException":
1892
- case "com.amazonaws.machinelearning#InvalidInputException":
1893
- response = {
1894
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1895
- name: errorCode,
1896
- $metadata: deserializeMetadata(output),
1897
- };
1898
- break;
1899
- case "ResourceNotFoundException":
1900
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1901
- response = {
1902
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1903
- name: errorCode,
1904
- $metadata: deserializeMetadata(output),
1905
- };
1906
- break;
1907
- default:
1908
- const parsedBody = parsedOutput.body;
1909
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1910
- response = {
1911
- ...parsedBody,
1912
- name: `${errorCode}`,
1913
- message: parsedBody.message || parsedBody.Message || errorCode,
1914
- $fault: "client",
1915
- $metadata: deserializeMetadata(output),
1916
- } as any;
1917
- }
1918
- const message = response.message || response.Message || errorCode;
1919
- response.message = message;
1920
- delete response.Message;
1921
- return Promise.reject(Object.assign(new Error(message), response));
1922
- };
1923
-
1924
- export const deserializeAws_json1_1GetDataSourceCommand = async (
1925
- output: __HttpResponse,
1926
- context: __SerdeContext
1927
- ): Promise<GetDataSourceCommandOutput> => {
1928
- if (output.statusCode >= 300) {
1929
- return deserializeAws_json1_1GetDataSourceCommandError(output, context);
1930
- }
1931
- const data: any = await parseBody(output.body, context);
1932
- let contents: any = {};
1933
- contents = deserializeAws_json1_1GetDataSourceOutput(data, context);
1934
- const response: GetDataSourceCommandOutput = {
1935
- $metadata: deserializeMetadata(output),
1936
- ...contents,
1937
- };
1938
- return Promise.resolve(response);
1939
- };
1940
-
1941
- const deserializeAws_json1_1GetDataSourceCommandError = async (
1942
- output: __HttpResponse,
1943
- context: __SerdeContext
1944
- ): Promise<GetDataSourceCommandOutput> => {
1945
- const parsedOutput: any = {
1946
- ...output,
1947
- body: await parseBody(output.body, context),
1948
- };
1949
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
1950
- let errorCode = "UnknownError";
1951
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1952
- switch (errorCode) {
1953
- case "InternalServerException":
1954
- case "com.amazonaws.machinelearning#InternalServerException":
1955
- response = {
1956
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
1957
- name: errorCode,
1958
- $metadata: deserializeMetadata(output),
1959
- };
1960
- break;
1961
- case "InvalidInputException":
1962
- case "com.amazonaws.machinelearning#InvalidInputException":
1963
- response = {
1964
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
1965
- name: errorCode,
1966
- $metadata: deserializeMetadata(output),
1967
- };
1968
- break;
1969
- case "ResourceNotFoundException":
1970
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
1971
- response = {
1972
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
1973
- name: errorCode,
1974
- $metadata: deserializeMetadata(output),
1975
- };
1976
- break;
1977
- default:
1978
- const parsedBody = parsedOutput.body;
1979
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1980
- response = {
1981
- ...parsedBody,
1982
- name: `${errorCode}`,
1983
- message: parsedBody.message || parsedBody.Message || errorCode,
1984
- $fault: "client",
1985
- $metadata: deserializeMetadata(output),
1986
- } as any;
1987
- }
1988
- const message = response.message || response.Message || errorCode;
1989
- response.message = message;
1990
- delete response.Message;
1991
- return Promise.reject(Object.assign(new Error(message), response));
1992
- };
1993
-
1994
- export const deserializeAws_json1_1GetEvaluationCommand = async (
1995
- output: __HttpResponse,
1996
- context: __SerdeContext
1997
- ): Promise<GetEvaluationCommandOutput> => {
1998
- if (output.statusCode >= 300) {
1999
- return deserializeAws_json1_1GetEvaluationCommandError(output, context);
2000
- }
2001
- const data: any = await parseBody(output.body, context);
2002
- let contents: any = {};
2003
- contents = deserializeAws_json1_1GetEvaluationOutput(data, context);
2004
- const response: GetEvaluationCommandOutput = {
2005
- $metadata: deserializeMetadata(output),
2006
- ...contents,
2007
- };
2008
- return Promise.resolve(response);
2009
- };
2010
-
2011
- const deserializeAws_json1_1GetEvaluationCommandError = async (
2012
- output: __HttpResponse,
2013
- context: __SerdeContext
2014
- ): Promise<GetEvaluationCommandOutput> => {
2015
- const parsedOutput: any = {
2016
- ...output,
2017
- body: await parseBody(output.body, context),
2018
- };
2019
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2020
- let errorCode = "UnknownError";
2021
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2022
- switch (errorCode) {
2023
- case "InternalServerException":
2024
- case "com.amazonaws.machinelearning#InternalServerException":
2025
- response = {
2026
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
2027
- name: errorCode,
2028
- $metadata: deserializeMetadata(output),
2029
- };
2030
- break;
2031
- case "InvalidInputException":
2032
- case "com.amazonaws.machinelearning#InvalidInputException":
2033
- response = {
2034
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2035
- name: errorCode,
2036
- $metadata: deserializeMetadata(output),
2037
- };
2038
- break;
2039
- case "ResourceNotFoundException":
2040
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
2041
- response = {
2042
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2043
- name: errorCode,
2044
- $metadata: deserializeMetadata(output),
2045
- };
2046
- break;
2047
- default:
2048
- const parsedBody = parsedOutput.body;
2049
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2050
- response = {
2051
- ...parsedBody,
2052
- name: `${errorCode}`,
2053
- message: parsedBody.message || parsedBody.Message || errorCode,
2054
- $fault: "client",
2055
- $metadata: deserializeMetadata(output),
2056
- } as any;
2057
- }
2058
- const message = response.message || response.Message || errorCode;
2059
- response.message = message;
2060
- delete response.Message;
2061
- return Promise.reject(Object.assign(new Error(message), response));
2062
- };
2063
-
2064
- export const deserializeAws_json1_1GetMLModelCommand = async (
2065
- output: __HttpResponse,
2066
- context: __SerdeContext
2067
- ): Promise<GetMLModelCommandOutput> => {
2068
- if (output.statusCode >= 300) {
2069
- return deserializeAws_json1_1GetMLModelCommandError(output, context);
2070
- }
2071
- const data: any = await parseBody(output.body, context);
2072
- let contents: any = {};
2073
- contents = deserializeAws_json1_1GetMLModelOutput(data, context);
2074
- const response: GetMLModelCommandOutput = {
2075
- $metadata: deserializeMetadata(output),
2076
- ...contents,
2077
- };
2078
- return Promise.resolve(response);
2079
- };
2080
-
2081
- const deserializeAws_json1_1GetMLModelCommandError = async (
2082
- output: __HttpResponse,
2083
- context: __SerdeContext
2084
- ): Promise<GetMLModelCommandOutput> => {
2085
- const parsedOutput: any = {
2086
- ...output,
2087
- body: await parseBody(output.body, context),
2088
- };
2089
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2090
- let errorCode = "UnknownError";
2091
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2092
- switch (errorCode) {
2093
- case "InternalServerException":
2094
- case "com.amazonaws.machinelearning#InternalServerException":
2095
- response = {
2096
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
2097
- name: errorCode,
2098
- $metadata: deserializeMetadata(output),
2099
- };
2100
- break;
2101
- case "InvalidInputException":
2102
- case "com.amazonaws.machinelearning#InvalidInputException":
2103
- response = {
2104
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2105
- name: errorCode,
2106
- $metadata: deserializeMetadata(output),
2107
- };
2108
- break;
2109
- case "ResourceNotFoundException":
2110
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
2111
- response = {
2112
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2113
- name: errorCode,
2114
- $metadata: deserializeMetadata(output),
2115
- };
2116
- break;
2117
- default:
2118
- const parsedBody = parsedOutput.body;
2119
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2120
- response = {
2121
- ...parsedBody,
2122
- name: `${errorCode}`,
2123
- message: parsedBody.message || parsedBody.Message || errorCode,
2124
- $fault: "client",
2125
- $metadata: deserializeMetadata(output),
2126
- } as any;
2127
- }
2128
- const message = response.message || response.Message || errorCode;
2129
- response.message = message;
2130
- delete response.Message;
2131
- return Promise.reject(Object.assign(new Error(message), response));
2132
- };
2133
-
2134
- export const deserializeAws_json1_1PredictCommand = async (
2135
- output: __HttpResponse,
2136
- context: __SerdeContext
2137
- ): Promise<PredictCommandOutput> => {
2138
- if (output.statusCode >= 300) {
2139
- return deserializeAws_json1_1PredictCommandError(output, context);
2140
- }
2141
- const data: any = await parseBody(output.body, context);
2142
- let contents: any = {};
2143
- contents = deserializeAws_json1_1PredictOutput(data, context);
2144
- const response: PredictCommandOutput = {
2145
- $metadata: deserializeMetadata(output),
2146
- ...contents,
2147
- };
2148
- return Promise.resolve(response);
2149
- };
2150
-
2151
- const deserializeAws_json1_1PredictCommandError = async (
2152
- output: __HttpResponse,
2153
- context: __SerdeContext
2154
- ): Promise<PredictCommandOutput> => {
2155
- const parsedOutput: any = {
2156
- ...output,
2157
- body: await parseBody(output.body, context),
2158
- };
2159
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2160
- let errorCode = "UnknownError";
2161
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2162
- switch (errorCode) {
2163
- case "InternalServerException":
2164
- case "com.amazonaws.machinelearning#InternalServerException":
2165
- response = {
2166
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
2167
- name: errorCode,
2168
- $metadata: deserializeMetadata(output),
2169
- };
2170
- break;
2171
- case "InvalidInputException":
2172
- case "com.amazonaws.machinelearning#InvalidInputException":
2173
- response = {
2174
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2175
- name: errorCode,
2176
- $metadata: deserializeMetadata(output),
2177
- };
2178
- break;
2179
- case "LimitExceededException":
2180
- case "com.amazonaws.machinelearning#LimitExceededException":
2181
- response = {
2182
- ...(await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)),
2183
- name: errorCode,
2184
- $metadata: deserializeMetadata(output),
2185
- };
2186
- break;
2187
- case "PredictorNotMountedException":
2188
- case "com.amazonaws.machinelearning#PredictorNotMountedException":
2189
- response = {
2190
- ...(await deserializeAws_json1_1PredictorNotMountedExceptionResponse(parsedOutput, context)),
2191
- name: errorCode,
2192
- $metadata: deserializeMetadata(output),
2193
- };
2194
- break;
2195
- case "ResourceNotFoundException":
2196
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
2197
- response = {
2198
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2199
- name: errorCode,
2200
- $metadata: deserializeMetadata(output),
2201
- };
2202
- break;
2203
- default:
2204
- const parsedBody = parsedOutput.body;
2205
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2206
- response = {
2207
- ...parsedBody,
2208
- name: `${errorCode}`,
2209
- message: parsedBody.message || parsedBody.Message || errorCode,
2210
- $fault: "client",
2211
- $metadata: deserializeMetadata(output),
2212
- } as any;
2213
- }
2214
- const message = response.message || response.Message || errorCode;
2215
- response.message = message;
2216
- delete response.Message;
2217
- return Promise.reject(Object.assign(new Error(message), response));
2218
- };
2219
-
2220
- export const deserializeAws_json1_1UpdateBatchPredictionCommand = async (
2221
- output: __HttpResponse,
2222
- context: __SerdeContext
2223
- ): Promise<UpdateBatchPredictionCommandOutput> => {
2224
- if (output.statusCode >= 300) {
2225
- return deserializeAws_json1_1UpdateBatchPredictionCommandError(output, context);
2226
- }
2227
- const data: any = await parseBody(output.body, context);
2228
- let contents: any = {};
2229
- contents = deserializeAws_json1_1UpdateBatchPredictionOutput(data, context);
2230
- const response: UpdateBatchPredictionCommandOutput = {
2231
- $metadata: deserializeMetadata(output),
2232
- ...contents,
2233
- };
2234
- return Promise.resolve(response);
2235
- };
2236
-
2237
- const deserializeAws_json1_1UpdateBatchPredictionCommandError = async (
2238
- output: __HttpResponse,
2239
- context: __SerdeContext
2240
- ): Promise<UpdateBatchPredictionCommandOutput> => {
2241
- const parsedOutput: any = {
2242
- ...output,
2243
- body: await parseBody(output.body, context),
2244
- };
2245
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2246
- let errorCode = "UnknownError";
2247
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2248
- switch (errorCode) {
2249
- case "InternalServerException":
2250
- case "com.amazonaws.machinelearning#InternalServerException":
2251
- response = {
2252
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
2253
- name: errorCode,
2254
- $metadata: deserializeMetadata(output),
2255
- };
2256
- break;
2257
- case "InvalidInputException":
2258
- case "com.amazonaws.machinelearning#InvalidInputException":
2259
- response = {
2260
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2261
- name: errorCode,
2262
- $metadata: deserializeMetadata(output),
2263
- };
2264
- break;
2265
- case "ResourceNotFoundException":
2266
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
2267
- response = {
2268
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2269
- name: errorCode,
2270
- $metadata: deserializeMetadata(output),
2271
- };
2272
- break;
2273
- default:
2274
- const parsedBody = parsedOutput.body;
2275
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2276
- response = {
2277
- ...parsedBody,
2278
- name: `${errorCode}`,
2279
- message: parsedBody.message || parsedBody.Message || errorCode,
2280
- $fault: "client",
2281
- $metadata: deserializeMetadata(output),
2282
- } as any;
2283
- }
2284
- const message = response.message || response.Message || errorCode;
2285
- response.message = message;
2286
- delete response.Message;
2287
- return Promise.reject(Object.assign(new Error(message), response));
2288
- };
2289
-
2290
- export const deserializeAws_json1_1UpdateDataSourceCommand = async (
2291
- output: __HttpResponse,
2292
- context: __SerdeContext
2293
- ): Promise<UpdateDataSourceCommandOutput> => {
2294
- if (output.statusCode >= 300) {
2295
- return deserializeAws_json1_1UpdateDataSourceCommandError(output, context);
2296
- }
2297
- const data: any = await parseBody(output.body, context);
2298
- let contents: any = {};
2299
- contents = deserializeAws_json1_1UpdateDataSourceOutput(data, context);
2300
- const response: UpdateDataSourceCommandOutput = {
2301
- $metadata: deserializeMetadata(output),
2302
- ...contents,
2303
- };
2304
- return Promise.resolve(response);
2305
- };
2306
-
2307
- const deserializeAws_json1_1UpdateDataSourceCommandError = async (
2308
- output: __HttpResponse,
2309
- context: __SerdeContext
2310
- ): Promise<UpdateDataSourceCommandOutput> => {
2311
- const parsedOutput: any = {
2312
- ...output,
2313
- body: await parseBody(output.body, context),
2314
- };
2315
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2316
- let errorCode = "UnknownError";
2317
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2318
- switch (errorCode) {
2319
- case "InternalServerException":
2320
- case "com.amazonaws.machinelearning#InternalServerException":
2321
- response = {
2322
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
2323
- name: errorCode,
2324
- $metadata: deserializeMetadata(output),
2325
- };
2326
- break;
2327
- case "InvalidInputException":
2328
- case "com.amazonaws.machinelearning#InvalidInputException":
2329
- response = {
2330
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2331
- name: errorCode,
2332
- $metadata: deserializeMetadata(output),
2333
- };
2334
- break;
2335
- case "ResourceNotFoundException":
2336
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
2337
- response = {
2338
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2339
- name: errorCode,
2340
- $metadata: deserializeMetadata(output),
2341
- };
2342
- break;
2343
- default:
2344
- const parsedBody = parsedOutput.body;
2345
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2346
- response = {
2347
- ...parsedBody,
2348
- name: `${errorCode}`,
2349
- message: parsedBody.message || parsedBody.Message || errorCode,
2350
- $fault: "client",
2351
- $metadata: deserializeMetadata(output),
2352
- } as any;
2353
- }
2354
- const message = response.message || response.Message || errorCode;
2355
- response.message = message;
2356
- delete response.Message;
2357
- return Promise.reject(Object.assign(new Error(message), response));
2358
- };
2359
-
2360
- export const deserializeAws_json1_1UpdateEvaluationCommand = async (
2361
- output: __HttpResponse,
2362
- context: __SerdeContext
2363
- ): Promise<UpdateEvaluationCommandOutput> => {
2364
- if (output.statusCode >= 300) {
2365
- return deserializeAws_json1_1UpdateEvaluationCommandError(output, context);
2366
- }
2367
- const data: any = await parseBody(output.body, context);
2368
- let contents: any = {};
2369
- contents = deserializeAws_json1_1UpdateEvaluationOutput(data, context);
2370
- const response: UpdateEvaluationCommandOutput = {
2371
- $metadata: deserializeMetadata(output),
2372
- ...contents,
2373
- };
2374
- return Promise.resolve(response);
2375
- };
2376
-
2377
- const deserializeAws_json1_1UpdateEvaluationCommandError = async (
2378
- output: __HttpResponse,
2379
- context: __SerdeContext
2380
- ): Promise<UpdateEvaluationCommandOutput> => {
2381
- const parsedOutput: any = {
2382
- ...output,
2383
- body: await parseBody(output.body, context),
2384
- };
2385
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2386
- let errorCode = "UnknownError";
2387
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2388
- switch (errorCode) {
2389
- case "InternalServerException":
2390
- case "com.amazonaws.machinelearning#InternalServerException":
2391
- response = {
2392
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
2393
- name: errorCode,
2394
- $metadata: deserializeMetadata(output),
2395
- };
2396
- break;
2397
- case "InvalidInputException":
2398
- case "com.amazonaws.machinelearning#InvalidInputException":
2399
- response = {
2400
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2401
- name: errorCode,
2402
- $metadata: deserializeMetadata(output),
2403
- };
2404
- break;
2405
- case "ResourceNotFoundException":
2406
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
2407
- response = {
2408
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2409
- name: errorCode,
2410
- $metadata: deserializeMetadata(output),
2411
- };
2412
- break;
2413
- default:
2414
- const parsedBody = parsedOutput.body;
2415
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2416
- response = {
2417
- ...parsedBody,
2418
- name: `${errorCode}`,
2419
- message: parsedBody.message || parsedBody.Message || errorCode,
2420
- $fault: "client",
2421
- $metadata: deserializeMetadata(output),
2422
- } as any;
2423
- }
2424
- const message = response.message || response.Message || errorCode;
2425
- response.message = message;
2426
- delete response.Message;
2427
- return Promise.reject(Object.assign(new Error(message), response));
2428
- };
2429
-
2430
- export const deserializeAws_json1_1UpdateMLModelCommand = async (
2431
- output: __HttpResponse,
2432
- context: __SerdeContext
2433
- ): Promise<UpdateMLModelCommandOutput> => {
2434
- if (output.statusCode >= 300) {
2435
- return deserializeAws_json1_1UpdateMLModelCommandError(output, context);
2436
- }
2437
- const data: any = await parseBody(output.body, context);
2438
- let contents: any = {};
2439
- contents = deserializeAws_json1_1UpdateMLModelOutput(data, context);
2440
- const response: UpdateMLModelCommandOutput = {
2441
- $metadata: deserializeMetadata(output),
2442
- ...contents,
2443
- };
2444
- return Promise.resolve(response);
2445
- };
2446
-
2447
- const deserializeAws_json1_1UpdateMLModelCommandError = async (
2448
- output: __HttpResponse,
2449
- context: __SerdeContext
2450
- ): Promise<UpdateMLModelCommandOutput> => {
2451
- const parsedOutput: any = {
2452
- ...output,
2453
- body: await parseBody(output.body, context),
2454
- };
2455
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
2456
- let errorCode = "UnknownError";
2457
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2458
- switch (errorCode) {
2459
- case "InternalServerException":
2460
- case "com.amazonaws.machinelearning#InternalServerException":
2461
- response = {
2462
- ...(await deserializeAws_json1_1InternalServerExceptionResponse(parsedOutput, context)),
2463
- name: errorCode,
2464
- $metadata: deserializeMetadata(output),
2465
- };
2466
- break;
2467
- case "InvalidInputException":
2468
- case "com.amazonaws.machinelearning#InvalidInputException":
2469
- response = {
2470
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
2471
- name: errorCode,
2472
- $metadata: deserializeMetadata(output),
2473
- };
2474
- break;
2475
- case "ResourceNotFoundException":
2476
- case "com.amazonaws.machinelearning#ResourceNotFoundException":
2477
- response = {
2478
- ...(await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)),
2479
- name: errorCode,
2480
- $metadata: deserializeMetadata(output),
2481
- };
2482
- break;
2483
- default:
2484
- const parsedBody = parsedOutput.body;
2485
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
2486
- response = {
2487
- ...parsedBody,
2488
- name: `${errorCode}`,
2489
- message: parsedBody.message || parsedBody.Message || errorCode,
2490
- $fault: "client",
2491
- $metadata: deserializeMetadata(output),
2492
- } as any;
2493
- }
2494
- const message = response.message || response.Message || errorCode;
2495
- response.message = message;
2496
- delete response.Message;
2497
- return Promise.reject(Object.assign(new Error(message), response));
2498
- };
2499
-
2500
- const deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse = async (
2501
- parsedOutput: any,
2502
- context: __SerdeContext
2503
- ): Promise<IdempotentParameterMismatchException> => {
2504
- const body = parsedOutput.body;
2505
- const deserialized: any = deserializeAws_json1_1IdempotentParameterMismatchException(body, context);
2506
- const contents: IdempotentParameterMismatchException = {
2507
- name: "IdempotentParameterMismatchException",
2508
- $fault: "client",
2509
- $metadata: deserializeMetadata(parsedOutput),
2510
- ...deserialized,
2511
- };
2512
- return contents;
2513
- };
2514
-
2515
- const deserializeAws_json1_1InternalServerExceptionResponse = async (
2516
- parsedOutput: any,
2517
- context: __SerdeContext
2518
- ): Promise<InternalServerException> => {
2519
- const body = parsedOutput.body;
2520
- const deserialized: any = deserializeAws_json1_1InternalServerException(body, context);
2521
- const contents: InternalServerException = {
2522
- name: "InternalServerException",
2523
- $fault: "server",
2524
- $metadata: deserializeMetadata(parsedOutput),
2525
- ...deserialized,
2526
- };
2527
- return contents;
2528
- };
2529
-
2530
- const deserializeAws_json1_1InvalidInputExceptionResponse = async (
2531
- parsedOutput: any,
2532
- context: __SerdeContext
2533
- ): Promise<InvalidInputException> => {
2534
- const body = parsedOutput.body;
2535
- const deserialized: any = deserializeAws_json1_1InvalidInputException(body, context);
2536
- const contents: InvalidInputException = {
2537
- name: "InvalidInputException",
2538
- $fault: "client",
2539
- $metadata: deserializeMetadata(parsedOutput),
2540
- ...deserialized,
2541
- };
2542
- return contents;
2543
- };
2544
-
2545
- const deserializeAws_json1_1InvalidTagExceptionResponse = async (
2546
- parsedOutput: any,
2547
- context: __SerdeContext
2548
- ): Promise<InvalidTagException> => {
2549
- const body = parsedOutput.body;
2550
- const deserialized: any = deserializeAws_json1_1InvalidTagException(body, context);
2551
- const contents: InvalidTagException = {
2552
- name: "InvalidTagException",
2553
- $fault: "client",
2554
- $metadata: deserializeMetadata(parsedOutput),
2555
- ...deserialized,
2556
- };
2557
- return contents;
2558
- };
2559
-
2560
- const deserializeAws_json1_1LimitExceededExceptionResponse = async (
2561
- parsedOutput: any,
2562
- context: __SerdeContext
2563
- ): Promise<LimitExceededException> => {
2564
- const body = parsedOutput.body;
2565
- const deserialized: any = deserializeAws_json1_1LimitExceededException(body, context);
2566
- const contents: LimitExceededException = {
2567
- name: "LimitExceededException",
2568
- $fault: "client",
2569
- $metadata: deserializeMetadata(parsedOutput),
2570
- ...deserialized,
2571
- };
2572
- return contents;
2573
- };
2574
-
2575
- const deserializeAws_json1_1PredictorNotMountedExceptionResponse = async (
2576
- parsedOutput: any,
2577
- context: __SerdeContext
2578
- ): Promise<PredictorNotMountedException> => {
2579
- const body = parsedOutput.body;
2580
- const deserialized: any = deserializeAws_json1_1PredictorNotMountedException(body, context);
2581
- const contents: PredictorNotMountedException = {
2582
- name: "PredictorNotMountedException",
2583
- $fault: "client",
2584
- $metadata: deserializeMetadata(parsedOutput),
2585
- ...deserialized,
2586
- };
2587
- return contents;
2588
- };
2589
-
2590
- const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async (
2591
- parsedOutput: any,
2592
- context: __SerdeContext
2593
- ): Promise<ResourceNotFoundException> => {
2594
- const body = parsedOutput.body;
2595
- const deserialized: any = deserializeAws_json1_1ResourceNotFoundException(body, context);
2596
- const contents: ResourceNotFoundException = {
2597
- name: "ResourceNotFoundException",
2598
- $fault: "client",
2599
- $metadata: deserializeMetadata(parsedOutput),
2600
- ...deserialized,
2601
- };
2602
- return contents;
2603
- };
2604
-
2605
- const deserializeAws_json1_1TagLimitExceededExceptionResponse = async (
2606
- parsedOutput: any,
2607
- context: __SerdeContext
2608
- ): Promise<TagLimitExceededException> => {
2609
- const body = parsedOutput.body;
2610
- const deserialized: any = deserializeAws_json1_1TagLimitExceededException(body, context);
2611
- const contents: TagLimitExceededException = {
2612
- name: "TagLimitExceededException",
2613
- $fault: "client",
2614
- $metadata: deserializeMetadata(parsedOutput),
2615
- ...deserialized,
2616
- };
2617
- return contents;
2618
- };
2619
-
2620
- const serializeAws_json1_1AddTagsInput = (input: AddTagsInput, context: __SerdeContext): any => {
2621
- return {
2622
- ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }),
2623
- ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }),
2624
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagList(input.Tags, context) }),
2625
- };
2626
- };
2627
-
2628
- const serializeAws_json1_1CreateBatchPredictionInput = (
2629
- input: CreateBatchPredictionInput,
2630
- context: __SerdeContext
2631
- ): any => {
2632
- return {
2633
- ...(input.BatchPredictionDataSourceId !== undefined &&
2634
- input.BatchPredictionDataSourceId !== null && { BatchPredictionDataSourceId: input.BatchPredictionDataSourceId }),
2635
- ...(input.BatchPredictionId !== undefined &&
2636
- input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }),
2637
- ...(input.BatchPredictionName !== undefined &&
2638
- input.BatchPredictionName !== null && { BatchPredictionName: input.BatchPredictionName }),
2639
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2640
- ...(input.OutputUri !== undefined && input.OutputUri !== null && { OutputUri: input.OutputUri }),
2641
- };
2642
- };
2643
-
2644
- const serializeAws_json1_1CreateDataSourceFromRDSInput = (
2645
- input: CreateDataSourceFromRDSInput,
2646
- context: __SerdeContext
2647
- ): any => {
2648
- return {
2649
- ...(input.ComputeStatistics !== undefined &&
2650
- input.ComputeStatistics !== null && { ComputeStatistics: input.ComputeStatistics }),
2651
- ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }),
2652
- ...(input.DataSourceName !== undefined &&
2653
- input.DataSourceName !== null && { DataSourceName: input.DataSourceName }),
2654
- ...(input.RDSData !== undefined &&
2655
- input.RDSData !== null && { RDSData: serializeAws_json1_1RDSDataSpec(input.RDSData, context) }),
2656
- ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }),
2657
- };
2658
- };
2659
-
2660
- const serializeAws_json1_1CreateDataSourceFromRedshiftInput = (
2661
- input: CreateDataSourceFromRedshiftInput,
2662
- context: __SerdeContext
2663
- ): any => {
2664
- return {
2665
- ...(input.ComputeStatistics !== undefined &&
2666
- input.ComputeStatistics !== null && { ComputeStatistics: input.ComputeStatistics }),
2667
- ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }),
2668
- ...(input.DataSourceName !== undefined &&
2669
- input.DataSourceName !== null && { DataSourceName: input.DataSourceName }),
2670
- ...(input.DataSpec !== undefined &&
2671
- input.DataSpec !== null && { DataSpec: serializeAws_json1_1RedshiftDataSpec(input.DataSpec, context) }),
2672
- ...(input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN }),
2673
- };
2674
- };
2675
-
2676
- const serializeAws_json1_1CreateDataSourceFromS3Input = (
2677
- input: CreateDataSourceFromS3Input,
2678
- context: __SerdeContext
2679
- ): any => {
2680
- return {
2681
- ...(input.ComputeStatistics !== undefined &&
2682
- input.ComputeStatistics !== null && { ComputeStatistics: input.ComputeStatistics }),
2683
- ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }),
2684
- ...(input.DataSourceName !== undefined &&
2685
- input.DataSourceName !== null && { DataSourceName: input.DataSourceName }),
2686
- ...(input.DataSpec !== undefined &&
2687
- input.DataSpec !== null && { DataSpec: serializeAws_json1_1S3DataSpec(input.DataSpec, context) }),
2688
- };
2689
- };
2690
-
2691
- const serializeAws_json1_1CreateEvaluationInput = (input: CreateEvaluationInput, context: __SerdeContext): any => {
2692
- return {
2693
- ...(input.EvaluationDataSourceId !== undefined &&
2694
- input.EvaluationDataSourceId !== null && { EvaluationDataSourceId: input.EvaluationDataSourceId }),
2695
- ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }),
2696
- ...(input.EvaluationName !== undefined &&
2697
- input.EvaluationName !== null && { EvaluationName: input.EvaluationName }),
2698
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2699
- };
2700
- };
2701
-
2702
- const serializeAws_json1_1CreateMLModelInput = (input: CreateMLModelInput, context: __SerdeContext): any => {
2703
- return {
2704
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2705
- ...(input.MLModelName !== undefined && input.MLModelName !== null && { MLModelName: input.MLModelName }),
2706
- ...(input.MLModelType !== undefined && input.MLModelType !== null && { MLModelType: input.MLModelType }),
2707
- ...(input.Parameters !== undefined &&
2708
- input.Parameters !== null && { Parameters: serializeAws_json1_1TrainingParameters(input.Parameters, context) }),
2709
- ...(input.Recipe !== undefined && input.Recipe !== null && { Recipe: input.Recipe }),
2710
- ...(input.RecipeUri !== undefined && input.RecipeUri !== null && { RecipeUri: input.RecipeUri }),
2711
- ...(input.TrainingDataSourceId !== undefined &&
2712
- input.TrainingDataSourceId !== null && { TrainingDataSourceId: input.TrainingDataSourceId }),
2713
- };
2714
- };
2715
-
2716
- const serializeAws_json1_1CreateRealtimeEndpointInput = (
2717
- input: CreateRealtimeEndpointInput,
2718
- context: __SerdeContext
2719
- ): any => {
2720
- return {
2721
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2722
- };
2723
- };
2724
-
2725
- const serializeAws_json1_1DeleteBatchPredictionInput = (
2726
- input: DeleteBatchPredictionInput,
2727
- context: __SerdeContext
2728
- ): any => {
2729
- return {
2730
- ...(input.BatchPredictionId !== undefined &&
2731
- input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }),
2732
- };
2733
- };
2734
-
2735
- const serializeAws_json1_1DeleteDataSourceInput = (input: DeleteDataSourceInput, context: __SerdeContext): any => {
2736
- return {
2737
- ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }),
2738
- };
2739
- };
2740
-
2741
- const serializeAws_json1_1DeleteEvaluationInput = (input: DeleteEvaluationInput, context: __SerdeContext): any => {
2742
- return {
2743
- ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }),
2744
- };
2745
- };
2746
-
2747
- const serializeAws_json1_1DeleteMLModelInput = (input: DeleteMLModelInput, context: __SerdeContext): any => {
2748
- return {
2749
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2750
- };
2751
- };
2752
-
2753
- const serializeAws_json1_1DeleteRealtimeEndpointInput = (
2754
- input: DeleteRealtimeEndpointInput,
2755
- context: __SerdeContext
2756
- ): any => {
2757
- return {
2758
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2759
- };
2760
- };
2761
-
2762
- const serializeAws_json1_1DeleteTagsInput = (input: DeleteTagsInput, context: __SerdeContext): any => {
2763
- return {
2764
- ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }),
2765
- ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }),
2766
- ...(input.TagKeys !== undefined &&
2767
- input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) }),
2768
- };
2769
- };
2770
-
2771
- const serializeAws_json1_1DescribeBatchPredictionsInput = (
2772
- input: DescribeBatchPredictionsInput,
2773
- context: __SerdeContext
2774
- ): any => {
2775
- return {
2776
- ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }),
2777
- ...(input.FilterVariable !== undefined &&
2778
- input.FilterVariable !== null && { FilterVariable: input.FilterVariable }),
2779
- ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }),
2780
- ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }),
2781
- ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }),
2782
- ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }),
2783
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
2784
- ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }),
2785
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
2786
- ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }),
2787
- ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }),
2788
- };
2789
- };
2790
-
2791
- const serializeAws_json1_1DescribeDataSourcesInput = (
2792
- input: DescribeDataSourcesInput,
2793
- context: __SerdeContext
2794
- ): any => {
2795
- return {
2796
- ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }),
2797
- ...(input.FilterVariable !== undefined &&
2798
- input.FilterVariable !== null && { FilterVariable: input.FilterVariable }),
2799
- ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }),
2800
- ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }),
2801
- ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }),
2802
- ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }),
2803
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
2804
- ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }),
2805
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
2806
- ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }),
2807
- ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }),
2808
- };
2809
- };
2810
-
2811
- const serializeAws_json1_1DescribeEvaluationsInput = (
2812
- input: DescribeEvaluationsInput,
2813
- context: __SerdeContext
2814
- ): any => {
2815
- return {
2816
- ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }),
2817
- ...(input.FilterVariable !== undefined &&
2818
- input.FilterVariable !== null && { FilterVariable: input.FilterVariable }),
2819
- ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }),
2820
- ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }),
2821
- ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }),
2822
- ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }),
2823
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
2824
- ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }),
2825
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
2826
- ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }),
2827
- ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }),
2828
- };
2829
- };
2830
-
2831
- const serializeAws_json1_1DescribeMLModelsInput = (input: DescribeMLModelsInput, context: __SerdeContext): any => {
2832
- return {
2833
- ...(input.EQ !== undefined && input.EQ !== null && { EQ: input.EQ }),
2834
- ...(input.FilterVariable !== undefined &&
2835
- input.FilterVariable !== null && { FilterVariable: input.FilterVariable }),
2836
- ...(input.GE !== undefined && input.GE !== null && { GE: input.GE }),
2837
- ...(input.GT !== undefined && input.GT !== null && { GT: input.GT }),
2838
- ...(input.LE !== undefined && input.LE !== null && { LE: input.LE }),
2839
- ...(input.LT !== undefined && input.LT !== null && { LT: input.LT }),
2840
- ...(input.Limit !== undefined && input.Limit !== null && { Limit: input.Limit }),
2841
- ...(input.NE !== undefined && input.NE !== null && { NE: input.NE }),
2842
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
2843
- ...(input.Prefix !== undefined && input.Prefix !== null && { Prefix: input.Prefix }),
2844
- ...(input.SortOrder !== undefined && input.SortOrder !== null && { SortOrder: input.SortOrder }),
2845
- };
2846
- };
2847
-
2848
- const serializeAws_json1_1DescribeTagsInput = (input: DescribeTagsInput, context: __SerdeContext): any => {
2849
- return {
2850
- ...(input.ResourceId !== undefined && input.ResourceId !== null && { ResourceId: input.ResourceId }),
2851
- ...(input.ResourceType !== undefined && input.ResourceType !== null && { ResourceType: input.ResourceType }),
2852
- };
2853
- };
2854
-
2855
- const serializeAws_json1_1EDPSecurityGroupIds = (input: string[], context: __SerdeContext): any => {
2856
- return input
2857
- .filter((e: any) => e != null)
2858
- .map((entry) => {
2859
- if (entry === null) {
2860
- return null as any;
2861
- }
2862
- return entry;
2863
- });
2864
- };
2865
-
2866
- const serializeAws_json1_1GetBatchPredictionInput = (input: GetBatchPredictionInput, context: __SerdeContext): any => {
2867
- return {
2868
- ...(input.BatchPredictionId !== undefined &&
2869
- input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }),
2870
- };
2871
- };
2872
-
2873
- const serializeAws_json1_1GetDataSourceInput = (input: GetDataSourceInput, context: __SerdeContext): any => {
2874
- return {
2875
- ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }),
2876
- ...(input.Verbose !== undefined && input.Verbose !== null && { Verbose: input.Verbose }),
2877
- };
2878
- };
2879
-
2880
- const serializeAws_json1_1GetEvaluationInput = (input: GetEvaluationInput, context: __SerdeContext): any => {
2881
- return {
2882
- ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }),
2883
- };
2884
- };
2885
-
2886
- const serializeAws_json1_1GetMLModelInput = (input: GetMLModelInput, context: __SerdeContext): any => {
2887
- return {
2888
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2889
- ...(input.Verbose !== undefined && input.Verbose !== null && { Verbose: input.Verbose }),
2890
- };
2891
- };
2892
-
2893
- const serializeAws_json1_1PredictInput = (input: PredictInput, context: __SerdeContext): any => {
2894
- return {
2895
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
2896
- ...(input.PredictEndpoint !== undefined &&
2897
- input.PredictEndpoint !== null && { PredictEndpoint: input.PredictEndpoint }),
2898
- ...(input.Record !== undefined &&
2899
- input.Record !== null && { Record: serializeAws_json1_1Record(input.Record, context) }),
2900
- };
2901
- };
2902
-
2903
- const serializeAws_json1_1RDSDatabase = (input: RDSDatabase, context: __SerdeContext): any => {
2904
- return {
2905
- ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }),
2906
- ...(input.InstanceIdentifier !== undefined &&
2907
- input.InstanceIdentifier !== null && { InstanceIdentifier: input.InstanceIdentifier }),
2908
- };
2909
- };
2910
-
2911
- const serializeAws_json1_1RDSDatabaseCredentials = (input: RDSDatabaseCredentials, context: __SerdeContext): any => {
2912
- return {
2913
- ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }),
2914
- ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }),
2915
- };
2916
- };
2917
-
2918
- const serializeAws_json1_1RDSDataSpec = (input: RDSDataSpec, context: __SerdeContext): any => {
2919
- return {
2920
- ...(input.DataRearrangement !== undefined &&
2921
- input.DataRearrangement !== null && { DataRearrangement: input.DataRearrangement }),
2922
- ...(input.DataSchema !== undefined && input.DataSchema !== null && { DataSchema: input.DataSchema }),
2923
- ...(input.DataSchemaUri !== undefined && input.DataSchemaUri !== null && { DataSchemaUri: input.DataSchemaUri }),
2924
- ...(input.DatabaseCredentials !== undefined &&
2925
- input.DatabaseCredentials !== null && {
2926
- DatabaseCredentials: serializeAws_json1_1RDSDatabaseCredentials(input.DatabaseCredentials, context),
2927
- }),
2928
- ...(input.DatabaseInformation !== undefined &&
2929
- input.DatabaseInformation !== null && {
2930
- DatabaseInformation: serializeAws_json1_1RDSDatabase(input.DatabaseInformation, context),
2931
- }),
2932
- ...(input.ResourceRole !== undefined && input.ResourceRole !== null && { ResourceRole: input.ResourceRole }),
2933
- ...(input.S3StagingLocation !== undefined &&
2934
- input.S3StagingLocation !== null && { S3StagingLocation: input.S3StagingLocation }),
2935
- ...(input.SecurityGroupIds !== undefined &&
2936
- input.SecurityGroupIds !== null && {
2937
- SecurityGroupIds: serializeAws_json1_1EDPSecurityGroupIds(input.SecurityGroupIds, context),
2938
- }),
2939
- ...(input.SelectSqlQuery !== undefined &&
2940
- input.SelectSqlQuery !== null && { SelectSqlQuery: input.SelectSqlQuery }),
2941
- ...(input.ServiceRole !== undefined && input.ServiceRole !== null && { ServiceRole: input.ServiceRole }),
2942
- ...(input.SubnetId !== undefined && input.SubnetId !== null && { SubnetId: input.SubnetId }),
2943
- };
2944
- };
2945
-
2946
- const serializeAws_json1_1Record = (input: { [key: string]: string }, context: __SerdeContext): any => {
2947
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
2948
- if (value === null) {
2949
- return acc;
2950
- }
2951
- return {
2952
- ...acc,
2953
- [key]: value,
2954
- };
2955
- }, {});
2956
- };
2957
-
2958
- const serializeAws_json1_1RedshiftDatabase = (input: RedshiftDatabase, context: __SerdeContext): any => {
2959
- return {
2960
- ...(input.ClusterIdentifier !== undefined &&
2961
- input.ClusterIdentifier !== null && { ClusterIdentifier: input.ClusterIdentifier }),
2962
- ...(input.DatabaseName !== undefined && input.DatabaseName !== null && { DatabaseName: input.DatabaseName }),
2963
- };
2964
- };
2965
-
2966
- const serializeAws_json1_1RedshiftDatabaseCredentials = (
2967
- input: RedshiftDatabaseCredentials,
2968
- context: __SerdeContext
2969
- ): any => {
2970
- return {
2971
- ...(input.Password !== undefined && input.Password !== null && { Password: input.Password }),
2972
- ...(input.Username !== undefined && input.Username !== null && { Username: input.Username }),
2973
- };
2974
- };
2975
-
2976
- const serializeAws_json1_1RedshiftDataSpec = (input: RedshiftDataSpec, context: __SerdeContext): any => {
2977
- return {
2978
- ...(input.DataRearrangement !== undefined &&
2979
- input.DataRearrangement !== null && { DataRearrangement: input.DataRearrangement }),
2980
- ...(input.DataSchema !== undefined && input.DataSchema !== null && { DataSchema: input.DataSchema }),
2981
- ...(input.DataSchemaUri !== undefined && input.DataSchemaUri !== null && { DataSchemaUri: input.DataSchemaUri }),
2982
- ...(input.DatabaseCredentials !== undefined &&
2983
- input.DatabaseCredentials !== null && {
2984
- DatabaseCredentials: serializeAws_json1_1RedshiftDatabaseCredentials(input.DatabaseCredentials, context),
2985
- }),
2986
- ...(input.DatabaseInformation !== undefined &&
2987
- input.DatabaseInformation !== null && {
2988
- DatabaseInformation: serializeAws_json1_1RedshiftDatabase(input.DatabaseInformation, context),
2989
- }),
2990
- ...(input.S3StagingLocation !== undefined &&
2991
- input.S3StagingLocation !== null && { S3StagingLocation: input.S3StagingLocation }),
2992
- ...(input.SelectSqlQuery !== undefined &&
2993
- input.SelectSqlQuery !== null && { SelectSqlQuery: input.SelectSqlQuery }),
2994
- };
2995
- };
2996
-
2997
- const serializeAws_json1_1S3DataSpec = (input: S3DataSpec, context: __SerdeContext): any => {
2998
- return {
2999
- ...(input.DataLocationS3 !== undefined &&
3000
- input.DataLocationS3 !== null && { DataLocationS3: input.DataLocationS3 }),
3001
- ...(input.DataRearrangement !== undefined &&
3002
- input.DataRearrangement !== null && { DataRearrangement: input.DataRearrangement }),
3003
- ...(input.DataSchema !== undefined && input.DataSchema !== null && { DataSchema: input.DataSchema }),
3004
- ...(input.DataSchemaLocationS3 !== undefined &&
3005
- input.DataSchemaLocationS3 !== null && { DataSchemaLocationS3: input.DataSchemaLocationS3 }),
3006
- };
3007
- };
3008
-
3009
- const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => {
3010
- return {
3011
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
3012
- ...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),
3013
- };
3014
- };
3015
-
3016
- const serializeAws_json1_1TagKeyList = (input: string[], context: __SerdeContext): any => {
3017
- return input
3018
- .filter((e: any) => e != null)
3019
- .map((entry) => {
3020
- if (entry === null) {
3021
- return null as any;
3022
- }
3023
- return entry;
3024
- });
3025
- };
3026
-
3027
- const serializeAws_json1_1TagList = (input: Tag[], context: __SerdeContext): any => {
3028
- return input
3029
- .filter((e: any) => e != null)
3030
- .map((entry) => {
3031
- if (entry === null) {
3032
- return null as any;
3033
- }
3034
- return serializeAws_json1_1Tag(entry, context);
3035
- });
3036
- };
3037
-
3038
- const serializeAws_json1_1TrainingParameters = (input: { [key: string]: string }, context: __SerdeContext): any => {
3039
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
3040
- if (value === null) {
3041
- return acc;
3042
- }
3043
- return {
3044
- ...acc,
3045
- [key]: value,
3046
- };
3047
- }, {});
3048
- };
3049
-
3050
- const serializeAws_json1_1UpdateBatchPredictionInput = (
3051
- input: UpdateBatchPredictionInput,
3052
- context: __SerdeContext
3053
- ): any => {
3054
- return {
3055
- ...(input.BatchPredictionId !== undefined &&
3056
- input.BatchPredictionId !== null && { BatchPredictionId: input.BatchPredictionId }),
3057
- ...(input.BatchPredictionName !== undefined &&
3058
- input.BatchPredictionName !== null && { BatchPredictionName: input.BatchPredictionName }),
3059
- };
3060
- };
3061
-
3062
- const serializeAws_json1_1UpdateDataSourceInput = (input: UpdateDataSourceInput, context: __SerdeContext): any => {
3063
- return {
3064
- ...(input.DataSourceId !== undefined && input.DataSourceId !== null && { DataSourceId: input.DataSourceId }),
3065
- ...(input.DataSourceName !== undefined &&
3066
- input.DataSourceName !== null && { DataSourceName: input.DataSourceName }),
3067
- };
3068
- };
3069
-
3070
- const serializeAws_json1_1UpdateEvaluationInput = (input: UpdateEvaluationInput, context: __SerdeContext): any => {
3071
- return {
3072
- ...(input.EvaluationId !== undefined && input.EvaluationId !== null && { EvaluationId: input.EvaluationId }),
3073
- ...(input.EvaluationName !== undefined &&
3074
- input.EvaluationName !== null && { EvaluationName: input.EvaluationName }),
3075
- };
3076
- };
3077
-
3078
- const serializeAws_json1_1UpdateMLModelInput = (input: UpdateMLModelInput, context: __SerdeContext): any => {
3079
- return {
3080
- ...(input.MLModelId !== undefined && input.MLModelId !== null && { MLModelId: input.MLModelId }),
3081
- ...(input.MLModelName !== undefined && input.MLModelName !== null && { MLModelName: input.MLModelName }),
3082
- ...(input.ScoreThreshold !== undefined &&
3083
- input.ScoreThreshold !== null && { ScoreThreshold: __serializeFloat(input.ScoreThreshold) }),
3084
- };
3085
- };
3086
-
3087
- const deserializeAws_json1_1AddTagsOutput = (output: any, context: __SerdeContext): AddTagsOutput => {
3088
- return {
3089
- ResourceId: __expectString(output.ResourceId),
3090
- ResourceType: __expectString(output.ResourceType),
3091
- } as any;
3092
- };
3093
-
3094
- const deserializeAws_json1_1BatchPrediction = (output: any, context: __SerdeContext): BatchPrediction => {
3095
- return {
3096
- BatchPredictionDataSourceId: __expectString(output.BatchPredictionDataSourceId),
3097
- BatchPredictionId: __expectString(output.BatchPredictionId),
3098
- ComputeTime: __expectLong(output.ComputeTime),
3099
- CreatedAt:
3100
- output.CreatedAt !== undefined && output.CreatedAt !== null
3101
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3102
- : undefined,
3103
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3104
- FinishedAt:
3105
- output.FinishedAt !== undefined && output.FinishedAt !== null
3106
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3107
- : undefined,
3108
- InputDataLocationS3: __expectString(output.InputDataLocationS3),
3109
- InvalidRecordCount: __expectLong(output.InvalidRecordCount),
3110
- LastUpdatedAt:
3111
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3112
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3113
- : undefined,
3114
- MLModelId: __expectString(output.MLModelId),
3115
- Message: __expectString(output.Message),
3116
- Name: __expectString(output.Name),
3117
- OutputUri: __expectString(output.OutputUri),
3118
- StartedAt:
3119
- output.StartedAt !== undefined && output.StartedAt !== null
3120
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3121
- : undefined,
3122
- Status: __expectString(output.Status),
3123
- TotalRecordCount: __expectLong(output.TotalRecordCount),
3124
- } as any;
3125
- };
3126
-
3127
- const deserializeAws_json1_1BatchPredictions = (output: any, context: __SerdeContext): BatchPrediction[] => {
3128
- return (output || [])
3129
- .filter((e: any) => e != null)
3130
- .map((entry: any) => {
3131
- if (entry === null) {
3132
- return null as any;
3133
- }
3134
- return deserializeAws_json1_1BatchPrediction(entry, context);
3135
- });
3136
- };
3137
-
3138
- const deserializeAws_json1_1CreateBatchPredictionOutput = (
3139
- output: any,
3140
- context: __SerdeContext
3141
- ): CreateBatchPredictionOutput => {
3142
- return {
3143
- BatchPredictionId: __expectString(output.BatchPredictionId),
3144
- } as any;
3145
- };
3146
-
3147
- const deserializeAws_json1_1CreateDataSourceFromRDSOutput = (
3148
- output: any,
3149
- context: __SerdeContext
3150
- ): CreateDataSourceFromRDSOutput => {
3151
- return {
3152
- DataSourceId: __expectString(output.DataSourceId),
3153
- } as any;
3154
- };
3155
-
3156
- const deserializeAws_json1_1CreateDataSourceFromRedshiftOutput = (
3157
- output: any,
3158
- context: __SerdeContext
3159
- ): CreateDataSourceFromRedshiftOutput => {
3160
- return {
3161
- DataSourceId: __expectString(output.DataSourceId),
3162
- } as any;
3163
- };
3164
-
3165
- const deserializeAws_json1_1CreateDataSourceFromS3Output = (
3166
- output: any,
3167
- context: __SerdeContext
3168
- ): CreateDataSourceFromS3Output => {
3169
- return {
3170
- DataSourceId: __expectString(output.DataSourceId),
3171
- } as any;
3172
- };
3173
-
3174
- const deserializeAws_json1_1CreateEvaluationOutput = (output: any, context: __SerdeContext): CreateEvaluationOutput => {
3175
- return {
3176
- EvaluationId: __expectString(output.EvaluationId),
3177
- } as any;
3178
- };
3179
-
3180
- const deserializeAws_json1_1CreateMLModelOutput = (output: any, context: __SerdeContext): CreateMLModelOutput => {
3181
- return {
3182
- MLModelId: __expectString(output.MLModelId),
3183
- } as any;
3184
- };
3185
-
3186
- const deserializeAws_json1_1CreateRealtimeEndpointOutput = (
3187
- output: any,
3188
- context: __SerdeContext
3189
- ): CreateRealtimeEndpointOutput => {
3190
- return {
3191
- MLModelId: __expectString(output.MLModelId),
3192
- RealtimeEndpointInfo:
3193
- output.RealtimeEndpointInfo !== undefined && output.RealtimeEndpointInfo !== null
3194
- ? deserializeAws_json1_1RealtimeEndpointInfo(output.RealtimeEndpointInfo, context)
3195
- : undefined,
3196
- } as any;
3197
- };
3198
-
3199
- const deserializeAws_json1_1DataSource = (output: any, context: __SerdeContext): DataSource => {
3200
- return {
3201
- ComputeStatistics: __expectBoolean(output.ComputeStatistics),
3202
- ComputeTime: __expectLong(output.ComputeTime),
3203
- CreatedAt:
3204
- output.CreatedAt !== undefined && output.CreatedAt !== null
3205
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3206
- : undefined,
3207
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3208
- DataLocationS3: __expectString(output.DataLocationS3),
3209
- DataRearrangement: __expectString(output.DataRearrangement),
3210
- DataSizeInBytes: __expectLong(output.DataSizeInBytes),
3211
- DataSourceId: __expectString(output.DataSourceId),
3212
- FinishedAt:
3213
- output.FinishedAt !== undefined && output.FinishedAt !== null
3214
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3215
- : undefined,
3216
- LastUpdatedAt:
3217
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3218
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3219
- : undefined,
3220
- Message: __expectString(output.Message),
3221
- Name: __expectString(output.Name),
3222
- NumberOfFiles: __expectLong(output.NumberOfFiles),
3223
- RDSMetadata:
3224
- output.RDSMetadata !== undefined && output.RDSMetadata !== null
3225
- ? deserializeAws_json1_1RDSMetadata(output.RDSMetadata, context)
3226
- : undefined,
3227
- RedshiftMetadata:
3228
- output.RedshiftMetadata !== undefined && output.RedshiftMetadata !== null
3229
- ? deserializeAws_json1_1RedshiftMetadata(output.RedshiftMetadata, context)
3230
- : undefined,
3231
- RoleARN: __expectString(output.RoleARN),
3232
- StartedAt:
3233
- output.StartedAt !== undefined && output.StartedAt !== null
3234
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3235
- : undefined,
3236
- Status: __expectString(output.Status),
3237
- } as any;
3238
- };
3239
-
3240
- const deserializeAws_json1_1DataSources = (output: any, context: __SerdeContext): DataSource[] => {
3241
- return (output || [])
3242
- .filter((e: any) => e != null)
3243
- .map((entry: any) => {
3244
- if (entry === null) {
3245
- return null as any;
3246
- }
3247
- return deserializeAws_json1_1DataSource(entry, context);
3248
- });
3249
- };
3250
-
3251
- const deserializeAws_json1_1DeleteBatchPredictionOutput = (
3252
- output: any,
3253
- context: __SerdeContext
3254
- ): DeleteBatchPredictionOutput => {
3255
- return {
3256
- BatchPredictionId: __expectString(output.BatchPredictionId),
3257
- } as any;
3258
- };
3259
-
3260
- const deserializeAws_json1_1DeleteDataSourceOutput = (output: any, context: __SerdeContext): DeleteDataSourceOutput => {
3261
- return {
3262
- DataSourceId: __expectString(output.DataSourceId),
3263
- } as any;
3264
- };
3265
-
3266
- const deserializeAws_json1_1DeleteEvaluationOutput = (output: any, context: __SerdeContext): DeleteEvaluationOutput => {
3267
- return {
3268
- EvaluationId: __expectString(output.EvaluationId),
3269
- } as any;
3270
- };
3271
-
3272
- const deserializeAws_json1_1DeleteMLModelOutput = (output: any, context: __SerdeContext): DeleteMLModelOutput => {
3273
- return {
3274
- MLModelId: __expectString(output.MLModelId),
3275
- } as any;
3276
- };
3277
-
3278
- const deserializeAws_json1_1DeleteRealtimeEndpointOutput = (
3279
- output: any,
3280
- context: __SerdeContext
3281
- ): DeleteRealtimeEndpointOutput => {
3282
- return {
3283
- MLModelId: __expectString(output.MLModelId),
3284
- RealtimeEndpointInfo:
3285
- output.RealtimeEndpointInfo !== undefined && output.RealtimeEndpointInfo !== null
3286
- ? deserializeAws_json1_1RealtimeEndpointInfo(output.RealtimeEndpointInfo, context)
3287
- : undefined,
3288
- } as any;
3289
- };
3290
-
3291
- const deserializeAws_json1_1DeleteTagsOutput = (output: any, context: __SerdeContext): DeleteTagsOutput => {
3292
- return {
3293
- ResourceId: __expectString(output.ResourceId),
3294
- ResourceType: __expectString(output.ResourceType),
3295
- } as any;
3296
- };
3297
-
3298
- const deserializeAws_json1_1DescribeBatchPredictionsOutput = (
3299
- output: any,
3300
- context: __SerdeContext
3301
- ): DescribeBatchPredictionsOutput => {
3302
- return {
3303
- NextToken: __expectString(output.NextToken),
3304
- Results:
3305
- output.Results !== undefined && output.Results !== null
3306
- ? deserializeAws_json1_1BatchPredictions(output.Results, context)
3307
- : undefined,
3308
- } as any;
3309
- };
3310
-
3311
- const deserializeAws_json1_1DescribeDataSourcesOutput = (
3312
- output: any,
3313
- context: __SerdeContext
3314
- ): DescribeDataSourcesOutput => {
3315
- return {
3316
- NextToken: __expectString(output.NextToken),
3317
- Results:
3318
- output.Results !== undefined && output.Results !== null
3319
- ? deserializeAws_json1_1DataSources(output.Results, context)
3320
- : undefined,
3321
- } as any;
3322
- };
3323
-
3324
- const deserializeAws_json1_1DescribeEvaluationsOutput = (
3325
- output: any,
3326
- context: __SerdeContext
3327
- ): DescribeEvaluationsOutput => {
3328
- return {
3329
- NextToken: __expectString(output.NextToken),
3330
- Results:
3331
- output.Results !== undefined && output.Results !== null
3332
- ? deserializeAws_json1_1Evaluations(output.Results, context)
3333
- : undefined,
3334
- } as any;
3335
- };
3336
-
3337
- const deserializeAws_json1_1DescribeMLModelsOutput = (output: any, context: __SerdeContext): DescribeMLModelsOutput => {
3338
- return {
3339
- NextToken: __expectString(output.NextToken),
3340
- Results:
3341
- output.Results !== undefined && output.Results !== null
3342
- ? deserializeAws_json1_1MLModels(output.Results, context)
3343
- : undefined,
3344
- } as any;
3345
- };
3346
-
3347
- const deserializeAws_json1_1DescribeTagsOutput = (output: any, context: __SerdeContext): DescribeTagsOutput => {
3348
- return {
3349
- ResourceId: __expectString(output.ResourceId),
3350
- ResourceType: __expectString(output.ResourceType),
3351
- Tags:
3352
- output.Tags !== undefined && output.Tags !== null
3353
- ? deserializeAws_json1_1TagList(output.Tags, context)
3354
- : undefined,
3355
- } as any;
3356
- };
3357
-
3358
- const deserializeAws_json1_1DetailsMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
3359
- return Object.entries(output).reduce(
3360
- (acc: { [key: string]: string }, [key, value]: [DetailsAttributes | string, any]) => {
3361
- if (value === null) {
3362
- return acc;
3363
- }
3364
- return {
3365
- ...acc,
3366
- [key]: __expectString(value) as any,
3367
- };
3368
- },
3369
- {}
3370
- );
3371
- };
3372
-
3373
- const deserializeAws_json1_1Evaluation = (output: any, context: __SerdeContext): Evaluation => {
3374
- return {
3375
- ComputeTime: __expectLong(output.ComputeTime),
3376
- CreatedAt:
3377
- output.CreatedAt !== undefined && output.CreatedAt !== null
3378
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3379
- : undefined,
3380
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3381
- EvaluationDataSourceId: __expectString(output.EvaluationDataSourceId),
3382
- EvaluationId: __expectString(output.EvaluationId),
3383
- FinishedAt:
3384
- output.FinishedAt !== undefined && output.FinishedAt !== null
3385
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3386
- : undefined,
3387
- InputDataLocationS3: __expectString(output.InputDataLocationS3),
3388
- LastUpdatedAt:
3389
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3390
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3391
- : undefined,
3392
- MLModelId: __expectString(output.MLModelId),
3393
- Message: __expectString(output.Message),
3394
- Name: __expectString(output.Name),
3395
- PerformanceMetrics:
3396
- output.PerformanceMetrics !== undefined && output.PerformanceMetrics !== null
3397
- ? deserializeAws_json1_1PerformanceMetrics(output.PerformanceMetrics, context)
3398
- : undefined,
3399
- StartedAt:
3400
- output.StartedAt !== undefined && output.StartedAt !== null
3401
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3402
- : undefined,
3403
- Status: __expectString(output.Status),
3404
- } as any;
3405
- };
3406
-
3407
- const deserializeAws_json1_1Evaluations = (output: any, context: __SerdeContext): Evaluation[] => {
3408
- return (output || [])
3409
- .filter((e: any) => e != null)
3410
- .map((entry: any) => {
3411
- if (entry === null) {
3412
- return null as any;
3413
- }
3414
- return deserializeAws_json1_1Evaluation(entry, context);
3415
- });
3416
- };
3417
-
3418
- const deserializeAws_json1_1GetBatchPredictionOutput = (
3419
- output: any,
3420
- context: __SerdeContext
3421
- ): GetBatchPredictionOutput => {
3422
- return {
3423
- BatchPredictionDataSourceId: __expectString(output.BatchPredictionDataSourceId),
3424
- BatchPredictionId: __expectString(output.BatchPredictionId),
3425
- ComputeTime: __expectLong(output.ComputeTime),
3426
- CreatedAt:
3427
- output.CreatedAt !== undefined && output.CreatedAt !== null
3428
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3429
- : undefined,
3430
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3431
- FinishedAt:
3432
- output.FinishedAt !== undefined && output.FinishedAt !== null
3433
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3434
- : undefined,
3435
- InputDataLocationS3: __expectString(output.InputDataLocationS3),
3436
- InvalidRecordCount: __expectLong(output.InvalidRecordCount),
3437
- LastUpdatedAt:
3438
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3439
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3440
- : undefined,
3441
- LogUri: __expectString(output.LogUri),
3442
- MLModelId: __expectString(output.MLModelId),
3443
- Message: __expectString(output.Message),
3444
- Name: __expectString(output.Name),
3445
- OutputUri: __expectString(output.OutputUri),
3446
- StartedAt:
3447
- output.StartedAt !== undefined && output.StartedAt !== null
3448
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3449
- : undefined,
3450
- Status: __expectString(output.Status),
3451
- TotalRecordCount: __expectLong(output.TotalRecordCount),
3452
- } as any;
3453
- };
3454
-
3455
- const deserializeAws_json1_1GetDataSourceOutput = (output: any, context: __SerdeContext): GetDataSourceOutput => {
3456
- return {
3457
- ComputeStatistics: __expectBoolean(output.ComputeStatistics),
3458
- ComputeTime: __expectLong(output.ComputeTime),
3459
- CreatedAt:
3460
- output.CreatedAt !== undefined && output.CreatedAt !== null
3461
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3462
- : undefined,
3463
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3464
- DataLocationS3: __expectString(output.DataLocationS3),
3465
- DataRearrangement: __expectString(output.DataRearrangement),
3466
- DataSizeInBytes: __expectLong(output.DataSizeInBytes),
3467
- DataSourceId: __expectString(output.DataSourceId),
3468
- DataSourceSchema: __expectString(output.DataSourceSchema),
3469
- FinishedAt:
3470
- output.FinishedAt !== undefined && output.FinishedAt !== null
3471
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3472
- : undefined,
3473
- LastUpdatedAt:
3474
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3475
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3476
- : undefined,
3477
- LogUri: __expectString(output.LogUri),
3478
- Message: __expectString(output.Message),
3479
- Name: __expectString(output.Name),
3480
- NumberOfFiles: __expectLong(output.NumberOfFiles),
3481
- RDSMetadata:
3482
- output.RDSMetadata !== undefined && output.RDSMetadata !== null
3483
- ? deserializeAws_json1_1RDSMetadata(output.RDSMetadata, context)
3484
- : undefined,
3485
- RedshiftMetadata:
3486
- output.RedshiftMetadata !== undefined && output.RedshiftMetadata !== null
3487
- ? deserializeAws_json1_1RedshiftMetadata(output.RedshiftMetadata, context)
3488
- : undefined,
3489
- RoleARN: __expectString(output.RoleARN),
3490
- StartedAt:
3491
- output.StartedAt !== undefined && output.StartedAt !== null
3492
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3493
- : undefined,
3494
- Status: __expectString(output.Status),
3495
- } as any;
3496
- };
3497
-
3498
- const deserializeAws_json1_1GetEvaluationOutput = (output: any, context: __SerdeContext): GetEvaluationOutput => {
3499
- return {
3500
- ComputeTime: __expectLong(output.ComputeTime),
3501
- CreatedAt:
3502
- output.CreatedAt !== undefined && output.CreatedAt !== null
3503
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3504
- : undefined,
3505
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3506
- EvaluationDataSourceId: __expectString(output.EvaluationDataSourceId),
3507
- EvaluationId: __expectString(output.EvaluationId),
3508
- FinishedAt:
3509
- output.FinishedAt !== undefined && output.FinishedAt !== null
3510
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3511
- : undefined,
3512
- InputDataLocationS3: __expectString(output.InputDataLocationS3),
3513
- LastUpdatedAt:
3514
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3515
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3516
- : undefined,
3517
- LogUri: __expectString(output.LogUri),
3518
- MLModelId: __expectString(output.MLModelId),
3519
- Message: __expectString(output.Message),
3520
- Name: __expectString(output.Name),
3521
- PerformanceMetrics:
3522
- output.PerformanceMetrics !== undefined && output.PerformanceMetrics !== null
3523
- ? deserializeAws_json1_1PerformanceMetrics(output.PerformanceMetrics, context)
3524
- : undefined,
3525
- StartedAt:
3526
- output.StartedAt !== undefined && output.StartedAt !== null
3527
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3528
- : undefined,
3529
- Status: __expectString(output.Status),
3530
- } as any;
3531
- };
3532
-
3533
- const deserializeAws_json1_1GetMLModelOutput = (output: any, context: __SerdeContext): GetMLModelOutput => {
3534
- return {
3535
- ComputeTime: __expectLong(output.ComputeTime),
3536
- CreatedAt:
3537
- output.CreatedAt !== undefined && output.CreatedAt !== null
3538
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3539
- : undefined,
3540
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3541
- EndpointInfo:
3542
- output.EndpointInfo !== undefined && output.EndpointInfo !== null
3543
- ? deserializeAws_json1_1RealtimeEndpointInfo(output.EndpointInfo, context)
3544
- : undefined,
3545
- FinishedAt:
3546
- output.FinishedAt !== undefined && output.FinishedAt !== null
3547
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3548
- : undefined,
3549
- InputDataLocationS3: __expectString(output.InputDataLocationS3),
3550
- LastUpdatedAt:
3551
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3552
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3553
- : undefined,
3554
- LogUri: __expectString(output.LogUri),
3555
- MLModelId: __expectString(output.MLModelId),
3556
- MLModelType: __expectString(output.MLModelType),
3557
- Message: __expectString(output.Message),
3558
- Name: __expectString(output.Name),
3559
- Recipe: __expectString(output.Recipe),
3560
- Schema: __expectString(output.Schema),
3561
- ScoreThreshold: __limitedParseFloat32(output.ScoreThreshold),
3562
- ScoreThresholdLastUpdatedAt:
3563
- output.ScoreThresholdLastUpdatedAt !== undefined && output.ScoreThresholdLastUpdatedAt !== null
3564
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ScoreThresholdLastUpdatedAt)))
3565
- : undefined,
3566
- SizeInBytes: __expectLong(output.SizeInBytes),
3567
- StartedAt:
3568
- output.StartedAt !== undefined && output.StartedAt !== null
3569
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3570
- : undefined,
3571
- Status: __expectString(output.Status),
3572
- TrainingDataSourceId: __expectString(output.TrainingDataSourceId),
3573
- TrainingParameters:
3574
- output.TrainingParameters !== undefined && output.TrainingParameters !== null
3575
- ? deserializeAws_json1_1TrainingParameters(output.TrainingParameters, context)
3576
- : undefined,
3577
- } as any;
3578
- };
3579
-
3580
- const deserializeAws_json1_1IdempotentParameterMismatchException = (
3581
- output: any,
3582
- context: __SerdeContext
3583
- ): IdempotentParameterMismatchException => {
3584
- return {
3585
- code: __expectInt32(output.code),
3586
- message: __expectString(output.message),
3587
- } as any;
3588
- };
3589
-
3590
- const deserializeAws_json1_1InternalServerException = (
3591
- output: any,
3592
- context: __SerdeContext
3593
- ): InternalServerException => {
3594
- return {
3595
- code: __expectInt32(output.code),
3596
- message: __expectString(output.message),
3597
- } as any;
3598
- };
3599
-
3600
- const deserializeAws_json1_1InvalidInputException = (output: any, context: __SerdeContext): InvalidInputException => {
3601
- return {
3602
- code: __expectInt32(output.code),
3603
- message: __expectString(output.message),
3604
- } as any;
3605
- };
3606
-
3607
- const deserializeAws_json1_1InvalidTagException = (output: any, context: __SerdeContext): InvalidTagException => {
3608
- return {
3609
- message: __expectString(output.message),
3610
- } as any;
3611
- };
3612
-
3613
- const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => {
3614
- return {
3615
- code: __expectInt32(output.code),
3616
- message: __expectString(output.message),
3617
- } as any;
3618
- };
3619
-
3620
- const deserializeAws_json1_1MLModel = (output: any, context: __SerdeContext): MLModel => {
3621
- return {
3622
- Algorithm: __expectString(output.Algorithm),
3623
- ComputeTime: __expectLong(output.ComputeTime),
3624
- CreatedAt:
3625
- output.CreatedAt !== undefined && output.CreatedAt !== null
3626
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3627
- : undefined,
3628
- CreatedByIamUser: __expectString(output.CreatedByIamUser),
3629
- EndpointInfo:
3630
- output.EndpointInfo !== undefined && output.EndpointInfo !== null
3631
- ? deserializeAws_json1_1RealtimeEndpointInfo(output.EndpointInfo, context)
3632
- : undefined,
3633
- FinishedAt:
3634
- output.FinishedAt !== undefined && output.FinishedAt !== null
3635
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.FinishedAt)))
3636
- : undefined,
3637
- InputDataLocationS3: __expectString(output.InputDataLocationS3),
3638
- LastUpdatedAt:
3639
- output.LastUpdatedAt !== undefined && output.LastUpdatedAt !== null
3640
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedAt)))
3641
- : undefined,
3642
- MLModelId: __expectString(output.MLModelId),
3643
- MLModelType: __expectString(output.MLModelType),
3644
- Message: __expectString(output.Message),
3645
- Name: __expectString(output.Name),
3646
- ScoreThreshold: __limitedParseFloat32(output.ScoreThreshold),
3647
- ScoreThresholdLastUpdatedAt:
3648
- output.ScoreThresholdLastUpdatedAt !== undefined && output.ScoreThresholdLastUpdatedAt !== null
3649
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.ScoreThresholdLastUpdatedAt)))
3650
- : undefined,
3651
- SizeInBytes: __expectLong(output.SizeInBytes),
3652
- StartedAt:
3653
- output.StartedAt !== undefined && output.StartedAt !== null
3654
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.StartedAt)))
3655
- : undefined,
3656
- Status: __expectString(output.Status),
3657
- TrainingDataSourceId: __expectString(output.TrainingDataSourceId),
3658
- TrainingParameters:
3659
- output.TrainingParameters !== undefined && output.TrainingParameters !== null
3660
- ? deserializeAws_json1_1TrainingParameters(output.TrainingParameters, context)
3661
- : undefined,
3662
- } as any;
3663
- };
3664
-
3665
- const deserializeAws_json1_1MLModels = (output: any, context: __SerdeContext): MLModel[] => {
3666
- return (output || [])
3667
- .filter((e: any) => e != null)
3668
- .map((entry: any) => {
3669
- if (entry === null) {
3670
- return null as any;
3671
- }
3672
- return deserializeAws_json1_1MLModel(entry, context);
3673
- });
3674
- };
3675
-
3676
- const deserializeAws_json1_1PerformanceMetrics = (output: any, context: __SerdeContext): PerformanceMetrics => {
3677
- return {
3678
- Properties:
3679
- output.Properties !== undefined && output.Properties !== null
3680
- ? deserializeAws_json1_1PerformanceMetricsProperties(output.Properties, context)
3681
- : undefined,
3682
- } as any;
3683
- };
3684
-
3685
- const deserializeAws_json1_1PerformanceMetricsProperties = (
3686
- output: any,
3687
- context: __SerdeContext
3688
- ): { [key: string]: string } => {
3689
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3690
- if (value === null) {
3691
- return acc;
3692
- }
3693
- return {
3694
- ...acc,
3695
- [key]: __expectString(value) as any,
3696
- };
3697
- }, {});
3698
- };
3699
-
3700
- const deserializeAws_json1_1Prediction = (output: any, context: __SerdeContext): Prediction => {
3701
- return {
3702
- details:
3703
- output.details !== undefined && output.details !== null
3704
- ? deserializeAws_json1_1DetailsMap(output.details, context)
3705
- : undefined,
3706
- predictedLabel: __expectString(output.predictedLabel),
3707
- predictedScores:
3708
- output.predictedScores !== undefined && output.predictedScores !== null
3709
- ? deserializeAws_json1_1ScoreValuePerLabelMap(output.predictedScores, context)
3710
- : undefined,
3711
- predictedValue: __limitedParseFloat32(output.predictedValue),
3712
- } as any;
3713
- };
3714
-
3715
- const deserializeAws_json1_1PredictorNotMountedException = (
3716
- output: any,
3717
- context: __SerdeContext
3718
- ): PredictorNotMountedException => {
3719
- return {
3720
- message: __expectString(output.message),
3721
- } as any;
3722
- };
3723
-
3724
- const deserializeAws_json1_1PredictOutput = (output: any, context: __SerdeContext): PredictOutput => {
3725
- return {
3726
- Prediction:
3727
- output.Prediction !== undefined && output.Prediction !== null
3728
- ? deserializeAws_json1_1Prediction(output.Prediction, context)
3729
- : undefined,
3730
- } as any;
3731
- };
3732
-
3733
- const deserializeAws_json1_1RDSDatabase = (output: any, context: __SerdeContext): RDSDatabase => {
3734
- return {
3735
- DatabaseName: __expectString(output.DatabaseName),
3736
- InstanceIdentifier: __expectString(output.InstanceIdentifier),
3737
- } as any;
3738
- };
3739
-
3740
- const deserializeAws_json1_1RDSMetadata = (output: any, context: __SerdeContext): RDSMetadata => {
3741
- return {
3742
- DataPipelineId: __expectString(output.DataPipelineId),
3743
- Database:
3744
- output.Database !== undefined && output.Database !== null
3745
- ? deserializeAws_json1_1RDSDatabase(output.Database, context)
3746
- : undefined,
3747
- DatabaseUserName: __expectString(output.DatabaseUserName),
3748
- ResourceRole: __expectString(output.ResourceRole),
3749
- SelectSqlQuery: __expectString(output.SelectSqlQuery),
3750
- ServiceRole: __expectString(output.ServiceRole),
3751
- } as any;
3752
- };
3753
-
3754
- const deserializeAws_json1_1RealtimeEndpointInfo = (output: any, context: __SerdeContext): RealtimeEndpointInfo => {
3755
- return {
3756
- CreatedAt:
3757
- output.CreatedAt !== undefined && output.CreatedAt !== null
3758
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedAt)))
3759
- : undefined,
3760
- EndpointStatus: __expectString(output.EndpointStatus),
3761
- EndpointUrl: __expectString(output.EndpointUrl),
3762
- PeakRequestsPerSecond: __expectInt32(output.PeakRequestsPerSecond),
3763
- } as any;
3764
- };
3765
-
3766
- const deserializeAws_json1_1RedshiftDatabase = (output: any, context: __SerdeContext): RedshiftDatabase => {
3767
- return {
3768
- ClusterIdentifier: __expectString(output.ClusterIdentifier),
3769
- DatabaseName: __expectString(output.DatabaseName),
3770
- } as any;
3771
- };
3772
-
3773
- const deserializeAws_json1_1RedshiftMetadata = (output: any, context: __SerdeContext): RedshiftMetadata => {
3774
- return {
3775
- DatabaseUserName: __expectString(output.DatabaseUserName),
3776
- RedshiftDatabase:
3777
- output.RedshiftDatabase !== undefined && output.RedshiftDatabase !== null
3778
- ? deserializeAws_json1_1RedshiftDatabase(output.RedshiftDatabase, context)
3779
- : undefined,
3780
- SelectSqlQuery: __expectString(output.SelectSqlQuery),
3781
- } as any;
3782
- };
3783
-
3784
- const deserializeAws_json1_1ResourceNotFoundException = (
3785
- output: any,
3786
- context: __SerdeContext
3787
- ): ResourceNotFoundException => {
3788
- return {
3789
- code: __expectInt32(output.code),
3790
- message: __expectString(output.message),
3791
- } as any;
3792
- };
3793
-
3794
- const deserializeAws_json1_1ScoreValuePerLabelMap = (
3795
- output: any,
3796
- context: __SerdeContext
3797
- ): { [key: string]: number } => {
3798
- return Object.entries(output).reduce((acc: { [key: string]: number }, [key, value]: [string, any]) => {
3799
- if (value === null) {
3800
- return acc;
3801
- }
3802
- return {
3803
- ...acc,
3804
- [key]: __limitedParseFloat32(value) as any,
3805
- };
3806
- }, {});
3807
- };
3808
-
3809
- const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => {
3810
- return {
3811
- Key: __expectString(output.Key),
3812
- Value: __expectString(output.Value),
3813
- } as any;
3814
- };
3815
-
3816
- const deserializeAws_json1_1TagLimitExceededException = (
3817
- output: any,
3818
- context: __SerdeContext
3819
- ): TagLimitExceededException => {
3820
- return {
3821
- message: __expectString(output.message),
3822
- } as any;
3823
- };
3824
-
3825
- const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => {
3826
- return (output || [])
3827
- .filter((e: any) => e != null)
3828
- .map((entry: any) => {
3829
- if (entry === null) {
3830
- return null as any;
3831
- }
3832
- return deserializeAws_json1_1Tag(entry, context);
3833
- });
3834
- };
3835
-
3836
- const deserializeAws_json1_1TrainingParameters = (output: any, context: __SerdeContext): { [key: string]: string } => {
3837
- return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
3838
- if (value === null) {
3839
- return acc;
3840
- }
3841
- return {
3842
- ...acc,
3843
- [key]: __expectString(value) as any,
3844
- };
3845
- }, {});
3846
- };
3847
-
3848
- const deserializeAws_json1_1UpdateBatchPredictionOutput = (
3849
- output: any,
3850
- context: __SerdeContext
3851
- ): UpdateBatchPredictionOutput => {
3852
- return {
3853
- BatchPredictionId: __expectString(output.BatchPredictionId),
3854
- } as any;
3855
- };
3856
-
3857
- const deserializeAws_json1_1UpdateDataSourceOutput = (output: any, context: __SerdeContext): UpdateDataSourceOutput => {
3858
- return {
3859
- DataSourceId: __expectString(output.DataSourceId),
3860
- } as any;
3861
- };
3862
-
3863
- const deserializeAws_json1_1UpdateEvaluationOutput = (output: any, context: __SerdeContext): UpdateEvaluationOutput => {
3864
- return {
3865
- EvaluationId: __expectString(output.EvaluationId),
3866
- } as any;
3867
- };
3868
-
3869
- const deserializeAws_json1_1UpdateMLModelOutput = (output: any, context: __SerdeContext): UpdateMLModelOutput => {
3870
- return {
3871
- MLModelId: __expectString(output.MLModelId),
3872
- } as any;
3873
- };
3874
-
3875
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
3876
- httpStatusCode: output.statusCode,
3877
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
3878
- extendedRequestId: output.headers["x-amz-id-2"],
3879
- cfId: output.headers["x-amz-cf-id"],
3880
- });
3881
-
3882
- // Collect low-level response body stream to Uint8Array.
3883
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
3884
- if (streamBody instanceof Uint8Array) {
3885
- return Promise.resolve(streamBody);
3886
- }
3887
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
3888
- };
3889
-
3890
- // Encode Uint8Array data into string with utf-8.
3891
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
3892
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
3893
-
3894
- const buildHttpRpcRequest = async (
3895
- context: __SerdeContext,
3896
- headers: __HeaderBag,
3897
- path: string,
3898
- resolvedHostname: string | undefined,
3899
- body: any
3900
- ): Promise<__HttpRequest> => {
3901
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
3902
- const contents: any = {
3903
- protocol,
3904
- hostname,
3905
- port,
3906
- method: "POST",
3907
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
3908
- headers,
3909
- };
3910
- if (resolvedHostname !== undefined) {
3911
- contents.hostname = resolvedHostname;
3912
- }
3913
- if (body !== undefined) {
3914
- contents.body = body;
3915
- }
3916
- return new __HttpRequest(contents);
3917
- };
3918
-
3919
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
3920
- collectBodyString(streamBody, context).then((encoded) => {
3921
- if (encoded.length) {
3922
- return JSON.parse(encoded);
3923
- }
3924
- return {};
3925
- });
3926
-
3927
- /**
3928
- * Load an error code for the aws.rest-json-1.1 protocol.
3929
- */
3930
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
3931
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
3932
-
3933
- const sanitizeErrorCode = (rawValue: string): string => {
3934
- let cleanValue = rawValue;
3935
- if (cleanValue.indexOf(":") >= 0) {
3936
- cleanValue = cleanValue.split(":")[0];
3937
- }
3938
- if (cleanValue.indexOf("#") >= 0) {
3939
- cleanValue = cleanValue.split("#")[1];
3940
- }
3941
- return cleanValue;
3942
- };
3943
-
3944
- const headerKey = findKey(output.headers, "x-amzn-errortype");
3945
- if (headerKey !== undefined) {
3946
- return sanitizeErrorCode(output.headers[headerKey]);
3947
- }
3948
-
3949
- if (data.code !== undefined) {
3950
- return sanitizeErrorCode(data.code);
3951
- }
3952
-
3953
- if (data["__type"] !== undefined) {
3954
- return sanitizeErrorCode(data["__type"]);
3955
- }
3956
-
3957
- return "";
3958
- };